Exemplo n.º 1
0
        private string Dump()
        {
            StringBuilder stringBuilder = new StringBuilder(Convert.ToString(DefaultObjectDumpFormatter.TOKEN_INDENT_OPEN));

            for (int i = 0; i < this.dataHolder.Count; i++)
            {
                AWDataWrapper sFSDataWrapper = this.dataHolder[i];
                int           type           = sFSDataWrapper.Type;
                string        value;
                if (type == 18)
                {
                    value = (sFSDataWrapper.Data as AWObject).GetDump(false);
                }
                else
                {
                    if (type == 17)
                    {
                        value = (sFSDataWrapper.Data as AWArray).GetDump(false);
                    }
                    else
                    {
                        if (type == 0)
                        {
                            value = "NULL";
                        }
                        else
                        {
                            if (type > 8 && type < 19)
                            {
                                value = "[" + sFSDataWrapper.Data + "]";
                            }
                            else
                            {
                                value = sFSDataWrapper.Data.ToString();
                            }
                        }
                    }
                }
                stringBuilder.Append("(" + ((AWDataType)type).ToString().ToLower() + ") ");
                stringBuilder.Append(value);
                stringBuilder.Append(Convert.ToString(DefaultObjectDumpFormatter.TOKEN_DIVIDER));
            }
            string text = stringBuilder.ToString();

            if (this.Size() > 0)
            {
                text = text.Substring(0, text.Length - 1);
            }
            return(text + Convert.ToString(DefaultObjectDumpFormatter.TOKEN_INDENT_CLOSE));
        }
Exemplo n.º 2
0
        public T GetValue <T>(int index)
        {
            T result;

            if (index >= this.dataHolder.Count)
            {
                result = default(T);
            }
            else
            {
                AWDataWrapper sFSDataWrapper = this.dataHolder[index];
                result = (T)((object)sFSDataWrapper.Data);
            }
            return(result);
        }
Exemplo n.º 3
0
        public bool IsNull(int index)
        {
            bool result;

            if (index >= this.dataHolder.Count)
            {
                result = true;
            }
            else
            {
                AWDataWrapper sFSDataWrapper = this.dataHolder[index];
                result = (sFSDataWrapper.Type == 0);
            }
            return(result);
        }
Exemplo n.º 4
0
        public object GetClass(string key)
        {
            AWDataWrapper sFSDataWrapper = this.dataHolder[key];
            object        result;

            if (sFSDataWrapper != null)
            {
                result = sFSDataWrapper.Data;
            }
            else
            {
                result = null;
            }
            return(result);
        }
Exemplo n.º 5
0
        public object RemoveElementAt(int index)
        {
            object result;

            if (index >= this.dataHolder.Count)
            {
                result = null;
            }
            else
            {
                AWDataWrapper sFSDataWrapper = this.dataHolder[index];
                this.dataHolder.RemoveAt(index);
                result = sFSDataWrapper.Data;
            }
            return(result);
        }
Exemplo n.º 6
0
        private string Dump()
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append(Convert.ToString(DefaultObjectDumpFormatter.TOKEN_INDENT_OPEN));
            foreach (KeyValuePair <string, AWDataWrapper> current in this.dataHolder)
            {
                AWDataWrapper value = current.Value;
                string        key   = current.Key;
                int           type  = value.Type;
                stringBuilder.Append("(" + ((AWDataType)type).ToString().ToLower() + ")");
                stringBuilder.Append(" " + key + ": ");
                if (type == 18)
                {
                    stringBuilder.Append((value.Data as AWObject).GetDump(false));
                }
                else
                {
                    if (type == 17)
                    {
                        stringBuilder.Append((value.Data as AWArray).GetDump(false));
                    }
                    else
                    {
                        if (type > 8 && type < 19)
                        {
                            stringBuilder.Append("[" + value.Data + "]");
                        }
                        else
                        {
                            stringBuilder.Append(value.Data);
                        }
                    }
                }
                stringBuilder.Append(DefaultObjectDumpFormatter.TOKEN_DIVIDER);
            }
            string text = stringBuilder.ToString();

            if (this.Size() > 0)
            {
                text = text.Substring(0, text.Length - 1);
            }
            return(text + DefaultObjectDumpFormatter.TOKEN_INDENT_CLOSE);
        }
Exemplo n.º 7
0
        public object GetClass(int index)
        {
            AWDataWrapper sFSDataWrapper = this.dataHolder[index];

            return((sFSDataWrapper == null) ? null : sFSDataWrapper.Data);
        }
Exemplo n.º 8
0
 public void Add(AWDataWrapper wrappedObject)
 {
     this.dataHolder.Add(wrappedObject);
 }
Exemplo n.º 9
0
 public void Put(string key, AWDataWrapper val)
 {
     this.dataHolder[key] = val;
 }