Пример #1
0
 public ProgramInfo(ExtentProgramData pargramdata)
 {
     InitializeComponent();
     Data             = pargramdata;
     pargramData      = AT_BC.Data.Helpers.DataContractSerializeHelper.Clone <ExtentProgramData>(pargramdata);;
     this.DataContext = pargramData;
 }
Пример #2
0
        private void btnAdd_Click(object sender, RoutedEventArgs e)
        {
            ExtentProgramData data = new ExtentProgramData();
            ProgramInfo       info = new ProgramInfo(data);

            info.Title = "添加";
            if (info.ShowDialog(this) == true)
            {
                ProgramInfo.Add(data);
            }
        }
Пример #3
0
 private ExtentProgramData ToExtentProgramData(ExtentProgramInfo info)
 {
     if (info != null)
     {
         ExtentProgramData data = new ExtentProgramData();
         data.Name    = info.Name;
         data.Path    = info.Path;
         data.IconURL = info.IconURL;
         return(data);
     }
     return(null);
 }
Пример #4
0
        private void btnDelete_Click(object sender, RoutedEventArgs e)
        {
            ExtentProgramData data = dglist.SelectedItem as ExtentProgramData;

            if (data != null)
            {
                DeleteImageFile(data.IconURL);
                ProgramInfo.Remove(data);
                Save();
            }
            else
            {
                MessageBox.Show("请选择需要删除的项!");
            }
        }
Пример #5
0
 private ExtentProgramInfo ToExtentProgramInfo(ExtentProgramData info)
 {
     if (info != null)
     {
         ExtentProgramInfo data = new ExtentProgramInfo();
         data.Name    = info.Name;
         data.Path    = info.Path;
         data.IconURL = info.IconURL;
         if (string.IsNullOrEmpty(data.IconURL))
         {
             data.IconURL = "/CO_IA.UI.Screen;component/Images/defaultprogram.png";
         }
         return(data);
     }
     return(null);
 }
Пример #6
0
        private void btnModify_Click(object sender, RoutedEventArgs e)
        {
            ExtentProgramData data = dglist.SelectedItem as ExtentProgramData;

            if (data != null)
            {
                string      imgfile = data.IconURL;
                ProgramInfo info    = new ProgramInfo(data);
                info.Title = "修改";
                if (info.ShowDialog(this) == true)
                {
                    if (data.IconURL != imgfile)
                    {
                        DeleteImageFile(imgfile);
                    }
                }
            }
            else
            {
                MessageBox.Show("请选择修改项!");
            }
        }
Пример #7
0
        private void AddSectionItem(ConfigurationSectionGroup group, string index, ExtentProgramData data)
        {
            ExtentProgramInfo info = ToExtentProgramInfo(data);

            group.Sections.Add(index.ToString(), info);
        }