Beispiel #1
0
        public static Drawing.Rectangle GetBoundingBox(Microsoft.Office.Interop.Visio.Master master, Microsoft.Office.Interop.Visio.VisBoundingBoxArgs args)
        {
            // MSDN: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vissdk11/html/vimthBoundingBox_HV81900422.asp
            double bbx0, bby0, bbx1, bby1;

            master.BoundingBox((short)args, out bbx0, out bby0, out bbx1, out bby1);
            var r = new Drawing.Rectangle(bbx0, bby0, bbx1, bby1);

            return(r);
        }
Beispiel #2
0
 public string GenerateTriangle(double x, double y, string mensaje)
 {
     try
     {
         Microsoft.Office.Interop.Visio.Master visioTriangleMaster = visioStencil.Masters.get_ItemU(@"Triangle");
         Microsoft.Office.Interop.Visio.Shape  visioTriangleShape  = visioPage.Drop(visioTriangleMaster, x, y);
         visioTriangleShape.Text = @mensaje + ".";
         db.InsertFigura("Triángulo", x, y, mensaje);
     }
     catch (Exception e)
     {
         return("¡ERROR!: " + e.Message);
     }
     return("¡Generación Correcta!");
 }
Beispiel #3
0
 public string GenerateStar(double x, double y, string mensaje)
 {
     try
     {
         Microsoft.Office.Interop.Visio.Master visioStarMaster = visioStencil.Masters.get_ItemU(@"Star 7");
         Microsoft.Office.Interop.Visio.Shape  visioStarShape  = visioPage.Drop(visioStarMaster, x, y);
         visioStarShape.Text = @mensaje + ".";
         db.InsertFigura("Estrella 7 Puntas", x, y, mensaje);
     }
     catch (Exception e)
     {
         return("¡ERROR!: " + e.Message);
     }
     return("¡Generación Correcta!");
 }
Beispiel #4
0
 public string Generate3DBox(double x, double y, string mensaje)
 {
     try
     {
         Microsoft.Office.Interop.Visio.Master visioOtherMaster = visioStencil.Masters.get_ItemU(@"3-D box");
         Microsoft.Office.Interop.Visio.Shape  visioOtherShape  = visioPage.Drop(visioOtherMaster, x, y);
         visioOtherShape.Text = @mensaje + ".";
         db.InsertFigura("Cuadrado 3D", x, y, mensaje);
     }
     catch (Exception e)
     {
         return("¡ERROR!: " + e.Message);
     }
     return("¡Generación Correcta!");
 }
 void _VisioApplication_MasterAdded(Microsoft.Office.Interop.Visio.Master Master)
 {
     DisplayInWatchWindow(countMasterAdded++, System.Reflection.MethodInfo.GetCurrentMethod().Name);
 }
 bool _VisioApplication_QueryCancelMasterDelete(Microsoft.Office.Interop.Visio.Master Master)
 {
     DisplayInWatchWindow(countQueryCancelMasterDelete++, System.Reflection.MethodInfo.GetCurrentMethod().Name);
     return(false);
 }