public Form1()
        {
            InitializeComponent();

            SnapFieldListTreeView treeView = fieldListDockPanel1.Controls[0].Controls[0] as SnapFieldListTreeView;

            // Customize the context menu.
            MenuCommandHandler menuCommandHandler = new MyMenuCommandHandler(snapControl1);

            menuCommandHandler.RegisterMenuCommands();
            snapControl1.ReplaceService <MenuCommandHandler>(menuCommandHandler);

            // Remove the Parameters node.
            IDataSourceCollectorService  oldService = snapControl1.GetService <IDataSourceCollectorService>();
            MyDataSourceCollectorService newService = new MyDataSourceCollectorService(oldService);

            snapControl1.ReplaceService <IDataSourceCollectorService>(newService);
            SnapFieldListTreeView view = fieldListDockPanel1.Controls[0].Controls[0] as SnapFieldListTreeView;

            view.AllowSvgImages = false;
            view.UpdateDataSource(snapControl1, newService.GetDataSources());

            #region #FieldListDockPanel_Options
            // Retain the original field order in the tree.
            fieldListDockPanel1.SortOrder = SortOrder.None;
            // Display nested fields at the bottom.
            fieldListDockPanel1.ShowComplexProperties = DevExpress.XtraReports.Design.ShowComplexProperties.Last;
            // Specify the Data Explorer window caption.
            fieldListDockPanel1.Text = "My Data";
            #endregion #FieldListDockPanel_Options
        }
Пример #2
0
 public MyDataSourceCollectorService(IDataSourceCollectorService oldService)
 {
     innerService = oldService;
 }