¡@

Home 

c# Programming Glossary: co

Event Signature in .NET — Using a Strong Typed 'Sender'?

http://stackoverflow.com/questions/1046016/event-signature-in-net-using-a-strong-typed-sender

a poor idea for this reason alone. However I would like to consider this from two possible perspectives 1 Should I consider.. to consider this from two possible perspectives 1 Should I consider using this for my own development work which is 100 for.. work which is 100 for internal purposes. 2 Is this a concept that the framework designers could consider changing or..

Are static methods thread safe

http://stackoverflow.com/questions/1090650/are-static-methods-thread-safe

webpage to calculate how long each page has taken to be constructed. My question is are Static classes thread safe In my.. is are Static classes thread safe In my example will concurrent users cause a problem with my start and stop times e.g.. _stopTime summary Gets the amount of time taken in milliseconds summary returns returns public static decimal Duration TimeSpan..

Why covariance and contravariance do not support value type

http://stackoverflow.com/questions/12454794/why-covariance-and-contravariance-do-not-support-value-type

covariance and contravariance do not support value type IEnumerable.. covariance and contravariance do not support value type IEnumerable T is co variant.. contravariance do not support value type IEnumerable T is co variant but it does not support value type just only reference..

C# - remove text in between delimiters in a string - regex?

http://stackoverflow.com/questions/1359412/c-sharp-remove-text-in-between-delimiters-in-a-string-regex

Have 'a good'day Have day Does Not Match Hello world Brown co w Cheese'factory If the given string doesn't contain a matching.. Brown co w Cheese'factory If the given string doesn't contain a matching set of delimiters it isn't modified. The input.. easy ways of matching those start and end delimiters in constants or in a list of some kind The solution I am looking for..

Is it better to return null or empty collection?

http://stackoverflow.com/questions/1969993/is-it-better-to-return-null-or-empty-collection

it better to return null or empty collection that's kind off a general question but I'm using C#.. the best way best practice do you return null or empty collection for a method that has a collection as a return type.. return null or empty collection for a method that has a collection as a return type c# collections share improve this..

Embedding mercurial revision information in Visual Studio c# projects automatically

http://stackoverflow.com/questions/2386440/embedding-mercurial-revision-information-in-visual-studio-c-sharp-projects-autom

very useful to be able to see if an application has been compiled with clean un modified changesets from the repository... usefully appends a to the changeset id when there are uncommitted changes in a repository so this allows us to easily see.. if people are running a clean or a modified version of the code. My current solution is detailed below and fulfills the basic..

Is it the best practice to extract an interface for every class?

http://stackoverflow.com/questions/3036749/is-it-the-best-practice-to-extract-an-interface-for-every-class

to extract an interface for every class I have seen code where every class has an interface that it implements. Sometimes.. has an interface that it implements. Sometimes there is no common interface for them all. They are just there and they are.. them all. They are just there and they are used instead of concreate objects. They do not offer a generic interface for two..

still confused about covariance and contravariance & in/out

http://stackoverflow.com/questions/3445631/still-confused-about-covariance-and-contravariance-in-out

confused about covariance and contravariance in out ok i read.. confused about covariance and contravariance in out ok i read a bit on this topic.. confused about covariance and contravariance in out ok i read a bit on this topic on stackoverflow..

Operation could destabilize the runtime?

http://stackoverflow.com/questions/378895/operation-could-destabilize-the-runtime

could destabilize the runtime I'm having a little bit of trouble.. understanding what the problem is here. I have a bit of code that pulls records from a database using LINQ and puts them.. the problem is here. I have a bit of code that pulls records from a database using LINQ and puts them into an object which..

GetHashCode Guidelines in C#

http://stackoverflow.com/questions/462451/gethashcode-guidelines-in-c-sharp

™s returns over the life of a particular object should be constant the same value even if the object ™s data changes. In many.. to enforce this. Is this a valid guideline I have tried a couple built in types in .NET and they didn't behave like this... in .NET and they didn't behave like this. c# .net hashcode share improve this question The answer is mostly it is..

Is there any performance difference between ++i and i++ in C#?

http://stackoverflow.com/questions/467322/is-there-any-performance-difference-between-i-and-i-in-c

int i 0 i 10 i ... and for int i 0 i 10 i ... or is the compiler able to optimize in such a way that they are equally fast.. Edit This was asked because I had a discussion with a co worker about it not because I think its a useful optimization.. There is no difference in the generated intermediate code for i and i in this case. Given this program class Program..

Why can't an anonymous method be assigned to var?

http://stackoverflow.com/questions/4965576/why-cant-an-anonymous-method-be-assigned-to-var

anonymous method be assigned to var I have the following code Func string bool comparer delegate string value return value.. to var I have the following code Func string bool comparer delegate string value return value 0 However the following.. string value return value 0 However the following does not compile var comparer delegate string value return value 0 Why can't..

How to expand environment variables remotely with .NET?

http://stackoverflow.com/questions/5031111/how-to-expand-environment-variables-remotely-with-net

are a bunch of different SpecialFolder values that you could use including ProgramFiles and ApplicationData string path.. Environment.SpecialFolder.ProgramFiles Then you could just combine it with the rest of your path string full_path.. Environment.SpecialFolder.ProgramFiles Then you could just combine it with the rest of your path string full_path Path.Combine..

Calling null on a class vs Dispose()

http://stackoverflow.com/questions/574019/calling-null-on-a-class-vs-dispose

and a destructor and calling Dispose Also if I have a code block with a using statement eg below if I step through the.. with a using statement eg below if I step through the code and exit the using block is the object disposed of then or.. block is the object disposed of then or when a garbage collection occurs What would happen if I call Dispose in the using..

Rotate a point by an angle

http://stackoverflow.com/questions/786472/rotate-a-point-by-an-angle

point by an angle I want to know how to work out the new co ordinates for a point when rotated by an angle relative to another.. required to allow me to draw a polygon between 2 onscreen controls. I can't use and rotate an image. From what I have considered.. I can't use and rotate an image. From what I have considered so far what complicates the matter further is that the..

Using RegEx to balance match parenthesis

http://stackoverflow.com/questions/7898310/using-regex-to-balance-match-parenthesis

is Regex should match everything from funcPow until the second closing parenthesis. It should stop after the second closing.. the second closing parenthesis. It should stop after the second closing parenthesis. Instead it is matching all the way to.. . If you really hate yourself and the world your fellow co programmers enough to use these things I suggest using the RegexOptions.IgnorePatternWhitespace..