private void CopyFastKeyOnClick(object sender, RoutedEventArgs e) { string newPath = (_isFirstFocused ? SecondPanelPath : FirstPanelPath).Text; List <Item> items = (_isFirstFocused ? FirstPanel : SecondPanel).Items.Cast <Item>() .Where(item => item.IsChecked).ToList(); OperationWindow operationWindow = new OperationWindow("Copying"); operationWindow.OnFinish += (o, s) => { UpdatePanels(); operationWindow.Close(); }; operationWindow.Show(); operationWindow.Copy(items, newPath); }
private void DeleteFastKeyOnClick(object sender, RoutedEventArgs e) { List <Item> items = (_isFirstFocused ? FirstPanel : SecondPanel).Items.Cast <Item>() .Where(item => item.IsChecked).ToList(); OperationWindow operationWindow = new OperationWindow("Deleting"); operationWindow.OnFinish += (o, s) => { UpdatePanels(); operationWindow.Close(); }; operationWindow.Show(); operationWindow.Delete(items); UpdatePanels(); }
private void UnarchiveOnClick(object sender, RoutedEventArgs e) { OperationWindow operationWindow = new OperationWindow("Unarchiving"); operationWindow.OnFinish += (o, args) => { operationWindow.Close(); UpdatePanels(); }; List <Item> items = (_isFirstFocused ? FirstPanel : SecondPanel).Items.Cast <Item>() .Where(item => item.IsChecked).ToList(); if (items.Count < 1) { return; } operationWindow.Show(); operationWindow.Unarchive(items[0]); UpdatePanels(); }
public override void Update(int deltaTime) { List <EntityBase> list = GetEntityList(); for (int i = 0; i < list.Count; i++) { if (!list[i].GetExistComp <OperationWindowComponent>()) { OperationWindow ui = UIManager.OpenUIWindow <OperationWindow>(); ui.m_entity = list[i]; ui.ElementInit(); //初始化元素显示 ui.InitRank(); //初始化排行榜显示 OperationWindowComponent oc = new OperationWindowComponent(); oc.ui = ui; list[i].AddComp(oc); } } }
void search_Button_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { if (productCode_Textbox.Text == "") { MessageBox.Show("Dont leave blank"); } else { productDbUtils = new ProductDbUtils(); if (productDbUtils.getProductByCode(productCode_Textbox.Text) == false) { MessageBox.Show("Product not found!"); } else { var operationWindow = new OperationWindow(productCode_Textbox.Text); Close(); operationWindow.Show(); } } }
private void ArchiveOnClick(object sender, RoutedEventArgs e) { ChooseNameWindow chooseNameWindow = new ChooseNameWindow("Archive name"); if ((bool)chooseNameWindow.ShowDialog()) { string destination = Path.Combine(_isFirstFocused ? FirstPanelPath.Text : SecondPanelPath.Text, chooseNameWindow.NewName) + ".zip"; OperationWindow operationWindow = new OperationWindow("Archiving"); operationWindow.OnFinish += (o, args) => { operationWindow.Close(); UpdatePanels(); }; List <Item> items = (_isFirstFocused ? FirstPanel : SecondPanel).Items.Cast <Item>() .Where(item => item.IsChecked).ToList(); if (items.Count < 1) { return; } operationWindow.Show(); operationWindow.Archive(items[0], destination); } }
private void abastecimientosToolStripMenuItem_Click(object sender, EventArgs e) { OperationWindow.operation_type = 1; OperationWindow ow = new OperationWindow(); ow.ShowDialog(); }
private void historialToolStripMenuItem_Click(object sender, EventArgs e) { OperationWindow.operation_type = 2; OperationWindow ow = new OperationWindow(); ow.ShowDialog(); }
private void PanelOnKeyDown(object sender, KeyEventArgs keyEventArgs) { ListView listView = (ListView)sender; _isFirstFocused = listView.Name == FirstPanel.Name; CheckPanelFocus(); if (Keyboard.IsKeyDown(Key.LeftCtrl)) { switch (keyEventArgs.Key) { case Key.C: _buffer = new List <Item>(); foreach (object firstPanelItem in FirstPanel.Items) { if (((Item)firstPanelItem).IsChecked && !(firstPanelItem is BackItem)) { _buffer.Add((Item)firstPanelItem); } } break; case Key.V: if (_buffer.Count >= 1) { OperationWindow operationWindow = new OperationWindow("Copying"); operationWindow.OnFinish += (o, s) => { UpdatePanels(); operationWindow.Close(); }; operationWindow.Show(); operationWindow.Copy(_buffer, _isFirstFocused ? FirstPanelPath.Text : SecondPanelPath.Text); } break; } } Item item = null; try { item = (Item)((ListViewItem)keyEventArgs.OriginalSource).Content; //fails here if any error //flag = true; } catch (Exception) { ChangeFocus(); } //if (!flag) // return; CheckPanelFocus(); switch (keyEventArgs.Key) { case Key.Back: string path = (_isFirstFocused ? FirstPanelPath.Text : SecondPanelPath.Text) + @"\.."; if (Directory.Exists(path)) { FillTable(_isFirstFocused, path); } else { MessageBox.Show("Can't go to parent folder"); } break; case Key.Enter: PanelOnMouseDoubleClick(sender, null); break; case Key.Right: ChangeFocus(); break; case Key.Left: ChangeFocus(); break; case Key.F2: Rename(item, _isFirstFocused); break; case Key.F5: UpdatePanels(); break; case Key.F11: WindowState = WindowState.Maximized; break; } }