Exemplo n.º 1
0
        // Utility to compute the required bitfield length in case of Raw features
        public static int ComputeStringLength(ConfigurationManager configManager)
        {
            // Decide which type of formatter to use
            switch (configManager.featuresFormat)
            {
            case "Normal":
                return(NormalFeaturesFormatter.ComputeStringLengthNormal(configManager));

            //break;
            case "Binary":
                return(BinaryFeaturesFormatter.ComputeStringLengthBinary(configManager));

            //break;
            case "Bitfield":
                return(BitFieldFeaturesFormatter.ComputeStringLengthBitfield(configManager));

            //break;
            case "Raw":
                return(RawFeaturesFormatter.ComputeStringLengthRaw(configManager));

            //break;
            default:
                Console.WriteLine("Incorrect features format configuration. {0} is invalid configuration. Valid configurations are: Normal, Binary and Bitfield", configManager.featuresFormat);
                throw (new IndexOutOfRangeException());
            }// end switch
        }