Beispiel #1
0
 void Document_DocumentRemoved(object sender, SubjectEventArgs <Document> e)
 {
     Document.DocumentRemoved -= Document_DocumentRemoved;
     WriteBlock.AppendTask(() =>
     {
         Document.Open(mFilePath, null);
     });
 }
Beispiel #2
0
        void Document_DocumentRemoved(object sender, SubjectEventArgs <Document> e)
        {
            Document.DocumentRemoved -= Document_DocumentRemoved;
            WriteBlock.AppendTask(() =>
            {
                var windows = Document.Open(mFilePath, null);

                Window.ActiveWindow = windows.First();
            });
        }
Beispiel #3
0
 private void ApplicationVersion()
 {
     WriteBlock.AppendTask(() =>
     {
         var appVer = Application.Version;
         MessageBox.Show(
             "ReleaseNumber = " + appVer.ReleaseNumber + Environment.NewLine +
             "ServicePack   = " + appVer.ServicePack,
             "Application.Version");
     });
 }
Beispiel #4
0
        private void CreatePanelTab()
        {
            WriteBlock.AppendTask(() =>
            {
                var command       = Command.Create(Guid.NewGuid().ToString());
                command.Image     = Resources.robot;
                command.Text      = "PanelTab Created by EllieWare";
                command.IsVisible = true;

                var tab = PanelTab.Create(command, new TextBox(), Panel.Structure);
            });
        }
Beispiel #5
0
 private void Reload()
 {
     WriteBlock.AppendTask(() =>
     {
         Document.DocumentRemoved += Document_DocumentRemoved;
         mFilePath      = Window.ActiveWindow.Document.Path;
         var allWindows = Window.GetWindows(Window.ActiveWindow.Document);
         foreach (var thisWindow in allWindows)
         {
             thisWindow.Close();
         }
     });
 }
Beispiel #6
0
 private void ColorFaceRed()
 {
     WriteBlock.AppendTask(() =>
     {
         var ctx       = Window.ActiveWindow.ActiveContext;
         var selection = ctx.Selection;
         var desFaces  = selection.OfType <DesignFace>();
         foreach (var thisDesFace in desFaces)
         {
             thisDesFace.SetColor(null, Color.Red);
         }
     });
 }
Beispiel #7
0
        public override bool Run()
        {
            var evt    = new AutoResetEvent(false);
            var retVal = false;

            WriteBlock.AppendTask(() =>
            {
                try
                {
                    retVal = DoRun();
                }
                finally
                {
                    evt.Set();
                }
            });

            return(evt.WaitOne(60000) && retVal);
        }
Beispiel #8
0
        public bool Run()
        {
            var evt    = new AutoResetEvent(false);
            var retVal = false;

            WriteBlock.AppendTask(() =>
            {
                try
                {
                    retVal = DoRun();
                }
                finally
                {
                    evt.Set();
                }
            });

            // allow 1 hour for timeout
            return(evt.WaitOne(60 * 60 * 1000) && retVal);
        }
Beispiel #9
0
 private void RemoveFace()
 {
     WriteBlock.AppendTask(() =>
     {
         try
         {
             var ctx       = Window.ActiveWindow.ActiveContext;
             var selection = ctx.Selection;
             var desFaces  = selection.OfType <DesignFace>();
             var modFaces  = from thisDesFace in desFaces select thisDesFace.Shape;
             foreach (var thisModFace in modFaces)
             {
                 var desBody = thisModFace.Body;
                 desBody.DeleteFaces(new[] { thisModFace }, RepairAction.GrowSurrounding);
             }
         }
         catch (InvalidOperationException ex)
         {
             // Body.DeleteFaces() throws InvalidOperationException on failure
             MessageBox.Show(ex.Message);
         }
     });
 }