public NiTaskDialog(IServiceProvider serviceProvider) { _serviceProvider = serviceProvider; _taskDialog = new TaskDialog.TaskDialog { Callback = Callback }; }
public NiTaskDialog(IServiceProvider serviceProvider) { _serviceProvider = serviceProvider; _taskDialog = new TaskDialog.TaskDialog { Callback = Callback }; }
public EmulateTaskDialog( TaskDialog newTaskDialog ) { EnableBoundsTracking = false; // http://dotnetperls.com/Content/Segoe-Tahoma-Windows-Forms.aspx // http://www.codeproject.com/KB/cs/AdjustingFontAndLayout.aspx // For some discussion about setting program fonts. this.Font = SystemFonts.MessageBoxFont; InitializeComponent ( ); this.taskDialog = newTaskDialog; BuildForm ( ); // Setup the default settings. if ( this.defaultRadioButton != null ) { this.defaultRadioButton.Checked = true; } // Only can set focus after everything has been build. if ( this.taskDialog.DefaultButton != 0 ) { // Set the default button. if ( this.taskDialogButtons.TryGetValue ( this.taskDialog.DefaultButton, out this.defaultButton ) ) { this.defaultButton.Select ( ); } else { if ( this.flowLayoutPanelSubAreaButtons.Controls.Count > 0 ) { // Select left-most button. this.flowLayoutPanelSubAreaButtons.Controls[this.flowLayoutPanelSubAreaButtons.Controls.Count - 1].Select ( ); } } } else { if ( this.flowLayoutPanelSubAreaButtons.Controls.Count > 0 ) { // Set the left-most button to be the default. Dictionary does // not keep the order of the button that is added in, so this // work around is used. // // Layout right to left, left-most item is at the end of the list. this.flowLayoutPanelSubAreaButtons.Controls[this.flowLayoutPanelSubAreaButtons.Controls.Count - 1].Select ( ); } } if ( this.taskDialog.Callback != null ) { timer.Start ( ); } }