Search Results

Search found 12 results on 1 pages for 'hun1ahpu'.

Page 1/1 | 1 

  • Collect all extension methods to generic class in another generic class

    - by Hun1Ahpu
    I'd like to create a lot of extension methods for some generic class, e.g. for public class SimpleLinkedList<T> where T:IComparable And I've started creating methods like this: public static class LinkedListExtensions { public static T[] ToArray<T>(this SimpleLinkedList<T> simpleLinkedList) where T:IComparable { //// code } } But when I tried to make LinkedListExtensions class generic like this: public static class LinkedListExtensions<T> where T:IComparable { public static T[] ToArray(this SimpleLinkedList<T> simpleLinkedList) { ////code } } I get "Extension methods can only be declared in non-generic, non-nested static class". And I'm trying to guess where this restriction came from and have no ideas.

    Read the article

  • Performance comparison of Dictionaries

    - by Hun1Ahpu
    I'm interested in performance values (big-O analysis) of Lookup and Insert operation for .Net Dictionaries: HashTable, SortedList, StringDictionary, ListDictionary, HybridDictionary, NameValueCollection Link to a web page with the answer works for me too.

    Read the article

  • WPF Application doesn't work on some machines: Stopped working error

    - by Hun1Ahpu
    My WPF application works fine on a number of machines, but now I get a report about this error on a user machine: Description: Stopped working Problem signature: Problem Event Name: CLR20r3 Problem Signature 01: mysoftware.exe Problem Signature 02: 1.0.0.1 Problem Signature 03: 4bbcd9d9 Problem Signature 04: PresentationFramework Problem Signature 05: 3.0.0.0 Problem Signature 06: 4a174fbc Problem Signature 07: 624f Problem Signature 08: e1 Problem Signature 09: System.Windows.Markup.XamlParse OS Version: 6.1.7600.2.0.0.256.48 Locale ID: 1033 I was trying to catch Exception using Application DispatcherUnhandledException but this didn't help. And warping Window1 constructor in try/catch block too. .NET Framework 3.5 is installed on that machine. How can I figure out the reason of crashing: log this error, debug, ...?

    Read the article

  • Why is it impossible to declare extension methods in a generic static class?

    - by Hun1Ahpu
    I'd like to create a lot of extension methods for some generic class, e.g. for public class SimpleLinkedList<T> where T:IComparable And I've started creating methods like this: public static class LinkedListExtensions { public static T[] ToArray<T>(this SimpleLinkedList<T> simpleLinkedList) where T:IComparable { //// code } } But when I tried to make LinkedListExtensions class generic like this: public static class LinkedListExtensions<T> where T:IComparable { public static T[] ToArray(this SimpleLinkedList<T> simpleLinkedList) { ////code } } I get "Extension methods can only be declared in non-generic, non-nested static class". And I'm trying to guess where this restriction came from and have no ideas.

    Read the article

  • Impossible to use ref and out in Extension methods?

    - by Hun1Ahpu
    Why is it forbidden to call Extension method with ref modifier? This one is possible: public static void Change(ref TestClass testClass, TestClass testClass2) { testClass = testClass2; } And this one not: public static void ChangeWithExtensionMethod(this ref TestClass testClass, TestClass testClass2) { testClass = testClass2; } But why?

    Read the article

  • What algorithm .Net use for searching a pattern in a string?

    - by Hun1Ahpu
    I'm studying string searching algorithms now and wondering what algorithm is used for .NET String.Contains function for example. Reflector shows that this function is used but I have no idea what its name means. private static extern int InternalFindNLSStringEx(IntPtr handle, string localeName, int flags, string source, int sourceCount, int startIndex, string target, int targetCount);

    Read the article

  • How to automatically run in the background?

    - by Hun1Ahpu
    I'm not sure that it's not implemented yet, I hope that it is. But I know that in .Net programmers should manually run time-consuming task in the background thread. So every time we handle some UI event and we understand that this will take some time we also understand that this will hang UI thread and our application. And then we make all this Background work things and handle callbacks or whatever. So my question is: Is there in some language/platform a mechanism that will automatically run time-consuming tasks in the background and will do all related work itself? So we just write the code for handling specific UI event and this code will be somehow detected as time-consuming and will be executed in background. And if there isn't, then why?

    Read the article

1