本文整理汇总了C#中Photo.RenameVersion方法的典型用法代码示例。如果您正苦于以下问题:C# Photo.RenameVersion方法的具体用法?C# Photo.RenameVersion怎么用?C# Photo.RenameVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Photo
的用法示例。
在下文中一共展示了Photo.RenameVersion方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
public bool Execute(PhotoStore store, Photo photo, Gtk.Window parent_window)
{
VersionNameRequest request = new VersionNameRequest (VersionNameRequest.RequestType.Rename,
photo, parent_window);
string new_name;
ResponseType response = request.Run (out new_name);
if (response != ResponseType.Ok)
return false;
try {
photo.RenameVersion (photo.DefaultVersionId, new_name);
store.Commit (photo);
return true;
} catch (Exception e) {
HandleException ("Could not rename a version", e, parent_window);
return false;
}
}
示例2: Execute
public bool Execute(PhotoStore store, Photo photo, Gtk.Window parent_window)
{
VersionNameRequest request = new VersionNameRequest (VersionNameRequest.RequestType.Rename,
photo, parent_window);
string new_name;
ResponseType response = request.Run (out new_name);
if (response != ResponseType.Ok)
return false;
try {
photo.RenameVersion (photo.DefaultVersionId, new_name);
store.Commit (photo);
} catch (Exception e) {
string msg = Catalog.GetString ("Could not rename a version");
string desc = String.Format (Catalog.GetString ("Received exception \"{0}\". Unable to rename version to \"{1}\""),
e.Message, new_name);
HigMessageDialog md = new HigMessageDialog (parent_window, DialogFlags.DestroyWithParent,
Gtk.MessageType.Error, ButtonsType.Ok,
msg,
desc);
md.Run ();
md.Destroy ();
return false;
}
return true;
}