Пример #1
0
        private void _tagger_LoadTagset(object sender, TaggerEventArgs e)
        {
            _service.CheckTagset();
            if (_service.TagsetSet)
            {
                _service.ProjectTagset = File.ReadAllText(ProjectInfo.TagsetPath);
                string   line  = File.ReadAllText(ProjectInfo.TagCountsPath);
                string[] lines = line.Split(new char[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries);
                foreach (var item in lines)
                {
                    var temp = item.Split(' ');
                    SituationIndex.TagsetCounter.Add(temp[0], int.Parse(temp[1]));
                }

                _tagger.DisplayTagset(TagsetIndex.Index[_service.ProjectTagset]);
                _main.SetTagsetLabel(_service.ProjectTagset);
                _tagger.DisplayTagsetColors(TagsetIndex.ColorIndex[_service.ProjectTagset]);
            }
        }
        private void _tagset_SetProjectTagset(object sender, TagsetUpdateEventArgs args)
        {
            _service.ProjectTagset = args.Name;

            if (!_service.TagsetSet)
            {
                File.WriteAllText(ProjectInfo.TagsetPath, args.Name);
                _service.TagsetSet = true;
            }
            else
            {
                File.WriteAllText(ProjectInfo.TagsetPath, String.Empty);
                File.WriteAllText(ProjectInfo.TagsetPath, args.Name);
            }
            _tagset.DisplayProjectTagsetName(_service.ProjectTagset);
            _main.TagsetColors = TagsetIndex.ColorIndex[args.Name];
            _main.DisplayTagset(TagsetIndex.Index[args.Name]);
            _main.DisplayTagsetColors(_main.TagsetColors);
        }