public InstructionListManager(IInstructionListLoader instructionListLoader, IDocumentFactory documentFactory) { instructionListLoader.InstructionsUpdated += InstructionsLoaded; documentFactory.ActiveDocumentChanged += ActiveDocumentChanged; _radAsm1InstructionSets = new List <IInstructionSet>(); _radAsm2InstructionSets = new List <IInstructionSet>(); _radAsm1Instructions = new List <Instruction>(); _radAsm2Instructions = new List <Instruction>(); _activeDocumentType = AsmType.Unknown; InstructionsLoaded(instructionListLoader.InstructionSets); Instance = this; }
private void OnMenuCombo(object sender, EventArgs e) { if (e == null || e == EventArgs.Empty) { throw new ArgumentException("Event args are required"); } if (!(e is OleMenuCmdEventArgs eventArgs)) { throw new ArgumentException("Event args should be OleMenuCmdEventArgs"); } if (InstructionListManager.Instance == null) { return; } if (!_initialized) { _instructionSetManager = InstructionListManager.Instance; _instructionSetManager.AsmTypeChanged += AsmTypeChanged; AsmTypeChanged(); _initialized = true; } var vOut = eventArgs.OutValue; var input = eventArgs.InValue; if (_instructionSets == null) { InitializeSets(); } if (vOut != IntPtr.Zero) { Marshal.GetNativeVariantForObject(_currentSet, vOut); } else if (input != null) { _currentSet = input.ToString(); _instructionSetManager.ChangeInstructionSet(_currentSet != AllSets ? _currentSet : null); } }