private void ActualizeConfigurationSettings(ConfigurationSettings configurationSettings, ProcessPlatform processPlatform) { //Actualize profiling target settings IProfilingTarget profilingTarget = _profilingTargets[configurationSettings.ProfilingTargetSettings.Uid]; if (profilingTarget.HasAgent) { configurationSettings.ProfilingTargetSettings.AgentDll = profilingTarget.GetAgentDll(processPlatform); } //Actualize frameworks settings foreach (FrameworkSettings frameworkSettings in configurationSettings.FrameworksSettings) { IFramework framework = _frameworks[frameworkSettings.Uid]; if (framework.HasAgent) { frameworkSettings.AgentDll = framework.GetAgentDll(processPlatform); } } //Actualize profiling types settings foreach (ProfilingTypeSettings profilingTypeSettings in configurationSettings.ProfilingTypesSettings) { IProfilingType profilingType = _profilingTypes[profilingTypeSettings.Uid]; if (profilingType.HasAgent) { profilingTypeSettings.AgentDll = profilingType.GetAgentDll(processPlatform); } profilingTypeSettings.Dependencies = profilingType.Definition.Dependencies.Select(x => x.Uid).ToArray(); profilingTypeSettings.FrameworkUid = profilingType.Definition.FrameworkUid; } }
public void InitShutdown() { IFrameworkFactory factory = new CFrameworkFactory(); IFramework fwk = factory.NewFramework(null); Assert.IsNotNull(fwk); Assert.AreEqual(fwk.getState(), BundleState.INSTALLED); fwk.Init(); Assert.AreEqual(fwk.getState(), BundleState.STARTING); IBundleContext ctx = fwk.getBundleContext(); Assert.IsNotNull(ctx); Assert.AreEqual(ctx.getBundle(), fwk); Expect.Once.On(mock_fwk_listener) .Method("FrameworkEvent") .With(new FrameworkEvent(FrameworkEvent.Type.STARTED, fwk, null)); ctx.AddFrameworkListener(mock_fwk_listener); fwk.Start(); Assert.AreEqual(fwk.getState(), BundleState.ACTIVE); fwk.Stop(); Assert.AreEqual(fwk.getState(), BundleState.STOPPING); fwk.WaitForStop(0); Assert.AreEqual(fwk.getState(), BundleState.RESOLVED); mocks.VerifyAllExpectationsHaveBeenMet(); }
//----------------------------------------------------------------------------------------------------------------------------------------------------- public SchedulerLifecycleManager(IFramework framework, AutofacJobFactory jobFactory, IEnumerable<IJobDetail> jobDetails, Auto<IJobLogger> logger) { _framework = framework; _logger = logger.Instance; _jobDetails = jobDetails.ToArray(); _jobFactory = jobFactory; }
private static IFramework AddBotAction <TReplyAction>(this IFramework framework, Type replyActionType) where TReplyAction : class, IReplyAction { var routes = replyActionType.GetTypeInfo().GetCustomAttributes().Select(x => (x as RouteAttribute)?.Route).Where(x => x != null).ToArray(); return(AddBotAction <TReplyAction>(framework, routes)); }
public static IFramework AddBotForm <TModel>(this IFramework framework) where TModel : class { var routes = typeof(TModel).GetTypeInfo().GetCustomAttributes().Select(x => (x as RouteAttribute)?.Route).Where(x => x != null).ToArray(); return(AddBotForm <TModel>(framework, routes)); }
private IRun CreateRun(IFramework framework) { if (framework == null) { throw new ArgumentNullException("framework"); } SequenceRun runs = new SequenceRun(); // SetUp OptionalMethodRun setup = new OptionalMethodRun(framework.SetUpAttributeType, false); runs.Runs.Add(setup); // Test FrameworkMethodRun test = new FrameworkMethodRun(framework); runs.Runs.Add(test); // TearDown OptionalMethodRun tearDown = new OptionalMethodRun(framework.TearDownAttributeType, false); runs.Runs.Add(tearDown); return(runs); }
public void OnConnection(object application) { this.framework = (IFramework)application; logger.Info("解压核心程序..."); try { bool flag = ProcessHelper.KillProcess(Arguments.PHANTOMJS_PROCESS_NAME); if (flag == true) { ExtractHelper.Extract(Arguments.TEMP_FOLDER, Arguments.PHANTOMJS_NAME, Arguments.SCRIPT_NAME); } } catch (Exception ex) { logger.Error("Extract core failed.", ex); throw new BasicException("Extract core failed."); } logger.Info("解压核心程序结束."); if (File.Exists(Path.Combine(Arguments.TEMP_FOLDER, Arguments.PHANTOMJS_NAME)) == false) { throw new BasicException("Webkit未找到,请重新安装软件或联系客服。"); } VerifyDirectory(); }
public void Create(Type t, FixtureCollection fixtures) { // get framework IFramework framework = FrameworkFactory.FromType(t); if (framework == null) { return; } // get test attribute Object fixtureAttribute = TypeHelper.TryGetFirstCustomAttribute(t, framework.TestFixtureAttributeType); if (fixtureAttribute == null) { return; } // create run bool ignored = TypeHelper.HasCustomAttribute(t, framework.IgnoreAttributeType); MethodInfo setUp = TypeHelper.GetAttributedMethod(t, framework.TestFixtureSetUpAttributeType); MethodInfo tearDown = TypeHelper.GetAttributedMethod(t, framework.TestFixtureTearDownAttributeType); Fixture fixture = new Fixture(t, this.CreateRun(framework), setUp, tearDown, ignored); fixtures.Add(fixture); }
public void MultipleInits() { IFrameworkFactory factory = new CFrameworkFactory(); IFramework fwk = factory.NewFramework(null); fwk.Init(); IBundleContext ctx = fwk.getBundleContext(); Expect.Exactly(2).On(mock_fwk_listener) .Method("FrameworkEvent") .With(new FrameworkEvent(FrameworkEvent.Type.STARTED, fwk, null)); ctx.AddFrameworkListener(mock_fwk_listener); fwk.Start(); fwk.Stop(); fwk.WaitForStop(0); Assert.AreEqual(fwk.getState(), BundleState.RESOLVED); fwk.Init(); fwk.getBundleContext().AddFrameworkListener(mock_fwk_listener); fwk.Start(); Assert.AreEqual(fwk.getState(), BundleState.ACTIVE); fwk.Stop(); fwk.WaitForStop(0); Assert.AreEqual(fwk.getState(), BundleState.RESOLVED); mocks.VerifyAllExpectationsHaveBeenMet(); }
//----------------------------------------------------------------------------------------------------------------------------------------------------- public ThreadLogAppender(IFramework framework, IThreadLogAnchor anchor, IThreadRegistry registry, IPlainLog plainLog) { _framework = framework; _anchor = anchor; _registry = registry; _plainLog = plainLog; }
public bool TryGet(Guid uid, out IFramework item) { lock (Lock) { VerifyDisposed(); return(_collection.TryGetValue(uid, out item)); } }
public CommandContext(IFramework framework) { if (framework == null) { throw new ArgumentNullException(); } Framework = framework; }
//----------------------------------------------------------------------------------------------------------------------------------------------------- public XmlConfigurationLoader(IFramework framework, Auto<IConfigurationLogger> logger, IEnumerable<IConfigurationSection> configurationSections) { _framework = framework; _logger = logger.Instance; _sectionsByXmlName = configurationSections.Cast<IInternalConfigurationObject>().ToDictionary( s => s.GetXmlName(), StringComparer.InvariantCultureIgnoreCase); }
public __DeviceParameter(IFramework framework, IDevice device, Parameter id) : base(framework, device, id) { __options = Enum .GetValues(type) .OfType <Enum>() .Where(x => !x.HasAttribute <HiddenAttribute>()) .OrderBy(x => x.GetAttribute <OrderAttribute>()?.Value ?? int.MaxValue) .ToList(); }
public CommandRepository(IFramework framework) { if (framework == null) { throw new ArgumentNullException(); } this._framework = framework; this.Commands = new List <ICommandAdaptor>(); this.NamedCommands = new Dictionary <string, ICommandAdaptor>(); }
public ScriptEngine(IResourceManager resourceManager, IScriptEngineContextManager scriptEngineContextManager, IFramework framework, IFileSystem fileSystem) { _resourceManager = resourceManager; _scriptEngineContextManager = scriptEngineContextManager; _framework = framework; _fileSystem = fileSystem; }
public bool Config(IFramework framework, IConfigElement configElement, bool isForce) { _framework = framework; if (!_isConfigInitialized || isForce) { Init(configElement.XmlElement); _isConfigInitialized = true; } return(true); }
//----------------------------------------------------------------------------------------------------------------------------------------------------- public async void AsyncAwaitOnPromiseExample() { IFramework framework = null; int x = await framework.Scheduler.Defer <int>(() => { return(123); }); Console.WriteLine(x.ToString()); }
protected bool Config(IFramework framework, IConfigElement configElement, bool isForce) { this.Framework = framework; if (!this.ConfigInitialized || isForce) { Init(configElement.XmlElement); this.ConfigInitialized = true; } return(true); }
public void Bootstrapp(IFramework framework) { framework.AddSingletonService <IAzureStorageConfig, AzureStorageConfig>(); framework.AddTransientService <IAzureBlob, AzureBlob>(); framework.AddTransientService <IAzureBlobQueue, AzureBlobQueue>(); framework.AddTransientService <IAzureBlobTable, AzureBlobTable>(); framework.AddTransientService(typeof(IAzureBlobTableRepository <>), typeof(AzureBlobTableRepository <>)); framework.AddTransientService(typeof(IRepositoryCommands <>), typeof(AzureBlobTableRepository <>)); framework.AddTransientService(typeof(IRepositoryQueries <>), typeof(AzureBlobTableRepository <>)); }
public void initFramework() { var frameworkFactory = new FrameworkFactory(); framework = frameworkFactory.CreateFramework(); framework.Init(); framework.Start(); bundles = framework.GetBundleContext().GetBundles(); }
public PluginDetailForm(IFramework framework, string bundleName, string bundleState) { this.bundleName = bundleName; this.bundleState = bundleState; bundle = framework.GetBundleContext().GetBundle(bundleName); this.framework = framework; logService = BunderServicesProvider.LogService; logger = logService.GetLogger(); InitializeComponent(); stateDetialLabel.Text = bundleState; }
public CreateBarsHelper(BarManager barManager_1, PopupMenu popupMenu_1, IFramework iframework_1, List <ICommand> list_1, IPopuMenuWrap ipopuMenuWrap_1) { this.CreateHandle(); base.CreateControl(); this.popupMenu_0 = popupMenu_1; this.barManager_0 = barManager_1; this.iframework_0 = iframework_1; this.list_0 = list_1; this.ipopuMenuWrap_0 = ipopuMenuWrap_1; this.sysGrants_0 = new SysGrants(AppConfigInfo.UserID); }
/// <summary> /// ģ��ij�ʼ������ȡ������Ϣ����Ϊ֧��Framework�� /// </summary> /// <param name="framework">������IFramework</param> /// <param name="setting">���ý�</param> protected override void OnInit(IFramework framework, IConfigSetting setting) { base.OnInit(framework, setting); try { MailSender.SmtpServer = this.setting["smtpServer"].Value.Value; MailSender.ServerPort = this.setting["serverPort"].Value.ToInt32(); MailSender.UserName = this.setting["userName"].Value.Value; MailSender.Password = this.setting["password"].Value.Value; } catch (Exception e) { Exceptor.Publish(e, LogLevel.WARN); } }
public FrameworkViewModel(IFramework framework, List <ProfilingTypeViewModel> profilingTypes, ConfigurationSettings configurationSettings) { _references = 0; _framework = framework; _frameworksSettings = configurationSettings.FrameworksSettings; _profilingTypes = new List <ProfilingTypeViewModel>(); foreach (IProfilingType profilingType in _framework.ProfilingTypes) { ProfilingTypeViewModel viewModel = new ProfilingTypeViewModel(profilingType, this, profilingTypes, configurationSettings.ProfilingTypesSettings); profilingTypes.Add(viewModel); _profilingTypes.Add(viewModel); } }
public TestForm(IFramework framework) { string fullName1 = typeof(IDBServices).Assembly.FullName; string fulllName2 = typeof(BunderServicesProvider).Assembly.FullName; dBServices = framework.GetBundleContext().GetService <IDBServices>(); eventService = framework.GetBundleContext().GetService <IEventService>(); eventService.registListener(this); BunderServicesProvider instance = BunderServicesProvider.getInstance(); // 获取当前线程上下文 synchronizationContext = SynchronizationContext.Current; InitializeComponent(); }
/// <summary> /// Bundle构造 /// </summary> /// <param name="framework">框架实例</param> /// <param name="bundleDirectoryPath">Bundle路径</param> /// <param name="bundleConfigData">Bundle配置节点</param> public Bundle(IFramework framework, string bundleDirectoryPath, XmlNode bundleConfigData) { this.framework = framework; this.bundleDirectoryPath = bundleDirectoryPath; this.manifestData = bundleConfigData; this.bundleRefDefinitionDict = new Dictionary <string, AssemblyDefinition>(); this.bundleRefAssemblyDict = new Dictionary <string, Assembly>(); this.extensionDatas = new List <ExtensionData>(); this.extensionPoints = new List <ExtensionPoint>(); this.bundleContext = new BundleContext(framework, this); Init(); }
public PageGenerator(IResourceManager resourceManager, IFramework framework) { var template = resourceManager.GetStringFromAssemblyOf<PageGenerator>("Forseti.Pages.Spark.Harness.spark"); _framework = framework; var settings = new SparkSettings().SetPageBaseType(typeof(HarnessView)); var templates = new InMemoryViewFolder(); _engine = new SparkViewEngine(settings) { ViewFolder = templates }; templates.Add(TemplateName, template); //"<for each=\"var s in Stuff\"><p>${s}</p></for>"); _descriptor = new SparkViewDescriptor().AddTemplate(TemplateName); }
private static IFramework AddBotAction(this IFramework framework, Type replyActionType, string[] routes, bool isDefault, bool isGlobalCommand) { var replyId = replyActionType.FullName; var replyItem = new ReplyItem { Routes = routes, ReplyId = replyId, ReplyType = replyId, IsDefault = isDefault, IsGlobalCommand = isGlobalCommand }; framework.AddService(s => s.Service(typeof(ReplyItem)).As(replyItem).Keyed(replyId).Lifetime(Lifetime.Singleton)); return(AddBotAction(framework, replyActionType, replyId)); }
/// <summary> /// Dispose of DirectEve /// </summary> public void Dispose() { Hooks.RemoveHooks(); if (_framework != null) { _framework.Dispose(); } //if (_security != null) // _security.QuitDirectEve(); //_security = null; _framework = null; }
public FrameworkMethodRunInvoker(FrameworkMethodRun run, IFramework framework, MethodInfo method) : base(run) { if (framework == null) { throw new ArgumentNullException("framework"); } if (method == null) { throw new ArgumentNullException("mi"); } this.framework = framework; this.method = method; this.Inspect(); }
//----------------------------------------------------------------------------------------------------------------------------------------------------- public ThreadLog( IFramework framework, IClock clock, IThreadRegistry registry, IThreadLogAnchor anchor, ThreadTaskType taskType, ActivityLogNode rootActivity) { _registry = registry; _anchor = anchor; _taskType = taskType; _rootActivity = rootActivity; _currentActivity = rootActivity; _startedAtUtc = framework.UtcNow; _logId = framework.NewGuid(); _correlationId = _logId; _node = framework.CurrentNode; _clock = clock; _rootActivity.AttachToThreadLog(this, parent: null); _registry.ThreadStarted(this); }
public void InitComponent(IFramework framework, int pluginId) { if (framework == null) { return; } m_Framework = framework; m_pluginId = pluginId; // Init UserControl if (m_UserControl == null) { m_UserControl = new DemoUserControl(); } m_UserControl.SetDemoModuleCore(this); }
public CompatibleManager() { #if NET461 System = new WindowSystem(); Framework = new NET461(); #else Framework = new NetStandard(); if (RuntimeSystemHelper.IsWindow()) { System = new WindowSystem(); } else { System = new LinuxSystem(); } #endif }
public void OnConnection(object application) { this.framework = (IFramework)application; DirectoryInfo productsDirectoryInfo = new DirectoryInfo(AbstractDownLoader.PRODUCTS_FOLDER); if (productsDirectoryInfo.Exists == false) { productsDirectoryInfo.Create(); } DirectoryInfo htmlDirectoryInfo = new DirectoryInfo(AbstractDownLoader.TEMP_HTML_FOLDER); if (htmlDirectoryInfo.Exists == false) { htmlDirectoryInfo.Create(); } }
public static IFramework FromAssembly(Assembly assembly) { IFramework framework = (IFramework)__frameworkByAssembly[assembly]; if (framework == null) { foreach (IFrameworkFactory frameworkFactory in __frameworkFactories) { framework = frameworkFactory.FromAssembly(assembly); if (framework != null) { __frameworkByAssembly[assembly] = framework; break; } } } return(framework); }
public IFramework this[Guid uid] { get { lock (_collection) { VerifyDisposed(); Framework framework; if (_collection.TryGetValue(uid, out framework)) { return(framework); } IFramework remoteFramework = Execute(() => RemoteObject[uid]); framework = new Framework(remoteFramework); _collection.Add(uid, framework); return(framework); } } }
private IRun CreateRun(IFramework framework) { if (framework == null) throw new ArgumentNullException("framework"); SequenceRun runs = new SequenceRun(); // SetUp OptionalMethodRun setup = new OptionalMethodRun(framework.SetUpAttributeType, false); runs.Runs.Add(setup); // Test FrameworkMethodRun test = new FrameworkMethodRun(framework); runs.Runs.Add(test); // TearDown OptionalMethodRun tearDown = new OptionalMethodRun(framework.TearDownAttributeType, false); runs.Runs.Add(tearDown); return runs; }
public Harness(IFramework framework) { Framework = framework; }
/// <summary> /// ��ʼ��ģ�� /// </summary> /// <param name="framework">IFramework</param> /// <param name="setting">��Ӧ�����ý�</param> protected override void OnInit(IFramework framework, IConfigSetting setting) { base.OnInit(framework, setting); cacheManager = this.GetCacheManager(); }
/// <summary> /// Dispose of DirectEve /// </summary> public void Dispose() { Hooks.RemoveHooks(); if (_framework != null) _framework.Dispose(); //if (_security != null) // _security.QuitDirectEve(); //_security = null; _framework = null; }
/// <summary> /// Create a DirectEve object /// </summary> public DirectEve(IFramework framework = null, bool enableStealth = true, bool enableStatisticModifying = false) { _enableStatisticsModifying = enableStatisticModifying; // create an instance of IFramework if (framework != null) { _framework = framework; } else { _framework = new InnerSpaceFramework(); } //#if !NO_DIRECTEVE_SECURITY // try // { // _security = new DirectEveSecurity(this); // Log("-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+"); // Log("Starting DirectEve v" + _security.Version); // if (_security.Email != "anonymous") // { // Log("Registered to " + _security.Email); // if (_security.ActiveInstances != -1 && _security.SupportInstances != -1) // Log("You are currently using " + _security.ActiveInstances + " of " + _security.SupportInstances + " support instances"); // } // else // Log("You are using the anonymous license, please consider upgrading to a support license (http://support.thehackerwithin.com)"); // Log("Copyright (c) 2012 - TheHackerWithin"); // Log("http://www.thehackerwithin.com"); // Log("-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+"); // } // catch (Exception ex) // { // Log("DirectEve: Exception during license check: " + ex.Message); // throw ex; // } //#endif try { _localSvcCache = new Dictionary<string, PyObject>(); _containers = new Dictionary<long, DirectContainer>(); _lastKnownTargets = new Dictionary<long, DateTime>(); #if DEBUG Log("Registering OnFrame event"); #endif if (enableStealth) { try { Hooks.InitializeHooks(); } catch (Exception ex) { Log("Warning: Failed to initialize stealth hooks: " + ex); } } _framework.RegisterFrameHook(FrameworkOnFrame); } catch (Exception e) { #if DEBUG Log("DirectEve: Debug: Exception after license check: " + e.Message + " stacktrace: " + e.StackTrace); #endif throw; } }
void IModule.Init(IFramework framework, IConfigSetting setting) { this.Init(framework, setting); }
//----------------------------------------------------------------------------------------------------------------------------------------------------- public MinimalDataPopulator(IFramework framework) { _framework = framework; }
public EmptyMessageContext(IFramework.Message.IMessage message) { SentTime = DateTime.Now; Message = message; MessageID = message.ID; }
/// <summary> /// ��ʼ��ģ�� /// </summary> /// <param name="framework">IFramework</param> /// <param name="setting">��Ӧ�����ý�</param> protected override void OnInit(IFramework framework, IConfigSetting setting) { base.OnInit(framework, setting); logManager = this.CreateLogManager(this.setting); }
/// <summary> /// ��ʼ��ģ�� /// </summary> /// <param name="framework">IFramework</param> /// <param name="setting">��Ӧ�����ý�</param> protected override void OnInit(IFramework framework, IConfigSetting setting) { base.OnInit(framework, setting); exceptionManager = this.GetExceptionManager(); }
/// <summary> /// ��ʼ��ģ�� /// </summary> /// <param name="framework">IFramework</param> /// <param name="setting">��Ӧ�����ý�</param> protected virtual void OnInit(IFramework framework, IConfigSetting setting) { if (setting == null) { throw new BaseException("ģ���ʼ��ʧ�ܣ�û���ṩ���ý�"); } this.framework = framework; this.moduleSetting = setting; this.name = setting.Property["name"].Value; string linkNode = setting.Property.TryGetPropertyValue("linkNode"); if (string.IsNullOrEmpty(linkNode)) { if (setting.Children > 0) { this.setting = setting[0]; } } else { this.setting = setting.GetChildSetting(linkNode); } }
/// <summary> /// ��ʼ��ģ�� /// </summary> /// <param name="framework">IFramework</param> /// <param name="setting">��Ӧ�����ý�</param> public virtual void Init(IFramework framework, IConfigSetting setting) { if(!this.initialized) { this.OnInit(framework, setting); this.initialized = true; } }
/// <summary> /// 初始化模块 /// </summary> /// <param name="framework">IFramework</param> /// <param name="setting">对应的配置节</param> protected override void OnInit(IFramework framework, IConfigSetting setting) { base.OnInit(framework, setting); questionMgr = this.CreateQuestionMgr(this.setting); }
public FrameworkMethodRun(IFramework framework) : base(framework.TestAttributeType.Name,true) { this.framework = framework; }
public FrameworkMethodRunInvoker(FrameworkMethodRun run, IFramework framework, MethodInfo method) : base(run) { if (framework == null) throw new ArgumentNullException("framework"); if (method == null) throw new ArgumentNullException("mi"); this.framework = framework; this.method = method; this.Inspect(); }
/// <summary> /// ��ʼ��ģ�� /// </summary> /// <param name="framework">IFramework</param> /// <param name="setting">��Ӧ�����ý�</param> public override void Init(IFramework framework, IConfigSetting setting) { if(setting != null) { base.Init(framework, setting); } }
//----------------------------------------------------------------------------------------------------------------------------------------------------- public InitialDataPopulator(IFramework framework) { _framework = framework; }