/// <summary>
 /// Raises the SubPropertyChanged event.
 /// </summary>
 /// <param name="e">Event arguments</param>
 protected virtual void OnSubPropertyChanged(SubPropertyChangedEventArgs e)
 {
     SubPropertyChangedEventHandler eh = SubPropertyChanged;
     if (eh != null) eh(this, e);
 }
        /// <summary>
        /// Handles ModelSubProperty change notifications
        /// </summary>
        /// <param name="sender">object</param>
        /// <param name="e">SubPropertyChangedEventArgs</param>
        private void ModelSubPropertyChanged(object sender, SubPropertyChangedEventArgs e)
        {
            if (e.Source is WorkDay)
            {
                UpdateWorkDayDetails();
            }
            else if (e.Source is Owner)
            {
                Owner owner = (Owner)e.Source;

                if (_View.OwnerKey != null && _View.OwnerKey.Equals(owner.Key))
                {
                    if (e.PropertyChangedArgs.PropertyName == Owner.DisplayNamePropertyName)
                        _View.DisplayName = owner.DisplayName;

                    else if (e.PropertyChangedArgs.PropertyName.Equals("ColorScheme"))
                        _View.CalendarColor = owner.ColorScheme;
                }
            }
            else if (e.Source is Appointment)
            {
                Appointment app = e.Source as Appointment;
                AppointmentTimeLineView appView;

                string name = e.PropertyChangedArgs.PropertyName;

                if (name.Equals("Tooltip"))
                {
                    appView = GetViewFromTimeLine(app);

                    if (appView != null)
                        appView.Tooltip = app.Tooltip;
                }
                else if (name.Equals("IsSelected"))
                {
                    appView = GetViewFromTimeLine(app);

                    if (appView != null)
                        appView.IsSelected = app.IsSelected;
                }
                else if (name.Equals("CategoryColor") || name.Equals("TimeMarkedAs"))
                {
                    appView = GetViewFromTimeLine(app);

                    if (appView != null)
                        appView.Refresh();
                }
                else if (name.Equals("OwnerKey"))
                {
                    if (_View.CalendarView.IsMultiCalendar == true)
                    {
                        if (_View.OwnerKey == app.OwnerKey)
                        {
                            _ViewStartTime = new DateTime();

                            RefreshData(false);

                            _View.NeedRecalcLayout = true;
                            _View.RecalcSize();
                        }
                        else
                        {
                            appView = GetViewFromTimeLine(app);

                            if (appView != null)
                            {
                                _ViewStartTime = new DateTime();

                                RefreshData(false);

                                _View.NeedRecalcLayout = true;
                                _View.RecalcSize();
                            }
                        }
                    }
                }
                else if (name.Equals("Visible"))
                {
                    RefreshData(true);
                }
            }
        }
Ejemplo n.º 3
0
        private void ChildPropertyChanged(object sender, SubPropertyChangedEventArgs e)
        {
            Appointment app = sender as Appointment;
            OnSubPropertyChanged(e);

            if (app != null)
            {
                if (IsNonTimeProperty(e.PropertyChangedArgs.PropertyName)) return;
                if (app.InMoveTo && e.PropertyChangedArgs.PropertyName != "EndTime") return;
                if (IsRecurranceProperty(e.PropertyChangedArgs.PropertyName) ||
                    e.Source is DailyRecurrenceSettings || 
                    e.Source is WeeklyRecurrenceSettings || 
                    e.Source is YearlyRecurrenceSettings || 
                    e.Source is MonthlyRecurrenceSettings)
                    InvalidateAppointmentCache();
                else
                    InvalidateAppointmentCache(app);
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Handles ModelSubProperty change notifications
        /// </summary>
        /// <param name="sender">object</param>
        /// <param name="e">SubPropertyChangedEventArgs</param>
        private void ModelSubPropertyChanged(object sender, SubPropertyChangedEventArgs e)
        {
            if (e.Source is Owner)
            {
                Owner owner = (Owner)e.Source;

                if (_View.OwnerKey != null && _View.OwnerKey.Equals(owner.Key))
                {
                    if (e.PropertyChangedArgs.PropertyName == Owner.DisplayNamePropertyName)
                        _View.DisplayName = owner.DisplayName;

                    else if (e.PropertyChangedArgs.PropertyName.Equals("ColorScheme"))
                        _View.CalendarColor = owner.ColorScheme;
                }
            }
            else if (e.Source is Appointment)
            {
                Appointment app = e.Source as Appointment;
                List<AppointmentMonthView> list;

                string name = e.PropertyChangedArgs.PropertyName;

                if (name.Equals("Tooltip"))
                {
                    list = GetViewsFromAll(app);

                    for (int i = 0; i < list.Count; i++)
                        list[i].Tooltip = app.Tooltip;
                }
                else if (name.Equals("IsSelected"))
                {
                    list = GetViewsFromAll(app);

                    for (int i = 0; i < list.Count; i++)
                        list[i].IsSelected = app.IsSelected;
                }
                else if (name.Equals("CategoryColor") || name.Equals("TimeMarkedAs"))
                {
                    list = GetViewsFromAll(app);

                    for (int i = 0; i < list.Count; i++)
                        list[i].Refresh();
                }
                else if (name.Equals("OwnerKey"))
                {
                    if (_View.CalendarView.IsMultiCalendar == true)
                    {
                        if (_View.OwnerKey == app.OwnerKey)
                        {
                            RefreshData();

                            _View.NeedRecalcSize = true;
                            _View.Refresh();
                        }
                        else
                        {
                            list = GetViewsFromAll(app);

                            if (list.Count > 0)
                            {
                                RefreshData();

                                _View.NeedRecalcSize = true;
                                _View.Refresh();
                            }
                        }
                    }
                }
                else if (name.Equals("Visible"))
                {
                    RefreshData();
                }
            }
        }
Ejemplo n.º 5
0
 private void ChildPropertyChanged(object sender, SubPropertyChangedEventArgs e)
 {
     OnSubPropertyChanged(e);
 }
        /// <summary>
        /// Handles ModelSubProperty change notifications
        /// </summary>
        /// <param name="sender">object</param>
        /// <param name="e">SubPropertyChangedEventArgs</param>
        private void ModelSubPropertyChanged(object sender, SubPropertyChangedEventArgs e)
        {
            if (e.Source is WorkDay)
            {
                for (int i = 0; i < _View.NumberOfColumns; i++)
                    UpdateWorkDayDetails(_View.DayColumns[i]);

                _View.CalendarView.CalendarPanel.RecalcSize();
            }
            else if (e.Source is Owner)
            {
                Owner owner = (Owner) e.Source;

                if (_View.OwnerKey != null && _View.OwnerKey.Equals(owner.Key))
                {
                    if (e.PropertyChangedArgs.PropertyName == Owner.DisplayNamePropertyName)
                        _View.DisplayName = owner.DisplayName;

                    else if (e.PropertyChangedArgs.PropertyName.Equals("ColorScheme"))
                        _View.CalendarColor = owner.ColorScheme;
                }
            }
            else if (e.Source is Appointment)
            {
                Appointment app = e.Source as Appointment;
                AppointmentWeekDayView appView;

                string name = e.PropertyChangedArgs.PropertyName;

                if (name.Equals("Tooltip"))
                {
                    appView = GetViewFromAll(app);

                    if (appView != null)
                        appView.Tooltip = app.Tooltip;
                }
                else if (name.Equals("IsSelected"))
                {
                    appView = GetViewFromAll(app);

                    if (appView != null)
                        appView.IsSelected = app.IsSelected;
                }
                else if (name.Equals("CategoryColor") || name.Equals("TimeMarkedAs"))
                {
                    appView = GetViewFromAll(app);

                    if (appView != null)
                        appView.Refresh();
                }
                else if (name.Equals("OwnerKey"))
                {
                    if (_View.CalendarView.IsMultiCalendar == true)
                    {
                        if (_View.OwnerKey == app.OwnerKey)
                        {
                            RefreshData();
                            UpdateDisplay();
                        }
                        else
                        {
                            appView = GetViewFromAll(app);

                            if (appView != null)
                            {
                                RefreshData();
                                UpdateDisplay();
                            }
                        }
                    }
                }
                else if (name.Equals("Visible"))
                {
                    RefreshData();
                    UpdateDisplay();
                }
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Handles ModelSubProperty change notifications
        /// </summary>
        /// <param name="sender">object</param>
        /// <param name="e">SubPropertyChangedEventArgs</param>
        private void ModelSubPropertyChanged(object sender, SubPropertyChangedEventArgs e)
        {
            if (e.Source is Owner)
            {
                Owner owner = (Owner)e.Source;

                if (_View.OwnerKey != null && _View.OwnerKey.Equals(owner.Key))
                {
                    if (e.PropertyChangedArgs.PropertyName == Owner.DisplayNamePropertyName)
                        _View.DisplayName = owner.DisplayName;

                    else if (e.PropertyChangedArgs.PropertyName.Equals("ColorScheme"))
                        _View.CalendarColor = owner.ColorScheme;
                }
            }
            else if (e.Source is Appointment)
            {
                Appointment app = e.Source as Appointment;

                string name = e.PropertyChangedArgs.PropertyName;

                if (name.Equals("OwnerKey"))
                {
                    if (_View.CalendarView.IsMultiCalendar == true)
                    {
                        if (_View.OwnerKey == app.OwnerKey)
                        {
                            LoadData(_ViewState == _lineState);

                            _View.NeedRecalcSize = true;
                            _View.Refresh();
                        }
                    }
                }
                else if (name.Equals("Visible"))
                {
                    LoadData(true);
                }
            }
        }