当前位置: 首页>>代码示例>>C#>>正文


C# MessageDialog.Hide方法代码示例

本文整理汇总了C#中MessageDialog.Hide方法的典型用法代码示例。如果您正苦于以下问题:C# MessageDialog.Hide方法的具体用法?C# MessageDialog.Hide怎么用?C# MessageDialog.Hide使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MessageDialog的用法示例。


在下文中一共展示了MessageDialog.Hide方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ShowWarningMessage

 public static void ShowWarningMessage(Window window, string message)
 {
     Dialog dialog = new MessageDialog(window, DialogFlags.DestroyWithParent | DialogFlags.Modal,
             MessageType.Warning, ButtonsType.Ok, message);
         dialog.Run();
         dialog.Hide();
 }
开发者ID:hughperkins,项目名称:SpringMapDesigner,代码行数:7,代码来源:DialogHelpers.cs

示例2: AskForConfirmation

            private static bool AskForConfirmation(Window win,
								string text)
            {
                MessageDialog md = new MessageDialog (win,
                                      DialogFlags.
                                      DestroyWithParent,
                                      MessageType.
                                      Question,
                                      ButtonsType.
                                      YesNo,
                                      String.
                                      Format
                                      ("<b>{0}</b>",
                                       text));

                int res = md.Run ();
                md.Hide ();
                md.Dispose ();
                return res == (int) ResponseType.Yes;
            }
开发者ID:BackupTheBerlios,项目名称:csboard-svn,代码行数:20,代码来源:PlayerPage.cs

示例3: StartCompare

	public void StartCompare (WaitCallback done)
	{		
		AdditionalInfoWindow.Visible = false;
		
		progressbar1.Visible = true;						
		progressbar1.Adjustment.Lower = 0;
		progressbar1.Adjustment.Upper = 100;

		// clear our existing content
		if (context != null)
			context.StopCompare ();

		// Go to the actual tree page.
		notebook1.Page = 0;
		
		// now generate new content asynchronously
		context = new CompareContext (reference_loader, target_loader);

		context.ProgressChanged += delegate (object sender, CompareProgressChangedEventArgs e) {
			Application.Invoke (delegate {
				Status = e.Message;
				Progress = e.Progress;
			});
		};
		
		context.Error += delegate (object sender, CompareErrorEventArgs e) {
			Application.Invoke (delegate {
				Console.WriteLine ("ERROR: {0}", e.Message);
				MessageDialog md = new MessageDialog (this, 0, MessageType.Error, ButtonsType.Ok, false,
				                                      e.Message);
				md.Response += delegate (object s, ResponseArgs ra) {
					md.Hide ();
				};
				md.Show();
				Status = String.Format ("Comparison failed at {0}", DateTime.Now);
				Progress = 0.0;
				progressbar1.Visible = false;
			});
		};

		context.Finished += delegate (object sender, EventArgs e) {
			Application.Invoke (delegate {
				DateTime finish_time = DateTime.Now;

				if (context.Comparison != null) {
					Status = String.Format ("Comparison completed at {0}", finish_time);
					
					context.Comparison.PropagateCounts ();
					PopulateTreeFromComparison (context.Comparison);
					Progress = 0.0;

					CompareHistory[] history = Config.Recent[0].History;
				
					if (history == null || history.Length == 0 ||
					    (history[history.Length-1].Extras != context.Comparison.Extra ||
					     history[history.Length-1].Errors != context.Comparison.Warning ||
					     history[history.Length-1].Missing != context.Comparison.Missing ||
					     history[history.Length-1].Niexs != context.Comparison.Niex ||
					     history[history.Length-1].Todos != context.Comparison.Todo)) {
	
						CompareHistory history_entry = new CompareHistory();
						history_entry.CompareTime = finish_time;
						history_entry.Extras = context.Comparison.Extra;
						history_entry.Errors = context.Comparison.Warning;
						history_entry.Missing = context.Comparison.Missing;
						history_entry.Niexs = context.Comparison.Niex;
						history_entry.Todos = context.Comparison.Todo;
						Config.Recent[0].AddHistoryEntry (history_entry);
						Config.Save ();
					}
				} else
					Status = "Comparison not completed - no data returned.";
				
				done (this);
				progressbar1.Visible = false;
			});
		};
		treeStore.Clear ();
		context.Compare ();
	}
开发者ID:FreeBSD-DotNet,项目名称:mono-tools,代码行数:80,代码来源:MainWindow.cs

示例4: ShowChallengeDialog

            private void ShowChallengeDialog(MatchChallenge mc)
            {
                StringBuilder buf = new StringBuilder ();
                string rating;

                if (mc.OpponentsRating != 0)
                    rating = mc.OpponentsRating.
                        ToString ();
                else
                    rating = "----";
                buf.Append (String.
                        Format
                        ("<big><b>{0} ({1}) wants to play a {2} game</b></big>\n",
                         mc.Opponent, rating,
                         mc.Category));
                buf.Append (String.
                        Format
                        ("<b><u>Time:</u> {0} </b><i>mins</i>, <b><u>Increment:</u></b> {1}\n",
                         mc.Time, mc.Increment));
                if (mc.Color != null)
                    buf.Append (String.
                            Format
                            ("\n<b><u>Color:</u></b> {0}\n",
                             mc.Color));

                buf.Append
                    ("\n\n<b>Do you want to play?</b>");

                MessageDialog dlg = new MessageDialog (null,
                                       DialogFlags.
                                       Modal,
                                       MessageType.
                                       Question,
                                       ButtonsType.
                                       YesNo,
                                       true,
                                       buf.
                                       ToString
                                       ());
                dlg.Modal = false;
                dlg.GrabFocus ();
                int ret = dlg.Run ();
                if (ret == (int) ResponseType.Yes)
                    client.CommandSender.
                        SendCommand ("accept");
                else if (ret == (int) ResponseType.No)
                    client.CommandSender.
                        SendCommand ("decline");
                dlg.Hide ();
                dlg.Dispose ();
            }
开发者ID:BackupTheBerlios,项目名称:csboard-svn,代码行数:51,代码来源:ICSDetailsWidget.cs

示例5: OnConnectionError

            private void OnConnectionError(object o,
							string reason)
            {
                client.Stop ();
                // show error
                MessageDialog md = new MessageDialog (null,
                                      DialogFlags.
                                      DestroyWithParent,
                                      MessageType.
                                      Error,
                                      ButtonsType.
                                      Close,
                                      String.
                                      Format
                                      ("<b>{0}</b>",
                                       reason));

                md.Run ();
                md.Hide ();
                md.Dispose ();

                menubar.disconnectMenuItem.Sensitive = false;
                menubar.connectMenuItem.Sensitive = true;
                //configwidget.Sensitive = true;
                //Authenticate ();
            }
开发者ID:BackupTheBerlios,项目名称:csboard-svn,代码行数:26,代码来源:ICSDetailsWidget.cs

示例6: OnGameMessage

            private void OnGameMessage(object o, string user,
						    GameMessageType type)
            {
                string msg;
                switch (type)
                  {
                  case GameMessageType.Draw:
                      msg = "<big><b>{0} offers a draw</b>.\nDo you want to agree?</big>";
                      break;
                  case GameMessageType.Abort:
                      msg = "<big><b>{0} wants to abort the game</b>.\nDo you want to agree?</big>";
                      break;
                  default:
                      return;
                  }
                MessageDialog dlg = new MessageDialog (null,
                                       DialogFlags.
                                       Modal,
                                       MessageType.
                                       Question,
                                       ButtonsType.
                                       YesNo,
                                       true,
                                       msg,
                                       user);
                dlg.Modal = false;
                int ret = dlg.Run ();
                if (ret == (int) ResponseType.Yes)
                    client.CommandSender.
                        SendCommand ("accept " +
                                 user);
                else if (ret == (int) ResponseType.No)
                    client.CommandSender.
                        SendCommand ("decline " +
                                 user);
                dlg.Hide ();
                dlg.Dispose ();
            }
开发者ID:BackupTheBerlios,项目名称:csboard-svn,代码行数:38,代码来源:ICSGameObserverWidget.cs


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