My application generally running on 10-20 threads and these threads sending events to the GUI to the update certain controls almost every seconds.
When the user close the application middle of these, all updates related with these events causes several random crashes. Mostly ObjectDisposedException and NullReferenceException.
Since the...
I insert a new object into LINQ-to-SQL DataContext without calling SubmitChanges() yet:
MyDataContext db = new MyDataContext();
MyObject newObject = new MyObject()
{
Id = 1,
Name = "MyName"
};
db.MyObjects.InsertOnSubmit(newObject);
Now in another place in my code I want to retrieve this new object, even though it is not in the...
As far as I know the difference operator of the DateTime type considers leap years: so
new DateTime(2008, 3, 1) - new DateTime(2008, 2, 1) // should return 29 days
new DateTime(2009, 3, 1) - new DateTime(2009, 2, 1) // should return 28 days
But what about daylight saving?
...
I want to write a program in WPF but not sure should I target .net35 or .net30. The advantages of .net35 are obvious. But still, I see one major advantage of .net30 -- it's built into Vista, so, the people using Windows Vista will not have to download and install the framework.
Do you think the advantages of .net35 outweigh the hassle o...
Hi,
I have a Windows.Forms component which has a "mySize" property that returns a Size struct.
My intention was to have this property calculate the returned mySize automatically based on the size of the component, unless mySize has been explicity set, in which case, return the set value of mySize.
Unfortunately, now that I am embedding t...
Is it possible to capture the graphics object created by the Google Earth browser plugin from a .NET WebBrowser control?
With this graphics object I could create an image to use as the background image for a panel that I can then draw on top of.
You cannot just use a WebBrowser control under a Panel control as the Google Earth plugin d...
Hello everyone,
I am looking for a network camera which I could program against the following functions,
I can plug-in the camera into network cable, then it could work to capture video independently, no need to plug-in into a computer to make it work;
I can remotely control the camera, e.g. control its start/stop/direction;
I can...
I am writing a survey application, and I have a form that can have potentially hundreds of input fields. How would I write the controller to process this form? I can't specify each input as a parameter for the controller, that would be unrealistic.
I found out about the MVCToolkit, and the UpdateFrom() method, but is this the right ...
I'm looking into creating a system / site which includes a website. I would like to get the benefits of WPF, and WBA seems to be a good avenue of doing this. Silverlight on the other hand is also good for accomplishing this goal, with the difference that WBA provides more options and power than Silverlight.
What are the benefits / losse...
With Regex::Replace we can use $1, $2, ... to match corresponding groups. But how can I use $1 followed by number. E.g. to replace 6 with 678?
Regex::Replace(text, "(6)", '$178');
...
Ok, I have code that is working (posted after this) but before I expand it I wanted to throw it out here and see maybe better ways of doing what I am doing.
the problem: the SIP panel sucks - sometimes all I need is numbers or letters entered into a mobile application - most of my users wind up not using the stylus but fingers so I need...
I need a stack structure that also allows the for the deleting of elements. I can't find anything like this in the .Net framework. Which structure provides the best basis for me to implement this?
...
This is probably really obvious and I'm being dense. In C# I can do this:
string = @"this is
some preformatted
text";
How do I do this in VB?
...
Hey!
I have a listbox like so:
list.DataSource = bindingSource;
list.DisplayMember = "column_name";
Later I would want to get the selected item's ID from the DataSet with bindingSource.Current. I've done this before with bindingNavigator+bindingSource, Current returns a DataRowView, so I can cast it and I'm done:
Int32.Parse(((DataRo...
Our client (a winforms app) includes a file-browser. I'd like the user to be able to open the selected file using the shell's default handler. How do I do that? I've read that I should use the Win32 API rather than the registry, but I'd prefer a solution that involves only .NET.
...
Hi
I am trying to sort some Japanese shop names using the "aiueo" order
Does anyone know if there is an algorithm to do this
I have written a comparer as follows but I believe the ja-jp culture uses the Unicode sort
internal class JewellerComparer : IComparer<string>
{
private readonly string _culture;
public Jew...
I'd like to create C# outlook addin to automate a process of adding mail fragments as comments in my bug tracking system (Jira).
To create the comment I need to extract currently selected text.
I manage to do that in a tricky way for email window (following this article).
But I didn't find any way to access the current selection in the ...
I am new to testing and mocking. I'm trying to test a business logic class which performs calculations, calls into the DAL and updates the database, and manages transactions. I'm using mocks to do unit testing, but how does full integration testing fit into all of this. Do I basically have the exact same tests, but use the real DAL or do...
So i have this URL:
http://test.com/afolder/who-else-wants-to-make-horror-movies%3f/
which is URL encoded version of :
http://test.com/afolder/who-else-wants-to-make-horror-movies?/
But IIS7 throws a 400:
HTTP Error 400.0 - Bad Request ASP.NET
detected invalid characters in the
URL.
But why is it doing that if i have correct...
I have come across some articles on the web about .Net applets and I was wondering how it differed from an activex control (created using a .Net language)? (to clarify, this is with regards to applets that run inside a web-browser)
(Is the difference: ActiveX controls written in a .Net language are called .Net Applets?)
Are there any a...