Exemplo n.º 1
0
 public static string[] GetNamesU(this IVisio.Masters masters)
 {
     System.Array names_sa;
     masters.GetNamesU(out names_sa);
     string[] names = (string[])names_sa;
     return(names);
 }
Exemplo n.º 2
0
        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");
        }
Exemplo n.º 3
0
        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]);
            }
        }
Exemplo n.º 4
0
 private IVisio.Master TryGetMaster(IVisio.Masters masters, string name)
 {
     try
     {
         var masterobj = masters.ItemU[name];
         return(masterobj);
     }
     catch (System.Runtime.InteropServices.COMException)
     {
         return(null);
     }
 }
Exemplo n.º 5
0
        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);
            }
        }
Exemplo n.º 6
0
 public static string[] GetNamesU(this IVisio.Masters masters)
 {
     return(VisioAutomation.Masters.MasterHelper.GetNamesU(masters));
 }
Exemplo n.º 7
0
 public static IEnumerable <IVisio.Master> ToEnumerable(this IVisio.Masters masters)
 {
     return(VisioAutomation.Masters.MasterHelper.ToEnumerable(masters));
 }
Exemplo n.º 8
0
 public static List <IVisio.Master> ToList(this IVisio.Masters masters)
 {
     return(ExtensionHelpers.ToList(() => masters.Count, i => masters[i + 1]));
 }
Exemplo n.º 9
0
 public static IEnumerable <IVisio.Master> ToEnumerable(this IVisio.Masters masters)
 {
     return(ExtensionHelpers.ToEnumerable(() => masters.Count, i => masters[i + 1]));
 }
Exemplo n.º 10
0
 public static List <IVisio.Master> ToList(this IVisio.Masters masters)
 {
     return(VisioAutomation.Internal.Extensions.ExtensionHelpers.ToList(() => masters.Count, i => masters[i + 1]));
 }
Exemplo n.º 11
0
 public static IEnumerable <IVisio.Master> ToEnumerable(this IVisio.Masters masters)
 {
     return(VisioAutomation.Internal.Extensions.ExtensionHelpers.ToEnumerable(() => masters.Count, i => masters[i + 1]));
 }