예제 #1
0
 public void ReadXml()
 {
     if (File.Exists(fbd.SelectedPath + @"\ProfileCatalog.xml"))
     {
         XmlSerializer _serializer = new XmlSerializer(typeof(SolutionProfile));
         using (var FS = new FileStream(fbd.SelectedPath + @"\ProfileCatalog.xml", FileMode.Open, FileAccess.Read))
         {
             StreamReader    reader      = new StreamReader(FS);
             string          read        = reader.ReadToEnd();
             StringReader    ReadXmlFile = new StringReader(read);
             SolutionProfile profile     = (SolutionProfile)_serializer.Deserialize(XmlReader.Create(ReadXmlFile));
             foreach (Section SectionName in profile.Section)
             {
                 if (SectionName.Name == "PlugIns")
                 {
                     foreach (SolutionProfileSectionModuleInfo ModuleInfo in SectionName.Modules)
                     {
                         if (ModuleInfo.AssemblyFile == "aexio.Xeus.DriveTest.dll")
                         {
                             checkedComboBoxEdit1.Properties.Items.Add("Drive Test");
                         }
                         if (ModuleInfo.AssemblyFile == "aexio.Xeus.Statistics.dll")
                         {
                             checkedComboBoxEdit1.Properties.Items.Add("Statistics");
                         }
                         if (ModuleInfo.AssemblyFile == "aexio.Xeus.Gpeh.dll")
                         {
                             checkedComboBoxEdit1.Properties.Items.Add("Ericsson Gpeh");
                         }
                         if (ModuleInfo.AssemblyFile == "aexio.Xeus.Chr.dll")
                         {
                             checkedComboBoxEdit1.Properties.Items.Add("Huawei PChr");
                         }
                         if (ModuleInfo.AssemblyFile == "aexio.Xeus.Mga.dll")
                         {
                             checkedComboBoxEdit1.Properties.Items.Add("NSN Megamon");
                         }
                         if (ModuleInfo.AssemblyFile == "aexio.Xeus.Cts.dll")
                         {
                             checkedComboBoxEdit1.Properties.Items.Add("ZTE Cts");
                         }
                         if (ModuleInfo.AssemblyFile == "aexio.Xeus.EriLteTr.dll")
                         {
                             checkedComboBoxEdit1.Properties.Items.Add("Ericsson Lte Trace");
                         }
                         if (ModuleInfo.AssemblyFile == "aexio.Xeus.AluCtg.dll")
                         {
                             checkedComboBoxEdit1.Properties.Items.Add("AluCtg");
                             checkedComboBoxEdit1.Properties.Items["AluCtg"].Enabled = false;
                         }
                     }
                 }
             }
             reader.Close();
             FS.Close();
         }
     }
 }
예제 #2
0
        private void Bt_Upgrade_Click(object sender, EventArgs e)
        {
            if (File.Exists(fbd.SelectedPath + @"\ProfileCatalog.xml") == true)
            {
                File.Delete(fbd.SelectedPath + @"\ProfileCatalog.xml");
                SolutionProfile _solutionProfile = new SolutionProfile();

                /***-----Section Name--------****/
                Section _SectionMain    = new Section();
                Section _SectionFeature = new Section();
                Section _sectionPlugins = new Section();

                /****-----Dependencies---------****/
                Dependencies DependenciesMAin = new Dependencies();

                /**----------Dependency--------**/
                Dependency _DependencyMain     = new Dependency();
                Dependency _DependencyFeature  = new Dependency();
                Dependency _DependencyPlugins  = new Dependency();
                Dependency _DependencyPlugins1 = new Dependency();


                /****------------Assemblly file----------------******/
                SolutionProfileSectionModuleInfo Main    = new SolutionProfileSectionModuleInfo();
                SolutionProfileSectionModuleInfo Feature = new SolutionProfileSectionModuleInfo();

                /******------Set Section Name----*********/
                _SectionMain.Name    = "Main";
                _SectionFeature.Name = "Features";
                _sectionPlugins.Name = "PlugIns";

                /***-----Set Dependency Name---***/
                _DependencyMain.Name     = string.Empty;
                _DependencyFeature.Name  = "Main";
                _DependencyPlugins.Name  = "Main";
                _DependencyPlugins1.Name = "Feature";

                /**----set assemblly file----**/
                Main.AssemblyFile    = "aexio.Xeus.Main.dll";
                Feature.AssemblyFile = "aexio.Xeus.Network.dll";

                /**---Collect----**/
                _SectionMain.Modules    = new List <SolutionProfileSectionModuleInfo>();
                _SectionFeature.Modules = new List <SolutionProfileSectionModuleInfo>();
                _sectionPlugins.Modules = new List <SolutionProfileSectionModuleInfo>();

                _SectionMain.Dependencies.Dependency    = new List <Dependency>();
                _SectionFeature.Dependencies.Dependency = new List <Dependency>();
                _sectionPlugins.Dependencies.Dependency = new List <Dependency>();

                _solutionProfile.Section = new List <Section>();

                /**---adding---**/
                _solutionProfile.Section.Add(_SectionMain);
                _solutionProfile.Section.Add(_SectionFeature);
                _solutionProfile.Section.Add(_sectionPlugins);

                _SectionMain.Dependencies.Dependency.Add(_DependencyMain);
                _SectionFeature.Dependencies.Dependency.Add(_DependencyFeature);
                _sectionPlugins.Dependencies.Dependency.Add(_DependencyPlugins);
                _sectionPlugins.Dependencies.Dependency.Add(_DependencyPlugins1);


                _SectionMain.Modules.Add(Main);
                _SectionFeature.Modules.Add(Feature);


                if (checkedComboBoxEdit1.Properties.Items["DriveTest"].CheckState == CheckState.Checked)
                {
                    SolutionProfileSectionModuleInfo DriveTest = new SolutionProfileSectionModuleInfo();
                    DriveTest.AssemblyFile = "aexio.Xeus.DriveTest.dll";
                    _sectionPlugins.Modules.Add(DriveTest);
                }
                if (checkedComboBoxEdit1.Properties.Items["Statistics"].CheckState == CheckState.Checked)
                {
                    SolutionProfileSectionModuleInfo Statistics = new SolutionProfileSectionModuleInfo();
                    Statistics.AssemblyFile = "aexio.Xeus.Statistics.dll";
                    _sectionPlugins.Modules.Add(Statistics);
                }
                if (checkedComboBoxEdit1.Properties.Items["Ericsson Gpeh"].CheckState == CheckState.Checked)
                {
                    SolutionProfileSectionModuleInfo Gpeh = new SolutionProfileSectionModuleInfo();
                    Gpeh.AssemblyFile = "aexio.Xeus.Gpeh.dll";
                    _sectionPlugins.Modules.Add(Gpeh);
                }
                if (checkedComboBoxEdit1.Properties.Items["Huawei PChr"].CheckState == CheckState.Checked)
                {
                    SolutionProfileSectionModuleInfo Chr = new SolutionProfileSectionModuleInfo();
                    Chr.AssemblyFile = "aexio.Xeus.Chr.dll";
                    _sectionPlugins.Modules.Add(Chr);
                }
                if (checkedComboBoxEdit1.Properties.Items["NSN Megamon"].CheckState == CheckState.Checked)
                {
                    SolutionProfileSectionModuleInfo Mga = new SolutionProfileSectionModuleInfo();
                    Mga.AssemblyFile = "aexio.Xeus.Mga.dll";
                    _sectionPlugins.Modules.Add(Mga);
                }
                if (checkedComboBoxEdit1.Properties.Items["ZTE Cts"].CheckState == CheckState.Checked)
                {
                    SolutionProfileSectionModuleInfo Cts = new SolutionProfileSectionModuleInfo();
                    Cts.AssemblyFile = "aexio.Xeus.Cts.dll";
                    _sectionPlugins.Modules.Add(Cts);
                }
                if (checkedComboBoxEdit1.Properties.Items["Ericsson Lte Trace"].CheckState == CheckState.Checked)
                {
                    SolutionProfileSectionModuleInfo EriLteTr = new SolutionProfileSectionModuleInfo();
                    EriLteTr.AssemblyFile = "aexio.Xeus.EriLteTr.dll";
                    _sectionPlugins.Modules.Add(EriLteTr);
                }

                /**
                 * if (checkedComboBoxEdit1.Properties.Items["AluCtg"].CheckState == CheckState.Checked)
                 * {
                 *  SolutionProfileSectionModuleInfo AluCtg = new SolutionProfileSectionModuleInfo();
                 *  AluCtg.AssemblyFile = "aexio.Xeus.AluCtg.dll";
                 *  _sectionPlugins.Modules.Add(AluCtg);
                 * }
                 ***/
                var serializer = new XmlSerializer(typeof(SolutionProfile));
                var stream     = new FileStream(fbd.SelectedPath + @"\ProfileCatalog.xml", FileMode.Create, FileAccess.Write);
                serializer.Serialize(stream, _solutionProfile);
                stream.Close();
            }
            else
            {
                XtraMessageBox.Show("Please Select Directory Installation Aexio.");
            }
        }