예제 #1
0
    protected string GetValueByCol(ResourceObject current_object, string col_name)
    {
        col_name = col_name.ToLower();
        if (!current_object.ContainsKey(col_name))
        {
            return("");
        }

        return(ParseString2Mem(current_object.GetPropertyValue(col_name)));
    }
예제 #2
0
    protected bool GetNextLine(ResourceObject current_object)
    {
        if (stream_reader.EndOfStream)
        {
            return(false);
        }

        string line = GetNextLine();

        if (line == null)
        {
            return(false);
        }

        if (crypto)
        {
            line = dc.Decrypto(line);
        }

        current_object.Clear();

        int index = 0;

        string[] property = line.Split('\t');
        while (index < (property.Length - 1))
        {
            string name = property[index++].ToLower();
            if (string.IsNullOrEmpty(name))
            {
                break;
            }

            string value = property[index++];
            if (current_object.ContainsKey(name))
            {
                throw (new Exception(string.Format("数据有错,有相同属性: name={0}, line={1}", name, line)));
            }

            current_object.AddProperty(name, value);
        }

        return(true);
    }