Καλώς ορίσατε στο dotNETZone.gr - Σύνδεση | Εγγραφή | Βοήθεια
σε

 

Αρχική σελίδα Ιστολόγια Συζητήσεις Εκθέσεις Φωτογραφιών Αρχειοθήκες

Παρουσίαση με Ετικέτες

Όλες οι Ετικέτε... » Syntax   (RSS)
  • Gotcha: use parentheses around ternary op conditional expressions

    Just came across the following case in C# that puzzled me momentarily, especially since the strings involved were long enough and the expression was broken on multiple lines: bool flag = true; string test1 = flag? "xa" : "xb"; string test2 = "x" + (flag? "a" : "b"); string test3 = "x" + flag? ...
    Δημοσιεύτηκε στο George Birbilis' blog (Weblog) από το μέλος birbilis στις Αυγούστου 25, 2018
  • Suggestion: Allow local nested methods inside any code block

    It would be nice if one could define methods inside other methods so that they are only accessible in the context of the parent method. In Pascal one could define them at the start of the parent method, before any other commands, but after local variables block, so they could also access the variables of […]
    Δημοσιεύτηκε στο George Birbilis' blog (Weblog) από το μέλος birbilis στις Σεπτεμβρίου 5, 2015
  • Suggestion: Define scoped variable at C# switch conditional statement

    Trying to reuse the conditional value of a switch statment in C# at the fallback “default” code block of it, and looking up if that was supported in C#, I found the a related discussion at: http://stackoverflow.com/questions/29628507/c-sharp-get-switch-value-if-in-default-case I added a comment there and also elaborated it a bit more at a ...
    Δημοσιεύτηκε στο George Birbilis' blog (Weblog) από το μέλος birbilis στις Σεπτεμβρίου 1, 2015
  • Suggestion: property and event setting block attached to C# type instance

    Instead of having to write in C#       speechRecognizer = CreateSpeechRecognizer();       if (speechRecognizer != null)       {         speechRecognizer.SomeProperty = someValue;         ...
    Δημοσιεύτηκε στο George Birbilis' blog (Weblog) από το μέλος birbilis στις Αυγούστου 25, 2015
  • Suggestion: implement ignore keyword or allow missing catch block in C#

    This is a suggestion I’ve just sent in via Visual Studio’s “Send a frown” feature (rewritten here a bit differently from memory, since that feedback channel doesn’t allow you to access your previous feedback as the Microsoft Connect or the Uservoice site does) : Instead of having to write try {   … } catch […]
    Δημοσιεύτηκε στο George Birbilis' blog (Weblog) από το μέλος birbilis στις Αυγούστου 23, 2015
  • Suggestion: Allow new in C# without giving Type

    This is a suggestion I’ve just sent in via Visual Studio’s “Send a frown” feature: Instead of writing statements like:   List<CultureInfo> result = new List<CultureInfo>(); in C# I’d prefer to be able to write   List<CultureInfo> result = new (); inside the () one would be able to pass contructor parameters ...
    Δημοσιεύτηκε στο George Birbilis' blog (Weblog) από το μέλος birbilis στις Αυγούστου 23, 2015
  • HowTo: Call C# method from class that has same name as namespace

    In the C# compiler error case shown above, CaptionsGrid class exists in namespace ClipFlair.CaptionsGrid so in the code we have “using ClipFlair.CaptionsGrid;” at the top of the file where we want to call the “SaveAudio” static method of CaptionsGrid class. But then we get the error “The type or namespace name ‘…’ does not exist ...
    Δημοσιεύτηκε στο George Birbilis' blog (Weblog) από το μέλος birbilis στις Ιουλίου 6, 2014
Με χρήση του Community Server (Commercial Edition), από την Telligent Systems