public RandomNetworkGenElement Create(Guid id, IElementDefinition defType) { RandomNetworkGenElement el = new RandomNetworkGenElement(id, defType); IInputPortMgr inPortMgr = CreateInputPortMgr(el); IOutputPortMgr outPortMgr = CreateOutputPortMgr(el); el.InPortMgr = inPortMgr; el.OutPortMgr = outPortMgr; IRandomNetGenParamMgr paramMgr = CreateParamMgr(); el.ParamMgr = paramMgr; Guid fxId = Guid.NewGuid(); IRandomNetworkGenFx fx = CreateMyFx(fxId, id); el.Fx = fx; using (SettingsMgrFactory fac = new SettingsMgrFactory()) { ISimpleSettingsMgr settingsMgr = fac.CreateSettingsMgr(el); el.SettingsMgr = settingsMgr; } using (OptionsMgrFactory fac = new OptionsMgrFactory()) { ISimpleOptionsMgr optsMgr = fac.CreateOptionsMgr(el); el.OptionsMgr = optsMgr; } return el; }
public DataPropertiesElement Create(Guid id, IElementDefinition defType) { DataPropertiesElement el = new DataPropertiesElement(id, defType); IInputPortMgr inPortMgr = CreateInputPortMgr(el); IOutputPortMgr outPortMgr = CreateOutputPortMgr(el); el.InPortMgr = inPortMgr; el.OutPortMgr = outPortMgr; IDataPropertiesElementParamMgr paramMgr = CreateParamMgr(); el.ParamMgr = paramMgr; Guid fxId = Guid.NewGuid(); IDataPropertiesElementFx fx = CreateMyFx(fxId, id); el.Fx = fx; using (SettingsMgrFactory fac = new SettingsMgrFactory()) { ICompoundSettingsMgr settingsMgr = fac.CreateSettingsMgr(el); el.SettingsMgr = settingsMgr; } using (OptionsMgrFactory fac = new OptionsMgrFactory()) { ICompoundOptionsMgr optsMgr = fac.CreateOptionsMgr(el); el.OptionsMgr = optsMgr; } return el; }
public ExtractKthCoreElement Create(Guid elementId, IElementDefinition defType) { ExtractKthCoreElement el = new ExtractKthCoreElement(elementId, defType); IInputPortMgr inPortMgr = CreateInputPortMgr(el); IOutputPortMgr outPortMgr = CreateOutputPortMgr(el); el.InPortMgr = inPortMgr; el.OutPortMgr = outPortMgr; IExtractKthCoreParamMgr paramMgr = CreateParamMgr(); el.ParamMgr = paramMgr; Guid fxId = Guid.NewGuid(); IExtractKthCoreFx fx = CreateMyFx(fxId, elementId); el.Fx = fx; using (SettingsMgrFactory fac = new SettingsMgrFactory()) { ISimpleSettingsMgr settingsMgr = fac.CreateSettingsMgr(el); el.SettingsMgr = settingsMgr; } using (OptionsMgrFactory fac = new OptionsMgrFactory()) { ISimpleOptionsMgr optsMgr = fac.CreateOptionsMgr(el); el.OptionsMgr = optsMgr; } return el; }
public void CreateSettingsMgr_For_SimpleEl() { //Arrange var fac = new SettingsMgrFactory(); ISimpleElement el = DummyFactory.CreateDummySimpleEl(Guid.NewGuid()); //Act ISettingsMgr mgr = fac.CreateSettingsMgr(el); //Assert Assert.NotNull(mgr); Assert.IsType(typeof(SimpleSettingsMgr), mgr); }
public INeutralPipe CreateNeutralPipe(Guid id) { NeutralPipe pipe = new NeutralPipe(id); using (SettingsMgrFactory fac = new SettingsMgrFactory()) { pipe.SettingsMgr = fac.CreateSettingsMgr(pipe); } using (Providers.OptionsMgrFactory fac = new OptionsMgrFactory()) { pipe.OptionsMgr = fac.CreateOptionsMgr(pipe); } return pipe; }
public void CreateSettingsMgr_For_Network_Pipe() { //Arrange var pfac = new PipeFactory(); INetworkPipe pipe = pfac.CreateNetworkPipe(); var fac = new SettingsMgrFactory(); //Act IPipeSettingsMgr mgr = fac.CreateSettingsMgr(pipe); //Assert Assert.NotNull(mgr); Assert.IsType(typeof(PipeSettingsMgr), mgr); }
public DataPropertiesElement Create(IElementTicket ticket, IElementDefinition defType) { if (ticket.TypeId != defType.ElementTypeId) { // TODO throw new InvalidOperationException(Properties.Resources.MssgTicketTypeIdDoesNotMatchDefTypeIdFormat(ticket.TypeId, defType.ElementTypeId)); } DataPropertiesElement el = new DataPropertiesElement(ticket.ElementId, defType); IInputPortMgr inPortMgr = CreateInputPortMgr(el, ticket.InputPortMgrId, ticket.InputPortIds[0]); IOutputPortMgr outPortMgr = CreateOutputPortMgr(el); el.InPortMgr = inPortMgr; el.OutPortMgr = outPortMgr; IDataPropertiesElementParamMgr paramMgr = CreateParamMgr(ticket.ParamMgrId); el.ParamMgr = paramMgr; IDataPropertiesElementFx fx = CreateMyFx(ticket.FxId, ticket.ElementId); el.Fx = fx; using (SettingsMgrFactory fac = new SettingsMgrFactory()) { ICompoundSettingsMgr settingsMgr = fac.CreateSettingsMgr(el); el.SettingsMgr = settingsMgr; } using (OptionsMgrFactory fac = new OptionsMgrFactory()) { ICompoundOptionsMgr optsMgr = fac.CreateOptionsMgr(el); el.OptionsMgr = optsMgr; } return el; }
public ExportNetworkElement Create(IElementTicket ticket, IElementDefinition defType) { if (ticket.TypeId != defType.ElementTypeId) { // TODO throw new InvalidOperationException(String.Format(Resources.MssgTicketTypeIdDoesNotMatchDefTypeId, ticket.TypeId, defType.ElementTypeId)); } ExportNetworkElement el = new ExportNetworkElement(ticket.ElementId, defType); IInputPortMgr inPortMgr = CreateInputPortMgr(el, ticket.InputPortMgrId, ticket.InputPortIds[0]); IOutputPortMgr outPortMgr = CreateOutputPortMgr(el); el.InPortMgr = inPortMgr; el.OutPortMgr = outPortMgr; IExportNetworkParamMgr paramMgr = CreateParamMgr(ticket.ParamMgrId); el.ParamMgr = paramMgr; IExportNetworkFx fx = CreateMyFx(ticket.FxId, ticket.ElementId); el.Fx = fx; using (var fac = new SettingsMgrFactory()) { ISimpleSettingsMgr settingsMgr = fac.CreateSettingsMgr(el); el.SettingsMgr = settingsMgr; } using (var fac = new OptionsMgrFactory()) { ISimpleOptionsMgr optsMgr = fac.CreateOptionsMgr(el); el.OptionsMgr = optsMgr; } return el; }