private void OnItemChecked (object sender, SWF.ItemCheckEventArgs args)
		{
			if (args.Index == ((ListItemProvider) Provider).Index) {
				newValue = args.NewValue;
				RaiseAutomationPropertyChangedEvent ();
			}
		}
Пример #2
0
 private void OnItemChecked(object sender, SWF.ItemCheckEventArgs args)
 {
     if (args.Index == ((ListItemProvider)Provider).Index)
     {
         newValue = args.NewValue;
         RaiseAutomationPropertyChangedEvent();
     }
 }
Пример #3
0
 internal void SetLogType(LogType logType, System.Windows.Forms.CheckState checkState)
 {
     if (checkState == CheckState.Checked)
     {
         AddLogType(logType);
     }
     else
     {
         RemoveLogType(logType);
     }
 }
Пример #4
0
        public override System.Windows.Forms.CheckState Check()
        {
            System.Windows.Forms.CheckState checkState = System.Windows.Forms.CheckState.Unchecked;
            try
            {
            }
            catch
            {
            }

            return(checkState);
        }
Пример #5
0
        private void PerformToggle(SWF.ToolStripButton button, SWF.CheckState state)
        {
            SWF.ToolStrip toolstrip = ((SWF.ToolStripButton)Provider.Component).Owner;
            if (toolstrip.InvokeRequired)
            {
                toolstrip.BeginInvoke(new PerformToggleDelegate(PerformToggle),
                                      new object [] { button, state });
                return;
            }

            button.CheckState = state;
        }
Пример #6
0
        public static bool?getBoolFromCheckState(System.Windows.Forms.CheckState cs)
        {
            switch (cs)
            {
            case System.Windows.Forms.CheckState.Indeterminate: return(null);

            case System.Windows.Forms.CheckState.Checked: return(true);

            case System.Windows.Forms.CheckState.Unchecked: return(false);

            default: return(null);    //Exception?
            }
        }
Пример #7
0
 internal void setChecked(bool value)
 {
     if (_checked != value)
     {
         _checked = value;
         if (_checked)
         {
             _checkState = System.Windows.Forms.CheckState.Checked;
         }
         else
         {
             _checkState = System.Windows.Forms.CheckState.Unchecked;
         }
         _owner._invokeNodeChecked(this);
     }
 }
Пример #8
0
        void IStateTreeNode.UpdateState(System.Windows.Forms.TreeViewCancelEventArgs e)
        {
            switch (CheckState)
            {
            case System.Windows.Forms.CheckState.Checked:
                CheckState = System.Windows.Forms.CheckState.Checked;
                break;

            case System.Windows.Forms.CheckState.Indeterminate:
                this.CheckState = System.Windows.Forms.CheckState.Indeterminate;
                break;

            case System.Windows.Forms.CheckState.Unchecked:
                CheckState = System.Windows.Forms.CheckState.Unchecked;
                break;
            }
        }
        private void PerformToggle(SWF.CheckState state)
        {
            if (provider.ItemProvider.DataGridView.InvokeRequired)
            {
                provider.ItemProvider.DataGridView.BeginInvoke(new PerformToggleDelegate(PerformToggle),
                                                               new object [] { state });
                return;
            }

            // FIXME: Validate InvalidCastException ? (thrown usually because of ValueType)

            SWF.DataGridViewCell oldCell = provider.ItemProvider.DataGridView.CurrentCell;
            provider.ItemProvider.DataGridView.CurrentCell = provider.CheckBoxCell;
//			provider.ItemProvider.DataGridView.BeginEdit (false);
            provider.CheckBoxCell.Value = state;
//			provider.ItemProvider.DataGridView.EndEdit ();
            provider.ItemProvider.DataGridView.CurrentCell = oldCell;
        }
Пример #10
0
 public CheckBoxEx()
 {
     //text = "";
     bChecked     = false;
     foreColor    = SystemColors.ControlText;
     backColor    = Color.Empty;
     textColor    = SystemColors.ControlText;
     textBrush    = new SolidBrush(textColor);
     forePen      = new Pen(this.ForeColor);
     borderStyle  = BorderStyle.None;
     checkState   = CheckState.Unchecked;
     autoCheck    = true;
     raiseEvent   = false;
     hotClickArea = new Rectangle(2, 2, 14, 14);
     this.Font    = new Font("Tahoma", 9F, FontStyle.Regular);
     this.Width   = 70;
     this.Height  = 20;
 }
Пример #11
0
        protected override void OnMouseDown(MouseEventArgs e)
        {
            this.Focus();

            raiseEvent = false;
            if ((hotClickArea.Contains(e.X, e.Y)) && (autoCheck == true))
            {
                if (bChecked)
                {
                    checkState = CheckState.Unchecked;
                }
                else
                {
                    checkState = CheckState.Checked;
                }

                bChecked   = !bChecked;
                raiseEvent = true;
                this.Invalidate();
            }
        }
Пример #12
0
 /// <summary>
 /// Initializes a new instance of the CheckBox2 class
 /// </summary>
 public CheckBox2()
 {
     InitializeComponent();
     using (Graphics g = this.CreateGraphics())
         m_scale = (int)StaticMethods.Scale(g);
     text         = Name;
     bChecked     = false;
     foreColor    = SystemColors.ControlText;
     backColor    = Color.Empty;
     textColor    = SystemColors.ControlText;
     textBrush    = new SolidBrush(textColor);
     forePen      = new Pen(this.ForeColor);
     borderStyle  = BorderStyle.None;
     checkState   = CheckState.Unchecked;
     autoCheck    = true;
     raiseEvent   = false;
     hotClickArea = new Rectangle(2, 2, CheckRectangleWidth, CheckRectangleHeight);
     this.Font    = new Font("Tahoma", 9F, FontStyle.Regular);
     this.Width   = 100 * m_scale;
     this.Height  = 20 * m_scale;
 }
Пример #13
0
        public void set_ItemsChecks(Int32 xIndex, System.Windows.Forms.CheckState value)
        {
            StretchArray();

            if (xIndex <0 | xIndex> this.Items.Count)
            {
                return;
            }

            if (mKillEvents3 != 0)
            {
                mItemsChecks[xIndex] = value;
            }
            else
            {
                if (this.CheckBoxes)
                {
                    StretchArray(); //clefranc BUG3
                    if (!this.DroppedDown)
                    {
                        if (mItemsChecks == null)
                        {
                            if (this.mChecked == CheckState.Checked)
                            {
                                CheckAll();
                            }
                            else
                            {
                                CheckNone();
                            }
                        }
                        else
                        {
                            mItemsChecks[xIndex] = value;
                            this.Text            = FormatCheckString();
                        }
                    }
                }
            }
        }
Пример #14
0
        /// <summary>
        /// Raises the MouseDown event
        /// </summary>
        /// <param name="e"></param>
        protected override void OnMouseDown(MouseEventArgs e)
        {
            this.Focus();

            raiseEvent = false;
            if ((new Rectangle(0, 0, this.Width, this.Height).Contains(e.X, e.Y)) && (autoCheck == true))
            {
                if (bChecked)
                {
                    checkState = CheckState.Unchecked;
                }
                else
                {
                    checkState = CheckState.Checked;
                }

                bChecked   = !bChecked;
                raiseEvent = true;
                this.Invalidate();
            }

            base.OnMouseDown(e);
        }
Пример #15
0
 internal void setCheckState(System.Windows.Forms.CheckState state)
 {
     if (_checkState != state)
     {
         _checkState = state;
         if (_checkState == System.Windows.Forms.CheckState.Checked)
         {
             if (!_checked)
             {
                 _checked = true;
                 _owner._invokeNodeChecked(this);
             }
         }
         else if (_checkState == System.Windows.Forms.CheckState.Unchecked)
         {
             if (_checked)
             {
                 _checked = false;
                 _owner._invokeNodeChecked(this);
             }
         }
     }
 }
Пример #16
0
        private void PerformToggle(SWF.CheckBox checkbox, SWF.CheckState state)
        {
            if (checkbox.InvokeRequired == true)
            {
                checkbox.BeginInvoke(new PerformToggleDelegate(PerformToggle),
                                     new object [] { checkbox, state });
                return;
            }

            // NOTE: We can count on presence of InvokeOnClick;
            //       it is a protected member of CheckBox.
            //
            //       This basically simulates a click, which always
            //       raises the Click event, but strangely does not
            //       raise CheckChanged when transitioning to
            //       Indeterminate state. This matches MS behavior.
            MethodInfo invokeOnClick =
                typeof(SWF.CheckBox).GetMethod("InvokeOnClick",
                                               BindingFlags.NonPublic |
                                               BindingFlags.Instance);

            invokeOnClick.Invoke(checkbox,
                                 new object [] { checkbox, EventArgs.Empty });
        }
Пример #17
0
        public override ToggleState GetItemToggleState(ListItemProvider item)
        {
            if (ContainsItem(item) == true)
            {
                SWF.CheckedListBox checkedListBox = (SWF.CheckedListBox)Control;

                SWF.CheckState state = checkedListBox.GetItemCheckState(item.Index);
                switch (state)
                {
                case SWF.CheckState.Checked:
                    return(ToggleState.On);

                case SWF.CheckState.Unchecked:
                    return(ToggleState.Off);

                default:
                    return(ToggleState.Indeterminate);
                }
            }
            else
            {
                return(ToggleState.Indeterminate);
            }
        }
Пример #18
0
 /// <summary>
 /// Инициализирует новый экземпляр класса NestedTripleTreeNode с заданной текстовой меткой и значением состояния.
 /// </summary>
 /// <param name="text">Метка нового узла дерева.</param>
 /// <param name="state">Состояние узла.</param>
 public NestedTripleTreeNode(string text, System.Windows.Forms.CheckState state) : base(text, state)
 {
 }
Пример #19
0
		protected override void OnMouseDown(MouseEventArgs e)
		{
			this.Focus();

			raiseEvent = false;
			if ((hotClickArea.Contains(e.X, e.Y)) && (autoCheck == true))
			{
				if (bChecked) 
					checkState = CheckState.Unchecked;
				else
					checkState = CheckState.Checked;

				bChecked = !bChecked;
				raiseEvent = true;
				this.Invalidate();
			}

		}
Пример #20
0
		public CheckBoxEx()
		{
			//text = "";
			bChecked = false;
			foreColor = SystemColors.ControlText;
			backColor = Color.Empty;
			textColor = SystemColors.ControlText;
			textBrush = new SolidBrush(textColor);
			forePen = new Pen(this.ForeColor);
			borderStyle = BorderStyle.None;
			checkState = CheckState.Unchecked;
			autoCheck = true;
			raiseEvent = false;
			hotClickArea = new Rectangle(2, 2, 14, 14);
			this.Font = new Font("Tahoma", 9F, FontStyle.Regular);
			this.Width = 70;
			this.Height = 20;
		}
Пример #21
0
 /// <summary>
 /// Инициализирует новый объект класса TripleTreeNode по параметрам.
 /// </summary>
 /// <param name="text">Текстовая метка узла.</param>
 /// <param name="value">Хранимое значение.</param>
 /// <param name="state">Состояние узла.</param>
 /// <param name="children">Массив дочерних объектов NestedTripleTreeNode.</param>
 public NestedTripleTreeNode(string text, object value, System.Windows.Forms.CheckState state, NestedTripleTreeNode[] children) : base(text, value, state, children)
 {
 }
Пример #22
0
        public void SelectLookupInputColumn(System.Windows.Forms.CheckedListBox clbInputColumns, System.Windows.Forms.ListBox lbSelectedItems, int checkedIndex, System.Windows.Forms.CheckState state, int nullColumnLineageId)
        {
            FormInputColumn icol = clbInputColumns.Items[checkedIndex] as FormInputColumn;

            IDTSInput input = ComponentMetadata.InputCollection[0];

            if (icol != null)
            {
                if (state == CheckState.Checked)
                {
                    DesignTimeComponent.SetUsageType(input.ID, VirtualInput, icol.LineageID, DTSUsageType.UT_READONLY);

                    IDTSInputColumn inputCol = input.InputColumnCollection.GetInputColumnByLineageID(icol.LineageID);

                    IDTSCustomProperty keyCol = inputCol.CustomPropertyCollection[Resources.LookupErrorAggIsKeyColumnName];
                    keyCol.Value = true;

                    icol.DTSInputColumn = inputCol;


                    if (lbSelectedItems != null && !lbSelectedItems.Items.Contains(icol))
                    {
                        int sortOrder = 0;
                        if (lbSelectedItems.Items.Count > 0)
                        {
                            FormInputColumn lastCol = lbSelectedItems.Items[lbSelectedItems.Items.Count - 1] as FormInputColumn;
                            sortOrder = lastCol.SortOrder;
                        }
                        icol.SortOrder = sortOrder + 1;

                        lbSelectedItems.Items.Add(icol);
                    }
                }
                else
                {
                    bool isInput = false;
                    if (icol.DTSInputColumn != null)
                    {
                        IDTSCustomProperty prop = icol.DTSInputColumn.CustomPropertyCollection[Resources.LookupErrorAggIsNullColumnName];
                        isInput = (bool)prop.Value;
                        IDTSCustomProperty keyCol = icol.DTSInputColumn.CustomPropertyCollection[Resources.LookupErrorAggIsKeyColumnName];
                        keyCol.Value = false;
                    }

                    if (!isInput)
                    {
                        DesignTimeComponent.SetUsageType(input.ID, VirtualInput, icol.LineageID, DTSUsageType.UT_IGNORED);
                        icol.DTSInputColumn = null;
                    }

                    if (lbSelectedItems != null && lbSelectedItems.Items.Contains(icol))
                    {
                        lbSelectedItems.Items.Remove(icol);
                    }
                }
            }
        }
 /// <summary>Initalize a new instance of SelectedDirectoriesChangedEventArgs</summary>
 public SelectedDirectoriesChangedEventArgs(string path, System.Windows.Forms.CheckState checkState)
 {
     _path       = path;
     _checkState = checkState;
 }
Пример #24
0
 public override Image GetCheckBoxImage(bool enabled, System.Windows.Forms.CheckState checkState, bool tracking, bool pressed)
 {
     return(GetScaledImage(base.GetCheckBoxImage(enabled, checkState, tracking, pressed)));
 }
 /// <summary>Initalize a new instance of SelectedDirectoriesChangedEventArgs</summary>
 public SelectedDirectoriesChangedEventArgs(string path, System.Windows.Forms.CheckState checkState)
 {
     _path = path;
     _checkState = checkState;
 }