public TimelineChangeManager() { _currentFrame = null; _frames = new List <TimelineFrame>(); timelineStorage.Initiate(); }
public TimelineChangeManager() { _currentFrame = null; _frames = new List<TimelineFrame>(); timelineStorage.Initiate(); }
public static TimelineFrame extractTimelineFrameFromXmlNode(XmlElement node) { TimelineFrame frame = new TimelineFrame(); frame.Id = Int32.Parse(node.Attributes["ID"].Value,CultureInfo.InvariantCulture); TimelineChange change = TimelineChange.extractTimelineChangeFromXmlNode((XmlElement)node.FirstChild); frame.Change = change; return frame; }
public void AddDUPLICATEChange(int refFrameID) { TimelineChange change = new TimelineChange(TypeOfChange.DUPLICATE, refFrameID, null); TimelineFrame frame = new TimelineFrame(); frame.Id = getNextFrameID(); frame.Change = change; AddFrame(frame); }
void AddFrame(TimelineFrame frame) { _frames.Add(frame); _currentFrame = frame; timelineStorage.saveFrame(frame); if (newTimelineFrameAddedEventHandler != null) { newTimelineFrameAddedEventHandler(frame); } }
public static TimelineFrame extractTimelineFrameFromXmlNode(XmlElement node) { TimelineFrame frame = new TimelineFrame(); frame.Id = Int32.Parse(node.Attributes["ID"].Value, CultureInfo.InvariantCulture); TimelineChange change = TimelineChange.extractTimelineChangeFromXmlNode((XmlElement)node.FirstChild); frame.Change = change; return(frame); }
public TimelineFrame retrieveFrameFromStorage(int frameID) { string queryPath = string.Format("//FRAME[@ID='{0}']", frameID); XmlElement node = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode(queryPath); if (node != null) { return(TimelineFrame.extractTimelineFrameFromXmlNode(node)); } return(null); }
public void AddUPDATEContentChange(int updatedNoteID, object newContent) { if (shouldAddDUPLICATEframe()) { AddDUPLICATEChange(_currentFrame.Id); } TimelineChange change = new TimelineChange(TypeOfChange.UPDATE, updatedNoteID, newContent); TimelineFrame frame = new TimelineFrame(); frame.Id = getNextFrameID(); frame.Change = change; AddFrame(frame); }
public void saveFrame(TimelineFrame frame) { try { XmlElement xmlNode = frame.toXML(xmlDoc.DocumentElement); xmlDoc.DocumentElement.AppendChild(xmlNode); xmlDoc.Save(currentFileName); } catch (Exception ex) { Utilities.UtilitiesLib.LogError(ex); } }
public void saveFrame(TimelineFrame frame) { try { XmlElement xmlNode = frame.toXML(xmlDoc.DocumentElement); xmlDoc.DocumentElement.AppendChild(xmlNode); xmlDoc.Save(currentFileName); } catch (Exception ex) { Utilities.UtilitiesLib.LogError(ex); } }
public void AddRESTOREChange(int restoredIdeaID) { if (shouldAddDUPLICATEframe()) { AddDUPLICATEChange(_currentFrame.Id); } TimelineChange change = new TimelineChange(TypeOfChange.RESTORE, restoredIdeaID, null); TimelineFrame frame = new TimelineFrame(); frame.Id = getNextFrameID(); frame.Change = change; AddFrame(frame); }
public void AddCOLORChange(int noteID, string colorCode) { if (shouldAddDUPLICATEframe()) { AddDUPLICATEChange(_currentFrame.Id); } TimelineChange change = new TimelineChange(TypeOfChange.COLOR, noteID, colorCode); TimelineFrame frame = new TimelineFrame(); frame.Id = getNextFrameID(); frame.Change = change; AddFrame(frame); }
public void AddDELETEChange(int deletedIdeaID) { if (shouldAddDUPLICATEframe()) { AddDUPLICATEChange(_currentFrame.Id); } TimelineChange change = new TimelineChange(TypeOfChange.DELETE, deletedIdeaID, null); TimelineFrame frame = new TimelineFrame(); frame.Id = getNextFrameID(); frame.Change = change; AddFrame(frame); }
public void AddADDChange(GenericIdeationObjects.IdeationUnit addedIdea) { if (shouldAddDUPLICATEframe()) { AddDUPLICATEChange(_currentFrame.Id); } TimelineChange change = new TimelineChange(TypeOfChange.ADD, addedIdea.Id, addedIdea.Content); TimelineFrame frame = new TimelineFrame(); frame.Id = getNextFrameID(); frame.Change = change; AddFrame(frame); }
public void AddUPDATEPositionChange(int updaptedNoteID, double newX, double newY) { if (shouldAddDUPLICATEframe()) { AddDUPLICATEChange(_currentFrame.Id); } System.Windows.Point newCenter = new System.Windows.Point(newX, newY); TimelineChange change = new TimelineChange(TypeOfChange.UPDATE, updaptedNoteID, newCenter); TimelineFrame frame = new TimelineFrame(); frame.Id = getNextFrameID(); frame.Change = change; AddFrame(frame); }
void JumpToFrame(int frameID) { TimelineFrame jumpTo = timelineStorage.retrieveFrameFromStorage(frameID); if (startEnumeratingEventHandler != null) { startEnumeratingEventHandler(); } foreach (TimelineFrame f in _frames) { if (_eventIntepreter != null) { _eventIntepreter.IntepretEvent(f.Change); } if (f.Id == jumpTo.Id) { break; } } }
public void SelectFrame(int frameID) { TimelineFrame selectedFrame = timelineStorage.retrieveFrameFromStorage(frameID); if (selectedFrame.Id == _currentFrame.Id) { return; } if (startEnumeratingEventHandler != null) { startEnumeratingEventHandler(); } foreach (TimelineFrame f in _frames) { if (f.Change.ChangeType == TypeOfChange.DUPLICATE) { JumpToFrame(f.Change.ChangedIdeaID); } else { if (_eventIntepreter != null) { _eventIntepreter.IntepretEvent(f.Change); } } if (f.Id == selectedFrame.Id) { break; } } if (finishEnumeratingEventHandler != null) { finishEnumeratingEventHandler(); } _currentFrame = selectedFrame; }