Exemplo n.º 1
0
        void SolidEdgeFramework.ISolidEdgeAddIn.OnConnection(object Application, SolidEdgeFramework.SeConnectMode ConnectMode, SolidEdgeFramework.AddIn AddInInstance)
        {
            if (IsDefaultAppDomain)
            {
                _application   = (SolidEdgeFramework.Application)Application;
                _addInInstance = AddInInstance;

                // Notice that "\n" is prepended to the description. This allows the addin to have its own Ribbon Tabs.
                this.AddInEx.Description = String.Format("\n{0}", this.AddInEx.Description);

                InitializeIsolatedAddIn();

                if (_isolatedAddIn != null)
                {
                    // Forward call to isolated AppDomain.
                    _isolatedAddIn.OnConnection(_application, ConnectMode, AddInInstance);
                }
            }
            else
            {
                Application   = UnwrapTransparentProxy(Application);
                AddInInstance = UnwrapTransparentProxy <SolidEdgeFramework.AddIn>(AddInInstance);

                _instance              = this;
                _application           = (SolidEdgeFramework.Application)Application;
                _addInInstance         = AddInInstance;
                _ribbonController      = new RibbonController(this);
                _edgeBarController     = new EdgeBarController(this);
                _viewOverlayController = new ViewOverlayController();

                OnConnection(_application, ConnectMode, AddInInstance);
            }
        }
Exemplo n.º 2
0
        void DisableAddins(SolidEdgeFramework.Application application)
        {
            SolidEdgeFramework.AddIns addins = null;
            SolidEdgeFramework.AddIn  addin  = null;

            addins = application.AddIns;

            for (int i = 1; i <= addins.Count; i++)
            {
                addin         = addins.Item(i);
                addin.Connect = false;
            }
        }
        /// <summary>
        /// Implementation of SolidEdgeFramework.ISolidEdgeAddIn.OnConnection().
        /// </summary>
        public void OnConnection(object Application, SolidEdgeFramework.SeConnectMode ConnectMode, SolidEdgeFramework.AddIn AddInInstance)
        {
            _application = (SolidEdgeFramework.Application)Application;
            _addInEx = (SolidEdgeFramework.ISEAddInEx)AddInInstance;
            _resourceAssembly = Assembly.GetExecutingAssembly();
            _edgeBarController = new EdgeBarController(this);

            // Attach specified events.
            HookEvents(_addInEx, typeof(SolidEdgeFramework.ISEAddInEvents).GUID);
            HookEvents(_application, typeof(SolidEdgeFramework.ISEApplicationEvents).GUID);

            // Handle ConnectMode if necessary.
            switch (ConnectMode)
            {
                case SolidEdgeFramework.SeConnectMode.seConnectAtStartup:
                    break;
                case SolidEdgeFramework.SeConnectMode.seConnectByUser:
                    break;
                case SolidEdgeFramework.SeConnectMode.seConnectExternally:
                    break;
            }
        }
Exemplo n.º 4
0
 /// <summary>
 /// Called during SolidEdgeFramework.ISolidEdgeAddIn.OnConnection().
 /// </summary>
 /// <param name="application"></param>
 /// <param name="ConnectMode"></param>
 /// <param name="AddInInstance"></param>
 public virtual void OnConnection(SolidEdgeFramework.Application application, SolidEdgeFramework.SeConnectMode ConnectMode, SolidEdgeFramework.AddIn AddInInstance)
 {
 }
Exemplo n.º 5
0
        public override void OnConnection(SolidEdgeFramework.Application application, SolidEdgeFramework.SeConnectMode ConnectMode, SolidEdgeFramework.AddIn AddInInstance)
        {
            base.OnConnection(application, ConnectMode, AddInInstance);

            // If you makes changes to your ribbon, be sure to increment the GuiVersion. That makes bFirstTime = true
            // next time Solid Edge is started. bFirstTime is used to setup the ribbon so if you make a change but don't
            // see the changes, that could be why
            AddInEx.GuiVersion = 1;

            // Put your custom OnConnection code here.
            var applicationEvents = (SolidEdgeFramework.ISEApplicationEvents_Event)application.ApplicationEvents;

            applicationEvents.AfterWindowActivate += applicationEvents_AfterWindowActivate;
        }
Exemplo n.º 6
0
        /// <summary>
        /// Called when the addin is first loaded by Solid Edge.
        /// </summary>
        public override void OnConnection(SolidEdgeFramework.Application application, SolidEdgeFramework.SeConnectMode ConnectMode, SolidEdgeFramework.AddIn AddInInstance)
        {
            // If you makes changes to your ribbon, be sure to increment the GuiVersion or your ribbon
            // will not initialize properly.
            AddInEx.GuiVersion = 1;

            // Create an instance of the default connection point controller. It helps manage connections to COM events.
            _connectionPointController = new SolidEdgeCommunity.ConnectionPointController(this);

            // Uncomment the following line to attach to the Solid Edge Application Events.
            _connectionPointController.AdviseSink <SolidEdgeFramework.ISEApplicationEvents>(this.Application);

            // Not necessary unless you absolutely need to see low level windows messages.
            // Uncomment the following line to attach to the Solid Edge Application Window Events.
            //_connectionPointController.AdviseSink<SolidEdgeFramework.ISEApplicationWindowEvents>(this.Application);

            // Uncomment the following line to attach to the Solid Edge Feature Library Events.
            _connectionPointController.AdviseSink <SolidEdgeFramework.ISEFeatureLibraryEvents>(this.Application);

            // Uncomment the following line to attach to the Solid Edge File UI Events.
            //_connectionPointController.AdviseSink<SolidEdgeFramework.ISEFileUIEvents>(this.Application);

            // Uncomment the following line to attach to the Solid Edge File New UI Events.
            //_connectionPointController.AdviseSink<SolidEdgeFramework.ISENewFileUIEvents>(this.Application);

            // Uncomment the following line to attach to the Solid Edge EC Events.
            //_connectionPointController.AdviseSink<SolidEdgeFramework.ISEECEvents>(this.Application);

            // Uncomment the following line to attach to the Solid Edge Shortcut Menu Events.
            //_connectionPointController.AdviseSink<SolidEdgeFramework.ISEShortCutMenuEvents>(this.Application);
        }
Exemplo n.º 7
0
        /// <summary>
        /// Implementation of SolidEdgeFramework.ISolidEdgeAddIn.OnConnection().
        /// </summary>
        public void OnConnection(object Application, SolidEdgeFramework.SeConnectMode ConnectMode, SolidEdgeFramework.AddIn AddInInstance)
        {
            _application = (SolidEdgeFramework.Application)Application;
            _addInEx     = (SolidEdgeFramework.ISEAddInEx)AddInInstance;

            HookEvents(_addInEx, typeof(SolidEdgeFramework.ISEAddInEvents).GUID);
            HookEvents(_application, typeof(SolidEdgeFramework.ISEApplicationEvents).GUID);

            switch (ConnectMode)
            {
            case SolidEdgeFramework.SeConnectMode.seConnectAtStartup:
                break;

            case SolidEdgeFramework.SeConnectMode.seConnectByUser:
                break;

            case SolidEdgeFramework.SeConnectMode.seConnectExternally:
                break;
            }
        }