.net

How do I access a .NET GUI application through a Web Service?

Howdy, I've been searching for a while for an answer to my problem but so far have found no reliable links. What I'm trying to do is this: I've built a Windows .NET GUI application. I'd like to be able to access the functionality of the Form Controls through a Web Service. Are there any good links on how to do this? Thanks for your hel...

.NET Resize Event: Get old size?

I've added a resize event to one of my widgets, which looks like this: void glControl_Resize(object sender, EventArgs e) { Is there a way I can get the old size of the widget (before resizing)? Maybe I can cast e to something that will give me more info? Or should I just save it during that event? ...

AutoMapper AssertConfiguration at compile time?

Is there any way to validate mappings at compile time? For example, I have an entity with many child entities. If I forgot to add a CreateMap for one of the childen when I try to map ParentX to ParentY the mapping will fail. I can't think of a way to validate this during compile but I'd love to find a way. ...

Using .NET 3.5 classes in .NET 2.0

Hello all, I would like to be able to use .NET 3.5 types in an application based on .NET 2.0. Basically we don't have deployed .NET 3.5 libraries in desktops but we need to use some classes from there. Any ideas how this is possible ? Thanks, Marios ...

Any DAL generators that will work on .NET 1.1 with SQL CE 3.1?

Are there any DAL generators or ORMs that will work on .NET 1.1 with SQL CE 3.1? This is only for a short lived project, so cost would be an issue ...

Sorting by Random.Next()

In this question one of the suggestions is to sort a list by Random.Next(). I assume (maybe incorrectly) he's suggesting this public static IEnumerable<T> RandomSort<T>(this IEnumerable<T> items) { Random r = new Random(); var a = items.ToArray(); Array.Sort(a, (t1, t2) => (r.Next()%2==0)?-1 : 1); ...

How to use/configure Unity Container IOC in my situation

Hi, I have some trouble implementing the Unity IOC into my project reading from config file. Here is what I have 1) ClasslibraryA 2) ClasslibraryB that references ClasslibraryA 3) Winforms App that references ClasslibraryB Note: SomeOther app will reference ClassLibraryA, eg. a web service. ClasslibraryA will have to be configured...

JMX or NetMX real-world examples.

Hi I'm currently researching NetMX (and JMX by association) for a systems monitoring project. Does anyone have any real world examples of either of these libraries? The only examples I can find are manipulating a counter via JConsole which isn't helping me get a bigger picture. Thanks for any help... Jon ...

Hyphen in method name, is it possible in any .NET language ?

I need to support a method named 'send-request' as an extension function to be used in an XSLT transformation. This is provided by an extension object on XslCompiledTransform. The cool thing about extension objects vs. <msxsl:script> is, well, that I don't have to use <msxsl:script>, you just declare the namespace and call the function. ...

.Net C# return value to ui prior to 'unit of work' completion. - Noob

Hi, bit of noob question regarding .Net and C#. I have a function that registers a new user. Via rpc some values are sent from the ui to a register function and a user record is put in the database. Then a value representing success is sent back to the ui. Now, on the same function call I want to send some emails etc to the new user. ...

Why is there no System.ClassNotFoundException in .Net?

When trying to locate a Type (typically a class) at runtime, if the name passed to the Type.GetType(string typeName, bool throwOnError = True) overload cannot be located, the exception raised is TypeLoadException. I understand that the thinking behind this is that the CLR believes that the problem is that we have not (yet) loaded t...

Role-management provider using web.config?

I'm building a tiny web application with a simple user autentication scheme. I register the users in web.config, like this: <authentication mode="Forms"> <forms loginUrl="~/login.aspx" defaultUrl="default.aspx" ...> <credentials passwordFormat="SHA1"> <user name="UserA" password="B60D121B438A380C343D5EC3C2037564B82FFEF3"/> ...

Fast HashCode of a Complex Object Graph

Hi, I have a pretty complex object and I need to get uniqueness of these objects. One solution can be done by overriding GetHashCode(). I have implemented a code noted below: public override int GetHashCode() { return this._complexObject1.GetHashCode() ^ this._complexObject2.GetHashCode() ^ this._complexObject...

Fast way to draw lines using different Color using GDI+?

I have an dynamic List of Point, new Point can be added at any time. I want to draw lines to connect them using different color. Color is based on the index of those points. Here is the code: private List<Point> _points; private static Pen pen1 = new Pen(Color.Red, 10); private static Pen pen2 = new Pen(Color.Yellow, 10); ...

What is most CPU efficient method to make the worker threads wait for tasks?

In my current C#/NET 3.5 application, I have a task queue (thread safe) and I have 5 worker threads that has to constantly look for tasks in the queue. If a task is available, any one worker will dequeue the task and take required action. My worker thread class is as follows: public class WorkerThread { //ConcurrentQueue is my impl...

No Security header in message but required by policy

Hi I encounter this issue. Anyone got any idea? How can i pass in the security header in visual studio 2008 project? Thanks in advance! The security header portion in the WSDL file : <s0:Policy s1:Id="Auth.xml"> <wssp:Identity xmlns:wssp="http://www.bea.com/wls90/security/policy"&gt; <wssp:SupportedTokens> <wssp:Se...

Authenticating WCF DataServices

Hi, I am trying to authenticate calls to a WCF DataServices service via Silverlight. Essentially, when a user logs in they get a special hash which should be embedded in the headers of every request to the WCF DataServices. Currently use this as a check via a QueryInterceptor method eg [QueryInterceptor("Orders")] public Expr...

Resume in upload file control..

I did read the following posts: http://stackoverflow.com/questions/1048330/pause-resume-upload-in-c http://stackoverflow.com/questions/1830130/resume-uploads-using-http But didn't got a perfect solution to my problem. In the above posts, one of the answers says "client and server needs to identify the file some how i suggest the us...

In C#, is there a kind of a SortedList<double> that allows fast querying (with LINQ) for the nearest value?

Hi Stackers, I am looking for a structure that holds a sorted set of double values. I want to query this set to find the closest value to a specified reference value. I have looked at the SortedList<double, double>, and it does quite well for me. However, since I do not need explicit key/value pairs. this seems to be overkill to me, an...

Web History and ASP.NET MVC with AJAX

Having a site where you can search with the below snippet, how do you store the history for each search so that a user can press the back-button to get to previous search results and have a populated text-box with the searched values? <% using(Ajax.BeginForm("TestSearch", new AjaxOptions { UpdateTargetId = "details" })) { %> ...