internal static void BuildFragments(IHostBundleMetadataNode hostNode) { AssertUtility.ArgumentNotNull(hostNode, "hostNode"); Interface1 metadata = hostNode.Metadata as Interface1; AssertUtility.ArgumentNotNull(metadata, "metadata"); if ((metadata.Fragments != null) && (metadata.Fragments.Count != 0)) { hostNode.DetachAllFragments(); metadata.Fragments.ForEach(a => hostNode.AttachFragment((IFragmentBundleMetadataNode)hostNode.ConstraintResolver.UnResolverNodes.Find(node => node.Metadata == a))); } }
public static TypeConverter GetConverter(Type type) { AssertUtility.ArgumentNotNull(type, "type"); TypeConverter converter = (TypeConverter)_converters[type]; if (converter != null) { return(converter); } if (type.IsEnum) { return(new EnumConverter(type)); } return(TypeDescriptor.GetConverter(type)); }
public static XmlNamespaceManager CreateXmlNamespaceManager(XmlNode node, string xmlNamespace) { AssertUtility.NotNull(node); XmlNamespaceManager manager = new XmlNamespaceManager(node.OwnerDocument.NameTable); if ((string.IsNullOrEmpty(xmlNamespace) ? 0 : 1) != 0) { if (xmlNamespace != "urn:uiosp-bundle-manifest-2.0") { throw new Exception("The xmlns attribute of Bundle in Manifest.xml must be urn:uiosp-bundle-manifest-2.0"); } manager.AddNamespace("ebm2", "urn:uiosp-bundle-manifest-2.0"); } return(manager); }