• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# IControlFactory类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IControlFactory的典型用法代码示例。如果您正苦于以下问题:C# IControlFactory类的具体用法?C# IControlFactory怎么用?C# IControlFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IControlFactory类属于命名空间,在下文中一共展示了IControlFactory类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
        }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:29,代码来源:PanelFactory.cs


示例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));
 }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:13,代码来源:InputFormComboBox.cs


示例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);
 }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:11,代码来源:CollapsiblePanelGroupManager.cs


示例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 = "";
 }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:14,代码来源:TextBoxMapper.cs


示例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;
        }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:34,代码来源:MainTitleIconControlWin.cs


示例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;
 }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:14,代码来源:NumericUpDownCurrencyMapper.cs


示例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);
 }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:12,代码来源:GridLayoutManager.cs


示例8: GetControlFactory

        protected override IControlFactory GetControlFactory()
        {
            if ((_factory == null)) _factory = new ControlFactoryVWG();

            GlobalUIRegistry.ControlFactory = _factory;
            return _factory;
        }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:7,代码来源:TestMenuItemVWG.cs


示例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(); };
 }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:11,代码来源:ComboBoxSelectorVWG.cs


示例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;
 }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:11,代码来源:EditableGridButtonsControlVWG.cs


示例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);
 }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:14,代码来源:EnumComboBoxMapper.cs


示例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);
 }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:14,代码来源:ListComboBoxMapper.cs


示例13: GetControlFactory

        protected IControlFactory GetControlFactory()
        {
            if ((_factory == null)) _factory = new ControlFactoryWin();

            GlobalUIRegistry.ControlFactory = _factory;
            return _factory;
        }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:7,代码来源:TestMenuItemCollectionWin.cs


示例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;
 }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:12,代码来源:CollapsiblePanelSelectorWin.cs


示例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;
        }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:36,代码来源:MainTitleIconControlVWG.cs


示例16: CollapsiblePanelManager

        ///<summary>
        /// Constructor for <see cref="CollapsiblePanelManager"/>
        ///</summary>
        ///<param name="collapsiblePanel"></param>
        ///<param name="controlFactory"></param>
        public CollapsiblePanelManager(ICollapsiblePanel collapsiblePanel, IControlFactory controlFactory)
        {
            _controlFactory = controlFactory;
            _collapsiblePanel = collapsiblePanel;
            _collapseButton = _controlFactory.CreateButtonCollapsibleStyle();


            _collapseButton.Click += delegate { Collapsed = !Collapsed; };
            _pinLabel = controlFactory.CreateLabelPinOffStyle();
            _pinLabel.Click += delegate { Pinned = !Pinned; };

            IPanel buttonPanel = _controlFactory.CreatePanel();
            BorderLayoutManager buttonLayoutManager =
                _controlFactory.CreateBorderLayoutManager(buttonPanel);
            buttonPanel.Height = _collapseButton.Height;

            buttonLayoutManager.AddControl(_collapseButton, BorderLayoutManager.Position.Centre);
            buttonLayoutManager.AddControl(_pinLabel, BorderLayoutManager.Position.East);

            _layoutManager = _controlFactory.CreateBorderLayoutManager(collapsiblePanel);
            _layoutManager.AddControl(buttonPanel, BorderLayoutManager.Position.North);


            _collapseButton.BackColor = System.Drawing.Color.Transparent;
            _collapseButton.ForeColor = System.Drawing.Color.Transparent;
        }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:31,代码来源:CollapsiblePanelManager.cs


示例17: HelpAboutBoxManager

        ///<summary>
        /// Constructor for the <see cref="HelpAboutBoxManager"/>
        ///</summary>
        ///<param name="controlFactory"></param>
        ///<param name="formHabanero"></param>
        ///<param name="programName"></param>
        ///<param name="producedForName"></param>
        ///<param name="producedByName"></param>
        ///<param name="versionNumber"></param>
        public HelpAboutBoxManager(IControlFactory controlFactory, IFormHabanero formHabanero, string programName, string producedForName, string producedByName, string versionNumber)
        {
            _FormHabanero = formHabanero;
            _mainPanel = controlFactory.CreatePanel();
            GridLayoutManager mainPanelManager = new GridLayoutManager(_mainPanel, controlFactory);
            mainPanelManager.SetGridSize(4, 2);
            mainPanelManager.FixAllRowsBasedOnContents();
            mainPanelManager.FixColumnBasedOnContents(0);
            mainPanelManager.FixColumnBasedOnContents(1);
            mainPanelManager.AddControl(controlFactory.CreateLabel("Programme Name:", false));
            mainPanelManager.AddControl(controlFactory.CreateLabel(programName, false));
            mainPanelManager.AddControl(controlFactory.CreateLabel("Produced For:", false));
            mainPanelManager.AddControl(controlFactory.CreateLabel(producedForName, false));
            mainPanelManager.AddControl(controlFactory.CreateLabel("Produced By:", false));
            mainPanelManager.AddControl(controlFactory.CreateLabel(producedByName, false));
            mainPanelManager.AddControl(controlFactory.CreateLabel("Version:", false));
            mainPanelManager.AddControl(controlFactory.CreateLabel(versionNumber, false));

            IButtonGroupControl buttons = controlFactory.CreateButtonGroupControl();
            buttons.AddButton("OK", new EventHandler(OKButtonClickHandler));

            BorderLayoutManager manager = controlFactory.CreateBorderLayoutManager(formHabanero);
            manager.AddControl(_mainPanel, BorderLayoutManager.Position.Centre);
            manager.AddControl(buttons, BorderLayoutManager.Position.South);
            formHabanero.Width = 300;
            formHabanero.Height = 200;
            formHabanero.Text = "About";
        }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:37,代码来源:HelpAboutBoxManager.cs


示例18: WizardFormWin

        /// <summary>
        /// Initialises the WizardForm, sets the controller and starts the wizard.
        /// </summary>
        /// <param name="controller">the wizrd controller that controls moving the wizard steps and the </param>
        /// <param name="controlFactory">The control factory to use for creating any controls</param>
        public WizardFormWin(IWizardController controller, IControlFactory controlFactory)
        {
            _wizardController = controller;
            var wizardControl = (WizardControlWin) controlFactory.CreateWizardControl(controller);

            SetupWizardControl(wizardControl);
        }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:12,代码来源:WizardFormWin.cs


示例19: FlowLayoutManager

 /// <summary>
 /// Constructor to initialise a new manager
 /// </summary>
 /// <param name="managedControl">The control to manage e.g. a Panel</param>
 /// <param name="controlFactory">The factory which generates controls</param>
 public FlowLayoutManager(IControlHabanero managedControl, IControlFactory controlFactory)
     : base(managedControl, controlFactory)
 {
     _controls = new List<IControlHabanero>();
     _newLinePositions = new ArrayList(3);
     _gluePositions = new ArrayList(5);
 }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:12,代码来源:FlowLayoutManager.cs


示例20: NumericUpDownMapper

 /// <summary>
 /// Constructor to instantiate a new instance of the class
 /// </summary>
 /// <param name="ctl">The control object to map</param>
 /// <param name="propName">The property name</param>
 /// <param name="isReadOnly">Whether the control is read only.
 /// If so, it then becomes disabled.  If not,
 /// handlers are assigned to manage key presses, depending on the strategy assigned to this mapper.</param>
 /// <param name="factory">The control factory to be used when creating the controlMapperStrategy</param>
 protected NumericUpDownMapper(INumericUpDown ctl, string propName, bool isReadOnly, IControlFactory factory)
     : base(ctl, propName, isReadOnly, factory)
 {
     _numericUpDown = (INumericUpDown)ctl;
     _mapperStrategy = factory.CreateNumericUpDownMapperStrategy();
     _mapperStrategy.ValueChanged(this);
 }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:16,代码来源:NumericUpDownMapper.cs



注:本文中的IControlFactory类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IControlHabanero类代码示例发布时间:2022-05-24
下一篇:
C# IControl类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap