Ejemplo n.º 1
0
        //public void OnMouseWheel(MouseWheelEventArgs e)
        //{
        //    if (!_ctrlPressed)
        //        return;

        //    MessageBox.Show("!");
        //}

        //public void OnKeyDown(KeyboardEventArgs e)
        //{
        //    _ctrlPressed = e.KeyboardDevice.Modifiers == ModifierKeys.Control;
        //}

        public void TabClick(TabFileItem tabItem, MouseButtonEventArgs e)
        {
            if (e.ChangedButton == MouseButton.Middle)
            {
                Close(tabItem);
            }
        }
Ejemplo n.º 2
0
 public void CloseOthers(TabFileItem tabItem)
 {
     using (new CursorManager())
     {
         TabFileItems
         .Where(tab => tab != tabItem)
         .Apply(tab => Close(tab));
     }
 }
Ejemplo n.º 3
0
        private TabFileItem LoadFile(string fileName)
        {
            var service = new TailService(UserSettings, fileName);

            service.Changed += (sender, e) => Execute.OnUIThread(() => TailChanged(e));

            var item = new TabFileItem(this, fileName, Path.GetFileNameWithoutExtension(fileName), service);

            item.FollowTail = UserSettings.Tail.AutoFollow;
            TabFileItems.Add(item);

            return(item);
        }
Ejemplo n.º 4
0
        public void Close(TabFileItem tabItem)
        {
            int index = TabFileItems.IndexOf(tabItem);

            FileNames.Remove(tabItem.FileName);
            TabFileItems.Remove(tabItem);
            tabItem.TailService.Dispose();

            if (TabFileItems.Count == 0)
            {
                Buffer.Clear();
            }

            SelectedTab = TabFileItems.Any() ? TabFileItems[Math.Min(index, TabFileItems.Count - 1)] : null;
        }