.net

Asynchronous Delegates Vs Thread/ThreadPool?

Hello, I need to execute 3 parallel tasks and after completion of each task they should call the same function which prints out the results. I don't understand in .net why we have Asychronous calling (delegate.BeginInvoke() & delegate.EndInvoke()) as well as Thread class? I'm little confused which one to use when? Now in this particul...

Comparing signatures in Ink Serilized Format

Hey guys, I have a load of signatures I wish to compare (all in ISF - ink serialized format). Does anyone know how to compare these signatures? Thanks in advance ...

Is the binary formatter smart about space when serializing?

Short and simple: If I have an object with many values == to their default constructor values, will a serialization with a binary formatter omit them in the resulting file to save space? I'm figuring, since the value is known from the class definition anyway. ...

Dot net 3.5:is appconfig dynamically updated in cache on run time?

After application start up ,if i change some value in app.config ,is it reflected in cache object through which i access appconfig properties. string currentValue = ConfigurationSettings.AppSettings[currentKey]; If it is not so what is possible way to do so? ...

Sharing transactions with EF and other technologies?

We have an application with a lot of legacy code, with many different technologies: COM+ Objects written in Delphi 5 COM+ Objects written in .NET OCX controls written in Delphi 5 ASP pages ASPX pages In our data access layer, we are working with old ADO (not .NET ADO) because we need compatibility against legacy code, and now we are at...

Creating strongly typed DataTable from CSV file in byte[]

I am developing using C# 3 and .NET 3.5 and have an object where the contents of a CSV file (of an unknown format) are held in a byte[] property. I need to parse this byte[] and create a System.DataTable containing the columns and rows. The problem is creating a System.DataTable where column data types match the data in the CSV. I am c...

How can I programmatically delete a line from a word document using c#?

I have some code to find and replace fields in a word document with values from a dataset. Word.Document oWordDoc = new Word.Document(); foreach (Word.Field mergeField in oWordDoc.Fields) { mergeField.Select(); oWord.Selection.TypeText( stringValueFromDataSet ); } In some cases stringValueFromDataSet is empty, and in addition t...

Relocating app.config file to a custom path

Is it possible to relocate the whole App.Config file to a custom path? It seems a bit odd that the config file resides in the same folder as the exe, with Windows' new approcah of saving all program settings in c:\ProgramData and all. An additional requirement we have is to programatically specify where to find the app.config file. The...

Bazaar + CruiseControl.Net

I want to setup CruiseControl.Net at my company. We currently have several .net solutions stored in a Bazaar repository and I want to use MSBuild to build each solution. This didn't seem too controversial, but I can't see an easy way of binding CruiseControl.Net to Bazaar. There seems to have been a plugin to do this at http://www.sorn....

When a thread is blocked on Monitor.Enter(obj), is it put in obj's ready queue?

If so, that would imply that the blocked thread can enter when another thread calls Monitor.Wait(obj). This seems a little odd to me in that it must contend with other threads in the ready queue. If not, can it only un-block when Monitor.Exit(obj) is called? Or is it in obj's waiting queue? This isn't clearly documented in the MSDN Lib...

Popup while session timeout

How to set a pop up message box saying... "please end your session and start again" in my asp.net webform? ...

Integrating into Windows Explorer context menu

I want to write a small tool, that does the following: When you right click on a file with a certain file-extension the Windows Explorer context menu shows an additional entry. When you click this entry a certain EXE is launched with this file as one of its parameters. I would like to use C#/.NET 2.0 for this. If it's not possible I ...

WPF - XBap vs Standalone Windows App

I'm thinking through a potential WPF application and have gained a reasonable understanding of what XBAPs, how they are deployed, limited trust and so on. The application I am considering probably wiill require fuller trust than an XBAP allows by default and also use of WCF with WS bindings etc. Hence I'm leaning towards the stand alon...

Using a Goto to enhance the DRY principle and code clarity: a good idea?

I have some code that is structured like the following: if (someStatement) { //... if (SomeOtherStatement) { //..., possibly more cases like this } else { //goto warning; //would otherwise repeat //the MessageBox.Show here } } else { //goto warning; } //... warning: Message...

How do I get a list of event handlers with nonstandard names in my code?

I'm in the middle of performing a large refactoring which will involve renaming a lot of events. This will leave our code with a lot of code like this: thing.NewEventName += thing_OldEventName; How do I get a list of event handlers with nonstandard names in my code? Should I be thinking about a regex search, or should I be looking a...

How to solve these problems with Asynchronous Callback>

I need to run 5 algorithms parallely each takes an image as input and gives image as output. After each of these is done, I need to display the 5 output images. I'm using Asynchronous Callback using delegates for this task. So, I created 5 delegates for these 5 algos and calling them like algo1Delegate.BeginInvoke(). Algorithms are run...

TypeOf is myType

Hello. I have a function Public MyObj as Object Public Function Test(t as Type) as Boolean Return TypeOf MyObj is t ' does not work End Function Thanks. * EDIT ==================================================================== For clarity I will use a complete example, a little modified that initially was thought. I use an int...

Will multiple FileSystemWatchers clash?

I have a FileSystemWatcher on machine A watching a folder on machine B over a network. I want to create another FileSystemWatcher in a program on machine B to monitor the same folder locally. Will the second FileSystemWatcher interfere with the first one? ...

Align / scoll issues in XAML Listbox

Apologies for the ambiguous title. I want the items of my listbox to display similar to a photo gallery - imagine Thumbnail view on Windows File Explorer. I have a listbox defined as so <ListBox ItemsSource="{Binding RUFView}" x:Name="RUFs" Margin="228,34,12,12" Background="Transparent" BorderBrush="#007F9DB9"> <ListBox.ItemsPanel...

Masking sensitive information when logging from IClientMessageInspector

I'm using WCF (.NET 3.5) to communicate with a server using SOAP. When running in debug mode, I use System.ServiceMode.Dispatcher.IClientMessageInspector and log4Net to log the request content. public object BeforeSendRequest(ref Message request, IClientChannel channel) { log.Debug(request); } My difficulty is that sometimes t...