private static string TestAllExtensionNodesRuntime(OS os, out int errorsAdded) { int errors = 0; string ret = ""; Utils.ActOnAllFilesRevursivley(ExtensionLoader.ActiveExtensionInfo.FolderPath + "/Nodes", (Action <string>)(filename => { if (!filename.EndsWith(".xml")) { return; } try { Computer c = Computer.loadFromFile(filename); if (c != null) { ExtensionLoader.CheckAndAssignCoreServer(c, os); } } catch (Exception ex) { string str1 = string.Format("COMPUTER LOAD ERROR:\nError loading computer \"{0}\"\nError: {1} - {2}", (object)filename, (object)ex.GetType().Name, (object)ex.Message); // ISSUE: variable of a compiler-generated type ExtensionTests.\u003C\u003Ec__DisplayClass4 cDisplayClass4 = this; // ISSUE: reference to a compiler-generated field string str2 = cDisplayClass4.ret + str1 + "\r\n"; // ISSUE: reference to a compiler-generated field cDisplayClass4.ret = str2; ++errors; } })); errorsAdded = errors; return(ret); }
void Start() { try { if (!Directory.Exists(DefaultPath)) { Directory.CreateDirectory(DefaultPath); } if (!Directory.Exists(LoggingPath)) { Directory.CreateDirectory(LoggingPath); } if (!Directory.Exists(PluginPath)) { Directory.CreateDirectory(PluginPath); } ExtensionLoader.Load(); DataStore.GetInstance().Save(); PluginCollector.GetCollector(); } catch (Exception ex) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine(string.Format("[Error] Failed to load Redox, Error: {0}", ex)); } }
/// <summary> /// Find all assemblies in the subdirectory, and load them into memory /// </summary> public static void LoadModules() { List <string> allAssemblies = new List <string>(); #if DEBUG string path = Assembly.GetExecutingAssembly().Location; #else string path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\JPP Consulting\\JPP AutoCad Library"; #endif //Check if authenticated, otherwise block the auto loading if (Authentication.Current.Authenticated()) { //Iterate over every dll found in bin folder if (Directory.Exists(path)) { foreach (string dll in Directory.GetFiles(path, "*.dll")) { string dllPath = dll.Replace('\\', '/'); //Load the additional libraries found Assembly module = ExtensionLoader.Load(dll); } } } }
public SimulationManager(ISettings settings, UpdateHub updateHub) { mainLock = new object(); this.settings = settings; //TODO: Where are the settings? extensionLoader = new ExtensionLoader(settings); extensionLoader.LoadExtensions(); definitionManager = new DefinitionManager(extensionLoader); var persistenceManager = new DiskPersistenceManager(extensionLoader, definitionManager, settings); ResourceManager = new ResourceManager(extensionLoader, definitionManager, settings, persistenceManager); ResourceManager.InsertUpdateHub(updateHub); chunkSubscription = updateHub.Subscribe(ResourceManager.GlobalChunkCache, DefaultChannels.Chunk); ResourceManager.GlobalChunkCache.InsertUpdateHub(updateHub); Service = new GameService(ResourceManager); simulation = new Simulation(ResourceManager, extensionLoader, Service) { IsServerSide = true }; backgroundThread = new Thread(SimulationLoop) { Name = "Simulation Loop", IsBackground = true }; }
/// <summary> /// Find all assemblies in the subdirectory, and load them into memory /// </summary> public static void LoadModules() { #if DEBUG string path = Assembly.GetExecutingAssembly().Location; #else string path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\JPP Consulting\\JPP AutoCad Library"; #endif //Check if authenticated, otherwise block the auto loading if (Authentication.Current.Authenticated()) { //Iterate over every dll found in bin folder if (Directory.Exists(path)) { foreach (string dll in Directory.GetFiles(path, "*.dll")) { //Load the additional libraries found ExtensionLoader.Load(dll); } } else { Log.Entry(Resources.Error_ModuleDirectoryMissing, Severity.Error); } } else { Log.Entry(Resources.Error_ModuleLoadFailedAuthentication, Severity.Error); } }
public SimulationManager(ISettings settings, UpdateHub updateHub) { mainLock = new object(); this.settings = settings; this.updateHub = updateHub; TypeContainer.Register <ExtensionLoader>(InstanceBehaviour.Singleton); TypeContainer.Register <IExtensionLoader, ExtensionLoader>(InstanceBehaviour.Singleton); TypeContainer.Register <IExtensionResolver, ExtensionLoader>(InstanceBehaviour.Singleton); TypeContainer.Register <DefinitionManager>(InstanceBehaviour.Singleton); TypeContainer.Register <IDefinitionManager, DefinitionManager>(InstanceBehaviour.Singleton); TypeContainer.Register <DiskPersistenceManager>(InstanceBehaviour.Singleton); TypeContainer.Register <IPersistenceManager, DiskPersistenceManager>(InstanceBehaviour.Singleton); TypeContainer.Register <ResourceManager>(InstanceBehaviour.Singleton); TypeContainer.Register <IResourceManager, ResourceManager>(InstanceBehaviour.Singleton); extensionLoader = TypeContainer.Get <ExtensionLoader>(); extensionLoader.LoadExtensions(); ResourceManager = TypeContainer.Get <ResourceManager>(); ResourceManager.InsertUpdateHub(updateHub); Service = new GameService(ResourceManager); simulation = new Simulation(ResourceManager, extensionLoader, Service) { IsServerSide = true }; backgroundThread = new Thread(SimulationLoop) { Name = "Simulation Loop", IsBackground = true }; }
/// <summary> /// Check items required by a newly checked item /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private static void lvExtensions_ItemChecked(object sender, ItemCheckedEventArgs e) { ListViewItem item = e.Item; if (item.Checked) { ExtensionLoader extensionLoader = ORMDesignerPackage.ExtensionLoader; ExtensionModelBinding checkedType = extensionLoader.AvailableCustomExtensions[(string)item.Tag]; ListView.ListViewItemCollection items = item.ListView.Items; foreach (Guid extendsModelId in checkedType.ExtendsDomainModelIds) { string extensionName = extensionLoader.MapExtensionDomainModelToName(extendsModelId); if (extensionName != null) { foreach (ListViewItem requiresItem in items) { if ((string)requiresItem.Tag == extensionName) { if (!requiresItem.Checked) { requiresItem.Checked = true; } break; } } } } } }
public LoaderForm() { InitializeComponent(); Size = new Size(Size.Width, 133); updateTimer.Enabled = true; Task t = new Task(() => { try { string[] pathes = new string[] { Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\Extensions", Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\AntMe\\Extensions" }; ExtensionLoader.LoadExtensions(pathes, token, true); Invoke((MethodInvoker) delegate { HandleSuccess(); }); } catch (AggregateException ex) { Invoke((MethodInvoker) delegate { HandleExceptions(ex); }); } }); t.Start(); }
private static void StartHeartBeat() { Bootstrap.Init(null); Hacks.RenderWatermark = false; Chat.Print( "Starting <font color = \"#740000\">Volatile AIO</font> <font color = \"#B87F7F\">Heart.cs</font>:"); VolatileMenu = MainMenu.AddMenu("V." + Player.ChampionName, "volatilemenu", "Volatile " + Player.ChampionName); ExtensionLoader = new ExtensionLoader(); //InfoBoard VolatileMenu.AddGroupLabel("Heart.cs"); VolatileMenu.AddLabel("\"I.. I'm alive.. I can feel my heart beating.\""); VolatileMenu.AddSeparator(); VolatileMenu.AddLabel("Welcome to Volatile AIO." + Environment.NewLine + "Volatile is an intelligent and aware AIO." + Environment.NewLine + "It strives to include the most thorough logic" + Environment.NewLine + "and the most pleasant game experience" + Environment.NewLine); VolatileMenu.AddSeparator(); VolatileMenu.AddLabel("I hope you'll like it."); VolatileMenu.AddSeparator(); VolatileMenu.AddGroupLabel("Supported Champions:"); foreach (var champion in ExtensionLoader.Champions) { var label = champion.Name + " by " + champion.Developer; for (var i = champion.Name.Length; i < 20; i++) { label += " "; } label += "Status: " + champion.State; VolatileMenu.AddLabel(label); } VolatileMenu.AddSeparator(); VolatileMenu.AddLabel("AIO Options:"); VolatileMenu.Add("debug", new CheckBox("Debug", false)); VolatileMenu.Add("vpred", new CheckBox("Super Secret Option", false)); //VolatileMenu.Add("vpred2", new Slider("Super Ultra Secret Dont Even Look", 0, 0, 2)); if (ExtensionLoader.Champions.All(c => c.Name != Player.ChampionName)) { return; } TargetMenu = VolatileMenu.AddSubMenu("Target Manager", "targetmenu", "Volatile TargetManager"); TargetMenu.Add("chosenignores", new CheckBox("Ignore all other champions if Selected Target", false)); ManaManager = new ManaManager(); AutoLeveler = new AutoLeveler(); DrawManager = new DrawManager(); HackMenu = VolatileMenu.AddSubMenu("Hacks", "hacks", "Volatile Hacks"); SkinManager.Initialize(); RecallTracker = new RecallTracker(); Activator = new Activator(); _championProfiles = new ChampionProfiles(); if (!AutoLeveler.PrioritiesAreSet() && AutoLeveler.AutoLevelMenu["autolevel"].Cast <CheckBox>().CurrentValue) { Chat.Print("Auto-Leveler: Priorities not Set!"); } if (!ManaManager.PrioritiesAreSet() && ManaManager.MmMenu["manamanager"].Cast <CheckBox>().CurrentValue) { Chat.Print("Mana Manager: Priorities not Set!"); } }
public override DeploymentContainer DetectItems() { DeploymentContainer container = new DeploymentContainer("Plug-ins", Key); try { ExtensionLoader loader = new ExtensionLoader(); HashSet <string> folders = new HashSet <string>(); ICollection <Extension <Autodesk.Connectivity.Explorer.Extensibility.IExplorerExtension> > extensions1 = loader.FindExtensions <Autodesk.Connectivity.Explorer.Extensibility.IExplorerExtension>(); foreach (Extension ext in extensions1) { AddExtension(container, ext, folders); } ICollection <Extension <Autodesk.Connectivity.WebServices.IWebServiceExtension> > extensions2 = loader.FindExtensions <Autodesk.Connectivity.WebServices.IWebServiceExtension>(); foreach (Extension ext in extensions2) { AddExtension(container, ext, folders); } ICollection <Extension <Autodesk.Connectivity.JobProcessor.Extensibility.IJobHandler> > extensions3 = loader.FindExtensions <Autodesk.Connectivity.JobProcessor.Extensibility.IJobHandler>(); foreach (Extension ext in extensions3) { AddExtension(container, ext, folders); } } catch { } return(container); }
public void OptCommand() { Editor ed = Application.DocumentManager.MdiActiveDocument.Editor; string filename = "C:\\Users\\123\\Desktop\\test\\Hello.dll"; ExtensionLoader.Load(filename); ed.WriteMessage("\n" + filename + "被载入,输入hello进行测试"); }
public void LoadExtension() { ExtensionLoader el = new ExtensionLoader(new LayerFactory(), new GeometryFactory()); SetByTest = 0; el.LoadExtension("utest1", "skins/utest1/", new String[] { "utest1.cs", "file2.cs" }); Assert.AreEqual(this.SetByTest, 123); }
/// <summary> /// Handles the extension loader. /// </summary> private static void HandleExtensionLoader() { IExtensionLoader extensionLoader = new ExtensionLoader(_dependencyUtility); extensionLoader.LoadExtensions(); _dependencyUtility.Register <IExtensionLoader>(extensionLoader); }
public void LoadAssembly() { Editor ed = Application.DocumentManager.MdiActiveDocument.Editor; string fileName = "C:\\net1_VB.dll"; ExtensionLoader.Load(fileName); ed.WriteMessage("\n" + fileName + "被载入,请输入Hello进行测试!"); }
public static IEnumerable <PeripheralImporter> GetPeripheralImporters() { return(ExtensionLoader.LoadFrom <PeripheralImporter>( PeripheralExtensions.GetCategoryDirectory(), true ). Concat(DefaultPeripheralImporters)); }
public void Initialize() //初始化程序。 { AcadNetDllAutoLoader(Registry.CurrentUser); //写入注册表 var netDllList = AutoCADNetDllInfor(); List <string> localDlllist = new List <string>(); // 检测本地的dll 并从服务器下载文件 foreach (string dllFileName in netDllList) { FileInfo fileCurrent = new FileInfo(currentDllPath + "\\" + Path.GetFileNameWithoutExtension(dllFileName)); FileInfo fileNet = new FileInfo(dllFileName); if (fileNet.Exists) { fileNet.CopyTo(currentDllPath + "\\" + Path.GetFileName(dllFileName), true); } localDlllist.Add(currentDllPath + "\\" + Path.GetFileName(dllFileName)); } //复制图标 #region// copy cmd icon to local folder if (!Directory.Exists(currentDllPath + "\\KFWH_CMD_ICON")) { Directory.CreateDirectory(currentDllPath + "\\KFWH_CMD_ICON"); } // List <string> listIconFiles = new List <string>(); string sqlcommand = $"select * from tb_PluginUsedFiles where Class_Name='AutoCADPluginICON' and FileName='KFWH_CMD_ICON'"; SqlDataReader sdr = SqlHelper.MyExecuteReader(sqlcommand); //调用自己编写的sqlhelper类 if (sdr.HasRows) //判断行不为空 { while (sdr.Read()) //循环读取数据,知道无数据为止 { listIconFiles.Add(sdr["Path"].ToString() + "\\" + sdr["FileName"].ToString()); } } if (Directory.Exists(listIconFiles[0])) { string[] fis = Directory.GetFiles(listIconFiles[0]); foreach (var item in fis) { FileInfo fi = new FileInfo(item); fi.CopyTo(currentDllPath + "\\KFWH_CMD_ICON\\" + Path.GetFileName(item), true); } } #endregion //加载dll到cad,提取cad命令 List <myAutoCADNetDll> listDllcmd = GetACADNetDllCmd(localDlllist); foreach (var item in localDlllist) { ExtensionLoader.Load(item); } AddMenusToAutoCAD(listDllcmd);//加载cuix菜单 if (this.mycuiFileName != string.Empty) { Application.LoadPartialMenu(this.mycuiFileName); } }
public void OptCommand() { Editor ed = Application.DocumentManager.MdiActiveDocument.Editor; string fileName1 = "C:\\Users\\Closer\\Desktop\\工作文件\\AutoCAD\\Hello\\Hello\\bin\\Debug\\Hello.dll"; string fileName2 = "C:\\Users\\Closer\\Desktop\\工作文件\\AutoCAD\\DotNetARX\\DotNetARX\\bin\\Debug\\DotNetARX.dll"; ExtensionLoader.Load(fileName1); ExtensionLoader.Load(fileName2); ed.WriteMessage("\n" + fileName1 + " " + fileName2 + "被载入,请输入Hello进行测试!!!!!!"); }
private void LoadAssembly(string dll) { //Load the additional libraries found if (!ExtensionLoader.IsLoaded(dll)) { Assembly target = ExtensionLoader.Load(dll); //TODO: Verify actually loaded _loadedModules[dll].Loaded = true; } }
/// <summary> /// Legt das Level für diese Simulation fest. Darf nur im gestoppten Modus genutzt werden. /// </summary> /// <param name="level">Level Infos mit AssemblyFile und TypeName</param> /// <param name="result">Eventuelle Fehlermeldung</param> /// <returns>Erfolgsmeldung</returns> public bool UploadLevel(TypeInfo level) { // Sicher stellen, dass der Modus stimmt. if (ServerState != SimulationState.Stopped) { throw new Exception("Simulation already started"); } if (level == null) { // Level leeren this.level = null; ResetSlots(); // Event werfen if (OnLevelChanged != null) { OnLevelChanged(this, null); } return(true); } else { // Prüfen, ob eine Datei angehängt wurde if (level.AssemblyFile == null) { throw new Exception("There is no Assembly File"); } // Prüfen, ob ein Typ angegeben wurde if (string.IsNullOrEmpty(level.TypeName)) { throw new Exception("There is no Level Type"); } // Level analysieren LevelInfo info = ExtensionLoader.SecureFindLevel(extensionPaths, level.AssemblyFile, level.TypeName); if (info != null) { info.Type.AssemblyFile = level.AssemblyFile; this.level = info; ResetSlots(); } // Event werfen if (OnLevelChanged != null) { OnLevelChanged(this, this.level); } return(true); } }
public void TestLayerInExtension() { TestElementFactory lf = new TestElementFactory(); lf.SearchAssembly(Assembly.GetCallingAssembly()); ExtensionLoader sl = new ExtensionLoader(new ElementFactory[] { lf }); sl.LoadExtension("utest4", "skins/utest4/", new String[] { "layer.cs" }); TestElement l = lf.CreateLayer("test-element-ext", 10); }
internal void Init() { _equalizerBands = new ObservableCollection <IEqualizerBand>(); // Load built-in codecs AddCodec(new CoreCodec()); AddCodec(new VorbisCodec()); AddCodec(new FlacCodec()); // Load external codecs _codecs.AddRange(ExtensionLoader.GetExtensions <ICodec>(PathStringUtils.GetExePath())); }
public void NoContentFailure() { var loader = new ExtensionLoader(_logger, new Assembly[] {}, TypeRecords, true); try { var obj = loader.Load <SimpleTestBase>("A"); Assert.Fail("Should not have been able to load a SimpleTestBase."); } catch { } }
public void MultiLoad() { var assemblies = new[] { Assembly.Load(new AssemblyName("Exor.Core.Tests.ContentB")), Assembly.Load(new AssemblyName("Exor.Core.Tests.ContentA")) }; var loader = new ExtensionLoader(_logger, assemblies, TypeRecords, true); var noCtor = loader.Load <SimpleTestBase>("A"); Assert.IsTrue(noCtor.GetType().FullName.Contains("SimpleTestB")); Assert.AreEqual(0, noCtor.Value); var withCtor = loader.Load <CtorTestBase>("A", 5, DateTime.MinValue); Assert.IsTrue(withCtor.GetType().FullName.Contains("CtorTestB")); Assert.AreEqual(5, withCtor.Value); Assert.AreEqual(DateTime.MinValue, withCtor.Time); var deepLoad = loader.DeepEagerLoad <CtorTestBase>("A", 10, DateTime.MaxValue); Assert.IsTrue(deepLoad.Count == 2, "didn't find 2 instances"); Assert.IsTrue(deepLoad[0].GetType().FullName.Contains("CtorTestB")); Assert.AreEqual(10, deepLoad[0].Value); Assert.AreEqual(DateTime.MaxValue, deepLoad[0].Time); Assert.IsTrue(deepLoad[1].GetType().FullName.Contains("CtorTestA")); Assert.AreEqual(10, deepLoad[1].Value); Assert.AreEqual(DateTime.MaxValue, deepLoad[1].Time); var mappedLoad = loader.LoadAll <SimpleTestBase>(); Assert.IsTrue(mappedLoad.Count == 2, "didn't find 2 instances"); Assert.IsTrue(mappedLoad.ContainsKey("A"), "has key A"); Assert.IsTrue(mappedLoad["A"].GetType().FullName.Contains("SimpleTestB")); Assert.IsTrue(mappedLoad.ContainsKey("A2"), "has key A2"); Assert.IsTrue(mappedLoad["A2"].GetType().FullName.Contains("OtherSimpleTestA")); var deepMappedLoad = loader.DeepLoadAll <SimpleTestBase>(); Assert.IsTrue(deepMappedLoad.Count == 2, "didn't find 2 keys"); Assert.IsTrue(deepMappedLoad.ContainsKey("A"), "has key A"); Assert.IsTrue(deepMappedLoad["A"][0].GetType().FullName.Contains("SimpleTestB")); Assert.IsTrue(deepMappedLoad["A"][1].GetType().FullName.Contains("SimpleTestA")); Assert.IsTrue(deepMappedLoad.ContainsKey("A2"), "has key A2"); Assert.IsTrue(deepMappedLoad["A2"][0].GetType().FullName.Contains("OtherSimpleTestA")); }
/// <summary> /// Get the resolved type for the toolbox provider <see cref="DomainModel"/> /// </summary> public Type GetResolvedType() { Type retVal = myResolvedType; if (retVal == null) { ExtensionModelBinding?extensionType = ExtensionLoader.GetExtensionDomainModel(myExtensionNamespaceUri); if (extensionType.HasValue) { myResolvedType = retVal = extensionType.Value.Type; } } return(retVal); }
private void callback_OnLevelChanged(TypeInfo level) { LevelInfo levelInfo = null; if (level != null) { levelInfo = ExtensionLoader.SecureFindLevel(extensionPaths, level.AssemblyFile, level.TypeName); } _level = levelInfo; if (OnLevelChanged != null) { OnLevelChanged(this, levelInfo); } }
public void Load() { if (!CoreExtensionApplication.CoreConsole) { try { if (File.Exists(DataPath + "\\IronstoneCoreUI.dll")) { ExtensionLoader.Load(DataPath + "\\IronstoneCoreUI.dll"); } else { ExtensionLoader.Load(BinPath + "\\IronstoneCoreUI.dll"); } _logger.Entry("Core UI library loaded.", Severity.Debug); } catch (System.Exception e) { _logger.Entry($"Unable to load Core UI library", Severity.Crash); _logger.LogException(e); throw; } } foreach (Module m in _loadedModules.Values.Where(m => m.ObjectModel)) { if (m.Authenticated) { LoadAssembly(m.Path); } } //Check if authenticated, otherwise block the auto loading if (_authentication.Authenticated()) { foreach (Module m in _loadedModules.Values.Where(m => !m.ObjectModel)) { if (m.Authenticated) { LoadAssembly(m.Path); } } } //Once modules loaded, create any required stores for documents that might already open. _dataService.CreateStoresFromAppDocumentManager(); }
public override void SetMoveOperations(string folder, UtilSettings utilSettings) { try { string extFolder = ExtensionLoader.DefaultExtensionsFolder; if (System.IO.Directory.Exists(folder)) { ExtensionLoader loader = new ExtensionLoader(); ExtensionFolder loaderFolder = new ExtensionFolder(folder, ExtensionFolder.SearchTypeEnum.OneLevelOnly, false); loader.SetExtensionFolders(loaderFolder.ToSingleArray()); List <string> validExtensions = new List <string>(); ICollection <Extension <Autodesk.Connectivity.Explorer.Extensibility.IExplorerExtension> > extensions1 = loader.FindExtensions <Autodesk.Connectivity.Explorer.Extensibility.IExplorerExtension>(); foreach (Extension ext in extensions1) { validExtensions.Add(System.IO.Directory.GetParent(ext.Location).FullName); } ICollection <Extension <Autodesk.Connectivity.WebServices.IWebServiceExtension> > extensions2 = loader.FindExtensions <Autodesk.Connectivity.WebServices.IWebServiceExtension>(); foreach (Extension ext in extensions2) { validExtensions.Add(System.IO.Directory.GetParent(ext.Location).FullName); } ICollection <Extension <Autodesk.Connectivity.JobProcessor.Extensibility.IJobHandler> > extensions3 = loader.FindExtensions <Autodesk.Connectivity.JobProcessor.Extensibility.IJobHandler>(); foreach (Extension ext in extensions3) { validExtensions.Add(System.IO.Directory.GetParent(ext.Location).FullName); } //string[] subFolders = System.IO.Directory.GetDirectories(folder); foreach (string subFolder in validExtensions) { string folderName = Path.GetFileName(subFolder); utilSettings.FolderMoveOperations.Add(new FolderMove( subFolder, Path.Combine(extFolder, folderName))); } } } catch { } }
/// <summary> /// Try to find real hardware device implementations. /// Thereto we search for defined interface-implementations or classes as compiled dlls in a special directory. /// ATTENTION: every "extension" should be in it's own directory. /// </summary> /// <param name="extensionPath">The path to the directory where extension can be found.</param> private List <Type> loadExtensionDevices(string extensionPath) { var extTypes = new List <Type>(); try { var dir = new DirectoryInfo(extensionPath); if (dir.Exists) { var dirs = dir.GetDirectories(); // check every subdirectory foreach (var directoryInfo in dirs) { // let the Extension loader fetch all dlls (classes) that implement a certain type or interface // in this example the type to search for is IBrailleIOAdapter --> which are wrappers to real tactile display hardware devices var extension = ExtensionLoader.LoadAllExtensions(typeof(IBrailleIOAdapter), directoryInfo.FullName).SelectMany(x => x.Value); extTypes.AddRange(extension); } } // now we can instantiate the single identified extension classes if (io != null && io.AdapterManager != null) { foreach (var extType in extTypes) { // you can also add constructor parameters such as the example object someConstrParam var adapter = Activator.CreateInstance(extType, io.AdapterManager); if (adapter != null) { io.AdapterManager.AddAdapter(adapter as IBrailleIOAdapter); // make the loaded adapter the Active one // --> is seems to be the replacement for the automatically loaded ShowOff adapter. io.AdapterManager.ActiveAdapter = adapter as IBrailleIOAdapter; } } } } catch (Exception e) { if (logger != null) { logger.Log(tud.mci.tangram.LogPriority.MIDDLE, this, "Exception while loading extensions", e); } } return(extTypes); }
private IResultSummary RunSingleSpecification(string fileExtension) { var specificationLocator = new ClassNameBasedSpecificationLocator(fileExtension); ResultPath = m_Target.ResolvedPathFor(specificationLocator.LocateSpecification(m_Fixture)); var concordionExtender = new ConcordionBuilder(); concordionExtender .WithSource(m_Source) .WithTarget(m_Target) .WithSpecificationLocator(specificationLocator); var extensionLoader = new ExtensionLoader(m_SpecificationConfig); extensionLoader.AddExtensions(m_Fixture, concordionExtender); var concordion = concordionExtender.Build(); return(concordion.Process(m_Fixture)); }
public override void Initialise() { base.Initialise(); PluginName = "BuildYourOwnRoutineCore"; KeyboardHelper = new KeyboardHelper(GameController); ExtensionCache = new ExtensionCache(); ExtensionParameter = new ExtensionParameter(this); ProfileDirectory = PluginDirectory + @"/Profile/"; ExtensionDirectory = PluginDirectory + @"/Extension/"; ExtensionLoader.LoadAllExtensions(ExtensionCache, ExtensionDirectory); ProcessLoadedExtensions(); CreateAndStartTreeFromLoadedProfile(); Settings.TicksPerSecond.OnValueChanged += UpdateCoroutineWaitRender; }