Creating an Object Model for a Windows Application - Part 1
page 4 of 11
by Brian Mains
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 38912/ 74

Base Architecture

Because all of the elements within an API implement a similar interface, a common interface can be used.  This makes development of the interface a lot easier.

Listing 1

public abstract class UIElement
{
  private string _name = string.Empty;
  private string _title = "Untitled";
  private bool _visible = true;
 
  public string Name
  {
    get
    {
      return _name;
    }
    set
    {
      _name = value;
    }
  }
  public string Title
  {
    get
    {
      return _title;
    }
    set
    {
      _title = value;
    }
  }
  public bool Visible
  {
    get
    {
      return _visible;
    }
    set
    {
      _visible = value;
    }
  }
}

Each object can be visible or invisible, and can have a name/title.  These are the core features that can be incorporated.  In addition, the next level of abstraction is for a window.  A window is either a document or tool window that contains a user interface.

Listing 2

public abstract class BaseWindow: UIElement
{
  private object _uiInterface = null;
  public object UIInterface
  {
    get
    {
      return _uiInterface;
    }
    set
    {
      _uiInterface = value;
    }
  }
}

If in the future, any window-based object needed additional features could easily incorporate them in the base class.


View Entire Article

User Comments

Title: good article   
Name: RangaswmyR
Date: 2008-01-25 4:41:03 AM
Comment:
This artical gives the best learning knowledge and it is very use full for creating and developing of a window form application and according to knowledge wise it is very use full to identified the controles which are usead to devlope a login page for any web sites.

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-05-02 1:04:46 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search