Esempio n. 1
0
        private void showAs_SelectionChanged(object sender, RoutedPropertyChangedEventArgs <object> e)
        {
            ShowAs show = (ShowAs)(showAs.Items[0] as RibbonGalleryCategory).Items.IndexOf(showAs.SelectedItem);

            if ((int)show == -1)
            {
                return;
            }

            CurrentCalendarView().ChangeShowAs(show);
        }
Esempio n. 2
0
        private void ChangeShowAs(ShowAs showAs)
        {
            if (CheckReadOnly())
            {
                return;
            }

            _appointment.ShowAs = showAs;
            AppointmentDatabase.UpdateAppointment(_appointment);

            showAsStrip.SetResourceReference(Border.BackgroundProperty, _appointment.ShowAs.ToString() + "Fill");
            RaiseShowAsChangedEvent();
        }
Esempio n. 3
0
        private string FormatWatchValue(byte value, ShowAs showAs)
        {
            switch (showAs)
            {
            case ShowAs.Hexadecimal:
                return(value.ToString("X2"));

            case ShowAs.Decimal:
                return(value.ToString());

            case ShowAs.Binary:
                return(Utils.FormatBinary(value));

            default:
                throw new Exception("Unknown format specified for watch");
            }
        }
Esempio n. 4
0
        private string FormatWatchValue(ushort value, ShowAs showAs)
        {
            switch (showAs)
            {
            case ShowAs.Hexadecimal:
                return(Utils.UShortToHex16BitFormat(value));

            case ShowAs.Decimal:
                return(value.ToString());

            case ShowAs.Binary:
                return(Utils.FormatBinary(value));

                break;

            default:
                throw new Exception("Unknown format specified for watch");
            }
        }
Esempio n. 5
0
        public void CopyFrom(Appointment appointment)
        {
            base.CopyFrom(appointment);

            _allDay       = appointment._allDay;
            _startDate    = appointment._startDate;
            _endDate      = appointment._endDate;
            _isRepeating  = appointment._isRepeating;
            _location     = appointment._location;
            _reminder     = appointment._reminder;
            _priority     = appointment._priority;
            _categoryID   = appointment._categoryID;
            _owner        = appointment._owner;
            _calendarUrl  = appointment._calendarUrl;
            _readOnly     = appointment._readOnly;
            _private      = appointment._private;
            _lastModified = appointment._lastModified;
            _showAs       = appointment._showAs;
            _recurrence   = new Recurrence(appointment._recurrence);
            _repeatId     = appointment._repeatId;
            _subject      = appointment._subject;
        }
Esempio n. 6
0
        protected Appointment(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
            _saveChangesToDisk = false;

            _allDay            = info.GetBoolean(AppointmentDatabase.AllDayAttribute);
            _startDate         = info.GetDateTime(AppointmentDatabase.StartDateAttribute);
            _endDate           = info.GetDateTime(AppointmentDatabase.EndDateAttribute);
            _isRepeating       = info.GetBoolean("ir");
            _location          = info.GetString(AppointmentDatabase.LocationAttribute);
            _reminder          = (TimeSpan)info.GetValue(AppointmentDatabase.ReminderAttribute, typeof(TimeSpan));
            _priority          = (Priority)info.GetByte(AppointmentDatabase.PriorityAttribute);
            _categoryID        = info.GetString(AppointmentDatabase.CategoryAttribute);
            _saveChangesToDisk = info.GetBoolean("sav");
            DetailsDocument    = Serializer.FlowDocumentDeserialize(info.GetString("dtl"));
            _owner             = info.GetString(AppointmentDatabase.OwnerAttribute);
            _calendarUrl       = info.GetString(AppointmentDatabase.CalendarUrlAttribute);
            _readOnly          = info.GetBoolean(AppointmentDatabase.ReadOnlyAttribute);
            _private           = info.GetBoolean(AppointmentDatabase.PrivateAttribute);
            _showAs            = (ShowAs)info.GetByte(AppointmentDatabase.ShowAsAttribute);
            _recurrence        = (Recurrence)info.GetValue("rec", typeof(Recurrence));
            _repeatId          = info.GetString(AppointmentDatabase.RepeatIdAttribute);
            _subject           = info.GetString(AppointmentDatabase.SubjectAttribute);
        }
Esempio n. 7
0
 /// <summary>
 /// Change the show as status of the currently active detail.
 /// </summary>
 /// <param name="showAs"></param>
 abstract public void ChangeShowAs(ShowAs showAs);