コード例 #1
0
ファイル: WepView.xaml.cs プロジェクト: mumitie/FF2BossEditor
 private void AddAttrBtn_Click(object sender, RoutedEventArgs e)
 {
     if (sender == null)
     {
         return;
     }
     if (((FrameworkElement)sender).DataContext is Core.Classes.Weapon wep)
     {
         Windows.WepAttrEditor attrEditor = new Windows.WepAttrEditor(new Core.Classes.Weapon.Attribute(wep));
         if (attrEditor.ShowDialog() == true)
         {
             wep.Attributes.Add(attrEditor.Attribute);
         }
     }
 }
コード例 #2
0
ファイル: WepView.xaml.cs プロジェクト: mumitie/FF2BossEditor
 private void EditAttr_Click(object sender, RoutedEventArgs e)
 {
     if (sender == null)
     {
         return;
     }
     if (((FrameworkElement)sender).DataContext is Core.Classes.Weapon.Attribute attr)
     {
         Windows.WepAttrEditor attrEditor = new Windows.WepAttrEditor(attr.Clone(attr.Parent));
         if (attrEditor.ShowDialog() == true)
         {
             attr.Arg  = attrEditor.Attribute.Arg;
             attr.ID   = attrEditor.Attribute.ID;
             attr.Name = attrEditor.Attribute.Name;
         }
     }
 }