public IUIObject CreateFrame(FrameType frameType, string name, IFrame parent, string inherits) { LayoutFrameType xml; switch (frameType) { case FrameType.Frame: xml = new ObjFrameType(); break; case FrameType.Button: xml = new ButtonType(); break; case FrameType.EditBox: xml = new EditBoxType(); break; case FrameType.GameTooltip: xml = new GameTooltipType(); break; case FrameType.CheckButton: xml = new CheckButtonType(); break; default: throw new UiSimuationException(string.Format("Unhandled frame type {0}.", frameType)); } xml.inherits = inherits; xml.name = name; xml.Items = new object[] {}; return(this.util.CreateObject(xml, parent)); }
public Button(UiInitUtil util, string objectType, CheckButtonType frameType, IRegion parent) : base(util, objectType, frameType, parent) { this.scriptHandler = new Script <ButtonHandler, IButton>(this); if (!string.IsNullOrEmpty(frameType.inherits)) { this.ApplyType((CheckButtonType)util.GetTemplate(frameType.inherits)); } this.ApplyType(frameType); }
public CheckButton(UiInitUtil util, string objectType, CheckButtonType frameType, IRegion parent) : base(util, objectType, frameType, parent) { }
private void ApplyType(CheckButtonType type) { this.text = type.text; }