public static string[] GetNamesU(this IVisio.Masters masters) { System.Array names_sa; masters.GetNamesU(out names_sa); string[] names = (string[])names_sa; return(names); }
public VisioDrawer() { //These variable allow Visio to run quickly, and quietly //Defer Recalc needs to be set to 0 after processing is done VisApp = new Visio.InvisibleApp(); VisApp.UndoEnabled = false; VisApp.LiveDynamics = false; VisApp.AutoLayout = false; VisApp.DeferRecalc = -1; VisApp.DeferRelationshipRecalc = true; //Open the page holding the master collection so we can use it string executingSource = System.Reflection.Assembly.GetExecutingAssembly().Location; string executingFolder = System.IO.Path.GetDirectoryName(executingSource); //Add a new document - this becomes the active document //if we do not do this, we get throw an exception VisApp.Documents.Add(executingFolder + "\\Config\\VisioTemplate.vsd"); MastersDocuments = VisApp.Documents; MasterDoc = MastersDocuments.OpenEx(executingFolder + "\\Config\\Stencil.vss", (short)Visio.VisOpenSaveArgs.visOpenHidden); //Now get a masters collection to use Masters = MasterDoc.Masters; //now get the active document ActiveDoc = VisApp.ActiveDocument; connectionMaster = GetMaster(@"Arrow"); missingJobMaster = GetMaster(@"External Job"); fullShapeMaster = GetMaster(@"FullShapeTemplate"); containerMaster = GetMaster(@"Container"); }
public static IEnumerable <IVisio.Master> AsEnumerable(this IVisio.Masters masters) { short count = masters.Count; for (int i = 0; i < count; i++) { yield return(masters[i + 1]); } }
private IVisio.Master TryGetMaster(IVisio.Masters masters, string name) { try { var masterobj = masters.ItemU[name]; return(masterobj); } catch (System.Runtime.InteropServices.COMException) { return(null); } }
private IVisio.Master TryGetMaster(IVisio.Masters masters, string name) { this._client.Application.AssertApplicationAvailable(); this._client.Document.AssertDocumentAvailable(); try { var masterobj = masters.ItemU[name]; return(masterobj); } catch (System.Runtime.InteropServices.COMException) { return(null); } }
public static string[] GetNamesU(this IVisio.Masters masters) { return(VisioAutomation.Masters.MasterHelper.GetNamesU(masters)); }
public static IEnumerable <IVisio.Master> ToEnumerable(this IVisio.Masters masters) { return(VisioAutomation.Masters.MasterHelper.ToEnumerable(masters)); }
public static List <IVisio.Master> ToList(this IVisio.Masters masters) { return(ExtensionHelpers.ToList(() => masters.Count, i => masters[i + 1])); }
public static IEnumerable <IVisio.Master> ToEnumerable(this IVisio.Masters masters) { return(ExtensionHelpers.ToEnumerable(() => masters.Count, i => masters[i + 1])); }
public static List <IVisio.Master> ToList(this IVisio.Masters masters) { return(VisioAutomation.Internal.Extensions.ExtensionHelpers.ToList(() => masters.Count, i => masters[i + 1])); }
public static IEnumerable <IVisio.Master> ToEnumerable(this IVisio.Masters masters) { return(VisioAutomation.Internal.Extensions.ExtensionHelpers.ToEnumerable(() => masters.Count, i => masters[i + 1])); }