Ejemplo n.º 1
0
        static void AddFile(string file, string filter)
        {
            string           filter_name;
            VirtualDirection vdir = CheckVDir(filter);

            vdir.m_files.Add(file);
        }
Ejemplo n.º 2
0
        public static void CreateVS2008XmlNode(VirtualDirection vdir, XmlNode node, XmlDocument doc, Dictionary <string, List <XmlElement> > fileConfigs)
        {
            XmlElement   elem      = doc.CreateElement("Filter");
            XmlAttribute attr_elem = doc.CreateAttribute("Name");

            attr_elem.InnerText = vdir.m_name;
            elem.Attributes.Append(attr_elem);

            foreach (string file in vdir.m_files)
            {
                XmlElement   elem_file = doc.CreateElement("File");
                XmlAttribute attr      = doc.CreateAttribute("RelativePath");
                attr.InnerText = file;
                elem_file.Attributes.Append(attr);
                elem.AppendChild(elem_file);

                if (fileConfigs.ContainsKey(file))
                {
                    List <XmlElement> cfg = fileConfigs[file];
                    foreach (XmlElement cfgNode in cfg)
                    {
                        elem.AppendChild(cfgNode);
                    }
                }
            }
            node.AppendChild(elem);
            foreach (VirtualDirection sub in vdir.m_subs)
            {
                CreateVS2008XmlNode(sub, elem, doc, fileConfigs);
            }
        }
Ejemplo n.º 3
0
        public static void CreateVS2008XmlNode(VirtualDirection vdir, XmlNode node, XmlDocument doc, Dictionary<string, List<XmlElement>> fileConfigs)
        {
            XmlElement elem = doc.CreateElement("Filter");
            XmlAttribute attr_elem = doc.CreateAttribute("Name");
            attr_elem.InnerText = vdir.m_name;
            elem.Attributes.Append(attr_elem);

            foreach (string file in vdir.m_files)
            {
                XmlElement elem_file = doc.CreateElement("File");
                XmlAttribute attr = doc.CreateAttribute("RelativePath");
                attr.InnerText = file;
                elem_file.Attributes.Append(attr);
                elem.AppendChild(elem_file);

                if (fileConfigs.ContainsKey(file))
                {
                    List<XmlElement> cfg = fileConfigs[file];
                    foreach (XmlElement cfgNode in cfg)
                    {
                        elem.AppendChild(cfgNode);
                    }
                }

            }
            node.AppendChild(elem);
            foreach (VirtualDirection sub in vdir.m_subs)
            {
                CreateVS2008XmlNode(sub, elem, doc, fileConfigs);
            }
        }
Ejemplo n.º 4
0
        static VirtualDirection CheckVDir(string filter)
        {
            string[] filterPath = filter.Split('\\');
            List <VirtualDirection> beginList = ms_target;
            VirtualDirection        vdir      = null;

            foreach (string name in filterPath)
            {
                vdir      = _CheckVDir(name, beginList);
                beginList = vdir.m_subs;
            }
            return(vdir);
        }
Ejemplo n.º 5
0
        static VirtualDirection _CheckVDir(string name, List <VirtualDirection> vlist)
        {
            VirtualDirection vdir = vlist.Find(delegate(VirtualDirection bk)
            {
                return(bk.m_name == name);
            });

            if (vdir == null)
            {
                vdir        = new VirtualDirection();
                vdir.m_name = name;
                vlist.Add(vdir);
            }
            return(vdir);
        }
Ejemplo n.º 6
0
        public static void CreateCodeLiteXmlNode(VirtualDirection vdir, XmlNode node, XmlDocument doc)
        {
            XmlElement elem = doc.CreateElement("VirtualDirectory");
            XmlAttribute attr_elem = doc.CreateAttribute("Name");
            attr_elem.InnerText = vdir.m_name;
            elem.Attributes.Append(attr_elem);

            foreach (string file in vdir.m_files)
            {
                XmlElement elem_file = doc.CreateElement("File");
                XmlAttribute attr = doc.CreateAttribute("Name");
                attr.InnerText = file;
                elem_file.Attributes.Append(attr);
                elem.AppendChild(elem_file);
            }
            node.AppendChild(elem);
            foreach (VirtualDirection sub in vdir.m_subs)
            {
                CreateCodeLiteXmlNode(sub, elem, doc);
            }
        }
Ejemplo n.º 7
0
        public static void CreateCodeLiteXmlNode(VirtualDirection vdir, XmlNode node, XmlDocument doc)
        {
            XmlElement   elem      = doc.CreateElement("VirtualDirectory");
            XmlAttribute attr_elem = doc.CreateAttribute("Name");

            attr_elem.InnerText = vdir.m_name;
            elem.Attributes.Append(attr_elem);

            foreach (string file in vdir.m_files)
            {
                XmlElement   elem_file = doc.CreateElement("File");
                XmlAttribute attr      = doc.CreateAttribute("Name");
                attr.InnerText = file;
                elem_file.Attributes.Append(attr);
                elem.AppendChild(elem_file);
            }
            node.AppendChild(elem);
            foreach (VirtualDirection sub in vdir.m_subs)
            {
                CreateCodeLiteXmlNode(sub, elem, doc);
            }
        }
Ejemplo n.º 8
0
 static VirtualDirection _CheckVDir(string name, List<VirtualDirection> vlist)
 {
     VirtualDirection vdir = vlist.Find(delegate(VirtualDirection bk)
     {
         return bk.m_name == name;
     });
     if (vdir == null)
     {
         vdir = new VirtualDirection();
         vdir.m_name=name;
         vlist.Add(vdir);
     }
     return vdir;
 }