List <TerminatorInfo> CreateInfos(int count)
        {
            List <TerminatorInfo> list = new List <TerminatorInfo>();

            for (byte i = 0; i < count; i++)
            {
                TerminatorInfo ti = new TerminatorInfo((Terminator)i);
            }
            return(list);
        }
        private void SelectionChangedHandler(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
        {
            TerminatorInfo info = this.listBoxTerminators.SelectedItem as TerminatorInfo;

            if (info != null)
            {
                this.SelectedTerminator = info;
                this.Close();
            }
        }
Esempio n. 3
0
 private void AddTerminator(TerminatorInfo info)
 {
     this.selectedTerminators.Add(info);
     this.currentIndex++;
     // Set the hex and name before display
     // TODO - also save in a byte block
     this.names[this.currentIndex].Content = info.Display;
     this.hex[this.currentIndex].Content   = info.HexDisplay;
     this.panels[this.currentIndex].Show();
     this.Init(this.currentIndex + 1);
 }
Esempio n. 4
0
 public void AddEntry(TerminatorInfo info)
 {
     // Current count acts as next position on add
     if (this.currentCount < MAX_ENTRIES)
     {
         this.IsChanged = true;
         this.infos.Add(new TerminatorInfo(info.Code));
         this.displays[this.currentCount].SetValues(info);
         this.currentCount++;
     }
 }
Esempio n. 5
0
        private void selectionChangedHandler(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
        {
            this.listBoxTerminators.SelectionChanged -= selectionChangedHandler;
            TerminatorInfo info = this.listBoxTerminators.SelectedItem as TerminatorInfo;

            if (info != null)
            {
                this.tEditor.AddNewTerminator(info);
            }
            this.listBoxTerminators.SelectedItem      = null;
            this.listBoxTerminators.SelectionChanged += selectionChangedHandler;
        }
Esempio n. 6
0
 public bool AddNewTerminator(TerminatorInfo info)
 {
     if (this.currentIndex < (MAX_TERMINATORS - 1))
     {
         if (info != null)
         {
             this.AddTerminator(info);
             return(true);
         }
     }
     return(false);
 }
        private void lstStoredTerminators_ItemSelected(object sender, SelectedItemChangedEventArgs e)
        {
            this.lstStoredTerminators.ItemSelected -= this.lstStoredTerminators_ItemSelected;
            TerminatorInfo item = this.lstStoredTerminators.SelectedItem as TerminatorInfo;

            if (item != null)
            {
                this.btnSave.IsVisible = true;
                this.terminatorDisplay.AddEntry(item);
                this.DetermineIfChanged();
                this.lstStoredTerminators.SelectedItem = null;
            }
            this.lstStoredTerminators.ItemSelected += this.lstStoredTerminators_ItemSelected;
        }
 private void AddTerminator(TerminatorInfo info, int index)
 {
     this.names[index].Content = info.Display;
     this.hex[index].Content   = info.HexDisplay;
 }
 public void SetValues(TerminatorInfo info)
 {
     this.Hex.Text  = info.HexDisplay;
     this.Name.Text = info.Display;
 }
 private void btnCancel_Click(object sender, RoutedEventArgs e)
 {
     this.SelectedTerminator = null;
     this.Close();
 }