public CReportFavoritesRoot(string aName, RsReportCollection aCollection) : base(aName, aCollection) { GUINode.ImageIndex = 2; GUINode.SelectedImageIndex = 2; GUINode.Text = RsViewEngine.Locale.GetTagText(RsLocalization.TAG_FAVORITES); }
public CReportRootFolder(string aName, RsReportCollection aCollection) : base(aName) { GUINode.ImageIndex = 3; GUINode.SelectedImageIndex = 3; SetCollection(aCollection); }
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; } }
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(); }
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; } }
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]); } } }
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; }
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; }
public static RsReportCollection CreateReportCollection(RsCollectionConfig aConfig) { RsReportCollection lResult = new RsReportCollection(); lResult.LoadFromXML(aConfig.Path); return lResult; }
protected override void SetCollection(RsReportCollection aCollection) { base.SetCollection(aCollection); foreach (object iItem in _SubItems) ((CReportItem)iItem).SetCollection(); }
public static void ExportCollection(RsReportCollection aCollection) { if (SaveCollectionDialog.ShowDialog() == DialogResult.OK) aCollection.ExportToXML(SaveCollectionDialog.FileName); }
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; } } }
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; }
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 static void CloseCollection(RsReportCollection aCollection) { CollectionManager.RemoveCollection(aCollection); aCollection.QuickSave(); aCollection.Release(); }
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); } }
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; }
protected virtual void SetCollection(RsReportCollection aCollection) { RsReportCollection lLastCollection = _Collection; _Collection = aCollection; edit(); if (lLastCollection != null) lLastCollection.setModified(true); }
public CReportFavoritesRoot(string aName, RsReportCollection aCollection) : base(aName, aCollection) { GUINode.ImageIndex = 2; GUINode.SelectedImageIndex = 2; GUINode.Text = RsViewEngine.Locale.GetTagText(RsLocalization.TAG_FAVORITES); }