本文整理汇总了C#中Gtk.ResponseArgs类的典型用法代码示例。如果您正苦于以下问题:C# ResponseArgs类的具体用法?C# ResponseArgs怎么用?C# ResponseArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ResponseArgs类属于Gtk命名空间,在下文中一共展示了ResponseArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ContactDialogResponseHandler
void ContactDialogResponseHandler(object o, ResponseArgs args, ContactHandler contactHandler)
{
var dialog = (ContactDialog)o;
if (args.ResponseId.Equals(ResponseType.Ok)) {
contactHandler(dialog.GetContact());
}
dialog.Hide();
}
示例2: HandleResponse
void HandleResponse (object obj, ResponseArgs args)
{
switch(args.ResponseId)
{
case ResponseType.Close:
this.Destroy ();
break;
}
}
示例3: OnWindowResponse
public void OnWindowResponse(object o, ResponseArgs args)
{
switch ((int) args.ResponseId) {
case (int) ResponseType.DeleteEvent:
case (int) ResponseType.Cancel:
case (int) ResponseType.Close:
window.Visible = false;
break;
default:
break;
}
}
示例4: on_dialog_response
private void on_dialog_response (object sender, ResponseArgs args) {
if (args.ResponseId != Gtk.ResponseType.Ok) {
// FIXME this is to work around a bug in gtk+ where
// the filesystem events are still listened to when
// a FileChooserButton is destroyed but not finalized
// and an event comes in that wants to update the child widgets.
uri_chooser.Dispose ();
uri_chooser = null;
} else if (args.ResponseId == Gtk.ResponseType.Ok) {
zip ();
}
zipdiag.Destroy ();
}
示例5: OnRespond
protected void OnRespond (object o, ResponseArgs args)
{
if (args.ResponseId != Gtk.ResponseType.Ok)
return;
TreeIter iter;
var list = new List<int> ();
if (storeSelected.GetIterFirst (out iter)) {
do {
var enc = (int)storeSelected.GetValue (iter, 2);
list.Add (enc);
} while (storeSelected.IterNext (ref iter));
}
TextEncoding.ConversionEncodings = list.Select (TextEncoding.GetEncoding).ToArray ();
}
示例6: OnRespond
protected void OnRespond (object o, ResponseArgs args)
{
if (args.ResponseId != Gtk.ResponseType.Ok)
return;
TreeIter iter;
ArrayList list = new ArrayList ();
if (storeSelected.GetIterFirst (out iter)) {
do {
string id = (string) storeSelected.GetValue (iter, 1);
TextEncoding enc = TextEncoding.GetEncoding (id);
list.Add (enc);
}
while (storeSelected.IterNext (ref iter));
}
TextEncoding.ConversionEncodings = (TextEncoding[]) list.ToArray (typeof(TextEncoding));
}
示例7: _OnResponse
void _OnResponse( object o, ResponseArgs args )
{
switch (args.ResponseId)
{
case ResponseType.Ok: // save
Trace.WriteLine( "ConfigDlg: Ok" );
bool convertOk = false;
int port = 0;
try
{
port = Convert.ToInt32( _serverPort.Text );
convertOk = true;
}
catch (Exception e)
{
// I think we should prevent all invalid entry rather
// than catching it here after the fact.
Trace.WriteLine( "Invalid port - " + e.ToString() );
}
if (convertOk)
{
_settings.serverName = _serverName.Text;
_settings.serverPort = port;
Hide();
}
break;
case ResponseType.Cancel:
// Restore previous values to controls
_serverName.Text = _settings.serverName;
_serverPort.Text = _settings.serverPort.ToString();
Hide();
break;
default:
Trace.WriteLine( "ConfigDlg: Unexpected Response" );
break;
}
}
示例8: OnDialogResponse
//Disabling warning 0169 because this code will be called at
//runtime with glade.
#pragma warning disable 0169
private void OnDialogResponse (object sender, ResponseArgs args)
{
if (args.ResponseId == ResponseType.Ok) {
MeasureFinder measureFinder = new MeasureFinder ();
int minimumValue = Int32.Parse (minimumValueEntry.Text);
if (linesPerMethodRadioButton.Active) {
results = measureFinder.FindByLinesPerMethod (measures, minimumValue);
}
else if (parametersPerMethodRadioButton.Active) {
results = measureFinder.FindByParametersPerMethod (measures, minimumValue);
}
else if (numberOfLinesRadioButton.Active) {
results = measureFinder.FindByNumberOfLines (measures, minimumValue);
}
else if (numberOfParametersRadioButton.Active) {
results = measureFinder.FindByNumberOfParameters (measures, minimumValue);
}
else if (numberOfFieldsRadioButton.Active) {
results = measureFinder.FindByNumberOfFields (measures, minimumValue);
}
}
findDialog.Destroy ();
}
示例9: OnAboutResponse
private void OnAboutResponse(object o, ResponseArgs args)
{
AboutDialog dialog = (AboutDialog) o;
dialog.Destroy ();
}
示例10: HandleResponse
void HandleResponse (object obj, ResponseArgs args) {
if (args.ResponseId == ResponseType.Accept) {
PhotoQuery query = new PhotoQuery (from_db.Photos);
query.RollSet = mdd.ActiveRolls == null ? null : new RollSet (mdd.ActiveRolls);
DoMerge (query, mdd.ActiveRolls, mdd.Copy);
}
mdd.Dialog.Destroy ();
}
示例11: OnUserSelectorResponse
private void OnUserSelectorResponse(object o, ResponseArgs args)
{
if(UserSelector != null)
{
switch(args.ResponseId)
{
case Gtk.ResponseType.Ok:
{
foreach(MemberInfo member in UserSelector.SelectedUsers)
{
if(!curUsers.ContainsKey(member.UserID))
{
try
{
iFolderUser newUser =
ifws.AddAndInviteUser(
ifolder.ID,
member.Name,
member.GivenName,
member.FamilyName,
member.UserID,
null,
"ReadWrite" );
TreeIter iter =
UserTreeStore.AppendValues(newUser);
if (memberFullNames.Contains(newUser.FN))
{
duplicateMembers[newUser.FN] = 0;
}
else
memberFullNames[newUser.FN] = 0;
curUsers.Add(newUser.UserID, iter);
}
catch(Exception e)
{
iFolderExceptionDialog ied =
new iFolderExceptionDialog(
topLevelWindow, e);
ied.Run();
ied.Hide();
ied.Destroy();
ied = null;
break;
}
}
}
UserSelector.Hide();
UserSelector.Destroy();
UserSelector = null;
break;
}
case Gtk.ResponseType.Help:
{
Util.ShowHelp("sharewith.html#bq6lwm0", topLevelWindow);
break;
}
case Gtk.ResponseType.Cancel:
{
UserSelector.Hide();
UserSelector.Destroy();
UserSelector = null;
break;
}
}
}
}
示例12: _OnUserResponse
void _OnUserResponse( object sender, ResponseArgs args )
{
_Trace( "[_OnUserResponse]" );
switch (args.ResponseId)
{
case ResponseType.Ok:
try
{
_database = _databaseEntry.Text;
_mp3RootDir = _mp3RootDirEntry.Text;
// Complain if the mp3 root dir doesn't exist.
DirectoryInfo mp3DirInfo = new DirectoryInfo( _mp3RootDir );
if (!mp3DirInfo.Exists)
{
MessageDialog md =
new MessageDialog( _localConfigDialog,
DialogFlags.Modal,
MessageType.Error,
ButtonsType.Ok,
("Directory '" + _mp3RootDir
+ "' does not exist") );
md.Run();
md.Destroy();
return;
}
// If the db file does not exist, create it. If necessary.
FileInfo dbInfo = new FileInfo( _database );
if (!dbInfo.Exists)
{
// If we don't reate the file, quick exit here (keep
// the dialog going)
if (!_CreateDatabasePrompt( _database ))
return;
}
// If we got here, the controls validated
_localConfigDialog.Destroy();
_isOk = true;
}
catch (Exception exception)
{
_Trace( exception.ToString() );
}
break;
case ResponseType.Cancel:
default:
_localConfigDialog.Destroy();
break; // er
}
}
示例13: OnStationEditorResponse
private void OnStationEditorResponse (object o, ResponseArgs args)
{
StationEditor editor = (StationEditor)o;
bool destroy = true;
try {
if (args.ResponseId == ResponseType.Ok) {
DatabaseTrackInfo track = editor.Track ?? new DatabaseTrackInfo ();
track.PrimarySource = this;
track.IsLive = true;
try {
track.Uri = new SafeUri (editor.StreamUri);
} catch {
destroy = false;
editor.ErrorMessage = Catalog.GetString ("Please provide a valid station URI");
}
if (!String.IsNullOrEmpty (editor.StationCreator)) {
track.ArtistName = editor.StationCreator;
}
track.Comment = editor.Description;
if (!String.IsNullOrEmpty (editor.Genre)) {
track.Genre = editor.Genre;
} else {
destroy = false;
editor.ErrorMessage = Catalog.GetString ("Please provide a station genre");
}
if (!String.IsNullOrEmpty (editor.StationTitle)) {
track.TrackTitle = editor.StationTitle;
track.AlbumTitle = editor.StationTitle;
} else {
destroy = false;
editor.ErrorMessage = Catalog.GetString ("Please provide a station title");
}
track.Rating = editor.Rating;
if (destroy) {
track.Save ();
}
}
} finally {
if (destroy) {
editor.Response -= OnStationEditorResponse;
editor.Destroy ();
}
}
}
示例14: HandleResponse
void HandleResponse(object obj, ResponseArgs args)
{
dialog.Destroy ();
}
示例15: on_dialog_response
void on_dialog_response(object obj, ResponseArgs args)
{
if (args.ResponseId == ResponseType.Ok) {
create_mosaics ();
}
metapixel_dialog.Destroy ();
}