Use proper naming conventions - in a large project you will end up with more than thousand variable names , methods , etc.
So in order to facilitate the autocompletion feature fully name as follows:
- the names of the variables - if it is control , find out consisten 3 letter abbreviation for type of control and than the name - for example - if I have a column name in the database called FirstName - the name of the textbox , which will pass the value to the db is txtFirstName, if it is label is should be labFirstName , if I have panel containing controls the name of the panel is panSearch. Thus each time you remember - it is a text field you just type txt and will get list (hopefully smaller than 20 items in your page / class with all the txt fields ; )
- the names of the methods - well Microsoft advices use for example SearchClick - I say use ClickSearch - once you type Click you will get all the EventHandlers which you have designed to response to click on a button , or CheckUserIsActivie
- Use longer names of classes to remember them better - later one use find and replace LongNameOfClass. with lnc once you have used the class so often that you remember the short name for sure - the same stands for variables
- use short name for variables , which are obvious from the context - e.g. later on when having to debug or just simply review what the ... I have written ... it will be 100% sure what this variable stands for . For example:
public static void SanitizeForSQL ( ref string s , char c )
{
s = c + s + c ;
}
Getting the Current TabItem when the Tab is not selected in WPF
-
[image: Banner]
This is a quick reminder to self on how to retrieve a TabItem from a WPF
TabControl *when the tab is not currently selected* because I ru...
1 week ago
No comments:
Post a Comment
- the first minus - Comments have to be moderated because of the spammers
- the second minus - I am very lazy at moderating comments ... hardly find time ...
- the third minus - Short links are no good for security ...
- The REAL PLUS : Any critic and positive feedback is better than none, so your comments will be published sooner or later !!!!