示例#1
0
        private void mEdit_Click(object sender, RoutedEventArgs e)
        {
            GongsiName     gongsi  = (GongsiName)this.listGongsi.SelectedItem;
            SetValueWindow setting = new SetValueWindow
            {
                Owner = this,
                WindowStartupLocation = WindowStartupLocation.CenterOwner
            };

            setting.SetValue(gongsi.Name);
            setting.ShowDialog();
            if (Selected == gongsi.Name)
            {
                Selected = setting.gcname;
            }
            gongsi.Name = setting.gcname;
        }
示例#2
0
        private void btnNew_Click(object sender, RoutedEventArgs e)
        {
            SetValueWindow setting = new SetValueWindow
            {
                Owner = this,
                WindowStartupLocation = WindowStartupLocation.CenterOwner
            };

            setting.ShowDialog();
            if (setting.gcname != "" && setting.gcname != null)
            {
                GongsiName gc = new GongsiName()
                {
                    Name = setting.gcname
                };
                list.Add(gc);
                listGongsi.ScrollIntoView(listGongsi.Items[listGongsi.Items.Count - 1]);
            }
        }