Example #1
0
        public OctRoute Insert(int index, byte value)
        {
            OctRoute result = Clone();

            result.values[index] = value;
            return(result);
        }
Example #2
0
        private OctRoute Clone()
        {
            var result = new OctRoute();

            for (int i = 0; i < values.Length; i++)
            {
                result.values[i] = values[i];
            }
            return(result);
        }
Example #3
0
        public static OctRoute Parse(string hexRoute)
        {
            var route  = long.Parse(hexRoute, NumberStyles.HexNumber);
            var result = new OctRoute();

            int index = result.values.Length;

            do
            {
                result.values[index - 1] = Convert.ToByte(route % OctCapacity);
                index--;
                route = route / OctCapacity;
            }while (route > 0);

            return(result);
        }