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

Gotcha: use parentheses around ternary op conditional expressions
25 Αυγούστου 18 03:42 μμ | Μπιρμπίλης Γεώργιος | 0 σχόλια   
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? "a" […]
Δημοσίευση στην κατηγορία: , , , , , , , ,
Suggestion: Allow local nested methods inside any code block
05 Σεπτεμβρίου 15 09:44 μμ | Μπιρμπίλης Γεώργιος | 0 σχόλια   
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 […]
Δημοσίευση στην κατηγορία: , , , , , , ,
Suggestion: Define scoped variable at C# switch conditional statement
01 Σεπτεμβρίου 15 08:47 μμ | Μπιρμπίλης Γεώργιος | 0 σχόλια   
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 suggestion (PLEASE VOTE IT […]
Δημοσίευση στην κατηγορία: , , , , , ,
Suggestion: property and event setting block attached to C# type instance
25 Αυγούστου 15 03:31 μμ | Μπιρμπίλης Γεώργιος | 0 σχόλια   
Instead of having to write in C#       speechRecognizer = CreateSpeechRecognizer();       if (speechRecognizer != null)       {         speechRecognizer.SomeProperty = someValue;         speechRecognizer.SomeOtherProperty = someOtherValue;         speechRecognizer.SpeechRecognized += SpeechRecognized;         speechRecognizer.SpeechHypothesized += SpeechHypothesized;         speechRecognizer.SpeechRecognitionRejected += SpeechRecognitionRejected;       } I’d prefer to write:       speechRecognizer = CreateSpeechRecognizer() {         SomeProperty = someValue,         SomeOtherProperty […]
Δημοσίευση στην κατηγορία: , , , , , ,
Suggestion: implement ignore keyword or allow missing catch block in C#
23 Αυγούστου 15 01:23 πμ | Μπιρμπίλης Γεώργιος | 0 σχόλια   
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 […]
Δημοσίευση στην κατηγορία: , , , , , , ,
Suggestion: Allow new in C# without giving Type
23 Αυγούστου 15 01:12 πμ | Μπιρμπίλης Γεώργιος | 0 σχόλια   
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 and also they […]
Δημοσίευση στην κατηγορία: , , , , ,
HowTo: Call C# method from class that has same name as namespace
06 Ιουλίου 14 03:25 μμ | Μπιρμπίλης Γεώργιος | 0 σχόλια   
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 […]
Δημοσίευση στην κατηγορία: , , , , , , , ,

Search

Go

Ιστορικό Δημοσιεύσεων

Συνδρομές