• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# IWin32Window类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IWin32Window的典型用法代码示例。如果您正苦于以下问题:C# IWin32Window类的具体用法?C# IWin32Window怎么用?C# IWin32Window使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IWin32Window类属于命名空间,在下文中一共展示了IWin32Window类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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();
 }
开发者ID:alexbikfalvi,项目名称:InetAnalytics,代码行数:13,代码来源:FormImage.cs


示例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;
 }
开发者ID:CharlesZHENG,项目名称:csexwb2,代码行数:7,代码来源:frmInput.cs


示例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;
        }
开发者ID:LibertyLocked,项目名称:ets2-telemetry-server,代码行数:26,代码来源:UrlReservationSetup.cs


示例4: SearchForUpdatesAndShow

 public void SearchForUpdatesAndShow(IWin32Window aOwnerWindow, bool alwaysShow)
 {
     OwnerWindow = aOwnerWindow;
     new Thread(SearchForUpdates).Start();
     if (alwaysShow)
         ShowDialog(aOwnerWindow);
 }
开发者ID:noamkfir,项目名称:gitextensions,代码行数:7,代码来源:FormUpdates.cs


示例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");
         }
     }
 }
开发者ID:kenlassesen,项目名称:dnafamilytree,代码行数:29,代码来源:SaveUtility.cs


示例6: Show

 public new void Show(IWin32Window owner)
 {
     if (!Visible)
         base.Show(owner);
     else
         Activate();
 }
开发者ID:arsaccol,项目名称:SLED,代码行数:7,代码来源:SledProjectModifiedForm.cs


示例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;
		}
开发者ID:ddugovic,项目名称:RASuite,代码行数:38,代码来源:JMDForm.cs


示例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 ();
		}
开发者ID:Clancey,项目名称:MonoMac.Windows.Form,代码行数:7,代码来源:MessageBox.cs


示例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;
        }
开发者ID:rschoening,项目名称:gitextensions,代码行数:8,代码来源:FormPuttyError.cs


示例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;
		}
开发者ID:hbaes,项目名称:updateSystem.NET,代码行数:33,代码来源:applicationSession.Messages.cs


示例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);
		}
开发者ID:DrakoGlyph,项目名称:tModLoader,代码行数:31,代码来源:FileFolderDialog.cs


示例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);
 }
开发者ID:panshuiqing,项目名称:winform-ui,代码行数:7,代码来源:LoadingBox.cs


示例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;
		}
开发者ID:nlhepler,项目名称:mono,代码行数:7,代码来源:WindowsFormsComponentEditor.cs


示例14: ShowDialog

		public DialogResult ShowDialog(IWin32Window Owner, string Path) {
			lblInfo.Text = string.Format(
				Language.GetString("fileAccessDialog_lblInfo_text")
				, Path);

			return base.ShowDialog(Owner);
		}
开发者ID:hbaes,项目名称:updateSystem.NET,代码行数:7,代码来源:fileAccessDialog.cs


示例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);
 }
开发者ID:Qrain,项目名称:photo-tool,代码行数:8,代码来源:Sound.cs


示例16: Show

 /// <include file='doc\MessageBox.uex' path='docs/doc[@for="MessageBox.Show6"]/*' />
 /// <devdoc>
 ///    <para>
 ///       Displays a message box with specified text, caption, and style.
 ///       Makes the dialog RTL if the resources for this dll have been localized to a RTL language.
 ///    </para>
 /// </devdoc>
 public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, 
                                 MessageBoxDefaultButton defaultButton, MessageBoxOptions options) {
     if (RTLAwareMessageBox.IsRTLResources) {
         options |= (MessageBoxOptions.RightAlign | MessageBoxOptions.RtlReading);
     }
     return MessageBox.Show(owner, text, caption, buttons, icon, defaultButton, options);
 }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:14,代码来源:RTLAwareMessageBox.cs


示例17: EditComponent

 public override bool EditComponent(ITypeDescriptorContext context, object obj, IWin32Window parent)
 {
     bool flag = false;
     bool inTemplateModeInternal = false;
     IComponent component = (IComponent) obj;
     ISite site = component.Site;
     if (site != null)
     {
         IDesignerHost service = (IDesignerHost) site.GetService(typeof(IDesignerHost));
         TemplatedControlDesigner designer = (TemplatedControlDesigner) service.GetDesigner(component);
         inTemplateModeInternal = designer.InTemplateModeInternal;
     }
     if (!inTemplateModeInternal)
     {
         System.Type[] componentEditorPages = this.GetComponentEditorPages();
         if ((componentEditorPages != null) && (componentEditorPages.Length != 0))
         {
             ComponentEditorForm form = new ComponentEditorForm(obj, componentEditorPages);
             if (!string.Equals(System.Design.SR.GetString("RTL"), "RTL_False", StringComparison.Ordinal))
             {
                 form.RightToLeft = RightToLeft.Yes;
                 form.RightToLeftLayout = true;
             }
             if (form.ShowForm(parent, this.GetInitialComponentEditorPageIndex()) == DialogResult.OK)
             {
                 flag = true;
             }
         }
         return flag;
     }
     System.Windows.Forms.Design.RTLAwareMessageBox.Show(null, System.Design.SR.GetString("BDL_TemplateModePropBuilder"), System.Design.SR.GetString("BDL_PropertyBuilder"), MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1, 0);
     return flag;
 }
开发者ID:Reegenerator,项目名称:Sample-CustomizeDatasetCS,代码行数:33,代码来源:BaseDataListComponentEditor.cs


示例18: OnPrePublish

        public override bool OnPrePublish(IWin32Window dialogOwner, IProperties properties,
                                          IPublishingContext publishingContext, bool publish)
        {
            var info = (BlogPost) publishingContext.PostInfo;

            //look at the publish date.
            if (!info.HasDatePublishedOverride)
            {
                var nextPubDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
                nextPubDate = GetNextDayOccurrence(DayOfWeek.Tuesday, nextPubDate);

                var reader = new JsonTextReader(reader: File.OpenText("Plugins\\Throttle.json"));
                var json = new Newtonsoft.Json.JsonSerializer();

                var config = json.Deserialize<Configuration>(reader);
                var wrapper = new MetaWeblogWrapper(config.Url, config.Username, config.Password);
                List<Post> recentPosts = wrapper.GetRecentPosts(10).ToList();
                while (recentPosts.Any(p => p.DateCreated >= nextPubDate && p.DateCreated < nextPubDate.AddDays(1)))
                {
                    nextPubDate = GetNextDayOccurrence(DayOfWeek.Tuesday, nextPubDate.AddDays(1));
                }
                var pubDate = new DateTime(nextPubDate.Year, nextPubDate.Month, nextPubDate.Day, 9, 0, 0);
                info.DatePublished = pubDate;
                info.DatePublishedOverride = pubDate;
            }
            return base.OnPrePublish(dialogOwner, properties, publishingContext, publish);
        }
开发者ID:erichexter,项目名称:ThrottlePlugin,代码行数:27,代码来源:Plugin.cs


示例19: RunScript

        public static bool RunScript(IWin32Window owner, GitModule aModule, string script, RevisionGrid revisionGrid)
        {
            if (string.IsNullOrEmpty(script))
                return false;

            ScriptInfo scriptInfo = ScriptManager.GetScript(script);

            if (scriptInfo == null)
            {
                MessageBox.Show(owner, "Cannot find script: " + script, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return false;
            }

            if (string.IsNullOrEmpty(scriptInfo.Command))
                return false;

            string argument = scriptInfo.Arguments;
            foreach (string option in Options)
            {
                if (string.IsNullOrEmpty(argument) || !argument.Contains(option))
                    continue;
                if (!option.StartsWith("{s"))
                    continue;
                if (revisionGrid != null)
                    continue;
                MessageBox.Show(owner,
                    string.Format("Option {0} is only supported when started from revision grid.", option),
                    "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return false;
            }
            return RunScript(owner, aModule, scriptInfo, revisionGrid);
        }
开发者ID:rooflz,项目名称:gitextensions,代码行数:32,代码来源:ScriptRunner.cs


示例20: SaveDeck

        public void SaveDeck(IWin32Window window)
        {
            SaveFileDialog save = new SaveFileDialog();

            save = new SaveFileDialog();
            //Set the default name
            using (this.m_Model.Workspace.Lock()) {
                using (Synchronizer.Lock((~this.m_Model.Workspace.CurrentDeckTraversal).SyncRoot)) {
                    using (Synchronizer.Lock((~this.m_Model.Workspace.CurrentDeckTraversal).Deck.SyncRoot)) {
                        if ((~this.m_Model.Workspace.CurrentDeckTraversal).Deck.Filename != "")
                            save.FileName = (~this.m_Model.Workspace.CurrentDeckTraversal).Deck.Filename;
                        else save.FileName = (~this.m_Model.Workspace.CurrentDeckTraversal).Deck.HumanName;
                    }
                }
            }
            save.Filter = "CP3 files (*.cp3)|*.cp3|All Files (*.*)|*.*";
            if (save.ShowDialog() == DialogResult.OK) {
                //If filter ("*.cp3") is chosen, then make sure the File Name End with ".cp3"
                if (save.FilterIndex == 1 && !save.FileName.EndsWith(".cp3"))
                    save.FileName = save.FileName + ".cp3";

                //Get the "current" deck
                //Here we define the current deck as the one whose tab is currently selected
                using (this.m_Model.Workspace.Lock()) {
                    using (Synchronizer.Lock((~this.m_Model.Workspace.CurrentDeckTraversal).SyncRoot)) {
                        using (Synchronizer.Lock((~this.m_Model.Workspace.CurrentDeckTraversal).Deck.SyncRoot)) {
                            Decks.PPTDeckIO.SaveAsCP3(new FileInfo(save.FileName), (~this.m_Model.Workspace.CurrentDeckTraversal).Deck);
                            this.m_Model.Workspace.CurrentDeckTraversal.Value.Deck.Dirty = false;
                            (~this.m_Model.Workspace.CurrentDeckTraversal).Deck.Filename=Path.GetFileNameWithoutExtension(save.FileName);
                        }
                    }
                }
            }
        }
开发者ID:ClassroomPresenter,项目名称:CP3,代码行数:34,代码来源:SaveDeckDialog.cs



注:本文中的IWin32Window类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IWindow类代码示例发布时间:2022-05-24
下一篇:
C# IWidgetBackend类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap