protected virtual void InitializePlantFromPipeline(IPlantEx plantEx) { INotifyIconChangerMaster globalNotifyIconChanger = HatcherGuide <INotifyIconChangerMaster> .CreateNewInstance(); globalNotifyIconChanger.Initialize(this.GlobalNotifyIcon); InitPlantPipeline.InitPlantGMPipeline.Run(plantEx, this.LuggageName, globalNotifyIconChanger); }
public virtual void InitPlantVMWithPlantEx([NotNull] IPlantEx underlyingPlant) { Assert.ArgumentNotNull(underlyingPlant, "underlyingPlant"); this.UnderlyingPlant = underlyingPlant; this.Name = underlyingPlant.Plant.HumanSupportingName.GetValueOrDefault("<unspecified name>"); this.Description = underlyingPlant.Plant.Description.GetValueOrDefault("<unspecified description>"); underlyingPlant.EnabledChanged += this.UnderlyingPlant_EnabledChanged; }
public virtual TPlantLuggageType GetPlantLuggage(IPlantEx plantEx) { if (!plantEx.HasLuggage(this.LuggageName)) { return(null); } return(plantEx.GetLuggage <TPlantLuggageType>(this.LuggageName)); }
public static List <IRareCommand> RunPipelineGetCommands(IPlantEx relatedPlant) { var args = new InitPlantRareCommandsArgs(relatedPlant); HatcherGuide <IPipelineManager> .Instance.InvokePipeline("rareCommandsServiceInitPlant", args); return(args.CollectedCommands); }
public static InitPlantGMArgs Run(IPlantEx plantEx, string luggageName, INotifyIconChangerMaster globalNotifyIconChanger) { var args = new InitPlantGMArgs(plantEx, luggageName, globalNotifyIconChanger); HatcherGuide <IPipelineManager> .Instance.InvokePipeline("globalMenuServiceInitPlant", args); return(args); }
protected virtual void OnEnabledChanged(IPlantEx plantEx, bool newValue) { PlantEnabledChangedEvent handler = this.EnabledChanged; if (handler != null) { handler(plantEx, newValue); } }
protected override void PlantOnEnabledChanged(IPlantEx plantEx, bool newValue) { var siBox = this.GetPlantLuggage(plantEx); if (siBox != null) { siBox.FixNIVisibility(); } }
protected virtual void InitializePlantInternal(IPlantEx plantEx) { List <IRareCommand> relatedCommands = InitPlantRareCommands.RunPipelineGetCommands(plantEx); if (relatedCommands != null) { var luggage = new RareCommandsServicePlantBox(relatedCommands); plantEx.PutLuggage(this.LuggageName, luggage); } }
protected override void PlantOnEnabledChanged(IPlantEx plantEx, bool newValue) { GlobalMenuPlantBox plantBox = this.GetPlantLuggage(plantEx); if (plantBox == null) { return; } plantBox.FixVisibility(); }
public InitPlantGMArgs( [NotNull] IPlantEx plantEx, [NotNull] string luggageName, [NotNull] INotifyIconChangerMaster globalNotifyIconChanger) { Assert.ArgumentNotNull(plantEx, "plantEx"); Assert.ArgumentNotNull(luggageName, "luggageName"); Assert.ArgumentNotNull(globalNotifyIconChanger, "globalNotifyIconChanger"); this.PlantEx = plantEx; this.LuggageName = luggageName; this.GlobalNotifyIconChanger = globalNotifyIconChanger; }
public InitPlantSIArgs( [NotNull] IPlantEx plantEx, [NotNull] string luggageName, EventHandler closeComponentClick, EventHandler exitGardenClick) { Assert.ArgumentNotNull(plantEx, "plantEx"); Assert.ArgumentNotNullOrEmpty(luggageName, "luggageName"); this.PlantEx = plantEx; this.LuggageName = luggageName; this.CloseComponentClick = closeComponentClick; this.ExitGardenClick = exitGardenClick; }
protected virtual void AquaintPlantWithServices(IPlantEx plantEx) { foreach (IService service in this.Services) { try { service.InitializePlant(plantEx); } catch (Exception ex) { Log.Error( "Failed to init plant '{0}' with service {1}".FormatWith(plantEx.Plant.GetType().FullName, service.GetType().FullName), ex, this); } } }
protected virtual void InitializePlantInternal(IPlantEx plant) { var workhorse = plant.GetFirstWorkhorseOfType <IGetPowerOfUserNotifications>(); if (workhorse == null) { return; } var plantBox = new UserNotificationsServicePlantBox() { RelatedPlantEx = plant, SettingsBox = plant.MySettingsBox.GetSubBox(this.LuggageName) }; var lord = new LordOfNotifications(plantBox); plant.PutLuggage(this.LuggageName, plantBox); workhorse.StoreLordOfNotifications(lord); }
protected virtual void SetCustomSettingsBox(IPlantEx plantEx) { var asExpected = plantEx.GetFirstWorkhorseOfType <IGetCustomSettingsStorage>(); if (asExpected == null) { return; } ISettingsBox settingsBox = plantEx.MySettingsBox.GetSubBox(this.LuggageName); asExpected.StoreCustomSettingsStorage(settingsBox); //Store luggage var luggage = new CustomSettingsServicePlantBox { RelatedPlantEx = plantEx, SettingsBox = settingsBox, IsEnabled = true, }; plantEx.PutLuggage(this.LuggageName, luggage); }
public virtual void Initialize(List <object> permanentPlants) { this.MySettingsBox = HatcherGuide <IRuntimeSettingsManager> .Instance.SystemSettings.GetSubBox("Gargedbed"); if (permanentPlants == null) { permanentPlants = new List <object>(); } permanentPlants.AddRange(this.GetAutoIncludePlants()); foreach (object plant in permanentPlants) { IPlantEx resolvedPlantEx = this.ResolveIPlantEx(plant); if (resolvedPlantEx != null) { this.Plants.Add(resolvedPlantEx.ID, resolvedPlantEx); } } //HatcherGuide<IRuntimeSettingsManager>.Instance.SaveNow(false); this.Initialized = true; }
protected virtual void ProvidePlantWithConfig(IPlantEx plantEx) { var asExpected = plantEx.GetFirstWorkhorseOfType <IGiveMeMyAppConfig>(); if (asExpected == null) { return; } string assemblyLocation = plantEx.Plant.GetType().Assembly.Location; System.Configuration.Configuration assemblyConfiguration = null; try { assemblyConfiguration = ConfigurationManager.OpenExeConfiguration(assemblyLocation); } catch (Exception ex) { Log.Warn("Unable to open admin config for {0}".FormatWith(assemblyLocation), this, ex); } asExpected.StoreModuleConfiguration(assemblyConfiguration); plantEx.PutLuggage(this.LuggageName, new MyAdminConfigServicePlantBox()); }
protected virtual void InitializePlantWithLuggage(IPlantEx plant) { var asClipboardWorksPerformer = plant.GetFirstWorkhorseOfType <IClipboardWorks>(); if (asClipboardWorksPerformer != null) { asClipboardWorksPerformer.StoreClipboardValueProvider(this.SelfProvider); } var clipboardListener = plant.GetFirstWorkhorseOfType <IClipboardListener>(); if (clipboardListener == null) { return; } var clipboardObserverPlantBox = new ClipboardObserverPlantBox { WorksHungry = clipboardListener, RelatedPlantEx = plant, SettingsBox = plant.MySettingsBox.GetSubBox(this.LuggageName) }; plant.PutLuggage(this.LuggageName, clipboardObserverPlantBox); }
public override void InitializePlant(IPlantEx plantEx) { this.EnsureInitialized(); base.InitializePlant(plantEx); this.InitializePlantFromPipeline(plantEx); }
public override void InitializePlant(IPlantEx plantEx) { base.InitializePlant(plantEx); this.InitializePlantFromPipeline(plantEx); }
public ResolveSinglePlantVMPipelineArgs([NotNull] IPlantEx plantEx) { Assert.ArgumentNotNull(plantEx, "plantEx"); this.PlantEx = plantEx; }
protected override ServiceForPlantVMBase GetServiceVM(UserConfigService serviceInstance, IPlantEx plantEx) { UserConfigServicePlantBox userConfigServicePlantBox = serviceInstance.GetPlantLuggage(plantEx); if (userConfigServicePlantBox == null) { return(null); } if (userConfigServicePlantBox.SettingsSteward.DefinedSettings.Count == 0) { return(null); } return(new ServiceForPlantActionPerformVM(this.ServiceName, this.ServiceDescription, this.GetCommand(userConfigServicePlantBox))); }
public InitPlantRareCommandsArgs(IPlantEx relatedPlant) { this.RelatedPlant = relatedPlant; }
public override void InitializePlant(IPlantEx plantEx) { base.InitializePlant(plantEx); this.InitializePlantInternal(plantEx); }
public static List<IRareCommand> RunPipelineGetCommands(IPlantEx relatedPlant) { var args = new InitPlantRareCommandsArgs(relatedPlant); HatcherGuide<IPipelineManager>.Instance.InvokePipeline("rareCommandsServiceInitPlant", args); return args.CollectedCommands; }
protected virtual SinglePlantVM GetSinglePlantVM(IPlantEx plantEx) { return ResolveSinglePlantVMPipelineRunner.Run(new ResolveSinglePlantVMPipelineArgs(plantEx)); }
protected override ServiceForPlantVMBase GetServiceVM(GlobalMenuService serviceInstance, IPlantEx plantEx) { var luggage = serviceInstance.GetPlantLuggage(plantEx); if (luggage.ToolStripMenuItems == null) { return(null); } return(new ServiceForPlantWithEnablingPlantBoxBasedVM(this.ServiceName, this.ServiceDescription, luggage)); }
protected virtual void UnderlyingPlant_EnabledChanged(IPlantEx plantEx, bool newValue) { this.OnPropertyChanged("ServicesVM"); }
public static void Run(string luggageName, IPlantEx relatedPlant) { var args = new InitPlantUCPipelineArg(luggageName, relatedPlant); HatcherGuide<IPipelineManager>.Instance.InvokePipeline("userConfigServiceInitPlant", args); }
public static InitPlantGMArgs Run(IPlantEx plantEx, string luggageName, INotifyIconChangerMaster globalNotifyIconChanger) { var args = new InitPlantGMArgs(plantEx, luggageName, globalNotifyIconChanger); HatcherGuide<IPipelineManager>.Instance.InvokePipeline("globalMenuServiceInitPlant", args); return args; }
public InitPlantUCPipelineArg(string luggageName, IPlantEx relatedPlant) { this.LuggageName = luggageName; this.RelatedPlant = relatedPlant; }
public static void Run(string luggageName, IPlantEx relatedPlant) { var args = new InitPlantUCPipelineArg(luggageName, relatedPlant); HatcherGuide <IPipelineManager> .Instance.InvokePipeline("userConfigServiceInitPlant", args); }
public static void Run(IPlantEx plantEx, string luggageName, EventHandler closeComponentClick, EventHandler exitGardenClick) { var args = new InitPlantSIArgs(plantEx, luggageName, closeComponentClick, exitGardenClick); HatcherGuide<IPipelineManager>.Instance.InvokePipeline("standaloneIconServiceInitPlant", args); }
protected override ServiceForPlantVMBase GetServiceVM(StandaloneIconService serviceInstance, IPlantEx plantEx) { return(new ServiceForPlantWithEnablingPlantBoxBasedVM( this.ServiceName, this.ServiceDescription, serviceInstance.GetPlantLuggage(plantEx))); }
protected virtual SinglePlantVM GetSinglePlantVM(IPlantEx plantEx) { return(ResolveSinglePlantVMPipelineRunner.Run(new ResolveSinglePlantVMPipelineArgs(plantEx))); }
protected virtual void InitializePlantFromPipeline(IPlantEx plantEx) { InitPlantSIPipeline.Run(plantEx, this.LuggageName, this.CloseComponentClick, this.ExitGardenClick); }