예제 #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);
        }
예제 #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();
        }
예제 #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");
            }
        }
예제 #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");
            }
        }
예제 #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;
        }
예제 #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);
        }
예제 #7
0
 /// <summary>
 /// Change the show as status of the currently active detail.
 /// </summary>
 /// <param name="showAs"></param>
 abstract public void ChangeShowAs(ShowAs showAs);