public static DataEditorHelper Getinstance() { if (dataEditorHelper == null) { dataEditorHelper = new DataEditorHelper(); } return(dataEditorHelper); }
private void SearchForm_Load(object sender, EventArgs e) { _dataEditorHelper = DataEditorHelper.Getinstance(); _dataEditorHelper.FindItems(tb_SearchField.Text); _searchTip.ToolTipTitle = "Use Character"; _searchTip.SetToolTip(tb_SearchField, $"{_dataEditorHelper._SearchSeparators[0]} - as separator for multi searching" + $"\n{_dataEditorHelper._SearchSeparators[1]} - allow register sensitivity" + $"\n{_dataEditorHelper._SearchSeparators[2]} - absolute match"); }
private MainForm() { InitializeComponent(); _fileSearcher.DataViewer = DataEditor; _dataEditorHelper = DataEditorHelper.Getinstance(); _dataEditorHelper.SetDataViewer(); //Data Source Binding source = new BindingSource(_fileSearcher.Assets, null); DataEditor.DataSource = source; //PathToolTip.ToolTipIcon = ToolTipIcon.Info; PathToolTip.AutoPopDelay = Int16.MaxValue; PathToolTip.InitialDelay = 1500; PathToolTip.IsBalloon = true; PathToolTip.ShowAlways = true; DE_ContexMenu.Renderer = AN_ContexMenu.Renderer = MainContexMenu.Renderer = new CustomContextMenuRender(); DE_ContexMenu.ShowImageMargin = AN_ContexMenu.ShowImageMargin = MainContexMenu.ShowImageMargin = false; DE_ContexMenu.ShowCheckMargin = AN_ContexMenu.ShowCheckMargin = MainContexMenu.ShowCheckMargin = false; tb_AssetName.Text = DefAssetName; tb_In.MouseLeave += new EventHandler(PathTT_Disable); tb_TopRoot.MouseLeave += new EventHandler(PathTT_Disable); tb_Out.MouseLeave += new EventHandler(PathTT_Disable); tb_AssetName.KeyDown += new KeyEventHandler(TBEnterPress); tb_In.KeyDown += new KeyEventHandler(TBEnterPress); tb_Out.KeyDown += new KeyEventHandler(TBEnterPress); tb_TopRoot.KeyDown += new KeyEventHandler(TBEnterPress); tb_In.DragEnter += new DragEventHandler(DataDragEnter); tb_In.DragDrop += new DragEventHandler(TextBoxDragAndDrop); tb_TopRoot.DragEnter += new DragEventHandler(DataDragEnter); tb_TopRoot.DragDrop += new DragEventHandler(TextBoxDragAndDrop); tb_Out.DragEnter += new DragEventHandler(DataDragEnter); tb_Out.DragDrop += new DragEventHandler(TextBoxDragAndDrop); cbl_Names.DragEnter += new DragEventHandler(DataDragEnter); cbl_Names.DragDrop += new DragEventHandler(CBLDragAndDrop); _assetNameHelper = AssetNameHelper.instance; _assetNameHelper.CheckedListBoxControl = cbl_Names; tb_AssetName.DataBindings.Add("Text", _assetNameHelper, "NodeName", true, DataSourceUpdateMode.OnPropertyChanged); lb_CheckInfo.DataBindings.Add("Text", _fileSearcher, "AssetsInfo", true, DataSourceUpdateMode.OnPropertyChanged); tb_Out.DataBindings.Add("Text", _fileProcessor, "OutPath", true, DataSourceUpdateMode.OnPropertyChanged); tb_TopRoot.DataBindings.Add("Text", _fileProcessor, "TopRoot", true, DataSourceUpdateMode.OnPropertyChanged); cb_AllowOverWrite.DataBindings.Add("Checked", _fileProcessor, "Overwrite", true, DataSourceUpdateMode.OnPropertyChanged); cb_SubFolders.DataBindings.Add("Checked", _fileProcessor, "SubRoots", true, DataSourceUpdateMode.OnPropertyChanged); cb_FoldersOnly.DataBindings.Add("Checked", _fileProcessor, "FoldersOnly", true, DataSourceUpdateMode.OnPropertyChanged); cb_FoldersOnly.Enabled = cb_SubFolders.Checked; //Asset Manager Init _comboBoxHelper.FillComboBox(cmb_SearchMode, ComboBoxTypes.Search); _comboBoxHelper.FillComboBox(cmb_NameMatchMode, ComboBoxTypes.NameMatch); //data editor init DataEditor.AllowUserToAddRows = false; DataEditor.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.None; DataEditor.ColumnHeadersDefaultCellStyle.BackColor = Color.FromArgb(40, 40, 43); DataEditor.ColumnHeadersDefaultCellStyle.ForeColor = Color.Turquoise; DataEditor.EnableHeadersVisualStyles = false; DataEditor.RowHeadersDefaultCellStyle.BackColor = Color.FromArgb(40, 40, 43); DataEditor.RowHeadersDefaultCellStyle.SelectionBackColor = Color.FromArgb(190, 125, 60); DataEditor.DefaultCellStyle.Font = new Font("Tahoma", 12, GraphicsUnit.Pixel); DataEditor.AllowUserToResizeRows = false; //double buffer on typeof(DataGridView).InvokeMember( "DoubleBuffered", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.SetProperty, null, DataEditor, new object[] { true }); DE_Info.ForeColor = Color.FromArgb(241, 241, 241); DE_Info.Font = new Font("Tahoma", 12f, GraphicsUnit.Pixel); DE_ContexMenu.Items.Add(DE_Info); }