示例#1
0
        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 (AddValue.Text == "")
            {
                return;
            }
            if (Convert.ToInt32(AddValue.Text) == 0)
            {
                return;
            }

            string                      type_name   = AddType.SelectedItem.ToString();
            double                      add_value   = Convert.ToDouble(AddValue.Text);
            ITEM_OPTION_TYPE            type        = EnumItemOptionTable_Kor.GET_ITEM_OPTION_TYPE(ref type_name);
            Dictionary <string, double> item_option = GetItemOptionDictionary(type);

            item_option[type_name] = add_value;

            SetNowItemOption();
            AddType.SelectedIndex = 0;
            AddValue.Text         = null;
        }
示例#2
0
        private void Refine_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 Refine   = OptionStack.Children[0] as ComboBox;
            ComboBox AddType  = OptionStack.Children[2] as ComboBox;
            TextBox  AddValue = OptionStack.Children[3] as TextBox;

            if (AddValue.Text == "")
            {
                return;
            }
            if (Convert.ToInt32(AddValue.Text) == 0)
            {
                return;
            }

            int              refine    = Refine.SelectedIndex;
            string           type_name = AddType.SelectedItem.ToString();
            double           add_value = Convert.ToDouble(AddValue.Text);
            ITEM_OPTION_TYPE type      = EnumItemOptionTable_Kor.GET_ITEM_OPTION_TYPE(ref type_name);

            if (now_item.Option_Refine.ContainsKey(refine) == false)
            {
                now_item.Option_Refine.Add(refine, new Dictionary <ITEM_OPTION_TYPE, Dictionary <string, double> >());
            }

            if (now_item.Option_Refine[refine].ContainsKey(type) == false)
            {
                now_item.Option_Refine[refine].Add(type, new Dictionary <string, double>());
            }
            now_item.Option_Refine[refine][type][type_name] = add_value;

            SetNowItemOption();
            AddType.SelectedIndex = 0;
            AddValue.Text         = null;
        }