Beispiel #1
0
        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));
                    }
                }
            }
        }
Beispiel #2
0
        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));
                    }
                }
            }
        }
Beispiel #3
0
        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, "DataRowCollection Visualizer");

                    DialogResult dr = windowService.ShowDialog(main);

                    if (objectProvider.IsObjectReplaceable && dr == DialogResult.OK)
                    {
                        objectProvider.TransferData(StreamSerializer.ObjectToStream(null, dt));
                    }
                }
            }
        }
Beispiel #4
0
        protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
        {
            if (windowService == null)
            {
                throw new ArgumentNullException("windowService");
            }
            if (objectProvider == null)
            {
                throw new ArgumentNullException("objectProvider");
            }

            DataSet ds = objectProvider.GetObject() as DataSet;

            if (ds != null)
            {
                using (FormMainDataSet main = new FormMainDataSet())
                {
                    main.Init(ds, objectProvider.IsObjectReplaceable);

                    DialogResult dr = windowService.ShowDialog(main);

                    if (objectProvider.IsObjectReplaceable && dr == DialogResult.OK)
                    {
                        objectProvider.ReplaceObject(ds);
                    }
                }
            }
        }
Beispiel #5
0
        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, "DataRowCollection Visualizer");

                    DialogResult dr = windowService.ShowDialog(main);

                    if (objectProvider.IsObjectReplaceable && dr == DialogResult.OK)
                        objectProvider.TransferData(StreamSerializer.ObjectToStream(null, dt));
                }
            }
        }
Beispiel #6
0
        protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
        {
            if (windowService == null)
                throw new ArgumentNullException("windowService");
            if (objectProvider == null)
                throw new ArgumentNullException("objectProvider");

            DataSet ds = objectProvider.GetObject() as DataSet;

            if (ds != null)
            {
                using (FormMainDataSet main = new FormMainDataSet())
                {
                    main.Init(ds, objectProvider.IsObjectReplaceable);

                    DialogResult dr = windowService.ShowDialog(main);

                    if (objectProvider.IsObjectReplaceable && dr == DialogResult.OK)
                        objectProvider.ReplaceObject(ds);
                }
            }
        }