private static DataStoreCollection LoadLastWrittenXmlDataStoreCollection()
        {
            System.Diagnostics.Debug.Write("[START]" + "LoadLastWrittenXmlDataStoreCollection");
            System.Diagnostics.Trace.Write("[START]" + "LoadLastWrittenXmlDataStoreCollection");
            System.Console.WriteLine("[START]" + "LoadLastWrittenXmlDataStoreCollection");
            System.IO.FileInfo fi = Global.GetLastWrittenXmlFileInfo( );
            if (fi == null)
            {
                return(null);
            }
            // The session creation must be before the object creation!!!
            string tffpn = CreateSession2TmpFs( );

            System.Diagnostics.Debug.Write("[START]" + fi.FullName);
            System.Diagnostics.Trace.Write("[START]" + fi.FullName);
            System.Console.WriteLine("[START]" + fi.FullName);
            DataStoreCollection dsColl = DataStoreCollection.LoadXML(fi.FullName);

            System.Console.WriteLine("[  END]" + fi.FullName);
            System.Diagnostics.Debug.Write("[  END]" + fi.FullName);
            System.Diagnostics.Trace.Write("[  END]" + fi.FullName);
            dsColl.ID = 0;
            dsColl.OrigFileFullPathName = fi.FullName;
            dsColl.TempFileFullPathName = tffpn;
            //SaveDataStoreCollection( dsColl );
            //
            return(dsColl);
        }
Пример #2
0
		/// <summary>
		/// Creates a model with 100 items, with index as Id.
		/// </summary>
		public static DataStoreCollection CreateModel()
		{
			var model = new DataStoreCollection();
			for (var i = 0; i < ItemCount; ++i)
				model.Add(new DataItem(i));
			return model;
		}
Пример #3
0
        Control GridView()
        {
            var control = new GridView {
                Size = new Size(-1, 150)
            };

            control.Columns.Add(new GridColumn {
                DataCell = new ImageViewCell(0), HeaderText = "Image"
            });
            control.Columns.Add(new GridColumn {
                DataCell = new CheckBoxCell(1), HeaderText = "Check", Editable = true
            });
            control.Columns.Add(new GridColumn {
                DataCell = new TextBoxCell(2), HeaderText = "Text", Editable = true
            });
            control.Columns.Add(new GridColumn {
                DataCell = new ComboBoxCell(3)
                {
                    DataStore = ComboCellItems()
                }, HeaderText = "Combo", Editable = true
            });

            var items = new DataStoreCollection();

            items.Add(new GridItem(bitmap1, true, "Text in Grid 1", "1"));
            items.Add(new GridItem(icon1, false, "Text in Grid 2", "2"));
            items.Add(new GridItem(bitmap1, null, "Text in Grid 3", "3"));

            control.DataStore = items;

            return(control);
        }
Пример #4
0
        private void AddDirsInListViewFile(IEnumerable <OsFile> dirs, IEnumerable <OsFile> files, string parentPath)
        {
            _dataStore.Clear();

            var item = new DataStoreCollection <FileInfoView>();

            //显示dirs
            foreach (OsFile dir in dirs)
            {
                //移除最后的'/'符号
                string dirName = dir.FileName.Remove(dir.FileName.Length - 1, 1);
                //添加fileInfo
                string fullName = Path.Combine(new string[] { parentPath, dirName }) + (_isWin ? "\\" : "/");
                item.Add(new FileInfoView(dirName, fullName, true, dir.FileMTime, dir.FileSize, dir.FilePerms));
            }
            //显示files
            foreach (OsFile file in files)
            {
                //添加fileInfo
                string dirName  = file.FileName;
                string fullName = Path.Combine(new string[] { parentPath, dirName });
                item.Add(new FileInfoView(dirName, fullName, false, file.FileMTime, file.FileSize, file.FilePerms));
            }
            _dataStore.AddRange(item);
        }
Пример #5
0
		public GridViewSection()
		{
			var layout = new DynamicLayout();

			layout.AddRow(new Label { Text = "Default" }, Default());
			layout.AddRow(new Label { Text = "No Header,\nNon-Editable" }, NoHeader());
#if DESKTOP
			layout.BeginHorizontal();
			layout.Add(new Label { Text = "Context Menu\n&& Multi-Select\n&& Filter" });
			layout.BeginVertical();
			layout.Add(filterText = new SearchBox { PlaceholderText = "Filter" });
			var withContextMenuAndFilter = WithContextMenuAndFilter();
			layout.Add(withContextMenuAndFilter);
			layout.EndVertical();
			layout.EndHorizontal();

			var selectionGridView = Default(addItems: false);
			layout.AddRow(new Label { Text = "Selected Items" }, selectionGridView);

			// hook up selection of main grid to the selection grid
			withContextMenuAndFilter.SelectionChanged += (s, e) =>
			{
				var items = new DataStoreCollection();
				items.AddRange(withContextMenuAndFilter.SelectedItems);
				selectionGridView.DataStore = items;
			};
#endif

			Content = layout;
		}
Пример #6
0
		public void Setup()
		{
			Application.Instance.Invoke(() =>
			{
				model = GridViewUtils.CreateModel();
				d = new DataStoreView { Model = model };
			});
		}
Пример #7
0
        public SectionListGridView(IEnumerable <Section> topNodes)
        {
            gridView = new GridView {
                ShowCellBorders = false
            };
            gridView.Columns.Add(new GridColumn {
                HeaderText = "Name", Width = 100, AutoSize = false, DataCell = new TextBoxCell("Name"), Sortable = true
            });
            gridView.Columns.Add(new GridColumn {
                HeaderText = "Section", DataCell = new TextBoxCell("SectionName"), Sortable = true
            });
            var items = new DataStoreCollection();

            foreach (var section in topNodes)
            {
                foreach (var test in section)
                {
                    items.Add(new MyItem {
                        Name        = (test as ISectionName).Text,
                        SectionName = (section as ISectionName).Text,
                        Section     = test,
                    });
                }
            }
            gridView.DataStore         = items;
            gridView.SelectionChanged += OnSelectedItemChanged;

            layout = new DynamicLayout();
            layout.Add(filterText = new SearchBox {
                PlaceholderText = "Filter"
            });
            layout.Add(gridView);

            // Filter
            filterText.TextChanged += (s, e) => {
                var filterItems = (filterText.Text ?? "").Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);

                // Set the filter delegate on the GridView
                gridView.Filter = (filterItems.Length == 0) ? (Func <object, bool>)null : o => {
                    var i       = o as MyItem;
                    var matches = true;

                    // Every item in the split filter string should be within the Text property
                    foreach (var filterItem in filterItems)
                    {
                        if (i.Name.IndexOf(filterItem, StringComparison.CurrentCultureIgnoreCase) == -1 &&
                            i.SectionName.IndexOf(filterItem, StringComparison.CurrentCultureIgnoreCase) == -1)
                        {
                            matches = false;
                            break;
                        }
                    }

                    return(matches);
                };
            };
        }
Пример #8
0
        static void Main()
        {
            System.Windows.Forms.Application.EnableVisualStyles( );
            System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false);

            DevExpress.UserSkins.BonusSkins.Register( );
            DevExpress.Skins.SkinManager.EnableFormSkins( );

            dsColl = DataStoreCollection.Load(DataStoreCollectionFileName);
            {
                DataStoreXtraForm o = new DataStoreXtraForm(dsColl);
                o.taskbarAssistant1.ProgressMode = DevExpress.Utils.Taskbar.Core.TaskbarButtonProgressMode.Error;
                //o.taskbarAssistant1.ProgressMode = DevExpress.Utils.Taskbar.Core.TaskbarButtonProgressMode.Indeterminate;
                //o.taskbarAssistant1.ProgressMode = DevExpress.Utils.Taskbar.Core.TaskbarButtonProgressMode.NoProgress;
                //o.taskbarAssistant1.ProgressMode = DevExpress.Utils.Taskbar.Core.TaskbarButtonProgressMode.Normal;
                //o.taskbarAssistant1.ProgressMode = DevExpress.Utils.Taskbar.Core.TaskbarButtonProgressMode.Paused;
                System.Windows.Forms.Application.Run(o);
                //o.taskbarAssistant1.ProgressMaximumValue = 10;
                //o.taskbarAssistant1.ProgressCurrentValue = 2;
                //o.taskbarAssistant1.Refresh( );
                //o.taskbarAssistant1.ProgressCurrentValue = 5;
                //o.taskbarAssistant1.Refresh( );
                //o.taskbarAssistant1.ProgressCurrentValue = 1;
                //o.taskbarAssistant1.Refresh( );
                //o.taskbarAssistant1.ProgressCurrentValue = 8;
                //o.taskbarAssistant1.Refresh( );
                //o.taskbarAssistant1.ProgressCurrentValue = 10;
                //o.taskbarAssistant1.Refresh( );
                {
                    // Create a regular custom button.
                    var svgBitmap = DevExpress.Utils.Svg.SvgBitmap.FromFile(@"D:\users\user01\source\repos\TreeListControlPOC\AQBTest\images\icons\db_red.svg");
                    DevExpress.XtraBars.Alerter.AlertButton btn1 = new DevExpress.XtraBars.Alerter.AlertButton(svgBitmap.Render(null, 0.5));
                    btn1.Hint = "Open file";
                    btn1.Name = "buttonOpen";
                    // Create a check custom button.
                    var svgBitmap1 = DevExpress.Utils.Svg.SvgBitmap.FromFile(@"D:\users\user01\source\repos\TreeListControlPOC\AQBTest\images\icons\sch_red.svg");

                    DevExpress.XtraBars.Alerter.AlertButton btn2 = new DevExpress.XtraBars.Alerter.AlertButton(svgBitmap1.Render(null, 0.5));
                    btn2.Style = DevExpress.XtraBars.Alerter.AlertButtonStyle.CheckButton;
                    btn2.Down  = true;
                    btn2.Hint  = "Alert On";
                    btn2.Name  = "buttonAlert";
                    // Add buttons to the AlertControl and subscribe to the events to process button clicks
                    o.alertControl1.Buttons.Add(btn1);
                    o.alertControl1.Buttons.Add(btn2);
                    o.alertControl1.ButtonClick       += new DevExpress.XtraBars.Alerter.AlertButtonClickEventHandler(alertControl1_ButtonClick);
                    o.alertControl1.ButtonDownChanged += new DevExpress.XtraBars.Alerter.AlertButtonDownChangedEventHandler(alertControl1_ButtonDownChanged);
                }
                // Show a sample alert window.
                DevExpress.XtraBars.Alerter.AlertInfo info = new DevExpress.XtraBars.Alerter.AlertInfo("New Window", "Text");
                o.alertControl1.Show(o, info);
            }
            dsColl.Save(DataStoreCollectionFileName);
            CreateToastNotificationsManager( );
            PullRemotely(dsColl);
        }
Пример #9
0
 public void Setup()
 {
     Application.Instance.Invoke(() =>
     {
         model = GridViewUtils.CreateModel();
         d     = new DataStoreView {
             Model = model
         };
     });
 }
 private static void SaveDataStoreCollection(DataStoreCollection dsColl)
 {
     // The session creation must be before the object creation!!!
     //DevExpress.Xpo.Session session = DevExpress.Xpo.XpoDefault.Session; // DevExpress.Xpo.Session.DefaultSession;
     //session.Save( dsColl );
     //foreach( DataStore ds in dsColl.List )
     //{
     //   session.Save( ds );
     //}
 }
Пример #11
0
        /// <summary>
        /// Creates a model with 100 items, with index as Id.
        /// </summary>
        public static DataStoreCollection CreateModel()
        {
            var model = new DataStoreCollection();

            for (var i = 0; i < ItemCount; ++i)
            {
                model.Add(new DataItem(i));
            }
            return(model);
        }
        public static DataStoreCollection LoadDataStoreCollection()
        {
            DataStoreCollection dsColl = dsColl = DataStoreCollection.LoadLastWrittenXmlDataStoreCollection( );

            if (dsColl == null)
            {
                dsColl = DataStoreCollection.CreateBootstrapDataStoreCollection( );
            }
            return(dsColl);
        }
        private static DataStoreCollection CreateBootstrapDataStoreCollection()
        {
            string tfn = CreateSession2TmpFs( );
            //
            DataStoreCollection dsColl = new DataStoreCollection( )
            {
                IsActive             = true,
                OrigFileFullPathName = null,
                TempFileFullPathName = tfn,
                Name = "<Name-PlaceHolder>"
            };

            {
                SaveDataStoreCollection(dsColl);
                {
                    DataStore o = dsColl.NewDataStoreTemplate( );
                    o.CID              = dsColl.ID;
                    o.Name             = "ChiNook";
                    o.ConnectionString = @"Data Source=D:\TEMP\SQLite\chinook\chinook.db;";
                    o.IsActive         = true;
                    o.IsToPullRemotely = false;
                    o.Preview          = o.Description = null;
                    o.SyntaxProvider   = (int)DataStore.SyntaxProviderEnum.SQLITE;
                    o.WithFields       = true;
                }
                {
                    DataStore o = dsColl.NewDataStoreTemplate( );
                    o.CID              = dsColl.ID;
                    o.Name             = "MSSServer Test";
                    o.ConnectionString = @"Data Source=DBSRV\QWERTY;Database=Sales;User Id=user02;Password=8a0IucJ@Nx1Qy5HfFrX0Ob3m;";
                    o.IsActive         = true;
                    o.IsToPullRemotely = false;
                    o.Preview          = o.Description = null;
                    o.SyntaxProvider   = (int)DataStore.SyntaxProviderEnum.MS_SQL_SERVER_2014;
                    o.WithFields       = true;
                }
                {
                    DataStore o = dsColl.NewDataStoreTemplate( );
                    o.CID              = dsColl.ID;
                    o.Name             = "SQLite DB1 Test";
                    o.ConnectionString = @"Data Source=D:\TEMP\SQLite\SQLITEDB1.db3;";
                    o.IsActive         = true;
                    o.IsToPullRemotely = false;
                    o.Preview          = o.Description = null;
                    o.SyntaxProvider   = (int)DataStore.SyntaxProviderEnum.SQLITE;
                    o.WithFields       = true;
                }
                {
                    DataStore o = dsColl.NewDataStoreTemplate( );
                    o.CID = dsColl.ID;
                }
                SaveDataStoreCollection(dsColl);
            }
            return(dsColl);
        }
Пример #14
0
 public void Setup()
 {
     Application.Instance.Invoke(() =>
     {
         grid                   = new GridView();
         handler                = (IGridView)grid.Handler;
         model                  = GridViewUtils.CreateModel();
         grid.DataStore         = model;
         grid.SelectionChanged += (s, e) => selectionChangedCount++;
     });
 }
Пример #15
0
		public void Setup()
		{
			Application.Instance.Invoke(() =>
			{
				grid = new GridView();
				handler = (IGridView)grid.Handler;
				model = GridViewUtils.CreateModel();
				grid.DataStore = model;
				grid.SelectionChanged += (s, e) => selectionChangedCount++;
			});
		}
 public DataStoreXtraForm(DataStoreCollection dsColl)
     : this()
 {
     this.dsColl = dsColl ?? throw new System.ArgumentNullException(nameof(dsColl));
     this.gridControl1.DataSource = this.dsColl.List;
     //
     this.ConfigImages( );
     this.ConfigToolTipController( );
     this.ConfigGridControl( );
     this.CustomDrawEmptyForeground( );
 }
Пример #17
0
        GridView Default(bool addItems = true)
        {
            var control = new GridView
            {
                Size = new Size(300, 100)
            };

            LogEvents(control);

            var dropDown = MyDropDown("DropDownKey");

            control.Columns.Add(new GridColumn {
                DataCell = new CheckBoxCell("Check"), Editable = true, AutoSize = true, Resizable = false
            });
            control.Columns.Add(new GridColumn {
                HeaderText = "Image", DataCell = new ImageViewCell("Image")
            });
            control.Columns.Add(new GridColumn {
                HeaderText = "Text", DataCell = new TextBoxCell("Text"), Editable = true, Sortable = true
            });
            control.Columns.Add(new GridColumn {
                HeaderText = "Drop Down", DataCell = dropDown, Editable = true, Sortable = true
            });

#if Windows // Drawable cells - need to implement on other platforms.
            var drawableCell = new DrawableCell
            {
                PaintHandler = args => {
                    var m = args.Item as MyGridItem;
                    if (m != null)
                    {
                        args.Graphics.FillRectangle(Brushes.Cached(m.Color) as SolidBrush, args.CellBounds);
                    }
                }
            };
            control.Columns.Add(new GridColumn {
                HeaderText = "Owner drawn", DataCell = drawableCell
            });
#endif

            if (addItems)
            {
                var items = new DataStoreCollection();
                var rand  = new Random();
                for (int i = 0; i < 10000; i++)
                {
                    items.Add(new MyGridItem(rand, i, dropDown));
                }
                control.DataStore = items;
            }

            return(control);
        }
        public void LoadSetting(Setting setting)
        {
			var header = setting.HttpHeaderSetting;
            if (header.HttpHeaderList != null)
            {
	            var items = new DataStoreCollection<HeaderItem>();
	            foreach (var i in header.HttpHeaderList)
	            {
					items.Add(new HeaderItem(i.Key, i.Value));
	            }
	            _gridViewHeader.DataStore = items;
            }
        }
        public static DataStoreCollection Load(string filepathname)
        {
            DataStoreCollection coll;

            if (System.IO.File.Exists(filepathname))
            {
                coll = DataStoreCollection.XmlDeserialize(filepathname);
            }
            else
            {
                coll = new DataStoreCollection( );
            }
            return(coll);
        }
Пример #20
0
        static void Main()
        {
            System.Windows.Forms.Application.EnableVisualStyles( );
            System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false);

            DevExpress.UserSkins.BonusSkins.Register( );
            DevExpress.Skins.SkinManager.EnableFormSkins( );

            dsColl = DataStoreCollection.Load(Global.DataStoreCollectionFilePathName);
            {
                DataStoreXtraForm o = new DataStoreXtraForm(dsColl);
                System.Windows.Forms.Application.Run(o);
            }
            dsColl.Save(TS_STR + '.' + Global.DataStoreCollectionFileName);
            CreateToastNotificationsManager( );
            PullRemotely(dsColl);
        }
Пример #21
0
 void Undo(DataStoreCollection <FileInfoView> dataStore, int row, string oldText, EditType editType)
 {
     if (editType == EditType.Rename)
     {
         (dataStore)[row].Name = oldText;
         //((List<FileInfoView>) dataStore)[row].Name = oldText;
     }
     else if (editType == EditType.EditMTime)
     {
         (dataStore)[row].FileMTime = oldText;
         //((List<FileInfoView>) dataStore)[row].FileMTime = oldText;
     }
     else if (editType == EditType.CreateDir)
     {
         dataStore.RemoveAt(row);
         //Application.Instance.Invoke(() =>((DataStoreCollection)dataStore).RemoveAt(row));
     }
 }
Пример #22
0
        /// <summary>
        /// 载入webshell数据
        /// </summary>
        public void LoadWebshellData()
        {
            DataTable dataTable = ShellManager.GetDataTable();

            if (dataTable == null)
            {
                return;
            }
            var item = new DataStoreCollection <Shell>();

            foreach (DataRow row in dataTable.Rows)
            {
                Shell shell = DataConvert.ConvertDataRowToShellStruct(row);
                item.Add(shell);
            }

            _gridViewShell.DataStore = item;
        }
        public void Test_GetByName()
        {
            DataStoreCollection collection = new DataStoreCollection();

            IDataStore dataStore1 = DataAccess.Data.InitializeDataStore("TestStore1");

            collection.Add(dataStore1);

            IDataStore dataStore2 = DataAccess.Data.InitializeDataStore("TestStore2");

            collection.Add(dataStore2);

            IDataStore foundStore1 = collection.GetByName("TestStore1");

            Assert.IsNotNull(foundStore1, "The first store wasn't found when searching by short store name.");

            IDataStore foundStore2 = collection.GetByName("TestStore2");

            Assert.IsNotNull(foundStore2, "The second store wasn't found when searching by short store name.");
        }
Пример #24
0
        public GridViewSection()
        {
            var layout = new DynamicLayout();

            layout.AddRow(new Label {
                Text = "Default"
            }, Default());
            layout.AddRow(new Label {
                Text = "No Header,\nNon-Editable"
            }, NoHeader());
#if DESKTOP
            layout.BeginHorizontal();
            layout.Add(new Label {
                Text = "Context Menu\n&& Multi-Select\n&& Filter"
            });
            layout.BeginVertical();
            layout.Add(filterText = new SearchBox {
                PlaceholderText = "Filter"
            });
            var withContextMenuAndFilter = WithContextMenuAndFilter();
            layout.Add(withContextMenuAndFilter);
            layout.EndVertical();
            layout.EndHorizontal();

            var selectionGridView = Default(addItems: false);
            layout.AddRow(new Label {
                Text = "Selected Items"
            }, selectionGridView);

            // hook up selection of main grid to the selection grid
            withContextMenuAndFilter.SelectionChanged += (s, e) =>
            {
                var items = new DataStoreCollection();
                items.AddRange(withContextMenuAndFilter.SelectedItems);
                selectionGridView.DataStore = items;
            };
#endif

            Content = layout;
        }
        public void Test_GetByName()
        {
            DataStoreCollection collection = new DataStoreCollection();

            IDataStore dataStore1 = DataAccess.Data.InitializeDataStore("TestStore1");

            collection.Add(dataStore1);

            IDataStore dataStore2 = DataAccess.Data.InitializeDataStore("TestStore2");

            collection.Add(dataStore2);



            IDataStore foundStore1 = collection.GetByName("TestStore1");

            Assert.IsNotNull(foundStore1, "The first store wasn't found when searching by short store name.");

            IDataStore foundStore2 = collection.GetByName("TestStore2");

            Assert.IsNotNull(foundStore2, "The second store wasn't found when searching by short store name.");
        }
Пример #26
0
        public PanelFileManager(IHost host, PluginParameter data)
        {
            _host      = host;
            _shellData = (Shell)data[0];

            // init StrRes to translate string
            StrRes.SetHost(_host);
            Init();

            //
            _fileManager = new FileManager(_host, _shellData);
            _fileManager.GetWwwRootPathCompletedToDo      += fileManager_GetWwwRootPathCompletedToDo;
            _fileManager.GetFileTreeCompletedToDo         += fileManager_GetFileTreeCompletedToDo;
            _fileManager.DeleteFileOrDirCompletedToDo     += fileManager_DeleteFileOrDirCompletedToDo;
            _fileManager.RenameFileOrDirCompletedToDo     += fileManager_RenameFileOrDirCompletedToDo;
            _fileManager.CopyFileOrDirCompletedToDo       += fileManager_CopyFileOrDirCompletedToDo;
            _fileManager.ModifyFileOrDirTimeCompletedToDo += fileManager_ModifyFileOrDirTimeCompletedToDo;
            _fileManager.CreateDirCompletedToDo           += fileManager_CreateDirCompletedToDo;
            _fileManager.WgetCompletedToDo += fileManager_WgetCompletedToDo;

            _status = new Status
            {
                PathSeparator = "\\",
                Host          = _host,
                ShellData     = _shellData,
                FileManager   = _fileManager,
                FileGridView  = _gridViewFile,
            };

            _gridViewFile.ContextMenu = CreateFileRightMenu(_status);
            //_dataStore = new List<FileInfoView>();
            _gridViewFile.DataStore = _dataStore = new DataStoreCollection <FileInfoView>();

            //获取根路径
            _fileManager.GetWwwRootPath();
        }
Пример #27
0
        public PanelFileManager(IHost host, PluginParameter data)
        {
            _host = host;
            _shellData = (Shell)data[0];

            // init StrRes to translate string
            StrRes.SetHost(_host);
            Init();

            //
            _fileManager = new FileManager(_host, _shellData);
            _fileManager.GetWwwRootPathCompletedToDo += fileManager_GetWwwRootPathCompletedToDo;
            _fileManager.GetFileTreeCompletedToDo += fileManager_GetFileTreeCompletedToDo;
            _fileManager.DeleteFileOrDirCompletedToDo += fileManager_DeleteFileOrDirCompletedToDo;
            _fileManager.RenameFileOrDirCompletedToDo += fileManager_RenameFileOrDirCompletedToDo;
            _fileManager.CopyFileOrDirCompletedToDo += fileManager_CopyFileOrDirCompletedToDo;
            _fileManager.ModifyFileOrDirTimeCompletedToDo += fileManager_ModifyFileOrDirTimeCompletedToDo;
            _fileManager.CreateDirCompletedToDo += fileManager_CreateDirCompletedToDo;
            _fileManager.WgetCompletedToDo += fileManager_WgetCompletedToDo;

            _status = new Status
            {
                PathSeparator = "\\",
                Host = _host,
                ShellData=_shellData,
                FileManager=_fileManager,
                FileGridView = _gridViewFile,
            };

            _gridViewFile.ContextMenu = CreateFileRightMenu(_status);
            //_dataStore = new List<FileInfoView>();
            _gridViewFile.DataStore = _dataStore = new DataStoreCollection<FileInfoView>();

            //获取根路径
            _fileManager.GetWwwRootPath();
        }
 public DataStoreCollectionXUC(DataStoreCollection dsColl = null)
 {
     this.dsColl = dsColl;
     InitializeComponent( );
     if (this.DesignMode)
     {
         //this.gridControl.DataSource = DataStoreCollection.NewCollectionTemplate( ).List;
     }
     else
     {
         this.gridControl.DataSource = this.dsColl?.List;
         this.gridControl.RefreshDataSource( );
         this.gridControl.Refresh( );
     }
     this.bsiRecordsCount.Caption = null;
     {
         this.gridControl.UseEmbeddedNavigator = true;
         this.gridControl.ForceInitialize( );
         this.gridView.OptionsView.NewItemRowPosition = NewItemRowPosition.Top;
         this.gridView.InitNewRow              += new InitNewRowEventHandler(this.gridView_InitNewRow);
         this.gridView.OptionsView.ShowFooter   = true;
         this.gridView.OptionsBehavior.Editable = true;
         this.gridView.OptionsBehavior.ReadOnly = false;
         {
             //this.gridView.Columns[ DataStore.IS_ACTIVE_FIELDNAME ].Visible = true;
             //this.gridView.Columns[ DataStore.WAS_TESTED_FIELDNAME ].Visible = false;
             //this.gridView.Columns[ DataStore.NAME_FIELDNAME ].Visible = true;
             //this.gridView.Columns[ DataStore.CONNECTION_STRING_FIELDNAME ].Visible = true;
             //this.gridView.Columns[ DataStore.LOGIN_ID_FIELDNAME ].Visible = true;
             //this.gridView.Columns[ DataStore.PASSWORD_FIELDNAME ].Visible = false;
             //this.gridView.Columns[ DataStore.FULLPATHNAME_FIELDNAME ].Visible = true;
             //this.gridView.Columns[ DataStore.CREATION_FIELDNAME ].Visible = false;
             //this.gridView.Columns[ DataStore.SYNTAX_PROVIDER_FIELDNAME ].Visible = true;
             //this.gridView.Columns[ DataStore.METADATA_PROVIDER_FIELDNAME ].Visible = true;
             //this.gridView.Columns[ DataStore.PREVIEW_FIELDNAME ].Visible = false;
             //this.gridView.Columns[ DataStore.DESCRIPTION_FIELDNAME ].Visible = false;
         }
         {
             this.gridView.Columns[DataStore.WAS_TESTED_FIELDNAME].OptionsColumn.AllowFocus   = false;
             this.gridView.Columns[DataStore.FULLPATHNAME_FIELDNAME].OptionsColumn.AllowFocus = false;
             this.gridView.Columns[DataStore.CREATION_FIELDNAME].OptionsColumn.AllowFocus     = false;
             this.gridView.Columns[DataStore.PREVIEW_FIELDNAME].OptionsColumn.AllowFocus      = false;
         }
         {
             this.gridView.Columns[DataStore.WAS_TESTED_FIELDNAME].OptionsColumn.ReadOnly   = true;
             this.gridView.Columns[DataStore.FULLPATHNAME_FIELDNAME].OptionsColumn.ReadOnly = false;
         }
         {
             // In-place editors used in display and edit modes respectively.
             this.editorForDisplay = new RepositoryItemComboBox( );
             this.editorForEditing = new RepositoryItemComboBox( );
             {
                 foreach (ConfigPath cp in this.dsColl.DirList)
                 {
                     this.editorForEditing.Items.Add(cp.PathDir);
                 }
             }
             RepositoryItem[] ri = new RepositoryItem[] { this.editorForDisplay, this.editorForEditing };
             this.gridView.GridControl.RepositoryItems.AddRange(ri);
             this.gridView.Columns[DataStore.DIRECTORYNAME_FIELDNAME].ColumnEdit = this.editorForDisplay;
         }
     }
 }
Пример #29
0
        public static void PullRemotely(DataStoreCollection dsColl)
        {
            dsColl = dsColl ?? throw new System.ArgumentNullException(nameof(dsColl));
            for (int i = 0; i < dsColl.List.Count; i++)
            {
                DataStore ds = dsColl.List[i];
                if (!ds.IsActive)
                {
                    continue;
                }
                if (ds.IsToPullRemotely)
                {
                    #region --- ??? ---
                    switch ((DataStore.SyntaxProviderEnum)ds.SyntaxProvider)
                    {
                    case DataStore.SyntaxProviderEnum.SQLITE:
                        DumpSQLite(ds);
                        break;

                    case DataStore.SyntaxProviderEnum.MS_SQL_SERVER_2014:
                        DumpMSSQL(ds);
                        break;

                    case DataStore.SyntaxProviderEnum.AUTO:
                    case DataStore.SyntaxProviderEnum.GENERIC:
                    case DataStore.SyntaxProviderEnum.ANSI_SQL_2003:
                    case DataStore.SyntaxProviderEnum.ANSI_SQL_89:
                    case DataStore.SyntaxProviderEnum.ANSI_SQL_92:
                    case DataStore.SyntaxProviderEnum.FIREBIRD_1_0:
                    case DataStore.SyntaxProviderEnum.FIREBIRD_1_5:
                    case DataStore.SyntaxProviderEnum.FIREBIRD_2_0:
                    case DataStore.SyntaxProviderEnum.FIREBIRD_2_5:
                    case DataStore.SyntaxProviderEnum.IBM_DB2:
                    case DataStore.SyntaxProviderEnum.IBM_INFORMIX_10:
                    case DataStore.SyntaxProviderEnum.IBM_INFORMIX_8:
                    case DataStore.SyntaxProviderEnum.IBM_INFORMIX_9:
                    case DataStore.SyntaxProviderEnum.MS_ACCESS_2000_:
                    case DataStore.SyntaxProviderEnum.MS_ACCESS_2003_:
                    case DataStore.SyntaxProviderEnum.MS_ACCESS_97_:
                    case DataStore.SyntaxProviderEnum.MS_ACCESS_XP_:
                    case DataStore.SyntaxProviderEnum.MS_SQL_SERVER_2000:
                    case DataStore.SyntaxProviderEnum.MS_SQL_SERVER_2005:
                    case DataStore.SyntaxProviderEnum.MS_SQL_SERVER_2008:
                    case DataStore.SyntaxProviderEnum.MS_SQL_SERVER_2012:
                    case DataStore.SyntaxProviderEnum.MS_SQL_SERVER_7:
                    case DataStore.SyntaxProviderEnum.MS_SQL_SERVER_COMPACT_EDITION:
                    case DataStore.SyntaxProviderEnum.MYSQL_3_XX:
                    case DataStore.SyntaxProviderEnum.MYSQL_4_0:
                    case DataStore.SyntaxProviderEnum.MYSQL_4_1:
                    case DataStore.SyntaxProviderEnum.MYSQL_5_0:
                    case DataStore.SyntaxProviderEnum.ORACLE_10:
                    case DataStore.SyntaxProviderEnum.ORACLE_11:
                    case DataStore.SyntaxProviderEnum.ORACLE_7:
                    case DataStore.SyntaxProviderEnum.ORACLE_8:
                    case DataStore.SyntaxProviderEnum.ORACLE_9:
                    case DataStore.SyntaxProviderEnum.POSTGRESQL:
                    case DataStore.SyntaxProviderEnum.SYBASE_ASE:
                    case DataStore.SyntaxProviderEnum.SYBASE_SQL_ANYWHERE:
                    case DataStore.SyntaxProviderEnum.TERADATA:
                    case DataStore.SyntaxProviderEnum.VISTADB:
                    default:
                        break;
                    } // switch(...) ...
                    #endregion
                }     // if( ... ) ...
            }         // for( ;; ) ...
        }             // public static void f( ... ) ...
Пример #30
0
 void Undo(DataStoreCollection<FileInfoView> dataStore, int row, string oldText, EditType editType)
 {
     if (editType == EditType.Rename)
     {
         (dataStore)[row].Name= oldText;
         //((List<FileInfoView>) dataStore)[row].Name = oldText;
     }
     else if (editType == EditType.EditMTime)
     {
         (dataStore)[row].FileMTime = oldText;
         //((List<FileInfoView>) dataStore)[row].FileMTime = oldText;
     }
     else if (editType == EditType.CreateDir)
     {
         dataStore.RemoveAt(row);
         //Application.Instance.Invoke(() =>((DataStoreCollection)dataStore).RemoveAt(row));
     }
 }
Пример #31
0
        private void AddDirsInListViewFile(IEnumerable<OsFile> dirs, IEnumerable<OsFile> files, string parentPath)
        {
            _dataStore.Clear();

            var item = new DataStoreCollection<FileInfoView>();
            //显示dirs
            foreach (OsFile dir in dirs)
            {
                //移除最后的'/'符号
                string dirName = dir.FileName.Remove(dir.FileName.Length - 1, 1);
                //添加fileInfo
                string fullName = Path.Combine(new string[] { parentPath, dirName }) + (_isWin ? "\\" : "/");
                item.Add(new FileInfoView(dirName, fullName, true, dir.FileMTime, dir.FileSize, dir.FilePerms));
            }
            //显示files
            foreach (OsFile file in files)
            {
                //添加fileInfo
                string dirName = file.FileName;
                string fullName = Path.Combine(new string[] { parentPath, dirName });
                item.Add(new FileInfoView(dirName, fullName, false, file.FileMTime, file.FileSize, file.FilePerms));
            }
            _dataStore.AddRange(item);
        }
Пример #32
0
        public static void PullRemotely(DataStoreCollection dsColl)
        {
            dsColl = dsColl ?? throw new System.ArgumentNullException(nameof(dsColl));
            for (int i = 0; i < dsColl.List.Count; i++)
            {
                DataStore ds = dsColl.List[i];
                if (!ds.IsActive)
                {
                    continue;
                }
                if (ds.IsToPullRemotely)
                {
                    #region --- ??? ---
                    TS_STR = @"D:\TEMP\SQLite\" + DataStore.TS_STR.Replace(":", "");
                    if (ds.NotificationWhenStarted)
                    {
                        DevExpress.XtraBars.ToastNotifications.ToastNotification tn = CreateToastNotification(ds);
                        tn.Header = "Starting: " + ds.Name;
                        tn.Body   = ds.AqbQbFilename;
                        tn.Body2  = ds.MiFqnFilename;
                        tnm.ShowNotification(tn);
                    }
                    switch ((DataStore.SyntaxProviderEnum)ds.SyntaxProvider)
                    {
                    case DataStore.SyntaxProviderEnum.SQLITE:
                        DumpSQLite(ds);
                        break;

                    case DataStore.SyntaxProviderEnum.MS_SQL_SERVER_2014:
                        DumpMSSQL(ds);
                        break;

                    case DataStore.SyntaxProviderEnum.AUTO:
                    case DataStore.SyntaxProviderEnum.GENERIC:
                    case DataStore.SyntaxProviderEnum.ANSI_SQL_2003:
                    case DataStore.SyntaxProviderEnum.ANSI_SQL_89:
                    case DataStore.SyntaxProviderEnum.ANSI_SQL_92:
                    case DataStore.SyntaxProviderEnum.FIREBIRD_1_0:
                    case DataStore.SyntaxProviderEnum.FIREBIRD_1_5:
                    case DataStore.SyntaxProviderEnum.FIREBIRD_2_0:
                    case DataStore.SyntaxProviderEnum.FIREBIRD_2_5:
                    case DataStore.SyntaxProviderEnum.IBM_DB2:
                    case DataStore.SyntaxProviderEnum.IBM_INFORMIX_10:
                    case DataStore.SyntaxProviderEnum.IBM_INFORMIX_8:
                    case DataStore.SyntaxProviderEnum.IBM_INFORMIX_9:
                    case DataStore.SyntaxProviderEnum.MS_ACCESS_2000_:
                    case DataStore.SyntaxProviderEnum.MS_ACCESS_2003_:
                    case DataStore.SyntaxProviderEnum.MS_ACCESS_97_:
                    case DataStore.SyntaxProviderEnum.MS_ACCESS_XP_:
                    case DataStore.SyntaxProviderEnum.MS_SQL_SERVER_2000:
                    case DataStore.SyntaxProviderEnum.MS_SQL_SERVER_2005:
                    case DataStore.SyntaxProviderEnum.MS_SQL_SERVER_2008:
                    case DataStore.SyntaxProviderEnum.MS_SQL_SERVER_2012:
                    case DataStore.SyntaxProviderEnum.MS_SQL_SERVER_7:
                    case DataStore.SyntaxProviderEnum.MS_SQL_SERVER_COMPACT_EDITION:
                    case DataStore.SyntaxProviderEnum.MYSQL_3_XX:
                    case DataStore.SyntaxProviderEnum.MYSQL_4_0:
                    case DataStore.SyntaxProviderEnum.MYSQL_4_1:
                    case DataStore.SyntaxProviderEnum.MYSQL_5_0:
                    case DataStore.SyntaxProviderEnum.ORACLE_10:
                    case DataStore.SyntaxProviderEnum.ORACLE_11:
                    case DataStore.SyntaxProviderEnum.ORACLE_7:
                    case DataStore.SyntaxProviderEnum.ORACLE_8:
                    case DataStore.SyntaxProviderEnum.ORACLE_9:
                    case DataStore.SyntaxProviderEnum.POSTGRESQL:
                    case DataStore.SyntaxProviderEnum.SYBASE_ASE:
                    case DataStore.SyntaxProviderEnum.SYBASE_SQL_ANYWHERE:
                    case DataStore.SyntaxProviderEnum.TERADATA:
                    case DataStore.SyntaxProviderEnum.VISTADB:
                    default:
                        break;
                    } // switch(...) ...
                    if (ds.NotificationWhenFinished)
                    {
                        DevExpress.XtraBars.ToastNotifications.ToastNotification tn = CreateToastNotification(ds);
                        tn.Header = "Finished: " + ds.Name;
                        tn.Body   = ds.AqbQbFilename;
                        tn.Body2  = ds.MiFqnFilename;
                        tnm.ShowNotification(tn);
                    }
                    #endregion
                } // if( ... ) ...
            }     // for( ;; ) ...
        }
Пример #33
0
		GridView Default(bool addItems = true)
		{
			var control = new GridView
			{
				Size = new Size(300, 100)
			};
			LogEvents(control);

			var dropDown = MyDropDown("DropDownKey");
			control.Columns.Add(new GridColumn { DataCell = new CheckBoxCell("Check"), Editable = true, AutoSize = true, Resizable = false });
			control.Columns.Add(new GridColumn { HeaderText = "Image", DataCell = new ImageViewCell("Image") });
			control.Columns.Add(new GridColumn { HeaderText = "Text", DataCell = new TextBoxCell("Text"), Editable = true, Sortable = true });
			control.Columns.Add(new GridColumn { HeaderText = "Drop Down", DataCell = dropDown, Editable = true, Sortable = true });

#if Windows // Drawable cells - need to implement on other platforms.
			var drawableCell = new DrawableCell
			{
				PaintHandler = args => {
					var m = args.Item as MyGridItem;
					if (m != null)
						args.Graphics.FillRectangle(Brushes.Cached(m.Color) as SolidBrush, args.CellBounds);
				}
			};
			control.Columns.Add(new GridColumn { HeaderText = "Owner drawn", DataCell = drawableCell });
#endif

			if (addItems)
			{
				var items = new DataStoreCollection();
				var rand = new Random();
				for (int i = 0; i < 10000; i++)
				{
					items.Add(new MyGridItem(rand, i, dropDown));
				}
				control.DataStore = items;
			}

			return control;
		}
Пример #34
0
		/// <summary>
		/// 载入webshell数据
		/// </summary>
		public void LoadWebshellData()
		{
			DataTable dataTable = ShellManager.GetDataTable();
			if (dataTable == null)
			{
				return;
			}
			var item = new DataStoreCollection<Shell>();
			foreach (DataRow row in dataTable.Rows)
			{
				Shell shell = DataConvert.ConvertDataRowToShellStruct(row);
				item.Add(shell);
			}

			_gridViewShell.DataStore = item;
		}
 private void NavigationControllerForm_Load(object sender, EventArgs e)
 {
     this.cpColl = ConfigPathCollection.Load( );
     this.dsColl = DataStoreCollection.Load(this.cpColl.GetDirList(ConfigPath.ConfigPathTypeEnum.DataStores));
     this.RecreateUserControls( );
 }
        public MetadataItemFQNForm(DataStoreCollection dsColl)
            : this()
        {
            this.dsColl = dsColl ?? throw new System.ArgumentNullException(nameof(dsColl));
            for (int i = 0; i < this.dsColl.List.Count; i++)
            {
                DataStore ds = this.dsColl.List[i];
                if (!ds.IsActive)
                {
                    continue;
                }
                if (ds.IsToPullRemotely)
                {
                    DataStore.SyntaxProviderEnum x = (DataStore.SyntaxProviderEnum)ds.SyntaxProvider;
                    switch (x)
                    {
                    case DataStore.SyntaxProviderEnum.SQLITE:
                        this.qb = CreateQueryBuilderSQLite(ds);
                        break;

                    case DataStore.SyntaxProviderEnum.MS_SQL_SERVER_2014:
                        this.qb = CreateQueryBuilderMSSQL(ds);
                        break;

                    case DataStore.SyntaxProviderEnum.AUTO:
                        break;

                    case DataStore.SyntaxProviderEnum.GENERIC:
                        break;

                    case DataStore.SyntaxProviderEnum.ANSI_SQL_2003:
                    case DataStore.SyntaxProviderEnum.ANSI_SQL_89:
                    case DataStore.SyntaxProviderEnum.ANSI_SQL_92:
                    case DataStore.SyntaxProviderEnum.FIREBIRD_1_0:
                    case DataStore.SyntaxProviderEnum.FIREBIRD_1_5:
                    case DataStore.SyntaxProviderEnum.FIREBIRD_2_0:
                    case DataStore.SyntaxProviderEnum.FIREBIRD_2_5:
                    case DataStore.SyntaxProviderEnum.IBM_DB2:
                    case DataStore.SyntaxProviderEnum.IBM_INFORMIX_10:
                    case DataStore.SyntaxProviderEnum.IBM_INFORMIX_8:
                    case DataStore.SyntaxProviderEnum.IBM_INFORMIX_9:
                    case DataStore.SyntaxProviderEnum.MS_ACCESS_2000_:
                    case DataStore.SyntaxProviderEnum.MS_ACCESS_2003_:
                    case DataStore.SyntaxProviderEnum.MS_ACCESS_97_:
                    case DataStore.SyntaxProviderEnum.MS_ACCESS_XP_:
                    case DataStore.SyntaxProviderEnum.MS_SQL_SERVER_2000:
                    case DataStore.SyntaxProviderEnum.MS_SQL_SERVER_2005:
                    case DataStore.SyntaxProviderEnum.MS_SQL_SERVER_2008:
                    case DataStore.SyntaxProviderEnum.MS_SQL_SERVER_2012:
                    case DataStore.SyntaxProviderEnum.MS_SQL_SERVER_7:
                    case DataStore.SyntaxProviderEnum.MS_SQL_SERVER_COMPACT_EDITION:
                    case DataStore.SyntaxProviderEnum.MYSQL_3_XX:
                    case DataStore.SyntaxProviderEnum.MYSQL_4_0:
                    case DataStore.SyntaxProviderEnum.MYSQL_4_1:
                    case DataStore.SyntaxProviderEnum.MYSQL_5_0:
                    case DataStore.SyntaxProviderEnum.ORACLE_10:
                    case DataStore.SyntaxProviderEnum.ORACLE_11:
                    case DataStore.SyntaxProviderEnum.ORACLE_7:
                    case DataStore.SyntaxProviderEnum.ORACLE_8:
                    case DataStore.SyntaxProviderEnum.ORACLE_9:
                    case DataStore.SyntaxProviderEnum.POSTGRESQL:
                    case DataStore.SyntaxProviderEnum.SYBASE_ASE:
                    case DataStore.SyntaxProviderEnum.SYBASE_SQL_ANYWHERE:
                    case DataStore.SyntaxProviderEnum.TERADATA:
                    case DataStore.SyntaxProviderEnum.VISTADB:
                    default:
                        break;
                    }
                    { // Export AQB's Query Builder XML Structures...
                        ExtractMetadataValues.SerializeQueryBuilder(this.qb, ds.AqbQbFilename);
                    }
                    MetadataItemFQNCollection o = new MetadataItemFQNCollection( );
                    o.List = ExtractMetadataValues.BuildBindingList(this.qb);
                    { // Export MetadataItem FQN Collection...
                        o.Save(ds.MiFqnFilename);
                    }
                    this.gridControl1.DataSource = o.List;
                }
                else
                {
                    MetadataItemFQNCollection o = MetadataItemFQNCollection.Load(ds.MiFqnFilename);
                    this.gridControl1.DataSource = o.List;
                }
            }
        }