public static void OpenDocument(string filename) { if (DocumentAPI.IsFileLoaded(filename)) { string msg = string.Format("The file \"{0}\" is already open.", filename); var e = new Photoshop6OM.PhotoshoProxyError(msg); throw e; } PSX.CheckFileExists(filename); // Desc1 var Desc1 = PSX.MakeNewDescriptor(); Desc1.PutPath((int)con.phKeyNull, filename); int old_count = DocumentAPI.GetDocumentCount(); // Play the event in photoshop PSX.PlayEvent((int)con.phEventOpen, Desc1, (int)con.phDialogSilent, PSX.PlayBehavior.checkresult); DocumentAPI.CheckDocumentCount(old_count + 1); }
public static void _end_save(string filename, PhotoshopTypeLibrary.IActionDescriptor Desc1) { // Play the event in photoshop PSX.PlayEvent((int)con.phEventSave, Desc1, (int)con.phDialogSilent, PSX.PlayBehavior.checknone); PSX.CheckFileExists(filename); }