Пример #1
0
        public DataPortable MemoryGet(string tag)
        {
            if (this.hsh_DataSave[(object)tag] == null)
            {
                return(new DataPortable());
            }
            DataPortable dataPortable1 = this.hsh_DataSave[(object)tag] as DataPortable;
            DataPortable dataPortable2 = new DataPortable();
            string       buffer        = "";

            dataPortable1.ExportBuffer(ref buffer);
            dataPortable2.ImportBuffer(buffer);
            this.hsh_DataSave.Remove((object)tag);
            return(dataPortable2);
        }
Пример #2
0
        public void ImportBuffer(string buffer)
        {
            this.hsh_tagValue.Clear();
            this.lst_mapTags.Clear();
            this.lst_ctrlTags.Clear();
            int  num1       = buffer.Length - 1;
            int  startIndex = 1;
            int  index1     = 1;
            bool flag       = false;
            int  num2       = 0;

            while (++index1 <= num1)
            {
                if ((int)buffer[index1] == (int)this.char_tag_value || (int)buffer[index1] == (int)this.char_open_portable || (int)buffer[index1] == (int)this.char_close_portable)
                {
                    ++num2;
                    if (num2 == 2)
                    {
                        flag = true;
                        num2 = 0;
                    }
                }
                if (flag)
                {
                    flag = false;
                    string[] strArray = buffer.Substring(startIndex, index1 - startIndex).Split(this.char_tag_value);
                    if (strArray[1].Length == 0)
                    {
                        int       num3  = 1;
                        ArrayList array = new ArrayList();
                        for (int index2 = index1 + 1; index2 < num1; ++index2)
                        {
                            if ((int)buffer[index2] == (int)this.char_open_portable)
                            {
                                ++num3;
                            }
                            if ((int)buffer[index2] == (int)this.char_close_portable)
                            {
                                --num3;
                            }
                            if (num3 == 1)
                            {
                                int          length       = index2 - index1;
                                string       buffer1      = buffer.Substring(index1 + 1, length);
                                DataPortable dataPortable = new DataPortable();
                                array.Add((object)dataPortable);
                                dataPortable.ImportBuffer(buffer1);
                                index1 += length;
                            }
                        }
                        this.MapTagArray(strArray[0], ref array);
                        index1    += 3;
                        startIndex = index1;
                    }
                    else
                    {
                        this.MapTagValue(strArray[0], strArray[1].Replace(this.str_field_sep, ""));
                        startIndex += index1 - startIndex + 1;
                    }
                }
            }
        }