Esempio n. 1
0
        private void loadConfig(string activeProfileFilePath)
        {
            try
            {
                //Load the reader with the XML file.
                reader = new XmlTextReader(activeProfileFilePath);
                XmlDocument xml = new XmlDocument();
                xml.Load(activeProfileFilePath);
                string title_name = xml.SelectSingleNode("Profile/Title").InnerText;
                bool   isMinimize = bool.Parse(xml.SelectSingleNode("Profile/Minimize").InnerText);
                selectProfile.Text = title_name;
                profile            = new profile(title_name, isMinimize);

                if (isMinimize)
                {
                    startMinimize.Checked = true;
                }
                else
                {
                    startMinimize.Checked = false;
                }

                for (int i = 1; i <= 9; i++)
                {
                    ArrayList SubData = new ArrayList();

                    string bottomKey     = "Button" + i;
                    string getXMLType    = xml.SelectSingleNode("Profile/" + bottomKey + "/Type").InnerText;
                    string getXMLProgram = xml.SelectSingleNode("Profile/" + bottomKey + "/Program").InnerText;

                    SubData.Add(getXMLType);
                    SubData.Add(getXMLProgram);

                    profile.setButtonData(bottomKey, SubData);
                }
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                }
            }
        }
Esempio n. 2
0
 public Form2(profile profile, string button)
 {
     InitializeComponent();
     this.profile = profile;
     this.button  = button;
 }