private StoreIndexDescriptor AssertIndexRule(SchemaRule schemaRule)
 {
     if (!(schemaRule is StoreIndexDescriptor))
     {
         fail("Expected IndexRule, but got " + schemaRule.GetType().Name);
     }
     return(( StoreIndexDescriptor )schemaRule);
 }
 private ConstraintRule AssertConstraintRule(SchemaRule schemaRule)
 {
     if (!(schemaRule is ConstraintRule))
     {
         fail("Expected ConstraintRule, but got " + schemaRule.GetType().Name);
     }
     return(( ConstraintRule )schemaRule);
 }
Пример #3
0
        // PUBLIC

        /// <summary>
        /// Serialize the provided SchemaRule onto the target buffer
        /// </summary>
        /// <param name="schemaRule"> the SchemaRule to serialize </param>
        public static sbyte[] Serialize(SchemaRule schemaRule)
        {
            if (schemaRule is StoreIndexDescriptor)
            {
                return(Serialize(( StoreIndexDescriptor )schemaRule));
            }
            else if (schemaRule is ConstraintRule)
            {
                return(Serialize(( ConstraintRule )schemaRule));
            }
            throw new System.InvalidOperationException("Unknown schema rule type: " + schemaRule.GetType());
        }