Exemplo n.º 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);
 }
Exemplo n.º 2
0
        public CReportRootFolder(string aName, RsReportCollection aCollection)
            : base(aName)
        {
            GUINode.ImageIndex = 3;
                        GUINode.SelectedImageIndex = 3;

                        SetCollection(aCollection);
        }
Exemplo n.º 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;
     }
 }
Exemplo n.º 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();
        }
Exemplo n.º 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;

                            }
        }
Exemplo n.º 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]);
         }
     }
 }
Exemplo n.º 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;
        }
Exemplo n.º 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;
        }
Exemplo n.º 11
0
 public static RsReportCollection CreateReportCollection(RsCollectionConfig aConfig)
 {
     RsReportCollection lResult = new RsReportCollection();
                 lResult.LoadFromXML(aConfig.Path);
                 return lResult;
 }
Exemplo n.º 12
0
 protected override void SetCollection(RsReportCollection aCollection)
 {
     base.SetCollection(aCollection);
     foreach (object iItem in _SubItems)
         ((CReportItem)iItem).SetCollection();
 }
Exemplo n.º 13
0
 public static void ExportCollection(RsReportCollection aCollection)
 {
     if (SaveCollectionDialog.ShowDialog() == DialogResult.OK)
         aCollection.ExportToXML(SaveCollectionDialog.FileName);
 }
Exemplo n.º 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;
                             }
                     }
 }
Exemplo n.º 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;
        }
Exemplo n.º 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);
        }
Exemplo n.º 17
0
 public static void CloseCollection(RsReportCollection aCollection)
 {
     CollectionManager.RemoveCollection(aCollection);
     aCollection.QuickSave();
     aCollection.Release();
 }
Exemplo n.º 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);
            }
        }
Exemplo n.º 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;
        }
Exemplo n.º 20
0
 protected virtual void SetCollection(RsReportCollection aCollection)
 {
     RsReportCollection lLastCollection = _Collection;
     _Collection = aCollection;
     edit();
     if (lLastCollection != null)
         lLastCollection.setModified(true);
 }
Exemplo n.º 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);
 }