Esempio n. 1
0
        private void btnEnrichHierarchy_Click(object sender, EventArgs e)
        {
            if (openFDEnrichHierarchy.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                StreamReader sr = new StreamReader(openFDEnrichHierarchy.FileName);

                string[] stringSeparators = new string[] { "\r\n" };
                string[] hierarchyNodes   = (sr.ReadToEnd()).Split(stringSeparators, StringSplitOptions.None);

                Hierarchy hier = contr.DeserilizeHierarchy(Constants.HierarchySource);

                foreach (var pair in hierarchyNodes)
                {
                    if (pair.Length != 0)
                    {
                        string[] combination = pair.Split(',');
                        hier.HierarchyPairs.Add(new string[] { combination[0], combination[1] });
                    }
                }

                contr.SerilizeHierarchy(hier, Constants.HierarchySource);
                sr.Close();
            }
        }