public AbilityPerStatus(IFTYPE iftype, int add_value, int per_value) { AddValue = add_value; PerValue = per_value; switch (iftype) { case IFTYPE.ATK_PER_STR: Calc = ATK_PER_STR; break; } }
private void Add_Option_Click(object sender, RoutedEventArgs e) { StackPanel parentStackpanel = ((sender as Button).Parent as StackPanel).Parent as StackPanel; StackPanel OptionStack = parentStackpanel.Children[0] as StackPanel; ComboBox AddType = OptionStack.Children[0] as ComboBox; TextBox AddValue = OptionStack.Children[1] as TextBox; //if (DB_ListBox.SelectedItem == null) // return; if (Convert.ToInt32(AddValue.Text) == 0) { return; } string typeName = Convert.ToString(AddType.SelectedItem); switch (Convert.ToString(parentStackpanel.Tag)) { case "ITYPE": { ITYPE type = (ITYPE)Enum.Parse(typeof(ITYPE), typeName); now_item.i_option[type] = Convert.ToInt32(AddValue.Text); break; } case "DTYPE": { DTYPE type = (DTYPE)Enum.Parse(typeof(DTYPE), typeName); now_item.d_option[type] = Convert.ToDouble(AddValue.Text); break; } case "SETYPE": { STATUS_EFFECT_TYPE type = (STATUS_EFFECT_TYPE)Enum.Parse(typeof(STATUS_EFFECT_TYPE), typeName); now_item.se_option[type] = Convert.ToDouble(AddValue.Text); break; } case "IFTYPE": { TextBox PerValue = OptionStack.Children[2] as TextBox; IFTYPE type = (IFTYPE)Enum.Parse(typeof(IFTYPE), typeName); now_item.if_option[type] = new AbilityPerStatus(type, Convert.ToInt32(AddValue.Text), Convert.ToInt32(PerValue.Text)); break; } } SetNowItemOption(); AddType.SelectedIndex = 0; AddValue.Text = "0"; }
private void Del_Option_Click(object sender, RoutedEventArgs e) { StackPanel parentStackpanel = ((sender as Button).Parent as StackPanel).Parent as StackPanel; ListBox OptionList = parentStackpanel.Children[2] as ListBox; if (OptionList.SelectedItem == null) { return; } if (DB_ListBox.SelectedItem == null) { return; } switch (Convert.ToString(parentStackpanel.Tag)) { case "ITYPE": { string typeName = (OptionList.SelectedItem as ItemOption_Binding <ITYPE, int>).Type_name; ITYPE type = (ITYPE)Enum.Parse(typeof(ITYPE), typeName); now_item.i_option.Remove(type); break; } case "DTYPE": { string typeName = (OptionList.SelectedItem as ItemOption_Binding <DTYPE, double>).Type_name; DTYPE type = (DTYPE)Enum.Parse(typeof(DTYPE), typeName); now_item.d_option.Remove(type); break; } case "SETYPE": { string typeName = (OptionList.SelectedItem as ItemOption_Binding <STATUS_EFFECT_TYPE, double>).Type_name; STATUS_EFFECT_TYPE type = (STATUS_EFFECT_TYPE)Enum.Parse(typeof(STATUS_EFFECT_TYPE), typeName); now_item.se_option.Remove(type); break; } case "IFTYPE": { string typeName = (OptionList.SelectedItem as ItemOption_Binding).Type_name; IFTYPE type = (IFTYPE)Enum.Parse(typeof(IFTYPE), typeName); now_item.if_option.Remove(type); break; } } SetNowItemOption(); }
/// <summary>Initializes a new instance of the <see cref="NET_LUID"/> struct.</summary> /// <param name="index"> /// A 24-bit index that NDIS allocates when an interface provider calls the NdisIfAllocateNetLuidIndex function. This index is /// used to distinguish between multiple interfaces that have the same interface type. Therefore, this value is unique within the /// local computer. /// </param> /// <param name="type"> /// A 16-bit value that specifies an Internet Assigned Numbers Authority (IANA) interface type. For example, /// IF_TYPE_ETHERNET_CSMACD (6) is the value for IfType that is assigned to any Ethernet-like interface. For a list of interface /// types, see NDIS Interface Types. /// </param> public NET_LUID(uint index, IFTYPE type) => Value = (index << 24) | ((ulong)type << 48);