Creating Base Classes


Author
Message
Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (654 reputation)Advanced StrataFrame User (654 reputation)Advanced StrataFrame User (654 reputation)Advanced StrataFrame User (654 reputation)Advanced StrataFrame User (654 reputation)Advanced StrataFrame User (654 reputation)Advanced StrataFrame User (654 reputation)Advanced StrataFrame User (654 reputation)Advanced StrataFrame User (654 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
I want to SubClass all the relevant SF classes and am looking for guidance/ best practise. Also if there are any utilities for dong this

At this stage I dont want to build in any additional functionality but will want to do so in the future the following. Is it sufficient to do the following for each of the classes:

e.g.

public class MyBaseBo : MicroFour.StartaFrame.BusinessLayer
{
}

public class MyBaseTextBox : MicroFour.StrataFrame.UI.Windows.Forms.Textbox
{
}

or do I need to refer to Methods inside each class

(e.g. In VFP terms, do I need to put in a DoDeafult() for each method

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.5K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
This is enough. Then if you want to add an additional property or method, you just add it to your class. You will be able to reference any property of the base class via the normal "this" reference. If you override methods or properties, you'd then use "base" to reference the base class. E.g.



public override string ToString()

{

  //-- Establish a return var

  string text;



  //-- Get value returned by base class

  text = base.ToString();



  //-- Based on existing value of some other property, append some other text

  if (this.BindingField != null)

  {

    text += ": bound";

  }



  return text;

}




When I first started realizing how easy this was, it almost felt like cheating...just too easy BigGrin
Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (654 reputation)Advanced StrataFrame User (654 reputation)Advanced StrataFrame User (654 reputation)Advanced StrataFrame User (654 reputation)Advanced StrataFrame User (654 reputation)Advanced StrataFrame User (654 reputation)Advanced StrataFrame User (654 reputation)Advanced StrataFrame User (654 reputation)Advanced StrataFrame User (654 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
Hi Greg. Thanks again for your reply.

Inmitially then it would appear to be quite straightforward.....just sub class ALL the Staratframe Controls with a {}

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search