.net

Resharper warns about using a virtual function in a constructor, but unlike C++ it is not an error

Possible Duplicate: Virtual member call in a constructor First of all, why isn't it an error to call a virtual function inside a ctor in C#? Second of all, if it is allowed, why does Resharper still warn about it? ...

use stlport in managed c++

Is it possible to use stlport within a Managed C++ DLL? In my project i get several 'unresolved token'-errors from the linker for stlport stuff. e.g.: 1>moc_ParentWidget.obj : error LNK2020: unresolved token (0A000819) "public: __thiscall stlp_std::allocator<unsigned short>::~allocator<unsigned short>(void)" (??1?$allocator@G@stlp_std@...

Can't invoke dynamic method from generic class.

I'm trying to work with two contexts in a generic repository and I should invoke the static method GetObjectContext() with dynamic type like ObjectContextManager<DynamicType>.GetObjectContext(). private DataContext GetDataContext() { Type type = GetContainerType(); Type paoloGenericClassType = typeof(ObjectContextMan...

BadImageFormatException with .NET ILMerged DLL in Windows 7 64

I'm developing in Windows 7 64-bit with Visual Studio 2008. I have a collection of class libraries that I merge into a single DLL using ILMerge. When I try to use this merged DLL, however, I get [BadImageFormatException: Could not load file or assembly 'MyMergedDll' or one of its dependencies. An attempt was made to load a program ...

Serialize/deserialize objects - order of fields matters?

Is it possible that DataContractSerializer wrongly deserializes object if fields are not in the "correct" (whatever that means) order? My classes that I serialize/deserialize do not have order attributes placed on fields/properties. Yet one of my fields always get deserialized as null although it has values, it actually contains a list o...

WPF FlowDocumentScrollViewer Selection.Select Not Working

I am trying to select text in my FlowDocumentScrollViewer. I am able to find the TextPointer start position and end position. So I have 2 TextPointers... TextPointer startPos; TextPointer endPos; Using these 2 TextPointers I am trying to select text in my FlowDocumentScrollViewer. I am doing it like this... flowDocumentScrollVie...

Creating an "over time" algorithm

What I have is a LineItem object and a collection called LineItems that holds LineItem objects. My LineItem objects have a property called ItemDate (DateTime data type) and another property called ItemAmount (decimal data type) and another property called ItemCategory (integer data type). What I am trying to do is write a function in my...

access public calendars from outlook in asp .net

Hi, We need to design one ASP.NET (2.0 or 3.5) page where outlook public calendars to which user has access will be displayed. Exchange server version is 2003. Was such kind of development done in past? Do we have any material/documents on it? We need inputs on, 1. How to get public calendars (shared calendars) to which user has acces...

Queue hold reference or object value?

In C#, the following "containers" hold reference or object itself for reference types? Queue Stack Array List Vector For example if I do the following: Queue<MyItem> item = new Queue<MyItem>(100); MyItem mit = new MyItem(); item.Enqueue(mit); The reference of the mit is copied to item or the mit object itself has been moved to item...

RadGrid Doubleclick

I would like to fire off the server side selectedindexchanged method of a radgrid on doubleclick and not on click. Is it possible to do this??? <telerik:RadGrid ID="RadGridCashier" runat="server" AllowMultiRowSelection="False" DataSourceID="SqlDataSourceCashier" Skin="WebBlue" AutoGenerateColumns="false" AllowFilteringByColumn="true" ...

Compiling C code for .NET

How can I compile C code for use in .NET? There is a game that written in C; how can I convert it to .Net code or use some parts of it? ...

Is a solution with hundreds of projects dangerous or just unwieldy?

our main client solution has 111 projects. When I first started on this team I was surprised (and alarmed) that we had so many projects and recommended consolidating the tiers into less but larger assemblies. our structure has models (DTOs) with nhibernate mapping files, and WCF services tier with data controller calls, some framework ...

Would simple class instantiation ever fail in C#?

I saw some code written by another developer that looks something like this: var stringBuilder = new StringBuilder(); if(stringBuilder == null) { // Log memory allocation error // ... return; } (It is ALL over the place in the code ) Question 1: Would that error logging code even get called? If there was no memory, woul...

Image and TextBlock in WPF RibbonApplicationMenu

Hi, I need to put an image and text to WPF Ribbon Menu. I have tried few things but all I can get are empty buttons in Ribbon Menu. I am using .NET framework 3.5. Part of my not working code is here: <r:Ribbon.ApplicationMenu> <r:RibbonApplicationMenu Command="{StaticResource ApplicationMenuCommand}"> <r:RibbonA...

Monitoring and reporting on Performance of .NET components

I am looking for a solution for monitoring a number of .NET components for a system where performance is critical. I have been looking at performance counters, which generally provide the information needed. The end result is that I would like a number of counters written to a database to be able to report upon. I would like to hold...

Change UI culture programmatically in WinCE 5 / .NET CF 2

In a standard .NET framework application (not CF), I can change the user UI culture with: System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture("es-AR"); System.Threading.Thread.CurrentThread.CurrentUICulture = System.Threading.Thread.CurrentThread.CurrentCulture; but the .NET CF...

Embed a Console Window inside a WPF Window

Is it possible to embed a console window inside a WPF window? As a little background, at first I tried to implement a console window from scratch in WPF, which was successful except for one huge problem -- its extremely slow. See the question here: http://stackoverflow.com/questions/3219819/vt100-terminal-emulation-in-windows-wpf-or-sil...

Exchange Management Powershell with .Net

I get this error with the following code: System.Management.Automation.CommandNotFoundException: The term new-storagegroup.... RunspaceConfiguration rsConfig = RunspaceConfiguration.Create(); PSSnapInException snapInException = null; PSSnapInInfo info = rsConfig.AddPSSnapIn("Microsoft.Exchange.Management.PowerSh...

Why do I need MVVM for WPF/Silverlight, is there any good reason one cant use MVC?

Maybe I'm crazy, but I get MVC. It makes sense. MVVM seems like a way to make MVC harder, am I wrong (if so, why?)? ...

.NET on linux, ~/folder is wrong?

In .NET i am writing Directory.CreateDirectory(textBox4.Text); textBox4.Text is ~/myfolder. What i get is a folder in the current working directory called ~ with myfolder in it. How do i have CreateDirectory create myfolder at the user's home? ...