Example #1
0
        private void Add(TimeLineItemViewModel timeLineItem)
        {
            // Add to list
            TimeLineItems.Add(timeLineItem);

            // Serialize added item
            timeLineItem.SerializationDirectory = _serializationDir;
            timeLineItem.ShouldAutoSerialize    = true;
            timeLineItem.SerializeConfigurations(null, null);
        }
Example #2
0
        private void Delete(TimeLineItemViewModel timeLineItem)
        {
            // Remove from memory
            TimeLineItems.Remove(timeLineItem);

            // Remove from disk
            var pathToRemove = Path.Combine(_serializationDir,
                                            timeLineItem.Name + ".xml");

            if (File.Exists(pathToRemove))
            {
                File.Delete(pathToRemove);
            }
        }
Example #3
0
        public void AddTimeLineItem(string comment)
        {
            var newItem = new TimeLineItemViewModel()
            {
                Comment   = comment, ProductType = ApplicationViewModel.Instance.CurrentProductType,
                StartTime = DateTime.Now
            };

            Add(newItem);
            // Delete outdated timelines
            DeleteOutdatedItems();

            ShouldDialogOpen = false;
        }