xsharp.eu • Question: naming of control classes - Page 3
Page 3 of 3

Question: naming of control classes

Posted: Wed Aug 08, 2018 5:38 pm
by FFF
Well, would say, a lot depends on the available intellisense possibilities. But I'm with W., it's a Pita if you always have to look for the using statements to see, what's in use.

K.

Question: naming of control classes

Posted: Wed Aug 08, 2018 7:03 pm
by SHirsch
Hi,

I also prefer prefix.
In my framework all classes are prefixed 'kd' and postfixed with their special purpose (eg. kdSleWeight oder kdSleDate).

Stefan

Question: naming of control classes

Posted: Thu Aug 09, 2018 7:00 am
by MathiasHakansson
An alternative could be to organize you namespaces so that you don't have to be afraid of them...

Accessing a Control by

XST.SLE.Date
XST.SLE.Password
XST.Combo.Check
XST.Combo.MultiSelect

It can be better to use namespaces instead of adding prefixes. If the names are short your code does not look ugly.

/Mathias

Question: naming of control classes

Posted: Thu Aug 09, 2018 7:05 am
by wriedmann
Hi Mathias,

thank you very much for your suggestion!

Personally, I don't like to subdivide namespaces too much.

Wolfgang

Question: naming of control classes

Posted: Thu Aug 09, 2018 11:04 am
by TerryB1
Hi Wolfgang
I think I’ve found where the confusion occurred.

In your original question you gave the following example:
Example: the tools version of the TextBox class could be named TextBoxXST, or XstTextBox.
I took this to mean that you were proposing an XstTextBox which could be either a WinForms Text Box or a WPF TextBox. Letting logic sort out which was which.
My point was that WPF controls and WinForms controls fall logically into separate namespaces anyway, so what not use them separately. Why bring them together under a single class name?

Sorry if I’ve confused things.
Terry

Question: naming of control classes

Posted: Thu Aug 09, 2018 6:12 pm
by wriedmann
Hi Terry,

I would follow what Microsoft did.
Unfortunately there are some controls with the same class name in both WPF and Windows Forms, but since you will probably not mix WinForms and WPF controls in the same window, this should be no major problem.

We will have a xsharp.tools.WPF.xstButton class and a xsharp.tools.windows.forms.xstButton class.

Wolfgang