public void AddCollection(RsReportCollection aCollection)
        {
            RsCollectionConfig lConfig = new RsCollectionConfig();
                        lConfig.Path = aCollection.FileName;
                        lConfig.Name = aCollection.CollectionName;
                        lConfig.Type = RsCollectionType.Custom;

                        ProfileManager.Profile.Collections.Add(lConfig);
                        ProfileManager.SaveProfile();
        }
 public static RsReportCollection CreateReportCollection(RsCollectionConfig aConfig)
 {
     RsReportCollection lResult = new RsReportCollection();
                 lResult.LoadFromXML(aConfig.Path);
                 return lResult;
 }
        protected void InitializeCollections()
        {
            RsCollectionConfig lFavCfg = new RsCollectionConfig();
            lFavCfg.Type = RsCollectionType.Favorites;
            lFavCfg.Path = FavoritesFile;
            lFavCfg.Name = "favorites";
            Profile.Collections.Add(lFavCfg);

            if (!lFavCfg.IsCollectionExists())
            {
                RsReportCollection lCollection = new RsReportCollection();
                lCollection.CollectionName = "favorites";
                lCollection.SaveToXML(lFavCfg.Path);
            }
        }
Example #4
0
        public static void UpdateProfile(string aProfile)
        {
            List<RsCollectionConfig> lNewList = new List<RsCollectionConfig>();
                        XmlDocument lDoc = new XmlDocument();
                        lDoc.Load(aProfile);

                        XmlNode lRoot = XmlTools.GetNode(lDoc, "ReportSmartSettings");
                        if (lRoot == null) return;

                        XmlNode lNode = XmlTools.GetNode(lRoot, "collections");
                        if (lNode != null && lNode.ChildNodes != null) {
                                foreach (XmlNode iNode in lNode.ChildNodes) {
                                        RsCollectionConfig iConfig = new RsCollectionConfig();
                                        iConfig.Path = XmlTools.GetAttrib(iNode, "path");
                                        iConfig.Type = iNode.Name == "favorites" ? RsCollectionType.Favorites : RsCollectionType.Custom;

                                        lNewList.Add(iConfig);
                                    }
                            }

                        lNode.RemoveAll();
                        lRoot.RemoveChild(lNode);

                        lNode = XmlTools.CreateXmlNode(lDoc, "Collections", lRoot);

                        foreach (RsCollectionConfig iConfig in lNewList) {
                                RsReportCollection iCollection = new RsReportCollection();
                                iCollection.LoadFromXML(iConfig.Path);
                                XmlNode iNode = XmlTools.CreateXmlNode(lDoc, "collection", lNode);
                                XmlTools.SetAttrib(iNode, "path", iConfig.Path);
                                XmlTools.SetAttrib(iNode, "type", iConfig.Type.ToString());
                                XmlTools.SetAttrib(iNode, "name", iCollection.CollectionName);

                            }

                        XmlTools.SetAttrib(lRoot, "configVersion", "1");
                        lDoc.Save(aProfile);
        }
        public void RegisterCollections(List<string> aPathList)
        {
            foreach (RsCollectionConfig iConfig in Profile.Collections)
            {
                if (iConfig.Type == RsCollectionType.Custom)
                    Profile.Collections.Remove(iConfig);
            }

            foreach (string iPath in aPathList)
            {
                RsCollectionConfig lCfg = new RsCollectionConfig();
                lCfg.Path = iPath;
                Profile.Collections.Add(lCfg);
            }
        }