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