public async Task Manage(IManage <string> manage) { if (manage.IsBookingComplete()) { await manage.Manage(); } }
protected override ValidationResult IsValid(object value, ValidationContext validationContext) { IManage manager = Activator.CreateInstance(this.ManagerType) as IManage; return(manager.Validate(value)); }
/// <summary> /// Set new service/manager to public using /// </summary> /// <param name="baseManagerInstance">Instance of your service/manager</param> /// <returns>Success of fail</returns> public static bool SetService(IManage baseManagerInstance) { if (baseManagerInstance != null) { if (baseManagerInstance.GetType().IsClass) { if (baseManagers.Exists(x => x.GetManageType() == baseManagerInstance.GetManageType())) { Debugger.SetMessage("Manager, that you want to attach, already exist.\nManager type is " + baseManagerInstance.GetManageType().ToString()); return(false); } baseManagers.Add(baseManagerInstance); baseManagerInstance.SetRemovingFunc(() => { DeleteService(baseManagerInstance.GetManageType()); }); CheckCallbacks(baseManagerInstance.GetManageType()); return(true); } else { Debugger.SetMessage("Manager, that you want to attach, is not a class.\nManager type is " + baseManagerInstance.GetType().ToString()); return(false); } } Debugger.SetMessage("Manager, that you want to attach, is null.\nManager type is " + baseManagerInstance.GetType().ToString()); return(false); }
/// <summary> /// 安装插件包 /// </summary> /// <param name="zipName"></param> public void InstallZip(string zipName) { IManage manage = Manage.Instance; PluginZipInfo zipInfo; if (zipInfoList.TryGetValue(zipName, out zipInfo)) { PluginInfo pluginInfo = manage.GetPlugins().SingleOrDefault(p => p.Guid == zipInfo.Guid); if (pluginInfo != null) { if (pluginInfo.Status == PluginStatus.NeedUnload) { throw new Exception("该插件刚被卸载,你需要重启应用后才能安装"); } else { throw new Exception("该插件已安装,卸载插件并重启应用后才能再次安装"); } } pluginInfo = Loader.Instance.LoadFromZip(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Plugins", "zips", zipInfo.ZipName)); manage.InitPlugin(pluginInfo); manage.StopPlugin(pluginInfo.Guid); WebIoc.Instance.Rebuild(); } }
//Minio public ManageController( UserManager <UserAccount> userManager, ILogger <ManageController> logger, SignInManager <UserAccount> signInManager, IEmailSender emailSender, IManage manage, DBModel context) { _userManager = userManager; _signInManager = signInManager; _emailSender = emailSender; _logger = logger; _manage = manage; _context = context; }
private static void CheckCallbacks(System.Type type) { if (callBackDictionary.ContainsKey(type)) { IManage service = GetService(type); if (service.IsReady) { MakeCallBack(service); } else { EventableDelegate anon = () => { }; anon = () => { CheckCallbacks(service.GetManageType()); service.RemoveListener(InstableEventType.onReady, anon); }; service.AddListener(InstableEventType.onReady, anon); } } }
public ManageController(IManage iManage) { this._IManage = iManage; }
private static IManage.IManSession GetUsrSession(IManage.IManSession imSession) { if (ConfigUtility.IsImTLogin()) { //imSession.TrustedLogin2(System.Security.Principal.WindowsIdentity.GetCurrent().Token.ToInt32()); imSession.TrustedLogin(); } else { imSession.Login(ConfigUtility.GetImLoginInfo().Item1, ConfigUtility.GetImLoginInfo().Item2); } return imSession; }
public PluginController(IManage manage) { PluginManage = manage; }
public ProfileController(IManage manager, IAuth authenticator) { this.manager = manager; this.authenticator = authenticator; }