コード例 #1
0
        private static void OnMouseUp(object sender, MouseButtonEventArgs e)
        {
            TimelineTreeRow timelineTreeRow = (TimelineTreeRow)sender;

            if (timelineTreeRow.gotMouseDown && !timelineTreeRow.IsEditingTitle)
            {
                timelineTreeRow.gotMouseDown = false;
                if (!timelineTreeRow.handledMouseDown)
                {
                    if (timelineTreeRow.mouseDownModifiers == ModifierKeys.Control)
                    {
                        timelineTreeRow.timelineItem.ToggleSelect();
                    }
                    else if (timelineTreeRow.mouseDownModifiers == ModifierKeys.Shift)
                    {
                        timelineTreeRow.timelineItem.ExtendSelect();
                    }
                    else if (timelineTreeRow.mouseDownModifiers == ModifierKeys.None)
                    {
                        timelineTreeRow.timelineItem.Select();
                    }
                }
                e.Handled = true;
            }
            timelineTreeRow.handledMouseDown   = false;
            timelineTreeRow.mouseDownModifiers = ModifierKeys.None;
        }
コード例 #2
0
        private static void OnRenameCommandChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
        {
            TimelineTreeRow timelineTreeRow = o as TimelineTreeRow;

            if (timelineTreeRow == null)
            {
                return;
            }
            timelineTreeRow.OnRenameCommandChanged((ICommand)e.NewValue);
        }
コード例 #3
0
        protected override Size ArrangeOverride(Size finalSize)
        {
            if (!this.CustomLayout)
            {
                return(base.ArrangeOverride(finalSize));
            }
            UIElementCollection internalChildren = this.InternalChildren;
            double    indent = this.Indent;
            double    height = 0.0;
            double    num1   = this.rightColumnWidth;
            double    num2   = Math.Max(this.ViewportOffset + this.ViewportWidth - this.rightColumnWidth - this.Indent, 0.0);
            Thickness margin = this.Margin;

            for (int index = 0; index < internalChildren.Count; ++index)
            {
                UIElement uiElement = internalChildren[index];
                if (uiElement.Visibility != Visibility.Collapsed)
                {
                    TimelineTreeRowPosition position = TimelineTreeRow.GetPosition((DependencyObject)uiElement);
                    double width = uiElement.DesiredSize.Width;
                    if (position == TimelineTreeRowPosition.Left)
                    {
                        if (width < num2)
                        {
                            num2 -= width;
                        }
                        else
                        {
                            width = num2;
                            num2  = 0.0;
                        }
                    }
                    Size size = new Size(width, finalSize.Height);
                    if (position == TimelineTreeRowPosition.Left)
                    {
                        uiElement.Arrange(new Rect(new Point(indent, 0.0), size));
                        indent += size.Width;
                    }
                    else if (position == TimelineTreeRowPosition.Right)
                    {
                        uiElement.Arrange(new Rect(new Point(this.ViewportOffset + this.ViewportWidth - num1, 0.0), size));
                        num1 -= size.Width;
                    }
                    else if (position == TimelineTreeRowPosition.Border)
                    {
                        uiElement.Arrange(new Rect(new Point(this.ViewportOffset, 0.0), new Size(this.ViewportWidth, finalSize.Height)));
                    }
                    if (size.Height > height)
                    {
                        height = size.Height;
                    }
                }
            }
            return(new Size(this.ViewportWidth + this.ViewportOffset, height));
        }
コード例 #4
0
        private void OnMouseLeave(object e, MouseEventArgs args)
        {
            TimelineTreeRow timelineTreeRow = e as TimelineTreeRow;

            if (timelineTreeRow == null)
            {
                return;
            }
            ToolTip toolTip = timelineTreeRow.ToolTip as ToolTip;

            if (toolTip == null)
            {
                return;
            }
            toolTip.IsOpen = false;
        }
コード例 #5
0
        private static void HandleBringIntoView(object sender, RequestBringIntoViewEventArgs e)
        {
            if (e.TargetObject == sender)
            {
                return;
            }
            TimelineTreeRow    timelineTreeRow    = (TimelineTreeRow)sender;
            InlineStringEditor inlineStringEditor = timelineTreeRow.FindName("ItemTitle") as InlineStringEditor;

            if (inlineStringEditor == null || !inlineStringEditor.IsEditing || e.TargetRect.IsEmpty)
            {
                return;
            }
            timelineTreeRow.BringIntoView(new Rect(e.TargetRect.X, e.TargetRect.Y, inlineStringEditor.ActualWidth, inlineStringEditor.ActualHeight));
            e.Handled = true;
        }
コード例 #6
0
        protected override Size MeasureOverride(Size availableSize)
        {
            if (!this.CustomLayout)
            {
                return(base.MeasureOverride(availableSize));
            }
            UIElementCollection internalChildren = this.InternalChildren;
            Size   size1  = new Size(double.PositiveInfinity, availableSize.Height);
            Size   size2  = new Size(this.ViewportWidth, availableSize.Height);
            double height = 0.0;
            double indent = this.Indent;

            this.rightColumnWidth = 0.0;
            for (int index = 0; index < internalChildren.Count; ++index)
            {
                UIElement uiElement = internalChildren[index];
                if (uiElement.Visibility != Visibility.Collapsed)
                {
                    TimelineTreeRowPosition position = TimelineTreeRow.GetPosition((DependencyObject)uiElement);
                    Size availableSize1 = position != TimelineTreeRowPosition.Border ? size1 : size2;
                    uiElement.Measure(availableSize1);
                    Size desiredSize = uiElement.DesiredSize;
                    if (desiredSize.Height > height)
                    {
                        height = desiredSize.Height;
                    }
                    bool flag = true;
                    if (position == TimelineTreeRowPosition.Right)
                    {
                        this.rightColumnWidth += desiredSize.Width;
                    }
                    else if (position == TimelineTreeRowPosition.Border)
                    {
                        flag = false;
                    }
                    if (flag)
                    {
                        indent += desiredSize.Width;
                    }
                }
            }
            return(new Size(indent, height));
        }