internal void LoadDayExtra(string fullPath) { FileStream fileStream = FileUtils.OpenForRead(fullPath); if (fileStream != null) { try { XmlSerializer ser = new XmlSerializer(typeof(DayExtra), Data.NamespaceURI); using (StreamReader reader = new StreamReader(fileStream)) { //XmlNamespaceUpgradeReader upg = new XmlNamespaceUpgradeReader(reader, "", Data.NamespaceURI); DayExtra e = (DayExtra)ser.Deserialize(reader); this._comments = e.Comments; this._trackings = e.Trackings; } } catch (Exception e) { ErrorTrace.Trace(TraceLevel.Error, e); } finally { fileStream.Close(); } //RepairComments(); } }
internal void LoadDayExtra(string fullPath) { FileStream fileStream = FileUtils.OpenForRead(fullPath); if (fileStream != null) { try { XmlSerializer ser = new XmlSerializer(typeof(DayExtraOld), "urn:newtelligence-com:dasblog:runtime:data"); using (StreamReader reader = new StreamReader(fileStream)) { //TODO: SDH: We need to have a better namespace upgrading solution for Medium Trust for folks with the OLD XML format //XmlNamespaceUpgradeReader upg = new XmlNamespaceUpgradeReader(reader, "", "urn:newtelligence-com:dasblog:runtime:data"); DayExtraOld e = (DayExtraOld)ser.Deserialize(reader); this._date = e.DateLocalTime; this._comments = e.Comments; this._trackings = e.Trackings; } } catch (Exception e) { ErrorTrace.Trace(TraceLevel.Error, e); } finally { fileStream.Close(); } } }
internal TrackingCollection GetTrackingsFor(string entryId, DataManager data) { Load(data); TrackingCollection filtered = new TrackingCollection(); foreach (Tracking c in Trackings) { if (c.TargetEntryId.ToUpper() == entryId.ToUpper()) { filtered.Add(c); } } return(filtered); }
/// <summary> /// Creates a shallow copy of the <see cref="TrackingCollection"/>. /// </summary> /// <returns>A shallow copy of the <see cref="TrackingCollection"/>.</returns> /// <remarks>Please refer to <see cref="ICloneable.Clone"/> for details.</remarks> public virtual object Clone() { TrackingCollection collection = new TrackingCollection(this.ToArray()); return(collection); }