Example #1
0
        public static VersionNumber Parse(string AValue)
        {
            VersionNumber LVersion = new VersionNumber(-1, -1, -1, -1);

            string[] LNumbers = AValue.Split('.');
            for (int LIndex = 0; LIndex < LNumbers.Length; LIndex++)
            {
                switch (LIndex)
                {
                case 0:
                    if (LNumbers[LIndex] != "*")
                    {
                        LVersion.Major = Int32.Parse(LNumbers[LIndex]);
                    }
                    break;

                case 1:
                    if (LNumbers[LIndex] != "*")
                    {
                        LVersion.Minor = Int32.Parse(LNumbers[LIndex]);
                    }
                    break;

                case 2:
                    if (LNumbers[LIndex] != "*")
                    {
                        LVersion.Revision = Int32.Parse(LNumbers[LIndex]);
                    }
                    break;

                case 3:
                    if (LNumbers[LIndex] != "*")
                    {
                        LVersion.Build = Int32.Parse(LNumbers[LIndex]);
                    }
                    break;

                default: throw new ConveyorException(ConveyorException.Codes.InvalidStringArgument);
                }
            }
            return(LVersion);
        }
Example #2
0
 public override object InternalExecute(Program program, object[] arguments)
 {
     if (arguments[0] == null)
     {
         if (arguments[1] == null)
         {
             return(null);
         }
         else
         {
             return(arguments[1]);
         }
     }
     else if (arguments[1] == null)
     {
         return(arguments[0]);
     }
     else
     {
         VersionNumber tempValue = (VersionNumber)arguments[0];
         VersionNumber RValue    = (VersionNumber)arguments[1];
         return(tempValue < RValue ? tempValue : RValue);
     }
 }
Example #3
0
 public override object Read(byte[] buffer, int offset)
 {
     return(VersionNumber.Read(buffer, offset));
 }