本文整理汇总了C#中Gtk.MessageDialog.ShowAll方法的典型用法代码示例。如果您正苦于以下问题:C# MessageDialog.ShowAll方法的具体用法?C# MessageDialog.ShowAll怎么用?C# MessageDialog.ShowAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.MessageDialog
的用法示例。
在下文中一共展示了MessageDialog.ShowAll方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RunWarningDialog
public static void RunWarningDialog(string warning)
{
MessageDialog md = new MessageDialog (null,
DialogFlags.Modal,
MessageType.Warning,
ButtonsType.Ok,
warning);
md.SetPosition (WindowPosition.Center);
md.ShowAll ();
md.Run ();
md.Destroy ();
}
示例2: RunErrorDialog
public static void RunErrorDialog(string error)
{
MessageDialog md = new MessageDialog (null,
DialogFlags.Modal,
MessageType.Error,
ButtonsType.Ok,
error);
md.SetPosition (WindowPosition.Center);
md.ShowAll ();
md.Run ();
md.Destroy ();
}
示例3: RunQuestionDialog
public static bool RunQuestionDialog(string question)
{
MessageDialog md = new MessageDialog (null,
DialogFlags.Modal,
MessageType.Question,
ButtonsType.YesNo,
question);
md.SetPosition (WindowPosition.Center);
md.ShowAll ();
bool result = md.Run () == (int)ResponseType.Yes;
md.Destroy ();
return result;
}
示例4: ShowWarning
public void ShowWarning(string message)
{
Gtk.MessageDialog md = new Gtk.MessageDialog ((Gtk.Window) WorkbenchSingleton.Workbench, Gtk.DialogFlags.Modal | Gtk.DialogFlags.DestroyWithParent, Gtk.MessageType.Warning, Gtk.ButtonsType.Ok, message);
md.Response += new Gtk.ResponseHandler (OnWarningResponse);
md.ShowAll ();
}
示例5: ShowMessage
public void ShowMessage(string message, Gtk.Window parent )
{
Gtk.MessageDialog md = new Gtk.MessageDialog ((Gtk.Window) WorkbenchSingleton.Workbench, Gtk.DialogFlags.Modal | Gtk.DialogFlags.DestroyWithParent, Gtk.MessageType.Info, Gtk.ButtonsType.Ok, message );
if ( parent != null )
{
md.TransientFor = parent;
}
md.Response += new Gtk.ResponseHandler(OnMessageResponse);
md.ShowAll ();
}
示例6: OnPromptChanged
private void OnPromptChanged( object sender, EventArgs e )
{
var prompt = m_updater.CurrentPrompt;
var description = m_updater.GameDescription;
var customMessage = m_updater.CustomMessage;
var previousUsername = m_updater.PreviouslyEnteredUsername;
var previousPassword = m_updater.PreviouslyEnteredPassword;
Application.Invoke( delegate
{
if( prompt == GameUpdatePrompt.Username ||
prompt == GameUpdatePrompt.Password ||
prompt == GameUpdatePrompt.UsernameAndPassword )
{
// Show credentials dialog
var dialog = new CredentialsDialog(
this,
(prompt != GameUpdatePrompt.Password) ?
((previousUsername != null) ? previousUsername : "") :
null,
(prompt != GameUpdatePrompt.Username) ?
((previousPassword != null) ? previousPassword : "") :
null
);
dialog.ShowAll();
int response = dialog.Run();
string username = dialog.Username;
string password = dialog.Password;
dialog.Destroy();
// Inform the updater
if( response == (int)ResponseType.Close ||
response == (int)ResponseType.DeleteEvent )
{
m_updater.Cancel();
m_updater.AnswerPrompt( false );
}
else
{
m_updater.AnswerPrompt(
response == (int)ResponseType.Ok,
username,
password
);
}
}
else if( prompt == GameUpdatePrompt.CustomMessage )
{
// Show message dialog
Console.WriteLine( customMessage );
var dialog = new MessageDialog(
this,
DialogFlags.Modal,
MessageType.Info,
ButtonsType.Ok,
customMessage
);
dialog.ShowAll();
int response = dialog.Run();
dialog.Destroy();
// Inform the updater
m_updater.AnswerPrompt( true );
}
else
{
// Show question dialog
var dialog = new MessageDialog(
this,
DialogFlags.Modal,
MessageType.Question,
ButtonsType.YesNo,
prompt.GetQuestion( Program.Language, description )
);
dialog.ShowAll();
int response = dialog.Run();
dialog.Destroy();
// Inform the updater
if( response == (int)ResponseType.Close ||
response == (int)ResponseType.DeleteEvent )
{
m_updater.Cancel();
m_updater.AnswerPrompt( false );
}
else
{
m_updater.AnswerPrompt( response == (int)ResponseType.Yes );
}
}
} );
}
示例7: Friends_FriendshipOffered
void Friends_FriendshipOffered(object sender, FriendshipOfferedEventArgs e)
{
Gtk.Application.Invoke(delegate {
string msg;
msg="You have recieved a friendship request from "+e.AgentName+"\n They would like to become your friend \n do you want to accept?";
MessageDialog md= new Gtk.MessageDialog(this,DialogFlags.DestroyWithParent,MessageType.Question,ButtonsType.YesNo,true,msg);
md.Response += delegate(object o, ResponseArgs args)
{
if (args.ResponseId == ResponseType.Yes)
{
MainClass.client.Friends.AcceptFriendship(e.AgentID, e.SessionID);
}
else
{
MainClass.client.Friends.DeclineFriendship(e.AgentID, e.SessionID);
}
md.Destroy();
};
md.ShowAll();
});
}
示例8: Self_ScriptQuestion
void Self_ScriptQuestion(object sender, ScriptQuestionEventArgs e)
{
string message;
switch(e.Questions)
{
case ScriptPermission.Attach:
message="Attach to you";
break;
case ScriptPermission.ChangeJoints:
message="Change joints";
break;
case ScriptPermission.ChangeLinks:
message="Change links";
break;
case ScriptPermission.ChangePermissions:
message="<b>Change permissions<b>";
break;
case ScriptPermission.ControlCamera:
message="Control your camera";
break;
case ScriptPermission.Debit:
message="<b>BE ABLE TO TAKE YOUR MONEY<\b>";
break;
case ScriptPermission.ReleaseOwnership:
message="Release ownership";
break;
case ScriptPermission.RemapControls:
message="Remap controls";
break;
case ScriptPermission.TakeControls:
message="Take controls";
break;
case ScriptPermission.TrackCamera:
message="Track camera";
break;
case ScriptPermission.TriggerAnimation:
message="Trigger animations";
break;
default:
message="I HAVE NO IDEA";
return;
}
Gtk.Application.Invoke(delegate {
string msg;
msg="The object : "+e.ObjectName+"Owner by :"+e.ObjectOwnerName+"Would like to \n"+message+"\n Would you like to allow this?";
MessageDialog md= new Gtk.MessageDialog(this,DialogFlags.DestroyWithParent,MessageType.Question,ButtonsType.YesNo,true,msg);
md.Response += delegate(object o, ResponseArgs args)
{
if (args.ResponseId == ResponseType.Yes)
{
MainClass.client.Self.ScriptQuestionReply(e.Simulator, e.ItemID, e.TaskID, e.Questions);
}
else
{
MainClass.client.Self.ScriptQuestionReply(e.Simulator, e.ItemID, e.TaskID, ScriptPermission.None);
}
md.Destroy();
};
md.ShowAll();
});
}
示例9: Self_AlertMessage
void Self_AlertMessage(object sender, AlertMessageEventArgs e)
{
if(e.Message=="Autopilot canceled")
{
Logger.Log("Autopilot cancled",Helpers.LogLevel.Debug);
return;
}
Gtk.Application.Invoke(delegate {
string msg;
msg="<b>ALERT FROM SECONDLIFE</b>\n"+e.Message;
MessageDialog md= new Gtk.MessageDialog(this,DialogFlags.Modal,MessageType.Info,ButtonsType.Close,true,msg);
md.Response += delegate { md.Destroy(); };
md.ShowAll();
});
}
示例10: RunInfoDialog
public static void RunInfoDialog(string message)
{
MessageDialog md = new MessageDialog (null,
DialogFlags.Modal,
MessageType.Info,
ButtonsType.Ok,
message);
md.SetPosition (WindowPosition.Center);
md.ShowAll ();
md.Run ();
md.Destroy ();
}