.net

Is there such a thing as a MessageQueueWatcher in .NET?

I currently use a System.IO.FileSystemWatcher as part of a "roll your own" message queue system (passing XML "messages" between servers using SOAP web services, writing the "messages" to a specific folder on disk where a Windows Service running a FileSystemWatcher pounces on the new "messages" as they arrive and do something productive w...

How can I add logic to an existing dependency-property callback?

I'm trying to add a PropertyChangedCallback to UIElement.RenderTransformOriginProperty. An exception is thrown when I try to override the PropertyMetadata. I have searched MSDN and Google, and all I have been able to come up with is this. DependencyPropertyDescriptor.AddValueChanged is suggested at some point in that post, but that wo...

Fastest way to generate bitmap from polygons in .NET

After reading this blog, I want to try writing a similar program myself. One of the subtasks is to have a source set of polygons, and use these polygons to generate the bitmap that is going to be compared with the target image. In .NET 2005 the obvious method is to use GDI+. Simply create a bitmap, get a Graphics object that interfaces...

Get Calling function name from Called function in C#

Possible Duplicate: How can I find the method that called the current method? How can I get the calling function name from the called function in c#? ...

How to see native code bytes from .NETCF JIT compiler on

Can anyone suggest a way (supported or unsupported) of getting a look at native code bytes compiled by the NETCF JIT compiler. I happen to be on WinCE6.0 on an ARM platform. I'm guessing that this can be done with a native debugger, but I'm trying to figure out (essentially) how I would get my bearings to know what I'm looking at. Per...

Validate Property With Attribute (Alternative to Enterprise Lib Validation Block)

Are there any alternative to Enterprise Library Validation Block? I want to be able to add validation attributes to my properties. Thanks ...

Strange date calculation and test.

Can anyone please explain what the following code checks for? I can make no sense of it, but don't want to leave it out of my rewrite merely out of ignorance. The complete code calculates a variance between now and detailLastDate, i.e. Days(detailLastDate) - Days(Now). For this case, detailLastDate has the value '090722': int num3 = ...

retrieve webservice containing page control in C#

is there a way to reference the page control in a webservice? something like this: [WebService(Namespace = "http://test.org/")] public class Search : System.Web.Services.WebService { public Search() { Page.Controls.Add(new Control()); // can I get a reference to Page? } } ...

Non-scaling Pen in GDI+

I need to create a pen which draws with a width of 0.5 mm regardless of the scale of the graphics transformation matrix. Here is what I am doing: Note: The sample code is C++/CLI but answers using C# are welcome. // assume that g is a Graphics object int dpi = g->DpiX; float dotsPerHalfInch = dpi * 0.5; // to extract scale factor from...

A look into serialPort

You wrote at: Opened SerialPort crashes C# application "A look into the .NET Framework source code helped a lot. But I think the thrown ObjectDisposedException should be caught by the SerialPort, not by the user." I'd like to take a look on source code for serialPort. How can I do it? ...

Getting Message by priority from MSMQ

hi. i am sending messages in MSMQ by setting its priority. using C# can i get the message from MSMQ having high priority first? just like we get in Priority Queue. and one thing more.. suppose there are three priority level 0 - high 1- medium 2 - low the sequence in queue is 2001122221111100 now if i send message with high prior...

How to design the UI for settings according to different options in C# WinForm?

This is a .NET winform application question. I come to this design from time to time. A simple form. On top of the form you have a list of options to select. According to different option chosen, the body of the form displays a unique panel of setting detail. How to design this UI in Visual Studio neatly? I have two ideas. First idea i...

.NET C# (WinForms) application not receiving event when clicked on taskbar

Hi, I have a .NET application (C#, WinForms) application running on Windows XP. If i minimize my application, and have several other windows minimized to the taskbar, and click on my application (in the taskbar) then often i see the taskbar "icon" blink but my application fails to "restore" its window. Any suggestions to what might caus...

How do I hide the titlebar and lock the position on an exe (unmanaged code) that I have moved inside a panel in a c# form?

I have to "embed" an .exe within a panel in a .net windows form. I am doing this using user32.dll SetParent to set the launched app's parent to the forms Panel handle. Once this is done, I would like to Hide the title bar of the .exe lock the exe into the panel (maximized) so it cannot be moved or closed. Suggestions? ...

DeleteFile of an EXE immediately after Process.WaitForExit fails

I do the following: Copy an executable to C:\temp\x.exe Start the executable with System.Diagnostics.Process.Start and then wait for the process to exit, synchronously, by calling WaitForExit on the Process object returned by Start. Delete the executable C:\temp\x.exe On some machines, this works great, but on others, the call to Del...

How can I access the overridden properties of a .NET API object in IronPython?

I am using IronPython to create a shell for a plugin API to Autodesk Revit Architecture 2010 to speed up learning their API. One of the classes the API provides is Autodesk.Revit.Elements.Room, derived from Autodesk.Revit.Element. I would really love to read Room.Name, but this goes Boom! on me as Room has overridden Elements Name prop...

Variable of an object getting changed when other object is modified

I encountered a behaviour I can´t quite understand when I was trying to populate a GridView. Consider the following code: DataTable table = GetStockMovement((int)ViewState[MOVEMENT_ID], false); MovedProducts = from DataRow row in table.Rows select new Product() { Product...

How visual studio ide registers a plug-in

I wonder how the VS2008 IDE registers a plugin. A db file, xml etc. since I know that once I call devenv.exe with the parameter to my plugin dll, the next time I launch VS IDE, my plug in is still there. Any leads on where it registers my dll? I can also make use of a best practice for such development pattern. I think of developing a b...

Can anyone recommend an advanced .NET TabControl with native look and feel?

I'd like to get a .NET TabControl with a few extra features, such as: Close button for tabs; Context menus for tabs (with close this, close all, close all but this) Tab re-arranging; Tab scrolling/resizing when there are too many tabs; I'd also like for the control to maintain the native OS look and feel. And, naturally, freeware win...

Struggling with runtime setup of some castle components

My question (I think) can be simply described by this question: How can I get a "Manager" class to have a list of all possible concrete implementations of a specific interface that have been registered as components injected into it so it can iterate through them? (And because of annoying architecture reasons I can't use the app.config ...