Beispiel #1
0
 internal override void CheckDuplicate(TaskDialogItem itemToExclude)
 {
     CheckDuplicateButton(_type, itemToExclude);
     base.CheckDuplicate(itemToExclude);
 }
Beispiel #2
0
 private void CheckDuplicateButton(ButtonType type, TaskDialogItem itemToExclude)
 {
     if( type != ButtonType.Custom && Owner != null )
     {
         foreach( TaskDialogButton button in Owner.Buttons )
         {
             if( button != this && button != itemToExclude && button.ButtonType == type )
                 throw new InvalidOperationException(Properties.Resources.DuplicateButtonTypeError);
         }
     }
 }
Beispiel #3
0
        internal void ClickItem(TaskDialogItem item)
        {
            if( !IsDialogRunning )
                throw new InvalidOperationException(Properties.Resources.TaskDialogNotRunningError);

            NativeMethods.SendMessage(Handle, (int)(item is TaskDialogButton ? NativeMethods.TaskDialogMessages.ClickButton : NativeMethods.TaskDialogMessages.ClickRadioButton), new IntPtr(item.Id), IntPtr.Zero);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="TaskDialogItemClickedEventArgs"/> class with the specified item.
 /// </summary>
 /// <param name="item">The <see cref="TaskDialogItem"/> that was clicked.</param>
 public TaskDialogItemClickedEventArgs(TaskDialogItem item)
 {
     _item = item;
 }
Beispiel #5
0
 internal void SetItemEnabled(TaskDialogItem item)
 {
     if( IsDialogRunning )
     {
         NativeMethods.SendMessage(Handle, (int)(item is TaskDialogButton ? NativeMethods.TaskDialogMessages.EnableButton : NativeMethods.TaskDialogMessages.EnableRadioButton), new IntPtr(item.Id), new IntPtr(item.Enabled ? 1 : 0));
     }
 }
Beispiel #6
0
 private void CheckDuplicateId(TaskDialogItem itemToExclude, int id)
 {
     if( id != 0 )
     {
         IEnumerable items = ItemCollection;
         if( items != null )
         {
             foreach( TaskDialogItem item in items )
             {
                 if( item != this && item != itemToExclude && item.Id == id )
                     throw new InvalidOperationException(Properties.Resources.DuplicateItemIdError);
             }
         }
     }
 }
Beispiel #7
0
 internal virtual void CheckDuplicate(TaskDialogItem itemToExclude)
 {
     CheckDuplicateId(itemToExclude, _id);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="TaskDialogItemClickedEventArgs"/> class with the specified item.
 /// </summary>
 /// <param name="item">The <see cref="TaskDialogItem"/> that was clicked.</param>
 public TaskDialogItemClickedEventArgs(TaskDialogItem item)
 {
     _item = item;
 }
Beispiel #9
0
 internal override void CheckDuplicate(TaskDialogItem itemToExclude)
 {
     CheckDuplicateButton(_type, itemToExclude);
     base.CheckDuplicate(itemToExclude);
 }