Example #1
0
        private void CreateContainerViewModel(WasteContainer newItem)
        {
            var cvm = m_ContainerViewModelFactory.CreateFromExisiting(newItem);

            cvm.PropertyChanged += ContainerPropertyChanged;
            m_Container.Add(cvm);
        }
Example #2
0
        private WasteCollection GenerateWasteCollection(Disposer disposer, WasteContainer wasteContainer)
        {
            var wasteCollection = new WasteCollection();

            wasteCollection.Disposer       = disposer;
            wasteCollection.Container      = wasteContainer;
            wasteCollection.GenerationDate = DateTime.Now;

            return(wasteCollection);
        }
Example #3
0
        private WasteContainer CreateNewContainerModel(MapViewModel selectedMap)
        {
            var position = new MapPosition
            {
                XPosition = 0,
                YPosition = 0
            };

            if (selectedMap != null)
            {
                position.Map = selectedMap.Model;
            }
            var container = new WasteContainer
            {
                MapPosition = position
            };

            return(container);
        }
Example #4
0
        public ContainerViewModel(WasteContainer model, IAvvWasteTypeProvider avvWasteTypeProvider)
        {
            m_Model = model;
            m_Model.PropertyChanged              += ModelPropertyChanged;
            m_Model.MapPosition.PropertyChanged  += PositionChanged;
            m_Model.WasteTypes.CollectionChanged += WasteTypesOnCollectionChanged;
            DisplayName            = TranslationProvider.Translate("EditContainer");
            m_AvvWasteTypeProvider = avvWasteTypeProvider;
            SelectedAvvWasteTypes  = new ObservableCollection <AvvWasteType>();
            if (m_AvvWasteTypeProvider.AvvWasteTypes != null)
            {
                SetSelectedAvvWasteType();
            }
            else
            {
                m_AvvWasteTypeProvider.Loaded += (s, e) => SetSelectedAvvWasteType();
            }

            m_ContainerPosition = new MapItemViewModel(model.Name, new Point(model.MapPosition.XPosition, model.MapPosition.YPosition), false);
        }
Example #5
0
        public IEnumerable <FillLevelReading> GenerateFillLevelReadings(WasteContainer container, ResponsibleSubject responsibleSubject, Series series, DayOfWeek[] weekDays)
        {
            var taskGeneratorConfig = new TaskGeneratorConfig();

            taskGeneratorConfig.Container          = container;
            taskGeneratorConfig.Series             = series;
            taskGeneratorConfig.ResponsibleSubject = responsibleSubject;
            taskGeneratorConfig.WeekDays           = weekDays;

            taskGeneratorConfig.Begin               = series.Begin;
            taskGeneratorConfig.End                 = series.End;
            taskGeneratorConfig.Repeat              = series.Repeat;
            taskGeneratorConfig.RecurrenceInterval  = series.RecurrenceInterval;
            taskGeneratorConfig.EndsWithDate        = series.EndsWithDate;
            taskGeneratorConfig.RepeatUntilDate     = series.RepeatUntilDate;
            taskGeneratorConfig.NumberOfRecurrences = series.NumberOfRecurrences;
            taskGeneratorConfig.IsWeekdayRecurrence = series.IsWeekdayRecurrence;
            taskGeneratorConfig.IsAllDay            = series.IsAllDay;
            taskGeneratorConfig.Cycle               = series.Cycle;

            return(GenerateFillLevelReadings(taskGeneratorConfig));
        }
Example #6
0
 public ContainerAddViewModel(WasteContainer model, IAvvWasteTypeProvider avvWasteTypeProvider)
     : base(model, avvWasteTypeProvider)
 {
     DisplayName = TranslationProvider.Translate("TitleContainerAddViewModel");
     m_Model     = model;
 }
Example #7
0
 private FillLevelReading CreateFillLevelReading(DateTime begin, DateTime end, bool isAllDay, WasteContainer container, ResponsibleSubject responsibleSubject, Series relatedSeries)
 {
     return(new FillLevelReading
     {
         DueDate = new Appointment
         {
             Begin = begin,
             End = end,
             IsAllDay = isAllDay
         },
         RelatedSeries = relatedSeries,
         AppointmentResponsibleSubject = responsibleSubject,
         ReadingContainer = container
     });
 }
 public WasteCollectionContainerViewModel CreateWasteCollectionContainerViewModel(WasteContainer model)
 {
     return(new WasteCollectionContainerViewModel(m_ContainerViewModelFactory.CreateFromExisiting(model), false, m_WasteRepository));
 }
Example #9
0
 private RelatedElementViewModel CreateRelatedElementViewModel(WasteContainer element)
 {
     return(new RelatedElementViewModel(element, string.Format("{0} ({1})", element.Name, element.Barcode)));
 }
 public ContainerEditViewModel(WasteContainer model, Action removeContainerAction, IAvvWasteTypeProvider avvWasteTypeProvider)
     : base(model, avvWasteTypeProvider)
 {
     m_RemoveContainer = removeContainerAction;
     DisplayName       = TranslationProvider.Translate("TitleContainerEditViewModel");
 }
Example #11
0
 public ContainerViewModel CreateFromExisiting(WasteContainer container)
 {
     return(new ContainerViewModel(container, m_AvvWasteTypeProvider));
 }
Example #12
0
 public ContainerEditViewModel CreateEditViewModel(WasteContainer model, Action removeContainerAction)
 {
     return(new ContainerEditViewModel(model, removeContainerAction, m_AvvWasteTypeProvider));
 }