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


C# MessageDialog.Hide方法代码示例

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


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

示例1: AskQuestionWithCancel

        public QuestionResponse AskQuestionWithCancel(string question, string caption)
        {
            using (Gtk.MessageDialog md = new Gtk.MessageDialog ((Gtk.Window) WorkbenchSingleton.Workbench, Gtk.DialogFlags.Modal | Gtk.DialogFlags.DestroyWithParent, Gtk.MessageType.Question, Gtk.ButtonsType.None, question)) {

                md.AddActionWidget (new Button (Gtk.Stock.No), ResponseType.No);
                md.AddActionWidget (new Button (Gtk.Stock.Cancel), ResponseType.Cancel);
                md.AddActionWidget (new Button (Gtk.Stock.Yes), ResponseType.Yes);
                md.ActionArea.ShowAll ();

                Gtk.ResponseType response = (Gtk.ResponseType)md.Run ();
                md.Hide ();

                if (response == Gtk.ResponseType.Yes) {
                    return QuestionResponse.Yes;
                }

                if (response == Gtk.ResponseType.No) {
                    return QuestionResponse.No;
                }

                if (response == Gtk.ResponseType.Cancel) {
                    return QuestionResponse.Cancel;
                }

                return QuestionResponse.Cancel;
            }
        }
开发者ID:slluis,项目名称:monodevelop-prehistoric,代码行数:27,代码来源:MessageService.cs

示例2: AskQuestion

        public bool AskQuestion(string question, string caption)
        {
            using (Gtk.MessageDialog md = new Gtk.MessageDialog ((Gtk.Window) WorkbenchSingleton.Workbench, Gtk.DialogFlags.Modal | Gtk.DialogFlags.DestroyWithParent, Gtk.MessageType.Question, Gtk.ButtonsType.YesNo, question)) {
                int response = md.Run ();
                md.Hide ();

                if ((Gtk.ResponseType) response == Gtk.ResponseType.Yes)
                    return true;
                else
                    return false;
            }
        }
开发者ID:slluis,项目名称:monodevelop-prehistoric,代码行数:12,代码来源:MessageService.cs

示例3: OnDeleteClicked

 protected virtual void OnDeleteClicked(object sender, System.EventArgs e)
 {
     ExternalTool tool = GetSelectedTool();
     MessageDialog dlg = new MessageDialog(this, DialogFlags.Modal, MessageType.Question,
                                           ButtonsType.YesNo, Catalog.GetString("Are you sure you wish to delete '{0}'"),
                                           tool.Name);
     if ((int) ResponseType.Yes == dlg.Run())
     {
         m_toolList.DeleteTool(tool.Name);
         RefreshList ();
     }
     dlg.Hide();
 }
开发者ID:cbuehler,项目名称:opencachemanager,代码行数:13,代码来源:ConfigureEToolsDlg.cs

示例4: MessageDialogClicked

		private void MessageDialogClicked (object o, EventArgs args)
		{
			using (Dialog dialog = new MessageDialog (this,
								  DialogFlags.Modal | DialogFlags.DestroyWithParent,
								  MessageType.Info,
								  ButtonsType.Ok,
								  "This message box has been popped up the following\nnumber of times:\n\n {0}",
								  i)) {
				dialog.Run ();
				dialog.Hide ();
			}

			i++;
		}
开发者ID:ystk,项目名称:debian-gtk-sharp2,代码行数:14,代码来源:DemoDialog.cs

示例5: ShowErrorWindow

 public static void ShowErrorWindow( string errorMessage, Window parentWindow=null )
 {
     var dialog = new MessageDialog(
         parentWindow,
         DialogFlags.Modal,
         MessageType.Error,
         ButtonsType.Ok,
         errorMessage
     );
     dialog.WindowPosition = WindowPosition.Center;
     dialog.Show();
     dialog.Run();
     dialog.Hide();
 }
开发者ID:RamiLego4Game,项目名称:PlatformerWorld-Launcher,代码行数:14,代码来源:GTKInterface.cs

示例6: Main

        public static int Main(string [] args)
        {
            Application.Init ();

            Catalog.Init (Config.packageName, Config.prefix + "/share/locale");

            try {

                session = new Session ();

                string filename = null;

                if (args.Length == 1 && System.IO.File.Exists (args[0])) {
                   filename = args[0];
                }

                            ChessWindow win = new ChessWindow (filename);

                            Application.Run ();

            } catch (ApplicationException) {
                return 1;
            } catch (System.Exception e) {

                 try {
                     MessageDialog md =
                                                new MessageDialog (null,
                                                                   DialogFlags.
                                                               DestroyWithParent,
                                                               MessageType.Error,
                                                                   ButtonsType.Close,
                                           Catalog.GetString ("An unexpected exception occured:\n\n") +
                                       e.ToString() + "\n" +
                                                       Catalog.GetString ("Please report about this exception to \n") +
                                      "Nickolay V. Shmyrev <[email protected]>");

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

                 } catch (Exception ex) {

                     throw e;

                     }
            }

            return 0;
        }
开发者ID:BackupTheBerlios,项目名称:csboard-svn,代码行数:49,代码来源:App.cs

示例7: DoCancel

 public void DoCancel()
 {
     Gtk.MessageDialog qdlg = new Gtk.MessageDialog (this, Gtk.DialogFlags.Modal, Gtk.MessageType.Warning,
                                                    Gtk.ButtonsType.YesNo, Catalog.GetString("Cancelling an export will result in an invalid GPX file.\nAre you sure?"));
     if ((int) ResponseType.Yes == qdlg.Run())
     {
         qdlg.Hide();
         qdlg.Dispose();
         this.Hide();
         this.Dispose();
         m_writer.Cancel = true;
         return;
     }
     qdlg.Hide();
     this.ShowNow();
 }
开发者ID:cbuehler,项目名称:opencachemanager,代码行数:16,代码来源:ExportProgressDialog.cs

示例8: Info

 public static void Info(string msg)
 {
     GLib.Idle.Add (new GLib.IdleHandler (delegate() {
         MessageDialog md = new MessageDialog(null, DialogFlags.DestroyWithParent,
             MessageType.Info, ButtonsType.Ok, msg);
         md.DeleteEvent += delegate(object o, DeleteEventArgs args) {
             md.Destroy();
         };
         md.Response += delegate(object o, ResponseArgs args) {
             md.Hide();
             md.Destroy();
         };
         md.Show ();
         return false;
     }));
 }
开发者ID:niwakazoider,项目名称:unicast,代码行数:16,代码来源:Dialog.cs

示例9: HandleExceptionManagerUnhandledException

        void HandleExceptionManagerUnhandledException(UnhandledExceptionArgs args)
        {
            Exception ex = (Exception)args.ExceptionObject;

            Console.WriteLine("Unhandled Exception: {0}", ex.GetType ().ToString ());
            Console.WriteLine("\t{0}", ex.Message);
            Console.WriteLine("\t{0}", ex.Source);
            Console.WriteLine("\t{0}", ex.StackTrace);

            MessageDialog d = new MessageDialog (null, DialogFlags.Modal, MessageType.Error,
                                                 ButtonsType.Close, true, "<b>{0}</b>: {1} at <i>{2}</i>",
                                                 ex.GetType ().ToString(),
                                                 ex.Message, ex.Source);
            d.Run ();
            d.Hide ();
            d.Dispose ();
            args.ExitApplication = true;
        }
开发者ID:sgtnasty,项目名称:battle,代码行数:18,代码来源:Program.cs

示例10: SetCache

 public void SetCache(Geocache cache)
 {
     if (saveButton.Sensitive == true)
     {
         MessageDialog dlg = new MessageDialog(null, DialogFlags.Modal, MessageType.Warning, ButtonsType.YesNo, Catalog.GetString("You have unsaved notes, do you wish to save them?"));
         if ((int)ResponseType.Yes ==  dlg.Run())
         {
             SaveNotes();
         }
         dlg.Hide();
     }
     current = cache;
     if (cache != null)
     {
         editorWidget.Text = cache.Notes;
         editorWidget.Sensitive = true;
     }
     else
     {
         editorWidget.Sensitive = false;
         editorWidget.Text = String.Empty;
     }
     saveButton.Sensitive = false;
 }
开发者ID:cbuehler,项目名称:opencachemanager,代码行数:24,代码来源:NotesWidget.cs

示例11: Start

        public void Start(String targetDB, bool isMove, ModeEnum modeType, OCMMainWindow win)
        {
            if (isMove)
            {
                Title = Catalog.GetString ("Move Caches...");
                copyLabel.Markup = Catalog.GetString ("Moving Geocaches");
            }
            List<Geocache> caches;
            if (modeType == CopyingProgress.ModeEnum.VISIBLE)
            {
                caches = win.CacheList.UnfilteredCaches;
            }
            else if (modeType == CopyingProgress.ModeEnum.SELECTED)
            {
                caches = new List<Geocache> ();
                caches.Add (win.CacheList.SelectedCache);
            }
            else
            {
                caches = null;
                //caches = new List<Geocache> (UIMonitor.getInstance ().CacheStore.GetUnfilteredCaches(0d,0d,new string[0]));
            }
            ACacheStore target = new FileStore (targetDB);
            ACacheStore source = win.App.CacheStore;
            targetDBLabel.Text = targetDB;
            double count = 0;
            total = caches.Count;
            if (target.NeedsUpgrade)
            {
                MessageDialog dlg = new MessageDialog(null, DialogFlags.Modal, MessageType.Info, ButtonsType.Ok,
                                                      Catalog.GetString("The target database needs to be upgraded. " +
                                                      	"Please open the target database before trying to copy/move caches."));
                dlg.Run();
                dlg.Hide();
                this.Hide();
                return;
            }
            buttonOk.Visible = false;
            List<String> str = new List<String>();
            foreach(Geocache c in caches)
            {
                str.Add(c.Name);
            }

            target.StartUpdate();
            target.PurgeAllLogs(str.ToArray());
            target.PurgeAllAttributes(str.ToArray());
            target.PurgeAllTravelBugs(str.ToArray());
            foreach(Geocache cache in caches)
            {
                if (cancel)
                {
                    target.CancelUpdate();
                    this.Hide();
                    this.Dispose();
                    return;
                }

                count++;
                UpdateProgress(count, cache.Name);
                target.AddWaypointOrCache(cache, false, false);
                List<CacheLog> logs = source.GetCacheLogs(cache.Name);
                foreach(CacheLog log in logs)
                {
                    target.AddLog(cache.Name, log);
                }

                List<Waypoint> children = source.GetChildWaypoints(new string[]{cache.Name});
                foreach (Waypoint child in children)
                {
                    target.AddWaypointOrCache(child, false, false);
                }

                CacheAttribute[]  attributes = source.GetAttributes(cache.Name);
                foreach (CacheAttribute attribute in attributes)
                {
                    target.AddAttribute(cache.Name,attribute);
                }

                if (isMove)
                    source.DeleteWaypoint(cache.Name);
            }
            statusLabel.Markup = Catalog.GetString("<i>Complete</i>");
            progressBar.Text = Catalog.GetString("Complete");
            buttonOk.Visible = true;
            buttonCancel.Visible = false;
            target.CompleteUpdate();
        }
开发者ID:cbuehler,项目名称:opencachemanager,代码行数:88,代码来源:CopyingProgress.cs

示例12: OnDeleteButtonClicked

 protected virtual void OnDeleteButtonClicked(object sender, System.EventArgs e)
 {
     Gtk.TreeIter itr;
     Gtk.TreeModel model;
     if (mapView.Selection.GetSelected (out model, out itr)) {
         MapDescription map = (MapDescription)model.GetValue (itr, 0);
         MessageDialog dlg = new MessageDialog (null, DialogFlags.Modal, MessageType.Question, ButtonsType.YesNo, String.Format (Catalog.GetString ("Are you sure you want to delete map {0}?"), map.Name));
         if ((int)ResponseType.Yes == dlg.Run ()) {
             m_maps.Remove(map);
             ReloadMaps();
         }
         dlg.Hide();
     }
 }
开发者ID:cbuehler,项目名称:opencachemanager,代码行数:14,代码来源:MapSelectionWidget.cs

示例13: HandleShouldRemove

        void HandleShouldRemove(object sender, ShouldRemoveEventArgs e)
        {
            string title;
            string message;

            if (e.DeleteData) {
                title = _("Delete torrent");
                message = _("Remove torrent and delete all data?");
            } else {
                title = _("Remove torrent");
                message = _("Are you sure you want to remove the torrent?");
            }

            MessageDialog messageDialog = new MessageDialog (this,
                                                             DialogFlags.Modal,
                                                             MessageType.Question,
                                                             ButtonsType.YesNo, message);
            messageDialog.Title = title;
            e.ShouldRemove = (ResponseType) messageDialog.Run() == ResponseType.Yes;
            messageDialog.Hide();
            messageDialog.Destroy ();
        }
开发者ID:ArsenShnurkov,项目名称:monsoon,代码行数:22,代码来源:MainWindow.cs

示例14: GrabWaypoints

 public void GrabWaypoints()
 {
     String expr = @"\b[NnSs] ?[0-9]+.? ?[0-9]*\.[0-9]*\s[WwEe] ?[0-9]+.? ?[0-9]*\.[0-9]*";
     String desc = m_Cache.ShortDesc + m_Cache.LongDesc;
     MatchCollection matches = Regex.Matches(desc, expr);
     if (matches.Count > 0)
     {
         ScanWaypointsDialog dlg = new ScanWaypointsDialog(matches.Count, this, matches);
         dlg.Run();
     }
     else
     {
         MessageDialog dlg = new MessageDialog(null, DialogFlags.Modal, MessageType.Info, ButtonsType.Ok,
                                               Catalog.GetString("OCM was unable to find any child waypoints."));
         dlg.Run();
         dlg.Hide();
     }
 }
开发者ID:cbuehler,项目名称:opencachemanager,代码行数:18,代码来源:WaypointWidget.cs

示例15: AddTool

 public void AddTool(ExternalTool tool)
 {
     if (m_tools.ContainsKey(tool.Name))
     {
         MessageDialog dlg = new MessageDialog(null, DialogFlags.Modal, MessageType.Question, ButtonsType.YesNo,
                                               String.Format(Catalog.GetString("Are you sure you wish to " +
                                               	"overwrite \"{0}\"?"), tool.Name));
         if ((int) ResponseType.Yes != dlg.Run())
         {
             dlg.Hide();
             return;
         }
         else
         {
             dlg.Hide();
             m_tools.Remove(tool.Name);
         }
     }
     m_tools.Add(tool.Name, tool);
     UpdateETFile();
 }
开发者ID:cbuehler,项目名称:opencachemanager,代码行数:21,代码来源:EToolList.cs


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