Пример #1
0
        public override object GetValue(object obj)
        {
            var irc = obj as IRuntimeContextInstance;

            if (irc == null)
            {
                throw new ArgumentException();
            }

            return(ContextValuesMarshaller.ConvertReturnValue(irc.GetPropValue(_info.Index)));
        }
Пример #2
0
        public bool Read()
        {
            if (currentChar == -1)
            {
                return(false);
            }

            var c = (Char)currentChar;

            while (Char.IsWhiteSpace(c))
            {
                currentChar = reader.Read();
                if (currentChar == -1)
                {
                    return(false);
                }
                c = (Char)currentChar;
            }

            if (c == '{')
            {
                ElementType = ContextValuesMarshaller.ConvertReturnValue(BrackerNodeTypeEnum.StartElement);
                Value       = ValueFactory.Create();
                currentChar = reader.Read();
            }
            else if (c == '}')
            {
                ElementType = ContextValuesMarshaller.ConvertReturnValue(BrackerNodeTypeEnum.EndElement);
                Value       = ValueFactory.Create();
                currentChar = reader.Read();
            }
            else
            {
                ElementType = ContextValuesMarshaller.ConvertReturnValue(BrackerNodeTypeEnum.Value);
                Value       = ReadValue();
                if ((char)currentChar == ',')
                {
                    currentChar = reader.Read();
                }
            }

            return(true);
        }