Ejemplo n.º 1
0
        public static void addAddons(VCProject vcproject, String ofRoot, IEnumerable <String> addons)
        {
            VCFilter addonsFolder = null;

            try {
                addonsFolder = vcproject.AddFilter("addons");
            }catch (Exception e)
            {
                IVCCollection filters = vcproject.Filters;
                foreach (var filter in filters)
                {
                    if (filter is VCFilter)
                    {
                        if (((VCFilter)filter).Name == "addons")
                        {
                            addonsFolder = ((VCFilter)filter);
                            break;
                        }
                    }
                }
            }
            if (addonsFolder != null)
            {
                foreach (var addon in addons)
                {
                    VCFilter addonFolder = addonsFolder.AddFilter(addon);
                    var      addonObj    = new Addon(ofRoot, addon, vcproject.ProjectDirectory);

                    addonObj.addFilesToVCFilter(addonFolder);
                    addonObj.addIncludePathsToVCProject(vcproject);
                    addonObj.addLibsToVCProject(vcproject);
                }
                vcproject.Save();
            }
            else
            {
                throw new Exception("Couldn't create or find addonsFolder");
            }
        }
Ejemplo n.º 2
0
        public static void addAddons(VCProject vcproject, String ofRoot, IEnumerable<String> addons)
        {
            VCFilter addonsFolder = null;
            try {
                addonsFolder = vcproject.AddFilter("addons");
            }catch(Exception e)
            {
                IVCCollection filters = vcproject.Filters;
                foreach(var filter in filters)
                {
                    if(filter is VCFilter)
                    {
                        if(((VCFilter)filter).Name == "addons")
                        {
                            addonsFolder = ((VCFilter)filter);
                            break;
                        }
                    }
                }
            }
            if (addonsFolder != null)
            {
                foreach (var addon in addons)
                {
                    VCFilter addonFolder = addonsFolder.AddFilter(addon);
                    var addonObj = new Addon(ofRoot, addon, vcproject.ProjectDirectory);

                    addonObj.addFilesToVCFilter(addonFolder);
                    addonObj.addIncludePathsToVCProject(vcproject);
                    addonObj.addLibsToVCProject(vcproject);
                }
                vcproject.Save();
            }
            else
            {
                throw new Exception("Couldn't create or find addonsFolder");
            }
        }