First of all, there is no implicit loop operation that breaks out at a specified time interval. You'll have to code it yourself.
Secondly, as your loop depends on reaching a value or a timeout being reached, a for loop is not the appropriate choice - it is designed to work with a fixed number of iterations. In this case, I would choose to use a while loop instead. Then you could do something like the following:
Stopwatch watch = new Stopwatch();
int count = 0;
} while (++count < 10 && watch.Elapsed <= TimeSpan.FromSeconds(2) );
In my application i have an XML like this..
I want to perform a search in this XML Based on SubID, ModuleId, TaskName, between start and end dates. Please help me. Also i need all the parents of the searched nodes without siblings.
As they are attributes, you need to use attribute based searches in your XPath. The type of syntax you are looking to use is //[@...=value].
You are going to have a problem with the date part as this stands because your data is all text as far as the parser is concerned. In order to work with date information, you are going to have to provide a schema and set the data types as appropriate.
BTW, your XML is malformed - you must enclose your values in quotes, so having TaskId=9 is incorrect and it should actually be TaskId="9"
I already told you that your date search wouldn't work because the data type is a string, and you need to create a schema for this. If you had read my answer fully, you'd have seen that vital piece of information.
I wonder if there is a services-like platform in C# where I can build addons onto. And when I say services, I mean the kind of services Windows has, which I can inject dependencies, trigger a start\stop and add\remove addons as I wish.
I will also need a way of controling it, like a console, MMC or some other kind of UI.
Does anyone know of something similar to what I'm looking for? it'll really help me out
I'm working on an end user card editor desktop aplication. The user can drag and drop controls (text, line, shape) from a toolbox to a design area.To create this controls I created my own controls that inherit from my BaseControl class that inherits from Control class. This controls can have a transparent background, and after googleing during days It works with this code.
That part works, controls can have a transparent background but there is another problem, I think with de z index.If I drag three controls, the last one is not on the top, it's the second one that is in the top and the Bring to Front, Send to Back commands does not work properly as well. It works with only two controls, but it doesn´t if I use more than two.
Im building a web chat application and im using async sockets in the server-side.
The client connects to the server socket via flash component.
My question is , when does the connection dies? if i close my browser i see that the server is closing the connection. is that because TCP socket sends data every x seconds to check the connection? and if it does , can i rely on it? or should i use UDP socket and try to handle the connection state myself.