private void InstructionsLoaded(IEnumerable <IInstructionSet> instructions)
        {
            _radAsm1InstructionSets.Clear();
            _radAsm2InstructionSets.Clear();
            _radAsm1Instructions.Clear();
            _radAsm2Instructions.Clear();

            foreach (var typeGroup in instructions.GroupBy(s => s.Type))
            {
                switch (typeGroup.Key)
                {
                case InstructionType.RadAsm1: _radAsm1InstructionSets.AddRange(typeGroup.AsEnumerable()); break;

                case InstructionType.RadAsm2: _radAsm2InstructionSets.AddRange(typeGroup.AsEnumerable()); break;
                }
            }

            _radAsm1Instructions.AddRange(_radAsm1InstructionSets.SelectMany(s => s.Select(i => i)));
            _radAsm2Instructions.AddRange(_radAsm2InstructionSets.SelectMany(s => s.Select(i => i)));

            var optionProvider = GeneralOptionProvider.Instance;

            _radAsm1SelectedSet = _radAsm1InstructionSets.FirstOrDefault(s => s.ToString() == optionProvider.Asm1SelectedSet);
            _radAsm2SelectedSet = _radAsm2InstructionSets.FirstOrDefault(s => s.ToString() == optionProvider.Asm2SelectedSet);

            AsmTypeChanged?.Invoke();
            InstructionsUpdatedInvoke(AsmType.RadAsmCode);
        }
        private void ActiveDocumentChanged(IDocument activeDocument)
        {
            var newActiveDocumentAsm = activeDocument?.CurrentSnapshot.GetAsmType() ?? AsmType.Unknown;

            if (newActiveDocumentAsm == _activeDocumentType)
            {
                return;
            }

            _activeDocumentType = newActiveDocumentAsm;
            AsmTypeChanged?.Invoke();
        }