Example #1
0
        //C++ TO C# CONVERTER WARNING: The original C++ declaration of the following method implementation was not found:
        //ORIGINAL LINE: void TokenData::SetType(int t)


        public void SetType(TokenData.TokenDataType t)
        {
            if (type == t)
            {
                return;
            }

            switch (t)
            {
            case TokenDataType.STR:
                str  = GetStr();
                type = t;
                break;

            case TokenDataType.NUM:
                num  = GetNum();
                type = t;
                break;

            case TokenDataType.FLOAT:
                Set(GetFloat());
                type = t;
                break;

            case TokenDataType.DOUBLE:
                Set(GetDouble());
                type = t;
                break;
            }
        }
Example #2
0
 /// <summary>
 /// Initialize the Token Item and set the name, type, and data type
 /// </summary>
 /// <param name="TokenName"></param>
 /// <param name="TokenType"></param>
 /// <param name="TokenDataType"></param>
 public TokenItem(string TokenName, TokenType TokenType, TokenDataType TokenDataType, bool InOperandFunction)
 {
     tokenName         = TokenName;
     tokenType         = TokenType;
     tokenDataType     = TokenDataType;
     inOperandFunction = InOperandFunction;
 }
Example #3
0
        private bool willBeAssigned = false; // Indicates if this token item is in an assignment

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Initialize the Token Item and set the name and token type
        /// </summary>
        /// <param name="TokenName"></param>
        /// <param name="TokenType"></param>
        public TokenItem(string TokenName, TokenType TokenType, bool InOperandFunction)
        {
            tokenName = TokenName;
            tokenType = TokenType;
            tokenDataType = TokenDataType.Token_DataType_None;
            inOperandFunction = InOperandFunction;
        }
 public BasicTokenData(string name, string label, string placeholder, bool required, TokenDataType type)
 {
     Name = name;
     Label = label;
     Placeholder = placeholder;
     Required = required;
     Type = type;
 }
Example #5
0
 public void Set(string s)
 {
     if (s == null)
     {
         str  = "";
         type = TokenDataType.STR;
     }
     else
     {
         str  = s;
         type = TokenDataType.STR;
     }
 }
Example #6
0
 public void Set(double d)
 {
     str  = string.Format("{0:f}", d);
     type = TokenDataType.NUM;
 }
Example #7
0
 public void Set(float f)
 {
     str  = string.Format("{0:f}", f);
     type = TokenDataType.NUM;
 }
Example #8
0
 public void Set(bool n)
 {
     num  = n ? 1 : 0;
     type = TokenDataType.NUM;
 }
Example #9
0
 public void Set(int n)
 {
     num  = n;
     type = TokenDataType.NUM;
 }