|
/*
* Copyright � 2005-2006 Danilo Mendez <danilo.mendez@kontac.net>
* Adolfo Socorro <ajs@esolutionspr.com>
* www.kontac.net
* All rights reserved.
* Released under both BSD license and Lesser GPL library license.
* Whenever there is any discrepancy between the two licenses,
* the BSD license will take precedence.
*/
namespace SmartCode.Model.Profile
{
using System;
using System.Collections;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using SmartCode.Model;
using System.ComponentModel;
[Serializable()]
public class ControlBase : IdentifiedObject, ISerializable
{
public enum JustifyEnum {LEFT,RIGHT,CENTER,}
protected string name;
protected bool required;
protected bool isVisible;
protected JustifyEnum justify;
protected decimal height;
protected decimal width;
public ControlBase(string name)
{
this.name = name;
isVisible =true;
Justify = SmartCode.Model.Profile.ControlBase.JustifyEnum.LEFT;
Height = 20;
}
public ControlBase(SerializationInfo Info, StreamingContext ctxt)
{
name = (string)Info.GetValue("name", typeof(string));
required = (bool)Info.GetValue("required", typeof(bool));
isVisible = (bool)Info.GetValue("isVisible", typeof(bool));
justify = (JustifyEnum)Info.GetValue("justify", typeof(JustifyEnum));
height = (decimal)Info.GetValue("height", typeof(decimal));
width = (decimal)Info.GetValue("width", typeof(decimal));
}
void ISerializable.GetObjectData(SerializationInfo Info, StreamingContext ctxt)
{
Info.AddValue ("name",name );
Info.AddValue ("required",required );
Info.AddValue ("isVisible",isVisible );
Info.AddValue ("justify",justify );
Info.AddValue ("height",height );
Info.AddValue ("width",width );
}
public string Name
{
get
{
return this.name;
}
set
{
this.name = value;
}
}
[Category("Editor")]
[Description(@"None")]
[Browsable(true)]
public bool Required
{
get
{
return this.required;
}
set
{
this.required = value;
}
}
[Category("Editor")]
[Description(@"None")]
[Browsable(true)]
public bool Visible
{
get
{
return this.isVisible;
}
set
{
this.isVisible = value;
}
}
[Category("Editor")]
[Description(@"None")]
[Browsable(true)]
public JustifyEnum Justify
{
get
{
return this.justify;
}
set
{
this.justify = value;
}
}
[Category("Editor")]
[Description(@"None")]
[Browsable(true)]
public decimal Height
{
get
{
return this.height;
}
set
{
this.height = value;
}
}
[Category("Editor")]
[Description(@"None")]
[Browsable(true)]
public decimal Width
{
get
{
return this.width;
}
set
{
this.width = value;
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here
Danilo is the creator of
SmartRules, a Business Rules Engine. He is an industry consultant working primarily with companies interested in implementing dynamic rules programming concepts to add flexibility to their architectures on web, CE, and desktop platforms. He operates his own website,
Kontac, where you will find more information.
To contact Danilo, email him at danilo.mendez@gmail.com.