Exemplo n.º 1
0
        internal static Facet CreateFacet(FacetDefinition Definition)
        {
            if (Definition is PatternFacetDefinition)
            {
                return(new PatternFacet(Definition));
            }
            if (Definition is LengthFacetDefinition)
            {
                return(new LengthFacet(Definition));
            }
            if (Definition is MaxLengthFacetDefinition)
            {
                return(new MaxLengthFacet(Definition));
            }
            if (Definition is WhiteSpaceFacetDefinition)
            {
                return(new WhiteSpaceFacet(Definition));
            }
            if (Definition is MinLengthFacetDefinition)
            {
                return(new WhiteSpaceFacet(Definition));
            }
            if (Definition is EnumerationFacetDefinition)
            {
                return(new EnumerationFacet(Definition));
            }
            string        MessageFormat  = AssemblyResources.GetName("FacetDefinitionNotSupportedForFacetCreation");
            StringBuilder MessageBuilder = new StringBuilder();

            MessageBuilder.AppendFormat(MessageFormat, Definition.GetType().ToString());
            //throw new XbrlException(MessageBuilder.ToString());
            return(null);
        }
Exemplo n.º 2
0
        private void ProcessFacet(FacetDefinition CurrentFacetDefinition, INode FacetNode)
        {
            Facet NewFacet;

            NewFacet = Facet.CreateFacet(CurrentFacetDefinition);
            foreach (IAttribute CurrentAttribute in FacetNode.Attributes)
            {
                foreach (FacetPropertyDefinition CurrentPropertyDefinition in CurrentFacetDefinition.PropertyDefinitions)
                {
                    if (CurrentAttribute.Name.Equals(CurrentPropertyDefinition.Name) == true)
                    {
                        NewFacet.AddFacetProperty(CurrentPropertyDefinition, CurrentAttribute.Value);
                        thisFacets.Add(NewFacet);
                        return;
                    }
                }
                string        MessageFormat  = AssemblyResources.GetName("UnsupportedFacetProperty");
                StringBuilder MessageBuilder = new StringBuilder();
                MessageBuilder.AppendFormat(MessageFormat, CurrentAttribute.Name, CurrentFacetDefinition.Name);
                //throw new XbrlException(MessageBuilder.ToString());
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// Adds a constraining facet definition to this type.
 /// </summary>
 /// <param name="ConstrainingFacet">
 /// The constraining facet to add to this type.
 /// </param>
 protected void AddConstrainingFacetDefinition(FacetDefinition ConstrainingFacet)
 {
     thisConstrainingFacetDefinitions.Add(ConstrainingFacet);
 }
Exemplo n.º 4
0
 /// <summary>
 /// Constructor for the <see cref="Facet"/> class.
 /// </summary>
 /// <param name="Definition">
 /// The definition of the facet to be used during the construction of the facet.
 /// </param>
 protected Facet(FacetDefinition Definition)
 {
     thisDefinition  = Definition;
     this.Properties = new List <FacetProperty>();
 }