本文整理汇总了C#中Gtk.MessageDialog.Run方法的典型用法代码示例。如果您正苦于以下问题:C# MessageDialog.Run方法的具体用法?C# MessageDialog.Run怎么用?C# MessageDialog.Run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.MessageDialog
的用法示例。
在下文中一共展示了MessageDialog.Run方法的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: 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();
}
}
示例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;
}
示例4: 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 ();
}
});
}
}
示例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: GetFilteredClient
/// <summary>
/// Prendre nom de famille écris pour populer le combo box
/// </summary>
/// <returns>The filtered client.</returns>
/// <param name="nomFamille">Nom famille.</param>
protected DataSet GetFilteredClient(string nomFamille)
{
DataSet client = new DataSet();
ConnectionMySQL conn = new ConnectionMySQL ();
try
{
conn.InitializeDB (LoginWindow.Uid, LoginWindow.Password);
conn.OpenConnection ();
client = conn.FindClientAvecNomFamille(nomFamille);
return client;
}catch(Exception ex)
{
MessageDialog ms = new MessageDialog (this, DialogFlags.Modal, MessageType.Error,
ButtonsType.Ok, ex.Message);
ms.Run ();
ms.Destroy ();
}
finally
{
conn.CloseConnection ();
}
return null;
}
示例8: Main
public static void Main(string[] args)
{
//GLib.Thread.Init();
//Gdk.Threads.Init();
Application.Init();
MainWindow win = new MainWindow();
GLib.ExceptionManager.UnhandledException += (unhandledException) =>
{
MessageDialog md = new MessageDialog(
win, DialogFlags.Modal, MessageType.Other,
ButtonsType.Ok, unhandledException.ExceptionObject.ToString());
md.Run();
md.Destroy();
};
win.Show();
Application.Run();
//Gdk.Threads.Enter();
//try
//{
// Application.Run();
//}
//finally
//{
// Gdk.Threads.Leave();
//}
}
示例9: 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;
}
示例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 ();
}
示例11: 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();
}
示例12: 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();
}
}
}
示例13: 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;
}
}
示例14: 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();
}
}
示例15: ShowInfo
public static void ShowInfo( string message, params string[] args )
{
MessageDialog dlg = new MessageDialog(null, DialogFlags.Modal, Gtk.MessageType.Info, ButtonsType.Ok, message, args);
dlg.Title = "SpoolPad";
dlg.Run();
dlg.Destroy();
}