Пример #1
0
        private bool LoadHeaderSetConfig()
        {
            try
            {
                if (!System.IO.File.Exists("C:\\Gateway\\Config\\EDC_Header_Set_Config.json"))
                {
                    //MessageBox.Show("No tag set config file exists! Please start to create tag set template.", "Information");
                    //ObjectManager.TagSetManager_Initial();
                    return(true);
                }

                StreamReader inputFile = new StreamReader("C:\\Gateway\\Config\\EDC_Header_Set_Config.json");

                string json_string = inputFile.ReadToEnd();

                //ObjectManager.TagSetManager_Initial(json_string);
                this.edc_header_list = JsonConvert.DeserializeObject <EDCHeaderSet>(json_string);

                if (this.edc_header_list.head_set_list == null)
                {
                    MessageBox.Show("No EDC header set exists!", "Information");
                    return(false);
                }

                inputFile.Close();
            }
            catch
            {
                MessageBox.Show("EDC Header Set config file loading error!", "Error");
                return(false);
            }

            return(true);
        }
        public frmListEDCHeaderSet(SetEDCHeaderList set_list, EDCHeaderSet hs)
        {
            InitializeComponent();
            this.hsList = hs;
            this.delgEDCHeaderSetList = set_list;

            this.hsList.eventAddHeaderSet += new EventHandler(this.btnAddHeaderSet_Click);
        }