Exemple #1
0
        public void BeforeQuit()
        {
            string eventString        = Resources.BeforeQuitFormat;
            string environmentName    = String.Empty;
            string environmentCaption = String.Empty;
            string environmentCATID   = String.Empty;

            try
            {
                SolidEdgeFramework.Environment environment = _application.GetActiveEnvironment();
                environment.GetInfo(out environmentName, out environmentCaption, out environmentCATID);
            }
            catch
            {
            }

            _eventQueue.Enqueue(new Forms.EventMonitorItem(eventString, environmentName, environmentCaption, environmentCATID));

            this.BeginInvokeIfRequired(frm =>
            {
                frm.DisconnectFromSolidEdge(true);
            });

            _uiAutoResetEvent.WaitOne(2000);
            _uiAutoResetEvent.Reset();
        }
Exemple #2
0
        public void BeforeWindowDeactivate(object theWindow)
        {
            string eventString        = Resources.BeforeWindowDeactivateFormat;
            string environmentName    = String.Empty;
            string environmentCaption = String.Empty;
            string environmentCATID   = String.Empty;

            try
            {
                SolidEdgeFramework.Environment environment = _application.GetActiveEnvironment();
                environment.GetInfo(out environmentName, out environmentCaption, out environmentCATID);
            }
            catch
            {
            }

            try
            {
                eventString = String.Format(eventString, theWindow.SafeInvokeGetProperty("Caption", "IUnknown"));
            }
            catch
            {
            }

            _eventQueue.Enqueue(new Forms.EventMonitorItem(eventString, environmentName, environmentCaption, environmentCATID));
        }
Exemple #3
0
        public void BeforeDocumentPrint(object theDocument, int hDC, ref double ModelToDC, ref int Rect)
        {
            string eventString        = Resources.BeforeDocumentPrintFormat;
            string environmentName    = String.Empty;
            string environmentCaption = String.Empty;
            string environmentCATID   = String.Empty;

            try
            {
                SolidEdgeFramework.Environment environment = _application.GetActiveEnvironment();
                environment.GetInfo(out environmentName, out environmentCaption, out environmentCATID);
            }
            catch
            {
            }

            try
            {
                eventString = String.Format(eventString, theDocument.SafeInvokeGetProperty("Name", "IUnknown"), hDC, ModelToDC, Rect);
            }
            catch
            {
            }

            _eventQueue.Enqueue(new Forms.EventMonitorItem(eventString, environmentName, environmentCaption, environmentCATID));
        }
Exemple #4
0
        public void BeforeCommandRun(int theCommandID)
        {
            string eventString        = Resources.BeforeCommandRunFormat;
            string environmentName    = String.Empty;
            string environmentCaption = String.Empty;
            string environmentCATID   = String.Empty;

            try
            {
                SolidEdgeFramework.Environment environment = _application.GetActiveEnvironment();
                environment.GetInfo(out environmentName, out environmentCaption, out environmentCATID);
            }
            catch
            {
            }

            try
            {
                eventString = String.Format(eventString, CommandHelper.ResolveCommandId(_application, theCommandID));
            }
            catch
            {
            }

            _eventQueue.Enqueue(new Forms.EventMonitorItem(eventString, environmentName, environmentCaption, environmentCATID));
        }
Exemple #5
0
        public void AfterNewDocumentOpen(object theDocument)
        {
            string eventString        = Resources.AfterNewDocumentOpenFormat;
            string environmentName    = String.Empty;
            string environmentCaption = String.Empty;
            string environmentCATID   = String.Empty;

            try
            {
                SolidEdgeFramework.Environment environment = _application.GetActiveEnvironment();
                environment.GetInfo(out environmentName, out environmentCaption, out environmentCATID);
            }
            catch
            {
            }

            try
            {
                eventString = String.Format(eventString, theDocument.SafeInvokeGetProperty("Name", "IUnknown"));
            }
            catch
            {
            }

            _eventQueue.Enqueue(new Forms.EventMonitorItem(eventString, environmentName, environmentCaption, environmentCATID));

            this.BeginInvokeIfRequired(frm =>
            {
                frm.HandleAutoResetEvent();
            });

            _uiAutoResetEvent.WaitOne(2000);
            _uiAutoResetEvent.Reset();
        }
Exemple #6
0
        public void BeforeDocumentClose(object theDocument)
        {
            string eventString        = Resources.BeforeDocumentCloseFormat;
            string environmentName    = String.Empty;
            string environmentCaption = String.Empty;
            string environmentCATID   = String.Empty;

            try
            {
                SolidEdgeFramework.Environment environment = _application.GetActiveEnvironment();
                environment.GetInfo(out environmentName, out environmentCaption, out environmentCATID);
            }
            catch
            {
            }

            try
            {
                eventString = String.Format(eventString, theDocument.SafeInvokeGetProperty("Name", "IUnknown"));
            }
            catch
            {
            }

            _eventQueue.Enqueue(new Forms.EventMonitorItem(eventString, environmentName, environmentCaption, environmentCATID));

            try
            {
                SolidEdgeFramework.SolidEdgeDocument document = theDocument as SolidEdgeFramework.SolidEdgeDocument;

                if ((document != null) && (document.IsTemporary() == false))
                {
                    this.BeginInvokeIfRequired(frm =>
                    {
                        frm.HandleAutoResetEvent();
                    });

                    _uiAutoResetEvent.WaitOne(2000);
                    _uiAutoResetEvent.Reset();
                }
            }
            catch
            {
            }
        }
Exemple #7
0
        public void AfterEnvironmentActivate(object theEnvironment)
        {
            string eventString        = Resources.AfterEnvironmentActivateFormat;
            string environmentName    = String.Empty;
            string environmentCaption = String.Empty;
            string environmentCATID   = String.Empty;

            SolidEdgeFramework.Environment environment = null;

            try
            {
                environment = _application.GetActiveEnvironment();
                environment.GetInfo(out environmentName, out environmentCaption, out environmentCATID);
            }
            catch
            {
            }

            try
            {
                commandBrowser.BeginInvokeIfRequired(ctl =>
                {
                    ctl.ActiveEnvironment = environment;
                });
            }
            catch
            {
            }

            try
            {
                eventString = String.Format(eventString, theEnvironment.SafeInvokeGetProperty("Name", "IUnknown"));
            }
            catch
            {
            }

            _eventQueue.Enqueue(new Forms.EventMonitorItem(eventString, environmentName, environmentCaption, environmentCATID));

            //this.BeginInvokeIfRequired(frm =>
            //{
            //    frm.RefreshGlobalPropertiesPropertyGrid();
            //});
        }