diff --git a/.gitignore b/.gitignore index d65d9d2e06b..4d42c1081c9 100644 --- a/.gitignore +++ b/.gitignore @@ -29,4 +29,5 @@ bin/ *.sdsettings *.DotSettings.user *.suo -.DS_Store \ No newline at end of file +.DS_Store +/JSON/Schemas/Catalog diff --git a/.gitmodules b/.gitmodules index 418de9e68eb..0171f47c82a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,9 @@ [submodule "src/Libraries/AvalonEdit"] path = src/Libraries/AvalonEdit - url = https://github.com/icsharpcode/AvalonEdit.git + url = https://github.com/CoolCoderSuper/AvalonEdit.git [submodule "src/Libraries/NRefactory"] path = src/Libraries/NRefactory - url = https://github.com/icsharpcode/NRefactory.git + url = https://github.com/CoolCoderSuper/NRefactory.git [submodule "src/Libraries/cecil"] path = src/Libraries/cecil url = https://github.com/jbevain/cecil.git diff --git a/.vs/ProjectEvaluation/sharpdevelop.metadata.v7.bin b/.vs/ProjectEvaluation/sharpdevelop.metadata.v7.bin new file mode 100644 index 00000000000..c952441032f Binary files /dev/null and b/.vs/ProjectEvaluation/sharpdevelop.metadata.v7.bin differ diff --git a/.vs/ProjectEvaluation/sharpdevelop.projects.v7.bin b/.vs/ProjectEvaluation/sharpdevelop.projects.v7.bin new file mode 100644 index 00000000000..ca18ed30697 Binary files /dev/null and b/.vs/ProjectEvaluation/sharpdevelop.projects.v7.bin differ diff --git a/.vs/SharpDevelop.Tests/FileContentIndex/23774adc-5552-4b82-827b-2f0be3ed42b6.vsidx b/.vs/SharpDevelop.Tests/FileContentIndex/23774adc-5552-4b82-827b-2f0be3ed42b6.vsidx new file mode 100644 index 00000000000..402cce3bfa1 Binary files /dev/null and b/.vs/SharpDevelop.Tests/FileContentIndex/23774adc-5552-4b82-827b-2f0be3ed42b6.vsidx differ diff --git a/.vs/SharpDevelop.Tests/FileContentIndex/33a61126-f118-4483-844d-3601f92c7a4c.vsidx b/.vs/SharpDevelop.Tests/FileContentIndex/33a61126-f118-4483-844d-3601f92c7a4c.vsidx new file mode 100644 index 00000000000..b43b8715857 Binary files /dev/null and b/.vs/SharpDevelop.Tests/FileContentIndex/33a61126-f118-4483-844d-3601f92c7a4c.vsidx differ diff --git a/.vs/SharpDevelop.Tests/FileContentIndex/64f85c44-d557-4577-bd8b-405e952be988.vsidx b/.vs/SharpDevelop.Tests/FileContentIndex/64f85c44-d557-4577-bd8b-405e952be988.vsidx new file mode 100644 index 00000000000..ef48dd21640 Binary files /dev/null and b/.vs/SharpDevelop.Tests/FileContentIndex/64f85c44-d557-4577-bd8b-405e952be988.vsidx differ diff --git a/.vs/SharpDevelop.Tests/FileContentIndex/90aa2269-ab39-4a12-9da1-6dc858e2cad0.vsidx b/.vs/SharpDevelop.Tests/FileContentIndex/90aa2269-ab39-4a12-9da1-6dc858e2cad0.vsidx new file mode 100644 index 00000000000..d2942dd0200 Binary files /dev/null and b/.vs/SharpDevelop.Tests/FileContentIndex/90aa2269-ab39-4a12-9da1-6dc858e2cad0.vsidx differ diff --git a/.vs/SharpDevelop.Tests/FileContentIndex/9629f5cd-7640-45eb-ba03-2b54b0e77a7b.vsidx b/.vs/SharpDevelop.Tests/FileContentIndex/9629f5cd-7640-45eb-ba03-2b54b0e77a7b.vsidx new file mode 100644 index 00000000000..b010369e75c Binary files /dev/null and b/.vs/SharpDevelop.Tests/FileContentIndex/9629f5cd-7640-45eb-ba03-2b54b0e77a7b.vsidx differ diff --git a/.vs/SharpDevelop.Tests/FileContentIndex/d2a40cae-fbc1-401b-9111-628b7e11dbb8.vsidx b/.vs/SharpDevelop.Tests/FileContentIndex/d2a40cae-fbc1-401b-9111-628b7e11dbb8.vsidx new file mode 100644 index 00000000000..f6d59b5b44e Binary files /dev/null and b/.vs/SharpDevelop.Tests/FileContentIndex/d2a40cae-fbc1-401b-9111-628b7e11dbb8.vsidx differ diff --git a/.vs/SharpDevelop.Tests/FileContentIndex/read.lock b/.vs/SharpDevelop.Tests/FileContentIndex/read.lock new file mode 100644 index 00000000000..e69de29bb2d diff --git a/.vs/SharpDevelop/DesignTimeBuild/.dtbcache.v2 b/.vs/SharpDevelop/DesignTimeBuild/.dtbcache.v2 new file mode 100644 index 00000000000..28e5fa86852 Binary files /dev/null and b/.vs/SharpDevelop/DesignTimeBuild/.dtbcache.v2 differ diff --git a/.vs/SharpDevelop/FileContentIndex/365a06b4-da3b-4426-a6fa-8683662baebc.vsidx b/.vs/SharpDevelop/FileContentIndex/365a06b4-da3b-4426-a6fa-8683662baebc.vsidx new file mode 100644 index 00000000000..7389ee8022f Binary files /dev/null and b/.vs/SharpDevelop/FileContentIndex/365a06b4-da3b-4426-a6fa-8683662baebc.vsidx differ diff --git a/.vs/SharpDevelop/FileContentIndex/3e48cae1-55cd-4307-b93c-c27231ca5964.vsidx b/.vs/SharpDevelop/FileContentIndex/3e48cae1-55cd-4307-b93c-c27231ca5964.vsidx new file mode 100644 index 00000000000..9afe4736f50 Binary files /dev/null and b/.vs/SharpDevelop/FileContentIndex/3e48cae1-55cd-4307-b93c-c27231ca5964.vsidx differ diff --git a/.vs/SharpDevelop/FileContentIndex/680eedf2-2751-4119-b2c8-2be396501867.vsidx b/.vs/SharpDevelop/FileContentIndex/680eedf2-2751-4119-b2c8-2be396501867.vsidx new file mode 100644 index 00000000000..2fc969cfff2 Binary files /dev/null and b/.vs/SharpDevelop/FileContentIndex/680eedf2-2751-4119-b2c8-2be396501867.vsidx differ diff --git a/.vs/SharpDevelop/FileContentIndex/9798b041-a326-4c6b-b0e1-4c4fad48a793.vsidx b/.vs/SharpDevelop/FileContentIndex/9798b041-a326-4c6b-b0e1-4c4fad48a793.vsidx new file mode 100644 index 00000000000..6568f0161d2 Binary files /dev/null and b/.vs/SharpDevelop/FileContentIndex/9798b041-a326-4c6b-b0e1-4c4fad48a793.vsidx differ diff --git a/.vs/SharpDevelop/v17/.futdcache.v2 b/.vs/SharpDevelop/v17/.futdcache.v2 new file mode 100644 index 00000000000..ec441633d63 Binary files /dev/null and b/.vs/SharpDevelop/v17/.futdcache.v2 differ diff --git a/.vs/SharpDevelop/v17/fileList.bin b/.vs/SharpDevelop/v17/fileList.bin new file mode 100644 index 00000000000..ccb91de75fc Binary files /dev/null and b/.vs/SharpDevelop/v17/fileList.bin differ diff --git a/README.md b/README.md index 954a6f3fb09..c214c93c945 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # #develop (short for SharpDevelop) +This is an attempt to modernize SharpDevelop. +Currently #develop doesn't support modern language features of C#, SDK style projects, or .NET Core. Which renders it almost useless in the real world. +The goal is to provide at least basic support for the above mentioned issues. Any help would be greatly appreciated. + ## Overview #develop is a free Integrated Development Environment diff --git a/SharpDevelop.sln b/SharpDevelop.sln index 1de7a8d728d..78369e9b083 100644 --- a/SharpDevelop.sln +++ b/SharpDevelop.sln @@ -1,8 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -# SharpDevelop 5.1 -VisualStudioVersion = 12.0.20827.3 +# Visual Studio Version 17 +VisualStudioVersion = 17.4.33205.214 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Main", "Main", "{256F5C28-532C-44C0-8AB8-D8EC5E492E01}" EndProject @@ -28,7 +27,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpDevelop.Bu EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Libraries", "Libraries", "{2A232EF1-EB95-41C6-B63A-C106E0C95D3C}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Cecil", "src\Libraries\cecil\Mono.Cecil.csproj", "{D68133BD-1E63-496E-9EDE-4FBDBF77B486}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mono.Cecil", "src\Libraries\cecil\Mono.Cecil.csproj", "{D68133BD-1E63-496E-9EDE-4FBDBF77B486}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NRefactory", "NRefactory", "{E5A0F4D8-37FD-4A30-BEB0-4409DC4E0865}" ProjectSection(SolutionItems) = preProject @@ -53,8 +52,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.Build.Tasks", " EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.TreeView", "src\Libraries\SharpTreeView\ICSharpCode.TreeView\ICSharpCode.TreeView.csproj", "{DDE2A481-8271-4EAC-A330-8FA6A38D13D1}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.Decompiler", "src\Libraries\ICSharpCode.Decompiler\ICSharpCode.Decompiler.csproj", "{984CC812-9470-4A13-AFF9-CC44068D666C}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AddIns", "AddIns", "{39327899-ED91-4F7F-988C-4FE4E17C014D}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Version Control", "Version Control", "{F208FF4F-E5D8-41D5-A7C7-B463976F156E}" @@ -153,11 +150,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.Data.SQLServer" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WpfDesign", "WpfDesign", "{D54BEB89-8CBE-475C-8BB9-836D2FD71260}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WpfDesign", "src\Libraries\WpfDesigner\WpfDesign\Project\WpfDesign.csproj", "{66A378A1-E9F4-4AD5-8946-D0EC06C2902F}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WpfDesign", "src\Libraries\WpfDesigner\WpfDesign\Project\WpfDesign.csproj", "{66A378A1-E9F4-4AD5-8946-D0EC06C2902F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WpfDesign.XamlDom", "src\Libraries\WpfDesigner\WpfDesign.XamlDom\Project\WpfDesign.XamlDom.csproj", "{88DA149F-21B2-48AB-82C4-28FB6BDFD783}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WpfDesign.XamlDom", "src\Libraries\WpfDesigner\WpfDesign.XamlDom\Project\WpfDesign.XamlDom.csproj", "{88DA149F-21B2-48AB-82C4-28FB6BDFD783}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WpfDesign.Designer", "src\Libraries\WpfDesigner\WpfDesign.Designer\Project\WpfDesign.Designer.csproj", "{78CC29AC-CC79-4355-B1F2-97936DF198AC}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WpfDesign.Designer", "src\Libraries\WpfDesigner\WpfDesign.Designer\Project\WpfDesign.Designer.csproj", "{78CC29AC-CC79-4355-B1F2-97936DF198AC}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WpfDesign.AddIn", "src\AddIns\DisplayBindings\WpfDesign\WpfDesign.AddIn\WpfDesign.AddIn.csproj", "{9A9D6FD4-6A2E-455D-ACC3-DDA775FE9865}" EndProject @@ -243,8 +240,8 @@ Global {7BA66A6B-1ED8-4B4C-970C-8928E891418B}.Debug|Any CPU.Build.0 = Debug|Any CPU {7BA66A6B-1ED8-4B4C-970C-8928E891418B}.Release|Any CPU.ActiveCfg = Release|Any CPU {7BA66A6B-1ED8-4B4C-970C-8928E891418B}.Release|Any CPU.Build.0 = Release|Any CPU - {D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Debug|Any CPU.ActiveCfg = net_4_0_Debug|Any CPU - {D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Debug|Any CPU.Build.0 = net_4_0_Debug|Any CPU + {D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Debug|Any CPU.Build.0 = Debug|Any CPU {D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Release|Any CPU.ActiveCfg = net_4_0_Release|Any CPU {D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Release|Any CPU.Build.0 = net_4_0_Release|Any CPU {3B2A5653-EC97-4001-BB9B-D90F1AF2C371}.Debug|Any CPU.ActiveCfg = net_4_5_Debug|Any CPU @@ -283,10 +280,6 @@ Global {DDE2A481-8271-4EAC-A330-8FA6A38D13D1}.Debug|Any CPU.Build.0 = Debug|Any CPU {DDE2A481-8271-4EAC-A330-8FA6A38D13D1}.Release|Any CPU.ActiveCfg = Release|Any CPU {DDE2A481-8271-4EAC-A330-8FA6A38D13D1}.Release|Any CPU.Build.0 = Release|Any CPU - {984CC812-9470-4A13-AFF9-CC44068D666C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {984CC812-9470-4A13-AFF9-CC44068D666C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {984CC812-9470-4A13-AFF9-CC44068D666C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {984CC812-9470-4A13-AFF9-CC44068D666C}.Release|Any CPU.Build.0 = Release|Any CPU {83F15BA7-8478-4664-81BB-A82F146D88B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {83F15BA7-8478-4664-81BB-A82F146D88B3}.Debug|Any CPU.Build.0 = Debug|Any CPU {83F15BA7-8478-4664-81BB-A82F146D88B3}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -545,7 +538,6 @@ Global {6C55B776-26D4-4DB3-A6AB-87E783B2F3D1} = {2A232EF1-EB95-41C6-B63A-C106E0C95D3C} {4139CCF6-FB49-4A9D-B2CF-331E9EA3198D} = {2A232EF1-EB95-41C6-B63A-C106E0C95D3C} {DDE2A481-8271-4EAC-A330-8FA6A38D13D1} = {2A232EF1-EB95-41C6-B63A-C106E0C95D3C} - {984CC812-9470-4A13-AFF9-CC44068D666C} = {2A232EF1-EB95-41C6-B63A-C106E0C95D3C} {F208FF4F-E5D8-41D5-A7C7-B463976F156E} = {39327899-ED91-4F7F-988C-4FE4E17C014D} {83F15BA7-8478-4664-81BB-A82F146D88B3} = {F208FF4F-E5D8-41D5-A7C7-B463976F156E} {17F4D7E0-6933-4C2E-8714-FD7E98D625D5} = {F208FF4F-E5D8-41D5-A7C7-B463976F156E} @@ -559,7 +551,7 @@ Global {7048AE18-EB93-4A84-82D0-DD60EB58ADBD} = {E0646C25-36F2-4524-969F-FA621353AB94} {6D209CBB-D8C1-478A-BC30-D3FC87B7858F} = {E0646C25-36F2-4524-969F-FA621353AB94} {94BBCA55-A20E-4782-93B0-3566D185F7C1} = {E0646C25-36F2-4524-969F-FA621353AB94} - {F3662720-9EA2-4591-BBC6-97361DCE50A9} = {39327899-ED91-4F7F-988C-4FE4E17C014D} + {F3662720-9EA2-4591-BBC6-97361DCE50A9} = {E0646C25-36F2-4524-969F-FA621353AB94} {9196DD8A-B4D4-4780-8742-C5762E547FC2} = {F3662720-9EA2-4591-BBC6-97361DCE50A9} {7D5C266F-D6FF-4D14-B315-0C0FC6C4EF51} = {F3662720-9EA2-4591-BBC6-97361DCE50A9} {4B8F0F98-8BE1-402B-AA8B-C8D548577B38} = {F3662720-9EA2-4591-BBC6-97361DCE50A9} @@ -616,4 +608,7 @@ Global {1D18D788-F7EE-4585-A23B-34DC8EC63CB8} = {49CE38B8-0460-46BF-9DFF-5B33A0F9EB5E} {EC06F96A-AEEC-49D6-B03D-AB87C6EB674C} = {49CE38B8-0460-46BF-9DFF-5B33A0F9EB5E} EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {F79036FD-25A6-4FF9-81C6-3330C43E3E21} + EndGlobalSection EndGlobal diff --git a/src/AddIns/Analysis/CodeAnalysis/CodeAnalysis.csproj b/src/AddIns/Analysis/CodeAnalysis/CodeAnalysis.csproj index 899865c3a3e..86ea97836cd 100644 --- a/src/AddIns/Analysis/CodeAnalysis/CodeAnalysis.csproj +++ b/src/AddIns/Analysis/CodeAnalysis/CodeAnalysis.csproj @@ -1,5 +1,5 @@  - + Library ICSharpCode.CodeAnalysis @@ -17,7 +17,7 @@ 4096 4 false - v4.5 + v4.8 diff --git a/src/AddIns/Analysis/CodeAnalysis/Src/AnalysisIdeOptionsPanel.xaml.cs b/src/AddIns/Analysis/CodeAnalysis/Src/AnalysisIdeOptionsPanel.xaml.cs index 107ff541266..4c31207dc87 100644 --- a/src/AddIns/Analysis/CodeAnalysis/Src/AnalysisIdeOptionsPanel.xaml.cs +++ b/src/AddIns/Analysis/CodeAnalysis/Src/AnalysisIdeOptionsPanel.xaml.cs @@ -38,8 +38,7 @@ private void ShowStatus() if (path == null) { status.Text = StringParser.Parse("${res:ICSharpCode.CodeAnalysis.IdeOptions.FxCopNotFound}"); } else { - status.Text = StringParser.Parse("${res:ICSharpCode.CodeAnalysis.IdeOptions.FxCopFoundInPath}") - + Environment.NewLine + path; + status.Text = $"{StringParser.Parse("${res:ICSharpCode.CodeAnalysis.IdeOptions.FxCopFoundInPath}")}{Environment.NewLine}{path}"; } } diff --git a/src/AddIns/Analysis/CodeAnalysis/Src/AnalysisProjectOptionsTreeNodes.cs b/src/AddIns/Analysis/CodeAnalysis/Src/AnalysisProjectOptionsTreeNodes.cs index a70038b5b22..f253c13fe10 100644 --- a/src/AddIns/Analysis/CodeAnalysis/Src/AnalysisProjectOptionsTreeNodes.cs +++ b/src/AddIns/Analysis/CodeAnalysis/Src/AnalysisProjectOptionsTreeNodes.cs @@ -210,13 +210,13 @@ public override bool IsCheckable { public override object Text { - get { return rule.CheckId + " : " + rule.DisplayName; } + get { return $"{rule.CheckId} : {rule.DisplayName}"; } } public string Identifier { get { - return rule.CategoryName + "#" + rule.CheckId; + return $"{rule.CategoryName}#{rule.CheckId}"; } } diff --git a/src/AddIns/Analysis/CodeAnalysis/Src/FxCopLogger.cs b/src/AddIns/Analysis/CodeAnalysis/Src/FxCopLogger.cs index 90165050e0f..7970bafc939 100644 --- a/src/AddIns/Analysis/CodeAnalysis/Src/FxCopLogger.cs +++ b/src/AddIns/Analysis/CodeAnalysis/Src/FxCopLogger.cs @@ -35,7 +35,7 @@ public class FxCopLogger : IMSBuildLoggerFilter { public IMSBuildChainedLoggerFilter CreateFilter(IMSBuildLoggerContext context, IMSBuildChainedLoggerFilter nextFilter) { - context.OutputTextLine(StringParser.Parse("${res:ICSharpCode.CodeAnalysis.RunningFxCopOn} " + context.ProjectFileName.GetFileNameWithoutExtension())); + context.OutputTextLine(StringParser.Parse($"${{res:ICSharpCode.CodeAnalysis.RunningFxCopOn}} {context.ProjectFileName.GetFileNameWithoutExtension()}")); return new FxCopLoggerImpl(context, nextFilter); } @@ -52,7 +52,7 @@ public FxCopLoggerImpl(IMSBuildLoggerContext context, IMSBuildChainedLoggerFilte public void HandleError(BuildError error) { - LoggingService.Debug("FxCopLogger got " + error.ToString()); + LoggingService.Debug($"FxCopLogger got {error}"); string[] moreData = (error.Subcategory ?? "").Split('|'); string checkId = error.ErrorCode; diff --git a/src/AddIns/Analysis/CodeAnalysis/Src/FxCopRule.cs b/src/AddIns/Analysis/CodeAnalysis/Src/FxCopRule.cs index 4c70db03603..fb49d98cca3 100644 --- a/src/AddIns/Analysis/CodeAnalysis/Src/FxCopRule.cs +++ b/src/AddIns/Analysis/CodeAnalysis/Src/FxCopRule.cs @@ -71,7 +71,7 @@ public string Url { public override string ToString() { - return string.Format("[FxCopRule {0}#{1}]", this.categoryName, this.checkId); + return $"[FxCopRule {categoryName}#{checkId}]"; } public int CompareTo(object obj) @@ -116,7 +116,7 @@ public List Rules { public override string ToString() { - return string.Format("[FxCopCategory {0}]", this.name); + return $"[FxCopCategory {name}]"; } } } diff --git a/src/AddIns/Analysis/CodeAnalysis/Src/SuppressMessageCommand.cs b/src/AddIns/Analysis/CodeAnalysis/Src/SuppressMessageCommand.cs index 3a64d7b2622..2cbf7f13893 100644 --- a/src/AddIns/Analysis/CodeAnalysis/Src/SuppressMessageCommand.cs +++ b/src/AddIns/Analysis/CodeAnalysis/Src/SuppressMessageCommand.cs @@ -78,7 +78,7 @@ static IEntity GetEntity(ICompilation compilation, string className, string memb static IMember GetMember(ITypeDefinition type, string memberName) { - string fullName = type.ReflectionName + "." + memberName; + string fullName = $"{type.ReflectionName}.{memberName}"; return type.GetMembers(m => m.ReflectionName == fullName).FirstOrDefault(); } diff --git a/src/AddIns/Analysis/CodeCoverage/Project/CodeCoverage.csproj b/src/AddIns/Analysis/CodeCoverage/Project/CodeCoverage.csproj index 0e933ac44c4..a3ab972d901 100644 --- a/src/AddIns/Analysis/CodeCoverage/Project/CodeCoverage.csproj +++ b/src/AddIns/Analysis/CodeCoverage/Project/CodeCoverage.csproj @@ -1,5 +1,5 @@  - + Library ICSharpCode.CodeCoverage @@ -16,7 +16,7 @@ 4096 4 False - v4.5 + v4.8 False @@ -114,7 +114,9 @@ - + + Component + diff --git a/src/AddIns/Analysis/CodeCoverage/Project/Src/CodeCoverageControl.cs b/src/AddIns/Analysis/CodeCoverage/Project/Src/CodeCoverageControl.cs index f851e064d7e..04dd91fe1f6 100644 --- a/src/AddIns/Analysis/CodeCoverage/Project/Src/CodeCoverageControl.cs +++ b/src/AddIns/Analysis/CodeCoverage/Project/Src/CodeCoverageControl.cs @@ -197,7 +197,7 @@ void UpdateDisplay() } } - // Add toolstrip - need to re-add it last otherwise the + // Add tool strip - need to re-add it last otherwise the // other controls will be displayed underneath it. if (toolStrip == null) { toolStrip = ToolbarService.CreateToolStrip(this, "/SharpDevelop/Pads/CodeCoveragePad/Toolbar"); @@ -350,7 +350,7 @@ void OpenFile(string fileName, int line, int column) bool TryLoadFileIntoTextEditor(string fileName) { if (!File.Exists(fileName)) { - textEditor.Text = String.Format("File does not exist '{0}'.", fileName); + textEditor.Text = $"File does not exist '{fileName}'."; return false; } @@ -588,7 +588,7 @@ void TextEditorDoubleClick(object sender, EventArgs e) } /// - /// If the treeview is to be moved to a different parent then + /// If the tree view is to be moved to a different parent then /// it needs to be recreated otherwise the OnBeforeExpand method /// is never called. /// diff --git a/src/AddIns/Analysis/CodeCoverage/Project/Src/CodeCoverageDisplayItem.cs b/src/AddIns/Analysis/CodeCoverage/Project/Src/CodeCoverageDisplayItem.cs index 628acab5e27..7c6dbd033e6 100644 --- a/src/AddIns/Analysis/CodeCoverage/Project/Src/CodeCoverageDisplayItem.cs +++ b/src/AddIns/Analysis/CodeCoverage/Project/Src/CodeCoverageDisplayItem.cs @@ -22,7 +22,7 @@ namespace ICSharpCode.CodeCoverage { /// - /// Represents a code coverage display item that can have its colour customised + /// Represents a code coverage display item that can have its colour customized /// (e.g. Visited code and Not visited code. /// public class CodeCoverageDisplayItem @@ -44,7 +44,7 @@ public CodeCoverageDisplayItem(string item, string itemBackColorPropertyName, Co } /// - /// Gets whether any of the colours has changed from their origina values. + /// Gets whether any of the colours have changed from their original values. /// public bool HasChanged { get { diff --git a/src/AddIns/Analysis/CodeCoverage/Project/Src/CodeCoverageMethod.cs b/src/AddIns/Analysis/CodeCoverage/Project/Src/CodeCoverageMethod.cs index f8f83a2e602..39aa5cac0fb 100644 --- a/src/AddIns/Analysis/CodeCoverage/Project/Src/CodeCoverageMethod.cs +++ b/src/AddIns/Analysis/CodeCoverage/Project/Src/CodeCoverageMethod.cs @@ -202,7 +202,7 @@ public static List GetChildNamespaces(List methods, var items = new List(); foreach (CodeCoverageMethod method in methods) { string classNamespace = method.ClassNamespace; - string dottedParentNamespace = parentNamespace + "."; + string dottedParentNamespace = $"{parentNamespace}."; if (classNamespace.Length > parentNamespace.Length && classNamespace.StartsWith(dottedParentNamespace)) { string ns = CodeCoverageMethod.GetChildNamespace(method.ClassNamespace, parentNamespace); if (!items.Contains(ns)) { @@ -221,7 +221,7 @@ public static List GetAllMethods(List me var matchedMethods = new List(); namespaceStartsWith += "."; foreach (CodeCoverageMethod method in methods) { - if ((method.ClassNamespace + ".").StartsWith(namespaceStartsWith, StringComparison.Ordinal)) { + if (($"{method.ClassNamespace}.").StartsWith(namespaceStartsWith, StringComparison.Ordinal)) { matchedMethods.Add(method); } } diff --git a/src/AddIns/Analysis/CodeCoverage/Project/Src/CodeCoverageProjectOptionsPanel.xaml.cs b/src/AddIns/Analysis/CodeCoverage/Project/Src/CodeCoverageProjectOptionsPanel.xaml.cs index a4843996b4d..cdc61356377 100644 --- a/src/AddIns/Analysis/CodeCoverage/Project/Src/CodeCoverageProjectOptionsPanel.xaml.cs +++ b/src/AddIns/Analysis/CodeCoverage/Project/Src/CodeCoverageProjectOptionsPanel.xaml.cs @@ -86,7 +86,7 @@ private static string ConvertToMultLineString(StringCollection items) StringBuilder text = new StringBuilder(); foreach (String item in items) { text.Append(item); - text.Append("\r\n"); + text.Append(Environment.NewLine); } return text.ToString().Trim(); } diff --git a/src/AddIns/Analysis/CodeCoverage/Project/Src/CodeCoverageSequencePoint.cs b/src/AddIns/Analysis/CodeCoverage/Project/Src/CodeCoverageSequencePoint.cs index d99ad0433d0..fea975fbabe 100644 --- a/src/AddIns/Analysis/CodeCoverage/Project/Src/CodeCoverageSequencePoint.cs +++ b/src/AddIns/Analysis/CodeCoverage/Project/Src/CodeCoverageSequencePoint.cs @@ -116,8 +116,7 @@ public override int GetHashCode() public override string ToString() { - return String.Format("Document: '{0}' VisitCount: {1} Line: {2} Col: {3} EndLine: {4} EndCol: {5} Length: {6}", - Document, VisitCount, Line, Column, EndLine, EndColumn, Length); + return $"Document: '{Document}' VisitCount: {VisitCount} Line: {Line} Col: {Column} EndLine: {EndLine} EndCol: {EndColumn} Length: {Length}"; } } } diff --git a/src/AddIns/Analysis/CodeCoverage/Project/Src/CodeCoverageTreeNode.cs b/src/AddIns/Analysis/CodeCoverage/Project/Src/CodeCoverageTreeNode.cs index 52906042201..3ee8f91e558 100644 --- a/src/AddIns/Analysis/CodeCoverage/Project/Src/CodeCoverageTreeNode.cs +++ b/src/AddIns/Analysis/CodeCoverage/Project/Src/CodeCoverageTreeNode.cs @@ -103,10 +103,10 @@ string GetNodeText() { if (TotalCodeLength > 0) { if ( visitedCodeLength == TotalCodeLength && visitedBranchCoverage != 0 && visitedBranchCoverage != 100 ) { - return String.Format("{0} (100%/{1}%)", Name, decimal.Round (visitedBranchCoverage, 2)); + return $"{Name} (100%/{(decimal.Round(visitedBranchCoverage, 2))}%)"; } int percentage = GetPercentage(); - return String.Format("{0} ({1}%)", Name, percentage); + return $"{Name} ({percentage}%)"; } return Name; } diff --git a/src/AddIns/Analysis/CodeCoverage/Project/Src/OpenCoverApplication.cs b/src/AddIns/Analysis/CodeCoverage/Project/Src/OpenCoverApplication.cs index 805ac8e593f..521e34313e2 100644 --- a/src/AddIns/Analysis/CodeCoverage/Project/Src/OpenCoverApplication.cs +++ b/src/AddIns/Analysis/CodeCoverage/Project/Src/OpenCoverApplication.cs @@ -116,23 +116,23 @@ string GetArguments() void AppendTarget() { - arguments.AppendFormat("-target:\"{0}\" ", Target); + arguments.Append($"-target:\"{Target}\" "); } void AppendTargetWorkingDirectory() { - arguments.AppendFormat("-targetdir:\"{0}\" ", GetTargetWorkingDirectory()); + arguments.Append($"-targetdir:\"{GetTargetWorkingDirectory()}\" "); } void AppendTargetArguments() { string targetArguments = GetTargetArguments(); - arguments.AppendFormat("-targetargs:\"{0}\" ", targetArguments.Replace("\"", "\\\"")); + arguments.Append($"-targetargs:\"{(targetArguments.Replace("\"", "\\\""))}\" "); } void AppendCodeCoverageResultsFileName() { - arguments.AppendFormat("-output:\"{0}\" ", CodeCoverageResultsFileName); + arguments.Append($"-output:\"{CodeCoverageResultsFileName}\" "); } void AppendFilter() @@ -173,7 +173,7 @@ string GetItemArguments(string optionName, StringCollection items) { StringBuilder itemArgs = new StringBuilder(); foreach (string item in items) { - itemArgs.AppendFormat("{0}{1} ", optionName, item); + itemArgs.Append($"{optionName}{item} "); } return itemArgs.ToString().Trim(); } diff --git a/src/AddIns/Analysis/CodeCoverage/Project/Src/OpenCoverSettings.cs b/src/AddIns/Analysis/CodeCoverage/Project/Src/OpenCoverSettings.cs index d63926fe418..13dd42c1f19 100644 --- a/src/AddIns/Analysis/CodeCoverage/Project/Src/OpenCoverSettings.cs +++ b/src/AddIns/Analysis/CodeCoverage/Project/Src/OpenCoverSettings.cs @@ -135,7 +135,7 @@ void ReadSettings(XmlReader reader) void WriteRuleElements(XmlWriter writer, string prefix, StringCollection rules) { foreach (string rule in rules) { - writer.WriteElementString(RuleElementName, prefix + rule); + writer.WriteElementString(RuleElementName, $"{prefix}{rule}"); } } diff --git a/src/AddIns/Analysis/CodeCoverage/Project/Src/RunTestWithCodeCoverageCommand.cs b/src/AddIns/Analysis/CodeCoverage/Project/Src/RunTestWithCodeCoverageCommand.cs index aafd3f7464b..aa21749fe10 100644 --- a/src/AddIns/Analysis/CodeCoverage/Project/Src/RunTestWithCodeCoverageCommand.cs +++ b/src/AddIns/Analysis/CodeCoverage/Project/Src/RunTestWithCodeCoverageCommand.cs @@ -152,7 +152,7 @@ SDTask CreateNoCodeCoverageResultsGeneratedTask(string fileName) string GetNoCodeCoverageResultsGeneratedTaskDescription(string fileName) { string message = StringParser.Parse("${res:ICSharpCode.CodeCoverage.NoCodeCoverageResultsGenerated}"); - return String.Format("{0} {1}", message, fileName); + return $"{message} {fileName}"; } } } diff --git a/src/AddIns/Analysis/CodeCoverage/Test/CodeCoverage.Tests.csproj b/src/AddIns/Analysis/CodeCoverage/Test/CodeCoverage.Tests.csproj index 2fbc6e78c17..6ccfd618deb 100644 --- a/src/AddIns/Analysis/CodeCoverage/Test/CodeCoverage.Tests.csproj +++ b/src/AddIns/Analysis/CodeCoverage/Test/CodeCoverage.Tests.csproj @@ -1,5 +1,5 @@  - + Library ICSharpCode.CodeCoverage.Tests @@ -16,7 +16,7 @@ 4096 4 false - v4.5 + v4.8 diff --git a/src/AddIns/Analysis/CodeQuality/CodeQuality.csproj b/src/AddIns/Analysis/CodeQuality/CodeQuality.csproj index 2d9b18d0104..3736dc6f985 100644 --- a/src/AddIns/Analysis/CodeQuality/CodeQuality.csproj +++ b/src/AddIns/Analysis/CodeQuality/CodeQuality.csproj @@ -1,5 +1,5 @@  - + {3C532D80-32B4-40E5-B5FE-BC6BAE1A00E7} Debug @@ -7,7 +7,7 @@ Library ICSharpCode.CodeQuality ICSharpCode.CodeQuality - v4.5 + v4.8 Properties ..\..\..\..\AddIns\Analysis\CodeQuality\ False @@ -113,15 +113,7 @@ - - - - - - - - - + diff --git a/src/AddIns/Analysis/MachineSpecifications/MachineSpecifications.Tests/MachineSpecifications.Tests.csproj b/src/AddIns/Analysis/MachineSpecifications/MachineSpecifications.Tests/MachineSpecifications.Tests.csproj index 02e83501c9f..4b3c12ea8dd 100644 --- a/src/AddIns/Analysis/MachineSpecifications/MachineSpecifications.Tests/MachineSpecifications.Tests.csproj +++ b/src/AddIns/Analysis/MachineSpecifications/MachineSpecifications.Tests/MachineSpecifications.Tests.csproj @@ -1,5 +1,5 @@  - + {172AE35D-2051-4977-AC13-0BF1B76374D5} Debug @@ -7,7 +7,7 @@ Library ICSharpCode.MachineSpecifications.Tests MachineSpecifications.Tests - v4.5 + v4.8 Properties diff --git a/src/AddIns/Analysis/MachineSpecifications/MachineSpecifications/MachineSpecifications.csproj b/src/AddIns/Analysis/MachineSpecifications/MachineSpecifications/MachineSpecifications.csproj index 352f98e36ae..3a246119f5a 100644 --- a/src/AddIns/Analysis/MachineSpecifications/MachineSpecifications/MachineSpecifications.csproj +++ b/src/AddIns/Analysis/MachineSpecifications/MachineSpecifications/MachineSpecifications.csproj @@ -1,5 +1,5 @@  - + Library ICSharpCode.MachineSpecifications @@ -19,7 +19,7 @@ Auto 4194304 4096 - v4.5 + v4.8 False @@ -137,8 +137,6 @@ False - - - + \ No newline at end of file diff --git a/src/AddIns/Analysis/Profiler/Controller/Profiler.Controller.csproj b/src/AddIns/Analysis/Profiler/Controller/Profiler.Controller.csproj index ab9dbf6b097..57716be6658 100644 --- a/src/AddIns/Analysis/Profiler/Controller/Profiler.Controller.csproj +++ b/src/AddIns/Analysis/Profiler/Controller/Profiler.Controller.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -10,7 +10,7 @@ Properties ICSharpCode.Profiler.Controller ICSharpCode.Profiler.Controller - v4.5 + v4.8 512 True False @@ -168,9 +168,7 @@ true - - - + {fe88fe17-d9fb-4fcc-9a35-6bffb6b26cc6} diff --git a/src/AddIns/Analysis/Profiler/Frontend/AddIn/Profiler.AddIn.csproj b/src/AddIns/Analysis/Profiler/Frontend/AddIn/Profiler.AddIn.csproj index 1ecf707da1d..61815194b10 100644 --- a/src/AddIns/Analysis/Profiler/Frontend/AddIn/Profiler.AddIn.csproj +++ b/src/AddIns/Analysis/Profiler/Frontend/AddIn/Profiler.AddIn.csproj @@ -1,5 +1,5 @@  - + {D294A12D-4B38-4F25-9AA6-3D4A6CE26E7B} Debug @@ -7,7 +7,7 @@ Library ICSharpCode.Profiler.AddIn ICSharpCode.Profiler.AddIn - v4.5 + v4.8 False False 4 diff --git a/src/AddIns/Analysis/Profiler/Frontend/Controls/Profiler.Controls.csproj b/src/AddIns/Analysis/Profiler/Frontend/Controls/Profiler.Controls.csproj index 7fc301caf78..64a305ad1f9 100644 --- a/src/AddIns/Analysis/Profiler/Frontend/Controls/Profiler.Controls.csproj +++ b/src/AddIns/Analysis/Profiler/Frontend/Controls/Profiler.Controls.csproj @@ -1,5 +1,5 @@  - + {BDA49550-5ED1-4C6B-B648-657B2CACD8E0} Debug @@ -7,7 +7,7 @@ Library ICSharpCode.Profiler.Controls ICSharpCode.Profiler.Controls - v4.5 + v4.8 Properties C:\Dokumente und Einstellungen\HP\Anwendungsdaten\ICSharpCode/SharpDevelop3.0\Settings.SourceAnalysis False diff --git a/src/AddIns/Analysis/Profiler/Tests/Profiler.Tests/Profiler.Tests.csproj b/src/AddIns/Analysis/Profiler/Tests/Profiler.Tests/Profiler.Tests.csproj index 0326f95944a..0bd22a9d39d 100644 --- a/src/AddIns/Analysis/Profiler/Tests/Profiler.Tests/Profiler.Tests.csproj +++ b/src/AddIns/Analysis/Profiler/Tests/Profiler.Tests/Profiler.Tests.csproj @@ -1,5 +1,5 @@  - + {068F9531-5D29-49E0-980E-59982A3A0469} Debug @@ -7,7 +7,7 @@ Library Profiler.Tests Profiler.Tests - v4.5 + v4.8 Properties C:\Users\Siegfried\AppData\Roaming\ICSharpCode/SharpDevelop3.0\Settings.SourceAnalysis False diff --git a/src/AddIns/Analysis/Profiler/X64Converter/Profiler.X64Converter.csproj b/src/AddIns/Analysis/Profiler/X64Converter/Profiler.X64Converter.csproj index 9ef3d87ab1d..fef843c0f2b 100644 --- a/src/AddIns/Analysis/Profiler/X64Converter/Profiler.X64Converter.csproj +++ b/src/AddIns/Analysis/Profiler/X64Converter/Profiler.X64Converter.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -10,7 +10,7 @@ Properties X64Converter Profiler.X64Converter - v4.5 + v4.8 512 C:\Users\Siegfried\AppData\Roaming\ICSharpCode/SharpDevelop3.0\Settings.SourceAnalysis False diff --git a/src/AddIns/Analysis/Profiler/X64Converter/app.config b/src/AddIns/Analysis/Profiler/X64Converter/app.config index 9008dd2558b..04fcaeb04e4 100644 --- a/src/AddIns/Analysis/Profiler/X64Converter/app.config +++ b/src/AddIns/Analysis/Profiler/X64Converter/app.config @@ -1,6 +1,6 @@ - + - + - \ No newline at end of file + diff --git a/src/AddIns/Analysis/SourceAnalysis/SourceAnalysis.csproj b/src/AddIns/Analysis/SourceAnalysis/SourceAnalysis.csproj index d0b10ce5d31..6f3675a6d7d 100644 --- a/src/AddIns/Analysis/SourceAnalysis/SourceAnalysis.csproj +++ b/src/AddIns/Analysis/SourceAnalysis/SourceAnalysis.csproj @@ -1,5 +1,5 @@  - + Library ICSharpCode.SourceAnalysis @@ -17,7 +17,7 @@ 4096 4 False - v4.5 + v4.8 False False diff --git a/src/AddIns/Analysis/UnitTesting/Test/UnitTesting.Tests.csproj b/src/AddIns/Analysis/UnitTesting/Test/UnitTesting.Tests.csproj index bc766505b49..678b2051d86 100644 --- a/src/AddIns/Analysis/UnitTesting/Test/UnitTesting.Tests.csproj +++ b/src/AddIns/Analysis/UnitTesting/Test/UnitTesting.Tests.csproj @@ -1,5 +1,5 @@  - + Library UnitTesting.Tests @@ -16,7 +16,7 @@ 4096 4 false - v4.5 + v4.8 @@ -137,13 +137,6 @@ ICSharpCode.SharpDevelop - - - - - - - - + \ No newline at end of file diff --git a/src/AddIns/Analysis/UnitTesting/UnitTesting.csproj b/src/AddIns/Analysis/UnitTesting/UnitTesting.csproj index f0fc6bba0f6..b7417bf1a03 100644 --- a/src/AddIns/Analysis/UnitTesting/UnitTesting.csproj +++ b/src/AddIns/Analysis/UnitTesting/UnitTesting.csproj @@ -1,5 +1,5 @@  - + Library ICSharpCode.UnitTesting @@ -17,7 +17,7 @@ 4096 4 false - v4.5 + v4.8 @@ -155,16 +155,7 @@ False - - - - - - - - - - + diff --git a/src/AddIns/BackendBindings/AspNet.Mvc/Project/AspNet.Mvc.csproj b/src/AddIns/BackendBindings/AspNet.Mvc/Project/AspNet.Mvc.csproj index 95273c0e26a..549b7632bf1 100644 --- a/src/AddIns/BackendBindings/AspNet.Mvc/Project/AspNet.Mvc.csproj +++ b/src/AddIns/BackendBindings/AspNet.Mvc/Project/AspNet.Mvc.csproj @@ -1,5 +1,5 @@  - + {D781721F-C2A7-4E95-B76F-247170AC3B13} Debug @@ -7,7 +7,7 @@ Library ICSharpCode.AspNet.Mvc AspNet.Mvc - v4.5 + v4.8 Properties ..\..\..\..\..\AddIns\BackendBindings\AspNet.Mvc\ @@ -73,37 +73,47 @@ Create.tt True + True Delete.tt True + True Details.tt True + True Edit.tt True + True Empty.tt + True + True List.tt True + True Create.tt True + True Delete.tt True + True Details.tt True + True Details.tt @@ -112,13 +122,17 @@ Edit.tt True + True Empty.tt + True + True List.tt True + True @@ -239,7 +253,9 @@ - + + Component + @@ -256,23 +272,7 @@ - - - - - - - - - - - - - - - - - + diff --git a/src/AddIns/BackendBindings/AspNet.Mvc/Project/ItemTemplates/CSharp/CodeTemplates/AddView/AspxCSharp/Create.cs b/src/AddIns/BackendBindings/AspNet.Mvc/Project/ItemTemplates/CSharp/CodeTemplates/AddView/AspxCSharp/Create.cs index 52987a70a07..26c6eda3b39 100644 --- a/src/AddIns/BackendBindings/AspNet.Mvc/Project/ItemTemplates/CSharp/CodeTemplates/AddView/AspxCSharp/Create.cs +++ b/src/AddIns/BackendBindings/AspNet.Mvc/Project/ItemTemplates/CSharp/CodeTemplates/AddView/AspxCSharp/Create.cs @@ -1,186 +1,85 @@ -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.239 -// +// Runtime Version: 17.0.0.0 +// // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // -//------------------------------------------------------------------------------ - -namespace ICSharpCode.AspNet.Mvc.AspxCSharp { +// ------------------------------------------------------------------------------ +namespace ICSharpCode.AspNet.Mvc.AspxCSharp +{ using ICSharpCode.AspNet.Mvc; using System.Collections.Generic; using System.Reflection; using System; + /// + /// Class to produce the template output + /// - public partial class Create : CreateBase { - - private global::Microsoft.VisualStudio.TextTemplating.ITextTemplatingEngineHost hostValue; - - - #line 75 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Create.tt" - - MvcTextTemplateHost MvcHost { - get { return (MvcTextTemplateHost)Host; } - } - - public class ModelProperty - { - public string Name { get; set; } - public bool IsPrimaryKey { get; set; } - - public ModelProperty(PropertyInfo propertyInfo) - { - this.Name = propertyInfo.Name; - this.IsPrimaryKey = IsPrimaryKeyProperty(propertyInfo); - } - - bool IsPrimaryKeyProperty(PropertyInfo propertyInfo) - { - return - IsIdProperty(propertyInfo) || - IsIdPropertyPrefixedWithClassName(propertyInfo); - } - - bool IsIdProperty(PropertyInfo propertyInfo) - { - return IsMatchIgnoringCase(propertyInfo.Name, "id"); - } - - bool IsIdPropertyPrefixedWithClassName(PropertyInfo propertyInfo) - { - string prefixedIdPropertyName = propertyInfo.DeclaringType.Name + "id"; - return IsMatchIgnoringCase(propertyInfo.Name, prefixedIdPropertyName); - } - - static bool IsMatchIgnoringCase(string a, string b) - { - return String.Equals(a, b, StringComparison.OrdinalIgnoreCase); - } - } - - public string GetViewPageType() - { - string viewDataTypeName = MvcHost.ViewDataTypeName; - if (!String.IsNullOrEmpty(viewDataTypeName)) { - return String.Format("<{0}>", viewDataTypeName); - } - return String.Empty; - } - - public IEnumerable GetModelProperties() - { - var properties = new List(); - foreach (PropertyInfo propertyInfo in MvcHost.GetViewDataTypeProperties()) { - properties.Add(new ModelProperty(propertyInfo)); - } - return properties; - } - - #line default - #line hidden - - - public global::Microsoft.VisualStudio.TextTemplating.ITextTemplatingEngineHost Host { - get { - return this.hostValue; - } - set { - this.hostValue = value; - } - } - - public virtual string TransformText() { - this.GenerationEnvironment = null; - - #line 5 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Create.tt" + #line 1 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Create.tt" + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")] + public partial class Create : CreateBase + { +#line hidden + /// + /// Create the template output + /// + public virtual string TransformText() + { + + #line 5 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Create.tt" if (MvcHost.IsPartialView) { #line default #line hidden - - #line 6 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Create.tt" this.Write("<%@ Control Language=\"C#\" Inherits=\"System.Web.Mvc.ViewUserControl"); - #line default - #line hidden - - #line 6 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Create.tt" - this.Write(this.ToStringHelper.ToStringWithCulture( GetViewPageType() )); + #line 6 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Create.tt" + this.Write(this.ToStringHelper.ToStringWithCulture(GetViewPageType())); #line default #line hidden - - #line 6 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Create.tt" this.Write("\" %>\r\n\r\n"); - #line default - #line hidden - - #line 8 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Create.tt" + #line 8 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Create.tt" } else if (MvcHost.IsContentPage) { #line default #line hidden - - #line 9 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Create.tt" this.Write("<%@ Page Language=\"C#\" MasterPageFile=\""); - #line default - #line hidden - - #line 9 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Create.tt" - this.Write(this.ToStringHelper.ToStringWithCulture( MvcHost.MasterPageFile )); + #line 9 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Create.tt" + this.Write(this.ToStringHelper.ToStringWithCulture(MvcHost.MasterPageFile)); #line default #line hidden - - #line 9 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Create.tt" this.Write("\" Inherits=\"System.Web.Mvc.ViewPage"); - #line default - #line hidden - - #line 9 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Create.tt" - this.Write(this.ToStringHelper.ToStringWithCulture( GetViewPageType() )); + #line 9 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Create.tt" + this.Write(this.ToStringHelper.ToStringWithCulture(GetViewPageType())); #line default #line hidden - - #line 9 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Create.tt" this.Write("\" %>\r\n\r\n\r\n" + ""); - #line default - #line hidden - - #line 12 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Create.tt" - this.Write(this.ToStringHelper.ToStringWithCulture( MvcHost.ViewName )); + #line 12 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Create.tt" + this.Write(this.ToStringHelper.ToStringWithCulture(MvcHost.ViewName)); #line default #line hidden - - #line 12 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Create.tt" this.Write("\r\n\r\n\r\n\r\n"); - #line default - #line hidden - - #line 68 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Create.tt" + #line 68 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Create.tt" } else { PopIndent(); @@ -340,225 +184,367 @@ public virtual string TransformText() { #line default #line hidden - - #line 72 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Create.tt" this.Write("\t\r\n\r\n"); - #line default - #line hidden - - #line 74 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Create.tt" + #line 74 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Create.tt" } #line default #line hidden return this.GenerationEnvironment.ToString(); } - - protected virtual void Initialize() { - } - } - - public class CreateBase { - - private global::System.Text.StringBuilder builder; - - private global::System.Collections.Generic.IDictionary session; - - private global::System.CodeDom.Compiler.CompilerErrorCollection errors; - - private string currentIndent = string.Empty; - - private global::System.Collections.Generic.Stack indents; - - private bool endsWithNewline; - - private ToStringInstanceHelper _toStringHelper = new ToStringInstanceHelper(); - - public virtual global::System.Collections.Generic.IDictionary Session { - get { - return this.session; + private global::Microsoft.VisualStudio.TextTemplating.ITextTemplatingEngineHost hostValue; + /// + /// The current host for the text templating engine + /// + public virtual global::Microsoft.VisualStudio.TextTemplating.ITextTemplatingEngineHost Host + { + get + { + return this.hostValue; } - set { - this.session = value; + set + { + this.hostValue = value; } } - public global::System.Text.StringBuilder GenerationEnvironment { - get { - if ((this.builder == null)) { - this.builder = new global::System.Text.StringBuilder(); + #line 75 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Create.tt" + + MvcTextTemplateHost MvcHost { + get { return (MvcTextTemplateHost)Host; } + } + + public class ModelProperty + { + public string Name { get; set; } + public bool IsPrimaryKey { get; set; } + + public ModelProperty(PropertyInfo propertyInfo) + { + this.Name = propertyInfo.Name; + this.IsPrimaryKey = IsPrimaryKeyProperty(propertyInfo); + } + + bool IsPrimaryKeyProperty(PropertyInfo propertyInfo) + { + return + IsIdProperty(propertyInfo) || + IsIdPropertyPrefixedWithClassName(propertyInfo); + } + + bool IsIdProperty(PropertyInfo propertyInfo) + { + return IsMatchIgnoringCase(propertyInfo.Name, "id"); + } + + bool IsIdPropertyPrefixedWithClassName(PropertyInfo propertyInfo) + { + string prefixedIdPropertyName = propertyInfo.DeclaringType.Name + "id"; + return IsMatchIgnoringCase(propertyInfo.Name, prefixedIdPropertyName); + } + + static bool IsMatchIgnoringCase(string a, string b) + { + return String.Equals(a, b, StringComparison.OrdinalIgnoreCase); + } + } + + public string GetViewPageType() + { + string viewDataTypeName = MvcHost.ViewDataTypeName; + if (!String.IsNullOrEmpty(viewDataTypeName)) { + return String.Format("<{0}>", viewDataTypeName); + } + return String.Empty; + } + + public IEnumerable GetModelProperties() + { + var properties = new List(); + foreach (PropertyInfo propertyInfo in MvcHost.GetViewDataTypeProperties()) { + properties.Add(new ModelProperty(propertyInfo)); + } + return properties; + } + + + #line default + #line hidden + } + + #line default + #line hidden + #region Base class + /// + /// Base class for this transformation + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")] + public class CreateBase + { + #region Fields + private global::System.Text.StringBuilder generationEnvironmentField; + private global::System.CodeDom.Compiler.CompilerErrorCollection errorsField; + private global::System.Collections.Generic.List indentLengthsField; + private string currentIndentField = ""; + private bool endsWithNewline; + private global::System.Collections.Generic.IDictionary sessionField; + #endregion + #region Properties + /// + /// The string builder that generation-time code is using to assemble generated output + /// + protected System.Text.StringBuilder GenerationEnvironment + { + get + { + if ((this.generationEnvironmentField == null)) + { + this.generationEnvironmentField = new global::System.Text.StringBuilder(); } - return this.builder; + return this.generationEnvironmentField; } - set { - this.builder = value; + set + { + this.generationEnvironmentField = value; } } - - protected global::System.CodeDom.Compiler.CompilerErrorCollection Errors { - get { - if ((this.errors == null)) { - this.errors = new global::System.CodeDom.Compiler.CompilerErrorCollection(); + /// + /// The error collection for the generation process + /// + public System.CodeDom.Compiler.CompilerErrorCollection Errors + { + get + { + if ((this.errorsField == null)) + { + this.errorsField = new global::System.CodeDom.Compiler.CompilerErrorCollection(); } - return this.errors; - } - } - - public string CurrentIndent { - get { - return this.currentIndent; + return this.errorsField; } } - - private global::System.Collections.Generic.Stack Indents { - get { - if ((this.indents == null)) { - this.indents = new global::System.Collections.Generic.Stack(); + /// + /// A list of the lengths of each indent that was added with PushIndent + /// + private System.Collections.Generic.List indentLengths + { + get + { + if ((this.indentLengthsField == null)) + { + this.indentLengthsField = new global::System.Collections.Generic.List(); } - return this.indents; + return this.indentLengthsField; } } - - public ToStringInstanceHelper ToStringHelper { - get { - return this._toStringHelper; + /// + /// Gets the current indent we use when adding lines to the output + /// + public string CurrentIndent + { + get + { + return this.currentIndentField; } } - - public void Error(string message) { - this.Errors.Add(new global::System.CodeDom.Compiler.CompilerError(null, -1, -1, null, message)); - } - - public void Warning(string message) { - global::System.CodeDom.Compiler.CompilerError val = new global::System.CodeDom.Compiler.CompilerError(null, -1, -1, null, message); - val.IsWarning = true; - this.Errors.Add(val); - } - - public string PopIndent() { - if ((this.Indents.Count == 0)) { - return string.Empty; + /// + /// Current transformation session + /// + public virtual global::System.Collections.Generic.IDictionary Session + { + get + { + return this.sessionField; + } + set + { + this.sessionField = value; } - int lastPos = (this.currentIndent.Length - this.Indents.Pop()); - string last = this.currentIndent.Substring(lastPos); - this.currentIndent = this.currentIndent.Substring(0, lastPos); - return last; - } - - public void PushIndent(string indent) { - this.Indents.Push(indent.Length); - this.currentIndent = (this.currentIndent + indent); - } - - public void ClearIndent() { - this.currentIndent = string.Empty; - this.Indents.Clear(); } - - public void Write(string textToAppend) { - if (string.IsNullOrEmpty(textToAppend)) { + #endregion + #region Transform-time helpers + /// + /// Write text directly into the generated output + /// + public void Write(string textToAppend) + { + if (string.IsNullOrEmpty(textToAppend)) + { return; } - if ((((this.GenerationEnvironment.Length == 0) - || this.endsWithNewline) - && (this.CurrentIndent.Length > 0))) { - this.GenerationEnvironment.Append(this.CurrentIndent); + // If we're starting off, or if the previous text ended with a newline, + // we have to append the current indent first. + if (((this.GenerationEnvironment.Length == 0) + || this.endsWithNewline)) + { + this.GenerationEnvironment.Append(this.currentIndentField); + this.endsWithNewline = false; } - this.endsWithNewline = false; - char last = textToAppend[(textToAppend.Length - 1)]; - if (((last == '\n') - || (last == '\r'))) { + // Check if the current text ends with a newline + if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture)) + { this.endsWithNewline = true; } - if ((this.CurrentIndent.Length == 0)) { + // This is an optimization. If the current indent is "", then we don't have to do any + // of the more complex stuff further down. + if ((this.currentIndentField.Length == 0)) + { this.GenerationEnvironment.Append(textToAppend); return; } - int lastNewline = 0; - for (int i = 0; (i - < (textToAppend.Length - 1)); i = (i + 1)) { - char c = textToAppend[i]; - if ((c == '\r')) { - if ((textToAppend[(i + 1)] == '\n')) { - i = (i + 1); - if ((i - == (textToAppend.Length - 1))) { - goto breakLoop; - } - } - } - else { - if ((c != '\n')) { - goto continueLoop; - } - } - i = (i + 1); - int len = (i - lastNewline); - if ((len > 0)) { - this.GenerationEnvironment.Append(textToAppend, lastNewline, (i - lastNewline)); - } - this.GenerationEnvironment.Append(this.CurrentIndent); - lastNewline = i; - continueLoop: - ; - } - breakLoop: - if ((lastNewline > 0)) { - this.GenerationEnvironment.Append(textToAppend, lastNewline, (textToAppend.Length - lastNewline)); + // Everywhere there is a newline in the text, add an indent after it + textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField)); + // If the text ends with a newline, then we should strip off the indent added at the very end + // because the appropriate indent will be added when the next time Write() is called + if (this.endsWithNewline) + { + this.GenerationEnvironment.Append(textToAppend, 0, (textToAppend.Length - this.currentIndentField.Length)); } - else { + else + { this.GenerationEnvironment.Append(textToAppend); } } - - public void Write(string format, params object[] args) { - this.Write(string.Format(format, args)); - } - - public void WriteLine(string textToAppend) { + /// + /// Write text directly into the generated output + /// + public void WriteLine(string textToAppend) + { this.Write(textToAppend); this.GenerationEnvironment.AppendLine(); this.endsWithNewline = true; } - - public void WriteLine(string format, params object[] args) { - this.WriteLine(string.Format(format, args)); + /// + /// Write formatted text directly into the generated output + /// + public void Write(string format, params object[] args) + { + this.Write(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args)); } - - public class ToStringInstanceHelper { - - private global::System.IFormatProvider formatProvider = global::System.Globalization.CultureInfo.InvariantCulture; - - public global::System.IFormatProvider FormatProvider { - get { - return this.formatProvider; + /// + /// Write formatted text directly into the generated output + /// + public void WriteLine(string format, params object[] args) + { + this.WriteLine(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args)); + } + /// + /// Raise an error + /// + public void Error(string message) + { + System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError(); + error.ErrorText = message; + this.Errors.Add(error); + } + /// + /// Raise a warning + /// + public void Warning(string message) + { + System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError(); + error.ErrorText = message; + error.IsWarning = true; + this.Errors.Add(error); + } + /// + /// Increase the indent + /// + public void PushIndent(string indent) + { + if ((indent == null)) + { + throw new global::System.ArgumentNullException("indent"); + } + this.currentIndentField = (this.currentIndentField + indent); + this.indentLengths.Add(indent.Length); + } + /// + /// Remove the last indent that was added with PushIndent + /// + public string PopIndent() + { + string returnValue = ""; + if ((this.indentLengths.Count > 0)) + { + int indentLength = this.indentLengths[(this.indentLengths.Count - 1)]; + this.indentLengths.RemoveAt((this.indentLengths.Count - 1)); + if ((indentLength > 0)) + { + returnValue = this.currentIndentField.Substring((this.currentIndentField.Length - indentLength)); + this.currentIndentField = this.currentIndentField.Remove((this.currentIndentField.Length - indentLength)); + } + } + return returnValue; + } + /// + /// Remove any indentation + /// + public void ClearIndent() + { + this.indentLengths.Clear(); + this.currentIndentField = ""; + } + #endregion + #region ToString Helpers + /// + /// Utility class to produce culture-oriented representation of an object as a string. + /// + public class ToStringInstanceHelper + { + private System.IFormatProvider formatProviderField = global::System.Globalization.CultureInfo.InvariantCulture; + /// + /// Gets or sets format provider to be used by ToStringWithCulture method. + /// + public System.IFormatProvider FormatProvider + { + get + { + return this.formatProviderField ; } - set { - if ((this.formatProvider == null)) { - throw new global::System.ArgumentNullException("formatProvider"); + set + { + if ((value != null)) + { + this.formatProviderField = value; } - this.formatProvider = value; } } - - public string ToStringWithCulture(object objectToConvert) { - if ((objectToConvert == null)) { + /// + /// This is called from the compile/run appdomain to convert objects within an expression block to a string + /// + public string ToStringWithCulture(object objectToConvert) + { + if ((objectToConvert == null)) + { throw new global::System.ArgumentNullException("objectToConvert"); } - global::System.Type type = objectToConvert.GetType(); - global::System.Type iConvertibleType = typeof(global::System.IConvertible); - if (iConvertibleType.IsAssignableFrom(type)) { - return ((global::System.IConvertible)(objectToConvert)).ToString(this.formatProvider); + System.Type t = objectToConvert.GetType(); + System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] { + typeof(System.IFormatProvider)}); + if ((method == null)) + { + return objectToConvert.ToString(); } - global::System.Reflection.MethodInfo methInfo = type.GetMethod("ToString", new global::System.Type[] { - iConvertibleType}); - if ((methInfo != null)) { - return ((string)(methInfo.Invoke(objectToConvert, new object[] { - this.formatProvider}))); + else + { + return ((string)(method.Invoke(objectToConvert, new object[] { + this.formatProviderField }))); } - return objectToConvert.ToString(); } } + private ToStringInstanceHelper toStringHelperField = new ToStringInstanceHelper(); + /// + /// Helper to produce culture-oriented representation of an object as a string + /// + public ToStringInstanceHelper ToStringHelper + { + get + { + return this.toStringHelperField; + } + } + #endregion } + #endregion } diff --git a/src/AddIns/BackendBindings/AspNet.Mvc/Project/ItemTemplates/CSharp/CodeTemplates/AddView/AspxCSharp/Delete.cs b/src/AddIns/BackendBindings/AspNet.Mvc/Project/ItemTemplates/CSharp/CodeTemplates/AddView/AspxCSharp/Delete.cs index f6af581755e..113396fa017 100644 --- a/src/AddIns/BackendBindings/AspNet.Mvc/Project/ItemTemplates/CSharp/CodeTemplates/AddView/AspxCSharp/Delete.cs +++ b/src/AddIns/BackendBindings/AspNet.Mvc/Project/ItemTemplates/CSharp/CodeTemplates/AddView/AspxCSharp/Delete.cs @@ -1,186 +1,85 @@ -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.239 -// +// Runtime Version: 17.0.0.0 +// // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // -//------------------------------------------------------------------------------ - -namespace ICSharpCode.AspNet.Mvc.AspxCSharp { +// ------------------------------------------------------------------------------ +namespace ICSharpCode.AspNet.Mvc.AspxCSharp +{ using ICSharpCode.AspNet.Mvc; using System.Collections.Generic; using System.Reflection; using System; + /// + /// Class to produce the template output + /// - public partial class Delete : DeleteBase { - - private global::Microsoft.VisualStudio.TextTemplating.ITextTemplatingEngineHost hostValue; - - - #line 70 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Delete.tt" - - MvcTextTemplateHost MvcHost { - get { return (MvcTextTemplateHost)Host; } - } - - public class ModelProperty - { - public string Name { get; set; } - public bool IsPrimaryKey { get; set; } - - public ModelProperty(PropertyInfo propertyInfo) - { - this.Name = propertyInfo.Name; - this.IsPrimaryKey = IsPrimaryKeyProperty(propertyInfo); - } - - bool IsPrimaryKeyProperty(PropertyInfo propertyInfo) - { - return - IsIdProperty(propertyInfo) || - IsIdPropertyPrefixedWithClassName(propertyInfo); - } - - bool IsIdProperty(PropertyInfo propertyInfo) - { - return IsMatchIgnoringCase(propertyInfo.Name, "id"); - } - - bool IsIdPropertyPrefixedWithClassName(PropertyInfo propertyInfo) - { - string prefixedIdPropertyName = propertyInfo.DeclaringType.Name + "id"; - return IsMatchIgnoringCase(propertyInfo.Name, prefixedIdPropertyName); - } - - static bool IsMatchIgnoringCase(string a, string b) - { - return String.Equals(a, b, StringComparison.OrdinalIgnoreCase); - } - } - - public string GetViewPageType() - { - string viewDataTypeName = MvcHost.ViewDataTypeName; - if (!String.IsNullOrEmpty(viewDataTypeName)) { - return String.Format("<{0}>", viewDataTypeName); - } - return String.Empty; - } - - public IEnumerable GetModelProperties() - { - var properties = new List(); - foreach (PropertyInfo propertyInfo in MvcHost.GetViewDataTypeProperties()) { - properties.Add(new ModelProperty(propertyInfo)); - } - return properties; - } - - #line default - #line hidden - - - public global::Microsoft.VisualStudio.TextTemplating.ITextTemplatingEngineHost Host { - get { - return this.hostValue; - } - set { - this.hostValue = value; - } - } - - public virtual string TransformText() { - this.GenerationEnvironment = null; - - #line 5 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Delete.tt" + #line 1 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Delete.tt" + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")] + public partial class Delete : DeleteBase + { +#line hidden + /// + /// Create the template output + /// + public virtual string TransformText() + { + + #line 5 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Delete.tt" if (MvcHost.IsPartialView) { #line default #line hidden - - #line 6 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Delete.tt" this.Write("<%@ Control Language=\"C#\" Inherits=\"System.Web.Mvc.ViewUserControl"); - #line default - #line hidden - - #line 6 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Delete.tt" - this.Write(this.ToStringHelper.ToStringWithCulture( GetViewPageType() )); + #line 6 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Delete.tt" + this.Write(this.ToStringHelper.ToStringWithCulture(GetViewPageType())); #line default #line hidden - - #line 6 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Delete.tt" this.Write("\" %>\r\n\r\n"); - #line default - #line hidden - - #line 8 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Delete.tt" + #line 8 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Delete.tt" } else if (MvcHost.IsContentPage) { #line default #line hidden - - #line 9 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Delete.tt" this.Write("<%@ Page Language=\"C#\" MasterPageFile=\""); - #line default - #line hidden - - #line 9 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Delete.tt" - this.Write(this.ToStringHelper.ToStringWithCulture( MvcHost.MasterPageFile )); + #line 9 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Delete.tt" + this.Write(this.ToStringHelper.ToStringWithCulture(MvcHost.MasterPageFile)); #line default #line hidden - - #line 9 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Delete.tt" this.Write("\" Inherits=\"System.Web.Mvc.ViewPage"); - #line default - #line hidden - - #line 9 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Delete.tt" - this.Write(this.ToStringHelper.ToStringWithCulture( GetViewPageType() )); + #line 9 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Delete.tt" + this.Write(this.ToStringHelper.ToStringWithCulture(GetViewPageType())); #line default #line hidden - - #line 9 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Delete.tt" this.Write("\" %>\r\n\r\n\r\n" + ""); - #line default - #line hidden - - #line 12 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Delete.tt" - this.Write(this.ToStringHelper.ToStringWithCulture( MvcHost.ViewName )); + #line 12 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Delete.tt" + this.Write(this.ToStringHelper.ToStringWithCulture(MvcHost.ViewName)); #line default #line hidden - - #line 12 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Delete.tt" this.Write("\r\n\r\n\r\n\r\n"); - #line default - #line hidden - - #line 63 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Delete.tt" + #line 63 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Delete.tt" } else { PopIndent(); @@ -327,225 +176,367 @@ public virtual string TransformText() { #line default #line hidden - - #line 67 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Delete.tt" this.Write("\t\r\n\r\n"); - #line default - #line hidden - - #line 69 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Delete.tt" + #line 69 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Delete.tt" } #line default #line hidden return this.GenerationEnvironment.ToString(); } - - protected virtual void Initialize() { - } - } - - public class DeleteBase { - - private global::System.Text.StringBuilder builder; - - private global::System.Collections.Generic.IDictionary session; - - private global::System.CodeDom.Compiler.CompilerErrorCollection errors; - - private string currentIndent = string.Empty; - - private global::System.Collections.Generic.Stack indents; - - private bool endsWithNewline; - - private ToStringInstanceHelper _toStringHelper = new ToStringInstanceHelper(); - - public virtual global::System.Collections.Generic.IDictionary Session { - get { - return this.session; + private global::Microsoft.VisualStudio.TextTemplating.ITextTemplatingEngineHost hostValue; + /// + /// The current host for the text templating engine + /// + public virtual global::Microsoft.VisualStudio.TextTemplating.ITextTemplatingEngineHost Host + { + get + { + return this.hostValue; } - set { - this.session = value; + set + { + this.hostValue = value; } } - public global::System.Text.StringBuilder GenerationEnvironment { - get { - if ((this.builder == null)) { - this.builder = new global::System.Text.StringBuilder(); + #line 70 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Delete.tt" + + MvcTextTemplateHost MvcHost { + get { return (MvcTextTemplateHost)Host; } + } + + public class ModelProperty + { + public string Name { get; set; } + public bool IsPrimaryKey { get; set; } + + public ModelProperty(PropertyInfo propertyInfo) + { + this.Name = propertyInfo.Name; + this.IsPrimaryKey = IsPrimaryKeyProperty(propertyInfo); + } + + bool IsPrimaryKeyProperty(PropertyInfo propertyInfo) + { + return + IsIdProperty(propertyInfo) || + IsIdPropertyPrefixedWithClassName(propertyInfo); + } + + bool IsIdProperty(PropertyInfo propertyInfo) + { + return IsMatchIgnoringCase(propertyInfo.Name, "id"); + } + + bool IsIdPropertyPrefixedWithClassName(PropertyInfo propertyInfo) + { + string prefixedIdPropertyName = propertyInfo.DeclaringType.Name + "id"; + return IsMatchIgnoringCase(propertyInfo.Name, prefixedIdPropertyName); + } + + static bool IsMatchIgnoringCase(string a, string b) + { + return String.Equals(a, b, StringComparison.OrdinalIgnoreCase); + } + } + + public string GetViewPageType() + { + string viewDataTypeName = MvcHost.ViewDataTypeName; + if (!String.IsNullOrEmpty(viewDataTypeName)) { + return String.Format("<{0}>", viewDataTypeName); + } + return String.Empty; + } + + public IEnumerable GetModelProperties() + { + var properties = new List(); + foreach (PropertyInfo propertyInfo in MvcHost.GetViewDataTypeProperties()) { + properties.Add(new ModelProperty(propertyInfo)); + } + return properties; + } + + + #line default + #line hidden + } + + #line default + #line hidden + #region Base class + /// + /// Base class for this transformation + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")] + public class DeleteBase + { + #region Fields + private global::System.Text.StringBuilder generationEnvironmentField; + private global::System.CodeDom.Compiler.CompilerErrorCollection errorsField; + private global::System.Collections.Generic.List indentLengthsField; + private string currentIndentField = ""; + private bool endsWithNewline; + private global::System.Collections.Generic.IDictionary sessionField; + #endregion + #region Properties + /// + /// The string builder that generation-time code is using to assemble generated output + /// + protected System.Text.StringBuilder GenerationEnvironment + { + get + { + if ((this.generationEnvironmentField == null)) + { + this.generationEnvironmentField = new global::System.Text.StringBuilder(); } - return this.builder; + return this.generationEnvironmentField; } - set { - this.builder = value; + set + { + this.generationEnvironmentField = value; } } - - protected global::System.CodeDom.Compiler.CompilerErrorCollection Errors { - get { - if ((this.errors == null)) { - this.errors = new global::System.CodeDom.Compiler.CompilerErrorCollection(); + /// + /// The error collection for the generation process + /// + public System.CodeDom.Compiler.CompilerErrorCollection Errors + { + get + { + if ((this.errorsField == null)) + { + this.errorsField = new global::System.CodeDom.Compiler.CompilerErrorCollection(); } - return this.errors; + return this.errorsField; } } - - public string CurrentIndent { - get { - return this.currentIndent; - } - } - - private global::System.Collections.Generic.Stack Indents { - get { - if ((this.indents == null)) { - this.indents = new global::System.Collections.Generic.Stack(); + /// + /// A list of the lengths of each indent that was added with PushIndent + /// + private System.Collections.Generic.List indentLengths + { + get + { + if ((this.indentLengthsField == null)) + { + this.indentLengthsField = new global::System.Collections.Generic.List(); } - return this.indents; + return this.indentLengthsField; } } - - public ToStringInstanceHelper ToStringHelper { - get { - return this._toStringHelper; + /// + /// Gets the current indent we use when adding lines to the output + /// + public string CurrentIndent + { + get + { + return this.currentIndentField; } } - - public void Error(string message) { - this.Errors.Add(new global::System.CodeDom.Compiler.CompilerError(null, -1, -1, null, message)); - } - - public void Warning(string message) { - global::System.CodeDom.Compiler.CompilerError val = new global::System.CodeDom.Compiler.CompilerError(null, -1, -1, null, message); - val.IsWarning = true; - this.Errors.Add(val); - } - - public string PopIndent() { - if ((this.Indents.Count == 0)) { - return string.Empty; + /// + /// Current transformation session + /// + public virtual global::System.Collections.Generic.IDictionary Session + { + get + { + return this.sessionField; + } + set + { + this.sessionField = value; } - int lastPos = (this.currentIndent.Length - this.Indents.Pop()); - string last = this.currentIndent.Substring(lastPos); - this.currentIndent = this.currentIndent.Substring(0, lastPos); - return last; - } - - public void PushIndent(string indent) { - this.Indents.Push(indent.Length); - this.currentIndent = (this.currentIndent + indent); - } - - public void ClearIndent() { - this.currentIndent = string.Empty; - this.Indents.Clear(); } - - public void Write(string textToAppend) { - if (string.IsNullOrEmpty(textToAppend)) { + #endregion + #region Transform-time helpers + /// + /// Write text directly into the generated output + /// + public void Write(string textToAppend) + { + if (string.IsNullOrEmpty(textToAppend)) + { return; } - if ((((this.GenerationEnvironment.Length == 0) - || this.endsWithNewline) - && (this.CurrentIndent.Length > 0))) { - this.GenerationEnvironment.Append(this.CurrentIndent); + // If we're starting off, or if the previous text ended with a newline, + // we have to append the current indent first. + if (((this.GenerationEnvironment.Length == 0) + || this.endsWithNewline)) + { + this.GenerationEnvironment.Append(this.currentIndentField); + this.endsWithNewline = false; } - this.endsWithNewline = false; - char last = textToAppend[(textToAppend.Length - 1)]; - if (((last == '\n') - || (last == '\r'))) { + // Check if the current text ends with a newline + if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture)) + { this.endsWithNewline = true; } - if ((this.CurrentIndent.Length == 0)) { + // This is an optimization. If the current indent is "", then we don't have to do any + // of the more complex stuff further down. + if ((this.currentIndentField.Length == 0)) + { this.GenerationEnvironment.Append(textToAppend); return; } - int lastNewline = 0; - for (int i = 0; (i - < (textToAppend.Length - 1)); i = (i + 1)) { - char c = textToAppend[i]; - if ((c == '\r')) { - if ((textToAppend[(i + 1)] == '\n')) { - i = (i + 1); - if ((i - == (textToAppend.Length - 1))) { - goto breakLoop; - } - } - } - else { - if ((c != '\n')) { - goto continueLoop; - } - } - i = (i + 1); - int len = (i - lastNewline); - if ((len > 0)) { - this.GenerationEnvironment.Append(textToAppend, lastNewline, (i - lastNewline)); - } - this.GenerationEnvironment.Append(this.CurrentIndent); - lastNewline = i; - continueLoop: - ; + // Everywhere there is a newline in the text, add an indent after it + textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField)); + // If the text ends with a newline, then we should strip off the indent added at the very end + // because the appropriate indent will be added when the next time Write() is called + if (this.endsWithNewline) + { + this.GenerationEnvironment.Append(textToAppend, 0, (textToAppend.Length - this.currentIndentField.Length)); } - breakLoop: - if ((lastNewline > 0)) { - this.GenerationEnvironment.Append(textToAppend, lastNewline, (textToAppend.Length - lastNewline)); - } - else { + else + { this.GenerationEnvironment.Append(textToAppend); } } - - public void Write(string format, params object[] args) { - this.Write(string.Format(format, args)); - } - - public void WriteLine(string textToAppend) { + /// + /// Write text directly into the generated output + /// + public void WriteLine(string textToAppend) + { this.Write(textToAppend); this.GenerationEnvironment.AppendLine(); this.endsWithNewline = true; } - - public void WriteLine(string format, params object[] args) { - this.WriteLine(string.Format(format, args)); + /// + /// Write formatted text directly into the generated output + /// + public void Write(string format, params object[] args) + { + this.Write(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args)); } - - public class ToStringInstanceHelper { - - private global::System.IFormatProvider formatProvider = global::System.Globalization.CultureInfo.InvariantCulture; - - public global::System.IFormatProvider FormatProvider { - get { - return this.formatProvider; + /// + /// Write formatted text directly into the generated output + /// + public void WriteLine(string format, params object[] args) + { + this.WriteLine(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args)); + } + /// + /// Raise an error + /// + public void Error(string message) + { + System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError(); + error.ErrorText = message; + this.Errors.Add(error); + } + /// + /// Raise a warning + /// + public void Warning(string message) + { + System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError(); + error.ErrorText = message; + error.IsWarning = true; + this.Errors.Add(error); + } + /// + /// Increase the indent + /// + public void PushIndent(string indent) + { + if ((indent == null)) + { + throw new global::System.ArgumentNullException("indent"); + } + this.currentIndentField = (this.currentIndentField + indent); + this.indentLengths.Add(indent.Length); + } + /// + /// Remove the last indent that was added with PushIndent + /// + public string PopIndent() + { + string returnValue = ""; + if ((this.indentLengths.Count > 0)) + { + int indentLength = this.indentLengths[(this.indentLengths.Count - 1)]; + this.indentLengths.RemoveAt((this.indentLengths.Count - 1)); + if ((indentLength > 0)) + { + returnValue = this.currentIndentField.Substring((this.currentIndentField.Length - indentLength)); + this.currentIndentField = this.currentIndentField.Remove((this.currentIndentField.Length - indentLength)); + } + } + return returnValue; + } + /// + /// Remove any indentation + /// + public void ClearIndent() + { + this.indentLengths.Clear(); + this.currentIndentField = ""; + } + #endregion + #region ToString Helpers + /// + /// Utility class to produce culture-oriented representation of an object as a string. + /// + public class ToStringInstanceHelper + { + private System.IFormatProvider formatProviderField = global::System.Globalization.CultureInfo.InvariantCulture; + /// + /// Gets or sets format provider to be used by ToStringWithCulture method. + /// + public System.IFormatProvider FormatProvider + { + get + { + return this.formatProviderField ; } - set { - if ((this.formatProvider == null)) { - throw new global::System.ArgumentNullException("formatProvider"); + set + { + if ((value != null)) + { + this.formatProviderField = value; } - this.formatProvider = value; } } - - public string ToStringWithCulture(object objectToConvert) { - if ((objectToConvert == null)) { + /// + /// This is called from the compile/run appdomain to convert objects within an expression block to a string + /// + public string ToStringWithCulture(object objectToConvert) + { + if ((objectToConvert == null)) + { throw new global::System.ArgumentNullException("objectToConvert"); } - global::System.Type type = objectToConvert.GetType(); - global::System.Type iConvertibleType = typeof(global::System.IConvertible); - if (iConvertibleType.IsAssignableFrom(type)) { - return ((global::System.IConvertible)(objectToConvert)).ToString(this.formatProvider); + System.Type t = objectToConvert.GetType(); + System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] { + typeof(System.IFormatProvider)}); + if ((method == null)) + { + return objectToConvert.ToString(); } - global::System.Reflection.MethodInfo methInfo = type.GetMethod("ToString", new global::System.Type[] { - iConvertibleType}); - if ((methInfo != null)) { - return ((string)(methInfo.Invoke(objectToConvert, new object[] { - this.formatProvider}))); + else + { + return ((string)(method.Invoke(objectToConvert, new object[] { + this.formatProviderField }))); } - return objectToConvert.ToString(); } } + private ToStringInstanceHelper toStringHelperField = new ToStringInstanceHelper(); + /// + /// Helper to produce culture-oriented representation of an object as a string + /// + public ToStringInstanceHelper ToStringHelper + { + get + { + return this.toStringHelperField; + } + } + #endregion } + #endregion } diff --git a/src/AddIns/BackendBindings/AspNet.Mvc/Project/ItemTemplates/CSharp/CodeTemplates/AddView/AspxCSharp/Details.cs b/src/AddIns/BackendBindings/AspNet.Mvc/Project/ItemTemplates/CSharp/CodeTemplates/AddView/AspxCSharp/Details.cs index 039a2b4b91c..735289ed049 100644 --- a/src/AddIns/BackendBindings/AspNet.Mvc/Project/ItemTemplates/CSharp/CodeTemplates/AddView/AspxCSharp/Details.cs +++ b/src/AddIns/BackendBindings/AspNet.Mvc/Project/ItemTemplates/CSharp/CodeTemplates/AddView/AspxCSharp/Details.cs @@ -1,222 +1,85 @@ -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.239 -// +// Runtime Version: 17.0.0.0 +// // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // -//------------------------------------------------------------------------------ - -namespace ICSharpCode.AspNet.Mvc.AspxCSharp { +// ------------------------------------------------------------------------------ +namespace ICSharpCode.AspNet.Mvc.AspxCSharp +{ using ICSharpCode.AspNet.Mvc; using System.Collections.Generic; using System.Reflection; using System; + /// + /// Class to produce the template output + /// - public partial class Details : DetailsBase { - - private global::Microsoft.VisualStudio.TextTemplating.ITextTemplatingEngineHost hostValue; - - - #line 72 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Details.tt" - - MvcTextTemplateHost MvcHost { - get { return (MvcTextTemplateHost)Host; } - } - - public class ModelProperty - { - public string Name { get; set; } - public bool IsPrimaryKey { get; set; } - - public ModelProperty(PropertyInfo propertyInfo) - { - this.Name = propertyInfo.Name; - this.IsPrimaryKey = IsPrimaryKeyProperty(propertyInfo); - } - - bool IsPrimaryKeyProperty(PropertyInfo propertyInfo) - { - return - IsIdProperty(propertyInfo) || - IsIdPropertyPrefixedWithClassName(propertyInfo); - } - - bool IsIdProperty(PropertyInfo propertyInfo) - { - return IsMatchIgnoringCase(propertyInfo.Name, "id"); - } - - bool IsIdPropertyPrefixedWithClassName(PropertyInfo propertyInfo) - { - string prefixedIdPropertyName = propertyInfo.DeclaringType.Name + "id"; - return IsMatchIgnoringCase(propertyInfo.Name, prefixedIdPropertyName); - } - - static bool IsMatchIgnoringCase(string a, string b) - { - return String.Equals(a, b, StringComparison.OrdinalIgnoreCase); - } - } - - public string GetViewPageType() - { - string viewDataTypeName = MvcHost.ViewDataTypeName; - if (!String.IsNullOrEmpty(viewDataTypeName)) { - return String.Format("<{0}>", viewDataTypeName); - } - return String.Empty; - } - - List modelProperties; - - List ModelProperties { - get { - if (modelProperties == null) { - modelProperties = new List(GetModelProperties()); - } - return modelProperties; - } - } - - public IEnumerable GetModelProperties() - { - var properties = new List(); - foreach (PropertyInfo propertyInfo in MvcHost.GetViewDataTypeProperties()) { - properties.Add(new ModelProperty(propertyInfo)); - } - return properties; - } - - bool ModelHasPrimaryKey { - get { return ModelPrimaryKeyName.Length > 0; } - } - - string modelPrimaryKeyName; - - string ModelPrimaryKeyName { - get { - if (modelPrimaryKeyName == null) { - modelPrimaryKeyName = GetModelPrimaryKeyName(); - } - return modelPrimaryKeyName; - } - } - - public string GetModelPrimaryKeyName() - { - foreach (ModelProperty modelProperty in ModelProperties) { - if (modelProperty.IsPrimaryKey) { - return modelProperty.Name; - } - } - return ""; - } - - #line default - #line hidden - - - public global::Microsoft.VisualStudio.TextTemplating.ITextTemplatingEngineHost Host { - get { - return this.hostValue; - } - set { - this.hostValue = value; - } - } - - public virtual string TransformText() { - this.GenerationEnvironment = null; - - #line 5 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Details.tt" + #line 1 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Details.tt" + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")] + public partial class Details : DetailsBase + { +#line hidden + /// + /// Create the template output + /// + public virtual string TransformText() + { + + #line 5 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Details.tt" if (MvcHost.IsPartialView) { #line default #line hidden - - #line 6 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Details.tt" this.Write("<%@ Control Language=\"C#\" Inherits=\"System.Web.Mvc.ViewUserControl"); - #line default - #line hidden - - #line 6 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Details.tt" - this.Write(this.ToStringHelper.ToStringWithCulture( GetViewPageType() )); + #line 6 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Details.tt" + this.Write(this.ToStringHelper.ToStringWithCulture(GetViewPageType())); #line default #line hidden - - #line 6 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Details.tt" this.Write("\" %>\r\n\r\n"); - #line default - #line hidden - - #line 8 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Details.tt" + #line 8 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Details.tt" } else if (MvcHost.IsContentPage) { #line default #line hidden - - #line 9 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Details.tt" this.Write("<%@ Page Language=\"C#\" MasterPageFile=\""); - #line default - #line hidden - - #line 9 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Details.tt" - this.Write(this.ToStringHelper.ToStringWithCulture( MvcHost.MasterPageFile )); + #line 9 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Details.tt" + this.Write(this.ToStringHelper.ToStringWithCulture(MvcHost.MasterPageFile)); #line default #line hidden - - #line 9 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Details.tt" this.Write("\" Inherits=\"System.Web.Mvc.ViewPage"); - #line default - #line hidden - - #line 9 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Details.tt" - this.Write(this.ToStringHelper.ToStringWithCulture( GetViewPageType() )); + #line 9 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Details.tt" + this.Write(this.ToStringHelper.ToStringWithCulture(GetViewPageType())); #line default #line hidden - - #line 9 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Details.tt" this.Write("\" %>\r\n\r\n\r\n" + ""); - #line default - #line hidden - - #line 12 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Details.tt" - this.Write(this.ToStringHelper.ToStringWithCulture( MvcHost.ViewName )); + #line 12 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Details.tt" + this.Write(this.ToStringHelper.ToStringWithCulture(MvcHost.ViewName)); #line default #line hidden - - #line 12 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Details.tt" this.Write("\r\n\r\n\r\n\r\n"); - #line default - #line hidden - - #line 65 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Details.tt" + #line 65 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Details.tt" } else { PopIndent(); @@ -410,225 +203,403 @@ public virtual string TransformText() { #line default #line hidden - - #line 69 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Details.tt" this.Write("\t\r\n\r\n"); - #line default - #line hidden - - #line 71 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Details.tt" + #line 71 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Details.tt" } #line default #line hidden return this.GenerationEnvironment.ToString(); } - - protected virtual void Initialize() { - } - } - - public class DetailsBase { - - private global::System.Text.StringBuilder builder; - - private global::System.Collections.Generic.IDictionary session; - - private global::System.CodeDom.Compiler.CompilerErrorCollection errors; - - private string currentIndent = string.Empty; - - private global::System.Collections.Generic.Stack indents; - - private bool endsWithNewline; - - private ToStringInstanceHelper _toStringHelper = new ToStringInstanceHelper(); - - public virtual global::System.Collections.Generic.IDictionary Session { - get { - return this.session; + private global::Microsoft.VisualStudio.TextTemplating.ITextTemplatingEngineHost hostValue; + /// + /// The current host for the text templating engine + /// + public virtual global::Microsoft.VisualStudio.TextTemplating.ITextTemplatingEngineHost Host + { + get + { + return this.hostValue; } - set { - this.session = value; + set + { + this.hostValue = value; } } - public global::System.Text.StringBuilder GenerationEnvironment { - get { - if ((this.builder == null)) { - this.builder = new global::System.Text.StringBuilder(); + #line 72 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Details.tt" + + MvcTextTemplateHost MvcHost { + get { return (MvcTextTemplateHost)Host; } + } + + public class ModelProperty + { + public string Name { get; set; } + public bool IsPrimaryKey { get; set; } + + public ModelProperty(PropertyInfo propertyInfo) + { + this.Name = propertyInfo.Name; + this.IsPrimaryKey = IsPrimaryKeyProperty(propertyInfo); + } + + bool IsPrimaryKeyProperty(PropertyInfo propertyInfo) + { + return + IsIdProperty(propertyInfo) || + IsIdPropertyPrefixedWithClassName(propertyInfo); + } + + bool IsIdProperty(PropertyInfo propertyInfo) + { + return IsMatchIgnoringCase(propertyInfo.Name, "id"); + } + + bool IsIdPropertyPrefixedWithClassName(PropertyInfo propertyInfo) + { + string prefixedIdPropertyName = propertyInfo.DeclaringType.Name + "id"; + return IsMatchIgnoringCase(propertyInfo.Name, prefixedIdPropertyName); + } + + static bool IsMatchIgnoringCase(string a, string b) + { + return String.Equals(a, b, StringComparison.OrdinalIgnoreCase); + } + } + + public string GetViewPageType() + { + string viewDataTypeName = MvcHost.ViewDataTypeName; + if (!String.IsNullOrEmpty(viewDataTypeName)) { + return String.Format("<{0}>", viewDataTypeName); + } + return String.Empty; + } + + List modelProperties; + + List ModelProperties { + get { + if (modelProperties == null) { + modelProperties = new List(GetModelProperties()); + } + return modelProperties; + } + } + + public IEnumerable GetModelProperties() + { + var properties = new List(); + foreach (PropertyInfo propertyInfo in MvcHost.GetViewDataTypeProperties()) { + properties.Add(new ModelProperty(propertyInfo)); + } + return properties; + } + + bool ModelHasPrimaryKey { + get { return ModelPrimaryKeyName.Length > 0; } + } + + string modelPrimaryKeyName; + + string ModelPrimaryKeyName { + get { + if (modelPrimaryKeyName == null) { + modelPrimaryKeyName = GetModelPrimaryKeyName(); + } + return modelPrimaryKeyName; + } + } + + public string GetModelPrimaryKeyName() + { + foreach (ModelProperty modelProperty in ModelProperties) { + if (modelProperty.IsPrimaryKey) { + return modelProperty.Name; + } + } + return ""; + } + + + #line default + #line hidden + } + + #line default + #line hidden + #region Base class + /// + /// Base class for this transformation + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")] + public class DetailsBase + { + #region Fields + private global::System.Text.StringBuilder generationEnvironmentField; + private global::System.CodeDom.Compiler.CompilerErrorCollection errorsField; + private global::System.Collections.Generic.List indentLengthsField; + private string currentIndentField = ""; + private bool endsWithNewline; + private global::System.Collections.Generic.IDictionary sessionField; + #endregion + #region Properties + /// + /// The string builder that generation-time code is using to assemble generated output + /// + protected System.Text.StringBuilder GenerationEnvironment + { + get + { + if ((this.generationEnvironmentField == null)) + { + this.generationEnvironmentField = new global::System.Text.StringBuilder(); } - return this.builder; + return this.generationEnvironmentField; } - set { - this.builder = value; + set + { + this.generationEnvironmentField = value; } } - - protected global::System.CodeDom.Compiler.CompilerErrorCollection Errors { - get { - if ((this.errors == null)) { - this.errors = new global::System.CodeDom.Compiler.CompilerErrorCollection(); + /// + /// The error collection for the generation process + /// + public System.CodeDom.Compiler.CompilerErrorCollection Errors + { + get + { + if ((this.errorsField == null)) + { + this.errorsField = new global::System.CodeDom.Compiler.CompilerErrorCollection(); } - return this.errors; - } - } - - public string CurrentIndent { - get { - return this.currentIndent; + return this.errorsField; } } - - private global::System.Collections.Generic.Stack Indents { - get { - if ((this.indents == null)) { - this.indents = new global::System.Collections.Generic.Stack(); + /// + /// A list of the lengths of each indent that was added with PushIndent + /// + private System.Collections.Generic.List indentLengths + { + get + { + if ((this.indentLengthsField == null)) + { + this.indentLengthsField = new global::System.Collections.Generic.List(); } - return this.indents; + return this.indentLengthsField; } } - - public ToStringInstanceHelper ToStringHelper { - get { - return this._toStringHelper; + /// + /// Gets the current indent we use when adding lines to the output + /// + public string CurrentIndent + { + get + { + return this.currentIndentField; } } - - public void Error(string message) { - this.Errors.Add(new global::System.CodeDom.Compiler.CompilerError(null, -1, -1, null, message)); - } - - public void Warning(string message) { - global::System.CodeDom.Compiler.CompilerError val = new global::System.CodeDom.Compiler.CompilerError(null, -1, -1, null, message); - val.IsWarning = true; - this.Errors.Add(val); - } - - public string PopIndent() { - if ((this.Indents.Count == 0)) { - return string.Empty; + /// + /// Current transformation session + /// + public virtual global::System.Collections.Generic.IDictionary Session + { + get + { + return this.sessionField; + } + set + { + this.sessionField = value; } - int lastPos = (this.currentIndent.Length - this.Indents.Pop()); - string last = this.currentIndent.Substring(lastPos); - this.currentIndent = this.currentIndent.Substring(0, lastPos); - return last; - } - - public void PushIndent(string indent) { - this.Indents.Push(indent.Length); - this.currentIndent = (this.currentIndent + indent); - } - - public void ClearIndent() { - this.currentIndent = string.Empty; - this.Indents.Clear(); } - - public void Write(string textToAppend) { - if (string.IsNullOrEmpty(textToAppend)) { + #endregion + #region Transform-time helpers + /// + /// Write text directly into the generated output + /// + public void Write(string textToAppend) + { + if (string.IsNullOrEmpty(textToAppend)) + { return; } - if ((((this.GenerationEnvironment.Length == 0) - || this.endsWithNewline) - && (this.CurrentIndent.Length > 0))) { - this.GenerationEnvironment.Append(this.CurrentIndent); + // If we're starting off, or if the previous text ended with a newline, + // we have to append the current indent first. + if (((this.GenerationEnvironment.Length == 0) + || this.endsWithNewline)) + { + this.GenerationEnvironment.Append(this.currentIndentField); + this.endsWithNewline = false; } - this.endsWithNewline = false; - char last = textToAppend[(textToAppend.Length - 1)]; - if (((last == '\n') - || (last == '\r'))) { + // Check if the current text ends with a newline + if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture)) + { this.endsWithNewline = true; } - if ((this.CurrentIndent.Length == 0)) { + // This is an optimization. If the current indent is "", then we don't have to do any + // of the more complex stuff further down. + if ((this.currentIndentField.Length == 0)) + { this.GenerationEnvironment.Append(textToAppend); return; } - int lastNewline = 0; - for (int i = 0; (i - < (textToAppend.Length - 1)); i = (i + 1)) { - char c = textToAppend[i]; - if ((c == '\r')) { - if ((textToAppend[(i + 1)] == '\n')) { - i = (i + 1); - if ((i - == (textToAppend.Length - 1))) { - goto breakLoop; - } - } - } - else { - if ((c != '\n')) { - goto continueLoop; - } - } - i = (i + 1); - int len = (i - lastNewline); - if ((len > 0)) { - this.GenerationEnvironment.Append(textToAppend, lastNewline, (i - lastNewline)); - } - this.GenerationEnvironment.Append(this.CurrentIndent); - lastNewline = i; - continueLoop: - ; - } - breakLoop: - if ((lastNewline > 0)) { - this.GenerationEnvironment.Append(textToAppend, lastNewline, (textToAppend.Length - lastNewline)); + // Everywhere there is a newline in the text, add an indent after it + textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField)); + // If the text ends with a newline, then we should strip off the indent added at the very end + // because the appropriate indent will be added when the next time Write() is called + if (this.endsWithNewline) + { + this.GenerationEnvironment.Append(textToAppend, 0, (textToAppend.Length - this.currentIndentField.Length)); } - else { + else + { this.GenerationEnvironment.Append(textToAppend); } } - - public void Write(string format, params object[] args) { - this.Write(string.Format(format, args)); - } - - public void WriteLine(string textToAppend) { + /// + /// Write text directly into the generated output + /// + public void WriteLine(string textToAppend) + { this.Write(textToAppend); this.GenerationEnvironment.AppendLine(); this.endsWithNewline = true; } - - public void WriteLine(string format, params object[] args) { - this.WriteLine(string.Format(format, args)); + /// + /// Write formatted text directly into the generated output + /// + public void Write(string format, params object[] args) + { + this.Write(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args)); } - - public class ToStringInstanceHelper { - - private global::System.IFormatProvider formatProvider = global::System.Globalization.CultureInfo.InvariantCulture; - - public global::System.IFormatProvider FormatProvider { - get { - return this.formatProvider; + /// + /// Write formatted text directly into the generated output + /// + public void WriteLine(string format, params object[] args) + { + this.WriteLine(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args)); + } + /// + /// Raise an error + /// + public void Error(string message) + { + System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError(); + error.ErrorText = message; + this.Errors.Add(error); + } + /// + /// Raise a warning + /// + public void Warning(string message) + { + System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError(); + error.ErrorText = message; + error.IsWarning = true; + this.Errors.Add(error); + } + /// + /// Increase the indent + /// + public void PushIndent(string indent) + { + if ((indent == null)) + { + throw new global::System.ArgumentNullException("indent"); + } + this.currentIndentField = (this.currentIndentField + indent); + this.indentLengths.Add(indent.Length); + } + /// + /// Remove the last indent that was added with PushIndent + /// + public string PopIndent() + { + string returnValue = ""; + if ((this.indentLengths.Count > 0)) + { + int indentLength = this.indentLengths[(this.indentLengths.Count - 1)]; + this.indentLengths.RemoveAt((this.indentLengths.Count - 1)); + if ((indentLength > 0)) + { + returnValue = this.currentIndentField.Substring((this.currentIndentField.Length - indentLength)); + this.currentIndentField = this.currentIndentField.Remove((this.currentIndentField.Length - indentLength)); } - set { - if ((this.formatProvider == null)) { - throw new global::System.ArgumentNullException("formatProvider"); + } + return returnValue; + } + /// + /// Remove any indentation + /// + public void ClearIndent() + { + this.indentLengths.Clear(); + this.currentIndentField = ""; + } + #endregion + #region ToString Helpers + /// + /// Utility class to produce culture-oriented representation of an object as a string. + /// + public class ToStringInstanceHelper + { + private System.IFormatProvider formatProviderField = global::System.Globalization.CultureInfo.InvariantCulture; + /// + /// Gets or sets format provider to be used by ToStringWithCulture method. + /// + public System.IFormatProvider FormatProvider + { + get + { + return this.formatProviderField ; + } + set + { + if ((value != null)) + { + this.formatProviderField = value; } - this.formatProvider = value; } } - - public string ToStringWithCulture(object objectToConvert) { - if ((objectToConvert == null)) { + /// + /// This is called from the compile/run appdomain to convert objects within an expression block to a string + /// + public string ToStringWithCulture(object objectToConvert) + { + if ((objectToConvert == null)) + { throw new global::System.ArgumentNullException("objectToConvert"); } - global::System.Type type = objectToConvert.GetType(); - global::System.Type iConvertibleType = typeof(global::System.IConvertible); - if (iConvertibleType.IsAssignableFrom(type)) { - return ((global::System.IConvertible)(objectToConvert)).ToString(this.formatProvider); + System.Type t = objectToConvert.GetType(); + System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] { + typeof(System.IFormatProvider)}); + if ((method == null)) + { + return objectToConvert.ToString(); } - global::System.Reflection.MethodInfo methInfo = type.GetMethod("ToString", new global::System.Type[] { - iConvertibleType}); - if ((methInfo != null)) { - return ((string)(methInfo.Invoke(objectToConvert, new object[] { - this.formatProvider}))); + else + { + return ((string)(method.Invoke(objectToConvert, new object[] { + this.formatProviderField }))); } - return objectToConvert.ToString(); } } + private ToStringInstanceHelper toStringHelperField = new ToStringInstanceHelper(); + /// + /// Helper to produce culture-oriented representation of an object as a string + /// + public ToStringInstanceHelper ToStringHelper + { + get + { + return this.toStringHelperField; + } + } + #endregion } + #endregion } diff --git a/src/AddIns/BackendBindings/AspNet.Mvc/Project/ItemTemplates/CSharp/CodeTemplates/AddView/AspxCSharp/Edit.cs b/src/AddIns/BackendBindings/AspNet.Mvc/Project/ItemTemplates/CSharp/CodeTemplates/AddView/AspxCSharp/Edit.cs index a959723482a..6029b61edce 100644 --- a/src/AddIns/BackendBindings/AspNet.Mvc/Project/ItemTemplates/CSharp/CodeTemplates/AddView/AspxCSharp/Edit.cs +++ b/src/AddIns/BackendBindings/AspNet.Mvc/Project/ItemTemplates/CSharp/CodeTemplates/AddView/AspxCSharp/Edit.cs @@ -1,222 +1,85 @@ -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.239 -// +// Runtime Version: 17.0.0.0 +// // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // -//------------------------------------------------------------------------------ - -namespace ICSharpCode.AspNet.Mvc.AspxCSharp { +// ------------------------------------------------------------------------------ +namespace ICSharpCode.AspNet.Mvc.AspxCSharp +{ using ICSharpCode.AspNet.Mvc; using System.Collections.Generic; using System.Reflection; using System; + /// + /// Class to produce the template output + /// - public partial class Edit : EditBase { - - private global::Microsoft.VisualStudio.TextTemplating.ITextTemplatingEngineHost hostValue; - - - #line 79 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Edit.tt" - - MvcTextTemplateHost MvcHost { - get { return (MvcTextTemplateHost)Host; } - } - - public class ModelProperty - { - public string Name { get; set; } - public bool IsPrimaryKey { get; set; } - - public ModelProperty(PropertyInfo propertyInfo) - { - this.Name = propertyInfo.Name; - this.IsPrimaryKey = IsPrimaryKeyProperty(propertyInfo); - } - - bool IsPrimaryKeyProperty(PropertyInfo propertyInfo) - { - return - IsIdProperty(propertyInfo) || - IsIdPropertyPrefixedWithClassName(propertyInfo); - } - - bool IsIdProperty(PropertyInfo propertyInfo) - { - return IsMatchIgnoringCase(propertyInfo.Name, "id"); - } - - bool IsIdPropertyPrefixedWithClassName(PropertyInfo propertyInfo) - { - string prefixedIdPropertyName = propertyInfo.DeclaringType.Name + "id"; - return IsMatchIgnoringCase(propertyInfo.Name, prefixedIdPropertyName); - } - - static bool IsMatchIgnoringCase(string a, string b) - { - return String.Equals(a, b, StringComparison.OrdinalIgnoreCase); - } - } - - public string GetViewPageType() - { - string viewDataTypeName = MvcHost.ViewDataTypeName; - if (!String.IsNullOrEmpty(viewDataTypeName)) { - return String.Format("<{0}>", viewDataTypeName); - } - return String.Empty; - } - - List modelProperties; - - List ModelProperties { - get { - if (modelProperties == null) { - modelProperties = new List(GetModelProperties()); - } - return modelProperties; - } - } - - public IEnumerable GetModelProperties() - { - var properties = new List(); - foreach (PropertyInfo propertyInfo in MvcHost.GetViewDataTypeProperties()) { - properties.Add(new ModelProperty(propertyInfo)); - } - return properties; - } - - bool ModelHasPrimaryKey { - get { return ModelPrimaryKeyName.Length > 0; } - } - - string modelPrimaryKeyName; - - string ModelPrimaryKeyName { - get { - if (modelPrimaryKeyName == null) { - modelPrimaryKeyName = GetModelPrimaryKeyName(); - } - return modelPrimaryKeyName; - } - } - - public string GetModelPrimaryKeyName() - { - foreach (ModelProperty modelProperty in ModelProperties) { - if (modelProperty.IsPrimaryKey) { - return modelProperty.Name; - } - } - return ""; - } - - #line default - #line hidden - - - public global::Microsoft.VisualStudio.TextTemplating.ITextTemplatingEngineHost Host { - get { - return this.hostValue; - } - set { - this.hostValue = value; - } - } - - public virtual string TransformText() { - this.GenerationEnvironment = null; - - #line 5 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Edit.tt" + #line 1 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Edit.tt" + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")] + public partial class Edit : EditBase + { +#line hidden + /// + /// Create the template output + /// + public virtual string TransformText() + { + + #line 5 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Edit.tt" if (MvcHost.IsPartialView) { #line default #line hidden - - #line 6 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Edit.tt" this.Write("<%@ Control Language=\"C#\" Inherits=\"System.Web.Mvc.ViewUserControl"); - #line default - #line hidden - - #line 6 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Edit.tt" - this.Write(this.ToStringHelper.ToStringWithCulture( GetViewPageType() )); + #line 6 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Edit.tt" + this.Write(this.ToStringHelper.ToStringWithCulture(GetViewPageType())); #line default #line hidden - - #line 6 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Edit.tt" this.Write("\" %>\r\n\r\n"); - #line default - #line hidden - - #line 8 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Edit.tt" + #line 8 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Edit.tt" } else if (MvcHost.IsContentPage) { #line default #line hidden - - #line 9 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Edit.tt" this.Write("<%@ Page Language=\"C#\" MasterPageFile=\""); - #line default - #line hidden - - #line 9 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Edit.tt" - this.Write(this.ToStringHelper.ToStringWithCulture( MvcHost.MasterPageFile )); + #line 9 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Edit.tt" + this.Write(this.ToStringHelper.ToStringWithCulture(MvcHost.MasterPageFile)); #line default #line hidden - - #line 9 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Edit.tt" this.Write("\" Inherits=\"System.Web.Mvc.ViewPage"); - #line default - #line hidden - - #line 9 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Edit.tt" - this.Write(this.ToStringHelper.ToStringWithCulture( GetViewPageType() )); + #line 9 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Edit.tt" + this.Write(this.ToStringHelper.ToStringWithCulture(GetViewPageType())); #line default #line hidden - - #line 9 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Edit.tt" this.Write("\" %>\r\n\r\n\r\n" + ""); - #line default - #line hidden - - #line 12 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Edit.tt" - this.Write(this.ToStringHelper.ToStringWithCulture( MvcHost.ViewName )); + #line 12 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Edit.tt" + this.Write(this.ToStringHelper.ToStringWithCulture(MvcHost.ViewName)); #line default #line hidden - - #line 12 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Edit.tt" this.Write("\r\n\r\n\r\n\r\n"); - #line default - #line hidden - - #line 72 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Edit.tt" + #line 72 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Edit.tt" } else { PopIndent(); @@ -394,225 +197,403 @@ public virtual string TransformText() { #line default #line hidden - - #line 76 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Edit.tt" this.Write("\t\r\n\r\n"); - #line default - #line hidden - - #line 78 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Edit.tt" + #line 78 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Edit.tt" } #line default #line hidden return this.GenerationEnvironment.ToString(); } - - protected virtual void Initialize() { - } - } - - public class EditBase { - - private global::System.Text.StringBuilder builder; - - private global::System.Collections.Generic.IDictionary session; - - private global::System.CodeDom.Compiler.CompilerErrorCollection errors; - - private string currentIndent = string.Empty; - - private global::System.Collections.Generic.Stack indents; - - private bool endsWithNewline; - - private ToStringInstanceHelper _toStringHelper = new ToStringInstanceHelper(); - - public virtual global::System.Collections.Generic.IDictionary Session { - get { - return this.session; + private global::Microsoft.VisualStudio.TextTemplating.ITextTemplatingEngineHost hostValue; + /// + /// The current host for the text templating engine + /// + public virtual global::Microsoft.VisualStudio.TextTemplating.ITextTemplatingEngineHost Host + { + get + { + return this.hostValue; } - set { - this.session = value; + set + { + this.hostValue = value; } } - public global::System.Text.StringBuilder GenerationEnvironment { - get { - if ((this.builder == null)) { - this.builder = new global::System.Text.StringBuilder(); + #line 79 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Edit.tt" + + MvcTextTemplateHost MvcHost { + get { return (MvcTextTemplateHost)Host; } + } + + public class ModelProperty + { + public string Name { get; set; } + public bool IsPrimaryKey { get; set; } + + public ModelProperty(PropertyInfo propertyInfo) + { + this.Name = propertyInfo.Name; + this.IsPrimaryKey = IsPrimaryKeyProperty(propertyInfo); + } + + bool IsPrimaryKeyProperty(PropertyInfo propertyInfo) + { + return + IsIdProperty(propertyInfo) || + IsIdPropertyPrefixedWithClassName(propertyInfo); + } + + bool IsIdProperty(PropertyInfo propertyInfo) + { + return IsMatchIgnoringCase(propertyInfo.Name, "id"); + } + + bool IsIdPropertyPrefixedWithClassName(PropertyInfo propertyInfo) + { + string prefixedIdPropertyName = propertyInfo.DeclaringType.Name + "id"; + return IsMatchIgnoringCase(propertyInfo.Name, prefixedIdPropertyName); + } + + static bool IsMatchIgnoringCase(string a, string b) + { + return String.Equals(a, b, StringComparison.OrdinalIgnoreCase); + } + } + + public string GetViewPageType() + { + string viewDataTypeName = MvcHost.ViewDataTypeName; + if (!String.IsNullOrEmpty(viewDataTypeName)) { + return String.Format("<{0}>", viewDataTypeName); + } + return String.Empty; + } + + List modelProperties; + + List ModelProperties { + get { + if (modelProperties == null) { + modelProperties = new List(GetModelProperties()); + } + return modelProperties; + } + } + + public IEnumerable GetModelProperties() + { + var properties = new List(); + foreach (PropertyInfo propertyInfo in MvcHost.GetViewDataTypeProperties()) { + properties.Add(new ModelProperty(propertyInfo)); + } + return properties; + } + + bool ModelHasPrimaryKey { + get { return ModelPrimaryKeyName.Length > 0; } + } + + string modelPrimaryKeyName; + + string ModelPrimaryKeyName { + get { + if (modelPrimaryKeyName == null) { + modelPrimaryKeyName = GetModelPrimaryKeyName(); + } + return modelPrimaryKeyName; + } + } + + public string GetModelPrimaryKeyName() + { + foreach (ModelProperty modelProperty in ModelProperties) { + if (modelProperty.IsPrimaryKey) { + return modelProperty.Name; + } + } + return ""; + } + + + #line default + #line hidden + } + + #line default + #line hidden + #region Base class + /// + /// Base class for this transformation + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")] + public class EditBase + { + #region Fields + private global::System.Text.StringBuilder generationEnvironmentField; + private global::System.CodeDom.Compiler.CompilerErrorCollection errorsField; + private global::System.Collections.Generic.List indentLengthsField; + private string currentIndentField = ""; + private bool endsWithNewline; + private global::System.Collections.Generic.IDictionary sessionField; + #endregion + #region Properties + /// + /// The string builder that generation-time code is using to assemble generated output + /// + protected System.Text.StringBuilder GenerationEnvironment + { + get + { + if ((this.generationEnvironmentField == null)) + { + this.generationEnvironmentField = new global::System.Text.StringBuilder(); } - return this.builder; + return this.generationEnvironmentField; } - set { - this.builder = value; + set + { + this.generationEnvironmentField = value; } } - - protected global::System.CodeDom.Compiler.CompilerErrorCollection Errors { - get { - if ((this.errors == null)) { - this.errors = new global::System.CodeDom.Compiler.CompilerErrorCollection(); + /// + /// The error collection for the generation process + /// + public System.CodeDom.Compiler.CompilerErrorCollection Errors + { + get + { + if ((this.errorsField == null)) + { + this.errorsField = new global::System.CodeDom.Compiler.CompilerErrorCollection(); } - return this.errors; - } - } - - public string CurrentIndent { - get { - return this.currentIndent; + return this.errorsField; } } - - private global::System.Collections.Generic.Stack Indents { - get { - if ((this.indents == null)) { - this.indents = new global::System.Collections.Generic.Stack(); + /// + /// A list of the lengths of each indent that was added with PushIndent + /// + private System.Collections.Generic.List indentLengths + { + get + { + if ((this.indentLengthsField == null)) + { + this.indentLengthsField = new global::System.Collections.Generic.List(); } - return this.indents; + return this.indentLengthsField; } } - - public ToStringInstanceHelper ToStringHelper { - get { - return this._toStringHelper; + /// + /// Gets the current indent we use when adding lines to the output + /// + public string CurrentIndent + { + get + { + return this.currentIndentField; } } - - public void Error(string message) { - this.Errors.Add(new global::System.CodeDom.Compiler.CompilerError(null, -1, -1, null, message)); - } - - public void Warning(string message) { - global::System.CodeDom.Compiler.CompilerError val = new global::System.CodeDom.Compiler.CompilerError(null, -1, -1, null, message); - val.IsWarning = true; - this.Errors.Add(val); - } - - public string PopIndent() { - if ((this.Indents.Count == 0)) { - return string.Empty; + /// + /// Current transformation session + /// + public virtual global::System.Collections.Generic.IDictionary Session + { + get + { + return this.sessionField; + } + set + { + this.sessionField = value; } - int lastPos = (this.currentIndent.Length - this.Indents.Pop()); - string last = this.currentIndent.Substring(lastPos); - this.currentIndent = this.currentIndent.Substring(0, lastPos); - return last; - } - - public void PushIndent(string indent) { - this.Indents.Push(indent.Length); - this.currentIndent = (this.currentIndent + indent); - } - - public void ClearIndent() { - this.currentIndent = string.Empty; - this.Indents.Clear(); } - - public void Write(string textToAppend) { - if (string.IsNullOrEmpty(textToAppend)) { + #endregion + #region Transform-time helpers + /// + /// Write text directly into the generated output + /// + public void Write(string textToAppend) + { + if (string.IsNullOrEmpty(textToAppend)) + { return; } - if ((((this.GenerationEnvironment.Length == 0) - || this.endsWithNewline) - && (this.CurrentIndent.Length > 0))) { - this.GenerationEnvironment.Append(this.CurrentIndent); + // If we're starting off, or if the previous text ended with a newline, + // we have to append the current indent first. + if (((this.GenerationEnvironment.Length == 0) + || this.endsWithNewline)) + { + this.GenerationEnvironment.Append(this.currentIndentField); + this.endsWithNewline = false; } - this.endsWithNewline = false; - char last = textToAppend[(textToAppend.Length - 1)]; - if (((last == '\n') - || (last == '\r'))) { + // Check if the current text ends with a newline + if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture)) + { this.endsWithNewline = true; } - if ((this.CurrentIndent.Length == 0)) { + // This is an optimization. If the current indent is "", then we don't have to do any + // of the more complex stuff further down. + if ((this.currentIndentField.Length == 0)) + { this.GenerationEnvironment.Append(textToAppend); return; } - int lastNewline = 0; - for (int i = 0; (i - < (textToAppend.Length - 1)); i = (i + 1)) { - char c = textToAppend[i]; - if ((c == '\r')) { - if ((textToAppend[(i + 1)] == '\n')) { - i = (i + 1); - if ((i - == (textToAppend.Length - 1))) { - goto breakLoop; - } - } - } - else { - if ((c != '\n')) { - goto continueLoop; - } - } - i = (i + 1); - int len = (i - lastNewline); - if ((len > 0)) { - this.GenerationEnvironment.Append(textToAppend, lastNewline, (i - lastNewline)); - } - this.GenerationEnvironment.Append(this.CurrentIndent); - lastNewline = i; - continueLoop: - ; - } - breakLoop: - if ((lastNewline > 0)) { - this.GenerationEnvironment.Append(textToAppend, lastNewline, (textToAppend.Length - lastNewline)); + // Everywhere there is a newline in the text, add an indent after it + textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField)); + // If the text ends with a newline, then we should strip off the indent added at the very end + // because the appropriate indent will be added when the next time Write() is called + if (this.endsWithNewline) + { + this.GenerationEnvironment.Append(textToAppend, 0, (textToAppend.Length - this.currentIndentField.Length)); } - else { + else + { this.GenerationEnvironment.Append(textToAppend); } } - - public void Write(string format, params object[] args) { - this.Write(string.Format(format, args)); - } - - public void WriteLine(string textToAppend) { + /// + /// Write text directly into the generated output + /// + public void WriteLine(string textToAppend) + { this.Write(textToAppend); this.GenerationEnvironment.AppendLine(); this.endsWithNewline = true; } - - public void WriteLine(string format, params object[] args) { - this.WriteLine(string.Format(format, args)); + /// + /// Write formatted text directly into the generated output + /// + public void Write(string format, params object[] args) + { + this.Write(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args)); } - - public class ToStringInstanceHelper { - - private global::System.IFormatProvider formatProvider = global::System.Globalization.CultureInfo.InvariantCulture; - - public global::System.IFormatProvider FormatProvider { - get { - return this.formatProvider; + /// + /// Write formatted text directly into the generated output + /// + public void WriteLine(string format, params object[] args) + { + this.WriteLine(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args)); + } + /// + /// Raise an error + /// + public void Error(string message) + { + System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError(); + error.ErrorText = message; + this.Errors.Add(error); + } + /// + /// Raise a warning + /// + public void Warning(string message) + { + System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError(); + error.ErrorText = message; + error.IsWarning = true; + this.Errors.Add(error); + } + /// + /// Increase the indent + /// + public void PushIndent(string indent) + { + if ((indent == null)) + { + throw new global::System.ArgumentNullException("indent"); + } + this.currentIndentField = (this.currentIndentField + indent); + this.indentLengths.Add(indent.Length); + } + /// + /// Remove the last indent that was added with PushIndent + /// + public string PopIndent() + { + string returnValue = ""; + if ((this.indentLengths.Count > 0)) + { + int indentLength = this.indentLengths[(this.indentLengths.Count - 1)]; + this.indentLengths.RemoveAt((this.indentLengths.Count - 1)); + if ((indentLength > 0)) + { + returnValue = this.currentIndentField.Substring((this.currentIndentField.Length - indentLength)); + this.currentIndentField = this.currentIndentField.Remove((this.currentIndentField.Length - indentLength)); + } + } + return returnValue; + } + /// + /// Remove any indentation + /// + public void ClearIndent() + { + this.indentLengths.Clear(); + this.currentIndentField = ""; + } + #endregion + #region ToString Helpers + /// + /// Utility class to produce culture-oriented representation of an object as a string. + /// + public class ToStringInstanceHelper + { + private System.IFormatProvider formatProviderField = global::System.Globalization.CultureInfo.InvariantCulture; + /// + /// Gets or sets format provider to be used by ToStringWithCulture method. + /// + public System.IFormatProvider FormatProvider + { + get + { + return this.formatProviderField ; } - set { - if ((this.formatProvider == null)) { - throw new global::System.ArgumentNullException("formatProvider"); + set + { + if ((value != null)) + { + this.formatProviderField = value; } - this.formatProvider = value; } } - - public string ToStringWithCulture(object objectToConvert) { - if ((objectToConvert == null)) { + /// + /// This is called from the compile/run appdomain to convert objects within an expression block to a string + /// + public string ToStringWithCulture(object objectToConvert) + { + if ((objectToConvert == null)) + { throw new global::System.ArgumentNullException("objectToConvert"); } - global::System.Type type = objectToConvert.GetType(); - global::System.Type iConvertibleType = typeof(global::System.IConvertible); - if (iConvertibleType.IsAssignableFrom(type)) { - return ((global::System.IConvertible)(objectToConvert)).ToString(this.formatProvider); + System.Type t = objectToConvert.GetType(); + System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] { + typeof(System.IFormatProvider)}); + if ((method == null)) + { + return objectToConvert.ToString(); } - global::System.Reflection.MethodInfo methInfo = type.GetMethod("ToString", new global::System.Type[] { - iConvertibleType}); - if ((methInfo != null)) { - return ((string)(methInfo.Invoke(objectToConvert, new object[] { - this.formatProvider}))); + else + { + return ((string)(method.Invoke(objectToConvert, new object[] { + this.formatProviderField }))); } - return objectToConvert.ToString(); } } + private ToStringInstanceHelper toStringHelperField = new ToStringInstanceHelper(); + /// + /// Helper to produce culture-oriented representation of an object as a string + /// + public ToStringInstanceHelper ToStringHelper + { + get + { + return this.toStringHelperField; + } + } + #endregion } + #endregion } diff --git a/src/AddIns/BackendBindings/AspNet.Mvc/Project/ItemTemplates/CSharp/CodeTemplates/AddView/AspxCSharp/Empty.cs b/src/AddIns/BackendBindings/AspNet.Mvc/Project/ItemTemplates/CSharp/CodeTemplates/AddView/AspxCSharp/Empty.cs index f4555be48aa..5d3a0392ec5 100644 --- a/src/AddIns/BackendBindings/AspNet.Mvc/Project/ItemTemplates/CSharp/CodeTemplates/AddView/AspxCSharp/Empty.cs +++ b/src/AddIns/BackendBindings/AspNet.Mvc/Project/ItemTemplates/CSharp/CodeTemplates/AddView/AspxCSharp/Empty.cs @@ -1,387 +1,418 @@ -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.239 -// +// Runtime Version: 17.0.0.0 +// // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // -//------------------------------------------------------------------------------ - -namespace ICSharpCode.AspNet.Mvc.AspxCSharp { +// ------------------------------------------------------------------------------ +namespace ICSharpCode.AspNet.Mvc.AspxCSharp +{ using ICSharpCode.AspNet.Mvc; using System; + /// + /// Class to produce the template output + /// - public partial class Empty : EmptyBase { - - private global::Microsoft.VisualStudio.TextTemplating.ITextTemplatingEngineHost hostValue; - - - #line 31 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Empty.tt" - - MvcTextTemplateHost MvcHost { - get { return (MvcTextTemplateHost)Host; } - } - - public string GetViewPageType() - { - string viewDataTypeName = MvcHost.ViewDataTypeName; - if (!String.IsNullOrEmpty(viewDataTypeName)) { - return String.Format("<{0}>", viewDataTypeName); - } - return String.Empty; - } - - #line default - #line hidden - - - public global::Microsoft.VisualStudio.TextTemplating.ITextTemplatingEngineHost Host { - get { - return this.hostValue; - } - set { - this.hostValue = value; - } - } - - public virtual string TransformText() { - this.GenerationEnvironment = null; - - #line 3 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Empty.tt" + #line 1 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Empty.tt" + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")] + public partial class Empty : EmptyBase + { +#line hidden + /// + /// Create the template output + /// + public virtual string TransformText() + { + + #line 3 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Empty.tt" if (MvcHost.IsPartialView) { #line default #line hidden - - #line 4 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Empty.tt" this.Write("<%@ Control Language=\"C#\" Inherits=\"System.Web.Mvc.ViewUserControl"); - #line default - #line hidden - - #line 4 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Empty.tt" - this.Write(this.ToStringHelper.ToStringWithCulture( GetViewPageType() )); + #line 4 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Empty.tt" + this.Write(this.ToStringHelper.ToStringWithCulture(GetViewPageType())); #line default #line hidden - - #line 4 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Empty.tt" this.Write("\" %>\r\n\r\n"); - #line default - #line hidden - - #line 6 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Empty.tt" + #line 6 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Empty.tt" } else if(MvcHost.IsContentPage) { #line default #line hidden - - #line 7 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Empty.tt" this.Write("<%@ Page Language=\"C#\" MasterPageFile=\""); - #line default - #line hidden - - #line 7 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Empty.tt" - this.Write(this.ToStringHelper.ToStringWithCulture( MvcHost.MasterPageFile )); + #line 7 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Empty.tt" + this.Write(this.ToStringHelper.ToStringWithCulture(MvcHost.MasterPageFile)); #line default #line hidden - - #line 7 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Empty.tt" this.Write("\" Inherits=\"System.Web.Mvc.ViewPage"); - #line default - #line hidden - - #line 7 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Empty.tt" - this.Write(this.ToStringHelper.ToStringWithCulture( GetViewPageType() )); + #line 7 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Empty.tt" + this.Write(this.ToStringHelper.ToStringWithCulture(GetViewPageType())); #line default #line hidden - - #line 7 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Empty.tt" this.Write("\" %>\r\n\r\n\r\n" + ""); - #line default - #line hidden - - #line 10 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Empty.tt" - this.Write(this.ToStringHelper.ToStringWithCulture( MvcHost.ViewName )); + #line 10 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Empty.tt" + this.Write(this.ToStringHelper.ToStringWithCulture(MvcHost.ViewName)); #line default #line hidden - - #line 10 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Empty.tt" this.Write("\r\n\r\n\r\n\r\n"); - #line default - #line hidden - - #line 16 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Empty.tt" + #line 16 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Empty.tt" } else { #line default #line hidden - - #line 17 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Empty.tt" this.Write("<%@ Page Language=\"C#\" Inherits=\"System.Web.Mvc.ViewPage"); - #line default - #line hidden - - #line 17 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Empty.tt" - this.Write(this.ToStringHelper.ToStringWithCulture( GetViewPageType() )); + #line 17 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Empty.tt" + this.Write(this.ToStringHelper.ToStringWithCulture(GetViewPageType())); #line default #line hidden - - #line 17 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Empty.tt" this.Write("\" %>\r\n\r\n\r\n\r\n\t\r\n\t\t"); - #line default - #line hidden - - #line 22 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Empty.tt" - this.Write(this.ToStringHelper.ToStringWithCulture( MvcHost.ViewName )); + #line 22 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Empty.tt" + this.Write(this.ToStringHelper.ToStringWithCulture(MvcHost.ViewName)); #line default #line hidden - - #line 22 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Empty.tt" this.Write("\r\n\t\r\n\t\r\n\t\t
\r\n\t\t\r\n\t\t
\r\n\t\r\n\r\n"); - #line default - #line hidden - - #line 30 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Empty.tt" + #line 30 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Empty.tt" } #line default #line hidden return this.GenerationEnvironment.ToString(); } - - protected virtual void Initialize() { - } - } - - public class EmptyBase { - - private global::System.Text.StringBuilder builder; - - private global::System.Collections.Generic.IDictionary session; - - private global::System.CodeDom.Compiler.CompilerErrorCollection errors; - - private string currentIndent = string.Empty; - - private global::System.Collections.Generic.Stack indents; - - private bool endsWithNewline; - - private ToStringInstanceHelper _toStringHelper = new ToStringInstanceHelper(); - - public virtual global::System.Collections.Generic.IDictionary Session { - get { - return this.session; + private global::Microsoft.VisualStudio.TextTemplating.ITextTemplatingEngineHost hostValue; + /// + /// The current host for the text templating engine + /// + public virtual global::Microsoft.VisualStudio.TextTemplating.ITextTemplatingEngineHost Host + { + get + { + return this.hostValue; } - set { - this.session = value; + set + { + this.hostValue = value; } } - public global::System.Text.StringBuilder GenerationEnvironment { - get { - if ((this.builder == null)) { - this.builder = new global::System.Text.StringBuilder(); + #line 31 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\Empty.tt" + + MvcTextTemplateHost MvcHost { + get { return (MvcTextTemplateHost)Host; } + } + + public string GetViewPageType() + { + string viewDataTypeName = MvcHost.ViewDataTypeName; + if (!String.IsNullOrEmpty(viewDataTypeName)) { + return String.Format("<{0}>", viewDataTypeName); + } + return String.Empty; + } + + + #line default + #line hidden + } + + #line default + #line hidden + #region Base class + /// + /// Base class for this transformation + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")] + public class EmptyBase + { + #region Fields + private global::System.Text.StringBuilder generationEnvironmentField; + private global::System.CodeDom.Compiler.CompilerErrorCollection errorsField; + private global::System.Collections.Generic.List indentLengthsField; + private string currentIndentField = ""; + private bool endsWithNewline; + private global::System.Collections.Generic.IDictionary sessionField; + #endregion + #region Properties + /// + /// The string builder that generation-time code is using to assemble generated output + /// + protected System.Text.StringBuilder GenerationEnvironment + { + get + { + if ((this.generationEnvironmentField == null)) + { + this.generationEnvironmentField = new global::System.Text.StringBuilder(); } - return this.builder; + return this.generationEnvironmentField; } - set { - this.builder = value; + set + { + this.generationEnvironmentField = value; } } - - protected global::System.CodeDom.Compiler.CompilerErrorCollection Errors { - get { - if ((this.errors == null)) { - this.errors = new global::System.CodeDom.Compiler.CompilerErrorCollection(); + /// + /// The error collection for the generation process + /// + public System.CodeDom.Compiler.CompilerErrorCollection Errors + { + get + { + if ((this.errorsField == null)) + { + this.errorsField = new global::System.CodeDom.Compiler.CompilerErrorCollection(); } - return this.errors; + return this.errorsField; } } - - public string CurrentIndent { - get { - return this.currentIndent; - } - } - - private global::System.Collections.Generic.Stack Indents { - get { - if ((this.indents == null)) { - this.indents = new global::System.Collections.Generic.Stack(); + /// + /// A list of the lengths of each indent that was added with PushIndent + /// + private System.Collections.Generic.List indentLengths + { + get + { + if ((this.indentLengthsField == null)) + { + this.indentLengthsField = new global::System.Collections.Generic.List(); } - return this.indents; + return this.indentLengthsField; } } - - public ToStringInstanceHelper ToStringHelper { - get { - return this._toStringHelper; + /// + /// Gets the current indent we use when adding lines to the output + /// + public string CurrentIndent + { + get + { + return this.currentIndentField; } } - - public void Error(string message) { - this.Errors.Add(new global::System.CodeDom.Compiler.CompilerError(null, -1, -1, null, message)); - } - - public void Warning(string message) { - global::System.CodeDom.Compiler.CompilerError val = new global::System.CodeDom.Compiler.CompilerError(null, -1, -1, null, message); - val.IsWarning = true; - this.Errors.Add(val); - } - - public string PopIndent() { - if ((this.Indents.Count == 0)) { - return string.Empty; + /// + /// Current transformation session + /// + public virtual global::System.Collections.Generic.IDictionary Session + { + get + { + return this.sessionField; + } + set + { + this.sessionField = value; } - int lastPos = (this.currentIndent.Length - this.Indents.Pop()); - string last = this.currentIndent.Substring(lastPos); - this.currentIndent = this.currentIndent.Substring(0, lastPos); - return last; - } - - public void PushIndent(string indent) { - this.Indents.Push(indent.Length); - this.currentIndent = (this.currentIndent + indent); - } - - public void ClearIndent() { - this.currentIndent = string.Empty; - this.Indents.Clear(); } - - public void Write(string textToAppend) { - if (string.IsNullOrEmpty(textToAppend)) { + #endregion + #region Transform-time helpers + /// + /// Write text directly into the generated output + /// + public void Write(string textToAppend) + { + if (string.IsNullOrEmpty(textToAppend)) + { return; } - if ((((this.GenerationEnvironment.Length == 0) - || this.endsWithNewline) - && (this.CurrentIndent.Length > 0))) { - this.GenerationEnvironment.Append(this.CurrentIndent); + // If we're starting off, or if the previous text ended with a newline, + // we have to append the current indent first. + if (((this.GenerationEnvironment.Length == 0) + || this.endsWithNewline)) + { + this.GenerationEnvironment.Append(this.currentIndentField); + this.endsWithNewline = false; } - this.endsWithNewline = false; - char last = textToAppend[(textToAppend.Length - 1)]; - if (((last == '\n') - || (last == '\r'))) { + // Check if the current text ends with a newline + if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture)) + { this.endsWithNewline = true; } - if ((this.CurrentIndent.Length == 0)) { + // This is an optimization. If the current indent is "", then we don't have to do any + // of the more complex stuff further down. + if ((this.currentIndentField.Length == 0)) + { this.GenerationEnvironment.Append(textToAppend); return; } - int lastNewline = 0; - for (int i = 0; (i - < (textToAppend.Length - 1)); i = (i + 1)) { - char c = textToAppend[i]; - if ((c == '\r')) { - if ((textToAppend[(i + 1)] == '\n')) { - i = (i + 1); - if ((i - == (textToAppend.Length - 1))) { - goto breakLoop; - } - } - } - else { - if ((c != '\n')) { - goto continueLoop; - } - } - i = (i + 1); - int len = (i - lastNewline); - if ((len > 0)) { - this.GenerationEnvironment.Append(textToAppend, lastNewline, (i - lastNewline)); - } - this.GenerationEnvironment.Append(this.CurrentIndent); - lastNewline = i; - continueLoop: - ; + // Everywhere there is a newline in the text, add an indent after it + textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField)); + // If the text ends with a newline, then we should strip off the indent added at the very end + // because the appropriate indent will be added when the next time Write() is called + if (this.endsWithNewline) + { + this.GenerationEnvironment.Append(textToAppend, 0, (textToAppend.Length - this.currentIndentField.Length)); } - breakLoop: - if ((lastNewline > 0)) { - this.GenerationEnvironment.Append(textToAppend, lastNewline, (textToAppend.Length - lastNewline)); - } - else { + else + { this.GenerationEnvironment.Append(textToAppend); } } - - public void Write(string format, params object[] args) { - this.Write(string.Format(format, args)); - } - - public void WriteLine(string textToAppend) { + /// + /// Write text directly into the generated output + /// + public void WriteLine(string textToAppend) + { this.Write(textToAppend); this.GenerationEnvironment.AppendLine(); this.endsWithNewline = true; } - - public void WriteLine(string format, params object[] args) { - this.WriteLine(string.Format(format, args)); + /// + /// Write formatted text directly into the generated output + /// + public void Write(string format, params object[] args) + { + this.Write(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args)); } - - public class ToStringInstanceHelper { - - private global::System.IFormatProvider formatProvider = global::System.Globalization.CultureInfo.InvariantCulture; - - public global::System.IFormatProvider FormatProvider { - get { - return this.formatProvider; + /// + /// Write formatted text directly into the generated output + /// + public void WriteLine(string format, params object[] args) + { + this.WriteLine(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args)); + } + /// + /// Raise an error + /// + public void Error(string message) + { + System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError(); + error.ErrorText = message; + this.Errors.Add(error); + } + /// + /// Raise a warning + /// + public void Warning(string message) + { + System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError(); + error.ErrorText = message; + error.IsWarning = true; + this.Errors.Add(error); + } + /// + /// Increase the indent + /// + public void PushIndent(string indent) + { + if ((indent == null)) + { + throw new global::System.ArgumentNullException("indent"); + } + this.currentIndentField = (this.currentIndentField + indent); + this.indentLengths.Add(indent.Length); + } + /// + /// Remove the last indent that was added with PushIndent + /// + public string PopIndent() + { + string returnValue = ""; + if ((this.indentLengths.Count > 0)) + { + int indentLength = this.indentLengths[(this.indentLengths.Count - 1)]; + this.indentLengths.RemoveAt((this.indentLengths.Count - 1)); + if ((indentLength > 0)) + { + returnValue = this.currentIndentField.Substring((this.currentIndentField.Length - indentLength)); + this.currentIndentField = this.currentIndentField.Remove((this.currentIndentField.Length - indentLength)); } - set { - if ((this.formatProvider == null)) { - throw new global::System.ArgumentNullException("formatProvider"); + } + return returnValue; + } + /// + /// Remove any indentation + /// + public void ClearIndent() + { + this.indentLengths.Clear(); + this.currentIndentField = ""; + } + #endregion + #region ToString Helpers + /// + /// Utility class to produce culture-oriented representation of an object as a string. + /// + public class ToStringInstanceHelper + { + private System.IFormatProvider formatProviderField = global::System.Globalization.CultureInfo.InvariantCulture; + /// + /// Gets or sets format provider to be used by ToStringWithCulture method. + /// + public System.IFormatProvider FormatProvider + { + get + { + return this.formatProviderField ; + } + set + { + if ((value != null)) + { + this.formatProviderField = value; } - this.formatProvider = value; } } - - public string ToStringWithCulture(object objectToConvert) { - if ((objectToConvert == null)) { + /// + /// This is called from the compile/run appdomain to convert objects within an expression block to a string + /// + public string ToStringWithCulture(object objectToConvert) + { + if ((objectToConvert == null)) + { throw new global::System.ArgumentNullException("objectToConvert"); } - global::System.Type type = objectToConvert.GetType(); - global::System.Type iConvertibleType = typeof(global::System.IConvertible); - if (iConvertibleType.IsAssignableFrom(type)) { - return ((global::System.IConvertible)(objectToConvert)).ToString(this.formatProvider); + System.Type t = objectToConvert.GetType(); + System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] { + typeof(System.IFormatProvider)}); + if ((method == null)) + { + return objectToConvert.ToString(); } - global::System.Reflection.MethodInfo methInfo = type.GetMethod("ToString", new global::System.Type[] { - iConvertibleType}); - if ((methInfo != null)) { - return ((string)(methInfo.Invoke(objectToConvert, new object[] { - this.formatProvider}))); + else + { + return ((string)(method.Invoke(objectToConvert, new object[] { + this.formatProviderField }))); } - return objectToConvert.ToString(); } } + private ToStringInstanceHelper toStringHelperField = new ToStringInstanceHelper(); + /// + /// Helper to produce culture-oriented representation of an object as a string + /// + public ToStringInstanceHelper ToStringHelper + { + get + { + return this.toStringHelperField; + } + } + #endregion } + #endregion } diff --git a/src/AddIns/BackendBindings/AspNet.Mvc/Project/ItemTemplates/CSharp/CodeTemplates/AddView/AspxCSharp/List.cs b/src/AddIns/BackendBindings/AspNet.Mvc/Project/ItemTemplates/CSharp/CodeTemplates/AddView/AspxCSharp/List.cs index 6c5542fe53e..ed8584d56f7 100644 --- a/src/AddIns/BackendBindings/AspNet.Mvc/Project/ItemTemplates/CSharp/CodeTemplates/AddView/AspxCSharp/List.cs +++ b/src/AddIns/BackendBindings/AspNet.Mvc/Project/ItemTemplates/CSharp/CodeTemplates/AddView/AspxCSharp/List.cs @@ -1,226 +1,85 @@ -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.239 -// +// Runtime Version: 17.0.0.0 +// // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // -//------------------------------------------------------------------------------ - -namespace ICSharpCode.AspNet.Mvc.AspxCSharp { +// ------------------------------------------------------------------------------ +namespace ICSharpCode.AspNet.Mvc.AspxCSharp +{ using ICSharpCode.AspNet.Mvc; using System.Collections.Generic; using System.Reflection; using System; + /// + /// Class to produce the template output + /// - public partial class List : ListBase { - - private global::Microsoft.VisualStudio.TextTemplating.ITextTemplatingEngineHost hostValue; - - - #line 100 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\List.tt" - - MvcTextTemplateHost MvcHost { - get { return (MvcTextTemplateHost)Host; } - } - - public class ModelProperty - { - public string Name { get; set; } - public bool IsPrimaryKey { get; set; } - - public ModelProperty(PropertyInfo propertyInfo) - { - this.Name = propertyInfo.Name; - this.IsPrimaryKey = IsPrimaryKeyProperty(propertyInfo); - } - - bool IsPrimaryKeyProperty(PropertyInfo propertyInfo) - { - return - IsIdProperty(propertyInfo) || - IsIdPropertyPrefixedWithClassName(propertyInfo); - } - - bool IsIdProperty(PropertyInfo propertyInfo) - { - return IsMatchIgnoringCase(propertyInfo.Name, "id"); - } - - bool IsIdPropertyPrefixedWithClassName(PropertyInfo propertyInfo) - { - string prefixedIdPropertyName = propertyInfo.DeclaringType.Name + "id"; - return IsMatchIgnoringCase(propertyInfo.Name, prefixedIdPropertyName); - } - - static bool IsMatchIgnoringCase(string a, string b) - { - return String.Equals(a, b, StringComparison.OrdinalIgnoreCase); - } - } - - public string GetViewPageType() - { - string viewDataTypeName = MvcHost.ViewDataTypeName; - if (!String.IsNullOrEmpty(viewDataTypeName)) { - return String.Format("<{0}>", viewDataTypeName); - } - return String.Empty; - } - - List modelProperties; - - List ModelProperties { - get { - if (modelProperties == null) { - modelProperties = new List(GetModelProperties()); - } - return modelProperties; - } - } - - public IEnumerable GetModelProperties() - { - var properties = new List(); - foreach (PropertyInfo propertyInfo in MvcHost.GetViewDataTypeProperties()) { - properties.Add(new ModelProperty(propertyInfo)); - } - return properties; - } - - bool ModelHasProperties { - get { return ModelProperties.Count > 0; } - } - - bool ModelHasPrimaryKey { - get { return ModelPrimaryKeyName.Length > 0; } - } - - string modelPrimaryKeyName; - - string ModelPrimaryKeyName { - get { - if (modelPrimaryKeyName == null) { - modelPrimaryKeyName = GetModelPrimaryKeyName(); - } - return modelPrimaryKeyName; - } - } - - public string GetModelPrimaryKeyName() - { - foreach (ModelProperty modelProperty in ModelProperties) { - if (modelProperty.IsPrimaryKey) { - return modelProperty.Name; - } - } - return ""; - } - - #line default - #line hidden - - - public global::Microsoft.VisualStudio.TextTemplating.ITextTemplatingEngineHost Host { - get { - return this.hostValue; - } - set { - this.hostValue = value; - } - } - - public virtual string TransformText() { - this.GenerationEnvironment = null; - - #line 5 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\List.tt" + #line 1 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\List.tt" + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")] + public partial class List : ListBase + { +#line hidden + /// + /// Create the template output + /// + public virtual string TransformText() + { + + #line 5 "C:\CodingCool\Code\Projects\ThirdParty\ICSharpCode\SharpDevelop\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\List.tt" if (MvcHost.IsPartialView) { #line default #line hidden - - #line 6 "D:\projects\dotnet\SharpDevelop.AspNetMvc\src\AddIns\BackendBindings\AspNet.Mvc\Project\ItemTemplates\CSharp\CodeTemplates\AddView\AspxCSharp\List.tt" this.Write("<%@ Control Language=\"C#\" Inherits=\"System.Web.Mvc.ViewUserControl
- - - - - - - +
\ No newline at end of file diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.csproj b/src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.csproj index acc35ef79a9..37b88593b06 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.csproj +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -11,7 +11,7 @@ False False OnSuccessfulBuild - v4.5 + v4.8 Library File False @@ -273,8 +273,6 @@ - - - + \ No newline at end of file diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding_ykk521nq_wpftmp.csproj b/src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding_ykk521nq_wpftmp.csproj new file mode 100644 index 00000000000..7f5c091e870 --- /dev/null +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding_ykk521nq_wpftmp.csproj @@ -0,0 +1,286 @@ + + + + Debug + AnyCPU + 8.0.50215 + 2.0 + {1F1AC7CD-D154-45BB-8EAF-804CA8055F5A} + CSharpBinding + Library + False + False + OnSuccessfulBuild + v4.8 + Library + File + False + False + Auto + 103284736 + AnyCPU + 4096 + 4 + false + + + CSharpBinding + + + true + Full + False + True + ..\..\..\..\..\AddIns\BackendBindings\CSharpBinding\ + + + false + None + True + True + ..\..\..\..\..\AddIns\BackendBindings\CSharpBinding\ + + + DEBUG + + + + + + + CSharpSemanticHighlighter.cs + + + + + + + + + + + + + + + + + + CSharpSemanticHighlighter.cs + + + + + + + + + + + + + + + CSharpFormattingEditor.xaml + Code + + + CSharpFormattingOptionPanel.xaml + Code + + + CSharpProjectFormattingOptions.xaml + Code + + + + + + + CreatePropertiesDialog.xaml + + + + + + + InsertCtorDialog.xaml + + + + + + IssueOptions.xaml + Code + + + + + + + + + + OverrideEqualsGetHashCodeMethodsDialog.xaml + + + OverrideToStringMethodDialog.xaml + + + + + + + + + + SearchForIssuesDialog.xaml + Code + + + + + + + + + + + + + + + + + BuildOptions.xaml + Code + + + + + + + + + Always + + + + Configuration\GlobalAssemblyInfo.cs + + + + + + {6C55B776-26D4-4DB3-A6AB-87E783B2F3D1} + ICSharpCode.AvalonEdit + False + + + {2A705FC6-1A9E-4941-9E47-254D79F2D9D5} + ICSharpCode.NRefactory.CSharp.Refactoring + False + + + {53DCA265-3C3C-42F9-B647-F72BA678122B} + ICSharpCode.NRefactory.CSharp + False + + + {DC393B66-92ED-4CAD-AB25-CFEF23F3D7C6} + ICSharpCode.NRefactory.Xml + False + + + {3B2A5653-EC97-4001-BB9B-D90F1AF2C371} + ICSharpCode.NRefactory + False + + + {DDE2A481-8271-4EAC-A330-8FA6A38D13D1} + ICSharpCode.TreeView + False + + + {2748AD25-9C63-4E12-877B-4DCE96FBED54} + ICSharpCode.SharpDevelop + False + + + {35CEF10F-2D4C-45F2-9DD1-161E0FEC583C} + ICSharpCode.Core + False + + + {7E4A7172-7FF5-48D0-B719-7CD959DD1AC9} + ICSharpCode.Core.Presentation + False + + + {857CA1A3-FC88-4BE0-AB6A-D1EE772AB288} + ICSharpCode.Core.WinForms + False + + + {8035765F-D51F-4A0C-A746-2FD100E19419} + ICSharpCode.SharpDevelop.Widgets + False + + + {8035765F-D51F-4A0C-A746-2FD100E19419} + ICSharpCode.SharpDevelop.Widgets + False + + + {7d7e92df-aceb-4b69-92c8-8ac7a703cd57} + FormsDesigner + False + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/AddIns/BackendBindings/CSharpBinding/Tests/CSharpBinding.Tests.csproj b/src/AddIns/BackendBindings/CSharpBinding/Tests/CSharpBinding.Tests.csproj index 8fb7b71dd25..e38f51d538e 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Tests/CSharpBinding.Tests.csproj +++ b/src/AddIns/BackendBindings/CSharpBinding/Tests/CSharpBinding.Tests.csproj @@ -1,5 +1,5 @@  - + {52006F3F-3156-45DE-89D8-C4813694FBA4} Debug @@ -7,7 +7,7 @@ Library CSharpBinding.Tests CSharpBinding.Tests - v4.5 + v4.8 Properties C:\Users\daniel\AppData\Roaming\ICSharpCode/SharpDevelop3.0\Settings.SourceAnalysis ..\..\..\..\..\bin\UnitTests\ diff --git a/src/AddIns/BackendBindings/CppBinding/CppBinding/CppBinding.csproj b/src/AddIns/BackendBindings/CppBinding/CppBinding/CppBinding.csproj index ecc333f3155..88aa45c7c07 100644 --- a/src/AddIns/BackendBindings/CppBinding/CppBinding/CppBinding.csproj +++ b/src/AddIns/BackendBindings/CppBinding/CppBinding/CppBinding.csproj @@ -1,12 +1,12 @@  - + {70966F84-74C9-4067-A379-0C674A929233} Debug AnyCPU Library CppBinding - v4.5 + v4.8 C:\Users\trecio\AppData\Roaming\ICSharpCode/SharpDevelop3.0\Settings.SourceAnalysis diff --git a/src/AddIns/BackendBindings/FSharpBinding/FSharpBinding.csproj b/src/AddIns/BackendBindings/FSharpBinding/FSharpBinding.csproj index 4ea73552eb7..30474bd3d02 100644 --- a/src/AddIns/BackendBindings/FSharpBinding/FSharpBinding.csproj +++ b/src/AddIns/BackendBindings/FSharpBinding/FSharpBinding.csproj @@ -1,5 +1,5 @@  - + {E954F3CB-A446-492F-A664-2B376EBC86E8} Debug @@ -7,7 +7,7 @@ Library FSharpBinding FSharpBinding - v4.5 + v4.8 Properties C:\Users\Daniel\AppData\Roaming\ICSharpCode/SharpDevelop3.0\Settings.SourceAnalysis False diff --git a/src/AddIns/BackendBindings/Scripting/Project/ICSharpCode.Scripting.csproj b/src/AddIns/BackendBindings/Scripting/Project/ICSharpCode.Scripting.csproj index 2691f0ce363..9627c769217 100644 --- a/src/AddIns/BackendBindings/Scripting/Project/ICSharpCode.Scripting.csproj +++ b/src/AddIns/BackendBindings/Scripting/Project/ICSharpCode.Scripting.csproj @@ -1,5 +1,5 @@  - + {7048AE18-EB93-4A84-82D0-DD60EB58ADBD} Debug @@ -7,7 +7,7 @@ Library ICSharpCode.Scripting ICSharpCode.Scripting - v4.5 + v4.8 False False 4 @@ -58,10 +58,7 @@ 3.0 - - - - + Configuration\GlobalAssemblyInfo.cs diff --git a/src/AddIns/BackendBindings/Scripting/Test/ICSharpCode.Scripting.Tests.csproj b/src/AddIns/BackendBindings/Scripting/Test/ICSharpCode.Scripting.Tests.csproj index 5c98ff5fca4..8da839c2be4 100644 --- a/src/AddIns/BackendBindings/Scripting/Test/ICSharpCode.Scripting.Tests.csproj +++ b/src/AddIns/BackendBindings/Scripting/Test/ICSharpCode.Scripting.Tests.csproj @@ -1,5 +1,5 @@  - + {85C09AD8-183B-403A-869A-7226646218A9} Debug @@ -7,7 +7,7 @@ Library ICSharpCode.Scripting.Tests ICSharpCode.Scripting.Tests - v4.5 + v4.8 False False 4 @@ -62,15 +62,7 @@ 3.0 - - - - - - - - - + @@ -122,10 +114,16 @@ - + + UserControl + - - + + Component + + + UserControl + @@ -164,8 +162,12 @@ - - + + UserControl + + + UserControl + diff --git a/src/AddIns/BackendBindings/TypeScript/Project/TypeScriptBinding.csproj b/src/AddIns/BackendBindings/TypeScript/Project/TypeScriptBinding.csproj index 9d4b7a9de6b..d4fbbd2dc1a 100644 --- a/src/AddIns/BackendBindings/TypeScript/Project/TypeScriptBinding.csproj +++ b/src/AddIns/BackendBindings/TypeScript/Project/TypeScriptBinding.csproj @@ -1,5 +1,5 @@  - + {94BBCA55-A20E-4782-93B0-3566D185F7C1} Debug @@ -7,7 +7,7 @@ Library ICSharpCode.TypeScriptBinding TypeScriptBinding - v4.5 + v4.8 Properties False False @@ -261,8 +261,6 @@ False - - - + \ No newline at end of file diff --git a/src/AddIns/BackendBindings/TypeScript/Test/TypeScriptBinding.Tests.csproj b/src/AddIns/BackendBindings/TypeScript/Test/TypeScriptBinding.Tests.csproj index bd72f6cc090..8ff1f1e3349 100644 --- a/src/AddIns/BackendBindings/TypeScript/Test/TypeScriptBinding.Tests.csproj +++ b/src/AddIns/BackendBindings/TypeScript/Test/TypeScriptBinding.Tests.csproj @@ -1,5 +1,5 @@  - + {6F22CECC-2ABA-4D5D-A3F8-1C4F4A46C915} Debug @@ -7,7 +7,7 @@ Library TypeScriptBinding.Tests TypeScriptBinding.Tests - v4.5 + v4.8 Properties False False @@ -104,10 +104,6 @@ typescriptServices.js - - - - - + \ No newline at end of file diff --git a/src/AddIns/BackendBindings/VBBinding/Project/VBBinding.vbproj b/src/AddIns/BackendBindings/VBBinding/Project/VBBinding.vbproj index 83c4875c0c6..3687215a63d 100644 --- a/src/AddIns/BackendBindings/VBBinding/Project/VBBinding.vbproj +++ b/src/AddIns/BackendBindings/VBBinding/Project/VBBinding.vbproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -11,7 +11,7 @@ 4 False False - v4.5 + v4.8 OnSuccessfulBuild Library File @@ -65,9 +65,6 @@ - - Configuration\GlobalAssemblyInfo.vb - @@ -116,7 +113,7 @@ - + diff --git a/src/AddIns/BackendBindings/WixBinding/Project/WixBinding.csproj b/src/AddIns/BackendBindings/WixBinding/Project/WixBinding.csproj index b06fa68c2ef..a181c0415e7 100644 --- a/src/AddIns/BackendBindings/WixBinding/Project/WixBinding.csproj +++ b/src/AddIns/BackendBindings/WixBinding/Project/WixBinding.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -11,7 +11,7 @@ Library 4 False - v4.5 + v4.8 False OnSuccessfulBuild False @@ -90,16 +90,24 @@ - + + UserControl + Configuration\GlobalAssemblyInfo.cs - + + UserControl + - - + + UserControl + + + UserControl + @@ -152,7 +160,9 @@ - + + UserControl + @@ -164,8 +174,12 @@ - - + + Component + + + Component + @@ -177,14 +191,18 @@ - + + Component + - + + UserControl + diff --git a/src/AddIns/BackendBindings/WixBinding/Test/WixBinding.Tests.csproj b/src/AddIns/BackendBindings/WixBinding/Test/WixBinding.Tests.csproj index 943b10c1c1d..7c67cdfaf25 100644 --- a/src/AddIns/BackendBindings/WixBinding/Test/WixBinding.Tests.csproj +++ b/src/AddIns/BackendBindings/WixBinding/Test/WixBinding.Tests.csproj @@ -1,5 +1,5 @@  - + Library WixBinding.Tests @@ -16,7 +16,7 @@ 4096 4 false - v4.5 + v4.8 @@ -113,7 +113,9 @@ - + + Component + @@ -309,7 +311,6 @@ - {6C55B776-26D4-4DB3-A6AB-87E783B2F3D1} ICSharpCode.AvalonEdit @@ -348,16 +349,6 @@ FormsDesigner.dll Always --> - - - - - - - - - - {8035765F-D51F-4A0C-A746-2FD100E19419} ICSharpCode.SharpDevelop.Widgets diff --git a/src/AddIns/BackendBindings/XamlBinding/XamlBinding.Tests/XamlBinding.Tests.csproj b/src/AddIns/BackendBindings/XamlBinding/XamlBinding.Tests/XamlBinding.Tests.csproj index 8fb11dcd569..80e0ecbbb45 100644 --- a/src/AddIns/BackendBindings/XamlBinding/XamlBinding.Tests/XamlBinding.Tests.csproj +++ b/src/AddIns/BackendBindings/XamlBinding/XamlBinding.Tests/XamlBinding.Tests.csproj @@ -1,5 +1,5 @@  - + {F390DA70-1FE1-4715-81A0-389AB010C130} Debug @@ -7,7 +7,7 @@ Library ICSharpCode.XamlBinding.Tests ICSharpCode.XamlBinding.Tests - v4.5 + v4.8 Properties ..\..\..\..\..\bin\UnitTests\ False diff --git a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlBinding.csproj b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlBinding.csproj index b42dc3f77d3..7dcf08337e1 100644 --- a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlBinding.csproj +++ b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlBinding.csproj @@ -1,5 +1,5 @@  - + {7C96B65D-28A5-4F28-A35B-8D83CE831EE8} Debug @@ -13,7 +13,7 @@ 4 false C:\Users\Daniel\AppData\Roaming\ICSharpCode/SharpDevelop3.0\Settings.SourceAnalysis - v4.5 + v4.8 @@ -171,9 +171,7 @@ False - - - + diff --git a/src/AddIns/Debugger/Debugger.AddIn/Debugger.AddIn.csproj b/src/AddIns/Debugger/Debugger.AddIn/Debugger.AddIn.csproj index 1815ee4e710..d350898b2ba 100644 --- a/src/AddIns/Debugger/Debugger.AddIn/Debugger.AddIn.csproj +++ b/src/AddIns/Debugger/Debugger.AddIn/Debugger.AddIn.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -20,7 +20,7 @@ 4096 false Always - v4.5 + v4.8 "C:\Program Files\SharpDevelop\3.0\bin\..\AddIns\AddIns\Misc\SourceAnalysis\Settings.SourceAnalysis" C:\Dokumente und Einstellungen\HP\Anwendungsdaten\ICSharpCode/SharpDevelop3.0\Settings.SourceAnalysis http://localhost/Debugger.AddIn/ @@ -302,26 +302,6 @@ - - - - - - - - - - - - - - - - - - - - @@ -342,7 +322,6 @@ ICSharpCode.Core.WinForms False - diff --git a/src/AddIns/Debugger/Debugger.AddIn/NRefactory/ExpressionEvaluationVisitor.cs b/src/AddIns/Debugger/Debugger.AddIn/NRefactory/ExpressionEvaluationVisitor.cs index 1e534faede3..2061a8c5ddd 100644 --- a/src/AddIns/Debugger/Debugger.AddIn/NRefactory/ExpressionEvaluationVisitor.cs +++ b/src/AddIns/Debugger/Debugger.AddIn/NRefactory/ExpressionEvaluationVisitor.cs @@ -497,7 +497,7 @@ public static string FormatValue(Thread evalThread, Value val) } sb.Append("}"); } else { - sb.AppendFormat(" ({0} elements)", count); + sb.Append($" ({count} elements)"); } return sb.ToString(); } diff --git a/src/AddIns/Debugger/Debugger.Core/Debugger.Core.csproj b/src/AddIns/Debugger/Debugger.Core/Debugger.Core.csproj index 82e5a671a85..cb351136d40 100644 --- a/src/AddIns/Debugger/Debugger.Core/Debugger.Core.csproj +++ b/src/AddIns/Debugger/Debugger.Core/Debugger.Core.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -36,7 +36,7 @@ true false true - v4.5 + v4.8 @@ -122,9 +122,7 @@ false - - - + {D68133BD-1E63-496E-9EDE-4FBDBF77B486} diff --git a/src/AddIns/Debugger/Debugger.Core/TypeSystemExtensions.cs b/src/AddIns/Debugger/Debugger.Core/TypeSystemExtensions.cs index 75b0441eef1..9ffd7f0a556 100644 --- a/src/AddIns/Debugger/Debugger.Core/TypeSystemExtensions.cs +++ b/src/AddIns/Debugger/Debugger.Core/TypeSystemExtensions.cs @@ -129,6 +129,11 @@ public IUnresolvedMethod GetMethodFromToken(uint functionToken) // used to prevent Cecil from loading referenced assemblies sealed class DummyAssemblyResolver : Mono.Cecil.IAssemblyResolver { + public void Dispose() + { + + } + public Mono.Cecil.AssemblyDefinition Resolve(Mono.Cecil.AssemblyNameReference name) { return null; diff --git a/src/AddIns/Debugger/Debugger.Tests/Debugger.Tests.csproj b/src/AddIns/Debugger/Debugger.Tests/Debugger.Tests.csproj index c1929bd72da..c4abf7f4421 100644 --- a/src/AddIns/Debugger/Debugger.Tests/Debugger.Tests.csproj +++ b/src/AddIns/Debugger/Debugger.Tests/Debugger.Tests.csproj @@ -1,5 +1,5 @@  - + Library Debugger.Tests @@ -22,7 +22,7 @@ 4096 true 219,414 - v4.5 + v4.8 @@ -74,7 +74,6 @@ - {53DCA265-3C3C-42F9-B647-F72BA678122B} ICSharpCode.NRefactory.CSharp diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/AvalonEdit.AddIn.csproj b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/AvalonEdit.AddIn.csproj index 4fa4a0c07ee..2b0e8ef0d76 100644 --- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/AvalonEdit.AddIn.csproj +++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/AvalonEdit.AddIn.csproj @@ -1,5 +1,5 @@  - + {0162E499-42D0-409B-AA25-EED21F75336B} Debug @@ -7,7 +7,7 @@ Library ICSharpCode.AvalonEdit.AddIn ICSharpCode.AvalonEdit.AddIn - v4.5 + v4.8 C:\Users\Daniel\AppData\Roaming\ICSharpCode/SharpDevelop3.0\Settings.SourceAnalysis ..\..\..\..\AddIns\DisplayBindings\AvalonEdit\ False @@ -16,6 +16,7 @@ false False -Microsoft.Design#CA1014;-Microsoft.Design#CA2210 + true @@ -270,10 +271,5 @@ False - - - - - - + \ No newline at end of file diff --git a/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.Addin/ICSharpCode.Data.Addin.csproj b/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.Addin/ICSharpCode.Data.Addin.csproj index 44a746eac04..25ab8f82afa 100644 --- a/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.Addin/ICSharpCode.Data.Addin.csproj +++ b/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.Addin/ICSharpCode.Data.Addin.csproj @@ -1,5 +1,5 @@  - + {A9F12710-24E4-46D4-832C-6ECB395B9EAD} Debug @@ -7,7 +7,7 @@ Library ICSharpCode.Data.Addin ICSharpCode.Data.Addin - v4.5 + v4.8 C:\Users\Phil\AppData\Roaming\ICSharpCode/SharpDevelop3.0\Settings.SourceAnalysis @@ -110,9 +110,7 @@ AnyCPU 4096 - - - + False diff --git a/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.Core.UI/ICSharpCode.Data.Core.UI.csproj b/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.Core.UI/ICSharpCode.Data.Core.UI.csproj index cbee9526c5e..8c13c0ab5dd 100644 --- a/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.Core.UI/ICSharpCode.Data.Core.UI.csproj +++ b/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.Core.UI/ICSharpCode.Data.Core.UI.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -10,7 +10,7 @@ Properties ICSharpCode.Data.Core.UI ICSharpCode.Data.Core.UI - v4.5 + v4.8 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 diff --git a/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.Core.UI/Properties/Resources.Designer.cs b/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.Core.UI/Properties/Resources.Designer.cs index a89c1673df9..8aaa032ef52 100644 --- a/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.Core.UI/Properties/Resources.Designer.cs +++ b/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.Core.UI/Properties/Resources.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.20506.1 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -19,7 +19,7 @@ namespace ICSharpCode.Data.Core.UI.Properties { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { diff --git a/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.Core.UI/Properties/Settings.Designer.cs b/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.Core.UI/Properties/Settings.Designer.cs index 60f9d209c95..60d5405ec44 100644 --- a/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.Core.UI/Properties/Settings.Designer.cs +++ b/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.Core.UI/Properties/Settings.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.20506.1 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -12,7 +12,7 @@ namespace ICSharpCode.Data.Core.UI.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.4.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); diff --git a/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.Core/ICSharpCode.Data.Core.csproj b/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.Core/ICSharpCode.Data.Core.csproj index 05371f1a2bc..e950c4613c4 100644 --- a/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.Core/ICSharpCode.Data.Core.csproj +++ b/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.Core/ICSharpCode.Data.Core.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -10,7 +10,7 @@ Properties ICSharpCode.Data.Core ICSharpCode.Data.Core - v4.5 + v4.8 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 diff --git a/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.Core/Properties/Resources.Designer.cs b/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.Core/Properties/Resources.Designer.cs index 36e280cdd0b..e68495b49cc 100644 --- a/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.Core/Properties/Resources.Designer.cs +++ b/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.Core/Properties/Resources.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.20506.1 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -19,7 +19,7 @@ namespace ICSharpCode.Data.Core.Properties { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { diff --git a/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.Core/Properties/Settings.Designer.cs b/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.Core/Properties/Settings.Designer.cs index edf9f798f74..24fc5f5f89d 100644 --- a/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.Core/Properties/Settings.Designer.cs +++ b/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.Core/Properties/Settings.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.20506.1 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -12,7 +12,7 @@ namespace ICSharpCode.Data.Core.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.4.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); diff --git a/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.EDMDesigner.Core.UI/ICSharpCode.Data.EDMDesigner.Core.UI.csproj b/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.EDMDesigner.Core.UI/ICSharpCode.Data.EDMDesigner.Core.UI.csproj index bb132fcbef1..c3c9067300d 100644 --- a/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.EDMDesigner.Core.UI/ICSharpCode.Data.EDMDesigner.Core.UI.csproj +++ b/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.EDMDesigner.Core.UI/ICSharpCode.Data.EDMDesigner.Core.UI.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -10,7 +10,7 @@ Properties ICSharpCode.Data.EDMDesigner.Core.UI ICSharpCode.Data.EDMDesigner.Core.UI - v4.5 + v4.8 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 diff --git a/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.EDMDesigner.Core.UI/Properties/Resources.Designer.cs b/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.EDMDesigner.Core.UI/Properties/Resources.Designer.cs index 44a6fe09f14..987e04d092d 100644 --- a/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.EDMDesigner.Core.UI/Properties/Resources.Designer.cs +++ b/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.EDMDesigner.Core.UI/Properties/Resources.Designer.cs @@ -1,17 +1,17 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.20506.1 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ -namespace ICSharpCode.Data.EDMDesigner.Core.UI.Properties -{ - - +namespace ICSharpCode.Data.EDMDesigner.Core.UI.Properties { + using System; + + /// /// A strongly-typed resource class, for looking up localized strings, etc. /// @@ -19,51 +19,43 @@ namespace ICSharpCode.Data.EDMDesigner.Core.UI.Properties // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources - { - + internal class Resources { + private static global::System.Resources.ResourceManager resourceMan; - + private static global::System.Globalization.CultureInfo resourceCulture; - + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() - { + internal Resources() { } - + /// /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get - { - if ((resourceMan == null)) - { + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ICSharpCode.Data.EDMDesigner.Core.UI.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } - + /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { + internal static global::System.Globalization.CultureInfo Culture { + get { return resourceCulture; } - set - { + set { resourceCulture = value; } } diff --git a/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.EDMDesigner.Core.UI/Properties/Settings.Designer.cs b/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.EDMDesigner.Core.UI/Properties/Settings.Designer.cs index 8088af29f2b..facc27aa248 100644 --- a/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.EDMDesigner.Core.UI/Properties/Settings.Designer.cs +++ b/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.EDMDesigner.Core.UI/Properties/Settings.Designer.cs @@ -1,28 +1,24 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.20506.1 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ -namespace ICSharpCode.Data.EDMDesigner.Core.UI.Properties -{ - - +namespace ICSharpCode.Data.EDMDesigner.Core.UI.Properties { + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.4.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { + + public static Settings Default { + get { return defaultInstance; } } diff --git a/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.EDMDesigner.Core/ICSharpCode.Data.EDMDesigner.Core.csproj b/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.EDMDesigner.Core/ICSharpCode.Data.EDMDesigner.Core.csproj index 5c05a289eee..779b788c69a 100644 --- a/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.EDMDesigner.Core/ICSharpCode.Data.EDMDesigner.Core.csproj +++ b/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.EDMDesigner.Core/ICSharpCode.Data.EDMDesigner.Core.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -10,7 +10,7 @@ Properties ICSharpCode.Data.EDMDesigner.Core ICSharpCode.Data.EDMDesigner.Core - v4.5 + v4.8 512 AnyCPU False diff --git a/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.SQLServer/ICSharpCode.Data.SQLServer.csproj b/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.SQLServer/ICSharpCode.Data.SQLServer.csproj index b4acc20975f..2d93fe244a8 100644 --- a/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.SQLServer/ICSharpCode.Data.SQLServer.csproj +++ b/src/AddIns/DisplayBindings/Data/ICSharpCode.Data.SQLServer/ICSharpCode.Data.SQLServer.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -10,7 +10,7 @@ Properties ICSharpCode.Data.SQLServer ICSharpCode.Data.SQLServer - v4.5 + v4.8 512 diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/FormsDesigner.csproj b/src/AddIns/DisplayBindings/FormsDesigner/Project/FormsDesigner.csproj index 366aa3a811e..a26581be282 100644 --- a/src/AddIns/DisplayBindings/FormsDesigner/Project/FormsDesigner.csproj +++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/FormsDesigner.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -22,7 +22,7 @@ ..\..\..\..\..\AddIns\DisplayBindings\FormsDesigner\ 108003328 4096 - v4.5 + v4.8 True ..\..\..\..\Main\ICSharpCode.SharpDevelop.snk False @@ -82,7 +82,9 @@ - + + Form + ImageResourceEditorDialog.cs diff --git a/src/AddIns/DisplayBindings/HexEditor/Project/HexEditor.csproj b/src/AddIns/DisplayBindings/HexEditor/Project/HexEditor.csproj index 725f4393f34..7242a47b87b 100644 --- a/src/AddIns/DisplayBindings/HexEditor/Project/HexEditor.csproj +++ b/src/AddIns/DisplayBindings/HexEditor/Project/HexEditor.csproj @@ -1,5 +1,5 @@  - + {E618A9CD-A39F-4925-A538-E8A3FEF24E54} Debug @@ -15,7 +15,7 @@ False OnBuildSuccess False - v4.5 + v4.8 @@ -146,9 +146,7 @@ False - - - + diff --git a/src/AddIns/DisplayBindings/ILSpyAddIn/DebuggerTextOutput.cs b/src/AddIns/DisplayBindings/ILSpyAddIn/DebuggerTextOutput.cs index f104c92955a..f4195774716 100644 --- a/src/AddIns/DisplayBindings/ILSpyAddIn/DebuggerTextOutput.cs +++ b/src/AddIns/DisplayBindings/ILSpyAddIn/DebuggerTextOutput.cs @@ -19,8 +19,8 @@ using System; using System.Collections.Generic; using System.Linq; -using ICSharpCode.Decompiler; -using ICSharpCode.Decompiler.ILAst; +//using ICSharpCode.Decompiler; +//using ICSharpCode.Decompiler.ILAst; using ICSharpCode.NRefactory.CSharp; using Mono.Cecil; @@ -28,9 +28,9 @@ namespace ICSharpCode.ILSpyAddIn { public sealed class DebugInfoTokenWriterDecorator : DecoratingTokenWriter { - readonly Stack symbolsStack = new Stack(); + //readonly Stack symbolsStack = new Stack(); - public readonly Dictionary DebugSymbols = new Dictionary(); + //public readonly Dictionary DebugSymbols = new Dictionary(); public readonly Dictionary MemberLocations = new Dictionary(); public DebugInfoTokenWriterDecorator(TokenWriter writer) @@ -41,36 +41,36 @@ public DebugInfoTokenWriterDecorator(TokenWriter writer) public override void StartNode(AstNode node) { base.StartNode(node); - if (node.Annotation() != null) { - symbolsStack.Push(node.Annotation()); - } + //if (node.Annotation() != null) { + // symbolsStack.Push(node.Annotation()); + //} } public override void EndNode(AstNode node) { base.EndNode(node); if (node is EntityDeclaration && node.Annotation() != null) { - MemberLocations[XmlDocKeyProvider.GetKey(node.Annotation())] = node.StartLocation; + //MemberLocations[XmlDocKeyProvider.GetKey(node.Annotation())] = node.StartLocation; } // code mappings - var ranges = node.Annotation>(); - if (symbolsStack.Count > 0 && ranges != null && ranges.Count > 0) { - symbolsStack.Peek().SequencePoints.Add( - new SequencePoint() { - ILRanges = ILRange.OrderAndJoin(ranges).ToArray(), - StartLocation = node.StartLocation, - EndLocation = node.EndLocation - }); - } + //var ranges = node.Annotation>(); + //if (symbolsStack.Count > 0 && ranges != null && ranges.Count > 0) { + // symbolsStack.Peek().SequencePoints.Add( + // new SequencePoint() { + // ILRanges = ILRange.OrderAndJoin(ranges).ToArray(), + // StartLocation = node.StartLocation, + // EndLocation = node.EndLocation + // }); + //} - if (node.Annotation() != null) { - var symbols = symbolsStack.Pop(); - symbols.SequencePoints = symbols.SequencePoints.OrderBy(s => s.ILOffset).ToList(); - symbols.StartLocation = node.StartLocation; - symbols.EndLocation = node.EndLocation; - DebugSymbols[XmlDocKeyProvider.GetKey(symbols.CecilMethod)] = symbols; - } + //if (node.Annotation() != null) { + // var symbols = symbolsStack.Pop(); + // symbols.SequencePoints = symbols.SequencePoints.OrderBy(s => s.ILOffset).ToList(); + // symbols.StartLocation = node.StartLocation; + // symbols.EndLocation = node.EndLocation; + // DebugSymbols[XmlDocKeyProvider.GetKey(symbols.CecilMethod)] = symbols; + //} } } } diff --git a/src/AddIns/DisplayBindings/ILSpyAddIn/DecompiledViewContent.cs b/src/AddIns/DisplayBindings/ILSpyAddIn/DecompiledViewContent.cs index e31cc7b045a..c7e6cba09e7 100644 --- a/src/AddIns/DisplayBindings/ILSpyAddIn/DecompiledViewContent.cs +++ b/src/AddIns/DisplayBindings/ILSpyAddIn/DecompiledViewContent.cs @@ -26,7 +26,7 @@ using ICSharpCode.AvalonEdit.AddIn; using ICSharpCode.AvalonEdit.Highlighting; using ICSharpCode.Core; -using ICSharpCode.Decompiler; +//using ICSharpCode.Decompiler; using ICSharpCode.SharpDevelop.Gui; using ICSharpCode.ILSpyAddIn; using ICSharpCode.NRefactory; @@ -54,7 +54,7 @@ class DecompiledViewContent : AbstractViewContentWithoutFile, IPositionable readonly CancellationTokenSource cancellation = new CancellationTokenSource(); Dictionary memberLocations; - public Dictionary DebugSymbols { get; private set; } + //public Dictionary DebugSymbols { get; private set; } #region Constructor public DecompiledViewContent(DecompiledTypeReference typeName, string entityTag) @@ -147,7 +147,7 @@ async void InitializeView() if (parseInformation == null || !(parseInformation.UnresolvedFile is ILSpyUnresolvedFile)) return; var file = (ILSpyUnresolvedFile)parseInformation.UnresolvedFile; memberLocations = file.MemberLocations; - DebugSymbols = file.DebugSymbols; + //DebugSymbols = file.DebugSymbols; OnDecompilationFinished(file.Output); } catch (OperationCanceledException) { // ignore cancellation diff --git a/src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyAddIn.csproj b/src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyAddIn.csproj index 807d57d5be4..adf7fea93c0 100644 --- a/src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyAddIn.csproj +++ b/src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyAddIn.csproj @@ -1,5 +1,5 @@  - + {8AA421C8-D7AF-4957-9F43-5135328ACB24} Debug @@ -7,7 +7,7 @@ Library ICSharpCode.ILSpyAddIn ILSpyAddIn - v4.5 + v4.8 Properties ..\..\..\..\AddIns\DisplayBindings\Decompiler\ False @@ -53,6 +53,7 @@ + 4.0 @@ -96,10 +97,6 @@ ICSharpCode.AvalonEdit False - - {984CC812-9470-4A13-AFF9-CC44068D666C} - ICSharpCode.Decompiler - {D68133BD-1E63-496E-9EDE-4FBDBF77B486} Mono.Cecil @@ -141,5 +138,9 @@ False - + + + 8.0.0.7345 + + \ No newline at end of file diff --git a/src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyDecompilerService.cs b/src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyDecompilerService.cs index 347678040e4..699fe3b466b 100644 --- a/src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyDecompilerService.cs +++ b/src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyDecompilerService.cs @@ -25,8 +25,10 @@ using System.Threading.Tasks; using ICSharpCode.Core; -using ICSharpCode.Decompiler; -using ICSharpCode.Decompiler.Ast; +using ICSharpCode.Decompiler.CSharp; +using ICSharpCode.NRefactory.CSharp; +//using ICSharpCode.Decompiler; +//using ICSharpCode.Decompiler.Ast; using ICSharpCode.NRefactory.TypeSystem; using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop.Parser; @@ -128,32 +130,42 @@ public AssemblyDefinition Resolve(string fullName, ReaderParameters parameters) { return Resolve(new DomAssemblyName(fullName), parameters); } - } + + public void Dispose() + { + + } + } public static ILSpyFullParseInformation DecompileType(DecompiledTypeReference name, CancellationToken cancellationToken = default(CancellationToken)) { if (name == null) throw new ArgumentNullException("name"); - using (DebugTimer.Time("DecompileType: " + name.ToFileName())) { - var astBuilder = CreateAstBuilder(name, cancellationToken); - return new ILSpyFullParseInformation(ILSpyUnresolvedFile.Create(name, astBuilder), null, astBuilder.SyntaxTree); - } + //using (DebugTimer.Time("DecompileType: " + name.ToFileName())) { + // var astBuilder = CreateAstBuilder(name, cancellationToken); + // return new ILSpyFullParseInformation(ILSpyUnresolvedFile.Create(name, astBuilder), null, astBuilder.SyntaxTree); + //} + ModuleDefinition module = GetModuleDefinitionFromCache(name.AssemblyFile); + var decompiler = new CSharpDecompiler(module.FileName, new Decompiler.DecompilerSettings()); + var results = decompiler.DecompileType(new Decompiler.TypeSystem.FullTypeName(new Decompiler.TypeSystem.TopLevelTypeName(name.Type.Namespace, name.Type.Name, name.Type.TypeParameterCount))); + var tree = SyntaxTree.Parse(results.ToString()); + return new ILSpyFullParseInformation(ILSpyUnresolvedFile.Create(name, tree), null, tree); } - static AstBuilder CreateAstBuilder(DecompiledTypeReference name, CancellationToken cancellationToken = default(CancellationToken)) - { - ModuleDefinition module = GetModuleDefinitionFromCache(name.AssemblyFile); - if (module == null) - throw new InvalidOperationException("Could not find assembly file"); - TypeDefinition typeDefinition = module.GetType(name.Type.ReflectionName); - if (typeDefinition == null) - throw new InvalidOperationException("Could not find type"); - DecompilerContext context = new DecompilerContext(module); - context.CancellationToken = cancellationToken; - AstBuilder astBuilder = new AstBuilder(context); - astBuilder.AddType(typeDefinition); - return astBuilder; - } + //static AstBuilder CreateAstBuilder(DecompiledTypeReference name, CancellationToken cancellationToken = default(CancellationToken)) + //{ + // ModuleDefinition module = GetModuleDefinitionFromCache(name.AssemblyFile); + // if (module == null) + // throw new InvalidOperationException("Could not find assembly file"); + // TypeDefinition typeDefinition = module.GetType(name.Type.ReflectionName); + // if (typeDefinition == null) + // throw new InvalidOperationException("Could not find type"); + // DecompilerContext context = new DecompilerContext(module); + // context.CancellationToken = cancellationToken; + // AstBuilder astBuilder = new AstBuilder(context); + // astBuilder.AddType(typeDefinition); + // return astBuilder; + //} } public class DecompiledTypeReference : IEquatable diff --git a/src/AddIns/DisplayBindings/ILSpyAddIn/ILSpySymbolSource.cs b/src/AddIns/DisplayBindings/ILSpyAddIn/ILSpySymbolSource.cs index 03133d7d5d1..72777aaccca 100644 --- a/src/AddIns/DisplayBindings/ILSpyAddIn/ILSpySymbolSource.cs +++ b/src/AddIns/DisplayBindings/ILSpyAddIn/ILSpySymbolSource.cs @@ -4,7 +4,7 @@ using System.Linq; using Debugger; using ICSharpCode.Core; -using ICSharpCode.Decompiler; +//using ICSharpCode.Decompiler; using ICSharpCode.NRefactory; using ICSharpCode.NRefactory.Documentation; using ICSharpCode.NRefactory.TypeSystem; @@ -35,23 +35,23 @@ public static ILSpyUnresolvedFile GetSymbols(IMethod method) public Debugger.SequencePoint GetSequencePoint(IMethod method, int iloffset) { - string id = IdStringProvider.GetIdString(method.MemberDefinition); - var file = GetSymbols(method); - if (file == null || !file.DebugSymbols.ContainsKey(id)) - return null; - var symbols = file.DebugSymbols[id]; - var seqs = symbols.SequencePoints; - var seq = seqs.FirstOrDefault(p => p.ILRanges.Any(r => r.From <= iloffset && iloffset < r.To)); - if (seq == null) - seq = seqs.FirstOrDefault(p => iloffset <= p.ILOffset); - if (seq != null) { - // Use the widest sequence point containing the IL offset - iloffset = seq.ILOffset; - seq = seqs.Where(p => p.ILRanges.Any(r => r.From <= iloffset && iloffset < r.To)) - .OrderByDescending(p => p.ILRanges.Last().To - p.ILRanges.First().From) - .FirstOrDefault(); - return seq.ToDebugger(symbols, file.FileName); - } + //string id = IdStringProvider.GetIdString(method.MemberDefinition); + //var file = GetSymbols(method); + //if (file == null || !file.DebugSymbols.ContainsKey(id)) + // return null; + //var symbols = file.DebugSymbols[id]; + //var seqs = symbols.SequencePoints; + //var seq = seqs.FirstOrDefault(p => p.ILRanges.Any(r => r.From <= iloffset && iloffset < r.To)); + //if (seq == null) + // seq = seqs.FirstOrDefault(p => iloffset <= p.ILOffset); + //if (seq != null) { + // // Use the widest sequence point containing the IL offset + // iloffset = seq.ILOffset; + // seq = seqs.Where(p => p.ILRanges.Any(r => r.From <= iloffset && iloffset < r.To)) + // .OrderByDescending(p => p.ILRanges.Last().To - p.ILRanges.First().From) + // .FirstOrDefault(); + // return seq.ToDebugger(symbols, file.FileName); + //} return null; } @@ -65,69 +65,71 @@ public Debugger.SequencePoint GetSequencePoint(IMethod method, int iloffset) if (file == null) yield break; - TextLocation loc = new TextLocation(line, column); - foreach(var symbols in file.DebugSymbols.Values.Where(s => s.StartLocation <= loc && loc <= s.EndLocation)) { - Decompiler.SequencePoint seq = null; - if (column != 0) - seq = symbols.SequencePoints.FirstOrDefault(p => p.StartLocation <= loc && loc <= p.EndLocation); - if (seq == null) - seq = symbols.SequencePoints.FirstOrDefault(p => line <= p.StartLocation.Line); - if (seq != null) - yield return seq.ToDebugger(symbols, filename); - } + //TextLocation loc = new TextLocation(line, column); + //foreach(var symbols in file.DebugSymbols.Values.Where(s => s.StartLocation <= loc && loc <= s.EndLocation)) { + // Decompiler.SequencePoint seq = null; + // if (column != 0) + // seq = symbols.SequencePoints.FirstOrDefault(p => p.StartLocation <= loc && loc <= p.EndLocation); + // if (seq == null) + // seq = symbols.SequencePoints.FirstOrDefault(p => line <= p.StartLocation.Line); + // if (seq != null) + // yield return seq.ToDebugger(symbols, filename); + //} } public IEnumerable GetIgnoredILRanges(IMethod method) { - string id = IdStringProvider.GetIdString(method.MemberDefinition); - var file = GetSymbols(method); + //string id = IdStringProvider.GetIdString(method.MemberDefinition); + //var file = GetSymbols(method); - if (file == null || !file.DebugSymbols.ContainsKey(id)) - return new ILRange[] { }; + //if (file == null || !file.DebugSymbols.ContainsKey(id)) + // return new ILRange[] { }; - var symbols = file.DebugSymbols[id]; - int codesize = symbols.CecilMethod.Body.CodeSize; - var inv = ICSharpCode.Decompiler.ILAst.ILRange.Invert(symbols.SequencePoints.SelectMany(s => s.ILRanges), codesize); - return inv.Select(r => new ILRange(r.From, r.To)); + //var symbols = file.DebugSymbols[id]; + //int codesize = symbols.CecilMethod.Body.CodeSize; + //var inv = ICSharpCode.Decompiler.ILAst.ILRange.Invert(symbols.SequencePoints.SelectMany(s => s.ILRanges), codesize); + //return inv.Select(r => new ILRange(r.From, r.To)); + return null; } public IEnumerable GetLocalVariables(IMethod method) { - string id = IdStringProvider.GetIdString(method.MemberDefinition); - var file = GetSymbols(method); - - if (file == null || !file.DebugSymbols.ContainsKey(id)) - return Enumerable.Empty(); - - var symbols = file.DebugSymbols[id]; - - var context = new SimpleTypeResolveContext(method); - var loader = new CecilLoader(); - - return symbols.LocalVariables.Where(v => v.OriginalVariable != null).Select( - v => new Debugger.ILLocalVariable() { - Index = v.OriginalVariable.Index, - Type = loader.ReadTypeReference(v.Type).Resolve(context).AcceptVisitor(method.Substitution), - Name = v.Name, - IsCompilerGenerated = false, - ILRanges = new [] { new ILRange(0, int.MaxValue) } - }); + //string id = IdStringProvider.GetIdString(method.MemberDefinition); + //var file = GetSymbols(method); + + //if (file == null || !file.DebugSymbols.ContainsKey(id)) + // return Enumerable.Empty(); + + //var symbols = file.DebugSymbols[id]; + + //var context = new SimpleTypeResolveContext(method); + //var loader = new CecilLoader(); + + //return symbols.LocalVariables.Where(v => v.OriginalVariable != null).Select( + // v => new Debugger.ILLocalVariable() { + // Index = v.OriginalVariable.Index, + // Type = loader.ReadTypeReference(v.Type).Resolve(context).AcceptVisitor(method.Substitution), + // Name = v.Name, + // IsCompilerGenerated = false, + // ILRanges = new [] { new ILRange(0, int.MaxValue) } + // }); + return null; } } static class ILSpySymbolSourceExtensions { - public static Debugger.SequencePoint ToDebugger(this ICSharpCode.Decompiler.SequencePoint seq, ICSharpCode.Decompiler.MethodDebugSymbols symbols, string filename) - { - return new Debugger.SequencePoint() { - MethodDefToken = symbols.CecilMethod.MetadataToken.ToUInt32(), - ILRanges = seq.ILRanges.Select(r => new ILRange(r.From, r.To)).ToArray(), - Filename = filename, - StartLine = seq.StartLocation.Line, - StartColumn = seq.StartLocation.Column, - EndLine = seq.EndLocation.Line, - EndColumn = seq.EndLocation.Column, - }; - } + //public static Debugger.SequencePoint ToDebugger(this ICSharpCode.Decompiler.SequencePoint seq, ICSharpCode.Decompiler.MethodDebugSymbols symbols, string filename) + //{ + // return new Debugger.SequencePoint() { + // MethodDefToken = symbols.CecilMethod.MetadataToken.ToUInt32(), + // ILRanges = seq.ILRanges.Select(r => new ILRange(r.From, r.To)).ToArray(), + // Filename = filename, + // StartLine = seq.StartLocation.Line, + // StartColumn = seq.StartLocation.Column, + // EndLine = seq.EndLocation.Line, + // EndColumn = seq.EndLocation.Column, + // }; + //} } } diff --git a/src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyUnresolvedFile.cs b/src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyUnresolvedFile.cs index d8f6f3f7753..7b282e5024d 100644 --- a/src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyUnresolvedFile.cs +++ b/src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyUnresolvedFile.cs @@ -20,8 +20,8 @@ using System.Collections.Generic; using System.IO; using ICSharpCode.Core; -using ICSharpCode.Decompiler; -using ICSharpCode.Decompiler.Ast; +//using ICSharpCode.Decompiler; +//using ICSharpCode.Decompiler.Ast; using ICSharpCode.NRefactory; using ICSharpCode.NRefactory.CSharp; using ICSharpCode.NRefactory.CSharp.TypeSystem; @@ -36,28 +36,27 @@ public class ILSpyUnresolvedFile : CSharpUnresolvedFile { DecompiledTypeReference name; string output; - - public static ILSpyUnresolvedFile Create(DecompiledTypeReference name, AstBuilder builder) + + public static ILSpyUnresolvedFile Create(DecompiledTypeReference name, SyntaxTree syntaxTree) { var writer = new StringWriter(); var target = new TextWriterTokenWriter(writer) { IndentationString = "\t" }; - var output = new DebugInfoTokenWriterDecorator(TokenWriter.WrapInWriterThatSetsLocationsInAST(target)); - builder.RunTransformations(); - var syntaxTree = builder.SyntaxTree; - + var output = new DebugInfoTokenWriterDecorator(TokenWriter.WrapInWriterThatSetsLocationsInAST(target)); + syntaxTree.AcceptVisitor(new InsertParenthesesVisitor { InsertParenthesesForReadability = true }); - syntaxTree.AcceptVisitor(new CSharpOutputVisitor(output, FormattingOptionsFactory.CreateSharpDevelop())); + //syntaxTree.AcceptVisitor(new CSharpOutputVisitor(output, FormattingOptionsFactory.CreateSharpDevelop())); ILSpyUnresolvedFile file = new ILSpyUnresolvedFile(name); var v = new TypeSystemConvertVisitor(file); syntaxTree.AcceptVisitor(v); - + file.MemberLocations = output.MemberLocations; - file.DebugSymbols = output.DebugSymbols; + //file.DebugSymbols = output.DebugSymbols; + writer.Write(syntaxTree.ToString()); file.output = writer.ToString(); - + return file; } - + ILSpyUnresolvedFile(DecompiledTypeReference name) { this.name = name; @@ -66,7 +65,7 @@ public static ILSpyUnresolvedFile Create(DecompiledTypeReference name, AstBuilde public Dictionary MemberLocations { get; private set; } - public Dictionary DebugSymbols { get; private set; } + //public Dictionary DebugSymbols { get; private set; } public string Output { get { return output; } diff --git a/src/AddIns/DisplayBindings/IconEditor/IconEditor.csproj b/src/AddIns/DisplayBindings/IconEditor/IconEditor.csproj index 7bd11dabd39..2de9dc32562 100644 --- a/src/AddIns/DisplayBindings/IconEditor/IconEditor.csproj +++ b/src/AddIns/DisplayBindings/IconEditor/IconEditor.csproj @@ -1,5 +1,5 @@  - + Library ICSharpCode.IconEditor @@ -17,7 +17,7 @@ 4096 4 false - v4.5 + v4.8 @@ -55,7 +55,9 @@ UserControl - + + Form + PickFormatDialog.cs diff --git a/src/AddIns/DisplayBindings/ResourceEditor/Project/ResourceEditor.csproj b/src/AddIns/DisplayBindings/ResourceEditor/Project/ResourceEditor.csproj index 109b223a1da..ca268ec1fab 100644 --- a/src/AddIns/DisplayBindings/ResourceEditor/Project/ResourceEditor.csproj +++ b/src/AddIns/DisplayBindings/ResourceEditor/Project/ResourceEditor.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -21,7 +21,7 @@ 4096 4 false - v4.5 + v4.8 @@ -138,10 +138,7 @@ False - - - - + diff --git a/src/AddIns/DisplayBindings/SettingsEditor/Project/SettingsEditor.csproj b/src/AddIns/DisplayBindings/SettingsEditor/Project/SettingsEditor.csproj index 0c29c2b9465..f284379b47f 100644 --- a/src/AddIns/DisplayBindings/SettingsEditor/Project/SettingsEditor.csproj +++ b/src/AddIns/DisplayBindings/SettingsEditor/Project/SettingsEditor.csproj @@ -1,5 +1,5 @@  - + Library ICSharpCode.SettingsEditor @@ -13,7 +13,7 @@ 4 false C:\Users\Daniel\AppData\Roaming\ICSharpCode/SharpDevelop3.0\Settings.SourceAnalysis - v4.5 + v4.8 diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/Commands/CutCopyPaste.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/Commands/CutCopyPaste.cs index d1ee8874d45..fdd68c70c15 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/Commands/CutCopyPaste.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/Commands/CutCopyPaste.cs @@ -71,7 +71,8 @@ public bool IsValid(object owner, Condition condition) { var surface = owner as DesignSurface; if(surface!=null) { - return surface.CanCopyOrCut(); + //TODO: Look at the CanCut method as well + return surface.CanCopy(); } return false; } diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/WpfDesign.AddIn.csproj b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/WpfDesign.AddIn.csproj index cd4254b1d3b..897e5170d37 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/WpfDesign.AddIn.csproj +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/WpfDesign.AddIn.csproj @@ -1,5 +1,5 @@  - + {9A9D6FD4-6A2E-455D-ACC3-DDA775FE9865} Debug @@ -12,7 +12,7 @@ False 4 false - v4.5 + v4.8 @@ -150,7 +150,5 @@ - - - + \ No newline at end of file diff --git a/src/AddIns/DisplayBindings/XmlEditor/Project/XmlEditor.csproj b/src/AddIns/DisplayBindings/XmlEditor/Project/XmlEditor.csproj index 106b822804f..97556bb9176 100644 --- a/src/AddIns/DisplayBindings/XmlEditor/Project/XmlEditor.csproj +++ b/src/AddIns/DisplayBindings/XmlEditor/Project/XmlEditor.csproj @@ -1,5 +1,5 @@  - + {DCA2703D-250A-463E-A68A-07ED105AE6BD} Debug @@ -7,7 +7,7 @@ Library ICSharpCode.XmlEditor XmlEditor - v4.5 + v4.8 False False 4 diff --git a/src/AddIns/DisplayBindings/XmlEditor/Test/XmlEditor.Tests.csproj b/src/AddIns/DisplayBindings/XmlEditor/Test/XmlEditor.Tests.csproj index ad1a166920d..33497f398bd 100644 --- a/src/AddIns/DisplayBindings/XmlEditor/Test/XmlEditor.Tests.csproj +++ b/src/AddIns/DisplayBindings/XmlEditor/Test/XmlEditor.Tests.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -20,7 +20,7 @@ False False True - v4.5 + v4.8 true @@ -250,9 +250,15 @@ - - - + + Form + + + Component + + + UserControl + @@ -337,13 +343,6 @@ - - - - - - - {6C55B776-26D4-4DB3-A6AB-87E783B2F3D1} ICSharpCode.AvalonEdit @@ -366,9 +365,6 @@ XmlEditor True - - - {2748AD25-9C63-4E12-877B-4DCE96FBED54} ICSharpCode.SharpDevelop @@ -377,8 +373,6 @@ {35CEF10F-2D4C-45F2-9DD1-161E0FEC583C} ICSharpCode.Core - - diff --git a/src/AddIns/Misc/AddInManager2/AddInManager2.Tests/AddInManager2.Tests.csproj b/src/AddIns/Misc/AddInManager2/AddInManager2.Tests/AddInManager2.Tests.csproj index 0b7c25ada80..26907f95e12 100644 --- a/src/AddIns/Misc/AddInManager2/AddInManager2.Tests/AddInManager2.Tests.csproj +++ b/src/AddIns/Misc/AddInManager2/AddInManager2.Tests/AddInManager2.Tests.csproj @@ -1,5 +1,5 @@  - + {0D0CB6E5-1EAD-471F-96B9-BFF84057BCF5} Debug @@ -7,7 +7,7 @@ Library ICSharpCode.AddInManager2.Tests ICSharpCode.AddInManager2.Tests - v4.5 + v4.8 Properties False @@ -85,9 +85,7 @@ - - - + {3B2A5653-EC97-4001-BB9B-D90F1AF2C371} diff --git a/src/AddIns/Misc/AddInManager2/Project/AddInManager2.csproj b/src/AddIns/Misc/AddInManager2/Project/AddInManager2.csproj index 5713fea16b3..5a16e4b898a 100644 --- a/src/AddIns/Misc/AddInManager2/Project/AddInManager2.csproj +++ b/src/AddIns/Misc/AddInManager2/Project/AddInManager2.csproj @@ -1,5 +1,5 @@  - + {60480C2F-F228-4D86-B98F-AF75A7DCEC34} Debug @@ -7,7 +7,7 @@ Library ICSharpCode.AddInManager2 ICSharpCode.AddInManager2 - v4.5 + v4.8 False False OnBuildSuccess @@ -183,14 +183,7 @@ False - - - - - - - - + diff --git a/src/AddIns/Misc/AddInManager2/Project/Src/Model/AddInDependency.cs b/src/AddIns/Misc/AddInManager2/Project/Src/Model/AddInDependency.cs index a898b53260a..b5ac9a98d45 100644 --- a/src/AddIns/Misc/AddInManager2/Project/Src/Model/AddInDependency.cs +++ b/src/AddIns/Misc/AddInManager2/Project/Src/Model/AddInDependency.cs @@ -151,7 +151,7 @@ private string FormatVersionConstraint(Version version, bool includeVersion, boo { string constraintOperator = isMinimum ? ">" : "<"; string equalityOperator = includeVersion ? "=" : ""; - return String.Format("{0}{1} {2}", constraintOperator, equalityOperator, version.ToString()); + return $"{constraintOperator}{equalityOperator} {version.ToString()}"; } } } diff --git a/src/AddIns/Misc/AddInManager2/Project/Src/Model/AddInSetup.cs b/src/AddIns/Misc/AddInManager2/Project/Src/Model/AddInSetup.cs index c683150dd8d..09b6149ea0c 100644 --- a/src/AddIns/Misc/AddInManager2/Project/Src/Model/AddInSetup.cs +++ b/src/AddIns/Misc/AddInManager2/Project/Src/Model/AddInSetup.cs @@ -177,7 +177,7 @@ public AddIn InstallAddIn(string fileName) // Unknown format of file _events.OnAddInOperationError( new AddInOperationErrorEventArgs( - SD.ResourceService.GetString("AddInManager.UnknownFileFormat") + " " + Path.GetExtension(fileName))); + $"{SD.ResourceService.GetString("AddInManager.UnknownFileFormat")} {Path.GetExtension(fileName)}")); return null; } diff --git a/src/AddIns/Misc/AddInManager2/Project/Src/Model/NuGetPackageManager.cs b/src/AddIns/Misc/AddInManager2/Project/Src/Model/NuGetPackageManager.cs index bd55565e4d1..03de6105628 100644 --- a/src/AddIns/Misc/AddInManager2/Project/Src/Model/NuGetPackageManager.cs +++ b/src/AddIns/Misc/AddInManager2/Project/Src/Model/NuGetPackageManager.cs @@ -121,7 +121,7 @@ public void ExecuteOperation(PackageOperation operation) public string GetLocalPackageDirectory(IPackage package) { - return Path.Combine(PackageOutputDirectory, package.Id + "." + package.Version.ToString()); + return Path.Combine(PackageOutputDirectory, $"{package.Id}.{package.Version}"); } private IPackageManager EnsurePackageManagerInstance() diff --git a/src/AddIns/Misc/AddInManager2/Project/Src/Model/PackageRepositories.cs b/src/AddIns/Misc/AddInManager2/Project/Src/Model/PackageRepositories.cs index d750b5a3905..465b49fe4fe 100644 --- a/src/AddIns/Misc/AddInManager2/Project/Src/Model/PackageRepositories.cs +++ b/src/AddIns/Misc/AddInManager2/Project/Src/Model/PackageRepositories.cs @@ -142,7 +142,7 @@ private void LoadPackageSources() private void SavePackageSources() { AddDefaultRepository(); - var savedRepositories = _registeredPackageSources.Select(ps => ps.Name + "=" + ps.Source); + var savedRepositories = _registeredPackageSources.Select(ps => $"{ps.Name}={ps.Source}"); _settings.PackageRepositories = savedRepositories.ToArray(); UpdateCurrentRepository(); } diff --git a/src/AddIns/Misc/AddInManager2/Project/Src/Model/PackageRepository.cs b/src/AddIns/Misc/AddInManager2/Project/Src/Model/PackageRepository.cs index 46823995ece..02fed2d7efd 100644 --- a/src/AddIns/Misc/AddInManager2/Project/Src/Model/PackageRepository.cs +++ b/src/AddIns/Misc/AddInManager2/Project/Src/Model/PackageRepository.cs @@ -90,7 +90,7 @@ public string NameWithHighlight { if (_highlightCount > 0) { - return String.Format("{0} ({1})", Name, _highlightCount); + return $"{Name} ({_highlightCount})"; } else { diff --git a/src/AddIns/Misc/AddInManager2/Project/Src/Model/Page.cs b/src/AddIns/Misc/AddInManager2/Project/Src/Model/Page.cs index 911f48d9675..1b690b7ab56 100644 --- a/src/AddIns/Misc/AddInManager2/Project/Src/Model/Page.cs +++ b/src/AddIns/Misc/AddInManager2/Project/Src/Model/Page.cs @@ -27,7 +27,7 @@ public class Page public override string ToString() { - return String.Format("[Page] Number={0}, IsSelected={1}", Number, IsSelected); + return $"[Page] Number={Number}, IsSelected={IsSelected}"; } } } diff --git a/src/AddIns/Misc/AddInManager2/Project/Src/ViewModel/AddInPackageViewModelBase.cs b/src/AddIns/Misc/AddInManager2/Project/Src/ViewModel/AddInPackageViewModelBase.cs index 9d4055d248f..f0c02c0d404 100644 --- a/src/AddIns/Misc/AddInManager2/Project/Src/ViewModel/AddInPackageViewModelBase.cs +++ b/src/AddIns/Misc/AddInManager2/Project/Src/ViewModel/AddInPackageViewModelBase.cs @@ -457,9 +457,9 @@ public virtual string FileName } } - protected string SurroundWithParantheses(string content) + protected string SurroundWithParentheses(string content) { - return "(" + content + ")"; + return $"({content})"; } } } diff --git a/src/AddIns/Misc/AddInManager2/Project/Src/ViewModel/AddInsViewModelBase.cs b/src/AddIns/Misc/AddInManager2/Project/Src/ViewModel/AddInsViewModelBase.cs index fb07ce209ef..389d0e7307f 100644 --- a/src/AddIns/Misc/AddInManager2/Project/Src/ViewModel/AddInsViewModelBase.cs +++ b/src/AddIns/Misc/AddInManager2/Project/Src/ViewModel/AddInsViewModelBase.cs @@ -209,7 +209,7 @@ public string TitleWithHighlight { if (_highlightCount > 0) { - return String.Format("{0} ({1})", Title, _highlightCount); + return $"{Title} ({_highlightCount})"; } else { diff --git a/src/AddIns/Misc/AddInManager2/Project/Src/ViewModel/NuGetPackageViewModel.cs b/src/AddIns/Misc/AddInManager2/Project/Src/ViewModel/NuGetPackageViewModel.cs index 798b57ee619..b583dd106b8 100644 --- a/src/AddIns/Misc/AddInManager2/Project/Src/ViewModel/NuGetPackageViewModel.cs +++ b/src/AddIns/Misc/AddInManager2/Project/Src/ViewModel/NuGetPackageViewModel.cs @@ -251,16 +251,16 @@ public override string Summary } else { - return SurroundWithParantheses(SD.ResourceService.GetString("AddInManager.AddInInstalled")); + return SurroundWithParentheses(SD.ResourceService.GetString("AddInManager.AddInInstalled")); } } else if (IsRemoved) { - return SurroundWithParantheses(SD.ResourceService.GetString("AddInManager.AddInRemoved")); + return SurroundWithParentheses(SD.ResourceService.GetString("AddInManager.AddInRemoved")); } else if (!IsEnabled) { - return SurroundWithParantheses(SD.ResourceService.GetString("AddInManager.AddInDisabled")); + return SurroundWithParentheses(SD.ResourceService.GetString("AddInManager.AddInDisabled")); } else { diff --git a/src/AddIns/Misc/AddInManager2/Project/Src/ViewModel/OfflineAddInViewModel.cs b/src/AddIns/Misc/AddInManager2/Project/Src/ViewModel/OfflineAddInViewModel.cs index ea6d0523ecc..4f9852fde88 100644 --- a/src/AddIns/Misc/AddInManager2/Project/Src/ViewModel/OfflineAddInViewModel.cs +++ b/src/AddIns/Misc/AddInManager2/Project/Src/ViewModel/OfflineAddInViewModel.cs @@ -350,7 +350,7 @@ public override string Summary { if (_addIn.Action == AddInAction.Install) { - return SurroundWithParantheses(SD.ResourceService.GetString("AddInManager.AddInInstalled")); + return SurroundWithParentheses(SD.ResourceService.GetString("AddInManager.AddInInstalled")); } else if (_addIn.Action == AddInAction.Update) { @@ -358,30 +358,30 @@ public override string Summary } else if (HasDependencyConflicts) { - return SurroundWithParantheses(SD.ResourceService.GetString("AddInManager.AddInDependencyFailed")); + return SurroundWithParentheses(SD.ResourceService.GetString("AddInManager.AddInDependencyFailed")); } else if (IsRemoved) { - return SurroundWithParantheses(SD.ResourceService.GetString("AddInManager.AddInRemoved")); + return SurroundWithParentheses(SD.ResourceService.GetString("AddInManager.AddInRemoved")); } else if (IsEnabled && !_addIn.Enabled) { - return SurroundWithParantheses(SD.ResourceService.GetString("AddInManager.AddInEnabled")); + return SurroundWithParentheses(SD.ResourceService.GetString("AddInManager.AddInEnabled")); } else if (!IsEnabled) { if (_addIn.Enabled) { - return SurroundWithParantheses(SD.ResourceService.GetString("AddInManager.AddInWillBeDisabled")); + return SurroundWithParentheses(SD.ResourceService.GetString("AddInManager.AddInWillBeDisabled")); } else { - return SurroundWithParantheses(SD.ResourceService.GetString("AddInManager.AddInDisabled")); + return SurroundWithParentheses(SD.ResourceService.GetString("AddInManager.AddInDisabled")); } } else if (_addIn.Action == AddInAction.InstalledTwice) { - return SurroundWithParantheses(SD.ResourceService.GetString("AddInManager.AddInInstalledTwice")); + return SurroundWithParentheses(SD.ResourceService.GetString("AddInManager.AddInInstalledTwice")); } else { @@ -510,7 +510,7 @@ public override void RemovePackage() string addInNames = ""; foreach (var dependentAddIn in dependentAddIns) { - addInNames += "\t " + dependentAddIn.AddIn.Name + Environment.NewLine; + addInNames += $"\t {dependentAddIn.AddIn.Name}{Environment.NewLine}"; } if (!MessageService.AskQuestionFormatted( "${res:AddInManager.Title}", "${res:AddInManager2.DisableDependentWarning}", _addIn.Name, addInNames)) @@ -566,7 +566,7 @@ public override void DisablePackage() string addInNames = ""; foreach (var dependentAddIn in dependentAddIns) { - addInNames += "\t " + dependentAddIn.AddIn.Name + Environment.NewLine; + addInNames += $"\t {dependentAddIn.AddIn.Name}{Environment.NewLine}"; } if (!MessageService.AskQuestionFormatted( "${res:AddInManager.Title}", "${res:AddInManager2.DisableDependentWarning}", _addIn.Name, addInNames)) @@ -610,7 +610,7 @@ public override void ShowOptions() } } ICSharpCode.SharpDevelop.Commands.OptionsCommand.ShowTabbedOptions( - _addIn.Name + " " + SD.ResourceService.GetString("AddInManager.Options"), + $"{_addIn.Name} {SD.ResourceService.GetString("AddInManager.Options")}", dummyNode); } diff --git a/src/AddIns/Misc/AddinScout/Project/AddinScout.csproj b/src/AddIns/Misc/AddinScout/Project/AddinScout.csproj index 89ad1c20c4a..711cdc2e65b 100644 --- a/src/AddIns/Misc/AddinScout/Project/AddinScout.csproj +++ b/src/AddIns/Misc/AddinScout/Project/AddinScout.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -22,7 +22,7 @@ AnyCPU 4096 false - v4.5 + v4.8 diff --git a/src/AddIns/Misc/AddinScout/Project/Src/Gui/AddInDetailsPanel.cs b/src/AddIns/Misc/AddinScout/Project/Src/Gui/AddInDetailsPanel.cs index 7ed888fec60..e7aa012f34c 100644 --- a/src/AddIns/Misc/AddinScout/Project/Src/Gui/AddInDetailsPanel.cs +++ b/src/AddIns/Misc/AddinScout/Project/Src/Gui/AddInDetailsPanel.cs @@ -80,7 +80,7 @@ void AddInDetailsListViewItemActivate(object sender, EventArgs e) public void ShowAddInDetails(AddIn ai) { - addInLabel.Text = "AddIn : " + ai.Properties["name"]; + addInLabel.Text = $"AddIn : {ai.Properties["name"]}"; addInDetailsListView.Items.Clear(); @@ -102,7 +102,7 @@ public void ShowAddInDetails(AddIn ai) foreach (KeyValuePair entry in ai.Manifest.Identities) { ListViewItem newListViewItem = new ListViewItem("Identity"); - newListViewItem.SubItems.Add(entry.Key + " = " + entry.Value); + newListViewItem.SubItems.Add($"{entry.Key} = {entry.Value}"); addInDetailsListView.Items.Add(newListViewItem); } diff --git a/src/AddIns/Misc/AddinScout/Project/Src/Gui/CodonListPanel.cs b/src/AddIns/Misc/AddinScout/Project/Src/Gui/CodonListPanel.cs index 331d5cbfa2e..c6b3e998199 100644 --- a/src/AddIns/Misc/AddinScout/Project/Src/Gui/CodonListPanel.cs +++ b/src/AddIns/Misc/AddinScout/Project/Src/Gui/CodonListPanel.cs @@ -96,7 +96,7 @@ public void ListCodons(string path) return; } - ExtTextBox.Text = "Extension : " + path; + ExtTextBox.Text = $"Extension : {path}"; AddInTreeNode node = AddInTree.GetTreeNode(path, false); if (node == null) return; @@ -107,7 +107,7 @@ public void ListCodons(string path) lvi.SubItems.Add(c.Properties.Contains("class") ? c.Properties["class"] : ""); - lvi.SubItems.Add(string.Join(";", c.Conditions.Select(a => a.Name + ": " + a.Action))); + lvi.SubItems.Add(string.Join(";", c.Conditions.Select(a => $"{a.Name}: {a.Action}"))); lvi.SubItems.Add(c.Properties.Contains("label") ? c.Properties["label"] : ""); CodonLV.Items.Add(lvi); } diff --git a/src/AddIns/Misc/FiletypeRegisterer/Project/FiletypeRegisterer.csproj b/src/AddIns/Misc/FiletypeRegisterer/Project/FiletypeRegisterer.csproj index 5c44cb08f45..7a38cbc98ea 100644 --- a/src/AddIns/Misc/FiletypeRegisterer/Project/FiletypeRegisterer.csproj +++ b/src/AddIns/Misc/FiletypeRegisterer/Project/FiletypeRegisterer.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -22,7 +22,7 @@ AnyCPU 4096 false - v4.5 + v4.8 diff --git a/src/AddIns/Misc/HelpViewer/HelpViewer.csproj b/src/AddIns/Misc/HelpViewer/HelpViewer.csproj index 44836d03760..8feca2db5c0 100644 --- a/src/AddIns/Misc/HelpViewer/HelpViewer.csproj +++ b/src/AddIns/Misc/HelpViewer/HelpViewer.csproj @@ -1,5 +1,5 @@  - + {80F76D10-0B44-4D55-B4BD-DAEB5464090C} Debug @@ -7,7 +7,7 @@ Library MSHelpSystem HelpViewer - v4.5 + v4.8 False False 4 @@ -67,7 +67,9 @@ - + + Form + SearchPadControl.xaml @@ -95,12 +97,7 @@ - - - - - - + diff --git a/src/AddIns/Misc/PackageManagement/Cmdlets/Project/PackageManagement.Cmdlets.csproj b/src/AddIns/Misc/PackageManagement/Cmdlets/Project/PackageManagement.Cmdlets.csproj index 5898e1a48fa..ccf73be1b58 100644 --- a/src/AddIns/Misc/PackageManagement/Cmdlets/Project/PackageManagement.Cmdlets.csproj +++ b/src/AddIns/Misc/PackageManagement/Cmdlets/Project/PackageManagement.Cmdlets.csproj @@ -1,5 +1,5 @@  - + {E0A5E80A-003B-4335-A9DC-A76E2E46D38D} Debug @@ -7,7 +7,7 @@ Library ICSharpCode.PackageManagement.Cmdlets PackageManagement.Cmdlets - v4.5 + v4.8 ..\..\..\..\..\..\AddIns\Misc\PackageManagement\ False @@ -92,8 +92,6 @@ False - - - + \ No newline at end of file diff --git a/src/AddIns/Misc/PackageManagement/Cmdlets/Test/PackageManagement.Cmdlets.Tests.csproj b/src/AddIns/Misc/PackageManagement/Cmdlets/Test/PackageManagement.Cmdlets.Tests.csproj index 49e818bb805..c21b145120e 100644 --- a/src/AddIns/Misc/PackageManagement/Cmdlets/Test/PackageManagement.Cmdlets.Tests.csproj +++ b/src/AddIns/Misc/PackageManagement/Cmdlets/Test/PackageManagement.Cmdlets.Tests.csproj @@ -1,5 +1,5 @@  - + {11115C83-3DB1-431F-8B98-59040359238D} Debug @@ -7,7 +7,7 @@ Library PackageManagement.Cmdlets.Tests PackageManagement.Cmdlets.Tests - v4.5 + v4.8 ..\..\..\..\..\..\bin\UnitTests\ @@ -98,9 +98,6 @@ PackageManagement.Cmdlets - - - - + \ No newline at end of file diff --git a/src/AddIns/Misc/PackageManagement/PowerShell/Project/PackageManagement.PowerShell.csproj b/src/AddIns/Misc/PackageManagement/PowerShell/Project/PackageManagement.PowerShell.csproj index 11774c79781..f7e83c5b7fd 100644 --- a/src/AddIns/Misc/PackageManagement/PowerShell/Project/PackageManagement.PowerShell.csproj +++ b/src/AddIns/Misc/PackageManagement/PowerShell/Project/PackageManagement.PowerShell.csproj @@ -1,5 +1,5 @@  - + {A406803B-C584-43A3-BCEE-A0BB3132CB5F} Debug @@ -7,7 +7,7 @@ Library ICSharpCode.PackageManagement.PowerShell PackageManagement.PowerShell - v4.5 + v4.8 ..\..\..\..\..\..\AddIns\Misc\PackageManagement\ False @@ -59,9 +59,7 @@ - - - + {7048AE18-EB93-4A84-82D0-DD60EB58ADBD} diff --git a/src/AddIns/Misc/PackageManagement/Project/PackageManagement.csproj b/src/AddIns/Misc/PackageManagement/Project/PackageManagement.csproj index 3a9259c3fbe..22f091db126 100644 --- a/src/AddIns/Misc/PackageManagement/Project/PackageManagement.csproj +++ b/src/AddIns/Misc/PackageManagement/Project/PackageManagement.csproj @@ -1,5 +1,5 @@  - + {AE4AB0FA-6087-4480-AF37-0FA1452B3DA1} Debug @@ -7,7 +7,7 @@ Library ICSharpCode.PackageManagement PackageManagement - v4.5 + v4.8 False False 4 @@ -66,16 +66,7 @@ - - - - - - - - - - + Configuration\GlobalAssemblyInfo.cs diff --git a/src/AddIns/Misc/PackageManagement/SharpDevelop.EnvDTE/SharpDevelop.EnvDTE.vbproj b/src/AddIns/Misc/PackageManagement/SharpDevelop.EnvDTE/SharpDevelop.EnvDTE.vbproj index cd33019d033..1a936589742 100644 --- a/src/AddIns/Misc/PackageManagement/SharpDevelop.EnvDTE/SharpDevelop.EnvDTE.vbproj +++ b/src/AddIns/Misc/PackageManagement/SharpDevelop.EnvDTE/SharpDevelop.EnvDTE.vbproj @@ -1,5 +1,5 @@  - + {1B753D7F-7C77-4D5E-B928-02982690879C} Debug @@ -7,8 +7,9 @@ Library Empty SharpDevelop.EnvDTE - v4.0 - Client + v4.8 + + Properties On False @@ -37,6 +38,12 @@ True TRACE=1 + + false + + + false + @@ -121,7 +128,9 @@ - + + + diff --git a/src/AddIns/Misc/PackageManagement/Test/PackageManagement.Tests.csproj b/src/AddIns/Misc/PackageManagement/Test/PackageManagement.Tests.csproj index 91ebb9fb02c..da1a2f6853f 100644 --- a/src/AddIns/Misc/PackageManagement/Test/PackageManagement.Tests.csproj +++ b/src/AddIns/Misc/PackageManagement/Test/PackageManagement.Tests.csproj @@ -1,5 +1,5 @@  - + {56E98A01-8398-4A08-9578-C7337711A52B} Debug @@ -7,7 +7,7 @@ Library PackageManagement.Tests PackageManagement.Tests - v4.5 + v4.8 Properties False False @@ -397,13 +397,6 @@ SharpDevelop.EnvDTE - - - - - - - - + \ No newline at end of file diff --git a/src/AddIns/Misc/RegExpTk/Project/RegExpTk.csproj b/src/AddIns/Misc/RegExpTk/Project/RegExpTk.csproj index 574f865debd..2c4f633ca2c 100644 --- a/src/AddIns/Misc/RegExpTk/Project/RegExpTk.csproj +++ b/src/AddIns/Misc/RegExpTk/Project/RegExpTk.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -18,7 +18,7 @@ 122683392 AnyCPU 4096 - v4.5 + v4.8 diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/ICSharpCode.Reporting.Addin.csproj b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/ICSharpCode.Reporting.Addin.csproj index 11850c2aa05..df38774c360 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/ICSharpCode.Reporting.Addin.csproj +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/ICSharpCode.Reporting.Addin.csproj @@ -1,5 +1,5 @@  - + {0502FCF7-72F4-4587-936B-D0238CD0E072} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} @@ -15,7 +15,7 @@ False obj\$(Configuration)\ 4 - v4.5 + v4.8 ..\..\..\..\..\AddIns\Misc\SharpDevelopReporting\ @@ -77,45 +77,45 @@ ..\..\..\..\Libraries\WPFExtendedToolkit\Xceed.Wpf.Toolkit.dll + - - - - - - - - - - - - - - - - - - - - - - Configuration\GlobalAssemblyInfo.cs - - - - - - - - - - - - + + Component + + + Component + + + Component + + + Component + + + Component + + + Component + + + Component + + + Component + + + Component + + + Component + + + Component + @@ -132,12 +132,16 @@ - + + UserControl + - + + Form + EditorDialog.cs diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/ICSharpCode.Reporting.csproj b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/ICSharpCode.Reporting.csproj index e50afe19fc6..e7d7c5aec14 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/ICSharpCode.Reporting.csproj +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/ICSharpCode.Reporting.csproj @@ -1,5 +1,5 @@  - + {40CA84D4-ACFC-4646-9CDD-B87262D34093} Debug @@ -7,7 +7,7 @@ Library ICSharpCode.Reporting ICSharpCode.Reporting - v4.5 + v4.8 Properties @@ -79,9 +79,6 @@ - - Src\Configuration\GlobalAssemblyInfo.cs - @@ -157,7 +154,9 @@ - + + Component + @@ -194,38 +193,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/ICSharpCode.Reporting.Test.csproj b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/ICSharpCode.Reporting.Test.csproj index 4114610fc2a..429712d9ba2 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/ICSharpCode.Reporting.Test.csproj +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/ICSharpCode.Reporting.Test.csproj @@ -1,5 +1,5 @@  - + {97CA9CE5-B966-48DF-BB59-F00FFC534B1F} Debug @@ -7,7 +7,7 @@ Library ICSharpCode.Reporting.Test ICSharpCode.Reporting.Tests - v4.5 + v4.8 Properties @@ -90,19 +90,7 @@ - - - - - - - - - - - - - + {40CA84D4-ACFC-4646-9CDD-B87262D34093} diff --git a/src/AddIns/Misc/SearchAndReplace/Project/SearchAndReplace.csproj b/src/AddIns/Misc/SearchAndReplace/Project/SearchAndReplace.csproj index 88cde529662..21c8b4e5c0b 100644 --- a/src/AddIns/Misc/SearchAndReplace/Project/SearchAndReplace.csproj +++ b/src/AddIns/Misc/SearchAndReplace/Project/SearchAndReplace.csproj @@ -1,5 +1,5 @@  - + {9196DD8A-B4D4-4780-8742-C5762E547FC2} Debug @@ -12,7 +12,7 @@ False 4 false - v4.5 + v4.8 diff --git a/src/AddIns/Misc/SearchAndReplace/Test/SearchAndReplace.Tests.csproj b/src/AddIns/Misc/SearchAndReplace/Test/SearchAndReplace.Tests.csproj index 4764d1b3f16..89f691d896c 100644 --- a/src/AddIns/Misc/SearchAndReplace/Test/SearchAndReplace.Tests.csproj +++ b/src/AddIns/Misc/SearchAndReplace/Test/SearchAndReplace.Tests.csproj @@ -1,5 +1,5 @@  - + {A569DCC1-C608-45FD-B770-4F79335EF154} Debug @@ -12,7 +12,7 @@ False 4 False - v4.5 + v4.8 False obj\$(Configuration)\ diff --git a/src/AddIns/Misc/StartPage/Project/StartPage.csproj b/src/AddIns/Misc/StartPage/Project/StartPage.csproj index 2cad04f9584..06b2c2fbdd7 100644 --- a/src/AddIns/Misc/StartPage/Project/StartPage.csproj +++ b/src/AddIns/Misc/StartPage/Project/StartPage.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -19,7 +19,7 @@ 126877696 AnyCPU 4096 - v4.5 + v4.8 false @@ -95,7 +95,6 @@ ICSharpCode.Core.Presentation False - diff --git a/src/AddIns/Misc/TextTemplating/Project/TextTemplating.csproj b/src/AddIns/Misc/TextTemplating/Project/TextTemplating.csproj index f66ca935e76..c9d57914282 100644 --- a/src/AddIns/Misc/TextTemplating/Project/TextTemplating.csproj +++ b/src/AddIns/Misc/TextTemplating/Project/TextTemplating.csproj @@ -1,5 +1,5 @@  - + {B5D8C3E6-42EC-4D4B-AD05-3644B32563EF} Debug @@ -7,7 +7,7 @@ Library ICSharpCode.TextTemplating TextTemplating - v4.5 + v4.8 False False 4 @@ -135,9 +135,6 @@ False - - - - + \ No newline at end of file diff --git a/src/AddIns/Misc/TextTemplating/Test/TextTemplating.Tests.csproj b/src/AddIns/Misc/TextTemplating/Test/TextTemplating.Tests.csproj index b38dd957e56..7344335610f 100644 --- a/src/AddIns/Misc/TextTemplating/Test/TextTemplating.Tests.csproj +++ b/src/AddIns/Misc/TextTemplating/Test/TextTemplating.Tests.csproj @@ -1,5 +1,5 @@  - + {5186325C-DD7F-4246-9BE7-3F384EFBF5A6} Debug @@ -7,7 +7,7 @@ Library TextTemplating.Tests TextTemplating.Tests - v4.5 + v4.8 Properties False False @@ -103,11 +103,7 @@ - - - - - + {3B2A5653-EC97-4001-BB9B-D90F1AF2C371} diff --git a/src/AddIns/Misc/UsageDataCollector/UsageDataCollector.AddIn/UsageDataCollector.AddIn.csproj b/src/AddIns/Misc/UsageDataCollector/UsageDataCollector.AddIn/UsageDataCollector.AddIn.csproj index a59d75d483e..28925b57b77 100644 --- a/src/AddIns/Misc/UsageDataCollector/UsageDataCollector.AddIn/UsageDataCollector.AddIn.csproj +++ b/src/AddIns/Misc/UsageDataCollector/UsageDataCollector.AddIn/UsageDataCollector.AddIn.csproj @@ -1,5 +1,5 @@  - + {0008FCE9-9EB4-4E2E-979B-553278E5BBA6} Debug @@ -7,7 +7,7 @@ Library ICSharpCode.UsageDataCollector UsageDataCollector.AddIn - v4.5 + v4.8 ..\..\..\..\..\AddIns\Misc\UsageDataCollector\ False False diff --git a/src/AddIns/Misc/UsageDataCollector/UsageDataCollector/UsageDataCollector.csproj b/src/AddIns/Misc/UsageDataCollector/UsageDataCollector/UsageDataCollector.csproj index fe51184743e..c6956ffd457 100644 --- a/src/AddIns/Misc/UsageDataCollector/UsageDataCollector/UsageDataCollector.csproj +++ b/src/AddIns/Misc/UsageDataCollector/UsageDataCollector/UsageDataCollector.csproj @@ -1,5 +1,5 @@  - + {6B1CFE35-DA17-4DEB-9C6E-227E5E251DA0} Debug @@ -7,7 +7,7 @@ Library ICSharpCode.UsageDataCollector UsageDataCollector - v4.0 + v4.8 ..\..\..\..\..\AddIns\Misc\UsageDataCollector\ False False @@ -15,7 +15,8 @@ false ..\..\..\..\..\AddIns\Misc\UsageDataCollector\UsageDataCollector.xml 1591 - Client + + x86 @@ -38,6 +39,12 @@ False TRACE + + false + + + false + @@ -64,9 +71,7 @@ - - - + {35CEF10F-2D4C-45F2-9DD1-161E0FEC583C} diff --git a/src/AddIns/VersionControl/GitAddIn/GitAddIn.csproj b/src/AddIns/VersionControl/GitAddIn/GitAddIn.csproj index 99780dcefd6..914b5585233 100644 --- a/src/AddIns/VersionControl/GitAddIn/GitAddIn.csproj +++ b/src/AddIns/VersionControl/GitAddIn/GitAddIn.csproj @@ -1,5 +1,5 @@  - + {83F15BA7-8478-4664-81BB-A82F146D88B3} Debug @@ -12,7 +12,7 @@ False 4 false - v4.5 + v4.8 @@ -84,9 +84,7 @@ Always
- - - + {2748AD25-9C63-4E12-877B-4DCE96FBED54} diff --git a/src/AddIns/VersionControl/SubversionAddIn/SubversionAddIn.csproj b/src/AddIns/VersionControl/SubversionAddIn/SubversionAddIn.csproj index 1a1c4e26cbd..120d93055e8 100644 --- a/src/AddIns/VersionControl/SubversionAddIn/SubversionAddIn.csproj +++ b/src/AddIns/VersionControl/SubversionAddIn/SubversionAddIn.csproj @@ -1,5 +1,5 @@  - + Library ICSharpCode.Svn @@ -10,7 +10,7 @@ 8.0.50215 2.0 Always - v4.5 + v4.8 False False 4 @@ -92,7 +92,9 @@
- + + Form + diff --git a/src/Libraries/ICSharpCode.Decompiler/ILAst/InitializerPeepholeTransforms.cs b/src/Libraries/ICSharpCode.Decompiler/ILAst/InitializerPeepholeTransforms.cs index 373a7ca43e8..302e12697e9 100644 --- a/src/Libraries/ICSharpCode.Decompiler/ILAst/InitializerPeepholeTransforms.cs +++ b/src/Libraries/ICSharpCode.Decompiler/ILAst/InitializerPeepholeTransforms.cs @@ -359,7 +359,7 @@ static bool IsCollectionType(TypeReference tr) return false; TypeDefinition td = tr.Resolve(); while (td != null) { - if (td.Interfaces.Any(intf => intf.Name == "IEnumerable" && intf.Namespace == "System.Collections")) + if (td.Interfaces.Any(intf => intf.InterfaceType.Name == "IEnumerable" && intf.InterfaceType.Namespace == "System.Collections")) return true; td = td.BaseType != null ? td.BaseType.Resolve() : null; } diff --git a/src/Libraries/NRefactory b/src/Libraries/NRefactory index a2b55de351b..7d45cca2892 160000 --- a/src/Libraries/NRefactory +++ b/src/Libraries/NRefactory @@ -1 +1 @@ -Subproject commit a2b55de351be2119b6f0c3a17c36b5b9adbd7c59 +Subproject commit 7d45cca2892071cc938fd0444af85bb9bcecedc0 diff --git a/src/Libraries/WpfDesigner b/src/Libraries/WpfDesigner index ce0bc32a6e9..4f4443973d4 160000 --- a/src/Libraries/WpfDesigner +++ b/src/Libraries/WpfDesigner @@ -1 +1 @@ -Subproject commit ce0bc32a6e9e51b9bf6a3fb2388a5381a2c8a3f5 +Subproject commit 4f4443973d499197bb46addc977fb9c2ddf292e9 diff --git a/src/Libraries/cecil b/src/Libraries/cecil index b527eb93d00..870ce3ed2bb 160000 --- a/src/Libraries/cecil +++ b/src/Libraries/cecil @@ -1 +1 @@ -Subproject commit b527eb93d00e2420cf8b0a696208570b3051fd2b +Subproject commit 870ce3ed2bbc8cea09f91d328e941a0fa5a0cd21 diff --git a/src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj b/src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj index 5d66a4ac4ec..9751da89146 100644 --- a/src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj +++ b/src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -25,7 +25,7 @@ 0809 1591 4 ..\..\..\..\bin\ - v4.5 + v4.8 ICSharpCode.SharpDevelop @@ -275,7 +275,9 @@ Code - + + UserControl + StringListEditorDialog.xaml @@ -284,11 +286,15 @@ Code - + + Form + AsynchronousWaitDialog.cs - + + Form + AbstractAttachToProcessForm.cs @@ -425,7 +431,9 @@ Form - + + Form + NewProjectDialog.cs @@ -548,11 +556,15 @@ - + + Form + ToolNotFoundDialog.cs - + + UserControl + TabbedOptionsDialog.xaml Code @@ -673,7 +685,7 @@ UserControl - Form + UserControl Form @@ -694,10 +706,10 @@ Component - Component + UserControl - Component + UserControl SelectReferenceDialog.cs @@ -843,12 +855,18 @@ - + + Component + - - + + Form + + + UserControl + @@ -856,8 +874,12 @@ - - + + Form + + + Component + @@ -873,7 +895,9 @@ - + + Component + @@ -890,16 +914,6 @@ - - - - - - - - - - @@ -974,27 +988,6 @@ ICSharpCode.Core False - - - - - - - - - - - - - - - - - - - - - {7E4A7172-7FF5-48D0-B719-7CD959DD1AC9} ICSharpCode.Core.Presentation diff --git a/src/Main/Base/Project/Project/TargetFrameworks/TargetFramework.cs b/src/Main/Base/Project/Project/TargetFrameworks/TargetFramework.cs index 33db0178533..50f87acc8cf 100644 --- a/src/Main/Base/Project/Project/TargetFrameworks/TargetFramework.cs +++ b/src/Main/Base/Project/Project/TargetFrameworks/TargetFramework.cs @@ -38,6 +38,11 @@ public abstract class TargetFramework public static readonly TargetFramework Net45 = new DotNet4x(Versions.V4_5, RedistLists.Net45, DotnetDetection.IsDotnet45Installed); public static readonly TargetFramework Net451 = new DotNet4x(Versions.V4_5_1, RedistLists.Net45, DotnetDetection.IsDotnet451Installed); public static readonly TargetFramework Net452 = new DotNet4x(Versions.V4_5_2, RedistLists.Net45, DotnetDetection.IsDotnet452Installed); + public static readonly TargetFramework Net46 = new DotNet4x(Versions.V4_6, RedistLists.Net45, DotnetDetection.IsDotnet46Installed); + public static readonly TargetFramework Net461 = new DotNet4x(Versions.V4_6_1, RedistLists.Net45, DotnetDetection.IsDotnet461Installed); + public static readonly TargetFramework Net471 = new DotNet4x(Versions.V4_7_1, RedistLists.Net45, DotnetDetection.IsDotnet471Installed); + public static readonly TargetFramework Net472 = new DotNet4x(Versions.V4_7_2, RedistLists.Net45, DotnetDetection.IsDotnet472Installed); + public static readonly TargetFramework Net48 = new DotNet4x(Versions.V4_8, RedistLists.Net45, DotnetDetection.IsDotnet48Installed); /// /// Retrieves a target framework by a 'name'. diff --git a/src/Main/Base/Project/Src/Project/MSBuildBasedProject.cs b/src/Main/Base/Project/Src/Project/MSBuildBasedProject.cs index b96f2b3d8d1..6bc1ff8717c 100644 --- a/src/Main/Base/Project/Src/Project/MSBuildBasedProject.cs +++ b/src/Main/Base/Project/Src/Project/MSBuildBasedProject.cs @@ -1237,7 +1237,8 @@ public MSBuildBasedProject(ProjectLoadInformation loadInformation) // successful upgrade has loaded the project } else if (projectFile != null && projectFile.ToolsVersion == "12.0") { // ToolsVersion 12.0 not found: the user needs to install Microsoft Build Tools 2013 - throw new ToolNotFoundProjectLoadException(ex.Message, ex) { + throw new ToolNotFoundProjectLoadException(ex.Message, ex) + { Description = "Microsoft Build Tools 2013 are necessary for opening Visual Studio 2013 solutions.", LinkTarget = "http://www.microsoft.com/en-us/download/details.aspx?id=40760" }; diff --git a/src/Main/Base/Project/Util/DotnetDetection.cs b/src/Main/Base/Project/Util/DotnetDetection.cs index 191c1ecb2d6..95619d2519b 100644 --- a/src/Main/Base/Project/Util/DotnetDetection.cs +++ b/src/Main/Base/Project/Util/DotnetDetection.cs @@ -71,7 +71,37 @@ public static bool IsDotnet46Installed() // 393273 is .NET 4.6 on my Win7 machine with VS 2015 RC installed return GetDotnet4Release() >= 393273; } - + + public static bool IsDotnet461Installed() + { + //TODO: + return true; + } + + public static bool IsDotnet462Installed() + { + //TODO: + return true; + } + + public static bool IsDotnet471Installed() + { + //TODO: + return true; + } + + public static bool IsDotnet472Installed() + { + //TODO: + return true; + } + + public static bool IsDotnet48Installed() + { + //TODO: + return true; + } + /// /// Gets the .NET 4.x release number. /// The numbers are documented on http://msdn.microsoft.com/en-us/library/hh925568.aspx diff --git a/src/Main/Base/Project/Util/Versions.cs b/src/Main/Base/Project/Util/Versions.cs index e0a751b365c..5d25a5a15ce 100644 --- a/src/Main/Base/Project/Util/Versions.cs +++ b/src/Main/Base/Project/Util/Versions.cs @@ -32,5 +32,10 @@ static class Versions public static readonly Version V4_5 = new Version(4, 5); public static readonly Version V4_5_1 = new Version(4, 5, 1); public static readonly Version V4_5_2 = new Version(4, 5, 2); + public static readonly Version V4_6 = new Version(4, 6); + public static readonly Version V4_6_1 = new Version(4, 6, 1); + public static readonly Version V4_7_1 = new Version(4, 7, 1); + public static readonly Version V4_7_2 = new Version(4, 7, 2); + public static readonly Version V4_8 = new Version(4, 8); } } diff --git a/src/Main/Base/Test/ICSharpCode.SharpDevelop.Tests.csproj b/src/Main/Base/Test/ICSharpCode.SharpDevelop.Tests.csproj index 92321c0b2ed..2fa68445bba 100644 --- a/src/Main/Base/Test/ICSharpCode.SharpDevelop.Tests.csproj +++ b/src/Main/Base/Test/ICSharpCode.SharpDevelop.Tests.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -24,13 +24,14 @@ False AnyCPU False - v4.5 + v4.8 true True ..\..\ICSharpCode.SharpDevelop.snk False False obj\$(Configuration)\ + Auto @@ -193,9 +194,7 @@ - - - + diff --git a/src/Main/Core/Project/ICSharpCode.Core.csproj b/src/Main/Core/Project/ICSharpCode.Core.csproj index c5b859b321c..798e7009743 100644 --- a/src/Main/Core/Project/ICSharpCode.Core.csproj +++ b/src/Main/Core/Project/ICSharpCode.Core.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -18,7 +18,7 @@ Always False File - v4.5 + v4.8 False false C:\Users\daniel\AppData\Roaming\ICSharpCode/SharpDevelop3.0\Settings.SourceAnalysis @@ -142,8 +142,6 @@ - - Src\AddInTree\AddIn\AddIn.xsd diff --git a/src/Main/Core/Test/ICSharpCode.Core.Tests.csproj b/src/Main/Core/Test/ICSharpCode.Core.Tests.csproj index 5a7c80b5ab1..966c2f0b8e2 100644 --- a/src/Main/Core/Test/ICSharpCode.Core.Tests.csproj +++ b/src/Main/Core/Test/ICSharpCode.Core.Tests.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -22,7 +22,7 @@ False AnyCPU False - v4.5 + v4.8 True ..\..\ICSharpCode.SharpDevelop.snk False @@ -79,9 +79,6 @@ ICSharpCode.Core - - - - + \ No newline at end of file diff --git a/src/Main/ICSharpCode.Core.Presentation/ICSharpCode.Core.Presentation.csproj b/src/Main/ICSharpCode.Core.Presentation/ICSharpCode.Core.Presentation.csproj index 86e767f4f73..aeb6989fc6e 100644 --- a/src/Main/ICSharpCode.Core.Presentation/ICSharpCode.Core.Presentation.csproj +++ b/src/Main/ICSharpCode.Core.Presentation/ICSharpCode.Core.Presentation.csproj @@ -1,5 +1,5 @@  - + {7E4A7172-7FF5-48D0-B719-7CD959DD1AC9} Debug @@ -7,7 +7,7 @@ Library ICSharpCode.Core.Presentation ICSharpCode.Core.Presentation - v4.5 + v4.8 Properties "C:\Program Files\SharpDevelop\3.0\bin\..\AddIns\AddIns\Misc\SourceAnalysis\Settings.SourceAnalysis" ..\..\..\bin\ diff --git a/src/Main/ICSharpCode.Core.WinForms/ICSharpCode.Core.WinForms.csproj b/src/Main/ICSharpCode.Core.WinForms/ICSharpCode.Core.WinForms.csproj index d6aabfe10f4..73e2ad0cf21 100644 --- a/src/Main/ICSharpCode.Core.WinForms/ICSharpCode.Core.WinForms.csproj +++ b/src/Main/ICSharpCode.Core.WinForms/ICSharpCode.Core.WinForms.csproj @@ -1,5 +1,5 @@  - + {857CA1A3-FC88-4BE0-AB6A-D1EE772AB288} Debug @@ -7,7 +7,7 @@ Library ICSharpCode.Core.WinForms ICSharpCode.Core.WinForms - v4.5 + v4.8 Properties ..\..\..\bin\ False @@ -63,19 +63,29 @@ Properties\GlobalAssemblyInfo.cs - + + Component + Component - - + + Component + + + Component + Form - - + + Form + + + Form + Form @@ -84,11 +94,15 @@ Component - + + Component + Component - + + Component + Component diff --git a/src/Main/ICSharpCode.SharpDevelop.BuildWorker/EventTypes.cs b/src/Main/ICSharpCode.SharpDevelop.BuildWorker/EventTypes.cs index 8bfc6966bcf..2c4e9e358dd 100644 --- a/src/Main/ICSharpCode.SharpDevelop.BuildWorker/EventTypes.cs +++ b/src/Main/ICSharpCode.SharpDevelop.BuildWorker/EventTypes.cs @@ -17,7 +17,6 @@ // DEALINGS IN THE SOFTWARE. using System; -using Microsoft.Build.Framework; namespace ICSharpCode.SharpDevelop.BuildWorker { diff --git a/src/Main/ICSharpCode.SharpDevelop.BuildWorker/ICSharpCode.SharpDevelop.BuildWorker.csproj b/src/Main/ICSharpCode.SharpDevelop.BuildWorker/ICSharpCode.SharpDevelop.BuildWorker.csproj index 424ff79e3dd..1bf03482cef 100644 --- a/src/Main/ICSharpCode.SharpDevelop.BuildWorker/ICSharpCode.SharpDevelop.BuildWorker.csproj +++ b/src/Main/ICSharpCode.SharpDevelop.BuildWorker/ICSharpCode.SharpDevelop.BuildWorker.csproj @@ -1,5 +1,5 @@  - + {C3CBC8E3-81D8-4C5B-9941-DCCD12D50B1F} Debug @@ -7,7 +7,7 @@ Exe ICSharpCode.SharpDevelop.BuildWorker ICSharpCode.SharpDevelop.BuildWorker40 - v4.5 + v4.8 False False 4 @@ -23,6 +23,8 @@ False obj\$(Configuration)\ + + true @@ -49,16 +51,22 @@ - - - 4.0 - + 3.5 + + + + + + + + + @@ -81,4 +89,9 @@ false + + + 17.4.0 + + \ No newline at end of file diff --git a/src/Main/ICSharpCode.SharpDevelop.BuildWorker/app.config b/src/Main/ICSharpCode.SharpDevelop.BuildWorker/app.config index 5691c95e4cf..aed811a16ff 100644 --- a/src/Main/ICSharpCode.SharpDevelop.BuildWorker/app.config +++ b/src/Main/ICSharpCode.SharpDevelop.BuildWorker/app.config @@ -5,7 +5,7 @@
- + @@ -22,6 +22,18 @@ + + + + + + + + + + + + diff --git a/src/Main/ICSharpCode.SharpDevelop.BuildWorker120/ICSharpCode.SharpDevelop.BuildWorker120.csproj b/src/Main/ICSharpCode.SharpDevelop.BuildWorker120/ICSharpCode.SharpDevelop.BuildWorker120.csproj index 9bc7e6672d7..e5e9471b4f6 100644 --- a/src/Main/ICSharpCode.SharpDevelop.BuildWorker120/ICSharpCode.SharpDevelop.BuildWorker120.csproj +++ b/src/Main/ICSharpCode.SharpDevelop.BuildWorker120/ICSharpCode.SharpDevelop.BuildWorker120.csproj @@ -1,5 +1,5 @@  - + {6F273DA5-E10C-45A6-9071-7313ECD98C90} Debug @@ -7,7 +7,7 @@ Exe ICSharpCode.SharpDevelop.BuildWorker ICSharpCode.SharpDevelop.BuildWorker120 - v4.5.1 + v4.8 False False 4 @@ -23,6 +23,8 @@ False obj\$(Configuration)\ + + true @@ -49,14 +51,22 @@ - - + 3.5 + + + + + + + + + @@ -93,7 +103,9 @@ - + + 17.4.0 + diff --git a/src/Main/ICSharpCode.SharpDevelop.BuildWorker120/app.config b/src/Main/ICSharpCode.SharpDevelop.BuildWorker120/app.config index 0e9d54308b6..f2b46dcedb1 100644 --- a/src/Main/ICSharpCode.SharpDevelop.BuildWorker120/app.config +++ b/src/Main/ICSharpCode.SharpDevelop.BuildWorker120/app.config @@ -5,27 +5,39 @@
- + - - + + - - + + - - + + - - + + + + + + + + + + + + + + diff --git a/src/Main/ICSharpCode.SharpDevelop.BuildWorker140/ICSharpCode.SharpDevelop.BuildWorker140.csproj b/src/Main/ICSharpCode.SharpDevelop.BuildWorker140/ICSharpCode.SharpDevelop.BuildWorker140.csproj index 25d5ca2be7f..8e2091caf3c 100644 --- a/src/Main/ICSharpCode.SharpDevelop.BuildWorker140/ICSharpCode.SharpDevelop.BuildWorker140.csproj +++ b/src/Main/ICSharpCode.SharpDevelop.BuildWorker140/ICSharpCode.SharpDevelop.BuildWorker140.csproj @@ -1,5 +1,5 @@  - + {7BA66A6B-1ED8-4B4C-970C-8928E891418B} Debug @@ -7,7 +7,7 @@ Exe ICSharpCode.SharpDevelop.BuildWorker ICSharpCode.SharpDevelop.BuildWorker140 - v4.5.1 + v4.8 False False 4 @@ -23,6 +23,8 @@ False obj\$(Configuration)\ + + true @@ -49,12 +51,20 @@ - - + + + + + + + + + + @@ -91,7 +101,9 @@ - + + 17.4.0 + diff --git a/src/Main/ICSharpCode.SharpDevelop.BuildWorker140/app.config b/src/Main/ICSharpCode.SharpDevelop.BuildWorker140/app.config index 155efda1cf0..20db1200f01 100644 --- a/src/Main/ICSharpCode.SharpDevelop.BuildWorker140/app.config +++ b/src/Main/ICSharpCode.SharpDevelop.BuildWorker140/app.config @@ -5,35 +5,47 @@
- + - - + + - - + + - - + + - - + + - - + + - - + + + + + + + + + + + + + + diff --git a/src/Main/ICSharpCode.SharpDevelop.BuildWorker35/ICSharpCode.SharpDevelop.BuildWorker35.csproj b/src/Main/ICSharpCode.SharpDevelop.BuildWorker35/ICSharpCode.SharpDevelop.BuildWorker35.csproj index 3dcd0e8da64..dd894b474cf 100644 --- a/src/Main/ICSharpCode.SharpDevelop.BuildWorker35/ICSharpCode.SharpDevelop.BuildWorker35.csproj +++ b/src/Main/ICSharpCode.SharpDevelop.BuildWorker35/ICSharpCode.SharpDevelop.BuildWorker35.csproj @@ -1,5 +1,5 @@  - + {B5F54272-49F0-40DB-845A-8D837875D3BA} Debug @@ -7,7 +7,7 @@ Exe ICSharpCode.SharpDevelop.BuildWorker35 ICSharpCode.SharpDevelop.BuildWorker35 - v3.5 + v4.8 Properties ..\..\..\bin\ False @@ -16,6 +16,9 @@ False False obj\$(Configuration)\ + + + x86 @@ -39,15 +42,30 @@ False TRACE;MSBUILD35 + + false + + + false + - + 3.5 + + + + + + + + + @@ -84,5 +102,10 @@ false + + + 17.4.0 + + \ No newline at end of file diff --git a/src/Main/ICSharpCode.SharpDevelop.BuildWorker35/app.config b/src/Main/ICSharpCode.SharpDevelop.BuildWorker35/app.config index aa701ee4ae4..f3d92e6027c 100644 --- a/src/Main/ICSharpCode.SharpDevelop.BuildWorker35/app.config +++ b/src/Main/ICSharpCode.SharpDevelop.BuildWorker35/app.config @@ -1,15 +1,28 @@ + - - + + - - + + + + + + + + + + + + + + - + diff --git a/src/Main/ICSharpCode.SharpDevelop.Widgets/Project/ICSharpCode.SharpDevelop.Widgets.csproj b/src/Main/ICSharpCode.SharpDevelop.Widgets/Project/ICSharpCode.SharpDevelop.Widgets.csproj index 23429a1a62d..5cc96d7a122 100644 --- a/src/Main/ICSharpCode.SharpDevelop.Widgets/Project/ICSharpCode.SharpDevelop.Widgets.csproj +++ b/src/Main/ICSharpCode.SharpDevelop.Widgets/Project/ICSharpCode.SharpDevelop.Widgets.csproj @@ -1,5 +1,5 @@  - + Library ICSharpCode.SharpDevelop.Widgets @@ -16,7 +16,7 @@ ..\..\ICSharpCode.SharpDevelop.snk False File - v4.5 + v4.8 @@ -123,11 +123,7 @@ - - - - - + diff --git a/src/Main/SharpDevelop/Parser/AssemblyParserService.cs b/src/Main/SharpDevelop/Parser/AssemblyParserService.cs index 1b2959abb5a..37d49970836 100644 --- a/src/Main/SharpDevelop/Parser/AssemblyParserService.cs +++ b/src/Main/SharpDevelop/Parser/AssemblyParserService.cs @@ -183,6 +183,11 @@ LoadedAssembly LoadAssembly(FileName fileName, CancellationToken cancellationTok // used to prevent Cecil from loading referenced assemblies sealed class DummyAssemblyResolver : IAssemblyResolver { + public void Dispose() + { + + } + public AssemblyDefinition Resolve(AssemblyNameReference name) { return null; diff --git a/src/Main/SharpDevelop/SharpDevelop.csproj b/src/Main/SharpDevelop/SharpDevelop.csproj index 02db097b4fe..98385820f70 100644 --- a/src/Main/SharpDevelop/SharpDevelop.csproj +++ b/src/Main/SharpDevelop/SharpDevelop.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -23,7 +23,7 @@ False False File - v4.5 + v4.8 app.manifest @@ -31,6 +31,8 @@ 436 False obj\$(Configuration)\ + + Full @@ -62,8 +64,6 @@ ..\..\Libraries\log4net\log4net.dll - - 3.0 @@ -72,7 +72,17 @@ + + + + + + + + + + @@ -149,15 +159,21 @@ - + + Form + AddNewConfigurationDialog.cs - + + Form + EditAvailableConfigurationsDialog.cs - + + Form + SolutionConfigurationEditor.cs @@ -175,7 +191,9 @@ - + + Form + @@ -196,14 +214,18 @@ - + + Form + AddOpenWithEntryDialog.cs - + + Form + OpenWithDialog.cs @@ -221,7 +243,9 @@ - + + Form + @@ -330,27 +354,12 @@ - - - - - - - - - - - - - - - - - - - - - + + 17.4.0 + + + 1.5.5 + diff --git a/src/Main/SharpDevelop/Startup/App.xaml.cs b/src/Main/SharpDevelop/Startup/App.xaml.cs index d51a9a691be..8e43490019b 100644 --- a/src/Main/SharpDevelop/Startup/App.xaml.cs +++ b/src/Main/SharpDevelop/Startup/App.xaml.cs @@ -16,7 +16,9 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. +using Microsoft.Build.Locator; using System; +using System.Linq; using System.Windows; namespace ICSharpCode.SharpDevelop.Startup @@ -28,6 +30,9 @@ partial class App : Application { public App() { + //MSBuildLocator.RegisterInstance(MSBuildLocator.QueryVisualStudioInstances().OrderByDescending( + //instance => instance.Version).First()); + MSBuildLocator.RegisterDefaults(); InitializeComponent(); } } diff --git a/src/Main/SharpDevelop/Templates/Project/ProjectTemplateImpl.cs b/src/Main/SharpDevelop/Templates/Project/ProjectTemplateImpl.cs index 2343b748c24..dab0c746a5a 100644 --- a/src/Main/SharpDevelop/Templates/Project/ProjectTemplateImpl.cs +++ b/src/Main/SharpDevelop/Templates/Project/ProjectTemplateImpl.cs @@ -180,7 +180,7 @@ public ProjectTemplateImpl(XmlDocument doc, IReadOnlyFileSystem fileSystem) if (config["SupportedTargetFrameworks"] != null) { var specifiedTargetFrameworks = config["SupportedTargetFrameworks"].InnerText.Split(';') - .Select(TargetFramework.GetByName).ToArray(); + .Select(TargetFramework.GetByName).ToArray(); supportedTargetFrameworks = SD.ProjectService.TargetFrameworks.Where(fx => specifiedTargetFrameworks.Any(s => fx.IsBasedOn(s))).ToArray(); } else { diff --git a/src/Main/SharpDevelop/app.template.config b/src/Main/SharpDevelop/app.template.config index 40a0be1c0b0..5ab52bb1c3c 100644 --- a/src/Main/SharpDevelop/app.template.config +++ b/src/Main/SharpDevelop/app.template.config @@ -56,7 +56,7 @@ - +