本文整理汇总了C#中IWin32Window类的典型用法代码示例。如果您正苦于以下问题:C# IWin32Window类的具体用法?C# IWin32Window怎么用?C# IWin32Window使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IWin32Window类属于命名空间,在下文中一共展示了IWin32Window类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Show
/// <summary>
/// Shows the dialog with the specified image.
/// </summary>
/// <param name="owner">The owner.</param>
/// <param name="title">The title.</param>
/// <param name="image">The image.</param>
public void Show(IWin32Window owner, string title, Image image)
{
this.ClientSize = image.Size;
this.Text = title;
this.pictureBox.Image = image;
base.ShowDialog();
}
示例2: ShowDialogInternal
public DialogResult ShowDialogInternal(string Text, IWin32Window owner)
{
m_Result = false;
txtInput.Text = Text;
this.ShowDialog(owner);
return (m_Result) ? DialogResult.OK : DialogResult.Cancel;
}
示例3: Install
public SetupStatus Install(IWin32Window owner)
{
if (_status == SetupStatus.Installed)
return _status;
try
{
// get Everyone token for the current locale
string everyone = new System.Security.Principal.SecurityIdentifier(
"S-1-1-0").Translate(typeof(System.Security.Principal.NTAccount)).ToString();
string port = ConfigurationManager.AppSettings["Port"];
string arguments = string.Format("http add urlacl url=http://+:{0}/ user=\"\\{1}\"", port, everyone);
Log.Info("Adding ACL rule...");
ProcessHelper.RunNetShell(arguments, "Failed to add URL ACL");
_status = SetupStatus.Installed;
}
catch (Exception ex)
{
Log.Error(ex);
_status = SetupStatus.Failed;
Settings.Instance.UrlReservationSetupHadErrors = true;
Settings.Instance.Save();
throw;
}
return _status;
}
示例4: SearchForUpdatesAndShow
public void SearchForUpdatesAndShow(IWin32Window aOwnerWindow, bool alwaysShow)
{
OwnerWindow = aOwnerWindow;
new Thread(SearchForUpdates).Start();
if (alwaysShow)
ShowDialog(aOwnerWindow);
}
示例5: SaveRadTree
public static void SaveRadTree(RadTreeView view, IWin32Window frm = null, string filename = "")
{
var saveFileDialogCsv = new SaveFileDialog();
saveFileDialogCsv.Title = "Save data to Comma Separated File";
saveFileDialogCsv.Filter = "CSV or Excel|*.csv";
saveFileDialogCsv.CheckPathExists = true;
saveFileDialogCsv.DefaultExt = "csv";
saveFileDialogCsv.AddExtension = true;
saveFileDialogCsv.OverwritePrompt = true;
saveFileDialogCsv.InitialDirectory = Repository.DataFolder;
saveFileDialogCsv.FileName = filename;
if (saveFileDialogCsv.ShowDialog(frm) == System.Windows.Forms.DialogResult.OK)
{
try
{
sb = new StringBuilder();
foreach (var node in view.Nodes)
{
sb.AppendLine(node.Text.Replace("<=", ","));
ListNodes(node);
}
System.IO.File.WriteAllText(saveFileDialogCsv.FileName, sb.ToString(),Encoding.UTF8);
}
catch (Exception exc)
{
MessageBox.Show(exc.Message, "Unexpected Error");
}
}
}
示例6: Show
public new void Show(IWin32Window owner)
{
if (!Visible)
base.Show(owner);
else
Activate();
}
示例7: DoCompressionDlg
/// <summary>
/// Show a configuration dialog (modal) for JMDWriter
/// </summary>
/// <param name="threads">number of threads</param>
/// <param name="complevel">compression level</param>
/// <param name="tmin">minimum possible number of threads</param>
/// <param name="tmax">maximum possible number of threads</param>
/// <param name="cmin">minimum compression level, assumed to be "no compression"</param>
/// <param name="cmax">maximum compression level</param>
/// <param name="hwnd">hwnd of parent</param>
/// <returns>false if user canceled; true if user consented</returns>
public static bool DoCompressionDlg(ref int threads, ref int complevel, int tmin, int tmax, int cmin, int cmax, IWin32Window hwnd)
{
JMDForm j = new JMDForm();
j.threadsBar.Minimum = tmin;
j.threadsBar.Maximum = tmax;
j.compressionBar.Minimum = cmin;
j.compressionBar.Maximum = cmax;
j.threadsBar.Value = threads;
j.compressionBar.Value = complevel;
j.threadsBar_Scroll(null, null);
j.compressionBar_Scroll(null, null);
j.threadLeft.Text = String.Format("{0}", tmin);
j.threadRight.Text = String.Format("{0}", tmax);
j.compressionLeft.Text = String.Format("{0}", cmin);
j.compressionRight.Text = String.Format("{0}", cmax);
DialogResult d = j.ShowDialog(hwnd);
threads = j.threadsBar.Value;
complevel = j.compressionBar.Value;
j.Dispose();
if (d == DialogResult.OK)
return true;
else
return false;
}
示例8: Show
public static DialogResult Show (IWin32Window owner, string text, string caption,
MessageBoxButtons buttons)
{
MessageBoxForm form = new MessageBoxForm (owner, text, caption, buttons, MessageBoxIcon.None);
return form.RunDialog ();
}
示例9: AskForKey
/// <summary>Shows the "SSH error" dialog modally, and returns the path to the key, if one was loaded.</summary>
public static string AskForKey(IWin32Window parent)
{
var form = new FormPuttyError();
form.ShowDialog(parent);
return form.KeyPath;
}
示例10: showMessage
public DialogResult showMessage(IWin32Window owner, string message, string title, MessageBoxIcon icon, MessageBoxButtons buttons) {
//Wenn kein Owner mitgegeben wurde, dann Versuchen das Hauptfenster anzuzeigen
if (owner == null || owner.Handle == IntPtr.Zero)
owner = new dummyWindow(Process.GetCurrentProcess().MainWindowHandle);
const string appTitle = "updateSystem.NET Administration";
//Nachricht loggen
logLevel lLevel;
switch (icon) {
case MessageBoxIcon.Error:
lLevel = logLevel.Error;
break;
case MessageBoxIcon.Exclamation:
lLevel = logLevel.Warning;
break;
default:
lLevel = logLevel.Info;
break;
}
Log.writeState(lLevel,
string.Format("{0}{1}", string.IsNullOrEmpty(title) ? "" : string.Format("{0} -> ", title),
message));
var dlgResponse = Environment.OSVersion.Version.Major >= 6
? showTaskDialog(owner, appTitle, title, message, buttons, icon)
: showMessageBox(owner, appTitle, title, message, icon, buttons);
Log.writeKeyValue(lLevel, "Messagedialogresult", dlgResponse.ToString());
return dlgResponse;
}
示例11: ShowDialog
public new DialogResult ShowDialog(IWin32Window owner)
{
// Set validate names to false otherwise windows will not let you select "Folder Selection."
dialog.ValidateNames = false;
dialog.CheckFileExists = false;
dialog.CheckPathExists = true;
try
{
// Set initial directory (used when dialog.FileName is set from outside)
if (dialog.FileName != null && dialog.FileName != "")
{
if (Directory.Exists(dialog.FileName))
dialog.InitialDirectory = dialog.FileName;
else
dialog.InitialDirectory = Path.GetDirectoryName(dialog.FileName);
}
}
catch (Exception ex)
{
// Do nothing
}
// Always default to Folder Selection.
dialog.FileName = "Folder Selection.";
if (owner == null)
return dialog.ShowDialog();
else
return dialog.ShowDialog(owner);
}
示例12: ShowLoading
public static void ShowLoading(IWin32Window owner, string text, Image loadingImage)
{
CloseLoading();
LoadingBoxArgs args = new LoadingBoxArgs(owner, text, loadingImage);
form = new MessageIconForm();
form.ShowLoading(args);
}
示例13: EditComponent
public virtual bool EditComponent (ITypeDescriptorContext context, object component, IWin32Window owner)
{
ComponentEditorForm f = new ComponentEditorForm (component, GetComponentEditorPages ());
if (f.ShowForm (owner, GetInitialComponentEditorPageIndex ()) == DialogResult.OK)
return true;
return false;
}
示例14: ShowDialog
public DialogResult ShowDialog(IWin32Window Owner, string Path) {
lblInfo.Text = string.Format(
Language.GetString("fileAccessDialog_lblInfo_text")
, Path);
return base.ShowDialog(Owner);
}
示例15: SetDialog
// ***** Dialog display *****
public void SetDialog(IWin32Window owner, ClassHvcw refHvcw, string ssid, string token)
{
clsHvcw = refHvcw;
textSSID.Text = ssid;
txtToken = token;
this.ShowDialog(owner);
}