예제 #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 IElement CreateElement(IElementTicket ticket, IElementDefinition defType)
 {
     return Create(ticket, defType);
 }
예제 #3
0
        internal IElement ReConstitute(IElementTicket ticket)
        {
            using (var dic = _provider.GetDefinitionDic())
            {
                IElementDefinition def = dic[ticket.TypeId];

                IElement element = null;
                using (IElementFactoryProvider fp = _provider.GetFactoryByPackageName<IElementFactoryProvider>(def.PackageName))
                {
                    IElementFactory fac = fp.Create(def);
                    if (fac != null)
                        element = fac.CreateElement(ticket, def);

                    return element;
                }
            }
        }
예제 #4
0
 public abstract IElement CreateElement(IElementTicket ticket, IElementDefinition defType);
예제 #5
0
 public void CopyElementTicketsTo(IElementTicket[] array, int arrayIndex)
 {
     ElementTickets.Values.CopyTo(array, arrayIndex);
 }