Ejemplo n.º 1
0
 private void TabItem_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
 {
     if (e.MiddleButton == System.Windows.Input.MouseButtonState.Pressed)
     {
         LadderTabItem tabItem = sender as LadderTabItem;
         RemoveLadderTabItem(tabItem);
     }
 }
Ejemplo n.º 2
0
 private void SetCurrentItem(LadderTabItem tabItem)
 {
     if (!Items.Contains(tabItem))
     {
         AddLadderTabItem(tabItem);
     }
     SelectedItem = tabItem;
     tabItem.ItemGetKeyboardFocus();
 }
Ejemplo n.º 3
0
        public void ShowItem(string name)
        {
            LadderTabItem tabItem = GetTabByName(name);

            if (tabItem == null)
            {
                var routine = CurrentProject.GetRoutineByName(name);
                if (routine != null)
                {
                    tabItem = new LadderTabItem(routine, Scale);
                    SetCurrentItem(tabItem);
                }
            }
            else
            {
                SetCurrentItem(tabItem);
            }
        }
Ejemplo n.º 4
0
 private void RemoveLadderTabItem(LadderTabItem tabItem)
 {
     tabItem.MouseDown -= TabItem_MouseDown;
     tabItem.ClearElements();
     Items.Remove(tabItem);
 }
Ejemplo n.º 5
0
 private void AddLadderTabItem(LadderTabItem tabItem)
 {
     tabItem.MouseDown += TabItem_MouseDown;
     Items.Add(tabItem);
 }