Пример #1
0
 public CReportFavoritesRoot(string aName, RsReportCollection aCollection)
     : base(aName, aCollection)
 {
     GUINode.ImageIndex = 2;
     GUINode.SelectedImageIndex = 2;
     GUINode.Text = RsViewEngine.Locale.GetTagText(RsLocalization.TAG_FAVORITES);
 }
Пример #2
0
        public CReportRootFolder(string aName, RsReportCollection aCollection)
            : base(aName)
        {
            GUINode.ImageIndex = 3;
                        GUINode.SelectedImageIndex = 3;

                        SetCollection(aCollection);
        }
Пример #3
0
 protected override void SetCollection(RsReportCollection aCollection)
 {
     base.SetCollection(aCollection);
     foreach (object iItem in _SubItems)
     {
         ((CReportItem)iItem).SetCollection();
     }
 }
 public RsReportCollectionProvider(string aCollectionFile) : base()
 {
     try {
         ReportCollection = new RsReportCollection();
         ReportCollection.LoadFromXML(aCollectionFile);
     } catch {
         ReportCollection = null;
     }
 }
Пример #5
0
        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();
        }
Пример #6
0
        protected virtual void SetCollection(RsReportCollection aCollection)
        {
            RsReportCollection lLastCollection = _Collection;

            _Collection = aCollection;
            edit();
            if (lLastCollection != null)
            {
                lLastCollection.setModified(true);
            }
        }
        public RsReportCollectionProvider(string aCollectionFile)
            : base()
        {
            try {
                                ReportCollection = new RsReportCollection();
                                ReportCollection.LoadFromXML(aCollectionFile);

                            } catch {
                                ReportCollection = null;

                            }
        }
Пример #8
0
 public void BuildFromXML(XmlNode aSource)
 {
     this.ItemName = aSource.Attributes["name"].Value;
     for (int i = 0; i < aSource.ChildNodes.Count; i++)
     {
         CReportItem lNewItem = RsReportCollection.CreateItemFromXMLNode(aSource.ChildNodes[i]);
         lNewItem.Parent = this;
         if (lNewItem is CReportFolder)
         {
             ((CReportFolder)lNewItem).BuildFromXML(aSource.ChildNodes[i]);
         }
     }
 }
Пример #9
0
        public RsReportCollection CreateCollection(string aCollectionName, string aFile)
        {
            // TODO Create a method to handle more than one collection with the same name

                        RsReportCollection lResult;

                        RsReportCollection lCollection = GetCollection(aCollectionName);
                        if (lCollection != null)
                                throw new Exception("Collection named \"" + aCollectionName + "\" already linked.");

                            else {
                                lResult = new RsReportCollection();
                                lResult.CollectionName = aCollectionName;
                                lResult.SaveToXML(aFile);
                                AddCollection(lResult);
                            }

                        return lResult;
        }
Пример #10
0
        public static bool SaveCollection(RsReportCollection aCollection)
        {
            if (aCollection.FileName == "")
            {
                bool lNoSave = false;

                while (RsViewEngine._dlgSaveCollection.ShowDialog() != DialogResult.OK)
                {
                    if (CRSMessageBox.ShowBox(
                                RsViewEngine.Locale.GetMessage("collectionmustsave"),
                                RsViewEngine.Locale.GetMessageTitle("collectionmustsave"),
                                MessageBoxButtons.OKCancel,
                                MessageBoxIcon.Asterisk
                        ) == DialogResult.Cancel)
                    {
                        lNoSave = true;
                        break;
                    }
                }

                if (!lNoSave)
                    aCollection.SaveToXML(RsViewEngine._dlgSaveCollection.FileName);
                else
                {
                    RsViewEngine.CloseCollection(aCollection);
                    return false;
                }
            }
            else
                aCollection.QuickSave();

            return true;
        }
Пример #11
0
 public static RsReportCollection CreateReportCollection(RsCollectionConfig aConfig)
 {
     RsReportCollection lResult = new RsReportCollection();
                 lResult.LoadFromXML(aConfig.Path);
                 return lResult;
 }
Пример #12
0
 protected override void SetCollection(RsReportCollection aCollection)
 {
     base.SetCollection(aCollection);
     foreach (object iItem in _SubItems)
         ((CReportItem)iItem).SetCollection();
 }
Пример #13
0
 public static void ExportCollection(RsReportCollection aCollection)
 {
     if (SaveCollectionDialog.ShowDialog() == DialogResult.OK)
         aCollection.ExportToXML(SaveCollectionDialog.FileName);
 }
Пример #14
0
 public void RemoveCollection(RsReportCollection aCollection)
 {
     foreach (RsCollectionConfig iConfig in ProfileManager.Profile.Collections) {
                         if (aCollection.FileName.ToUpper().Equals(iConfig.Path.ToUpper())) {
                                 ProfileManager.Profile.Collections.Remove(iConfig);
                                 break;
                             }
                     }
 }
Пример #15
0
        public static RsReportCollection ImportCollection()
        {
            if (OpenCollectionDialog.ShowDialog() == DialogResult.OK)
            {
                RsReportCollection lResult = new RsReportCollection();
                lResult.LoadFromXML(OpenCollectionDialog.FileName);

                RsViewEngine.CollectionManager.AddCollection(lResult);
                return lResult;

            }
            else
                return null;
        }
Пример #16
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);
        }
Пример #17
0
 public static void CloseCollection(RsReportCollection aCollection)
 {
     CollectionManager.RemoveCollection(aCollection);
     aCollection.QuickSave();
     aCollection.Release();
 }
Пример #18
0
        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);
            }
        }
Пример #19
0
        public RsReportCollection GetCollection(string aCollectionName)
        {
            foreach (RsCollectionConfig iConfig in ProfileManager.Profile.Collections) {
                                if (iConfig.Name.ToUpper().Equals(aCollectionName.ToUpper())) {
                                        RsReportCollection lResult = new RsReportCollection();
                                        lResult.LoadFromXML(iConfig.Path);
                                        return lResult;
                                    }
                            }

                        return null;
        }
Пример #20
0
 protected virtual void SetCollection(RsReportCollection aCollection)
 {
     RsReportCollection lLastCollection = _Collection;
     _Collection = aCollection;
     edit();
     if (lLastCollection != null)
         lLastCollection.setModified(true);
 }
Пример #21
0
 public CReportFavoritesRoot(string aName, RsReportCollection aCollection) : base(aName, aCollection)
 {
     GUINode.ImageIndex         = 2;
     GUINode.SelectedImageIndex = 2;
     GUINode.Text = RsViewEngine.Locale.GetTagText(RsLocalization.TAG_FAVORITES);
 }