예제 #1
0
        private void SelectItem(object sender, System.EventArgs e)
        {
            lldel.Enabled = false;
            if (lbprop.SelectedIndex < 0)
            {
                return;
            }
            lldel.Enabled = true;

            try
            {
                tbname.Tag = true;
                SimPe.Plugin.MaterialDefinitionProperty prop = (SimPe.Plugin.MaterialDefinitionProperty)lbprop.Items[lbprop.SelectedIndex];
                this.tbname.Text = prop.Name;
                this.tbval.Text  = prop.Value;
            }
            catch (Exception ex)
            {
                Helper.ExceptionMessage(Localization.Manager.GetString("errconvert"), ex);
            }
            finally
            {
                tbname.Tag = null;
            }
        }
예제 #2
0
        protected void Change()
        {
            if (this.Tag == null)
            {
                return;
            }
            if (this.lbprop.SelectedIndex < 0)
            {
                return;
            }
            try
            {
                tbname.Tag = true;
                SimPe.Plugin.MaterialDefinitionProperty prop = (SimPe.Plugin.MaterialDefinitionProperty)lbprop.Items[lbprop.SelectedIndex];

                prop.Name  = tbname.Text;
                prop.Value = tbval.Text;

                lbprop.Items[lbprop.SelectedIndex] = prop;

                SimPe.Plugin.MaterialDefinition md = (SimPe.Plugin.MaterialDefinition) this.Tag;
                md.Changed = true;
            }
            catch (Exception ex)
            {
                Helper.ExceptionMessage(Localization.Manager.GetString("errconvert"), ex);
            }
            finally
            {
                tbname.Tag = null;
            }
        }