public void BeginEditing(string id, bool ignoreLoadTask = false)
        {
            if (!ignoreLoadTask)
            {
                if (loadTask != null && !loadTask.IsCompleted)
                {
                    _openOnLoad = id;
                    return;
                }
            }

            foreach (MonthDetail each in stackPanel.Children)
            {
                if (each.Appointment.ID == id)
                {
                    if (each.Appointment.ReadOnly || (each.Appointment.CategoryID != "" && each.Appointment.Category.ReadOnly))
                    {
                        GenericFunctions.ShowReadOnlyMessage();
                        return;
                    }

                    each.InvokeDoubleClickEvent();
                    break;
                }
            }
        }
Exemple #2
0
        private void subjectDisplayOuter_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (e.ChangedButton == MouseButton.Left)
            {
                e.Handled = true;

                dblClickFired = true;

                if (dblClickTimer != null)
                {
                    dblClickTimer.Stop();
                    dblClickTimer = null;
                }

                if (_appointment.ReadOnly || (_appointment.CategoryID != "" && _appointment.Category.ReadOnly))
                {
                    if (tooltip != null)
                    {
                        tooltip.Close();
                    }

                    GenericFunctions.ShowReadOnlyMessage();
                    return;
                }

                InvokeDoubleClickEvent();
            }
        }
Exemple #3
0
        private bool CheckReadOnly()
        {
            if (_appointment.ReadOnly || (_appointment.CategoryID != "" && _appointment.Category.ReadOnly))
            {
                if (tooltip != null)
                {
                    ((ApptToolTip)tooltip).Close();
                }

                GenericFunctions.ShowReadOnlyMessage();
                return(true);
            }

            return(false);
        }
Exemple #4
0
        private void subjectDisplayOuter_Click(object sender, RoutedEventArgs e)
        {
            if (_appointment.ReadOnly || (_appointment.CategoryID != "" && _appointment.Category.ReadOnly))
            {
                if (tooltip != null)
                {
                    ((ApptToolTip)tooltip).Close();
                }

                GenericFunctions.ShowReadOnlyMessage();
                return;
            }

            BeginEdit();
        }
Exemple #5
0
        private void dblClickTimer_Tick(object sender, EventArgs e)
        {
            DispatcherTimer timer = sender as DispatcherTimer;

            timer.Stop();
            timer.Tick -= dblClickTimer_Tick;
            timer       = null;

            if (!dblClickFired)
            {
                if (tooltip != null)
                {
                    tooltip.FastClose();
                }

                if (_appointment.ReadOnly || (_appointment.CategoryID != "" && _appointment.Category.ReadOnly))
                {
                    if (tooltip != null)
                    {
                        tooltip.Close();
                    }

                    GenericFunctions.ShowReadOnlyMessage();
                    return;
                }

                TextPointer pointer;

                try
                {
                    pointer = subjectDisplay.GetPositionFromPoint(Mouse.GetPosition(subjectDisplay), false);
                }
                catch
                {
                    pointer = subjectDisplay.ContentEnd;
                }

                int insertionPos = -1;

                if (pointer != null)
                {
                    insertionPos = pointer.GetTextRunLength(LogicalDirection.Backward);
                }

                BeginEdit(insertionPos);
            }
        }
Exemple #6
0
        private void Resize_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            e.Handled = true;

            if (_appointment.CategoryID != "")
            {
                if (_appointment.Category.ReadOnly)
                {
                    GenericFunctions.ShowReadOnlyMessage();
                    return;
                }
            }

            if (_appointment.IsRepeating)
            {
                throw (new NotImplementedException("Resizing recurring items is not currently supported."));
            }

            IInputElement _sender = (IInputElement)sender;

            _mouseOffset = Mouse.GetPosition(_sender);
            _isResized   = false;
            Mouse.Capture(_sender);
        }