Пример #1
0
        public TimelineChangeManager()
        {
            _currentFrame = null;
            _frames       = new List <TimelineFrame>();

            timelineStorage.Initiate();
        }
Пример #2
0
        public TimelineChangeManager()
        {
            _currentFrame = null;
            _frames = new List<TimelineFrame>();

            timelineStorage.Initiate();
        }
Пример #3
0
 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;
 }
Пример #4
0
        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);
        }
Пример #5
0
 void AddFrame(TimelineFrame frame)
 {
     _frames.Add(frame);
     _currentFrame = frame;
     timelineStorage.saveFrame(frame);
     if (newTimelineFrameAddedEventHandler != null)
     {
         newTimelineFrameAddedEventHandler(frame);
     }
 }
Пример #6
0
        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);
        }
Пример #7
0
        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);
        }
Пример #8
0
        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);
        }
Пример #9
0
 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);
     }
 }
Пример #10
0
 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);
     }
 }
Пример #11
0
        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);
        }
Пример #12
0
        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);
        }
Пример #13
0
        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);
        }
Пример #14
0
        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);
        }
Пример #15
0
        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);
        }
Пример #16
0
        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;
                }
            }
        }
Пример #17
0
        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;
        }