Ejemplo n.º 1
0
 protected internal virtual bool OnItemCheckedChanging(RadCheckedListDataItemCancelEventArgs args)
 {
     if (this.ItemCheckedChanging != null)
     {
         this.ItemCheckedChanging((object)this, args);
     }
     return(args.Cancel);
 }
Ejemplo n.º 2
0
 public void SetCheckState(bool value, bool silent)
 {
     if (this.setCheckState || !this.checkedElement.ShowCheckAllItems || this.isChecked == value)
     {
         return;
     }
     this.setCheckState = true;
     if (this.CheckAllItemCheckedChanging != null)
     {
         RadCheckedListDataItemCancelEventArgs e = new RadCheckedListDataItemCancelEventArgs((RadCheckedListDataItem)this);
         this.CheckAllItemCheckedChanging((object)this.ownerElement, e);
         if (e.Cancel)
         {
             this.setCheckState = false;
             return;
         }
     }
     if (this.OnNotifyPropertyChanging("Checked"))
     {
         this.setCheckState = false;
     }
     else
     {
         this.isChecked = value;
         int num = (int)this.SetValue(RadCheckedListDataItem.CheckedProperty, (object)value);
         this.OnNotifyPropertyChanged("Checked");
         this.OnSelectedItemChanged(EventArgs.Empty);
         if (silent)
         {
             this.setCheckState = false;
             if (this.CheckAllItemCheckedChanged == null)
             {
                 return;
             }
             this.CheckAllItemCheckedChanged((object)this.ownerElement, new RadCheckedListDataItemEventArgs((RadCheckedListDataItem)this));
         }
         else
         {
             this.checkedElement.BeginUpdate();
             this.checkedElement.AutoCompleteEditableAreaElement.AutoCompleteTextBox.ListElement.SuspendSelectionEvents = true;
             this.checkedElement.ListElement.DataLayer.ListSource.BeginUpdate();
             foreach (RadCheckedListDataItem checkedListDataItem in (RadListDataItemCollection)this.checkedElement.Items)
             {
                 checkedListDataItem.Checked = value;
             }
             this.checkedElement.ListElement.DataLayer.ListSource.EndUpdate();
             this.checkedElement.EndUpdate();
             this.checkedElement.SyncEditorElementWithSelectedItem();
             this.checkedElement.AutoCompleteEditableAreaElement.AutoCompleteTextBox.ListElement.SuspendSelectionEvents = false;
             this.setCheckState = false;
             if (this.CheckAllItemCheckedChanged == null)
             {
                 return;
             }
             this.CheckAllItemCheckedChanged((object)this.ownerElement, new RadCheckedListDataItemEventArgs((RadCheckedListDataItem)this));
         }
     }
 }