示例#1
0
    public void add(string url, List <string> depAssetGuid)
    {
        ABDepInfo info = new ABDepInfo();

        info._url          = url;
        info._depAssetGuid = depAssetGuid;
        _ABDepDic[url]     = info;
    }
示例#2
0
    public bool read(string filename)
    {
        if (File.Exists(filename) == false)
        {
            return(false);
        }
        _ABDepDic.Clear();
        XmlDocument xmldoc = new XmlDocument();

        xmldoc.Load(filename);
        XmlNode rootElement = xmldoc.SelectSingleNode("ABDepInfo");

        if (rootElement == null)
        {
            return(false);
        }
        XmlNodeList nodeList = rootElement.ChildNodes;

        foreach (XmlNode xn in nodeList)
        {
            ABDepInfo depInfoUnit = new ABDepInfo();
            foreach (XmlAttribute attr in xn.Attributes)
            {
                if (attr.Name.Equals("url"))
                {
                    depInfoUnit._url = attr.Value;
                }
            }
            XmlNodeList xnChildNodeList = xn.ChildNodes;
            foreach (XmlNode xnChild in xnChildNodeList)
            {
                foreach (XmlAttribute attr in xnChild.Attributes)
                {
                    if (attr.Name.Equals("guid"))
                    {
                        depInfoUnit._depAssetGuid.Add(attr.Value);
                    }
                }
            }

            _ABDepDic.Add(depInfoUnit._url, depInfoUnit);
        }
        return(true);
    }
示例#3
0
 public bool tryGetValue(string url, out ABDepInfo abDepInfo)
 {
     return(_ABDepDic.TryGetValue(url, out abDepInfo));
 }
示例#4
0
 public void add(ABDepInfo info)
 {
     _ABDepDic[info._url] = info;
 }