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


C# IVisualizerObjectProvider.GetData方法代码示例

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


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

示例1: Show

        protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider provider)
        {
            using (Form form1 = new Form())
            {
                form1.Text = "FormCollection Visualizer";
                form1.StartPosition = FormStartPosition.WindowsDefaultLocation;
                form1.SizeGripStyle = SizeGripStyle.Auto;
                form1.ShowInTaskbar = false;
                form1.ShowIcon = false;

                DataTable dt;

                using (Stream stream = provider.GetData())
                {
                    BinaryFormatter bformatter = new BinaryFormatter();

                    dt = (DataTable)bformatter.Deserialize(stream);

                    stream.Close();
                }

                DataGridView gridView = new DataGridView();
                gridView.Dock = DockStyle.Fill;

                form1.Controls.Add(gridView);

                gridView.DataSource = dt;

                windowService.ShowDialog(form1);
            }
        }
开发者ID:piotrosz,项目名称:DebugVisualizersCollection,代码行数:31,代码来源:FormCollectionVisualizer.cs

示例2: Show

        protected override void Show(IDialogVisualizerService p_windowService, IVisualizerObjectProvider p_objectProvider)
        {
            try
            {
                // Get data from VisualizerBase as Stream
                using (Stream objStreamData = p_objectProvider.GetData())
                {
                    BinaryFormatter bf = new BinaryFormatter();

                    // Create instance from that stream
                    BaseTable objBaseVisualizer = (BaseTable)bf.Deserialize(objStreamData);

                    // We get the first table in list (since we only use this one in DataTable visualizer)
                    VisualizerBaseTable objTable = objBaseVisualizer.MyTableToVisualize[0];

                    // We create new Form
                    VisualizerForm frmVisualizerForm = new VisualizerForm(objTable);

                    // And walla
                    frmVisualizerForm.ShowDialog();
                }
            }
            catch (Exception ex)
            {
                UiHelper.MyMessageBox("Error while opening " + UiHelper.APP_NAME + " - DataTable Visualizer", ex);
            }
        }
开发者ID:itsho,项目名称:ItshoMultiVisualizer,代码行数:27,代码来源:DataTableDebuggerVisualizer.cs

示例3: Show

        protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
        {
            Stream pixbuf_stream = objectProvider.GetData();
            BinaryReader reader = new BinaryReader (pixbuf_stream);

            bool has_alpha;
            int bits_per_sample, width, height, rowstride;
            Gdk.Pixbuf pixbuf;

            has_alpha = reader.ReadBoolean ();
            bits_per_sample = reader.ReadInt32 ();
            width = reader.ReadInt32 ();
            height = reader.ReadInt32 ();
            rowstride = reader.ReadInt32 ();

            int size = height * rowstride;

            byte[] pixbuf_data = new byte [size];

            reader.Read (pixbuf_data, 0, size);

            pixbuf = new Pixbuf (Gdk.Colorspace.Rgb, has_alpha, bits_per_sample, width, height);

            Marshal.Copy (pixbuf_data, 0, pixbuf.Pixels, size);

            PixbufWindow win = new PixbufWindow ("Pixbuf Visualizer", pixbuf);

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

示例4: Show

        protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
        {
            try
            {
                var obj = objectProvider.GetData();
                var modelNode = new M2ModelDialogDebuggerVisualizerService().DeserializeDataFromStream<ModelNode>(obj);

                var form = new Form
                {
                    ClientSize = new Size(800, 600),
                    FormBorderStyle = FormBorderStyle.FixedToolWindow,
                };

                var treeView = new TreeView();
                treeView.Parent = form;
                treeView.Dock = DockStyle.Fill;

                InitNodes(treeView.Nodes, modelNode);
                treeView.ExpandAll();

                windowService.ShowDialog(form);
            }
            catch (Exception e)
            {
                // TODO
                throw;
            }
        }
开发者ID:SubPointSolutions,项目名称:spmeta2-vsixextensions,代码行数:28,代码来源:M2ModelDialogDebuggerVisualizer.cs

示例5: Show

        protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
        {
            var msg = new StreamReader(objectProvider.GetData()).ReadToEnd();

            var form = new AsposeVisualizerForm();
            form.SetText(msg);

            windowService.ShowDialog(form);
        }
开发者ID:ursenzler,项目名称:AsposeVisualizer,代码行数:9,代码来源:AsposeDialogDebuggerVisualizer.cs

示例6: Show

        protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
        {
            var stream = objectProvider.GetData();
            var reader = new StreamReader(stream);
            var text = reader.ReadToEnd();

            var viewer = new TextViewer(text, "IL");
            viewer.ShowDialog();
        }
开发者ID:CAPCHIK,项目名称:roslyn,代码行数:9,代码来源:ILDeltaDebuggerVisualizer.cs

示例7: ReadData

 private XElement ReadData(IVisualizerObjectProvider objectProvider)
 {
     var data = new XElement("Result");
     using (var sr = new IO.StreamReader(objectProvider.GetData()))
     {
         data = XElement.Parse(sr.ReadToEnd());
     }
     return data;
 }
开发者ID:iBener,项目名称:projets,代码行数:9,代码来源:VisualizerDataSource.cs

示例8: Show

        /// <summary>
        /// The format of the query information and the desired UI will usually depend on the Linq to SQLq provider
        /// used by the query. 
        /// Therefore in this general query visualizer we only read the assembly and class for the specific
        /// query visualizer from the Stream and call the method "Display" on this class, which in turn will
        /// read the query information and show the UI.         
        /// </summary>
        /// <param name="windowService"> used to display the UI </param>
        /// <param name="objectProvider"> used to retrieve the data (as Stream) from the visualizer proxy</param>
        protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
        {
            Stream rawStream = objectProvider.GetData();

            //call visualizer to serialize query info
            Visualizer qv = new Visualizer();

            qv.Display(windowService, rawStream);
        }
开发者ID:jaecheol,项目名称:linq-to-sql-query-visualizer,代码行数:18,代码来源:QueryExecution.cs

示例9: Show

        protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
        {
            var formatter = new BinaryFormatter();
            var data = formatter.Deserialize(objectProvider.GetData());

            if (data is InternalColorFrame)
            {
                windowService.ShowDialog(new Kinect2DFrameVisualizerForm(data as InternalColorFrame, true) { Text = Properties.Resources.ColorFrameImageDialogDebuggerVisualizer });
            }
        }
开发者ID:andreasassetti,项目名称:Kinect-v2-Visual-Studio-Visualizer,代码行数:10,代码来源:ColorFrameImageDialogDebuggerVisualizer.cs

示例10: Show

        protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
        {
            var streamReader = new StreamReader(objectProvider.GetData());
            var stateMachineSource = streamReader.ReadToEnd();

            var pointer = (int)stateMachineSource[0];

            var form = new StateMachineVisualiserForm(pointer, stateMachineSource.Substring(1));
            windowService.ShowDialog(form);
        }
开发者ID:bruinbrown,项目名称:Brainfuck-Interpreter,代码行数:10,代码来源:StateMachineVisualiser.cs

示例11: Show

        protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
        {
            var dynamicDebuggerVisualizer = new DynamicDebuggerVisualizer();
            var dataStream = objectProvider.GetData();

            if (dataStream.Length == 0) return;

            var formToShow = dynamicDebuggerVisualizer.ShowLINQPad(dataStream, VsReferencedVersion);

            if (!IsTest())
                windowService.ShowDialog(formToShow);
        }
开发者ID:workwebresources,项目名称:LINQBridgeVs,代码行数:12,代码来源:DynamicDebuggerVisualizerV11.cs

示例12: Show

 protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
 {
     Stream incomingData = objectProvider.GetData();
     BinaryFormatter formatter = new BinaryFormatter();
     string name = (string)formatter.Deserialize(incomingData);
     Bitmap pixeldata = (Bitmap)formatter.Deserialize(incomingData);
     using (BitmapForm form = new BitmapForm()) {
         form.Text = name;
         form.Bitmap = pixeldata;
         windowService.ShowDialog(form);
     }
 }
开发者ID:SirePi,项目名称:duality,代码行数:12,代码来源:BitmapVisualizer.cs

示例13: Show

        protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
        {
            if (windowService == null)
                throw new ArgumentNullException("windowService");
            if (objectProvider == null)
                throw new ArgumentNullException("objectProvider");

            var reader = new BinaryReader(objectProvider.GetData());
            var width  = reader.ReadInt32(); // unchecked uint to int conversion
            var height = reader.ReadInt32(); // unchecked uint to int conversion
            var src = reader.ReadBytes(reader.ReadInt32());
            
            using (var form = new Form())
            using (var pb = new PictureBox())
            {
                var bmp = new Bitmap(width, height);
                var data = bmp.LockBits(new Rectangle(0, 0, width, height), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
                var length = height * data.Stride;
                var pixels = new byte[length];
                for (int i = 0; i < length; i += 4)
                {
                    pixels[i + 0] = src[i + 2];
                    pixels[i + 1] = src[i + 1];
                    pixels[i + 2] = src[i + 0];
                    pixels[i + 3] = src[i + 3];
                }
                System.Runtime.InteropServices.Marshal.Copy(pixels, 0, data.Scan0, length);
                bmp.UnlockBits(data);

                var transGrid = new Bitmap(16, 16); // Checkerboard pattern for transparent images.
                using (var g = System.Drawing.Graphics.FromImage(transGrid))
                {
                    g.Clear(Color.FromArgb(102, 102, 102));
                    var brush = new SolidBrush(Color.FromArgb(153, 153, 153));
                    g.FillRectangle(brush, 0, 0, 8, 8);
                    g.FillRectangle(brush, 8, 8, 8, 8);
                }
                
                form.Controls.Add(pb);
                form.ClientSize = bmp.Size;
                form.Width = Math.Max(form.Width, 200);
                form.Text = string.Format("Texture Visualizer ({0:#,##0} x {1:#,##0})", width, height);
                form.BackgroundImage = transGrid;
                form.BackgroundImageLayout = ImageLayout.Tile;
                pb.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Right | AnchorStyles.Left;
                pb.Bounds = form.ClientRectangle;
                pb.SizeMode = PictureBoxSizeMode.Zoom;
                pb.Image = bmp;
                pb.BackColor = Color.Transparent;

                windowService.ShowDialog(form);
            }
        }
开发者ID:MSylvia,项目名称:space-station-14,代码行数:53,代码来源:TextureVisualizer.cs

示例14: Show

        protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
        {
            string contents = new StreamReader(objectProvider.GetData()).ReadToEnd();

            var pictureBox = new PictureBox()
            {
                Size = new Size(100, 100),
                BackColor = Color.FromArgb(int.Parse(contents)),
                Dock = DockStyle.Fill
            };

            windowService.ShowDialog(pictureBox);
        }
开发者ID:orangutanboy,项目名称:Visualiser-Demo-With-Custom-ObjectSource,代码行数:13,代码来源:DemoObjectVisualiser.cs

示例15: Show

        protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
        {
            // Deserialize the Stream returned by GetData() into a string
            String vars = null;
            using (Stream dataStream = objectProvider.GetData())
            {
                BinaryFormatter formatter = new BinaryFormatter();
                vars = formatter.Deserialize(dataStream) as String;
            }

            // Create the user interface form, passing in the NameValueCollection
            using (VisualizerForm displayForm = new VisualizerForm())
            {
                displayForm.Visualize(vars);
                windowService.ShowDialog(displayForm);
            }
        }
开发者ID:Xangis,项目名称:HexStringVisualizer,代码行数:17,代码来源:Visualizer.cs


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