.net

Can a wpf application be deployed without compiling the xaml?

Is it possible to deploy a WPF windows application in such a way that the xaml files can be manipulated at run-time? If possible, I would imagine this would work similar to an asp.net application that can deploy the .aspx pages as content, which are then compiled just-in-time at run-time. I'd like to allow the simple layout of a screen...

How to change diacritic characters to non-diacritic ones

Hello, I've found a answer how to remove diacritic characters on stackoverflow, but could you please tell me if it is possible to change diacritic characters to non-diacritic ones? Oh.. and I think about .NET (or other if not possible) kind regards ...

What is the .NET equivalent of CreateEnhMetaFile and PlayEnhMetaFile?

I'm porting some C++ code to VB.NET which creates a print job consisting of several pages. Every page has a template of graphical objects (text, lines, curves, etc) which stays the same on each page, and overlaid on top of that is the different data for each page. The template is created at the start of the print job as an in-memory met...

Server based reuse - DLL, GAC, or REST?

We have a piece of functionality that is used by several different applications (clients) on the same server. It can best be modeled as a service, has a backend database, and there will only be one version of the functionality and the database in use at any one time. Until now we have employed simple DLL-reuse, with the functionality, i...

Strongly Typed Controls in .NET

I am working on a Windows Forms app for quite some time now, and I really find myself doing more typecasts in the GUI code than I ever did in my underlying business code. What I mean becomes apparent if you watch the ComboBox control that accepts some vague "object" as it's item. Then you go off and may display some DisplayMember and a...

Common Regular Expressions

Is there a site online that lists common regular expressions or has a utility to help you create one based on sample text? Thanks! ...

Pass texture using pointer across process

It's hard to put this into the title, so let me explain. I have an application that uses Direct3D to display some mesh and directshow(vmr9 + allocator) to play some video, and then send the video frame as texture to the Direct3D portion to be applied onto the mesh. The application needs to run 24/7. At least it's allowed to be restarted...

How do I add multiple namespaces to the root element with XmlDocument?

I need to create an XmlDocument with a root element containing multiple namespaces. Am using C# 2.0 or 3.0 Here is my code: XmlDocument doc = new XmlDocument(); XmlElement root = doc.CreateElement("JOBS", "http://www.example.com"); doc.AppendChild(root); XmlElement job = doc.CreateElement("JOB", "http://www.example.com"); root.Append...

How to ignore spelling in a run in WPF RichTextBox

I'm using the built-in SpellCheck for the WPF RichTextBox and would like to ignore spelling errors for some text runs (validated paths). What is the best way of doing this? ...

How can I refer to a control within its event? (without using it's name)

Is there a way in .net to refer to a control generically (so that if the control name changes, etc.) you don't have a problem. I.e., the object level version of the "me" keyword. So, I'd like to use something generic instead of RadioButton1 in the example below. Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, _ ...

Since .NET has a garbage collector why do we need finalizers/destructors/dispose-pattern?

If I understand correctly the .net runtime will always clean up after me. So if I create new objects and I stop referencing them in my code, the runtime will clean up those objects and free the memory they occupied. Since this is the case why then do some objects need to have a destructor or dispose method? Won’t the runtime clean up af...

Reporting Services 403 error

Hi all, I've recently updated an application to the 3.5 framework (from 2.0). The app links to Reporting Services (2005) remotely via an URL. This all works fine locally but when deployed to the dev server (win 2003) I'm getting a 403 error when attempting to call the report server. "You are not authorized to view this page ... HTTP ...

Class usage in ORM based projects

This question is about "best use" scenarios in projects with ORMs like NHibernate, Subsonic, Linq2SQL, etc... All of these tools generate basic entity classes, some with attributes, others without. Do people use these classes as their business classes? Or is there wholesale copying of data from ORM generated classes to manually create...

How does one install .net dlls without .NET SDK or Visual Studio?

I need to deploy a few .net dlls. They need to be put in the GAC and the required entries need to be in the registry. On my machine I have both the SDK and Visual Studio running, so currently I am utilizing .net sdk tools like gacutil and regasm. However, when I need to install these dlls on a customer machine, how should I go about it. ...

Datagridview - check if the last column is fully displayed

I was wondering if there was a way to determine if the last column is fully displayed. I know there is a Displayed property on a column, but that property is true if the column is either partially or fully displayed. I only want it if the column is fully displayed. ...

Should I return 'null' or an empty array?

Suppose you have a method that should create and return an array of some sort. What if the array doesn't get populated. Do you return an empty array or null/nothing? ...

.NET WinForms 2.0: How to have a shared imagelist?

i want have to have a single imageList used by multiple forms in a project. That is to say multiple controls use the same image list. Note: Ideally multiple projects in a single solution will use the same image list - but i don't want to ask too much of Microsoft at once. Ideally multiple projects in multiple solutions will use the same...

Are singleton classes thread-safe in IIS?

I have an ASP.NET webpage running under IIS that uses a common assembly that contains a singleton class. Should I implement a locking mechanism on the singleton to make it thread-safe? Or, will any connection to the webserver use the same instance of the singleton? Hopefully I'm asking this coherently. ...

What is the best way to check for reparse point in .net (c#)?

My function is pretty much a standard search function... I've included it below. In the function I have 1 line of code responsible for weeding out Repart NTFS points. if (attributes.ToString().IndexOf("ReparsePoint") == -1) The problem is now I am getting an error Access to the path 'c:\System Volume Information' is denied. I debu...

what wrong with this linq to sql

i get this error {"Method 'System.DateTime ConvertTimeFromUtc(System.DateTime, System.TimeZoneInfo)' has no supported translation to SQL."} when i try to execute this linq to sql var query = from p in db.Posts let categories = GetCategoriesByPostId(p.PostId) let comments = GetCommentsByPostId(p.PostId) ...