コード例 #1
0
ファイル: SyntaxWalkerBase.cs プロジェクト: lawl-dev/Kiwi
 public virtual void Visit(DataSyntax dataSyntax)
 {
     foreach (var parameterSyntax in dataSyntax.Parameter)
     {
         Visit(parameterSyntax);
     }
 }
コード例 #2
0
        internal static object SyntaxGetter(IPropertyBag propertyBag)
        {
            string text = (string)propertyBag[ADSchemaAttributeSchema.RawAttributeSyntax];
            int    num  = (int)((AttributeSyntax)propertyBag[ADSchemaAttributeSchema.OMSyntax]);

            byte[]     values     = (byte[])propertyBag[ADSchemaAttributeSchema.OMObjectClass];
            DataSyntax dataSyntax = DataSyntax.UnDefined;
            string     key;

            switch (key = text)
            {
            case "2.5.5.0":
                dataSyntax = DataSyntax.UnDefined;
                break;

            case "2.5.5.1":
                dataSyntax = DataSyntax.DSDN;
                break;

            case "2.5.5.2":
                dataSyntax = DataSyntax.ObjectIdentifier;
                break;

            case "2.5.5.3":
                dataSyntax = DataSyntax.CaseSensitive;
                break;

            case "2.5.5.4":
                dataSyntax = DataSyntax.Teletex;
                break;

            case "2.5.5.5":
                if (num == 19)
                {
                    dataSyntax = DataSyntax.Printable;
                }
                else if (num == 22)
                {
                    dataSyntax = DataSyntax.IA5;
                }
                break;

            case "2.5.5.6":
                dataSyntax = DataSyntax.Numeric;
                break;

            case "2.5.5.7":
            {
                string y = ADSchemaAttributeObject.ToHexString(values);
                if (StringComparer.OrdinalIgnoreCase.Equals("2A864886F7140101010B", y))
                {
                    dataSyntax = DataSyntax.DNBinary;
                }
                else if (StringComparer.OrdinalIgnoreCase.Equals("56060102050B1D", y))
                {
                    dataSyntax = DataSyntax.ORName;
                }
                break;
            }

            case "2.5.5.8":
                dataSyntax = DataSyntax.Boolean;
                break;

            case "2.5.5.9":
                if (num == 2)
                {
                    dataSyntax = DataSyntax.Integer;
                }
                else if (num == 10)
                {
                    dataSyntax = DataSyntax.Enumeration;
                }
                break;

            case "2.5.5.10":
                if (num == 4)
                {
                    dataSyntax = DataSyntax.Octet;
                }
                else if (num == 127)
                {
                    dataSyntax = DataSyntax.ReplicaLink;
                }
                break;

            case "2.5.5.11":
                if (num == 23)
                {
                    dataSyntax = DataSyntax.UTCTime;
                }
                else if (num == 24)
                {
                    dataSyntax = DataSyntax.GeneralizedTime;
                }
                break;

            case "2.5.5.12":
                dataSyntax = DataSyntax.Unicode;
                break;

            case "2.5.5.13":
                dataSyntax = DataSyntax.PresentationAddress;
                break;

            case "2.5.5.14":
            {
                string y = ADSchemaAttributeObject.ToHexString(values);
                if (StringComparer.OrdinalIgnoreCase.Equals("2B0C0287731C00853E", y))
                {
                    dataSyntax = DataSyntax.AccessPoint;
                }
                else if (StringComparer.OrdinalIgnoreCase.Equals("2A864886F7140101010C", y))
                {
                    dataSyntax = DataSyntax.DNString;
                }
                break;
            }

            case "2.5.5.15":
                dataSyntax = DataSyntax.NTSecDesc;
                break;

            case "2.5.5.16":
                dataSyntax = DataSyntax.LargeInteger;
                break;

            case "2.5.5.17":
                dataSyntax = DataSyntax.Sid;
                break;
            }
            return(dataSyntax);
        }