本文整理汇总了C#中ICSharpCode.ILSpy.ILSpySettings类的典型用法代码示例。如果您正苦于以下问题:C# ILSpySettings类的具体用法?C# ILSpySettings怎么用?C# ILSpySettings使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ILSpySettings类属于ICSharpCode.ILSpy命名空间,在下文中一共展示了ILSpySettings类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MainWindow
public MainWindow()
{
instance = this;
spySettings = ILSpySettings.Load();
this.sessionSettings = new SessionSettings(spySettings);
this.assemblyListManager = new AssemblyListManager(spySettings);
if (Environment.OSVersion.Version.Major >= 6)
this.Icon = new BitmapImage(new Uri("pack://application:,,,/ILSpy;component/images/ILSpy.ico"));
else
this.Icon = Images.AssemblyLoading;
this.DataContext = sessionSettings;
this.Left = sessionSettings.WindowBounds.Left;
this.Top = sessionSettings.WindowBounds.Top;
this.Width = sessionSettings.WindowBounds.Width;
this.Height = sessionSettings.WindowBounds.Height;
// TODO: validate bounds (maybe a monitor was removed...)
this.WindowState = sessionSettings.WindowState;
InitializeComponent();
decompilerTextView.mainWindow = this;
if (sessionSettings.SplitterPosition > 0 && sessionSettings.SplitterPosition < 1) {
leftColumn.Width = new GridLength(sessionSettings.SplitterPosition, GridUnitType.Star);
rightColumn.Width = new GridLength(1 - sessionSettings.SplitterPosition, GridUnitType.Star);
}
sessionSettings.FilterSettings.PropertyChanged += filterSettings_PropertyChanged;
this.Loaded += new RoutedEventHandler(MainWindow_Loaded);
}
示例2: CheckForUpdatesIfEnabledAsync
/// <summary>
/// If automatic update checking is enabled, checks if there are any updates available.
/// Returns the download URL if an update is available.
/// Returns null if no update is available, or if no check was performed.
/// </summary>
public static Task<string> CheckForUpdatesIfEnabledAsync(ILSpySettings spySettings)
{
var tcs = new TaskCompletionSource<string>();
UpdateSettings s = new UpdateSettings(spySettings);
if (checkForUpdateCode && s.AutomaticUpdateCheckEnabled) {
// perform update check if we never did one before;
// or if the last check wasn't in the past 7 days
if (s.LastSuccessfulUpdateCheck == null
|| s.LastSuccessfulUpdateCheck < DateTime.UtcNow.AddDays(-7)
|| s.LastSuccessfulUpdateCheck > DateTime.UtcNow)
{
GetLatestVersionAsync().ContinueWith(
delegate (Task<AvailableVersionInfo> task) {
try {
s.LastSuccessfulUpdateCheck = DateTime.UtcNow;
AvailableVersionInfo v = task.Result;
if (v.Version > currentVersion)
tcs.SetResult(v.DownloadUrl);
else
tcs.SetResult(null);
} catch (AggregateException) {
// ignore errors getting the version info
tcs.SetResult(null);
}
});
} else {
tcs.SetResult(null);
}
} else {
tcs.SetResult(null);
}
return tcs.Task;
}
示例3: MainWindow
public MainWindow()
{
instance = this;
spySettings = ILSpySettings.Load();
this.sessionSettings = new SessionSettings(spySettings);
this.assemblyListManager = new AssemblyListManager(spySettings);
this.Icon = new BitmapImage(new Uri("pack://application:,,,/ILSpy;component/images/ILSpy.ico"));
this.DataContext = sessionSettings;
InitializeComponent();
App.CompositionContainer.ComposeParts(this);
mainPane.Content = decompilerTextView;
if (sessionSettings.SplitterPosition > 0 && sessionSettings.SplitterPosition < 1) {
leftColumn.Width = new GridLength(sessionSettings.SplitterPosition, GridUnitType.Star);
rightColumn.Width = new GridLength(1 - sessionSettings.SplitterPosition, GridUnitType.Star);
}
sessionSettings.FilterSettings.PropertyChanged += filterSettings_PropertyChanged;
InitMainMenu();
InitToolbar();
ContextMenuProvider.Add(treeView, decompilerTextView);
this.Loaded += new RoutedEventHandler(MainWindow_Loaded);
}
示例4: LoadList
/// <summary>
/// Loads an assembly list from the ILSpySettings.
/// If no list with the specified name is found, the default list is loaded instead.
/// </summary>
public AssemblyList LoadList(ILSpySettings spySettings, string listName)
{
AssemblyList list = DoLoadList(spySettings, listName);
if (!AssemblyLists.Contains(list.ListName))
AssemblyLists.Add(list.ListName);
return list;
}
示例5: AssemblyListManager
public AssemblyListManager(ILSpySettings spySettings)
{
XElement doc = spySettings["AssemblyLists"];
foreach (var list in doc.Elements("List")) {
AssemblyLists.Add(SessionSettings.Unescape((string)list.Attribute("name")));
}
}
示例6: CheckForUpdatesAsync
public static Task<string> CheckForUpdatesAsync(ILSpySettings spySettings)
{
var tcs = new TaskCompletionSource<string>();
UpdateSettings s = new UpdateSettings(spySettings);
CheckForUpdateInternal(tcs, s);
return tcs.Task;
}
示例7: MainWindow
public MainWindow()
{
spySettings = ILSpySettings.Load();
this.sessionSettings = new SessionSettings(spySettings);
this.assemblyListManager = new AssemblyListManager(spySettings);
this.DataContext = sessionSettings;
this.Left = sessionSettings.WindowBounds.Left;
this.Top = sessionSettings.WindowBounds.Top;
this.Width = sessionSettings.WindowBounds.Width;
this.Height = sessionSettings.WindowBounds.Height;
// TODO: validate bounds (maybe a monitor was removed...)
this.WindowState = sessionSettings.WindowState;
InitializeComponent();
decompilerTextView.mainWindow = this;
if (sessionSettings.SplitterPosition > 0 && sessionSettings.SplitterPosition < 1) {
leftColumn.Width = new GridLength(sessionSettings.SplitterPosition, GridUnitType.Star);
rightColumn.Width = new GridLength(1 - sessionSettings.SplitterPosition, GridUnitType.Star);
}
sessionSettings.FilterSettings.PropertyChanged += filterSettings_PropertyChanged;
#if DEBUG
AddDebugItemsToToolbar();
#endif
this.Loaded += new RoutedEventHandler(MainWindow_Loaded);
}
示例8: MainWindow
public MainWindow()
{
instance = this;
spySettings = ILSpySettings.Load();
this.sessionSettings = new SessionSettings(spySettings);
this.assemblyListManager = new AssemblyListManager(spySettings);
this.Icon = new BitmapImage(new Uri("pack://application:,,,/ILSpy;component/images/ILSpy.ico"));
this.DataContext = sessionSettings;
this.Left = sessionSettings.WindowBounds.Left;
this.Top = sessionSettings.WindowBounds.Top;
this.Width = sessionSettings.WindowBounds.Width;
this.Height = sessionSettings.WindowBounds.Height;
// TODO: validate bounds (maybe a monitor was removed...)
this.WindowState = sessionSettings.WindowState;
InitializeComponent();
App.CompositionContainer.ComposeParts(this);
Grid.SetRow(decompilerTextView, 1);
rightPane.Children.Add(decompilerTextView);
if (sessionSettings.SplitterPosition > 0 && sessionSettings.SplitterPosition < 1) {
leftColumn.Width = new GridLength(sessionSettings.SplitterPosition, GridUnitType.Star);
rightColumn.Width = new GridLength(1 - sessionSettings.SplitterPosition, GridUnitType.Star);
}
sessionSettings.FilterSettings.PropertyChanged += filterSettings_PropertyChanged;
InitMainMenu();
InitToolbar();
ContextMenuProvider.Add(treeView);
ContextMenuProvider.Add(analyzerTree);
this.Loaded += new RoutedEventHandler(MainWindow_Loaded);
}
示例9: LoadDecompilerSettings
public static DecompilerSettings LoadDecompilerSettings(ILSpySettings settings)
{
XElement e = settings["DecompilerSettings"];
DecompilerSettings s = new DecompilerSettings();
s.AnonymousMethods = (bool?)e.Attribute("anonymousMethods") ?? s.AnonymousMethods;
s.YieldReturn = (bool?)e.Attribute("yieldReturn") ?? s.YieldReturn;
return s;
}
示例10: LoadDecompilerSettings
public static DecompilerSettings LoadDecompilerSettings(ILSpySettings settings)
{
XElement e = settings["DecompilerSettings"];
DecompilerSettings s = new DecompilerSettings();
s.AnonymousMethods = (bool?)e.Attribute("anonymousMethods") ?? s.AnonymousMethods;
s.YieldReturn = (bool?)e.Attribute("yieldReturn") ?? s.YieldReturn;
s.QueryExpressions = (bool?)e.Attribute("queryExpressions") ?? s.QueryExpressions;
s.UseDebugSymbols = (bool?)e.Attribute("useDebugSymbols") ?? s.UseDebugSymbols;
return s;
}
示例11: Load
public override void Load(ILSpySettings settings)
{
// For loading options, use ILSpySetting's indexer.
// If the specified section does exist, the indexer will return a new empty element.
XElement e = settings[ns + "CustomOptions"];
// Now load the options from the XML document:
Options s = new Options();
s.UselessOption1 = (bool?)e.Attribute("useless1") ?? s.UselessOption1;
s.UselessOption2 = (double?)e.Attribute("useless2") ?? s.UselessOption2;
this.options = s;
}
示例12: Load
public void Load(ILSpySettings settings)
{
//Creates the viewmodel
var vm = new ILEditOptionPageViewModel();
//Initializes the viewmodel
vm.Load();
//Sets the data context
this.DataContext = vm;
}
示例13: LinqPadSpyContainer
public LinqPadSpyContainer(Application currentApplication, Language decompiledLanguage)
{
if (currentApplication == null)
{
throw new ArgumentNullException("currentApplication");
}
if (decompiledLanguage == null)
{
throw new ArgumentNullException("decompiledLanguage");
}
this.decompiledLanguage = decompiledLanguage;
this.currentApplication = currentApplication;
// Initialize supported ILSpy languages. Values used for the combobox.
Languages.Initialize(CompositionContainerBuilder.Container);
this.CurrentAssemblyList = new AssemblyList("LINQPadAssemblyList", this.currentApplication);
ICSharpCode.ILSpy.App.CompositionContainer = CompositionContainerBuilder.Container;
CompositionContainerBuilder.Container.ComposeParts(this);
// A hack to get around the global shared state of the Window object throughout ILSpy.
ICSharpCode.ILSpy.MainWindow.SpyWindow = this;
this.spySettings = ILSpySettings.Load();
this.sessionSettings = new SessionSettings(this.spySettings)
{
ActiveAssemblyList = this.CurrentAssemblyList.ListName
};
SetUpDataContext();
this.assemblyPath = LinqPadUtil.GetLastLinqPadQueryAssembly();
this.decompilerTextView = GetDecompilerTextView();
InitializeComponent();
this.mainPane.Content = this.decompilerTextView;
this.InitToolbar();
this.Loaded += new RoutedEventHandler(this.MainWindowLoaded);
}
示例14: DoLoadList
AssemblyList DoLoadList(ILSpySettings spySettings, string listName)
{
XElement doc = spySettings["AssemblyLists"];
if (listName != null) {
foreach (var list in doc.Elements("List")) {
if (SessionSettings.Unescape((string)list.Attribute("name")) == listName) {
return new AssemblyList(list);
}
}
}
XElement firstList = doc.Elements("List").FirstOrDefault();
if (firstList != null)
return new AssemblyList(firstList);
else
return new AssemblyList(listName ?? DefaultListName);
}
示例15: Load
public override void Load(ILSpySettings settings) {
this.settings = DebuggerSettings.Instance.Clone();
this.BreakProcessType = this.settings.BreakProcessType;
}