/// <summary> /// Find module installer components for auto install with settings from unity editor. /// </summary> /// <param name="_gamemanagerGO"></param> public void ModuleAutoInstallerOverride(GameObject _gamemanagerGO) { // DataModule if (_gamemanagerGO.GetComponentInChildren <ModuleInstaller <IDataModule> >()) { IDataModule dm = _gamemanagerGO.GetComponentInChildren <ModuleInstaller <IDataModule> >().InstallModule(); DataModule.SetupModule(dm, dm.Settings); //typeof(IMyInterface).IsAssignableFrom(typeof(MyType)) //typeof().GetInterfaces().Contains(typeof(IMyInterface)) } // LocalizationModule if (_gamemanagerGO.GetComponentInChildren <ModuleInstaller <ILocalizationModule> >()) { ILocalizationModule dm = _gamemanagerGO.GetComponentInChildren <ModuleInstaller <ILocalizationModule> >().InstallModule(); LocalizationModule.SetupModule(dm, dm.Settings); } // PlayerProfileModule Install if (_gamemanagerGO.GetComponentInChildren <ModuleInstaller <IPlayerProfileModule> >()) { IPlayerProfileModule moduleInstance = _gamemanagerGO.GetComponentInChildren <ModuleInstaller <IPlayerProfileModule> >().InstallModule(); PlayerProfile.SetupModule(moduleInstance, moduleInstance.Settings); } // UIModule Install if (_gamemanagerGO.GetComponentInChildren <ModuleInstaller <IUIModule> >()) { IUIModule moduleInstance = _gamemanagerGO.GetComponentInChildren <ModuleInstaller <IUIModule> >().InstallModule(); UIModule.SetupModule(moduleInstance, moduleInstance.Settings); } // SceneModule Install if (_gamemanagerGO.GetComponentInChildren <ModuleInstaller <ISceneModule> >()) { ISceneModule moduleInstance = _gamemanagerGO.GetComponentInChildren <ModuleInstaller <ISceneModule> >().InstallModule(); SceneModule.SetupModule(moduleInstance, moduleInstance.Settings); } }
public async Task Invoke(HttpContext context, IDataModule dataModule) { //var _data = dataModule.AppClients; //var response = Utilities.InitializeResponse(); //context.Response.ContentType = "application/json"; //context.Response.StatusCode = (int)HttpStatusCode.Unauthorized; //var reqAuthToken = context.Request.Headers["X-ClientSecret"]; //if (string.IsNullOrEmpty(reqAuthToken)) //{ // await context.Response.WriteAsync( // SerializeUtility.SerializeJSON(Utilities.UnsuccessfulResponse(response, "X-ClientSecret header is required")), // Encoding.UTF8); //} //else //if (_data.Search(reqAuthToken).FirstOrDefault()?.ClientSecret != reqAuthToken) //{ // await context.Response.WriteAsync( // SerializeUtility.SerializeJSON(Utilities.UnsuccessfulResponse(response, "Invalid access token")), // Encoding.UTF8); //} //else //{ // await _Next(context); //} }
public IDataModule SetupModule(IDataModule _concreteModule, IModuleSettings _settings = null) { Settings = _settings; Debug.Log("AutoSetup. DataPath: " + ((DataModuleJsonSettings)Settings).StoreDataPath); // Add Here setup stuffs for this concrete implementation return(this); }
public void RegisterDataModule(IDataModule dataModule) { if (dataModule != null) { dataModule.RegisterEvents(m_eventSystemManager); m_dataModules[dataModule.GetName()] = dataModule; } }
/// <summary> /// Disposes of the ModuleHandler /// </summary> public void Dispose() { _dataModule = null; catalog.Dispose(); catalog = null; ModuleList.Clear(); ModuleList = null; }
public void UnRegisterDataModule(IDataModule dataModule) { if (dataModule != null) { dataModule.UnRegisterEvents(m_eventSystemManager); m_dataModules.Remove(dataModule.GetName()); } }
/// <summary> /// Module Setup. /// </summary> /// <param name="_concreteModule">Concrete module implementation to set as active module behaviour.</param> /// <returns></returns> public IDataModule SetupModule(IDataModule _concreteModule, IModuleSettings _settings = null) { ConcreteModuleImplementation = _concreteModule.SetupModule(_concreteModule, _settings); if (ConcreteModuleImplementation == null) { OnSetupError(); } return(ConcreteModuleImplementation); }
public T GetDataModule <T>(int name) where T : IDataModule { T _t = default(T); IDataModule _module = null; if (m_dataModules.TryGetValue(name, out _module)) { _t = (T)_module; } return(_t); }
public bool OpenFile(string path, FileType fileType) { _dataModule = SaveLoader.LoadFromFile(path); if (_dataModule != null) { _SetCurrentFile(path, fileType); SelectPass(0); } return(_dataModule != null); }
/// <summary> /// Loads modules /// </summary> public void Load() { CompositionContainer container = new CompositionContainer(_catalog); container.ComposeParts(this); foreach (var lazyModule in Modules) { IDataModule module = lazyModule.Value; module.Load(); } }
internal static double GN(string mdName, string param) { double num = 0.0; IDataModule dataModule = null; DataModuleUtils.m_dicMdName_DataModule.TryGetValue(mdName, out dataModule); bool flag = dataModule != null; if (flag) { num = dataModule.GN(param); } return(num); }
internal static string GS(string mdName, string param) { string str = ""; IDataModule dataModule = null; DataModuleUtils.m_dicMdName_DataModule.TryGetValue(mdName, out dataModule); bool flag = dataModule != null; if (flag) { str = dataModule.GS(param); } return(str); }
public void Start() { foreach (var module in _modules) { IDataModule closureSafeModule = module; var task = Task.Run(async() => { var parameters = new Parameter[] { new NamedParameter("specificFolder", closureSafeModule.ModuleName) }; await closureSafeModule.StartModule( DependenciesController.Instance.Container.Resolve <IStorageClient>(parameters)); closureSafeModule.Dispose(); }); task.Wait(); } }
internal static double GN(int mdId, string param) { double num = 0.0; IDataModule dataModule = null; DataModuleUtils.m_dicMdId_DataModule.TryGetValue(mdId, out dataModule); bool flag = dataModule != null; if (flag) { num = dataModule.GN(param); } else { AppEventLog.Debug(string.Format("不存在[{0}]数据模块", mdId)); } return(num); }
public bool SaveFile(string path, IDataModule passCollection) { if (passCollection == null) { return(false); } try { XDocument xDoc = _ParseToXml(passCollection); xDoc?.Save(path); return(true); } catch (Exception) { return(false); } }
public static void Init(TIM.T_KERNEL.DbTableCache.DllComponent component) { foreach (DllModule dllModule in component.Modules) { bool flag = dllModule.Type == ModuleType.D && dllModule.CallObjectType != null; if (flag) { IDataModule dataModule = (IDataModule)Activator.CreateInstance(dllModule.CallObjectType); bool flag2 = !DataModuleUtils.m_dicMdId_DataModule.ContainsKey(dllModule.MdId); if (flag2) { DataModuleUtils.m_dicMdId_DataModule.TryAdd(dllModule.MdId, dataModule); } bool flag3 = !DataModuleUtils.m_dicMdName_DataModule.ContainsKey(dllModule.MdName); if (flag3) { DataModuleUtils.m_dicMdName_DataModule.TryAdd(dllModule.MdName, dataModule); } } } }
//public SDKPlatformManager sdkManager = SDKPlatformManager.Instance; //public UIManager uiManager = UIManager.Instance; //private void Awake() //{ // Application.targetFrameRate = targetFrameRate; // UnityMonoDriver.s_instance = this; // if (base.transform.parent != null) // { // DontDestroyOnLoad(base.transform.parent); // } // InvokeRepeating("Tick",0f, 0.01f); // resourceManager.Init(GameObject.Find("ResourceManager").GetComponent<GameResourceManager>()); // uiManager.Init(); //} //private void Start() //{ // sdkManager.Init(); // sdkManager.Install(); // AudioManagerBase.Instance.Init(); // clientGameStateManager.Init(); // clientGameStateManager.EnterDefaultState(); //} //private void Update() //{ // sdkManager.Update(); // resourceManager.Update(); // AudioManagerBase.Instance.Update(); // uiManager.Update(Time.deltaTime); //} //private void Tick() //{ // //StoryManager.singleton.Tick(); // TimerManager.Tick(); // FrameTimerManager.Tick(); //} //private void OnApplicationFocus(bool focus) //{ // if (focus) // { // if (GameControllerBase.thePlayer != null) // { // GameControllerBase.thePlayer.m_skillManager.Compensation(prePay); // TimerManager.AddTimer(1000, 0, () => { prePay = 0; }); // } // } //} //private float prePause = 0; //private float prePay = 0; //private void OnApplicationPause(bool pause) //{ // if (pause) // { // prePause = Time.realtimeSinceStartup; // } // else // { // float cur = Time.realtimeSinceStartup; // GameControllerBase.StartTime = cur; // float pay = cur - prePause; // if (GameControllerBase.thePlayer != null) // { // GameControllerBase.thePlayer.m_skillManager.Compensation(-prePay); // prePay = 0; // GameControllerBase.thePlayer.m_skillManager.Compensation(pay); // } // } //} private void Awake() { CaomaoDriver.Instance = this; DontDestroyOnLoad(this.gameObject); UIRoot = GameObject.FindGameObjectWithTag("UIRoot").transform; DontDestroyOnLoad(UIRoot.gameObject); GameSettingModule = this.CreateModule <GameSettingModule>(); UIModule = this.CreateModule <CUIModule>(); GameStateModule = this.CreateModule <ClientGameStateModule>(); ResourceModule = this.CreateModule <ResourceModule>(); SceneLoadModule = this.CreateModule <SceneLoadModule>(); WordFilterModule = this.CreateModule <WordFilterModule>(); LocalizationModule = this.CreateModule <LocalizationModule>(); WebRequestModule = this.CreateModule <WebRequestModule>(); RedPointModule = this.CreateModule <RedPointModule>(); HotFixModule = this.CreateModule <HotFixModule>(); TimerModule = this.CreateModule <TimerModule>(); AudioModule = this.CreateModule <AudioModule>(); DataModule = this.CreateModule <DataModule>(); NewbieHelpModule = this.CreateModule <NewbieHelpModule>(); this.modules.Awake(); }
private XDocument _ParseToXml(IDataModule passCollection) { if (passCollection == null) { return(null); } XDocument xDoc = new XDocument(new XElement(_STRING_ID)); foreach (PassContainer passNote in passCollection) { XElement element = new XElement(nameof(passNote)); foreach (var propertyInfo in typeof(PassContainer).GetProperties()) { element.Add(new XElement(propertyInfo.Name, propertyInfo.GetValue(passNote))); } xDoc.Root.Add(element); } return(xDoc); }
protected virtual void DoBeforeSetOwner(IDataModule value) { }
protected override void DoAfterSetOwner(IDataModule value) { ExecuteSecurity(value); }
public AdministrationService() { _dataModule = AdministrationCommandFacade.ModuleHandler.DataModule; }
public static bool SaveFile(string path, IDataModule passCollection) { return(SaveFile(path, passCollection, FileType.xml)); }
public bool SaveFile(string path, IDataModule passCollection) { return(FileInterface.SaveFile(path, passCollection)); }
public static bool SaveFile(string path, IDataModule passCollection, FileType fileType) { IFileModule fileModule = new FileModule.FileModule(fileType); return(fileModule.SaveFile(path, passCollection)); }
protected virtual void DoAfterSetOwner(IDataModule value) { }
public void Dispose() { _dataModule = null; catalog.Dispose(); catalog = null; ModuleList.Clear(); ModuleList = null; }
protected virtual void DoAfterSetOwner(IDataModule value) { if (this.DisableKeyFields && !this.AutoDisableControl) SetKeyCtrlsReadOnly(false); }
public void ExecuteSecurity(IDataModule value) { if (!DesignMode && this.Active) { DataTable table = SecurityTable; Form form = this.OwnerComp as Form; Type type = form.GetType(); for (int i = 0; i < table.Rows.Count; i++) { string controlName = (string)table.Rows[i]["ControlName"]; FieldInfo field = type.GetField(controlName, BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance); if (field != null) { object obj = field.GetValue(form); if (obj != null) { Type typeObj = obj.GetType(); for (int j = 1; j < table.Columns.Count; j++) { PropertyInfo property = typeObj.GetProperty(table.Columns[j].ColumnName); if (property != null && property.PropertyType == typeof(bool)) { property.SetValue(obj, table.Rows[i][j], null); } } //特别的 if(obj is InfoSecColumns) { (obj as InfoSecColumns).ReadOnly = !(bool)table.Rows[i]["Enabled"]; } #if UseCrystalReportDD else if(obj is CrystalReportViewer) { (obj as CrystalReportViewer).ShowExportButton = (bool)table.Rows[i]["AllowPrint"]; (obj as CrystalReportViewer).ShowPrintButton = (bool)table.Rows[i]["AllowPrint"]; } #endif } } } } }
public async Task Invoke(HttpContext context, IDataModule dataModule) { }
protected override void DoAfterSetOwner(IDataModule value) { if (AllCtrls.Count > 0) { AllCtrls.Clear(); } GetAllCtrls(((Form)this.OwnerComp).Controls); foreach (Control ctrl in AllCtrls) { if (ctrl is InfoRefvalBox && ((InfoRefvalBox)ctrl).RefVal == this) { string selValue = ((InfoRefvalBox)ctrl).TextBoxSelectedValue; object[] obj = this.CheckValid_And_ReturnDisplayValue(ref selValue, false, false); ((InfoRefvalBox)ctrl).TextBoxText = (string)obj[1]; } } }
protected override void DoAfterSetOwner(IDataModule value) { Do(); }
protected override void DoAfterSetOwner(IDataModule value) { base.DoAfterSetOwner(value); if (this.ValidActive) { AllCtrls.Clear(); this.GetAllCtrls(((Form)this.OwnerComp).Controls); foreach (Control ctrl in AllCtrls) { if (ctrl is Label) { foreach (FieldItem vfi in this.FieldItems) { if (vfi.ValidateLabelLink == ((Label)ctrl).Name && this.ValidateColor != null) { if (vfi.CheckNull || vfi.CheckRangeFrom.Trim().Length > 0 || vfi.CheckRangeTo.Trim().Length > 0 || vfi.Validate.Trim().Length > 0) { ((Label)ctrl).ForeColor = this.ValidateColor; ((Label)ctrl).Text = ((Label)ctrl).Text.Insert(0, this.ValidateChar); } } } } if (ctrl is InfoDataGridView) { //modified by lily 2007/4/25 for multi-details may have many *s. object obj = ((InfoDataGridView)ctrl).DataSource; if (obj != null && obj is InfoBindingSource && (InfoBindingSource)obj == this.BindingSource) { InfoDataGridView grid = (InfoDataGridView)ctrl; if (!grid.ReadOnly || (obj as InfoBindingSource).AutoDisableControl) { foreach (DataGridViewColumn field in grid.Columns) { foreach (FieldItem vfi in this.FieldItems) { if (vfi.FieldName == field.DataPropertyName && this.ValidateColor != null) { if (vfi.CheckNull || vfi.CheckRangeFrom.Trim().Length > 0 || vfi.CheckRangeTo.Trim().Length > 0 || vfi.Validate.Trim().Length > 0) { field.HeaderCell.Style.ForeColor = this.ValidateColor; field.HeaderText = field.HeaderText.Insert(0, this.ValidateChar); } } } } } } } } } if (this.LeaveValidation) { Form form = this.OwnerComp as Form; Type type = form.GetType(); FieldInfo[] fields = type.GetFields(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance); foreach (FieldInfo field in fields) { for (int i = 0; i < this.FieldItems.Count; i++) { FieldItem fi = FieldItems[i]; object obj = field.GetValue(form); if (obj != null) { if (obj is InfoRefvalBox && (obj as InfoRefvalBox).TextBoxBindingMember == fi.FieldName) { (obj as Control).Leave += new EventHandler(DefaultValidate_Leave); break; } else if (obj is Control && (obj as Control).DataBindings.Count > 0 && (obj as Control).DataBindings[0].BindingMemberInfo.BindingField == fi.FieldName) { (obj as Control).Leave += new EventHandler(DefaultValidate_Leave); break; } } } } } }
public ClientsService() { _dataModule = PlanningCommandFacade.ModuleHandler.DataModule; }
protected override void DoAfterSetOwner(IDataModule value) { //foreach (Control c in ((InfoForm)this.OwnerComp).Controls) //{ // if (c is Button) // { // if (((Button)c).Text == this.ClickControl) // ((Button)c).PerformClick(); // } // else if (c is InfoNavigator) // { // foreach (ToolStripItem tsi in ((InfoNavigator)c).Items) // { // if (tsi.Text == this.ClickControl) // tsi.PerformClick(); // } // } //} }
public PassManager() { _dataModule = new PassCollection(); _currentPass = null; }