public void Deactivate()
 {
     _instance = null;
     Marshal.ReleaseComObject(_application);
     _application = null;
     AssemblyResolver.Stop();
 }
        public void Activate(global::Inventor.ApplicationAddInSite site, bool firstTime)
        {
            log.Info("Attempting to load linkParameters..");
            _instance    = this;
            _application = site.Application;

            Type addinType = this.GetType();

            AdnInventorUtilities.Initialize(_application, addinType);

            AdnCommand.AddCommand(new LinkParametersCommand(_application));
            AdnCommand.AddCommand(new AboutCommand(_application));
            AdnCommand.AddCommand(new HelpControlCommand(_application));

            AdnRibbonBuilder.CreateRibbon(_application, addinType, "LinkParameters.Resources.AddInUI.xml");

            //Prevent user from unloading the add-in (except at Inventor shutdown).
            //This workarounds an issue concerning unloading/reloading an addin that
            //creates controls in a native Inventor Panel.
            site.Parent.UserUnloadable = false;

            AssemblyResolver.Paths.Add(AdnInventorUtilities.iLogicPath);
            AssemblyResolver.Start();
            log.Info("linkParameters loaded successfully.");
        }