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); } }))); }
private void UpdatePosition(object parameter) { InfoBubbleDataPacket data = (InfoBubbleDataPacket)parameter; SaveParameter(data.TopLeft, data.BotRight); UpdatePosition(data.TopLeft, data.BotRight); }
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); }))); } }
private void UpdatePosition(object parameter) { InfoBubbleDataPacket data = (InfoBubbleDataPacket)parameter; TargetTopLeft = data.TopLeft; TargetBotRight = data.BotRight; }
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); } }
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); } }
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); }
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); }
private void UpdateInfoBubbleContent(object parameter) { InfoBubbleDataPacket data = (InfoBubbleDataPacket)parameter; InfoBubbleStyle = data.Style; ConnectingDirection = data.ConnectingDirection; UpdateContent(data.Text); TargetTopLeft = data.TopLeft; TargetBotRight = data.BotRight; }
// 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; }
private void UpdatePreviewBubblePosition() { if (PreviewBubble == null || NodeModel is Watch) { return; } var data = new InfoBubbleDataPacket { TopLeft = GetTopLeft(), BotRight = GetBotRight() }; PreviewBubble.UpdatePositionCommand.Execute(data); }
private void ShowCondensedContent(object parameter) { if (parameter != null && parameter is InfoBubbleDataPacket) { InfoBubbleDataPacket data = (InfoBubbleDataPacket)parameter; InfoBubbleStyle = data.Style; } // Generate condensed content GenerateContent(); ZIndex = 3; }
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); }
private void UpdateErrorBubblePosition() { if (ErrorBubble == null) { return; } var data = new InfoBubbleDataPacket { TopLeft = GetTopLeft(), BotRight = GetBotRight() }; ErrorBubble.UpdatePositionCommand.Execute(data); }
private void UpdateErrorBubblePosition() { if (this.ErrorBubble == null) return; InfoBubbleDataPacket data = new InfoBubbleDataPacket(); data.TopLeft = GetTopLeft(); data.BotRight = GetBotRight(); this.ErrorBubble.UpdatePositionCommand.Execute(data); }
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); }
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); }
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); }
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); }
private void UpdatePreviewBubblePosition() { if (PreviewBubble == null || NodeModel is Watch) return; var data = new InfoBubbleDataPacket { TopLeft = GetTopLeft(), BotRight = GetBotRight() }; PreviewBubble.UpdatePositionCommand.Execute(data); }
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); }
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); }
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); }
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); } }
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); } }
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); } }
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); }
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; }
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); } }
private void UpdateErrorBubblePosition() { if (ErrorBubble == null) return; var data = new InfoBubbleDataPacket { TopLeft = GetTopLeft(), BotRight = GetBotRight() }; ErrorBubble.UpdatePositionCommand.Execute(data); }
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); }))); } }