protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { if (windowService == null) throw new ArgumentNullException("windowService"); if (objectProvider == null) throw new ArgumentNullException("objectProvider"); DataTable dt = objectProvider.GetObject() as DataTable; if (dt != null) { using (FormMainDataSet main = new FormMainDataSet()) { main.Init(dt, objectProvider.IsObjectReplaceable, "DataRow Visualizer"); DialogResult dr = windowService.ShowDialog(main); if (objectProvider.IsObjectReplaceable && dr == DialogResult.OK) { /// DataRow is not serializable, so we serialize the item array /// in the TransferData override of the DataRowVisualizerObjectSource we deserialize the itemArray /// and update the values on the original DataRow objectProvider.TransferData(StreamSerializer.ObjectToStream(null, dt.Rows[0].ItemArray)); } } } }
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { if (windowService != null) { if (objectProvider != null) { var obj = objectProvider.GetObject() as QueryData; // flag1 = obj == null; if (obj != null) { var form = new EfVisualizerForm(); if (!string.IsNullOrEmpty(obj.ExceptionMessage)) { form.SetDebugText(string.Format("Error:{0}{1}", Environment.NewLine, obj.ExceptionMessage)); } else { form.SetDebugText(obj.SQLCommand); } DialogResult dialogResult = windowService.ShowDialog(form); } } else { throw new ArgumentNullException("objectProvider"); } } else { throw new ArgumentNullException("windowService"); } }
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { try { if (windowService == null) { throw new ArgumentNullException("windowService"); } if (objectProvider == null) { throw new ArgumentNullException("objectProvider"); } object data = (object)objectProvider.GetObject(); System.Data.DataSet ds = data as System.Data.DataSet; if (ds == null) { throw new ArgumentException("Only DataSets can be visualized with the ExtendedDataSetVisualizer"); } using (ExtendedDataSetVisualizerWin win = new ExtendedDataSetVisualizerWin(ds)) { windowService.ShowDialog(win); } } catch (System.Exception rExc) { MessageBox.Show(rExc.Message); } }
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { var bitmap = (Bitmap)objectProvider.GetObject(); if (bitmap == null) throw new NullReferenceException("Make sure your Bitmap is not null."); var form = new Form { Text = String.Format("ImageView - W: {0}px H: {1}px", bitmap.Width, bitmap.Height), ClientSize = new Size(480, 320), FormBorderStyle = FormBorderStyle.Sizable, ShowInTaskbar = false, ShowIcon = false }; var pictureBox = new PictureBox { SizeMode = PictureBoxSizeMode.Zoom, Image = bitmap, Parent = form, Dock = DockStyle.Fill }; form.ShowDialog(); }
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { if (windowService == null) throw new ArgumentNullException("windowService"); if (objectProvider == null) throw new ArgumentNullException("objectProvider"); // TODO: 取得要顯示其視覺化檢視的物件。 // 將 objectProvider.GetObject() 的結果轉型為 // 要視覺化的物件型別。 var data = (Image)objectProvider.GetObject(); // TODO: 顯示您的物件檢視。 // 以自己的自訂表單或控制項取代 displayForm。 using (Form displayForm = new Form { Text = string.Format("Width: {0}, Height: {1} Format:{2}", data.Width, data.Height, data.PixelFormat), ClientSize = new Size(data.Width, data.Height), FormBorderStyle = FormBorderStyle.FixedToolWindow, StartPosition = FormStartPosition.CenterScreen, } ) { PictureBox box = new PictureBox { Image = data, Dock = DockStyle.Fill }; displayForm.Controls.Add(box); windowService.ShowDialog(displayForm); } }
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider provider) { using (Form form1 = new Form()) { form1.Paint += new PaintEventHandler(form1_Paint); form1.Text = "Font Visualizer"; font = (Font)provider.GetObject(); form1.StartPosition = FormStartPosition.WindowsDefaultLocation; form1.SizeGripStyle = SizeGripStyle.Auto; form1.ShowInTaskbar = false; form1.ShowIcon = false; Graphics formGraphics = form1.CreateGraphics(); var size = formGraphics.MeasureString(font.Name, font); form1.Width = (int)size.Width + 100; form1.Height = (int)size.Height + 100; windowService.ShowDialog(form1); } }
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { var board = (objectProvider.GetObject()) as Board; new GoBoardForm(board).ShowDialog(); }
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { var image = (Bitmap) objectProvider.GetObject(); var dialogTitle = String.Format("Width: {0}, Height: {1}, Format: {2}", image.Width, image.Height, image.PixelFormat); var form = new Form { Text = dialogTitle, ClientSize = new Size(image.Width, image.Height), FormBorderStyle = FormBorderStyle.FixedToolWindow, }; var pictureBox = new PictureBox { Image = image, Dock = DockStyle.Fill, Parent = form, }; pictureBox.MouseMove += (s, a) => { form.Text = String.Format("{0}, RGB({1})={2}", dialogTitle, a.Location, image.GetPixel(a.Location.X, a.Location.Y)); }; windowService.ShowDialog(form); }
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { StringBuilder sb = new StringBuilder(); var ilBytes = ((ILDelta)objectProvider.GetObject()).Value; var viewer = new TextViewer(ilBytes.GetMethodIL(), "IL"); viewer.ShowDialog(); }
/// <summary> /// Contains the code that actually creates the ChromeVisualizer (by starting its process) /// </summary> /// <param name="windowService"></param> /// <param name="objectProvider"></param> protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { // Get the HTML we want to visualize string html = objectProvider.GetObject().ToString(); // Get temp file path string htmlFilePath = Path.GetTempFileName() + ".html"; try { // Try to write it out File.WriteAllText(htmlFilePath, html, Encoding.UTF8); } catch (Exception exc) { // Report it to the user MessageBox.Show("Failed to save HTML to a temporary text file: " + exc.Message); return; } // Create a new process to launch our chrome visualizer Process process = new Process(); // Link to the ChromeVisualizer.exe file process.StartInfo.FileName = chromeVisualizerPath; // Pass the HTML temp file path as argument process.StartInfo.Arguments = htmlFilePath; // Maximize the window process.StartInfo.WindowStyle = ProcessWindowStyle.Maximized; try { // Finally, start the process! process.Start(); } catch (Exception exc) { // Report it to the user MessageBox.Show("Failed to start the Chrome Visualizer executable: " + exc.Message); return; } // Wait for user to close window process.WaitForExit(); try { // Finally, try to delete the temp file File.Delete(htmlFilePath); } catch (Exception exc) { // Report it to the user MessageBox.Show("Failed to delete the temporary HTML file: " + exc.Message); return; } }
/// <summary> /// 表示 /// </summary> /// <param name="windowService"></param> /// <param name="objectProvider"></param> protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { using (MatrixVisualizerForm displayForm = new MatrixVisualizerForm()) { displayForm.SetMatrix(objectProvider.GetObject() as KrdLab.Lisys.Matrix); windowService.ShowDialog(displayForm); } }
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { var fixMessageString = objectProvider.GetObject().ToString(); var directoryPath = Path.GetDirectoryName(Uri.UnescapeDataString(new System.Uri(Assembly.GetExecutingAssembly().CodeBase).AbsolutePath)); FixMessageVisualizerDialog.Show(fixMessageString, new ConventionBasedFixDictionarySource(directoryPath), null); }
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { SerializedProxy data = (SerializedProxy)objectProvider.GetObject (); //MessageBox.Show(data.ProxyType.FullName); AopProxyVisualizerForm form = new AopProxyVisualizerForm(); form.Proxy = data; windowService.ShowDialog(form); }
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { StringWindow win = new StringWindow (objectProvider.GetObject().ToString()); win.Editable = objectProvider.IsObjectReplaceable; win.Show (); }
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { MainForm preview = new MainForm(); DataTable dt = null; dt = (DataTable)objectProvider.GetObject(); object rowObject = dt.Rows[dt.Rows.Count - 1][0]; preview.ShowData(dt, rowObject.ToString()); }
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { var nodeProxy = (INodeProxy)objectProvider.GetObject(); var window = new VisualizerWindow { DataContext = new VisualizerViewModel(nodeProxy) }; window.ShowDialog(); }
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { var window = new Window { Content = new View((IEnumerable<object>) objectProvider.GetObject()) }; window.ShowDialog(); }
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { var frm = new FrmImage(); var img = objectProvider.GetObject() as Image; if (img == null) return; frm.Picture = img; windowService.ShowDialog(frm); }
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { if (windowService == null) throw new ArgumentNullException("windowService"); if (objectProvider == null) throw new ArgumentNullException("objectProvider"); if (!(objectProvider.GetObject() is Matrix)) throw new ArgumentException("Object type is not Matrix"); var data = (Matrix)objectProvider.GetObject(); using (DataVisualizerForm f = new DataVisualizerForm()) { f.Text = "Matrix"; f.SetData(data); windowService.ShowDialog(f); } }
protected override void Show( IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider ) { Image image = (Image)objectProvider.GetObject(); using( ViewImageDialog dialog = new ViewImageDialog() ) { dialog.Image = image; windowService.ShowDialog( dialog ); } }
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { StringBuilder sb = new StringBuilder(); var pdb = (PdbDelta)objectProvider.GetObject(); string xml = PdbToXmlConverter.DeltaPdbToXml(pdb.Stream, Enumerable.Range(0x06000001, 0xff)); var viewer = new TextViewer(xml, "PDB"); viewer.ShowDialog(); }
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { tgEntityCollectionBase data = (tgEntityCollectionBase)objectProvider.GetObject(); using (esVisualizerForm displayForm = new esVisualizerForm(data)) { windowService.ShowDialog(displayForm); } }
protected override void Show( IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { using (var visualizer = new MockVisualizerForm(objectProvider.GetObject())) { windowService.ShowDialog(visualizer); } }
override protected void Show( IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider ) { BestCS.Math.Histogram histogram = ( BestCS.Math.Histogram) objectProvider.GetObject( ); HistogramView histogramView = new HistogramView( ); histogramView.SetHistogram( histogram ); windowService.ShowDialog( histogramView ); }
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { using (JsonVisualizerForm form = new JsonVisualizerForm()) { form.Viewer.Json = objectProvider.GetObject().ToString(); windowService.ShowDialog(form); } }
override protected void Show( IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider ) { Image image = (Image) objectProvider.GetObject( ); ImageView imageViewer = new ImageView( ); imageViewer.SetImage( image ); windowService.ShowDialog( imageViewer ); }
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { if (windowService == null) throw new ArgumentNullException("windowService"); if (objectProvider == null) throw new ArgumentNullException("objectProvider"); var cfg = (Configuration)objectProvider.GetObject(); using (var frmVisualizer = new FrmVisualizer(cfg)) windowService.ShowDialog(frmVisualizer); }
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { Trace.WriteLine(Assembly.GetCallingAssembly().FullName); var model = new MainViewModel(objectProvider.GetObject()); MainView win = new MainView(); win.DataContext = model; win.Title = "OxyPlot Visualizer"; win.ShowDialog(); }
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { var owner = objectProvider.GetObject(); var node = owner as AbstractNode; if (node != null) { AstView v = new AstView {Unit = node, Dock = DockStyle.Fill}; windowService.ShowDialog(v); } }
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { modalService = windowService; if (modalService == null) throw new NotSupportedException("This debugger does not support modal visualizers"); var containerDetail = (ContainerDetail) objectProvider.GetObject(); var form = new ContainerForm(containerDetail); modalService.ShowDialog(form); }
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { var cfgInDotFormat = objectProvider.GetObject().AssertCast <String>(); var dotFile = Path.GetTempFileName(); File.WriteAllText(dotFile, cfgInDotFormat); var pngFile = dotFile.RenderAsPng(); if (pngFile != null) { Process.Start(pngFile.FullName); } }
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { MyClass myClass = objectProvider.GetObject() as MyClass; if (objectProvider.IsObjectReplaceable && myClass != null) { StringBuilder sb = new StringBuilder(); sb.AppendLine("Here is"); sb.AppendLine("your multi line"); sb.AppendLine("visualizer"); sb.AppendLine($"of MyClass with count = {myClass.count}"); MessageBox.Show(sb.ToString()); } }
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { if (windowService == null) { throw new ArgumentNullException("windowService"); } if (objectProvider == null) { throw new ArgumentNullException("objectProvider"); } object data = (object)objectProvider.GetObject(); TestShowVisualizer(data); }
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { Image image = (Image)objectProvider.GetObject(); if (image != null) { using (ImageForm form = new ImageForm()) { form.ShowInTaskbar = false; form.Set(image); windowService.ShowDialog(form); } } }
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { IDebugForm form = CF.DebugForm; Model m = form.Model; GeoPoint p = (GeoPoint)objectProvider.GetObject(); Point pnt = Point.Construct(); pnt.Location = p; pnt.Symbol = PointSymbol.Cross; VisualizerHelper.AssertColor(pnt); m.Add(pnt); form.ShowDialog(windowService); }
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { string str = (string)objectProvider.GetObject(); if (str != null) { using (StringForm form = new StringForm()) { form.SetString(str); form.ShowInTaskbar = false; windowService.ShowDialog(form); } } }
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { // TODO: Get the object to display a visualizer for. // Cast the result of objectProvider.GetObject() // to the type of the object being visualized. object data = (object)objectProvider.GetObject(); // TODO: Display your view of the object. // Replace displayForm with your own custom Form or Control. MatchesVisualizerForm displayForm = new MatchesVisualizerForm(); displayForm.setDisplay((MatchCollection)data); windowService.ShowDialog(displayForm); }
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { System.Data.DataSet data = (System.Data.DataSet)objectProvider.GetObject(); DXChartVizualizerForm displayForm = new DXChartVizualizerForm(); try { displayForm.AcceptDataSet(data); } catch (Exception) { MessageBox.Show("Can't find column of the appropriate data type for the values."); return; } windowService.ShowDialog(displayForm); }
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { if (windowService == null) { throw new ArgumentNullException("windowService"); } if (objectProvider == null) { throw new ArgumentNullException("objectProvider"); } if (!(objectProvider.GetObject() is Vector)) { throw new ArgumentException("Object type is not Matrix"); } var data = (Vector)objectProvider.GetObject(); using (DataVisualizerForm f = new DataVisualizerForm()) { f.Text = "Vector"; f.SetData(data); windowService.ShowDialog(f); } }
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { if (windowService == null) { throw new ArgumentNullException("windowService"); } if (objectProvider == null) { throw new ArgumentNullException("objectProvider"); } // TODO: ビジュアライザーを表示する目的のオブジェクトを取得します。 // objectProvider.GetObject() の結果をキャスト // されるオブジェクトの型にキャストします。 var data = (MyProxy)objectProvider.GetObject(); //MyProxyからBitmapSourceを作成 var source = BitmapSource.Create(data.Width, data.Height, 96, 96, PixelFormats.Bgra32, null, data.Pixels, data.Stride); //Bitmapを作成して、BitmapSourceのデータをコピペ var bmp = new Bitmap(data.Width, data.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb); var bmpData = bmp.LockBits( new Rectangle(0, 0, bmp.Width, bmp.Height), System.Drawing.Imaging.ImageLockMode.ReadOnly, bmp.PixelFormat); source.CopyPixels(Int32Rect.Empty, bmpData.Scan0, bmpData.Height * bmpData.Stride, bmpData.Stride); bmp.UnlockBits(bmpData); var pictureBox = new PictureBox { Image = bmp, SizeMode = PictureBoxSizeMode.AutoSize }; // TODO: オブジェクトのビューを表示します。 // displayForm をユーザー独自のカスタム フォームまたはコントロールで置き換えます。 using (Form displayForm = new Form()) { displayForm.Text = data.ToString(); displayForm.Controls.Add(pictureBox); windowService.ShowDialog(displayForm); } bmp.Dispose(); pictureBox.Dispose(); }
/// <summary>Show the visualiser</summary> protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { // Note: Async visualisers aren't possible. It seems VS loads the visualiser in an // AppDomain and then kills it and everything it creates when this function returns. try { var obj = (TType)objectProvider.GetObject(); using (var dlg = (TForm)Activator.CreateInstance(typeof(TForm), obj)) windowService.ShowDialog(dlg); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("Visualiser Error: " + ex.Message); MessageBox.Show(ex.MessageFull()); } }
private static void ShowInternal(IVisualizerObjectProvider objectProvider) { var data = objectProvider.GetObject() as MatchCollection; if (data == null) { MessageBox.Show("Cannot Visualize this object type.", "Object Not Supported", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } var window = new MainWindow(data); window.ShowDialog(); }
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { try { object value = objectProvider.GetObject(); // 显示 using (JsonView jsonView = new JsonView(value.ToString())) { jsonView.ShowDialog(); } } catch (Exception e) { MessageBox.Show(e.StackTrace + e.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { modalService = windowService; if (modalService == null) { throw new NotSupportedException("This debugger does not support modal visualizers"); } var container = (ExpressionTreeContainer)objectProvider.GetObject(); var browser = new TreeBrowser(); browser.Add(container.TreeNode); var treeForm = new TreeWindow(browser, container.Expression); modalService.ShowDialog(treeForm); }
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { PresentationTraceSources.DataBindingSource.Listeners.Add(new DebugTraceListener()); ConfigKey = objectProvider.GetObject() as string ?? ""; var config = Persistence.Get <TConfig>(ConfigKey); var window = new TWindow(); window.Initialize(objectProvider, config); if (window.IsOpen) { window.ShowDialog(); } }
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { // MatProxyが送られてくるはず using (var proxy = objectProvider.GetObject() as MatProxy) { if (proxy == null) { throw new ArgumentException(); } // Formに表示 using (var form = new ImageViewer(proxy)) { windowService.ShowDialog(form); } } }
override protected void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { MDataTable dt = objectProvider.GetObject() as MDataTable; if (dt != null) { try { FormCreate.BindTable(windowService, dt, null); } catch (Exception err) { MessageBox.Show(err.Message); } } }
unsafe protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { var md = (MetadataDelta)objectProvider.GetObject(); var writer = new StringWriter(); fixed(byte *ptr = md.Bytes) { var reader = new MetadataReader(ptr, md.Bytes.Length, MetadataReaderOptions.ApplyWindowsRuntimeProjections); var visualizer = new MetadataVisualizer(reader, writer); visualizer.Visualize(); } var viewer = new TextViewer(writer.ToString(), "Metadata"); viewer.ShowDialog(); }
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { IDebugForm form = CF.DebugForm; Model m = form.Model; GeoObjectList list = (GeoObjectList)objectProvider.GetObject(); for (int i = 0; i < list.Count; ++i) { IntegerProperty ip = new IntegerProperty(i, "Debug.Hint"); list[i].UserData.Add("ListIndex", ip); m.Add(VisualizerHelper.AssertColor(list[i])); } m.Add(list); form.ShowDialog(windowService); }
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { var matrix = (Matrix)objectProvider.GetObject(); using (var form = new MatrixVisualizerForm(matrix)) { form.ShowDialog(); try { matrix = form.GetMatrix(); objectProvider.ReplaceObject(matrix); } catch { } } }
protected override void Show( IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { var propertyGrid = new PropertyGrid(); propertyGrid.Dock = DockStyle.Fill; propertyGrid.SelectedObject = objectProvider.GetObject(); Form form = new Form { Text = propertyGrid.SelectedObject.ToString() }; form.Controls.Add(propertyGrid); form.ShowModal(); }
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { try { var data = (ChannelGraphData)objectProvider.GetObject(); Graph graph = new ChannelGraphGenerator().CreateGraph(data); using (var form = new GraphVisualizerForm(graph, "Channel Visualizer")) windowService.ShowDialog(form); } catch (InvalidCastException) { MessageBox.Show("The selected data is not of a type compatible with this visualizer.", GetType().ToString()); } }
/// <summary> /// Display the visualizer user interface. /// </summary> /// <remarks>This method is used by Visual Studio, and is not intended to be called from your code.</remarks> /// <param name="windowService">An object of type <see cref="T:Microsoft.VisualStudio.DebuggerVisualizers.IDialogVisualizerService"></see>, which provides methods your visualizer can use to display Windows forms, controls, and dialogs.</param> /// <param name="objectProvider">An object of type <see cref="T:Microsoft.VisualStudio.DebuggerVisualizers.IVisualizerObjectProvider"></see>. This object provides communication from the debugger side of the visualizer to the object source (<see cref="T:Microsoft.VisualStudio.DebuggerVisualizers.VisualizerObjectSource"></see>) on the debuggee side.</param> protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { try { object data = objectProvider.GetObject(); if (data is ObjectListView) { using (VisualizerForm displayForm = new VisualizerForm()) { displayForm.View = (ObjectListView)data; windowService.ShowDialog(displayForm); } } else { // If ObjectListView<T> Type dataType = data.GetType(); if (dataType.IsGenericType && dataType.GetGenericTypeDefinition() == typeof(ObjectListView <>)) { // Construct a VisualizerForm<T> Type visType = typeof(VisualizerTForm <>); Type visConstructed = visType.MakeGenericType(data.GetType().GetGenericArguments()); object v = Activator.CreateInstance(visConstructed); PropertyInfo view = visConstructed.GetProperty("View"); view.SetValue(v, data, null); Form visualizerForm = (Form)v; using (visualizerForm) { windowService.ShowDialog(visualizerForm); } } } } catch (Exception ex) { if (ex.GetType().Name == "RemoteObjectSourceException") // it's an internal type that derives directly from System.Exception { MessageBox.Show("The visualizer cannot be displayed because your list item type is not marked Serializable.", "Visualizer Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { throw; } } }
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { UnmanagedObject matND = objectProvider.GetObject() as UnmanagedObject; if (matND != null) { MCvMatND cvMatND = (MCvMatND)Marshal.PtrToStructure(matND.Ptr, typeof(MCvMatND)); if (cvMatND.dims > 3 || (cvMatND.dims == 3 && cvMatND.dim[2].Size > 4)) { MessageBox.Show("MatND of dimension > 3 is not supported for debugger visualizer"); return; } UnmanagedObject matrix = null; int rows = cvMatND.dim[0].Size; int cols = cvMatND.dims >= 2 ? cvMatND.dim[1].Size : 1; int channels = cvMatND.dims >= 3 ? cvMatND.dim[2].Size : 1; if (matND is MatND <float> ) { matrix = new Matrix <float>(rows, cols, channels); } else if (matND is MatND <int> ) { matrix = new Matrix <int>(rows, cols, channels); } else if (matND is MatND <double> ) { matrix = new Matrix <double>(rows, cols, channels); } if (matrix == null) { MessageBox.Show(String.Format("{0} is not supported", cvMatND.type.ToString())); return; } CvInvoke.cvCopy(matND.Ptr, matrix.Ptr, IntPtr.Zero); using (MatrixViewer viewer = new MatrixViewer()) { viewer.Matrix = matrix; windowService.ShowDialog(viewer); } } }
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { if (windowService != null) { if (objectProvider != null) { var obj = objectProvider.GetObject() as QueryData; if (obj != null) { var form = new EfVisualizerForm(); if (!string.IsNullOrEmpty(obj.ExceptionMessage)) { form.SetDebugText(string.Format("Error:{0}{1}", Environment.NewLine, obj.ExceptionMessage)); } else { form.SetDebugText(obj.SQLCommand); } DialogResult dialogResult = windowService.ShowDialog(form); bool flag; if (!objectProvider.IsObjectReplaceable) { flag = true; } else { flag = dialogResult != DialogResult.OK; } if (!flag) { objectProvider.ReplaceObject(obj); } } } else { throw new ArgumentNullException("objectProvider"); } } else { throw new ArgumentNullException("windowService"); } }
override protected void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { Image image = (Image)objectProvider.GetObject(); Form form = new Form(); form.Text = string.Format("Width: {0}, Height: {1}", image.Width, image.Height); form.ClientSize = new Size(image.Width, image.Height); form.FormBorderStyle = FormBorderStyle.FixedToolWindow; PictureBox pictureBox = new PictureBox(); pictureBox.Image = image; pictureBox.Parent = form; pictureBox.Dock = DockStyle.Fill; windowService.ShowDialog(form); }
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { if (windowService == null) { throw new ArgumentNullException("windowService"); } if (objectProvider == null) { throw new ArgumentNullException("objectProvider"); } object data = (object)objectProvider.GetObject(); PlotCollectionSet set = data as PlotCollectionSet; FormPlotCollection dlg = new FormPlotCollection(set); windowService.ShowDialog(dlg); }
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { IDebugForm form = CF.DebugForm; Model m = form.Model; Border bdr = (Border)objectProvider.GetObject(); for (int i = 0; i < bdr.DebugList.Count; ++i) { IGeoObject toAdd = bdr.DebugList[i]; IntegerProperty ip = new IntegerProperty(i, "Debug.Hint"); toAdd.UserData.Add("Debug", ip); VisualizerHelper.AssertColor(toAdd); m.Add(toAdd); } form.ShowDialog(windowService); }
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { object arrayObj = objectProvider.GetObject(); if (!arrayObj.GetType().IsArray || arrayObj.GetType().GetElementType() != typeof(double)) { MessageBox.Show("Expected an array of kind: double[ , 2]", "Wasted!", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } double[,] a = (double[, ])arrayObj; //double[,] array = Array.ConvertAll<object[], double[]>((object[,])arrayObj, xs => Array.ConvertAll<object, double>(xs, x => (double)x)); using (var form = new LineForm()) { form.SetData(a); windowService.ShowDialog(form); } }
/// <summary> /// Shows the debugger window. This method MUST complete everything it needs sychronously before ending. /// </summary> /// <param name="windowService"></param> /// <param name="objectProvider"></param> protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { if (windowService == null) { throw new ArgumentNullException(nameof(windowService)); } if (objectProvider == null) { throw new ArgumentNullException(nameof(objectProvider)); } if (!(objectProvider.GetObject() is DataTable table)) { throw new InvalidOperationException("Only works on DataTables"); } sendToVsToolWindow(table).Wait(OVERALL_TIMEOUT); }