示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="StringMetaExport"/> class.
        /// </summary>
        public StringMetaExport()
        {
            FullName = "StringMetaExport";

            var builder = new ComponentInfoBuilder(GetTypeInfo());

            builder.AddMeta("Key1", "Exported metadata1", true);
            builder.AddMeta("Key1", "Exported metadata2", true);
            builder.AddPropertyExport(TypeDescriptor.Create <string>(), "Export");
            builder.AddExplicitCompositionPoint(Naming.Method(TypeInfo, Naming.CtorName, false));

            ComponentInfo = builder.BuildWithImplicitCtor();
        }
示例#2
0
        private void buildMetaExport(AttributeInfo info, ComponentInfoBuilder builder)
        {
            var isMultiple = info.GetArgument("IsMultiple") == "true";
            var name       = parseObject(info.GetArgument("Name", 0), builder, info.Element) as string;
            var value      = parseObject(info.GetArgument("Value", 1), builder, info.Element);

            builder.AddMeta(name, value, isMultiple);
        }