Example #1
0
        private ThreadedBindingList <FMSbaseObj> LoadSettingtoList()
        {
            ThreadedBindingList <FMSbaseObj> result = new ThreadedBindingList <FMSbaseObj>();
            XmlDocument doc;
            XmlNode     node;

            try
            {// load config document for current assembly
                doc = LoadConfigDocument();
                // retrieve TMOConfigurations
                node = doc.SelectSingleNode("//TMOConfigurations");
                if (node != null)
                {
                    foreach (XmlElement selectNode in node.SelectNodes("//TMOConfiguration"))
                    {
                        try
                        {
                            var _maxt = 1;
                            if (!int.TryParse(selectNode.GetAttribute("MaxProcessThreads"), out _maxt))
                            {
                                _maxt = 1;
                            }
                            FMSbaseObj o = FMSbaseObj.CreateFMSObj(selectNode.GetAttribute("Id"), selectNode.GetAttribute("InputUNC"),
                                                                   selectNode.GetAttribute("OutputUNC"), selectNode.GetAttribute("StoreProcedure"), _maxt, selectNode.GetAttribute("Classname"));
                            result.Add(o);
                        }
                        catch (Exception ex)
                        {
                            Loghelper.Write(LogLevel.Error, ex.Message);
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Loghelper.Write(LogLevel.Error, e.Message);
            }
            finally
            {
                node = null;
                doc  = null;
            }

            return(result);
        }
Example #2
0
 private void loadingSettingToolStripMenuItem_Click(object sender, EventArgs e)
 {
     fMSObjs = LoadSettingtoList();
     dataGridView1.AutoGenerateColumns = false;
     dataGridView1.DataSource          = fMSObjs;
 }