本文整理汇总了C#中Gtk.MessageDialog.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# Gtk.MessageDialog.Dispose方法的具体用法?C# Gtk.MessageDialog.Dispose怎么用?C# Gtk.MessageDialog.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.MessageDialog
的用法示例。
在下文中一共展示了Gtk.MessageDialog.Dispose方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MainClass
public MainClass(bool debug, string appName)
{
GLibLogging.Enabled = true;
Assembly exe = typeof (MainClass).Assembly;
string configDir = Path.GetFullPath (Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData), appName));
string lockFile = Path.Combine (configDir, "pid.lock");
bool instanceRunning = DetectInstances (lockFile, appName);
if (instanceRunning) {
Gtk.Application.Init ();
Gtk.MessageDialog md = new Gtk.MessageDialog (null, Gtk.DialogFlags.Modal, Gtk.MessageType.Warning, Gtk.ButtonsType.Close,
GettextCatalog.GetString ("An instance of StrongMonkey with configuration profile '{0}' is already running.{1}If you really want to run 2 seperate instances, use the \"--appName=StrongMonkeyXXX\" command line parameter",
appName, Environment.NewLine));
md.Run ();
md.Destroy ();
md.Dispose ();
md.Close += delegate(object sender, EventArgs e) {
Gtk.Application.Quit ();
};
Gtk.Application.Run ();
} else {
CoreUtility.Initialize (exe, appName, debug);
WriteInstancePid (lockFile);
AddinUtility.Initialize ();
}
}
示例2: DoCancel
private void DoCancel()
{
m_parser.Cancel = true;
this.Hide ();
String message = Catalog.GetString("Import cancelled, all changes reverted.");
Gtk.MessageDialog dlg = new Gtk.MessageDialog (this, Gtk.DialogFlags.Modal, Gtk.MessageType.Info,
Gtk.ButtonsType.Ok, message);
dlg.Run ();
dlg.Hide ();
dlg.Dispose ();
}
示例3: validateEntry
private bool validateEntry()
{
if (String.IsNullOrEmpty(nameEntry.Text))
{
Gtk.MessageDialog msg = new Gtk.MessageDialog(this, Gtk.DialogFlags.DestroyWithParent,
Gtk.MessageType.Error, Gtk.ButtonsType.Ok,
"The name field is required.");
msg.Run();
msg.Hide();
msg.Dispose();
return false;
}
/*if (!locationWidget.Latitude.ValidateEntry())
return false;
if (!locationWidget.Longitude.ValidateEntry())
return false;*/
return true;
}
示例4: ValidateEntry
public bool ValidateEntry()
{
try
{
int degrees = int.Parse(degreeEntry.Text, CultureInfo.InvariantCulture);
double minutes = double.Parse(minuteEntry.Text, CultureInfo.InvariantCulture);
if (degrees < 0 || minutes < 0)
throw new Exception();
return true;
}
catch (Exception)
{
Gtk.MessageDialog dlg = new Gtk.MessageDialog(null, Gtk.DialogFlags.DestroyWithParent,
Gtk.MessageType.Error, Gtk.ButtonsType.Ok,
Catalog.GetString("Invalid Coordinate"));
dlg.Run();
dlg.Hide();
dlg.Dispose();
return false;
}
}