예제 #1
0
        protected override IControlFactory GetControlFactory()
        {
            IControlFactory factory = new ControlFactoryWin();

            GlobalUIRegistry.ControlFactory = factory;
            return(factory);
        }
예제 #2
0
        private static IControlFactory GetControlFactory()
        {
            ControlFactoryWin factory = new ControlFactoryWin();

            GlobalUIRegistry.ControlFactory = factory;
            return(factory);
        }
예제 #3
0
        protected override IBOComboBoxSelector CreateComboBoxControl()
        {
            ControlFactoryWin factory = new ControlFactoryWin();

            GlobalUIRegistry.ControlFactory = factory;
            return(new ComboBoxSelectorWin());
        }
 protected override EnumComboBoxMapper CreateComboBox(string propertyName, bool setBO)
 {
     EnumBO bo = new EnumBO();
     ComboBoxWin comboBox = new ComboBoxWin();
     IControlFactory controlFactory = new ControlFactoryWin();
     EnumComboBoxMapper enumComboBoxMapper = new EnumComboBoxMapper(comboBox, propertyName, false, controlFactory);
     if (setBO) enumComboBoxMapper.BusinessObject = bo;
     return enumComboBoxMapper;
 }
        public GenericGridFilterControlWin(IGridBase grid)
        {
            var ds = grid.DataSource as DataView;
            if (ds != null) this._originalView = ds;
            (grid as DataGridView).DataSourceChanged += this.DataSourceChanged;

            this._lastForcedEvents = DateTime.Now;
            this.Grid = grid;
            this._timer = new Timer()
            {
                Enabled = true,
                Interval = 500,
            };
            this._timer.Tick += (sender, e) => 
            {
                if ((this._filterRequired) && (this._lastFilterChanged.AddMilliseconds(this._timer.Interval) < DateTime.Now))
                {
                    if (this._inFilter)
                        this._cancelCurrentFilter = true;
                    this._filterRequired = false;
                    this.DoFilter();
                }
            };

            var factory = new ControlFactoryWin();
            this._filterLabel = factory.CreateLabel("Filter:");
            this._filterTextBox = factory.CreateTextBox();
            var txt = this._filterTextBox as TextBox;
            txt.TextChanged += (sender, e) =>
                {
                    if (txt.Text == this._lastFilterText) return;
                    this._lastFilterChanged = DateTime.Now;
                    this._filterRequired = true;
                };
            var manager = factory.CreateBorderLayoutManager(this);
            manager.AddControl(this._filterLabel, BorderLayoutManager.Position.West);
            manager.AddControl(this._filterTextBox, BorderLayoutManager.Position.Centre);
            var vgap = manager.VerticalGapSize + manager.BorderSize;
            this.Height = this._filterTextBox.Height + 2 * vgap;

            this.FilterStarted += (sender, e) =>
                {
                    this.SetUIState(true);
                };
            this.FilterCompleted += (sender, e) =>
                {
                    this.SetUIState(false);
                };
            var wingrid = Grid as DataGridView;
            if (wingrid != null)
            {
                this._gridOriginalAlternatingStyle = wingrid.AlternatingRowsDefaultCellStyle;
                wingrid.AlternatingRowsDefaultCellStyleChanged += this.RecordGridAltStyle;
            }
        }
예제 #6
0
        protected override EnumComboBoxMapper CreateComboBox(string propertyName, bool setBO)
        {
            EnumBO             bo                 = new EnumBO();
            ComboBoxWin        comboBox           = new ComboBoxWin();
            IControlFactory    controlFactory     = new ControlFactoryWin();
            EnumComboBoxMapper enumComboBoxMapper = new EnumComboBoxMapper(comboBox, propertyName, false, controlFactory);

            if (setBO)
            {
                enumComboBoxMapper.BusinessObject = bo;
            }
            return(enumComboBoxMapper);
        }
 protected override void CreateControlFactory()
 {
     _controlFactory = new ControlFactoryWin();
     GlobalUIRegistry.ControlFactory = _controlFactory;
 }
 private static IControlFactory GetControlFactory()
 {
     ControlFactoryWin factory = new ControlFactoryWin();
     GlobalUIRegistry.ControlFactory = factory;
     return factory;
 }
 protected override IControlFactory GetControlFactory()
 {
     IControlFactory controlFactory = new ControlFactoryWin();
     GlobalUIRegistry.ControlFactory = controlFactory;
     return controlFactory;
 }
 protected override IBOComboBoxSelector CreateComboBoxControl()
 {
     ControlFactoryWin factory = new ControlFactoryWin();
     GlobalUIRegistry.ControlFactory = factory;
     return new ComboBoxSelectorWin();
 }
 protected override void CreateControlFactory()
 {
     _controlFactory = new ControlFactoryWin();
     GlobalUIRegistry.ControlFactory = _controlFactory;
 }
예제 #12
0
        public GenericGridFilterControlWin(IGridBase grid)
        {
            var ds = grid.DataSource as DataView;

            if (ds != null)
            {
                this._originalView = ds;
            }
            (grid as DataGridView).DataSourceChanged += this.DataSourceChanged;

            this._lastForcedEvents = DateTime.Now;
            this.Grid   = grid;
            this._timer = new Timer()
            {
                Enabled  = true,
                Interval = 500,
            };
            this._timer.Tick += (sender, e) =>
            {
                if ((this._filterRequired) && (this._lastFilterChanged.AddMilliseconds(this._timer.Interval) < DateTime.Now))
                {
                    if (this._inFilter)
                    {
                        this._cancelCurrentFilter = true;
                    }
                    this._filterRequired = false;
                    this.DoFilter();
                }
            };

            var factory = new ControlFactoryWin();

            this._filterLabel   = factory.CreateLabel("Filter:");
            this._filterTextBox = factory.CreateTextBox();
            var txt = this._filterTextBox as TextBox;

            txt.TextChanged += (sender, e) =>
            {
                if (txt.Text == this._lastFilterText)
                {
                    return;
                }
                this._lastFilterChanged = DateTime.Now;
                this._filterRequired    = true;
            };
            var manager = factory.CreateBorderLayoutManager(this);

            manager.AddControl(this._filterLabel, BorderLayoutManager.Position.West);
            manager.AddControl(this._filterTextBox, BorderLayoutManager.Position.Centre);
            var vgap = manager.VerticalGapSize + manager.BorderSize;

            this.Height = this._filterTextBox.Height + 2 * vgap;

            this.FilterStarted += (sender, e) =>
            {
                this.SetUIState(true);
            };
            this.FilterCompleted += (sender, e) =>
            {
                this.SetUIState(false);
            };
            var wingrid = Grid as DataGridView;

            if (wingrid != null)
            {
                this._gridOriginalAlternatingStyle              = wingrid.AlternatingRowsDefaultCellStyle;
                wingrid.AlternatingRowsDefaultCellStyleChanged += this.RecordGridAltStyle;
            }
        }