当前位置: 首页>>代码示例>>C#>>正文


C# IVisualizerObjectProvider.GetObject方法代码示例

本文整理汇总了C#中IVisualizerObjectProvider.GetObject方法的典型用法代码示例。如果您正苦于以下问题:C# IVisualizerObjectProvider.GetObject方法的具体用法?C# IVisualizerObjectProvider.GetObject怎么用?C# IVisualizerObjectProvider.GetObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IVisualizerObjectProvider的用法示例。


在下文中一共展示了IVisualizerObjectProvider.GetObject方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Show

        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);
            }
        }
开发者ID:piotrosz,项目名称:DebugVisualizersCollection,代码行数:25,代码来源:FontVisualizer.cs

示例2: Show

        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();
        }
开发者ID:siranen,项目名称:ImageVisualizer,代码行数:26,代码来源:BitmapImageVisualizer.cs

示例3: Show

        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);
            }
        }
开发者ID:Rdot,项目名称:ExtendedVisualizers,代码行数:30,代码来源:ExtendedDataSetVisualizer.cs

示例4: Show

        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");
            }
        }
开发者ID:scottjustin5000,项目名称:Visualizers,代码行数:33,代码来源:EfQueryVisualizer.cs

示例5: Show

 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();
 }
开发者ID:ehsansajjad465,项目名称:roslyn,代码行数:7,代码来源:ILDebuggerVisualizer.cs

示例6: Show

        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);
            }
        }
开发者ID:Dason1986,项目名称:Lib,代码行数:28,代码来源:ImageVisualizer.cs

示例7: Show

        protected override void Show(IDialogVisualizerService windowService,
                                     IVisualizerObjectProvider objectProvider)
        {
            var board = (objectProvider.GetObject()) as Board;

            new GoBoardForm(board).ShowDialog();
        }
开发者ID:RayyLim,项目名称:GoGame,代码行数:7,代码来源:BoardDebuggerVisualizers.cs

示例8: Show

        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);
        }
开发者ID:Slesa,项目名称:Playground,代码行数:29,代码来源:BitmapVisualizer.cs

示例9: Show

        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));
                    }
                }
            }
        }
开发者ID:vfrank66,项目名称:DbVisualizer,代码行数:27,代码来源:DSVisualizer.cs

示例10: Show

        /// <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;
            }
        }
开发者ID:eladnava,项目名称:chrome-visualizer,代码行数:64,代码来源:DebuggerIntegration.cs

示例11: Show

        protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
        {
            StringWindow win = new StringWindow (objectProvider.GetObject().ToString());

            win.Editable = objectProvider.IsObjectReplaceable;

            win.Show ();
        }
开发者ID:mono,项目名称:monodevelop-visualizers,代码行数:8,代码来源:StringVisualizer.cs

示例12: Show

 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);
 }
开发者ID:mrsheen,项目名称:VS2010-Image-Debugger-Visualizer,代码行数:8,代码来源:ImageVisualizer.cs

示例13: Show

 protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
 {
     var window = new Window
     {
         Content = new View((IEnumerable<object>) objectProvider.GetObject())
     };
     window.ShowDialog();
 }
开发者ID:JohanLarsson,项目名称:ListVisualizer,代码行数:8,代码来源:Visualizer.cs

示例14: 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());
 }
开发者ID:opencx,项目名称:Visual-Studio-Visualizer,代码行数:8,代码来源:CollectionVisualizer.cs

示例15: Show

        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);
        }
开发者ID:unclepaul84,项目名称:fixmessagevisualizer,代码行数:8,代码来源:FixMessageDebugVisualizer.cs


注:本文中的IVisualizerObjectProvider.GetObject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。