Exemplo n.º 1
0
        private void AddBeamPort_click(object sender, RoutedEventArgs e)
        {
            BeamPort bp = new BeamPort();

            this.Data.BeamPorts.Add(bp);

            beamExpander.IsExpanded = true;
        }
Exemplo n.º 2
0
 public MainWindow()
 {
     Beam  = new BeamPort();
     Files = new ObservableCollection <FileMap>();
     InitializeComponent();
     ModManagement.Downloaded     += new EventHandler <System.ComponentModel.AsyncCompletedEventArgs>(ModManagement_Downloaded);
     ModManagement.DownloadFailed += new EventHandler <System.ComponentModel.AsyncCompletedEventArgs>(ModManagement_DownloadFailed);
     Configuration = InstalledModConfigurations.Current.Configurations.Configurations[0];
 }
Exemplo n.º 3
0
        private void DeleteBeamPort_Click(object sender, RoutedEventArgs e)
        {
            Button btn = sender as Button;

            if (btn != null)
            {
                BeamPort bp = btn.CommandParameter as BeamPort;
                if (btn != null)
                {
                    this.Data.BeamPorts.Remove(bp);
                    AdjustWallRatio();
                }
            }
        }
 void SetSelectedItemMask()
 {
     if (SelectedIndex > -1 && SelectedIndex < BeamPorts.Count)
     {
         SelectedItemMask.Visibility = Visibility.Visible;
         SelectedItem = ic.Items[SelectedIndex] as BeamPort;
         SelectedItemMask.ArcWidth = SelectedItem.ArcWidth;
         SelectedItemMask.Range    = SelectedItem.Range;
         SelectedItemMask.X        = SelectedItem.X;
         SelectedItemMask.Z        = SelectedItem.Z;
     }
     else
     {
         SelectedItemMask.Visibility = Visibility.Collapsed;
     }
 }
Exemplo n.º 5
0
        static void OnBeamChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            BeamDrawingControl me = sender as BeamDrawingControl;

            if (me != null)
            {
                BeamPort oldValue = e.OldValue as BeamPort;
                BeamPort newValue = e.NewValue as BeamPort;
                if (oldValue != null)
                {
                    oldValue.VectorItemChanged -= new EventHandler(me.Beam_VectorItemChanged);
                }
                if (newValue != null)
                {
                    newValue.VectorItemChanged += new EventHandler(me.Beam_VectorItemChanged);
                }
            }
        }