Beispiel #1
0
        private void UpdateBubbleContent()
        {
            if (ErrorBubble == null || DynamoViewModel == null)
            {
                return;
            }
            if (string.IsNullOrEmpty(NodeModel.ToolTipText))
            {
                if (NodeModel.State != ElementState.Error && NodeModel.State != ElementState.Warning)
                {
                    ErrorBubble.ChangeInfoBubbleStateCommand.Execute(InfoBubbleViewModel.State.Minimized);
                }
            }
            else
            {
                if (!DynamoViewModel.CurrentSpaceViewModel.Errors.Contains(ErrorBubble))
                {
                    return;
                }

                var topLeft  = new Point(NodeModel.X, NodeModel.Y);
                var botRight = new Point(NodeModel.X + NodeModel.Width, NodeModel.Y + NodeModel.Height);
                InfoBubbleViewModel.Style style = NodeModel.State == ElementState.Error
                    ? InfoBubbleViewModel.Style.ErrorCondensed
                    : InfoBubbleViewModel.Style.WarningCondensed;
                // NOTE!: If tooltip is not cached here, it will be cleared once the dispatcher is invoked below
                string content = NodeModel.ToolTipText;
                const InfoBubbleViewModel.Direction connectingDirection = InfoBubbleViewModel.Direction.Bottom;
                var data = new InfoBubbleDataPacket(style, topLeft, botRight, content, connectingDirection);

                ErrorBubble.UpdateContentCommand.Execute(data);
                ErrorBubble.ChangeInfoBubbleStateCommand.Execute(InfoBubbleViewModel.State.Pinned);
            }
        }
Beispiel #2
0
        private void UpdateStyle(InfoBubbleViewModel.Style style, Direction connectingDirection)
        {
            InfoBubbleStyle     = style;
            ConnectingDirection = connectingDirection;
            limitedDirection    = Direction.None;

            switch (style)
            {
            case Style.LibraryItemPreview:
                SetStyle_LibraryItemPreview();
                break;

            case Style.NodeTooltip:
                SetStyle_NodeTooltip(connectingDirection);
                break;

            case Style.Error:
                SetStyle_Error();
                break;

            case Style.Preview:
                SetStyle_Preview();
                break;

            case Style.PreviewCondensed:
                SetStyle_PreviewCondensed();
                break;

            case Style.None:
                throw new ArgumentException("InfoWindow didn't have a style (456B24E0F400)");
            }
        }
Beispiel #3
0
        private void UpdatePreviewBubbleContent()
        {
            if (this.PreviewBubble == null || this.NodeModel is Watch)
            {
                return;
            }

            //create data packet to send to preview bubble
            InfoBubbleViewModel.Style style = InfoBubbleViewModel.Style.PreviewCondensed;
            Point  topLeft  = new Point(NodeModel.X, NodeModel.Y);
            Point  botRight = new Point(NodeModel.X + NodeModel.Width, NodeModel.Y + NodeModel.Height);
            string content  = this.OldValue;

            InfoBubbleViewModel.Direction connectingDirection = InfoBubbleViewModel.Direction.Top;
            InfoBubbleDataPacket          data = new InfoBubbleDataPacket(style, topLeft, botRight, content, connectingDirection);

            //update preview bubble
            dynSettings.Controller.DynamoViewModel.CurrentSpaceViewModel.Dispatcher.BeginInvoke((new Action(() =>
            {
                if (dynSettings.Controller.DynamoViewModel.CurrentSpaceViewModel.Previews.Contains(this.PreviewBubble))
                {
                    this.PreviewBubble.UpdateContentCommand.Execute(data);
                }
            })));
        }
Beispiel #4
0
 private void UpdateErrorBubbleContent()
 {
     if (this.ErrorBubble == null)
     {
         return;
     }
     if (string.IsNullOrEmpty(NodeModel.ToolTipText))
     {
         if (ErrorBubble.Opacity != 0)
         {
             ErrorBubble.SetAlwaysVisibleCommand.Execute(false);
             ErrorBubble.InstantCollapseCommand.Execute(null);
         }
     }
     else
     {
         Point topLeft  = new Point(NodeModel.X, NodeModel.Y);
         Point botRight = new Point(NodeModel.X + NodeModel.Width, NodeModel.Y + NodeModel.Height);
         InfoBubbleViewModel.Style style = InfoBubbleViewModel.Style.Error;
         string content = NodeModel.ToolTipText;
         InfoBubbleViewModel.Direction connectingDirection = InfoBubbleViewModel.Direction.Bottom;
         InfoBubbleDataPacket          data = new InfoBubbleDataPacket(style, topLeft, botRight, content, connectingDirection);
         dynSettings.Controller.DynamoViewModel.CurrentSpaceViewModel.Dispatcher.BeginInvoke((new Action(() =>
         {
             if (!dynSettings.Controller.DynamoViewModel.CurrentSpaceViewModel.Errors.Contains(this.ErrorBubble))
             {
                 return;
             }
             this.ErrorBubble.UpdateContentCommand.Execute(data);
             this.ErrorBubble.SetAlwaysVisibleCommand.Execute(true);
             this.ErrorBubble.InstantAppearCommand.Execute(null);
         })));
     }
 }
Beispiel #5
0
        private void UpdateErrorBubbleContent()
        {
            if (this.ErrorBubble == null || dynSettings.Controller == null)
            {
                return;
            }
            if (string.IsNullOrEmpty(NodeModel.ToolTipText))
            {
                if (NodeModel.State != ElementState.ERROR)
                {
                    ErrorBubble.ChangeInfoBubbleStateCommand.Execute(InfoBubbleViewModel.State.Minimized);
                }
            }
            else
            {
                if (!dynSettings.Controller.DynamoViewModel.CurrentSpaceViewModel.Errors.Contains(this.ErrorBubble))
                {
                    return;
                }

                Point topLeft  = new Point(NodeModel.X, NodeModel.Y);
                Point botRight = new Point(NodeModel.X + NodeModel.Width, NodeModel.Y + NodeModel.Height);
                InfoBubbleViewModel.Style style = InfoBubbleViewModel.Style.ErrorCondensed;
                // NOTE!: If tooltip is not cached here, it will be cleared once the dispatcher is invoked below
                string content = NodeModel.ToolTipText;
                InfoBubbleViewModel.Direction connectingDirection = InfoBubbleViewModel.Direction.Bottom;
                InfoBubbleDataPacket          data = new InfoBubbleDataPacket(style, topLeft, botRight, content, connectingDirection);

                this.ErrorBubble.UpdateContentCommand.Execute(data);
                this.ErrorBubble.ChangeInfoBubbleStateCommand.Execute(InfoBubbleViewModel.State.Pinned);
            }
        }
Beispiel #6
0
        private void UpdatePreviewBubbleContent(bool forceDataQuery)
        {
            if (PreviewBubble == null || NodeModel is Watch || dynSettings.Controller == null)
            {
                return;
            }

            var vm = dynSettings.Controller.DynamoViewModel;

            if (!vm.CurrentSpaceViewModel.Previews.Contains(PreviewBubble))
            {
                return;
            }

            if (PreviewBubble.InfoBubbleState == InfoBubbleViewModel.State.Minimized)
            {
                if (forceDataQuery == false)
                {
                    return;
                }
            }

            //create data packet to send to preview bubble
            const InfoBubbleViewModel.Style style = InfoBubbleViewModel.Style.PreviewCondensed;
            string content = OldValue;
            const InfoBubbleViewModel.Direction connectingDirection = InfoBubbleViewModel.Direction.Top;
            var data = new InfoBubbleDataPacket(style, GetTopLeft(), GetBotRight(), content, connectingDirection);

            PreviewBubble.UpdateContentCommand.Execute(data);
        }
Beispiel #7
0
 public InfoBubbleDataPacket(InfoBubbleViewModel.Style style, Point topLeft, Point botRight,
     string text, InfoBubbleViewModel.Direction connectingDirection)
 {
     Style = style;
     TopLeft = topLeft;
     BotRight = botRight;
     Text = text;
     ConnectingDirection = connectingDirection;
 }
Beispiel #8
0
 public InfoBubbleDataPacket(InfoBubbleViewModel.Style style, Point topLeft, Point botRight,
                             string text, InfoBubbleViewModel.Direction connectingDirection)
 {
     Style               = style;
     TopLeft             = topLeft;
     BotRight            = botRight;
     Text                = text;
     ConnectingDirection = connectingDirection;
 }
Beispiel #9
0
 public InfoBubbleDataPacket(
     InfoBubbleViewModel.Style style,
     Point topLeft,
     Point botRight,
     string text,
     InfoBubbleViewModel.Direction connectingDirection)
 {
     Style               = style;
     TopLeft             = topLeft;
     BotRight            = botRight;
     Link                = ParseLinkFromText(text);
     Text                = RemoveLinkFromText(text);
     ConnectingDirection = connectingDirection;
 }