示例#1
0
        /// <summary>
        /// Read configuration and apply override TODO: Improve description
        /// </summary>
        private void ReadConfiguration()
        {
            string path = InputPorts[0].Data.ToString();

            if (path != null)
            {
                string st = System.IO.File.ReadAllText(path);

                try
                {
                    selectionSetsConfs = JsonConvert.DeserializeObject <JsonSelectionSetsConfiguration>(st);
                }
                catch (Exception exp)
                { System.Windows.MessageBox.Show(exp.Message); }

                if (selectionSetsConfs != null)
                {
                    foreach (var set in selectionSetsConfs.SelectionSets.Selectionset)
                    {
                        RecursiveSets(set);
                    }
                    foreach (var set in selectionSetsConfs.SelectionSets.Viewfolder)
                    {
                        RecursiveSets(set);
                    }
                }
            }
        }
示例#2
0
        public static void convertXMLtoConfiguration(string path)
        {
            var jsonXML = JsonConvert.SerializeObject(exchangeFile, Newtonsoft.Json.Formatting.Indented);

            jsonSelectionSetsFile = JsonConvert.DeserializeObject <JsonSelectionSetsConfiguration>(jsonXML);

            File.WriteAllText(path, jsonXML);
        }