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


C# Gtk.MessageDialog类代码示例

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


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

示例1: editMode

        //wenn bearbeitet werden muss, dann diese Methode aufrufen, um die Entrys zu fuellen
        public bool editMode(string name, string date, string starttime, string endtime)
        {
            TimeDetailid = SelectWidget.connection.checkOutTimedetailID (name, starttime); // liest die ID von der Schicht aus

            if (TimeDetailid == 0) { //Wenn die id = 0 gilt, dann ist die Auslesung nicht erfolgt
                MessageDialog md = new MessageDialog (null, DialogFlags.DestroyWithParent, MessageType.Error, ButtonsType.Ok, "Schicht kann nicht bearbeitet werden!");
                md.Run ();
                md.Destroy ();
                return false;
            }

            nameEntry.Text = name;
            dateLabel.Text = date;
            if (date == "10.07.2015") {

            }
            if (date == "11.07.2015") {

            }
            if (date == "12.07.2015") {

            }
            string[] starthourSplit = starttime.Split(new char[2]);
            startHourEntry.Text = starthourSplit[0];
            StartMinuteEntry.Text = "";
            stopHourEntry.Text = "";
            StopMinuteEntry.Text = "";
            return true;
        }
开发者ID:Bischi,项目名称:personalManager,代码行数:30,代码来源:NewTimesWidget.cs

示例2: clsHost

        public clsHost(String filePath)
        {
            var buildTarget = MonoDevelop.Ide.IdeApp.ProjectOperations.CurrentSelectedBuildTarget;
            var buildConfigs = ((DotNetProject)buildTarget).Configurations;
            build_exe_path = buildConfigs.Cast<DotNetProjectConfiguration> ().First (x => x.DebugType == "full").CompiledOutputName;

            ScriptPath = filePath;
            LocalHost = IPAddress.Loopback.ToString ();
            LocalTunnelPort = 10123;

            TerminalFont = "Monospace 10";
            TerminalCols = 120;
            TerminalRows = 50;
            TerminalEmulation = "vt100";

            try
            {
                ProcessScript (false);
                clsSSHDebuggerEngine.HostsList.Add (this);
            }
            catch (Exception ex)
            {
                Gtk.Application.Invoke (delegate {
                        using (var md = new MessageDialog (null, DialogFlags.Modal, MessageType.Info, ButtonsType.Ok,ex.Message)) {
                            md.Title = "ProcessScript";
                            md.Run ();
                            md.Destroy ();
                        }
                    });
            }
        }
开发者ID:Clancey,项目名称:SSHDebugger,代码行数:31,代码来源:clsHost.cs

示例3: Error

		CompareDefinition Error (string format, params string [] args)
		{
			MessageDialog md = new MessageDialog (this, DialogFlags.DestroyWithParent, MessageType.Error, ButtonsType.Close, String.Format (format, args));
			md.Run ();
			md.Destroy ();
			return null;
		}
开发者ID:col42dev,项目名称:mono-tools,代码行数:7,代码来源:CustomCompare.cs

示例4: OnButton15Clicked

        protected void OnButton15Clicked(object sender, EventArgs e)
        {
            MessageDialog md = new MessageDialog(null, DialogFlags.Modal, MessageType.Info, ButtonsType.None, "Sending bug report..");
            md.Icon = Image.LoadFromResource("Gtktester.Icons.PNG.256.png").Pixbuf;
            md.WindowPosition = WindowPosition.Center;

            using (WebClient client = new WebClient())
            {
                Uri urlll = new Uri(Uri.EscapeUriString(
                                    String.Format(
                                        "http://mrmiketheripper.x10.mx/bugreports/luamodulemanager/?runningonmono={0}&compiledonmono={1}&clrversion={2}&platform={3}&osversion={4}&64bit={5}&additionalcomments={6}",
                                        SysInfo.RunOnMono.ToString(), SysInfo.CompiledOnMono.ToString(), SysInfo.CLRVersion.ToString(), SysInfo.OS.Platform.ToString(),
                                        SysInfo.OS.Version.ToString(), SysInfo.Is64Bit.ToString(), textview2.Buffer.Text)
                                ));
                #if DEBUG
                Console.WriteLine(urlll);
                #endif
                string responseBody = client.DownloadString(urlll);

                if(responseBody == "1Sent")
                    md = new MessageDialog(null, DialogFlags.Modal, MessageType.Info, ButtonsType.Ok, "Sent okay!\nResponse: {0}", responseBody);
                else
                    md = new MessageDialog(null, DialogFlags.Modal, MessageType.Info, ButtonsType.Ok, "Error sending!\nResponse: {0}", responseBody);
                md.Run();
                md.Destroy();
            }

            this.Destroy();
        }
开发者ID:Luigifan,项目名称:LuaScriptsManager,代码行数:29,代码来源:BugReporter.cs

示例5: OnButtonClicked

 protected void OnButtonClicked(object sender, EventArgs e)
 {
     if (sender == button1)
     {
         // native system calls messagebox demo
         // note: this is just a demo, you should always use GTK if you can!
         if (MainClass.platform == Platforms.Mac)
         {
             MonoMac.AppKit.NSAlert alert = new MonoMac.AppKit.NSAlert ();
             alert.MessageText = "Hello";
             alert.AlertStyle = MonoMac.AppKit.NSAlertStyle.Informational;
             alert.AddButton ("Ok");
             alert.RunModal ();
         }
         else if (MainClass.platform == Platforms.Windows)
         {
             CrossTemplate.Win32.user32.MessageBox (IntPtr.Zero, "Hello", "Caption", 0x40 /* MB_ICONINFORMATION */);
         }
         else
         {
             throw new NotImplementedException ();
         }
     }
     else if (sender == button2)
     {
         // Gtk
         Gtk.MessageDialog alert = new Gtk.MessageDialog(this, DialogFlags.Modal, MessageType.Info, ButtonsType.Ok, "Hello");
         alert.Title = "Caption";
         ResponseType result = (ResponseType)alert.Run ();
         if (result == ResponseType.Ok)
         {
             alert.Destroy ();
         }
     }
 }
开发者ID:Eun,项目名称:CrossTemplate,代码行数:35,代码来源:MainWindow.cs

示例6: RunCheckVersion

        public static void RunCheckVersion(bool updateDB, bool updateApp, bool installMicroUpdate)
        {
            CheckBaseVersion.Check ();

            if(CheckBaseVersion.ResultFlags == CheckBaseResult.BaseVersionLess && updateDB)
            {
                DB.DBUpdater.TryUpdate ();
                RunCheckVersion (updateDB, updateApp, installMicroUpdate);
                return;
            }

            if(CheckBaseVersion.ResultFlags == CheckBaseResult.BaseVersionGreater && updateApp)
            {
                CheckUpdate.StartCheckUpdateThread (UpdaterFlags.UpdateRequired);
            }

            if(CheckBaseVersion.ResultFlags != CheckBaseResult.Ok)
            {
                MessageDialog VersionError = new MessageDialog (QSProjectsLib.QSMain.ErrorDlgParrent,
                    DialogFlags.DestroyWithParent,
                    MessageType.Warning,
                    ButtonsType.Close,
                    CheckBaseVersion.TextMessage);
                VersionError.Run ();
                VersionError.Destroy ();
                Environment.Exit (0);
            }

            if (installMicroUpdate)
                DB.DBUpdater.CheckMicroUpdates ();

            if(updateApp)
                CheckUpdate.StartCheckUpdateThread (UpdaterFlags.StartInThread);
        }
开发者ID:QualitySolution,项目名称:QSProjects,代码行数:34,代码来源:MainUpdater.cs

示例7: ShowCertDialog

 private void ShowCertDialog ()
 {
     Logger.Debug ("Showing Cert Dialog: " + Handler.UserMessage);
     CertPolicyHandler.Response ret = CertPolicyHandler.Response.None;
     using (var handle = new AutoResetEvent(false)) {
         Application.Invoke (delegate {
             try {
                 using (MessageDialog md = new MessageDialog (null, DialogFlags.Modal,
                 MessageType.Warning, ButtonsType.None, Handler.UserMessage +
                 "\n\nDo you trust this certificate?") {
                     Title = "Untrusted Certificate"})
                 {
                     using (var noButton = md.AddButton("No", (int)CertPolicyHandler.Response.CertDeny))
                     using (var justNowButton = md.AddButton("Just now", (int)CertPolicyHandler.Response.CertAcceptSession))
                     using (var alwaysButton = md.AddButton("Always", (int)CertPolicyHandler.Response.CertAcceptAlways))
                     {
                         ret = (CertPolicyHandler.Response)md.Run ();
                         md.Destroy ();
                     }
                 }
             } finally {
                 handle.Set ();
             }
         }
         );
         handle.WaitOne ();
     }
     Logger.Debug ("Cert Dialog return:" + ret.ToString ());
     Handler.UserResponse = ret;
 }
开发者ID:emrul,项目名称:CmisSync,代码行数:30,代码来源:CertPolicyWindow.cs

示例8: ShowMessageBox

        //FileChooserDialog sfd = new FileChooserDialog() { OverwritePrompt = true, ValidateNames = true, AddExtension = true };
        //FileChooserDialog ofd = new FileChooserDialog() { CheckFileExists = true, CheckPathExists = true };

        public DialogResult ShowMessageBox(string Text, string Caption, MessageBoxButtons Button, MessageBoxIcon Icon)
        {
            var m = new MessageDialog(MainForm, DialogFlags.Modal, MessageType.Warning, ButtonsType.Ok, Text);
            m.Run();
            m.Destroy();
            return DialogResult.OK;
        }
开发者ID:JoeyEremondi,项目名称:tikzedt,代码行数:10,代码来源:GlobalUIGTK.cs

示例9: OnCmdGrabarClicked

        protected virtual void OnCmdGrabarClicked(object sender, System.EventArgs e)
        {
            TreeIter iter = new TreeIter();

            if (tvLista.Model.GetIterFirst(out iter)) {
            do {
                if (tvLista.Model.GetValue(iter,cafeteria.tvLista_Col_Cantidad).ToString() != "0")
                {
                    MySQL.consultar("INSERT INTO `cafeteria_stock` (`ID_articulo`, `stock`, `fecha`, `ingresado_por`) " +
                    "VALUES(" +
                            "'" + tvLista.Model.GetValue(iter,cafeteria.tvLista_Col_ID_articulo).ToString() + "'," +
                            "'" + tvLista.Model.GetValue(iter,cafeteria.tvLista_Col_Cantidad).ToString() + "'," +
                            "NOW()," +
                            auth.ID_usuario +
                            ")");
                }
            } while(tvLista.Model.IterNext(ref iter));
            }
            MySQL.consultar("INSERT INTO `cafeteria_ingresos` (`ID_ingreso`, `descripcion`, `comprador`, `ingresado_por`, `fechatiempo`, `total_compra`) " +
            "VALUES(" +
            "0, " +
            "'"+txtDetalle.Buffer.Text+"'," +
            "'"+txtComprador.Text+"'," +
            ""+auth.ID_usuario+"," +
            "NOW()," +
            "'"+txtTotalCompra.Text+"'" +
            ")");

            Gtk.MessageDialog Mensaje = new MessageDialog(this, DialogFlags.Modal, MessageType.Info, ButtonsType.Close, "Ingreso realizado.\nEsta ventana se cerrará");
            Mensaje.Title="Éxito";
            Mensaje.Run();
            Mensaje.Destroy();
            this.Destroy();
            return;
        }
开发者ID:vlad88sv,项目名称:RIFT,代码行数:35,代码来源:compras.cs

示例10: HandleSave

		protected void HandleSave (object sender, EventArgs e)
		{
			if (null == fileSaveWidget.Filename ||
			    	fileSaveWidget.Filename.Length == 0) {
				Gtk.MessageDialog infoDlg = new MessageDialog (
					this, DialogFlags.Modal, MessageType.Info, ButtonsType.Ok,
					"Set file name");
				infoDlg.Run ();
				infoDlg.Destroy ();
				return;
			}

			string fileName = System.IO.Path.GetFullPath(fileSaveWidget.Filename);
			this.dftUtil.Save(fileName, fontService);

			/*
			Gtk.MessageDialog successDlg = new MessageDialog (
				this, DialogFlags.Modal, MessageType.Info, ButtonsType.Ok,
				"Done");
			successDlg.Run ();
			successDlg.Destroy ();
			*/

			this.Destroy ();
		}
开发者ID:MagistrTot,项目名称:DGLE,代码行数:25,代码来源:FontBuildWindow.cs

示例11: SaveBeforePrint

        public static bool SaveBeforePrint(Type savingEntity, string whatPrint)
        {
            string  savingName = "НЕ УКАЗАНО";

            var att = savingEntity.GetCustomAttributes (typeof(OrmSubjectAttribute), true);
            if (att.Length > 0) {
                if(!String.IsNullOrWhiteSpace ((att [0] as OrmSubjectAttribute).AllNames.Prepositional))
                {
                    savingName = (att [0] as OrmSubjectAttribute).AllNames.Prepositional;
                }
                else
                {
                    savingName = (att [0] as OrmSubjectAttribute).ObjectName;
                }
            }

            string message = String.Format ("Перед печатью {0}, необходимо сохранить изменения в {1}. Сохранить?",
                whatPrint,
                savingName
            );
            var md = new MessageDialog ( QSMain.ErrorDlgParrent, DialogFlags.Modal,
                MessageType.Question,
                ButtonsType.YesNo,
                message);
            bool result = (ResponseType)md.Run () == ResponseType.Yes;
            md.Destroy ();
            return result;
        }
开发者ID:QualitySolution,项目名称:QSProjects,代码行数:28,代码来源:CommonDialogs.cs

示例12: ShowMessage

        public static void ShowMessage(Window parent, string title, string msg, bool error)
        {
            MessageType type = (error ? MessageType.Error : MessageType.Info);
            MessageDialog dlg = new MessageDialog
            (
                parent,
                DialogFlags.Modal,
                type,
                ButtonsType.Ok,
                null
            );

            dlg.Title = title;
            dlg.Text = msg;
            if(parent == null)
                dlg.WindowPosition = WindowPosition.Mouse;

            dlg.Opacity = 0.95;
            //dlg.Deletable = false;

            //AppHelper.Log("launching message dialog" + (parent != null ? " con parent" :  ""));
            dlg.Run();
            //AppHelper.Log("destroying message dialog");
            dlg.Destroy();
        }
开发者ID:omarkhd,项目名称:gymk,代码行数:25,代码来源:GuiHelper.cs

示例13: CheckForLunaDllUpdates

 public void CheckForLunaDllUpdates()
 {
     if (MainWindow.wohl != null)
     {
         Version actualLatest = MainWindow.wohl.ReturnLatestVersion();
         if (actualLatest > CurLunaDllVer)
         {
             MessageDialog md = new MessageDialog(null,
                 DialogFlags.Modal,
                 MessageType.Question,
                 ButtonsType.YesNo, "A new LunaLua version is available!\n\nYour Version: {0}\nLatest: {1}\n\nWould you like to update?", CurLunaDllVer, actualLatest);
             md.Icon = Image.LoadFromResource("Gtktester.Icons.PNG.256.png").Pixbuf;
             md.WindowPosition = WindowPosition.Center;
             ResponseType res = (ResponseType)md.Run();
             if (res == ResponseType.Yes)
             {
                 UpdateLunaLua();
             }
             else
             {
             }
             md.Destroy();
         }
     }
 }
开发者ID:Luigifan,项目名称:LuaScriptsManager,代码行数:25,代码来源:LunaLuaInformation.cs

示例14: load

        public static Preferences load()
        {
            var path = GetPreferencesFilePath ();

            try {
                using (System.IO.StreamReader file = new System.IO.StreamReader(path)) {
                    System.Xml.Serialization.XmlSerializer reader =
                        new System.Xml.Serialization.XmlSerializer(typeof(Preferences));

                    Preferences preferences =  (Preferences) reader.Deserialize(file);
                    return preferences;
                }
            }
            catch(System.IO.FileNotFoundException) {
                return new Preferences ();
            }
            catch(Exception) {
                MessageDialog md = new MessageDialog (null, DialogFlags.Modal, MessageType.Error, ButtonsType.Ok,
                    "There was a problem loading user preferences. Your settings were reset.");
                md.Title = "CircleCI Indicator Failure";
                md.Run();
                md.Destroy();
                Preferences p = new Preferences ();
                p.save ();
                return p;
            }
        }
开发者ID:rossille,项目名称:circleci-notification,代码行数:27,代码来源:Preferences.cs

示例15: Main

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

            if (!ImageMagickResolver.Resolved ()) {
                var builder = new System.Text.StringBuilder ("Hi there,");
                builder.AppendLine ();
                builder.AppendLine ("I was unable to find ImageMagick on your system which means...");
                builder.AppendLine ("a) It is not installed");
                builder.AppendLine ("b) It is in a directory I haven't checked");
                builder.AppendLine ("");
                builder.AppendLine ("If 'a' please exit the application and install ImageMagick");
                builder.AppendLine ("If 'b' then please edit the file '{0}' and insert the correct location for convert and montage");
                builder.AppendLine ();
                builder.AppendLine ("Please visit the FAQ <a href=\"http://fontwhiz.com\">http://fontwhiz.com</a> if you are unclear.");

                var messageDialog = new MessageDialog (null,
                                                       DialogFlags.Modal,
                                                       MessageType.Error,
                                                       ButtonsType.Close,
                                                       builder.ToString (), UserSettings.AppUserSettingsFile);

                messageDialog.WindowPosition = WindowPosition.Center;

                messageDialog.Run ();
                messageDialog.Destroy ();
                return;
            }

            MainWindow win = new MainWindow ();
            win.Show ();
            Application.Run ();
        }
开发者ID:jasemagee,项目名称:FontWhiz,代码行数:33,代码来源:Main.cs


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