Exemplo n.º 1
0
        private void InitBlockGroup()
        {
            List <BlockItemGroup> blockDef = new List <BlockItemGroup>();

            cbCustom.Items.Add("无");
            blockDef.Add(new BlockItemGroup("无", "", ""));
            DefinedRegionParse defineRegion = new DefinedRegionParse();
            BlockDefined       blockDefined = defineRegion.BlockDefined;

            if (blockDefined == null || blockDefined.BlockItemGroups == null || blockDefined.BlockItemGroups.Length == 0)
            {
                return;
            }
            foreach (BlockItemGroup group in blockDefined.BlockItemGroups)
            {
                if (group.Name == "005" || group.Name == "010")
                {
                    continue;
                }
                cbCustom.Items.Add(string.IsNullOrEmpty(group.Description) ? group.Name : group.Description);
                blockDef.Add(group);
            }
            cbCustom.Tag           = blockDef;
            cbCustom.SelectedIndex = 0;
        }
Exemplo n.º 2
0
        public Main()
        {
            InitializeComponent();
            _regex = new Regex(@"\S+_\S+_(?<region>(0D|0S)\d{2})", RegexOptions.Compiled);
            DefinedRegionParse parse = new DefinedRegionParse();
            BlockDefined       block = parse.BlockDefined;

            _group = block.FindGroup("干旱");
        }