コード例 #1
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);
                }
            })));
        }
コード例 #2
0
ファイル: InfoBubbleViewModel.cs プロジェクト: l2obin/Dynamo
        private void UpdatePosition(object parameter)
        {
            InfoBubbleDataPacket data = (InfoBubbleDataPacket)parameter;

            SaveParameter(data.TopLeft, data.BotRight);
            UpdatePosition(data.TopLeft, data.BotRight);
        }
コード例 #3
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);
         })));
     }
 }
コード例 #4
0
ファイル: InfoBubbleViewModel.cs プロジェクト: vtaran/Dynamo
        private void UpdatePosition(object parameter)
        {
            InfoBubbleDataPacket data = (InfoBubbleDataPacket)parameter;

            TargetTopLeft  = data.TopLeft;
            TargetBotRight = data.BotRight;
        }
コード例 #5
0
ファイル: NodeViewModel.cs プロジェクト: jimmplan/Dynamo
        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);
            }
        }
コード例 #6
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);
            }
        }
コード例 #7
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);
        }
コード例 #8
0
ファイル: InfoBubbleViewModel.cs プロジェクト: l2obin/Dynamo
        private void UpdateInfoBubbleContent(object parameter)
        {
            InfoBubbleDataPacket data = (InfoBubbleDataPacket)parameter;

            UpdateStyle(data.Style, data.ConnectingDirection);
            UpdateContent(data.Text);
            UpdateShape(data.TopLeft, data.BotRight);
            UpdatePosition(data.TopLeft, data.BotRight);
        }
コード例 #9
0
ファイル: InfoBubbleViewModel.cs プロジェクト: vtaran/Dynamo
        private void UpdateInfoBubbleContent(object parameter)
        {
            InfoBubbleDataPacket data = (InfoBubbleDataPacket)parameter;

            InfoBubbleStyle     = data.Style;
            ConnectingDirection = data.ConnectingDirection;
            UpdateContent(data.Text);
            TargetTopLeft  = data.TopLeft;
            TargetBotRight = data.BotRight;
        }
コード例 #10
0
ファイル: InfoBubbleViewModel.cs プロジェクト: vtaran/Dynamo
        // TODO:Kahheng Refactor away these
        #region TODO:Kahheng Refactor away these
        private void ShowFullContent(object parameter)
        {
            if (parameter != null && parameter is InfoBubbleDataPacket)
            {
                InfoBubbleDataPacket data = (InfoBubbleDataPacket)parameter;
                InfoBubbleStyle = data.Style;
            }

            Content = FullContent;

            ZIndex = 5;
        }
コード例 #11
0
        private void UpdatePreviewBubblePosition()
        {
            if (PreviewBubble == null || NodeModel is Watch)
            {
                return;
            }
            var data = new InfoBubbleDataPacket {
                TopLeft = GetTopLeft(), BotRight = GetBotRight()
            };

            PreviewBubble.UpdatePositionCommand.Execute(data);
        }
コード例 #12
0
ファイル: InfoBubbleViewModel.cs プロジェクト: vtaran/Dynamo
        private void ShowCondensedContent(object parameter)
        {
            if (parameter != null && parameter is InfoBubbleDataPacket)
            {
                InfoBubbleDataPacket data = (InfoBubbleDataPacket)parameter;
                InfoBubbleStyle = data.Style;
            }

            // Generate condensed content
            GenerateContent();

            ZIndex = 3;
        }
コード例 #13
0
        private void UpdatePreviewBubblePosition()
        {
            if (this.PreviewBubble == null || this.NodeModel is Watch)
            {
                return;
            }
            Point topLeft             = new Point(NodeModel.X, NodeModel.Y);
            Point botRight            = new Point(NodeModel.X + NodeModel.Width, NodeModel.Y + NodeModel.Height);
            InfoBubbleDataPacket data = new InfoBubbleDataPacket();

            data.TopLeft  = topLeft;
            data.BotRight = botRight;
            this.PreviewBubble.UpdatePositionCommand.Execute(data);
        }
コード例 #14
0
        private void UpdateErrorBubblePosition()
        {
            if (ErrorBubble == null)
            {
                return;
            }
            var data = new InfoBubbleDataPacket
            {
                TopLeft  = GetTopLeft(),
                BotRight = GetBotRight()
            };

            ErrorBubble.UpdatePositionCommand.Execute(data);
        }
コード例 #15
0
ファイル: NodeViewModel.cs プロジェクト: TheChosen0ne/Dynamo
 private void UpdateErrorBubblePosition()
 {
     if (this.ErrorBubble == null)
         return;
     InfoBubbleDataPacket data = new InfoBubbleDataPacket();
     data.TopLeft = GetTopLeft();
     data.BotRight = GetBotRight();
     this.ErrorBubble.UpdatePositionCommand.Execute(data);
 }
コード例 #16
0
        private void LibraryItem_OnMouseEnter(object sender, MouseEventArgs e)
        {
            TreeViewItem treeViewItem = sender as TreeViewItem;
            NodeSearchElement nodeSearchElement = treeViewItem.Header as NodeSearchElement;
            if (nodeSearchElement == null)
                return;

            Point pointToScreen_TopLeft = treeViewItem.PointToScreen(new Point(0, 0));
            Point topLeft = this.PointFromScreen(pointToScreen_TopLeft);
            Point pointToScreen_BotRight = new Point(pointToScreen_TopLeft.X + treeViewItem.ActualWidth, pointToScreen_TopLeft.Y + treeViewItem.ActualHeight);
            Point botRight = this.PointFromScreen(pointToScreen_BotRight);
            string infoBubbleContent = nodeSearchElement.Description;
            InfoBubbleDataPacket data = new InfoBubbleDataPacket(InfoBubbleViewModel.Style.LibraryItemPreview, topLeft,
                botRight, infoBubbleContent, InfoBubbleViewModel.Direction.Left);
            DynamoCommands.ShowLibItemInfoBubbleCommand.Execute(data);
        }
コード例 #17
0
ファイル: NodeViewModel.cs プロジェクト: algobasket/Dynamo
        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);
        }
コード例 #18
0
ファイル: NodeViewModel.cs プロジェクト: TheChosen0ne/Dynamo
 private void UpdatePreviewBubblePosition()
 {
     if (this.PreviewBubble == null || this.NodeModel is Watch)
         return;
     InfoBubbleDataPacket data = new InfoBubbleDataPacket();
     data.TopLeft = GetTopLeft();
     data.BotRight = GetBotRight();
     this.PreviewBubble.UpdatePositionCommand.Execute(data);
 }
コード例 #19
0
        private void UpdatePreviewBubbleContent()
        {
            if (this.PreviewBubble == null || this.NodeModel is Watch || dynSettings.Controller == null)
                return;

            var vm = dynSettings.Controller.DynamoViewModel;
            if (!vm.CurrentSpaceViewModel.Previews.Contains(this.PreviewBubble))
                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);
            this.PreviewBubble.UpdateContentCommand.Execute(data);
        }
コード例 #20
0
ファイル: NodeViewModel.cs プロジェクト: algobasket/Dynamo
 private void UpdatePreviewBubblePosition()
 {
     if (PreviewBubble == null || NodeModel is Watch)
         return;
     var data = new InfoBubbleDataPacket { TopLeft = GetTopLeft(), BotRight = GetBotRight() };
     PreviewBubble.UpdatePositionCommand.Execute(data);
 }
コード例 #21
0
        private void ShowErrorBubbleCondensedContent()
        {
            if (this.IsDisconnected)
                return;

            InfoBubbleDataPacket data = new InfoBubbleDataPacket();
            data.Style = InfoBubbleViewModel.Style.ErrorCondensed;
            data.ConnectingDirection = InfoBubbleViewModel.Direction.Bottom;

            this.ViewModel.ShowCondensedContentCommand.Execute(data);
        }
コード例 #22
0
        private void ShowPreviewBubbleFullContent()
        {
            if (this.IsDisconnected)
                return;

            InfoBubbleDataPacket data = new InfoBubbleDataPacket();
            data.Style = InfoBubbleViewModel.Style.Preview;
            data.ConnectingDirection = InfoBubbleViewModel.Direction.Top;

            this.ViewModel.ShowFullContentCommand.Execute(data);
        }
コード例 #23
0
ファイル: InfoBubbleView.xaml.cs プロジェクト: whztt07/Dynamo
        private void ShowErrorBubbleFullContent()
        {
            if (this.IsDisconnected)
                return;

            InfoBubbleDataPacket data = new InfoBubbleDataPacket();
            if (ViewModel.InfoBubbleStyle == InfoBubbleViewModel.Style.ErrorCondensed)
            {
                data.Style = InfoBubbleViewModel.Style.Error;
            }
            else if (ViewModel.InfoBubbleStyle == InfoBubbleViewModel.Style.WarningCondensed)
            {
                data.Style = InfoBubbleViewModel.Style.Warning;
            }
            data.ConnectingDirection = InfoBubbleViewModel.Direction.Bottom;

            this.ViewModel.ShowFullContentCommand.Execute(data);
        }
コード例 #24
0
ファイル: CoreUITests.cs プロジェクト: yy-yyaa/Dynamo
        public void UpdateInfoBubble_ErrorBubble()
        {
            InfoBubbleViewModel infoBubble = new InfoBubbleViewModel(this.ViewModel);
            string content = "This is the test infoBubble";
            InfoBubbleDataPacket inputData_ErrorBubble = new InfoBubbleDataPacket(InfoBubbleViewModel.Style.Error,
                new Point(0, 0), new Point(0, 0), content, InfoBubbleViewModel.Direction.Bottom);

            if (infoBubble.UpdateContentCommand.CanExecute(null))
            {
                infoBubble.UpdateContentCommand.Execute(inputData_ErrorBubble);
                Assert.AreEqual(content, infoBubble.Content);
                Assert.AreEqual(InfoBubbleViewModel.Style.Error, infoBubble.InfoBubbleStyle);
                Assert.AreEqual(InfoBubbleViewModel.Direction.Bottom, infoBubble.ConnectingDirection);
            }
        }
コード例 #25
0
ファイル: CoreUITests.cs プロジェクト: kah-heng/Dynamo
        public void UpdateInfoBubble_NodeTooltip()
        {
            var infoBubble = new InfoBubbleViewModel();
            string content = "This is the test infoBubble";
            var inputData_NodeTooltip = new InfoBubbleDataPacket(InfoBubbleViewModel.Style.NodeTooltip,
                new Point(0, 0), new Point(0, 0), content, InfoBubbleViewModel.Direction.Right);

            if (infoBubble.UpdateContentCommand.CanExecute(null))
            {
                infoBubble.UpdateContentCommand.Execute(inputData_NodeTooltip);
                Assert.AreEqual(content, infoBubble.Content);
                Assert.AreEqual(InfoBubbleViewModel.Style.NodeTooltip, infoBubble.InfoBubbleStyle);
                Assert.AreEqual(InfoBubbleViewModel.Direction.Right, infoBubble.ConnectingDirection);
            }
        }
コード例 #26
0
ファイル: CoreUITests.cs プロジェクト: kah-heng/Dynamo
        public void UpdateInfoBubble_LibItem()
        {
            InfoBubbleViewModel infoBubble = new InfoBubbleViewModel();
            string content = "This is the test infoBubble";
            InfoBubbleDataPacket inputData_LibItem = new InfoBubbleDataPacket(InfoBubbleViewModel.Style.LibraryItemPreview,
                new Point(0, 0), new Point(0, 0), content, InfoBubbleViewModel.Direction.Left);

            if (infoBubble.UpdateContentCommand.CanExecute(null))
            {
                infoBubble.UpdateContentCommand.Execute(inputData_LibItem);
                Assert.AreEqual(content, infoBubble.Content);
                Assert.AreEqual(InfoBubbleViewModel.Style.LibraryItemPreview, infoBubble.InfoBubbleStyle);
                Assert.AreEqual(InfoBubbleViewModel.Direction.Left, infoBubble.ConnectingDirection);
            }
        }
コード例 #27
0
 private void UpdatePreviewBubblePosition()
 {
     if (this.PreviewBubble == null || this.NodeModel is Watch)
         return;
     Point topLeft = new Point(NodeModel.X, NodeModel.Y);
     Point botRight = new Point(NodeModel.X + NodeModel.Width, NodeModel.Y + NodeModel.Height);
     InfoBubbleDataPacket data = new InfoBubbleDataPacket();
     data.TopLeft = topLeft;
     data.BotRight = botRight;
     this.PreviewBubble.UpdatePositionCommand.Execute(data);
 }
コード例 #28
0
        private void ShowPreviewBubbleFullContent()
        {
            if (this.IsDisconnected)
                return;

            string content = ViewModel.FullContent;
            InfoBubbleViewModel.Style style = InfoBubbleViewModel.Style.Preview;
            InfoBubbleViewModel.Direction connectingDirection = InfoBubbleViewModel.Direction.Top;
            Point topLeft = ViewModel.TargetTopLeft;
            Point botRight = ViewModel.TargetBotRight;
            InfoBubbleDataPacket data = new InfoBubbleDataPacket(style, topLeft, botRight, content, connectingDirection);
            this.ViewModel.UpdateContentCommand.Execute(data);
            this.ViewModel.ZIndex = 5;
        }
コード例 #29
0
ファイル: NodeViewModel.cs プロジェクト: heegwon/Dynamo
        private void UpdateBubbleContent()
        {
            if (ErrorBubble == null || dynSettings.Controller == null)
                return;
            if (string.IsNullOrEmpty(NodeModel.ToolTipText))
            {
                if (NodeModel.State != ElementState.Error && NodeModel.State != ElementState.Warning)
                {
                    ErrorBubble.ChangeInfoBubbleStateCommand.Execute(InfoBubbleViewModel.State.Minimized);
                }
            }
            else
            {
                if (!dynSettings.Controller.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);
            }
        }
コード例 #30
0
ファイル: NodeViewModel.cs プロジェクト: heegwon/Dynamo
 private void UpdateErrorBubblePosition()
 {
     if (ErrorBubble == null)
         return;
     var data = new InfoBubbleDataPacket
     {
         TopLeft = GetTopLeft(),
         BotRight = GetBotRight()
     };
     ErrorBubble.UpdatePositionCommand.Execute(data);
 }
コード例 #31
0
ファイル: NodeViewModel.cs プロジェクト: kah-heng/Dynamo
 private void UpdateErrorBubbleContent()
 {
     if (this.ErrorBubble == null || dynSettings.Controller == null)
         return;
     if (string.IsNullOrEmpty(NodeModel.ToolTipText))
     {
         // TODO: Opacity is no longer in use
         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);
         })));
     }
 }