I am working on the code part only.MSTest is written by some1 else.When I run the MStest after making changes to few files in a project , it is getting failed.I just want to know which change in which file triggering the error in MStest.Any idea ?
What do you mean by "using" it? If you want to start or stop the service, you can use ServiceController class.
If you need to call a method from the service, you should not be using the service at all. If it has class library collection for the business layer and data access etc, use them as reference in your application.
"The worst code you'll come across is code you wrote last year.", wizardzz[^]
a DGV is a complex Control. I got it sorting any way I want, see e.g. my "CP Vanity" article.
From memory, and maybe not 100% accurate:
1. It would not sort (but throw some exception) when databound to something that does not implement IBindingList; that is why I often use a DataTable, not just a List as a data source.
2. It would sort in the natural way when set to Automatic, without requiring any extra code.
3. It could be made to sort in odd ways by setting to Programmatic and calling Sort() explicitly, again see CP Vanity.
Note: I would never change the sort mode inside a click handler, in fact I think the sort mode for each column typically should be constant throughout the app's life, it may be different amongst columns, but I see no need to change it over time.
I'm not sure, however I would try this:
- use a WebBrowser;
- have it Navigate(string) to the URL you want;
- use it's DocumentCompleted event to obtain its Document property.
Caveat: complex pages may fire their DocumentCompleted event many times; what I typically do is compare the current WebBrowserDocumentCompletedEventArgs.URL with the original one, until they match.
I'm not sure the "final HTML" actually exists at all; it could well be the browser interprets the incoming data and processes it on the fly, yielding data structures with displayable items that will eventually be shown.
This[^] and other Google hits suggests there is a way, not necessarily an easy one. Start studying "DOM".
There's no such thing as the "final HTML". Documents can be modified by any number of scripts and by any number of actions on the web page and at any time AFTER the document complete events fire. Click a button and a DIV might disappear. There's no way to tell.
Your concept of a "final HTML" just doesn't exist, even more so today with more script, Flash, AJAX, HTML5, ... HTML is far from a static entity.
First of all - I am not very experienced. I have the following strage situation:
Task t = null;
t = Task.Factory.StartNew(() =>
// do some calculations
LogToUi is a function that updates a textbox in the UI. It does it pretty straightforward tbUpdateMe.Text = passedtoLogToUiText;
This works just fine, it also works if I use a listbox instead of textbox, but If I would like to change LogToUi to update a datagridview - it does not work.
I was told that in general what I have written should not work.... But it does... So why?
A friend of mine told me that even with textbox it should not work... But it does... So what is the situation and can I expect that it will work with TextBox but not very stable or what?
So long as your LogToUi method is invoking to the UI thread then any control can be updated successfully. If not, you will end up with illegal cross thread exceptions, or your app may crash (eventually!) if you have these turned off.