.net

OverrideDefaultStyle in WPF NavigationWindow?

When creating a Navigation Application in WPF, How can I create a custom style and layout for the window? Is this possible? Say for instance, adding a panel along the side of the window with links to all the pages in the application. When I try add controls/content to the NavigationWindow, I get the following message: "The type 'Navigat...

What's the best ORM for DDD?

I'd prefer a commercial solution. So not NHibernate. Now i'm playing with LLBLGen pro and i like it but it doesn't seem be DDD friendly. ...

How to serialize a string holding nothing but "\r\n" to XML correctly?

We're using DataContractSerializer to serialize our data to XML. Recently we found a bug with how the string "\r\n" gets saved and read back - it was turned into just "\n". Apparently, what causes this is using an XmlWriter with Indent = true set: // public class Test { public string Line; } var serializer = new DataContractSerializer(...

How I can Connect to Oracle in ADO.NET Entity Data Model.

Somebody advice me to use Entity Framework here when I asked this question: what is better to build Data layer, Strongly Typed DataSets or Classes So I read a lot of articles about Entity Framework, I understood that Entity Framework designed to be data-source independent and it will support most of the popular DBMSs. I Have vs2008 wit...

WPF DATAGRID - How to binding two tables fields in xaml

Please help. I have two relational tables which are Employee and EmployeePosition. I am trying to bind two tables into one datagrid on the xmal file without using LINQ to join those two table into one collection from the c# code behind. HOW CAN I DO IT? The sample code and table below Employee EmployeeID FirstName LastName PositionID ...

Encountering self recursive assembly references in the .NET framework.

I was writing some C# code recursively walking the referenced assemblies of a base assembly, building up a directed acyclic graph of these references to do a topological sort. I'm doing this by means of the GetReferencedAssemblies() method on the Assembly class. While testing the code, I found - to my surprise - that some assemblies in ...

redirect to another page from Silverlight

Hello everyone, In side a Silverlight Page, I want to redirect to another aspx page in the same web site and using POST method to send some additional header information. Any ideas how to implement this? Any samples are appreciated. :-) I am using VSTS2008 + .Net 3.5 + Silverlight 2.0 + C#. thanks in advance, George ...

Any .NET IDE running on Windows Mobile?

Is there any .NET IDE running on windows Mobile 6.x? The IDE does not have to support mobile development, nor debugging or something else. What I'm looking for is kind of an "IntelliSense-capable editor running on Windows Mobile" that lets me write code on my mobile phone wihtout having to power up my laptop. ...

How do I use a shape to define a clipping region?

I am still simulating a radar (or attempting to) and through trial and error managed to draw a pie on top of my picturebox's background the more or less covers the target area I wish to draw to. Now I'm trying to make that area my clipping region. How do I achieve this? I haven't come across anything that explains this clearly. I have th...

C# int to byte[]

If I need to convert an int to byte[] I could use Bitconvert.GetBytes(). But if I should follow this: An XDR signed integer is a 32-bit datum that encodes an integer in the range [-2147483648,2147483647]. The integer is represented in two's complement notation. The most and least significant bytes are 0 and 3, resp...

Where to get well designed and coded applications written in C# to learn from them?

I got into log4net code and Nunit. Both of them gave me something to think about and taught me something new. What other aps do you know, with source code open that worth reading their code? Also, what is the best way to get into the code, sure if you cant ask its creator a question? A little addition, I`d like to have sources read by y...

Application Level shortcut keys in WPF

Hi, In WPF application I am currently trying to bind a Command to launch a calculator Tool form any where in the application using shortcut keys, I have created a command but not getting how to map commands and shortcut keys to create universal shortcut keys in my application. Thanks in advance. ...

.Net Application-wide variables

I'm fairly new to .Net... I have several queries which will execute when the application loads. I want these queries to store the data in an object (a dataset?) which is accessible throughout the application. Should I be using a singleton class? How can a User Control within my application reference public variables in the main applicati...

How do I display an image within a region defined in a Picturebox?

As a follow on to my previous question I have gotten my region but spent the last two hours trying to display tiny pictures wihing that region alone; with the end goal being to be able to arbitarily display any number of images I choose. so far this is my code: void OnPaintRadar(Object sender, PaintEventArgs e) { Graphics g = e....

Why C# doesn't allow inheritance of return type when implementing an Interface

Is there any rational reason why the code below is not legal in C#? class X: IA, IB { public X test() // Compliation Error, saying that X is not IB { return this; } } interface IA { IB test(); } interface IB { }; ...

A good, recent article on the comparison between Java EE and .NET?

I've started looking into a few larger server-app frameworks that would be able to support desktop client interfaces as well as web interfaces, and have really zero'd down on the two obvious ones: J2EE and .NET. From a language standpoint, feature standpoint, portability standpoint, etc...I am pretty comfortable with my understanding of ...

Setting dllimport programatically in c#

I am using DllImport in my solution. My problem is that I have two versions of the same DLL one built for 32 bit and another for 64 bit. They both expose the same functions with identical names and identical signatures. My problem is that I have to use two static methods which expose these and then at run time use IntPtr size to determi...

Which namespace does a factory class belong?

I have a factory class, DocumentLoaderFactory, which simply returns an instance that implements an interface, IDocumentLoader. All implementation resides under the following namespace Skim.Ssms.AddIn.ActiveFileExplorer.Loader But what I am wondering is, which namespace does DocumentLoaderFactory belong? I have placed the factory c...

Private Accessor don't build when using MSBuild

My build server uses MSBuild to build my application. Our unit tests require access to some private members for testing, so we use the built in private accessors. Visual Studio has no problem with it, but when we push our code to the build server we get the error: MyTest.cs (96,13): errorCS0246: The type or namespace name 'My_Acc...

How can I calculate the logical width of WPF visual element?

I need to calculate the logical width of a visual element, before it gets rendered by WPF. For simplicity of explanation, I'll say that this visual element will likely be a Polygon object. It could be something else, but a Polygon makes it easy to visualize. So the XAML might look something like this: <Window x:Class="MyCLRNames...