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;
        }
Beispiel #3
0
        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 CreateOptionsMgr_For_Simple_El()
        {
            //Arrange
            OptionsMgrFactory fac = new OptionsMgrFactory();
            ISimpleElement el = DummyFactory.CreateDummySimpleEl(Guid.NewGuid());

            //Act
            IOptionsMgr mgr = fac.CreateOptionsMgr(el);

            //Assert
            Assert.NotNull(mgr);
            Assert.IsType(typeof(SimpleOptionsMgr), mgr);
        }
        public void CreateOptionsMgr_For_Network_Pipe()
        {
            //Arrange
            PipeFactory pfac = new PipeFactory();
            INetworkPipe pipe = pfac.CreateNetworkPipe();

            OptionsMgrFactory fac = new OptionsMgrFactory();

            //Act
            IPipeOptionsMgr mgr = fac.CreateOptionsMgr(pipe);

            //Assert
            Assert.NotNull(mgr);
            Assert.IsType(typeof(PipeOptionsMgr), mgr);
        }
Beispiel #6
0
        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 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;
        }