Exemplo n.º 1
0
        public IType GetSampleType(IXmlNamespace xmlNamespace, string typeName)
        {
            if (this.dataSets.Count == 0)
            {
                return((IType)null);
            }
            string clrNamespace;
            string assemblyName;

            if (!XamlParser.TryParseClrNamespaceUri(xmlNamespace.Value, out clrNamespace, out assemblyName))
            {
                return((IType)null);
            }
            if (!clrNamespace.StartsWith(this.sampleDataClrNamespacePrefix, StringComparison.Ordinal) && !clrNamespace.StartsWith(this.dataStoreClrNamespacePrefix, StringComparison.Ordinal))
            {
                return((IType)null);
            }
            SampleDataSet sampleDataSet1 = this.GetSampleDataSet(clrNamespace.Substring(this.sampleDataClrNamespacePrefix.Length), true);

            if (sampleDataSet1 != null)
            {
                return(sampleDataSet1.GetSampleType(xmlNamespace, typeName));
            }
            SampleDataSet sampleDataSet2 = this.GetSampleDataSet(clrNamespace.Substring(this.dataStoreClrNamespacePrefix.Length), true);

            if (sampleDataSet2 != null)
            {
                return(sampleDataSet2.GetSampleType(xmlNamespace, typeName));
            }
            return((IType)null);
        }