public SSIS2008EmitterPhase(string WorkflowUniqueName) { this._workflowUniqueName = WorkflowUniqueName; _guid = Guid.NewGuid(); _message = MessageEngine.Create(String.Format(System.Globalization.CultureInfo.InvariantCulture, "SSISFactory: {0}", _guid.ToString())); _pluginLoader = new PluginLoader<ISSISEmitter, PhysicalIRMappingAttribute>(null, 1, 1); }
public CLI(IDirectoryLocator directoryLocator, PluginLoader pluginLoader, IController controller) { _logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); _directoryLocator = directoryLocator; _pluginLoader = pluginLoader; _controller = controller; }
public CommunicationsLocal( ConfigSettings configSettings, NetworkServersInfo serversInfo, BaseHttpServer httpServer, IAssetCache assetCache, LibraryRootFolder libraryRootFolder) : base(serversInfo, httpServer, assetCache, libraryRootFolder) { PluginLoader<IInventoryStoragePlugin> loader = new PluginLoader<IInventoryStoragePlugin>(); loader.Add("/OpenSim/InventoryStorage", new PluginProviderFilter(configSettings.InventoryPlugin)); loader.Load(); loader.Plugin.Initialize(configSettings); LocalUserServices lus = new LocalUserServices( serversInfo.DefaultHomeLocX, serversInfo.DefaultHomeLocY, this); //lus.AddPlugin(new TemporaryUserProfilePlugin()); lus.AddPlugin(configSettings.StandaloneUserPlugin, configSettings.StandaloneUserSource); m_userService = lus; m_userAdminService = lus; m_avatarService = lus; m_messageService = lus; m_gridService = new LocalBackEndServices(); }
public ScraperService() { scrapers = new Dictionary<int, Plugin<IScraperPlugin>>(); var pluginLoader = new PluginLoader(); pluginLoader.AddRequiredMetadata("Id"); pluginLoader.AddRequiredMetadata("Name"); // first argument is directory name in source tree, second one in installed tree //pluginLoader.AddFromTree("PlugIns", "Extensions"); pluginLoader.AddFromTreeMatch(@"PlugIns\MPExtended.PlugIns.Scrapers.*", @"Plugins\Scrapers"); var plugins = pluginLoader.GetPlugins<IScraperPlugin>(); foreach (var plugin in plugins) { Log.Debug("Loaded scraper plugin {0}", plugin.Metadata["Name"]); int id = (int)plugin.Metadata["Id"]; scrapers.Add(id, plugin); if (Configuration.Scraper.AutoStart != null && Configuration.Scraper.AutoStart.Contains(id)) { Log.Debug("Auto-Starting plugin " + plugin.Metadata["Name"]); plugin.Value.StartScraper(); } } }
public void Initialise(BaseDto configuration, DictionaryParameters parameters) { Contract.Assert(configuration is ScheduledJobsWorkerConfiguration); parameters = parameters ?? new DictionaryParameters(); var cfg = configuration as ScheduledJobsWorkerConfiguration; // get communication update and retry variables cfg.UpdateIntervalInMinutes = Convert.ToInt32(ConfigurationManager.AppSettings["UpdateIntervalMinutes"]); cfg.UpdateIntervalInMinutes = (0 != cfg.UpdateIntervalInMinutes) ? cfg.UpdateIntervalInMinutes : ScheduledJobsWorkerConfiguration.UPDATE_INTERVAL_IN_MINUTES_DEFAULT; cfg.ServerNotReachableRetries = Convert.ToInt32(ConfigurationManager.AppSettings["ServerNotReachableRetries"]); cfg.ServerNotReachableRetries = cfg.UpdateIntervalInMinutes * (0 != cfg.ServerNotReachableRetries ? cfg.ServerNotReachableRetries : ScheduledJobsWorkerConfiguration.SERVER_NOT_REACHABLE_RETRIES_DEFAULT); // apply parameters if overridden on command line var uri = ConfigurationManager.AppSettings["Uri"]; if(parameters.ContainsKey("args0")) { uri = parameters["args0"] as string; } Contract.Assert(!string.IsNullOrWhiteSpace(uri)); cfg.Uri = new Uri(uri); cfg.ManagementUriName = ConfigurationManager.AppSettings["ManagementUri"]; if(parameters.ContainsKey("args1")) { cfg.ManagementUriName = parameters["args1"] as string; } Contract.Assert(!string.IsNullOrWhiteSpace(cfg.ManagementUriName)); // load plugins var configurationLoader = new PluginLoaderConfigurationFromAppSettingsLoader(); var pluginLoader = new PluginLoader(configurationLoader, cfg.Logger); cfg.Plugins = pluginLoader.InitialiseAndLoad(); Contract.Assert(0 < cfg.Plugins.Count, "No plugins loaded. Cannot continue."); // get credentials to connect to Appclusive HOST server var credentialSection = ConfigurationManager.GetSection(AppclusiveCredentialSection.SECTION_NAME) as AppclusiveCredentialSection; if(null == credentialSection) { Trace.WriteLine("No credential in app.config section '{0}' defined. Using 'DefaultNetworkCredentials'.", AppclusiveCredentialSection.SECTION_NAME, ""); cfg.Credential = CredentialCache.DefaultNetworkCredentials; } else { Trace.WriteLine("Credential in app.config section '{0}' found. Using '{1}\\{2}'.", AppclusiveCredentialSection.SECTION_NAME, credentialSection.Domain, credentialSection.Username); var networkCredential = new NetworkCredential(credentialSection.Username, credentialSection.Password, credentialSection.Domain); Contract.Assert(null != networkCredential); cfg.Credential = networkCredential; } }
public static TfsPlugin Find() { var x = new PluginLoader(); return x.Try("GitTfs.Vs2010", "Sep.Git.Tfs.Vs2010.TfsPlugin") ?? x.Try("GitTfs.Vs2008", "Sep.Git.Tfs.Vs2008.TfsPlugin") ?? x.Fail(); }
public MainWindow() { PluginLoader loader = new PluginLoader(); InitializeComponent(); root.Children.Add(loader.GetToolView() as UIElement); }
private PluginLoader InitializePluginLoader() { var assemblyLoaderMock = new Mock<IAssemblyLoader>(); assemblyLoaderMock.Setup(x => x.LoadPluginAssemblies()) .Returns(new[] { typeof(TestInstallerInfoProvider).GetTypeInfo().Assembly }); var pluginLoader = new PluginLoader(assemblyLoaderMock.Object, new GeneralConfiguration()); return pluginLoader; }
private void LoadServices() { var loader = new PluginLoader(); loader.AddFromTreeMatch(@"Services\MPExtended.Services.*", "MPExtended.Services.*.dll", @"Plugins\Services"); loader.AddRequiredMetadata("ServiceName"); services = loader.GetPlugins<IService>(); wcfServices = loader.GetPlugins<IWcfService>(); }
public PluginListWindow(PluginLoader pluginLoader) { InitializeComponent(); foreach (Plugin loadedPlugin in pluginLoader.LoadedPlugins) { } }
private void LoadServices() { var loader = new PluginLoader(); loader.AddDirectory(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), false); loader.AddFromTreeMatch(@"Services\MPExtended.Services.*", "MPExtended.Services.*.dll", @"Plugins\Services"); loader.AddRequiredMetadata("ServiceName"); services = loader.GetPlugins<IService>(); wcfServices = loader.GetPlugins<IWcfService>(); }
internal SSISEmitterContext(SsisPackage package, SsisSequence parentSequence, PluginLoader<ISSISEmitter, PhysicalIRMappingAttribute> pluginLoader) { _package = package; _ssisSequence = parentSequence; _guid = Guid.NewGuid(); _message = MessageEngine.Create(String.Format(System.Globalization.CultureInfo.InvariantCulture, "SSISFactory: {0}", _guid.ToString())); if (_ssisSequence != null) { _parentContainer = _ssisSequence.DTSSequence; } _pluginLoader = pluginLoader; }
public void Compose() { var pluginLoader = new PluginLoader(); var pluginFinder = new PluginFinder(); installedPlugins = RegisterExtensions(pluginFinder, pluginLoader, "plugins", true); var skinFinder = new SkinFinder(); installedSkins = RegisterExtensions(skinFinder, pluginLoader, "skins", false); controllers = pluginLoader.GetPlugins<IController>(); compositionDone = true; }
public static TfsPlugin Find() { var x = new PluginLoader(); var explicitVersion = Environment.GetEnvironmentVariable("GIT_TFS_CLIENT"); if(!String.IsNullOrEmpty(explicitVersion)) { return x.Try("GitTfs.Vs" + explicitVersion, "Sep.Git.Tfs.Vs" + explicitVersion + ".TfsPlugin") ?? x.Fail("Unable to load TFS version specified in GIT_TFS_CLIENT (" + explicitVersion + ")!"); } return x.Try("GitTfs.Vs2010", "Sep.Git.Tfs.Vs2010.TfsPlugin") ?? x.Try("GitTfs.Vs2008", "Sep.Git.Tfs.Vs2008.TfsPlugin") ?? x.Fail(); }
public MainWindowCommand(Action killApplication, AppSettings appSettings) { var selfPlugin = new SelfPlugin(); var loader = new PluginLoader(selfPlugin); var persistanceHelper = new PersistanceHelper(selfPlugin.XStream); appSettings.AppHotkeys = persistanceHelper.LoadOrSaveAndLoad<Hotkeys>(Paths.Instance.AppHotkeys, new KeyboardShortcutChangeCommand(appSettings).Execute); Hotkeys hotkeys = appSettings.AppHotkeys; displayHotkey = hotkeys.DisplayHotKey; controller = new MainWindowController(loader.LaunchablePlugins, loader.CharacterPlugins, loader.LaunchableHandlers, selfPlugin, persistanceHelper, appSettings); this.killApplication = killApplication; appSettings.HotkeysChanged += HandleHotkeysChanged; window = new MainWindow(controller); }
public static TfsPlugin Find() { var x = new PluginLoader(); var explicitVersion = Environment.GetEnvironmentVariable("GIT_TFS_CLIENT"); if (explicitVersion == "11") explicitVersion = "2012"; // GitTfs.Vs2012 was formerly called GitTfs.Vs11 if(!String.IsNullOrEmpty(explicitVersion)) { return x.Try("GitTfs.Vs" + explicitVersion, "Sep.Git.Tfs.TfsPlugin") ?? x.Fail("Unable to load TFS version specified in GIT_TFS_CLIENT (" + explicitVersion + ")!"); } return x.Try("GitTfs.Vs2015", "Sep.Git.Tfs.TfsPlugin") ?? x.Try("GitTfs.Vs2013", "Sep.Git.Tfs.TfsPlugin") ?? x.Try("GitTfs.Vs2012", "Sep.Git.Tfs.TfsPlugin") ?? x.Try("GitTfs.Vs2010", "Sep.Git.Tfs.TfsPlugin") ?? x.Fail(); }
public static TfsPlugin Find() { var pluginLoader = new PluginLoader(); var explicitVersion = Environment.GetEnvironmentVariable("GIT_TFS_CLIENT"); if (explicitVersion == "11") explicitVersion = "2012"; // GitTfs.Vs2012 was formerly called GitTfs.Vs11 if(!String.IsNullOrEmpty(explicitVersion)) { return pluginLoader.TryLoadVsPluginVersion(explicitVersion) ?? pluginLoader.Fail("Unable to load TFS version specified in GIT_TFS_CLIENT (" + explicitVersion + ")!"); } return pluginLoader.TryLoadVsPluginVersion("2015", true) ?? pluginLoader.TryLoadVsPluginVersion("2013") ?? pluginLoader.TryLoadVsPluginVersion("2012") ?? pluginLoader.TryLoadVsPluginVersion("2010") ?? pluginLoader.TryLoadVsPluginVersion("2015") ?? pluginLoader.Fail(); }
public FormMain(log4net.ILog logger, IDirectoryLocator directoryLocator, PluginLoader pluginLoader, IController controller, Updater updater, IDriveDetector driveDetector) { InitializeComponent(); Load += OnLoad; _logger = logger; _directoryLocator = directoryLocator; _pluginLoader = pluginLoader; _controller = controller; _updater = updater; _driveDetector = driveDetector; _progressBarToolTip = new ToolTip(); _progressBarToolTip.SetToolTip(progressBar, null); _taskbarItem = new WindowsTaskbarItemFactory().GetInstance(Handle); progressBar.UseCustomColors = true; progressBar.GenerateText = percentComplete => string.Format("{0}: {1:0.00}%", _state, percentComplete); playlistListView.ItemSelectionChanged += PlaylistListViewOnItemSelectionChanged; playlistListView.ShowAllChanged += PlaylistListViewOnShowAllChanged; playlistListView.PlaylistReconfigured += PlaylistListViewOnPlaylistReconfigured; tracksPanel.PlaylistReconfigured += TracksPanelOnPlaylistReconfigured; mediaPanel.SelectedMediaChanged += MediaPanelOnSelectedMediaChanged; mediaPanel.Search = ShowMetadataSearchWindow; _updater.IsPortable = _directoryLocator.IsPortable; var updateObserver = new FormMainUpdateObserver(this, checkForUpdatesToolStripMenuItem, null); updateObserver.BeforeInstallUpdate += update => DisableUpdates(); var currentVersion = AppUtils.AppVersion; _updateHelper = new UpdateHelper(_updater, currentVersion); _updateHelper.RegisterObserver(updateObserver); SystemEvents.SessionEnded += (sender, args) => DisableUpdates(); FormClosing += OnFormClosing; }
public CommunicationsOGS1( NetworkServersInfo serversInfo, BaseHttpServer httpServer, IAssetCache assetCache, LibraryRootFolder libraryRootFolder, ConfigSettings configSettings) : base(serversInfo, httpServer, assetCache, libraryRootFolder) { OGS1GridServices gridInterComms = new OGS1GridServices(serversInfo, httpServer); m_gridService = gridInterComms; // This plugin arrangement could eventually be configurable rather than hardcoded here. OGS1UserServices userServices = new OGS1UserServices(this); //userServices.AddPlugin(new TemporaryUserProfilePlugin()); userServices.AddPlugin(new OGS1UserDataPlugin(this, configSettings)); m_userService = userServices; m_messageService = userServices; m_avatarService = (IAvatarService)m_userService; PluginLoader<IInventoryStoragePlugin> loader = new PluginLoader<IInventoryStoragePlugin>(); loader.Add("/OpenSim/InventoryStorage", new PluginProviderFilter(configSettings.InventoryPlugin)); loader.Load(); loader.Plugin.Initialize(configSettings); }
internal static void Main(string[] args) { // entry point for doorstop // At this point, literally nothing but mscorlib is loaded, // and since this class doesn't have any static fields that // aren't defined in mscorlib, we can control exactly what // gets loaded. _ = args; try { if (Environment.GetCommandLineArgs().Contains("--verbose")) { WinConsole.Initialize(); } SetupLibraryLoading(); EnsureDirectories(); // this is weird, but it prevents Mono from having issues loading the type. // IMPORTANT: NO CALLS TO ANY LOGGER CAN HAPPEN BEFORE THIS var unused = StandardLogger.PrintFilter; #region // Above hack explaination /* * Due to an unknown bug in the version of Mono that Unity uses, if the first access to StandardLogger * is a call to a constructor, then Mono fails to load the type correctly. However, if the first access is to * the above static property (or maybe any, but I don't really know) it behaves as expected and works fine. */ #endregion Default.Debug("Initializing logger"); SelfConfig.ReadCommandLine(Environment.GetCommandLineArgs()); SelfConfig.Load(); DisabledConfig.Load(); if (AntiPiracy.IsInvalid(Environment.CurrentDirectory)) { Default.Error("Invalid installation; please buy the game to run BSIPA."); return; } CriticalSection.Configure(); Logging.Logger.Injector.Debug("Prepping bootstrapper"); // updates backup InstallBootstrapPatch(); GameVersionEarly.Load(); AntiMalwareEngine.Initialize(); Updates.InstallPendingUpdates(); Loader.LibLoader.SetupAssemblyFilenames(true); pluginAsyncLoadTask = PluginLoader.LoadTask(); permissionFixTask = PermissionFix.FixPermissions(new DirectoryInfo(Environment.CurrentDirectory)); } catch (Exception e) { Console.WriteLine(e); } }
public static int Main(string[] args) { // Make sure we don't get outbound connections queueing ServicePointManager.DefaultConnectionLimit = 50; ServicePointManager.UseNagleAlgorithm = false; m_Server = new HttpServerBase("R.O.B.U.S.T.", args); string registryLocation; IConfig serverConfig = m_Server.Config.Configs["Startup"]; if (serverConfig == null) { System.Console.WriteLine("Startup config section missing in .ini file"); throw new Exception("Configuration error"); } string connList = serverConfig.GetString("ServiceConnectors", String.Empty); registryLocation = serverConfig.GetString("RegistryLocation","."); IConfig servicesConfig = m_Server.Config.Configs["ServiceList"]; if (servicesConfig != null) { List<string> servicesList = new List<string>(); if (connList != String.Empty) servicesList.Add(connList); foreach (string k in servicesConfig.GetKeys()) { string v = servicesConfig.GetString(k); if (v != String.Empty) servicesList.Add(v); } connList = String.Join(",", servicesList.ToArray()); } string[] conns = connList.Split(new char[] {',', ' ', '\n', '\r', '\t'}); // int i = 0; foreach (string c in conns) { if (c == String.Empty) continue; string configName = String.Empty; string conn = c; uint port = 0; string[] split1 = conn.Split(new char[] {'/'}); if (split1.Length > 1) { conn = split1[1]; string[] split2 = split1[0].Split(new char[] {'@'}); if (split2.Length > 1) { configName = split2[0]; port = Convert.ToUInt32(split2[1]); } else { port = Convert.ToUInt32(split1[0]); } } string[] parts = conn.Split(new char[] {':'}); string friendlyName = parts[0]; if (parts.Length > 1) friendlyName = parts[1]; IHttpServer server; if (port != 0) server = MainServer.GetHttpServer(port); else server = MainServer.Instance; m_log.InfoFormat("[SERVER]: Loading {0} on port {1}", friendlyName, server.Port); IServiceConnector connector = null; Object[] modargs = new Object[] { m_Server.Config, server, configName }; connector = ServerUtils.LoadPlugin<IServiceConnector>(conn, modargs); if (connector == null) { modargs = new Object[] { m_Server.Config, server }; connector = ServerUtils.LoadPlugin<IServiceConnector>(conn, modargs); } if (connector != null) { m_ServiceConnectors.Add(connector); m_log.InfoFormat("[SERVER]: {0} loaded successfully", friendlyName); } else { m_log.ErrorFormat("[SERVER]: Failed to load {0}", conn); } } loader = new PluginLoader(m_Server.Config, registryLocation); int res = m_Server.Run(); Environment.Exit(res); return 0; }
private bool TryGetConfigurator(BooleanGenericTuple <ImageModPathTuple> selectedMod, out IConfigurator configurator, out PluginLoader loader) { var config = selectedMod.Generic.ModConfig; string dllPath = config.GetManagedDllPath(selectedMod.Generic.ModConfigPath); configurator = null; loader = null; if (!File.Exists(dllPath)) { return(false); } loader = PluginLoader.CreateFromAssemblyFile(dllPath, true, _sharedTypes, config => config.DefaultContext = AssemblyLoadContext.GetLoadContext(Assembly.GetExecutingAssembly())); var assembly = loader.LoadDefaultAssembly(); var types = assembly.GetTypes(); var entryPoint = types.FirstOrDefault(t => typeof(IConfigurator).IsAssignableFrom(t) && !t.IsAbstract); if (entryPoint != null) { configurator = (IConfigurator)Activator.CreateInstance(entryPoint); configurator.SetModDirectory(Path.GetFullPath(Path.GetDirectoryName(selectedMod.Generic.ModConfigPath))); return(true); } return(false); }
/// <summary> /// Command line exit Code Summary: /// 0 – Application completed its task with no errors /// 1 – Configuration.xml error /// 2 – Missing plugin dll /// 3 - Missing refmapper xml /// 4 - Datasource directory error /// 5 - XML output directory error /// 6 - Data Transfer failed /// 7 - Log directory error /// 8 - Failed to move sent file to the "completed" subdirectory /// 9 - No data to send. There was no valid data to send, double check source files. /// </summary> public static void Main(string[] args) { // path of where app is running from _path = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location); // init _conf and check files if (CheckFiles(_path)) { // log to catch errors Log log = new Log(_conf.LogDirectory); // load plugin _plugin = PluginLoader.LoadExtractor("plugins\\" + _conf.Plugin); // DataTable to store all the extracted data from files DataTable results = new DataTable(); string[] files = System.IO.Directory.GetFiles(_conf.DataSourceDirectory); // scans folder for file foreach (string file in files) { // extract data DataTable dt = _plugin.GetData(_conf, file); // valid datatable of all valid rows DataTable validDt = dt.Clone(); // validate the data foreach (DataRow dr in dt.Rows) { Validator validator = new Validator(); bool valid = true; if (!validator.ValidateDataRow(dr)) { valid = false; } if (!_plugin.Validate(dr, _path + "\\plugins\\" + _conf.RefMapper)) { valid = false; } // if valid import to validDt if (valid) { validDt.ImportRow(dr); } else { log.write("Error validating row in " + file + ": "); // print datarow contents to log file foreach (DataColumn dc in dr.Table.Columns) { log.write(dc.ColumnName + " : " + dr[dc].ToString()); } } } // merged data to Result results.Merge(validDt); } // timestamp for use in the xml DateTime date = DateTime.Now; string timestamp = String.Format("{0:yyyyMMddHHmmss}", date); // if results table is empty then don't generate an empty xml if (results.Rows.Count != 0) { // generate xml XmlOutput output = new XmlOutput(null); string xmlFileName = timestamp + ".xml"; // need to parse an emtpy genelist IList <SiteConf.Gene.Object> geneList = new List <SiteConf.Gene.Object>(); output.Generate("", _conf.XmlOutputDirectory + "\\" + xmlFileName, results, null, null, _conf.OrgHashCode, geneList); // call VariantExporterCmdLn to send data if (SendData()) { // check if completed directory exist if (!System.IO.Directory.Exists(_conf.DataSourceDirectory + "\\completed")) { // create "completed" sub directory inside the xmlOutputDirectory System.IO.Directory.CreateDirectory(_conf.DataSourceDirectory + "\\completed"); } // if send successful move files to completed sub directory foreach (string file in files) { // rename file by appending the date to the end of file // from this "file.tsv" to this "file_20140716143423.tsv" string renamedFile = System.IO.Path.GetFileNameWithoutExtension(file) + "(" + DateTime.Now.ToString("yyyyMMddHHmmss") + ")" + System.IO.Path.GetExtension(file); try { System.IO.File.Move(file, _conf.DataSourceDirectory + "\\completed\\" + renamedFile); log.write("Data from file: " + file + " sent."); } catch { log.write("Data from file: " + file + " was sent, but due to an error the file could not be moved to the completed sub directory."); } } } } else { log.write("No valid data to send. Check source that all mandatory fields are provided and correct."); System.Environment.ExitCode = 9; } } }
public PhasePluginLoader() { this._PluginLoader = new PluginLoader<IPhase, PhaseFriendlyNameAttribute>(Settings.Default.SubpathPhasePluginFolder, 0, 1); this._Message = MessageEngine.Create("__PHASE PLUGIN LOADER"); }
// This method loads the identified asset server, passing an approrpiately // initialized Initialize wrapper. There should to be exactly one match, // if not, then the first match is used. private IAssetServer loadAssetServer(string id, PluginInitializerBase pi) { if (!String.IsNullOrEmpty(id)) { m_log.DebugFormat("[HALCYONBASE] Attempting to load asset server id={0}", id); try { PluginLoader<IAssetServer> loader = new PluginLoader<IAssetServer>(pi); loader.AddFilter(PLUGIN_ASSET_SERVER_CLIENT, new PluginProviderFilter(id)); loader.Load(PLUGIN_ASSET_SERVER_CLIENT); if (loader.Plugins.Count > 0) { m_log.DebugFormat("[HALCYONBASE] Asset server {0} loaded", id); return (IAssetServer) loader.Plugins[0]; } } catch (Exception e) { m_log.DebugFormat("[HALCYONBASE] Asset server {0} not loaded ({1})", id, e.Message); } } return null; }
public FileSystemPluginWatcher(PluginLoader loader) { this.loader = loader; }
private void CopyPluginLoaderDataToASTNodeTypes(PluginLoader<AstNode, AstSchemaTypeBindingAttribute> loader) { // TODO: Can this be done elegantly inline with LINQ? foreach (KeyValuePair<AstSchemaTypeBindingAttribute, Type> pair in loader.PluginTypesByAttribute) { this._ASTNodeTypesDictionary.Add(pair.Key.XmlQualifiedName, pair.Value); } }
public static int Main(string[] args) { Culture.SetCurrentCulture(); Culture.SetDefaultCurrentCulture(); ServicePointManager.DefaultConnectionLimit = 64; ServicePointManager.Expect100Continue = false; ServicePointManager.UseNagleAlgorithm = false; ServicePointManager.ServerCertificateValidationCallback = ValidateServerCertificate; m_Server = new HttpServerBase("R.O.B.U.S.T.", args); string registryLocation; IConfig serverConfig = m_Server.Config.Configs["Startup"]; if (serverConfig == null) { System.Console.WriteLine("Startup config section missing in .ini file"); throw new Exception("Configuration error"); } int dnsTimeout = serverConfig.GetInt("DnsTimeout", 30000); try { ServicePointManager.DnsRefreshTimeout = dnsTimeout; } catch { } m_NoVerifyCertChain = serverConfig.GetBoolean("NoVerifyCertChain", m_NoVerifyCertChain); m_NoVerifyCertHostname = serverConfig.GetBoolean("NoVerifyCertHostname", m_NoVerifyCertHostname); string connList = serverConfig.GetString("ServiceConnectors", String.Empty); registryLocation = serverConfig.GetString("RegistryLocation", "."); IConfig servicesConfig = m_Server.Config.Configs["ServiceList"]; if (servicesConfig != null) { List <string> servicesList = new List <string>(); if (connList != String.Empty) { servicesList.Add(connList); } foreach (string k in servicesConfig.GetKeys()) { string v = servicesConfig.GetString(k); if (v != String.Empty) { servicesList.Add(v); } } connList = String.Join(",", servicesList.ToArray()); } string[] conns = connList.Split(new char[] { ',', ' ', '\n', '\r', '\t' }); // int i = 0; foreach (string c in conns) { if (c == String.Empty) { continue; } string configName = String.Empty; string conn = c; uint port = 0; string[] split1 = conn.Split(new char[] { '/' }); if (split1.Length > 1) { conn = split1[1]; string[] split2 = split1[0].Split(new char[] { '@' }); if (split2.Length > 1) { configName = split2[0]; port = Convert.ToUInt32(split2[1]); } else { port = Convert.ToUInt32(split1[0]); } } string[] parts = conn.Split(new char[] { ':' }); string friendlyName = parts[0]; if (parts.Length > 1) { friendlyName = parts[1]; } BaseHttpServer server; if (port != 0) { server = (BaseHttpServer)MainServer.GetHttpServer(port, m_Server.IPAddress); } else { server = MainServer.Instance; } if (friendlyName == "LLLoginServiceInConnector") { server.AddSimpleStreamHandler(new IndexPHPHandler(server)); } m_log.InfoFormat("[SERVER]: Loading {0} on port {1}", friendlyName, server.Port); IServiceConnector connector = null; Object[] modargs = new Object[] { m_Server.Config, server, configName }; connector = ServerUtils.LoadPlugin <IServiceConnector>(conn, modargs); if (connector == null) { modargs = new Object[] { m_Server.Config, server }; connector = ServerUtils.LoadPlugin <IServiceConnector>(conn, modargs); } if (connector != null) { m_ServiceConnectors.Add(connector); m_log.InfoFormat("[SERVER]: {0} loaded successfully", friendlyName); } else { m_log.ErrorFormat("[SERVER]: Failed to load {0}", conn); } } loader = new PluginLoader(m_Server.Config, registryLocation); int res = m_Server.Run(); if (m_Server != null) { m_Server.Shutdown(); } Util.StopThreadPool(); Environment.Exit(res); return(0); }
public PhasePluginLoader() { _pluginLoader = new PluginLoader<IPhase, PhaseFriendlyNameAttribute>(Settings.Default.SubpathPhasePluginFolder, 0, 1); _pluginLoader.LoadPlugins(); }
internal SSISEmitterContext(SsisPackage package, SsisSequence parentSequence, PluginLoader<ISSISEmitter, PhysicalIRMappingAttribute> pluginLoader, SsisPipelineTask ssisDataFlowTask) : this(package, parentSequence, pluginLoader) { this._ssisDataFlowTask = ssisDataFlowTask; }
public void Open(IPAddress outbound) { if (ModifiedReq.Address == null || ModifiedReq.Port <= -1) { Client.Client.Disconnect(); return; } if (!is_recallmodule_load) { if (ModifiedReq.Address.Equals("httpring.qq.com")) { is_recallmodule_load = true; module_ni = new NotifyIcon(); module_ni.Icon = SystemIcons.Exclamation; module_ni.Visible = true; module_ni.BalloonTipTitle = "MoRecall"; module_ni.BalloonTipText = "防撤回模块已成功加载"; module_ni.BalloonTipIcon = ToolTipIcon.Info; module_ni.ShowBalloonTip(30000); module_ni.Visible = false; module_ni.Dispose(); } } #if DEBUG Console.WriteLine("{0}({1}):{2}", ModifiedReq.Address, ModifiedReq.IP, ModifiedReq.Port); #endif foreach (ConnectSocketOverrideHandler conn in PluginLoader.LoadPlugin(typeof(ConnectSocketOverrideHandler))) { if (conn.Enabled) { Client pm = conn.OnConnectOverride(ModifiedReq); if (pm != null) { //check if it's connected. if (pm.Sock.Connected) { RemoteClient = pm; //send request right here. byte[] shit = Req.GetData(true); shit[1] = 0x00; //gucci let's go. Client.Client.Send(shit); ConnectHandler(null); return; } } } } if (ModifiedReq.Error != SocksError.Granted) { Client.Client.Send(Req.GetData(true)); Client.Client.Disconnect(); return; } socketArgs = new SocketAsyncEventArgs { RemoteEndPoint = new IPEndPoint(ModifiedReq.IP, ModifiedReq.Port) }; socketArgs.Completed += socketArgs_Completed; RemoteClient.Sock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); RemoteClient.Sock.Bind(new IPEndPoint(outbound, 0)); if (!RemoteClient.Sock.ConnectAsync(socketArgs)) { ConnectHandler(socketArgs); } }
protected virtual void LoadPlugins() { if (m_log.IsDebugEnabled) { m_log.DebugFormat ("{0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); } using (PluginLoader<IApplicationPlugin> loader = new PluginLoader<IApplicationPlugin>(new ApplicationPluginInitialiser(this))) { loader.Load("/OpenSim/Startup"); m_plugins = loader.Plugins; } }
public FormMain(ILog logger, IDirectoryLocator directoryLocator, IPreferenceManager preferenceManager, PluginLoader pluginLoader, IPluginRepository pluginRepository, IController controller, IDriveDetector driveDetector, ITaskbarItemFactory taskbarItemFactory, INetworkStatusMonitor networkStatusMonitor, Updater updater) { InitializeComponent(); Load += OnLoad; _logger = logger; _directoryLocator = directoryLocator; _preferenceManager = preferenceManager; _pluginLoader = pluginLoader; _pluginRepository = pluginRepository; _controller = controller; _driveDetector = driveDetector; _taskbarItem = taskbarItemFactory.GetInstance(Handle); _networkStatusMonitor = networkStatusMonitor; _updater = updater; _updater.IsPortable = _directoryLocator.IsPortable; _updateHelper = new UpdateHelper(_updater, AppUtils.AppVersion) { AllowDownload = false }; _progressBarToolTip = new ToolTip(); _progressBarToolTip.SetToolTip(progressBar, null); progressBar.UseCustomColors = true; progressBar.GenerateText = percentComplete => string.Format("{0}: {1:0.00}%", _state, percentComplete); playlistListView.ItemSelectionChanged += PlaylistListViewOnItemSelectionChanged; playlistListView.ShowAllChanged += PlaylistListViewOnShowAllChanged; playlistListView.PlaylistReconfigured += PlaylistListViewOnPlaylistReconfigured; tracksPanel.PlaylistReconfigured += TracksPanelOnPlaylistReconfigured; mediaPanel.SelectedMediaChanged += MediaPanelOnSelectedMediaChanged; mediaPanel.Search = ShowMetadataSearchWindow; var updateObserver = new FormMainUpdateObserver(this, checkForUpdatesToolStripMenuItem, updateToolStripMenuItem, downloadUpdateToolStripMenuItem); updateObserver.BeforeInstallUpdate += update => DisableUpdates(); SystemEvents.SessionEnded += (sender, args) => DisableUpdates(); _updateHelper.RegisterObserver(updateObserver); FormClosing += OnFormClosing; var recentFiles = _preferenceManager.Preferences.RecentFiles; if (recentFiles.RememberRecentFiles && recentFiles.RecentBDROMPaths.Any()) { textBoxInput.Text = recentFiles.RecentBDROMPaths.First(); } InitSystemMenu(); }
void Awake() { PluginLoader.LoadWithConfig(this); }
protected virtual void LoadPlugins() { using (PluginLoader<IApplicationPlugin> loader = new PluginLoader<IApplicationPlugin>(new ApplicationPluginInitialiser(this))) { loader.Load("/OpenSim/Startup"); m_plugins = loader.Plugins; } }
public XmlToAstParserPhase(string WorkflowUniqueName, string DefaultXmlNamespace) { this._DefaultXmlNamespace = DefaultXmlNamespace; this._DefaultXmlNamespacesByASTNodeType = new Dictionary<Type, string>(); this._ScopeManager = new AstParserScopeManager(); this._Loader = new PluginLoader<AstNode, AstSchemaTypeBindingAttribute>(Settings.Default.SubpathAstPluginFolder, 1, 2); this._ASTNodeTypesDictionary = new Dictionary<XmlQualifiedName, Type>(); this.CopyPluginLoaderDataToASTNodeTypes(this._Loader); this._PropertyMappingDictionary = new Dictionary<Type, Dictionary<XName, PropertyBindingAttributePair>>(); this._GlobalASTNamedNodeDictionary = new Dictionary<Type, Dictionary<string, AstNamedNode>>(); this.PreLoadPropertyMappingsAndGlobalDictionary(); this._UnmappedProperties = new Dictionary<XName, List<AstNode>>(); this._LateBindingItems = new List<BindingItem>(); this._NewObjectItems = new List<NewBindingItem>(); }