fbpx
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Question: naming of control classes

Question: naming of control classes 1 year 3 months ago #5774

  FFF's Avatar FFF Offline Posts: 757
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.
Regards
Karl

Please Log in or Create an account to join the conversation.

Question: naming of control classes 1 year 3 months ago #5775

  SHirsch's Avatar SHirsch Offline Posts: 126
Hi,

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

Stefan

Please Log in or Create an account to join the conversation.

Question: naming of control classes 1 year 3 months ago #5779

  MathiasHakansson's Avatar MathiasHakansson Offline Posts: 49
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

Please Log in or Create an account to join the conversation.

Question: naming of control classes 1 year 3 months ago #5780

  wriedmann's Avatar Topic Author wriedmann Away Posts: 1904
Hi Mathias,

thank you very much for your suggestion!

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

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy

www.riedmann.it - docs.xsharp.it

Please Log in or Create an account to join the conversation.

Question: naming of control classes 1 year 3 months ago #5786

  Terry's Avatar Terry Offline Posts: 139
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

Please Log in or Create an account to join the conversation.

Question: naming of control classes 1 year 3 months ago #5789

  wriedmann's Avatar Topic Author wriedmann Away Posts: 1904
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
Wolfgang Riedmann
Meran, South Tyrol, Italy

www.riedmann.it - docs.xsharp.it

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
  • 2
Moderators: wriedmann