Skip to content

Commit

Permalink
Merge pull request #1 from 0xd4d/master
Browse files Browse the repository at this point in the history
use the latest
  • Loading branch information
CreateAndInject authored Oct 22, 2017
2 parents 8cd90a0 + 1e8b50d commit cb200dd
Show file tree
Hide file tree
Showing 4,386 changed files with 279,633 additions and 85,257 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
110 changes: 110 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
root = true

[*]
indent_size = 4
indent_style = tab
insert_final_newline = true
tab_width = 4
#end_of_line =

[*.json]

[App.config]

[*.yml]
indent_size = 2
indent_style = space

[*.{proj,csproj,vbproj,props,targets,resx,vsixmanifest}]
indent_size = 2
indent_style = space

[app.manifest]
indent_size = 2
indent_style = space

[*.xml]

[*.xaml]
indent_style = space

[*.{cs,vb}]
dotnet_sort_system_directives_first = true
dotnet_style_qualification_for_field = false:suggestion
dotnet_style_qualification_for_property = false:suggestion
dotnet_style_qualification_for_method = false:suggestion
dotnet_style_qualification_for_event = false:suggestion
dotnet_style_predefined_type_for_locals_parameters_members = true:none
dotnet_style_predefined_type_for_member_access = true:none
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_separate_import_directive_groups = false
dotnet_style_prefer_is_null_check_over_reference_equality_method = false:suggestion
dotnet_style_require_accessibility_modifiers = never:info

[*.cs]
csharp_style_throw_expression = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
csharp_style_var_for_built_in_types = false:none
csharp_style_var_when_type_is_apparent = true:suggestion
csharp_style_var_elsewhere = true:suggestion
csharp_style_conditional_delegate_call = true:suggestion
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
csharp_style_expression_bodied_constructors = true:suggestion
csharp_style_expression_bodied_methods = true:suggestion
csharp_style_expression_bodied_operators = true:suggestion
csharp_style_expression_bodied_properties = true:suggestion
csharp_style_expression_bodied_indexers = true:suggestion
csharp_style_expression_bodied_accessors = true:suggestion
csharp_prefer_braces = false
csharp_space_between_method_declaration_name_and_open_parenthesis = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_between_parentheses =
csharp_space_after_cast = false
csharp_space_around_declaration_statements = false
csharp_space_before_open_square_brackets = false
csharp_space_between_empty_square_brackets = false
csharp_space_between_square_brackets = false
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_after_comma = true
csharp_space_after_dot = false
csharp_space_after_semicolon_in_for_statement = true
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_before_comma = false
csharp_space_before_dot = false
csharp_space_before_semicolon_in_for_statement = false
csharp_space_around_binary_operators = before_and_after
csharp_indent_braces = false
csharp_indent_block_contents = true
csharp_indent_switch_labels = false
csharp_indent_case_contents = true
csharp_indent_labels = flush_left
csharp_preserve_single_line_blocks = true
csharp_preserve_single_line_statements = true
csharp_new_line_before_open_brace = none
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_between_query_expression_clauses = true
csharp_indent_case_contents_when_block = false
csharp_prefer_inferred_anonymous_type_member_names = true:suggestion
csharp_prefer_inferred_tuple_names = true:suggestion
csharp_prefer_simple_default_expression = true:suggestion
#csharp_preferred_modifier_order =
csharp_style_pattern_local_over_anonymous_function = true:suggestion

[*.vb]
visual_basic_prefer_inferred_anonymous_type_member_names = true:suggestion
visual_basic_prefer_inferred_tuple_names = true:suggestion
#visual_basic_preferred_modifier_order =
9 changes: 9 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,12 @@
[submodule "dnSpy/dnSpy.Images"]
path = dnSpy/dnSpy.Images
url = https://github.com/0xd4d/dnSpy.Images.git
[submodule "Extensions/dnSpy.Debugger/netcorefiles"]
path = Extensions/dnSpy.Debugger/netcorefiles
url = https://github.com/0xd4d/netcorefiles.git
[submodule "Extensions/dnSpy.Debugger/clrmd"]
path = Extensions/dnSpy.Debugger/clrmd
url = https://github.com/0xd4d/clrmd.git
[submodule "dnSpy/Roslyn/Roslyn.ExpressionCompiler"]
path = dnSpy/Roslyn/Roslyn.ExpressionCompiler
url = https://github.com/0xd4d/Roslyn.ExpressionCompiler.git
8 changes: 2 additions & 6 deletions Extensions/Examples/Example1.Extension/CodeCtxMenus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ sealed class TextEditorCommand1 : MenuItemBase {
readonly MySettings mySettings;

[ImportingConstructor]
TextEditorCommand1(MySettings mySettings) {
this.mySettings = mySettings;
}
TextEditorCommand1(MySettings mySettings) => this.mySettings = mySettings;

public override bool IsChecked(IMenuItemContext context) => mySettings.BoolOption1;
public override void Execute(IMenuItemContext context) => mySettings.BoolOption1 = !mySettings.BoolOption1;
Expand All @@ -60,9 +58,7 @@ sealed class TextEditorCommand2 : MenuItemBase {
readonly MySettings mySettings;

[ImportingConstructor]
TextEditorCommand2(MySettings mySettings) {
this.mySettings = mySettings;
}
TextEditorCommand2(MySettings mySettings) => this.mySettings = mySettings;

public override bool IsChecked(IMenuItemContext context) => mySettings.BoolOption2;
public override void Execute(IMenuItemContext context) => mySettings.BoolOption2 = !mySettings.BoolOption2;
Expand Down
13 changes: 3 additions & 10 deletions Extensions/Examples/Example1.Extension/Example1.Extension.csproj
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{B24AAB0F-CA85-4D85-8B46-10D634896E2A}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Example1.Extension</RootNamespace>
<AssemblyName>Example1.Extension.x</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Features>strict</Features>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -79,11 +79,4 @@
</Page>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
10 changes: 5 additions & 5 deletions Extensions/Examples/Example1.Extension/MySettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ public string StringOption3 {
public MySettings Clone() => CopyTo(new MySettings());

public MySettings CopyTo(MySettings other) {
other.BoolOption1 = this.BoolOption1;
other.BoolOption2 = this.BoolOption2;
other.StringOption3 = this.StringOption3;
other.BoolOption1 = BoolOption1;
other.BoolOption2 = BoolOption2;
other.StringOption3 = StringOption3;
return other;
}
}
Expand All @@ -73,12 +73,12 @@ sealed class MySettingsImpl : MySettings {
// Read the settings from the file or use the default values if our settings haven't
// been saved to it yet.

this.disableSave = true;
disableSave = true;
var sect = settingsService.GetOrCreateSection(SETTINGS_GUID);
BoolOption1 = sect.Attribute<bool?>(nameof(BoolOption1)) ?? BoolOption1;
BoolOption2 = sect.Attribute<bool?>(nameof(BoolOption2)) ?? BoolOption2;
StringOption3 = sect.Attribute<string>(nameof(StringOption3)) ?? StringOption3;
this.disableSave = false;
disableSave = false;
}
readonly bool disableSave;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace Example1.Extension {
public partial class MySettingsControl : UserControl {
public MySettingsControl() {
InitializeComponent();
}
public MySettingsControl() => InitializeComponent();
}
}
11 changes: 4 additions & 7 deletions Extensions/Examples/Example1.Extension/MySettingsPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ sealed class MyAppSettingsPageProvider : IAppSettingsPageProvider {

// This constructor gets the single MySettingsImpl instance exported by MySettingsImpl in MySettings.cs
[ImportingConstructor]
MyAppSettingsPageProvider(MySettings mySettings) {
this.mySettings = mySettings;
}
MyAppSettingsPageProvider(MySettings mySettings) => this.mySettings = mySettings;

public IEnumerable<AppSettingsPage> Create() {
// We only create one page
Expand Down Expand Up @@ -60,14 +58,13 @@ public override object UIObject {
readonly MySettings newSettings;

public MyAppSettingsPage(MySettings mySettings) {
this.globalSettings = mySettings;
this.newSettings = mySettings.Clone();
globalSettings = mySettings;
newSettings = mySettings.Clone();
}

public override void OnApply() {
public override void OnApply() =>
// OK/Apply was pressed, save the settings
newSettings.CopyTo(globalSettings);
}

public override void OnClosed() {
// The dialog box was closed
Expand Down
14 changes: 7 additions & 7 deletions Extensions/Examples/Example1.Extension/ToolBarCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ sealed class TBCommand2 : ToolBarObjectBase {
readonly ComboBox comboBox;

TBCommand2() {
this.comboBox = new ComboBox();
this.comboBox.Width = 100;
this.comboBox.Items.Add("Item #1");
this.comboBox.Items.Add("Item #2");
this.comboBox.Items.Add("Item #3");
this.comboBox.Items.Add("Item #4");
this.comboBox.SelectedIndex = 1;
comboBox = new ComboBox();
comboBox.Width = 100;
comboBox.Items.Add("Item #1");
comboBox.Items.Add("Item #2");
comboBox.Items.Add("Item #3");
comboBox.Items.Add("Item #4");
comboBox.SelectedIndex = 1;
}

public override object GetUIObject(IToolBarItemContext context, IInputElement commandTarget) => comboBox;
Expand Down
7 changes: 3 additions & 4 deletions Extensions/Examples/Example1.Extension/TreeViewCtxMenus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ sealed class TVContext {
public DocumentTreeNodeData[] Nodes { get; }

public TVContext(bool someValue, IEnumerable<DocumentTreeNodeData> nodes) {
this.SomeValue = someValue;
this.Nodes = nodes.ToArray();
SomeValue = someValue;
Nodes = nodes.ToArray();
}
}

Expand Down Expand Up @@ -61,10 +61,9 @@ sealed class TVCommand3 : TVCtxMenuCommand {
public override void Execute(TVContext context) {
int secretNum = new Random().Next() % 10;
MsgBox.Instance.Ask<int?>("Number", null, "Guess a number", null, s => {
int num;
if (string.IsNullOrWhiteSpace(s))
return "Enter a number";
if (!int.TryParse(s, out num))
if (!int.TryParse(s, out int num))
return "Not an integer";
if (num == 42)
return "Nope!";
Expand Down
5 changes: 3 additions & 2 deletions Extensions/Examples/Example1.Extension/project.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"dependencies": {
"Microsoft.VisualStudio.Text.UI.Wpf": "15.0.25824-RC"
"System.ValueTuple": "4.4.0",
"Microsoft.VisualStudio.Text.UI.Wpf": "15.0.26201"
},
"frameworks": {
"net46": { }
"net462": { }
},
"runtimes": {
"win": { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ public override IEnumerable<DocumentTreeNodeData> Nodes {

readonly AssemblyChildNode node;

public AssemblyChildNodeTabContent(AssemblyChildNode node) {
this.node = node;
}
public AssemblyChildNodeTabContent(AssemblyChildNode node) => this.node = node;

// Called when the user opens a new tab. Override CanClone and return false if
// Clone() isn't supported
Expand Down Expand Up @@ -103,12 +101,12 @@ sealed class AssemblyChildNodeUIContext : DocumentTabUIContext {
readonly AssemblyChildNodeVM vm;

public AssemblyChildNodeUIContext() {
this.vm = new AssemblyChildNodeVM();
vm = new AssemblyChildNodeVM();
// A ContentPresenter + DataTemplate is used to show the VM, but you could of course use
// a UserControl.
this.content = new ContentPresenter {
content = new ContentPresenter {
Focusable = true,
Content = this.vm,
Content = vm,
};
}

Expand All @@ -117,8 +115,8 @@ sealed class MyUIState {
public bool Value2;

public MyUIState(string value1, bool value2) {
this.Value1 = value1;
this.Value2 = value2;
Value1 = value1;
Value2 = value2;
}
}

Expand Down
Loading

0 comments on commit cb200dd

Please sign in to comment.