本文整理汇总了C#中Gtk.MessageDialog.Destroy方法的典型用法代码示例。如果您正苦于以下问题:C# MessageDialog.Destroy方法的具体用法?C# MessageDialog.Destroy怎么用?C# MessageDialog.Destroy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.MessageDialog
的用法示例。
在下文中一共展示了MessageDialog.Destroy方法的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;
}
示例2: OnException
static void OnException(UnhandledExceptionArgs args)
{
//MessageDialog md = new MessageDialog(null, DialogFlags.Modal, MessageType.Error, ButtonsType.Ok, args.ExceptionObject.ToString());
MessageDialog md = new MessageDialog(null, DialogFlags.Modal, MessageType.Error, ButtonsType.Ok, "Hiba történt!");
md.Run();
md.Destroy();
}
示例3: show
public static ResponseType show(Window parent_window, DialogFlags dialogFlags, MessageType messageType, ButtonsType buttonsType,string message)
{
_dlg = new MessageDialog (parent_window, dialogFlags,messageType, buttonsType, message);
ResponseType response = (ResponseType) _dlg.Run ();
_dlg.Destroy ();
return response;
}
示例4: Main
public static void Main (string[] args)
{
Application.Init ();
if (args.Length == 0) {
ShowHelp ();
return;
}
if (args [0] == "-c") {
if (args.Length != 2) {
ShowHelp ();
return;
}
service = InstrumentationService.GetRemoteService (args[1]);
try {
service.GetCategories ();
} catch (Exception ex) {
MessageDialog md = new MessageDialog (null, DialogFlags.Modal, MessageType.Error, ButtonsType.Close, "Could not connect to instrumentation service: " + ex.Message);
md.Run ();
md.Destroy ();
return;
}
} else if (args.Length == 1) {
LoadServiceData (args[0]);
} else {
ShowHelp ();
return;
}
InstrumentationViewerDialog win = new InstrumentationViewerDialog ();
win.Show ();
Application.Run ();
}
示例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 ();
}
}
}
示例6: CloseProject
public static bool CloseProject()
{
if (Project.Modified) {
string msg = Catalog.GetString ("Do you want to save the project before closing?");
Gtk.MessageDialog dlg = new Gtk.MessageDialog (null, Gtk.DialogFlags.Modal, Gtk.MessageType.Question, ButtonsType.None, msg);
dlg.AddButton (Catalog.GetString ("Close without saving"), Gtk.ResponseType.No);
dlg.AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel);
dlg.AddButton (Gtk.Stock.Save, Gtk.ResponseType.Yes);
Gtk.ResponseType res = (Gtk.ResponseType) dlg.Run ();
dlg.Destroy ();
if (res == Gtk.ResponseType.Cancel)
return false;
if (res == Gtk.ResponseType.Yes) {
if (!SaveProject ())
return false;
}
}
object[] obs = new object [openWindows.Count];
openWindows.Values.CopyTo (obs, 0);
foreach (Gtk.Widget page in obs) {
WidgetNotebook.Remove (page);
page.Destroy ();
}
openWindows.Clear ();
Project.Close ();
MainWindow.Title = "Stetic";
ProjectView.Clear ();
return true;
}
示例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;
}
示例8: 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);
}
示例9: 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 ();
}
示例10: 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();
}
示例11: 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();
}
}
}
示例12: 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;
}
}
示例13: OnButton1Activated
protected virtual void OnButton1Activated(object sender, System.EventArgs e)
{
Console.WriteLine("dupa");
try
{
var reader = new StringReader(textview1.Buffer.Text);
var Sequences = Utils.ReadFasta(reader);
reader.Close();
Dispose();
}
catch
{
var md = new MessageDialog
(
this,
DialogFlags.DestroyWithParent,
MessageType.Error,
ButtonsType.Close,
"Błędny format pliku."
);
md.Title = "Błąd";
md.Run();
md.Destroy();
}
}
示例14: OnButton1Clicked
protected virtual void OnButton1Clicked(object sender, System.EventArgs e)
{
string username = this.entry3.Text;
string server_address = this.entry2.Text;
int server_port = this.spinbutton1.ValueAsInt;
if (username == "") {
MessageDialog md = new MessageDialog(this, DialogFlags.Modal, MessageType.Error, ButtonsType.Close, "Username not set.");
md.Run();
md.Destroy();
return;
}
if (this.server.Connected) {
this.server.Disconnect();
}
try {
this.server.Connect(username, server_address, server_port);
this.RefreshSimList();
} catch (System.Net.Sockets.SocketException) {
this.server.Disconnect();
MessageDialog md = new MessageDialog(this, DialogFlags.Modal, MessageType.Error, ButtonsType.Close, "Server not running on " + server_address + ":" + server_port + ".");
md.Run();
md.Destroy();
} catch {
this.server.Disconnect();
MessageDialog md = new MessageDialog(this, DialogFlags.Modal, MessageType.Error, ButtonsType.Close, "Connection error.");
md.Run();
md.Destroy();
}
}
示例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 ();
}