/*
Copyright (C) 2014-2019 de4dot@gmail.com
This file is part of dnSpy
dnSpy is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
dnSpy is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with dnSpy. If not, see .
*/
using System;
using System.Collections.ObjectModel;
namespace dnSpy.Contracts.Debugger.Evaluation {
///
/// Debugger language service
///
public abstract class DbgLanguageService {
///
/// Gets all languages
///
/// Runtime kind GUID, see
///
public abstract ReadOnlyCollection GetLanguages(Guid runtimeKindGuid);
///
/// Sets the language that should be used by all runtimes with GUID
///
/// Runtime kind GUID, see
/// Language to use
public abstract void SetCurrentLanguage(Guid runtimeKindGuid, DbgLanguage language);
///
/// Gets the current language the runtime uses
///
/// Runtime kind GUID, see
///
public abstract DbgLanguage GetCurrentLanguage(Guid runtimeKindGuid);
///
/// Raised when a runtime's current language is changed
///
public abstract event EventHandler? LanguageChanged;
}
///
/// Language changed event args
///
public readonly struct DbgLanguageChangedEventArgs {
///
/// Runtime kind GUID, see
///
public Guid RuntimeKindGuid { get; }
///
/// New language
///
public DbgLanguage Language { get; }
///
/// Constructor
///
/// Runtime kind GUID, see
/// New language
public DbgLanguageChangedEventArgs(Guid runtimeKindGuid, DbgLanguage language) {
RuntimeKindGuid = runtimeKindGuid;
Language = language ?? throw new ArgumentNullException(nameof(language));
}
}
}