Exemple #1
0
        public MainForm()
        {
            InitializeComponent();

            txtInformation.Text = GetLoadedAssemblies();

            var adnOptions = AddinOptions.Create()
                             .WithMessageDialog(new MessageDialog())
                             .WithFileSettings(new AddinFileSettings());

            _addinEngine = new AddinEngine(adnOptions);
            _addinEngine.Start(true);

            RefreshInformationArea();
        }
Exemple #2
0
        static void DoInitialize()
        {
            //var trustLevel = WebHelper.GetTrustLevel();

            if (_addinEngine != null)
            {
                return;
            }

            var fileSettings = new AddinFileSettings(AddinFileSettings.DefaultAddinDataDirectory, new[] { "bin" }, new[] { AddinFileSettings.DefaultAddinProbingDirectory });
            var addinOptions = AddinOptions.Create().WithAssemblyLoadPolicy(new MvcAssemblyLoadPolicy()).WithFileSettings(fileSettings);

            _addinEngine = new AddinEngine(addinOptions);

            _addinEngine.Initialize(true);

            var addins = _addinEngine.GetAllAddins();

            foreach (var addin in addins)
            {
                PrepareAddin(addin);
            }

            _addinEngine.Start();

            //addins = _addinEngine.GetStartedAddins();
            ////var probingPath = AppDomain.CurrentDomain.SetupInformation.PrivateBinPath;
            //foreach (var addin in addins)
            //{
            //    //probingPath += addin.File.BaseDirectory + ";";
            //    //var asms = addin.Runtime.LoadAssemblies();
            //    //foreach (var asm in asms)
            //    //    BuildManagerHelper.AddReferencedAssemblyNormally(asm);
            //}
            ////AppDomain.CurrentDomain.SetupInformation.PrivateBinPath = probingPath;

            //var menustrip = new MvcMenuStrip();
            //_addinEngine.LoadExtensionPoint(menustrip);
            //_addinEngine.Framework.SetProperty("MvcMenuStrip", menustrip);
        }
Exemple #3
0
 private void btnStartEngine_Click(object sender, EventArgs e)
 {
     _addinEngine.Start(true);
 }