예제 #1
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);
         }
     }
 }
 /// <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;
 }
예제 #3
0
 internal override void CheckDuplicate(TaskDialogItem itemToExclude)
 {
     CheckDuplicateButton(_type, itemToExclude);
     base.CheckDuplicate(itemToExclude);
 }
예제 #4
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));
     }
 }
예제 #5
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);
        }
예제 #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);
             }
         }
     }
 }
예제 #7
0
 internal virtual void CheckDuplicate(TaskDialogItem itemToExclude)
 {
     CheckDuplicateId(itemToExclude, _id);
 }
예제 #8
0
 /// <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;
 }
 internal virtual void CheckDuplicate(TaskDialogItem itemToExclude)
 {
     CheckDuplicateId(itemToExclude, _id);
 }
예제 #10
0
 internal override void CheckDuplicate(TaskDialogItem itemToExclude)
 {
     CheckDuplicateButton(_type, itemToExclude);
     base.CheckDuplicate(itemToExclude);
 }