.net

How to log user operations for a asp.net application ?

How can we log user operations for a asp.net application. Further what is the approach for saving the log data ? Kindly guide. ...

How to use autocomplete in a datagrid?

I have a Datagrid with a DataGridTextColumn. This is populated by using databinding, and can be edited by users. Is it possible to add autocomplete to the DataGridTextColumn ? ...

Entity Framework 4.0: is it worthy now?

I've read a lot complains about Entity Framework in .NET 3.5 SP1, especially about its ineffectively generated SQL. Those complains had prevented me from studying Entity Framework. Now Entity Framework 4.0 has come out, which provide a lot of promises. I wonder if it's really a good ORM now, or still not yet? Is it worth to learn and us...

.NET WPF Window FadeIn and FadeOut Animation

Hi All Below is code snippets of a window FadeIn and FadeOut animation: // Create the fade in storyboard fadeInStoryboard = new Storyboard(); fadeInStoryboard.Completed += new EventHandler(fadeInStoryboard_Completed); DoubleAnimation fadeInAnimation = new DoubleAnimation(0.0, 1.0, new Duration(TimeSpan.FromSeconds(0.30))); Storyboard.S...

C# WebClient crashes my application!

Hi there, i'm trying to run this code: remoteProducts.ForEach(delegate(RemoteProduct p) { this.toolStripStatus.Text = "Downloading product: " + this.progress.Value + "/" + remoteProducts.Count; try { prodLocalDao.addProduct(p.Id, p.Categ...

Xbap arrow keys jump to the address bar

In an xbap application, when navigating listboxes, comboboxes etc with the arrowkeys, reaching the end of the list will result in focus jumping to the addressbar of the browser. Very annoying.. Any ideas on how to avoid this behaviour? ...

MVVM and DataGrid View re-use as embedded controls within otherviews with subset data.

Okay here's the situation. Net 4 WPF NO Silverlight. I have several Views that present a datagrid showing the contents of some observable collections e.g. ObservableCollection<ClassAViewModel> sourceA; ObservableCollection<ClassBViewModel> sourceB; ObservableCollection<ClassCViewModel> sourceC; The collections are populated by a call...

.NET - ColorAnimation doesn't work

I created a ColorAnimation for a SpotLight-object, but it doesn't seem to work. What am I doing wrong? ColorAnimation mouseEnterColorAnimation = new ColorAnimation(); mouseEnterColorAnimation.To = Colors.Red; mouseEnterColorAnimation.Duration = TimeSpan.FromSeconds(5); Storyboard.SetTargetName(mouseEnterColorAnimation, "MyAnimatedBrush"...

How to add a UsernameToken to the RequestSoapContext property of web service proxy class

I have a service that I have referenced which creates a proxy class "MyWebService". However when I use that class its object doesnt seem to have the RequestSoapContext property. Here below is how I was expecting to consume the service: MyWebService objWS = new MyWebService(); UsernameToken token = new UsernameTo...

How can I get the "purpose" (Client Authentication Certificate) of a certificate in .NET?

I want to find all client authentication certificates from the X509Store(StoreLocation.CurrentUser) Is there anyway to do this? Even by getting all then filtering by a certain property to get all Client Authentication certificates? ...

Cropping whitespace from an Image

Hi guys, Anyone know of a good method of cropping whitespace from an image? I have an external method which generates Image objects containing charts, but unfortunately they have lots of white space which I would like to remove. Thanks, Alex ...

Reading the HttpStatusCode when the remote server throws an internal error

I’m trying to read the HTTP response code from a remote server but am running into some trouble when it throws an internal server error. In the following code, GetResponse() can throw a WebException when the remote machine returns an error. I’m currently catching the error and assuming it was a HttpStatusCode.InternalServerError but this...

Custom shape object in MS Office

I want to create some custom shapes for MS Office which we can use in house. For example I want to create a shape named “carton box” which have three – four default places where user can add some text. It is same as other shapes or I would say just like shapes (line, flowchart, arrow etc) in MS office 2007. Is there any way to create a...

C: Run-time vs Pre-loaded

I'm not sure if I got my terms straight here, but I was wondering: Is creating objects in run-time faster than adding objects to a form before running it? In case my terms are messed up, in the load function, you add this: lOptions.AutoSize = true; lOptions.Location = new System.Drawing.Point(7, 75); lOptions.Name = "lOptions"; lOptio...

How to verify if a windows service is stopped or running and wait until it is in this state?

How to verify if a windows service is stopped or running and wait until it is in this state? Dim s As New ServiceController("Aservice") s.Refresh() If s.Status = ServiceControllerStatus.Running Then s.Stop() End If s.Refresh() The problem is that I want to wait in this function until the service is in that sta...

What does '??' mean in C#?

Possible Duplicate: What do two question marks together mean in C#? I'm trying to understand what this statment does: what does "??" mean? is this som type if if-statment? string cookieKey = "SearchDisplayType" + key ?? ""; ...

Windows Forms: Using a user control like a container control

I have developed a simple Windows Forms User Control. I drag and drop this user control on a form. How can I achive, that now I can put further controls from the toolbox dirctly on the user control in the form? In other words, is it possible to use a user control like a container control? ...

How to wait for BackgroundWorker to finish and then exit console application

I have written a sample console application to test backgroundworker using one of the examples posted here in Stackoverflow. I have a backgroundworker which start with the main method but its ending in the middle of the operation if I press enter because I have written a console.readkey in the main method. But I want it to wait till the ...

Windows 7/2008R2 Process Reflection

Have you ever used Process Reflection from code? Even in C#? I've been reading about this topic. I find it very interesting as it allows you to recover an application after an unhandled exception as you can clone a process as a "process backup" and run it after actual one has a fatal error. Process Reflection (new) Crashed...

Storing a list of methods in C#

I have a list of method that I would like to call in a specific order. Therefore I would want to store them either in an ordered list or in a table with a specified index. This way the list would be the only thing to change the day we want to change the call order. I found this article explaining how to do it using an array and delegate...