Пример #1
0
        public ConfiguredPartDefinition(PartConfig partConfig)
        {
            partType = Type.GetType(partConfig.Type);
            exports  = new List <ExportDefinition>();
            imports  = new List <ImportDefinition>();

            exports.Add(new ExportDefinition(partConfig.Contract, GetMetaData(partConfig.Metadata)));

            if (partConfig.Imports.Count > 0)
            {
                ProcessImportDefinitions(partConfig);
            }
        }
Пример #2
0
        private void ProcessImportDefinitions(PartConfig partConfig)
        {
            foreach (ConfiguredPartImportDefinition pid in partConfig.Imports)
            {
                ImportDefinition importDef = new ImportDefinition(
                    i => i.ContractName.Equals(pid.Contract),
                    pid.Contract,
                    pid.Cardinality,
                    pid.AllowRecomposition,
                    pid.AllowDefault
                    );

                this.imports.Add(importDef);
            }
        }
Пример #3
0
 public void Add(PartConfig partConfig)
 {
     BaseAdd(partConfig);
 }