本文整理汇总了C#中IControlFactory类的典型用法代码示例。如果您正苦于以下问题:C# IControlFactory类的具体用法?C# IControlFactory怎么用?C# IControlFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IControlFactory类属于命名空间,在下文中一共展示了IControlFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PanelFactory
/// <summary>
/// A constructor as before, but with a UIDefName specified
/// </summary>
public PanelFactory(BusinessObject bo, string uiDefName, IControlFactory controlFactory)
{
_uiDefName = uiDefName;
_controlFactory = controlFactory;
BOMapper mapper = new BOMapper(bo);
IUIDef uiDef = mapper.GetUIDef(uiDefName);
if (uiDef == null)
{
string errMessage = "Cannot create a panel factory for '" + bo.ClassDef.ClassName
+ "' since the classdefs do not contain a uiDef '" + uiDefName + "'";
throw new HabaneroDeveloperException
("There is a serious application error please contact your system administrator"
+ Environment.NewLine + errMessage, errMessage);
}
_uiForm = uiDef.GetUIFormProperties();
if (_uiForm == null)
{
string errMsg = "Cannot create a panel factory for '" + bo.ClassDef.ClassName
+ "' since the classdefs do not contain a form def for uidef '" + uiDefName + "'";
throw new HabaneroDeveloperException
("There is a serious application error please contact your system administrator"
+ Environment.NewLine + errMsg, errMsg);
}
InitialiseFactory(bo);
}
示例2: InputFormComboBox
///<summary>
/// Constructor for <see cref="InputFormComboBox"/>
///</summary>
///<param name="controlFactory"></param>
///<param name="message"></param>
///<param name="choices"></param>
public InputFormComboBox(IControlFactory controlFactory, string message, List<object> choices)
{
_controlFactory = controlFactory;
_message = message;
_comboBox = _controlFactory.CreateComboBox();
choices.ForEach(item => _comboBox.Items.Add(item));
}
示例3: ColumnLayoutManager
/// <summary>
/// Constructs the <see cref="CollapsiblePanelGroupManager"/>
/// </summary>
// ReSharper disable SuggestBaseTypeForParameter
public CollapsiblePanelGroupManager
(ICollapsiblePanelGroupControl collapsiblePanelGroup, IControlFactory controlFactory)
{
ControlFactory = controlFactory;
PanelsList = new List<ICollapsiblePanel>();
ColumnLayoutManager = new ColumnLayoutManager(collapsiblePanelGroup, ControlFactory);
}
示例4: TextBoxMapper
/// <summary>
/// Constructor to initialise a new instance of the mapper
/// </summary>
/// <param name="tb">The TextBox to map</param>
/// <param name="propName">The property name</param>
/// <param name="isReadOnly">Whether this control is read only</param>
/// <param name="factory">the control factory to be used when creating the controlMapperStrategy</param>
public TextBoxMapper(ITextBox tb, string propName, bool isReadOnly, IControlFactory factory)
: base(tb, propName, isReadOnly, factory)
{
_textBox = tb;
_textBoxMapperStrategy = factory.CreateTextBoxMapperStrategy();
_oldText = "";
}
示例5: MainTitleIconControlWin
/// <summary>
/// Constructs a <see cref="MainTitleIconControlWin"/>
/// </summary>
public MainTitleIconControlWin(IControlFactory controlFactory)
{
if (controlFactory == null) throw new ArgumentNullException("controlFactory");
_controlFactory = controlFactory;
_panel = _controlFactory.CreatePanel();
((PanelWin)_panel).BackgroundImage = CollapsiblePanelResource.headergradient;
_panel.BackColor = Color.Transparent;
_panel.Dock = Habanero.Faces.Base.DockStyle.Top;
_panel.Height = 23;
_icon = _controlFactory.CreateLabel();
((LabelWin)_icon).BackgroundImage = CollapsiblePanelResource.headergradient;
_icon.BackColor = Color.Transparent;
((LabelWin)_icon).BackgroundImageLayout = ImageLayout.Center;
_icon.Dock = Habanero.Faces.Base.DockStyle.Left;
_icon.Size = new Size(20, 20);
_title = _controlFactory.CreateLabel();
_title.Dock = Habanero.Faces.Base.DockStyle.Fill;
_title.BackColor = Color.Transparent;
_title.TextAlign = ContentAlignment.MiddleLeft;
_title.ForeColor = Color.White;
_panel.Controls.Add(_title);
_panel.Controls.Add(_icon);
_panel.MaximumSize = new Size(2000, 23);
this.Dock = DockStyleWin.GetDockStyle(DockStyle.Top);
this.Controls.Add((PanelWin)_panel);
this.Height = 23;
}
示例6: NumericUpDownCurrencyMapper
/// <summary>
/// Constructor to initialise a new instance of the class
/// </summary>
/// <param name="numericUpDownControl">The numericUpDownControl object to map</param>
/// <param name="propName">The property name</param>
/// <param name="isReadOnly">Whether this control is read only</param>
/// <param name="factory">the control factory to be used when creating the controlMapperStrategy</param>
public NumericUpDownCurrencyMapper(INumericUpDown numericUpDownControl, string propName, bool isReadOnly, IControlFactory factory)
: base(numericUpDownControl, propName, isReadOnly, factory)
{
_numericUpDown.DecimalPlaces = 2;
_numericUpDown.Maximum = decimal.MaxValue;
_numericUpDown.Minimum = decimal.MinValue;
}
示例7: GridLayoutManager
/// <summary>
/// Constructor to initialise a new grid layout
/// </summary>
/// <param name="managedControl">The control to manage</param>
/// <param name="controlFactory">The control factory used to create any controls</param>
public GridLayoutManager(IControlHabanero managedControl, IControlFactory controlFactory)
: base(managedControl, controlFactory)
{
_controls = new List<IControlHabanero>();
_controlInfoTable = new Hashtable();
this.SetGridSize(2, 2);
}
示例8: GetControlFactory
protected override IControlFactory GetControlFactory()
{
if ((_factory == null)) _factory = new ControlFactoryVWG();
GlobalUIRegistry.ControlFactory = _factory;
return _factory;
}
示例9: ComboBoxSelectorVWG
///<summary>
/// Constructor for <see cref="ComboBoxSelectorVWG"/>
///</summary>
///<param name="controlFactory"></param>
public ComboBoxSelectorVWG(IControlFactory controlFactory)
{
if (controlFactory == null) throw new ArgumentNullException("controlFactory");
_manager = new ComboBoxCollectionSelector(this, controlFactory);
_manager.IncludeBlankItem = true;
_manager.BusinessObjectSelected += delegate { FireBusinessObjectSelected(); };
}
示例10: EditableGridButtonsControlVWG
///<summary>
/// Creates the <see cref="EditableGridButtonsControlVWG"/>
///</summary>
///<param name="controlFactory"></param>
public EditableGridButtonsControlVWG(IControlFactory controlFactory) : base(controlFactory)
{
IButton cancelButton = AddButton("Cancel", FireCancelButtonClicked);
cancelButton.Visible = true;
IButton saveButton = AddButton("Save", FireSaveButtonClicked);
saveButton.Visible = true;
}
示例11: EnumComboBoxMapper
/// <summary>
/// Instantiates a new mapper
/// </summary>
/// <param name="comboBox">The ComboBox to map</param>
/// <param name="propName">The property name</param>
/// <param name="isReadOnly">Whether this control is read only</param>
/// <param name="factory">The control factory to be used when creating the controlMapperStrategy</param>
public EnumComboBoxMapper(IComboBox comboBox, string propName, bool isReadOnly, IControlFactory factory)
: base(comboBox, propName, isReadOnly, factory)
{
_mapperStrategy = factory.CreateLookupComboBoxDefaultMapperStrategy();
if (_mapperStrategy == null) return;
_mapperStrategy.AddHandlers(this);
}
示例12: ListComboBoxMapper
///<summary>
/// Constructor form <see cref="ListComboBoxMapper"/>
///</summary>
///<param name="ctl"></param>
///<param name="propName"></param>
///<param name="isReadOnly"></param>
///<param name="factory"></param>
public ListComboBoxMapper(IControlHabanero ctl, string propName, bool isReadOnly, IControlFactory factory)
: base(ctl, propName, isReadOnly, factory)
{
_comboBox = (IComboBox)ctl;
_mapperStrategy = factory.CreateListComboBoxMapperStrategy();
_mapperStrategy.AddItemSelectedEventHandler(this);
}
示例13: GetControlFactory
protected IControlFactory GetControlFactory()
{
if ((_factory == null)) _factory = new ControlFactoryWin();
GlobalUIRegistry.ControlFactory = _factory;
return _factory;
}
示例14: CollapsiblePanelSelectorWin
///<summary>
/// Constructor for <see cref="CollapsiblePanelSelectorWin"/>
///</summary>
///<param name="controlFactory"></param>
///<exception cref="NotImplementedException"></exception>
public CollapsiblePanelSelectorWin(IControlFactory controlFactory)
{
_controlFactory = controlFactory;
if (controlFactory == null) throw new ArgumentNullException("controlFactory");
this.ItemSelected += delegate { FireBusinessObjectSelected(); };
this.AutoSelectFirstItem = true;
}
示例15: MainTitleIconControlVWG
/// <summary>
/// Constructs a <see cref="MainTitleIconControlVWG"/>
/// </summary>
public MainTitleIconControlVWG(IControlFactory controlFactory)
{
if (controlFactory == null) throw new ArgumentNullException("controlFactory");
_controlFactory = controlFactory;
_panel = _controlFactory.CreatePanel();
((PanelVWG)_panel).BackgroundImage = @"Images.headergradient.png";
_panel.BackColor = Color.Transparent;
_panel.Dock = Habanero.Faces.Base.DockStyle.Top;
_panel.Height = 23;
this.Size = new Size(_panel.Width,_panel.Height);
_icon = _controlFactory.CreateLabel();
((LabelVWG)_icon).BackgroundImage = "";
_icon.BackColor = Color.Transparent;
((LabelVWG)_icon).BackgroundImageLayout = ImageLayout.Center;
_icon.Dock = Habanero.Faces.Base.DockStyle.Left;
_icon.Size = new Size(20, 20);
_title = _controlFactory.CreateLabel();
_title.Font = new Font("Verdana", 10);
_title.Dock = Habanero.Faces.Base.DockStyle.Fill;
_title.BackColor = Color.Transparent;
_title.TextAlign = ContentAlignment.MiddleLeft;
_title.ForeColor = Color.White;
_panel.Controls.Add(_title);
_panel.Controls.Add(_icon);
this.Dock = DockStyleVWG.GetDockStyle(DockStyle.Top);
this.Controls.Add((PanelVWG)_panel);
this.Height = 23;
}