コード例 #1
0
        public ExtractKthCoreElement Create(IElementTicket ticket, IElementDefinition defType)
        {
            if (ticket.TypeId != defType.ElementTypeId)
            {
                throw new InvalidOperationException(Properties.Resources.MssgTicketTypeIdDoesNotMatchDefTypeIdFormat(ticket.TypeId, defType.ElementTypeId));
            }

            ExtractKthCoreElement el = new ExtractKthCoreElement(ticket.ElementId, defType);

            IInputPortMgr inPortMgr = CreateInputPortMgr(el, ticket.InputPortMgrId, ticket.InputPortIds[0]);
            IOutputPortMgr outPortMgr = CreateOutputPortMgr(el, ticket.OutputPortMgrId, ticket.OutputPortIds[0]);

            el.InPortMgr = inPortMgr;
            el.OutPortMgr = outPortMgr;

            IExtractKthCoreParamMgr paramMgr = CreateParamMgr(ticket.ParamMgrId);
            el.ParamMgr = paramMgr;

            IExtractKthCoreFx fx = CreateMyFx(ticket.FxId, ticket.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;
        }
コード例 #2
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;
        }