├── .gitignore ├── .nuget ├── NuGet.Config ├── NuGet.exe └── NuGet.targets ├── I'm Only Resting.sln ├── Ior.Forms.PropertyGridEx ├── BrowsableTypeConverter.cs ├── CustomChoices.cs ├── CustomColorScheme.cs ├── CustomProperty.cs ├── CustomPropertyCollection.cs ├── CustomPropertyCollectionSet.cs ├── Ior.Forms.PropertyGridEx.csproj ├── Properties │ └── AssemblyInfo.cs ├── PropertyGridEx.Designer.cs ├── PropertyGridEx.cs ├── UICustomEventEditor.cs ├── UIFilenameEditor.cs └── UIListboxEditor.cs ├── Ior ├── Core │ ├── IorClient.cs │ ├── IorContentType.cs │ ├── LogMessageModel.cs │ ├── RequestModel.cs │ ├── RequestResponseSnapshot.cs │ ├── RequestViewModel.cs │ ├── ResponseBodyOutput.cs │ ├── ResponseModel.cs │ └── SettingsViewModel.cs ├── Forms │ ├── AboutBox.Designer.cs │ ├── AboutBox.cs │ ├── AboutBox.resx │ ├── ControlHelpers.cs │ ├── LogViewer.Designer.cs │ ├── LogViewer.cs │ ├── LogViewer.resx │ ├── MainForm.Designer.cs │ ├── MainForm.cs │ ├── MainForm.resx │ ├── SettingsDialog.Designer.cs │ ├── SettingsDialog.cs │ ├── SettingsDialog.resx │ ├── StandardScintilla.cs │ └── StandardTextBox.cs ├── Ior.csproj ├── NLog.Debug.config ├── NLog.Release.config ├── NLog.config ├── NLog.xsd ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── HistorySettings.Designer.cs │ ├── HistorySettings.cs │ ├── HistorySettings.settings │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ ├── Settings.cs │ ├── Settings.settings │ └── SlowCheetah │ │ └── SlowCheetah.Transforms.targets ├── Resources │ └── Camera.ico ├── app.config ├── logo.ico └── packages.config ├── LICENSE ├── NOTICE ├── README.md ├── Tests.IorTests ├── Core │ ├── IorClientTests.cs │ ├── IorContentTypeTests.cs │ ├── RequestModelTests.cs │ └── RequestViewModelTests.cs ├── Properties │ └── AssemblyInfo.cs ├── Tests.IorTests.csproj └── packages.config ├── Utils ├── FilePathFormatter.cs ├── FileUtils.cs ├── HistoryList.cs ├── IEnumerableUtils.cs ├── Properties │ └── AssemblyInfo.cs ├── StringUtils.cs └── Utils.csproj ├── archive-release.bat ├── lib ├── scintilla │ ├── License.txt │ ├── ReadMe.htm │ ├── SciLexer.dll │ ├── ScintillaNET.dll │ └── ScintillaNET.xml └── tidy │ ├── TidyManaged.dll │ ├── TidyManaged.xml │ └── libtidy.dll └── tools └── 7z ├── 7za.exe ├── license.txt └── readme.txt /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | builds/ 25 | 26 | # Visual Studio 2015 cache/options directory 27 | .vs/ 28 | # Uncomment if you have tasks that create the project's static files in wwwroot 29 | #wwwroot/ 30 | 31 | # MSTest test Results 32 | [Tt]est[Rr]esult*/ 33 | [Bb]uild[Ll]og.* 34 | 35 | # NUNIT 36 | *.VisualState.xml 37 | TestResult.xml 38 | 39 | # Build Results of an ATL Project 40 | [Dd]ebugPS/ 41 | [Rr]eleasePS/ 42 | dlldata.c 43 | 44 | # DNX 45 | project.lock.json 46 | project.fragment.lock.json 47 | artifacts/ 48 | 49 | *_i.c 50 | *_p.c 51 | *_i.h 52 | *.ilk 53 | *.meta 54 | *.obj 55 | *.pch 56 | *.pdb 57 | *.pgc 58 | *.pgd 59 | *.rsp 60 | *.sbr 61 | *.tlb 62 | *.tli 63 | *.tlh 64 | *.tmp 65 | *.tmp_proj 66 | *.log 67 | *.vspscc 68 | *.vssscc 69 | .builds 70 | *.pidb 71 | *.svclog 72 | *.scc 73 | 74 | # Chutzpah Test files 75 | _Chutzpah* 76 | 77 | # Visual C++ cache files 78 | ipch/ 79 | *.aps 80 | *.ncb 81 | *.opendb 82 | *.opensdf 83 | *.sdf 84 | *.cachefile 85 | *.VC.db 86 | *.VC.VC.opendb 87 | 88 | # Visual Studio profiler 89 | *.psess 90 | *.vsp 91 | *.vspx 92 | *.sap 93 | 94 | # TFS 2012 Local Workspace 95 | $tf/ 96 | 97 | # Guidance Automation Toolkit 98 | *.gpState 99 | 100 | # ReSharper is a .NET coding add-in 101 | _ReSharper*/ 102 | *.[Rr]e[Ss]harper 103 | *.DotSettings.user 104 | 105 | # JustCode is a .NET coding add-in 106 | .JustCode 107 | 108 | # TeamCity is a build add-in 109 | _TeamCity* 110 | 111 | # DotCover is a Code Coverage Tool 112 | *.dotCover 113 | 114 | # NCrunch 115 | _NCrunch_* 116 | .*crunch*.local.xml 117 | nCrunchTemp_* 118 | 119 | # MightyMoose 120 | *.mm.* 121 | AutoTest.Net/ 122 | 123 | # Web workbench (sass) 124 | .sass-cache/ 125 | 126 | # Installshield output folder 127 | [Ee]xpress/ 128 | 129 | # DocProject is a documentation generator add-in 130 | DocProject/buildhelp/ 131 | DocProject/Help/*.HxT 132 | DocProject/Help/*.HxC 133 | DocProject/Help/*.hhc 134 | DocProject/Help/*.hhk 135 | DocProject/Help/*.hhp 136 | DocProject/Help/Html2 137 | DocProject/Help/html 138 | 139 | # Click-Once directory 140 | publish/ 141 | 142 | # Publish Web Output 143 | *.[Pp]ublish.xml 144 | *.azurePubxml 145 | # TODO: Comment the next line if you want to checkin your web deploy settings 146 | # but database connection strings (with potential passwords) will be unencrypted 147 | *.pubxml 148 | *.publishproj 149 | 150 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 151 | # checkin your Azure Web App publish settings, but sensitive information contained 152 | # in these scripts will be unencrypted 153 | PublishScripts/ 154 | 155 | # NuGet Packages 156 | *.nupkg 157 | # The packages folder can be ignored because of Package Restore 158 | **/packages/* 159 | # except build/, which is used as an MSBuild target. 160 | !**/packages/build/ 161 | # Uncomment if necessary however generally it will be regenerated when needed 162 | #!**/packages/repositories.config 163 | # NuGet v3's project.json files produces more ignoreable files 164 | *.nuget.props 165 | *.nuget.targets 166 | 167 | # Microsoft Azure Build Output 168 | csx/ 169 | *.build.csdef 170 | 171 | # Microsoft Azure Emulator 172 | ecf/ 173 | rcf/ 174 | 175 | # Windows Store app package directories and files 176 | AppPackages/ 177 | BundleArtifacts/ 178 | Package.StoreAssociation.xml 179 | _pkginfo.txt 180 | 181 | # Visual Studio cache files 182 | # files ending in .cache can be ignored 183 | *.[Cc]ache 184 | # but keep track of directories ending in .cache 185 | !*.[Cc]ache/ 186 | 187 | # Others 188 | ClientBin/ 189 | ~$* 190 | *~ 191 | *.dbmdl 192 | *.dbproj.schemaview 193 | *.pfx 194 | *.publishsettings 195 | node_modules/ 196 | orleans.codegen.cs 197 | 198 | # Since there are multiple workflows, uncomment next line to ignore bower_components 199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 200 | #bower_components/ 201 | 202 | # RIA/Silverlight projects 203 | Generated_Code/ 204 | 205 | # Backup & report files from converting an old project file 206 | # to a newer Visual Studio version. Backup files are not needed, 207 | # because we have git ;-) 208 | _UpgradeReport_Files/ 209 | Backup*/ 210 | UpgradeLog*.XML 211 | UpgradeLog*.htm 212 | 213 | # SQL Server files 214 | *.mdf 215 | *.ldf 216 | 217 | # Business Intelligence projects 218 | *.rdl.data 219 | *.bim.layout 220 | *.bim_*.settings 221 | 222 | # Microsoft Fakes 223 | FakesAssemblies/ 224 | 225 | # GhostDoc plugin setting file 226 | *.GhostDoc.xml 227 | 228 | # Node.js Tools for Visual Studio 229 | .ntvs_analysis.dat 230 | 231 | # Visual Studio 6 build log 232 | *.plg 233 | 234 | # Visual Studio 6 workspace options file 235 | *.opt 236 | 237 | # Visual Studio LightSwitch build output 238 | **/*.HTMLClient/GeneratedArtifacts 239 | **/*.DesktopClient/GeneratedArtifacts 240 | **/*.DesktopClient/ModelManifest.xml 241 | **/*.Server/GeneratedArtifacts 242 | **/*.Server/ModelManifest.xml 243 | _Pvt_Extensions 244 | 245 | # Paket dependency manager 246 | .paket/paket.exe 247 | paket-files/ 248 | 249 | # FAKE - F# Make 250 | .fake/ 251 | 252 | # JetBrains Rider 253 | .idea/ 254 | *.sln.iml 255 | -------------------------------------------------------------------------------- /.nuget/NuGet.Config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.nuget/NuGet.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SwensenSoftware/im-only-resting/0c3709024810d886a2f1919a692886f286e7a082/.nuget/NuGet.exe -------------------------------------------------------------------------------- /.nuget/NuGet.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildProjectDirectory)\..\ 5 | 6 | 7 | false 8 | 9 | 10 | false 11 | 12 | 13 | true 14 | 15 | 16 | false 17 | 18 | 19 | 20 | 21 | 25 | 26 | 27 | 28 | 29 | $([System.IO.Path]::Combine($(SolutionDir), ".nuget")) 30 | $([System.IO.Path]::Combine($(ProjectDir), "packages.config")) 31 | $([System.IO.Path]::Combine($(SolutionDir), "packages")) 32 | 33 | 34 | 35 | 36 | $(SolutionDir).nuget 37 | packages.config 38 | $(SolutionDir)packages 39 | 40 | 41 | 42 | 43 | $(NuGetToolsPath)\nuget.exe 44 | @(PackageSource) 45 | 46 | "$(NuGetExePath)" 47 | mono --runtime=v4.0.30319 $(NuGetExePath) 48 | 49 | $(TargetDir.Trim('\\')) 50 | 51 | -RequireConsent 52 | 53 | $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(RequireConsentSwitch) -o "$(PackagesDir)" 54 | $(NuGetCommand) pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols 55 | 56 | 57 | 58 | RestorePackages; 59 | $(BuildDependsOn); 60 | 61 | 62 | 63 | 64 | $(BuildDependsOn); 65 | BuildPackage; 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 79 | 80 | 83 | 84 | 85 | 86 | 88 | 89 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 140 | 141 | 142 | 143 | -------------------------------------------------------------------------------- /I'm Only Resting.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.30501.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{9507BF54-C5F1-4314-BD6F-462F2CD503EC}" 7 | ProjectSection(SolutionItems) = preProject 8 | .nuget\NuGet.Config = .nuget\NuGet.Config 9 | .nuget\NuGet.exe = .nuget\NuGet.exe 10 | .nuget\NuGet.targets = .nuget\NuGet.targets 11 | EndProjectSection 12 | EndProject 13 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{AD36E669-B965-4D46-B1C3-28FDDB983EE5}" 14 | ProjectSection(SolutionItems) = preProject 15 | archive-release.bat = archive-release.bat 16 | LICENSE = LICENSE 17 | NOTICE = NOTICE 18 | EndProjectSection 19 | EndProject 20 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ior.Forms.PropertyGridEx", "Ior.Forms.PropertyGridEx\Ior.Forms.PropertyGridEx.csproj", "{B0BB47F2-21C4-41FC-B6E6-40757ADFC4A1}" 21 | EndProject 22 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ior", "Ior\Ior.csproj", "{B859DACC-2D94-46FC-973C-17EF37A5F64F}" 23 | EndProject 24 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Utils", "Utils\Utils.csproj", "{937C9CDB-4994-41F8-9219-50A63E6248A6}" 25 | EndProject 26 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests.IorTests", "Tests.IorTests\Tests.IorTests.csproj", "{E18906ED-D117-49FF-A592-D724F5FDCB48}" 27 | EndProject 28 | Global 29 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 30 | Debug|Any CPU = Debug|Any CPU 31 | Debug|Mixed Platforms = Debug|Mixed Platforms 32 | Debug|x86 = Debug|x86 33 | Release|Any CPU = Release|Any CPU 34 | Release|Mixed Platforms = Release|Mixed Platforms 35 | Release|x86 = Release|x86 36 | EndGlobalSection 37 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 38 | {B0BB47F2-21C4-41FC-B6E6-40757ADFC4A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 39 | {B0BB47F2-21C4-41FC-B6E6-40757ADFC4A1}.Debug|Any CPU.Build.0 = Debug|Any CPU 40 | {B0BB47F2-21C4-41FC-B6E6-40757ADFC4A1}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 41 | {B0BB47F2-21C4-41FC-B6E6-40757ADFC4A1}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 42 | {B0BB47F2-21C4-41FC-B6E6-40757ADFC4A1}.Debug|x86.ActiveCfg = Debug|Any CPU 43 | {B0BB47F2-21C4-41FC-B6E6-40757ADFC4A1}.Release|Any CPU.ActiveCfg = Release|Any CPU 44 | {B0BB47F2-21C4-41FC-B6E6-40757ADFC4A1}.Release|Any CPU.Build.0 = Release|Any CPU 45 | {B0BB47F2-21C4-41FC-B6E6-40757ADFC4A1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 46 | {B0BB47F2-21C4-41FC-B6E6-40757ADFC4A1}.Release|Mixed Platforms.Build.0 = Release|Any CPU 47 | {B0BB47F2-21C4-41FC-B6E6-40757ADFC4A1}.Release|x86.ActiveCfg = Release|Any CPU 48 | {B859DACC-2D94-46FC-973C-17EF37A5F64F}.Debug|Any CPU.ActiveCfg = Debug|x86 49 | {B859DACC-2D94-46FC-973C-17EF37A5F64F}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 50 | {B859DACC-2D94-46FC-973C-17EF37A5F64F}.Debug|Mixed Platforms.Build.0 = Debug|x86 51 | {B859DACC-2D94-46FC-973C-17EF37A5F64F}.Debug|x86.ActiveCfg = Debug|x86 52 | {B859DACC-2D94-46FC-973C-17EF37A5F64F}.Debug|x86.Build.0 = Debug|x86 53 | {B859DACC-2D94-46FC-973C-17EF37A5F64F}.Release|Any CPU.ActiveCfg = Release|x86 54 | {B859DACC-2D94-46FC-973C-17EF37A5F64F}.Release|Mixed Platforms.ActiveCfg = Release|x86 55 | {B859DACC-2D94-46FC-973C-17EF37A5F64F}.Release|Mixed Platforms.Build.0 = Release|x86 56 | {B859DACC-2D94-46FC-973C-17EF37A5F64F}.Release|x86.ActiveCfg = Release|x86 57 | {B859DACC-2D94-46FC-973C-17EF37A5F64F}.Release|x86.Build.0 = Release|x86 58 | {937C9CDB-4994-41F8-9219-50A63E6248A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 59 | {937C9CDB-4994-41F8-9219-50A63E6248A6}.Debug|Any CPU.Build.0 = Debug|Any CPU 60 | {937C9CDB-4994-41F8-9219-50A63E6248A6}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 61 | {937C9CDB-4994-41F8-9219-50A63E6248A6}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 62 | {937C9CDB-4994-41F8-9219-50A63E6248A6}.Debug|x86.ActiveCfg = Debug|Any CPU 63 | {937C9CDB-4994-41F8-9219-50A63E6248A6}.Release|Any CPU.ActiveCfg = Release|Any CPU 64 | {937C9CDB-4994-41F8-9219-50A63E6248A6}.Release|Any CPU.Build.0 = Release|Any CPU 65 | {937C9CDB-4994-41F8-9219-50A63E6248A6}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 66 | {937C9CDB-4994-41F8-9219-50A63E6248A6}.Release|Mixed Platforms.Build.0 = Release|Any CPU 67 | {937C9CDB-4994-41F8-9219-50A63E6248A6}.Release|x86.ActiveCfg = Release|Any CPU 68 | {E18906ED-D117-49FF-A592-D724F5FDCB48}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 69 | {E18906ED-D117-49FF-A592-D724F5FDCB48}.Debug|Any CPU.Build.0 = Debug|Any CPU 70 | {E18906ED-D117-49FF-A592-D724F5FDCB48}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 71 | {E18906ED-D117-49FF-A592-D724F5FDCB48}.Debug|Mixed Platforms.Build.0 = Debug|x86 72 | {E18906ED-D117-49FF-A592-D724F5FDCB48}.Debug|x86.ActiveCfg = Debug|Any CPU 73 | {E18906ED-D117-49FF-A592-D724F5FDCB48}.Release|Any CPU.ActiveCfg = Release|Any CPU 74 | {E18906ED-D117-49FF-A592-D724F5FDCB48}.Release|Any CPU.Build.0 = Release|Any CPU 75 | {E18906ED-D117-49FF-A592-D724F5FDCB48}.Release|Mixed Platforms.ActiveCfg = Release|x86 76 | {E18906ED-D117-49FF-A592-D724F5FDCB48}.Release|Mixed Platforms.Build.0 = Release|x86 77 | {E18906ED-D117-49FF-A592-D724F5FDCB48}.Release|x86.ActiveCfg = Release|Any CPU 78 | EndGlobalSection 79 | GlobalSection(SolutionProperties) = preSolution 80 | HideSolutionNode = FALSE 81 | EndGlobalSection 82 | EndGlobal 83 | -------------------------------------------------------------------------------- /Ior.Forms.PropertyGridEx/BrowsableTypeConverter.cs: -------------------------------------------------------------------------------- 1 | namespace Swensen.Ior.Forms 2 | { 3 | using System; 4 | using System.ComponentModel; 5 | using System.Globalization; 6 | using System.Runtime.CompilerServices; 7 | 8 | public class BrowsableTypeConverter : ExpandableObjectConverter 9 | { 10 | public enum LabelStyle 11 | { 12 | lsNormal, 13 | lsTypeName, 14 | lsEllipsis 15 | } 16 | 17 | public class BrowsableLabelStyleAttribute : Attribute 18 | { 19 | 20 | private LabelStyle eLabelStyle = LabelStyle.lsNormal; 21 | public BrowsableLabelStyleAttribute(LabelStyle LabelStyle) 22 | { 23 | eLabelStyle = LabelStyle; 24 | } 25 | public LabelStyle LabelStyle 26 | { 27 | get 28 | { 29 | return eLabelStyle; 30 | } 31 | set 32 | { 33 | eLabelStyle = value; 34 | } 35 | } 36 | } 37 | 38 | public override bool CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Type destinationType) 39 | { 40 | return true; 41 | } 42 | 43 | public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) 44 | { 45 | BrowsableLabelStyleAttribute attribute1 = (BrowsableLabelStyleAttribute)context.PropertyDescriptor.Attributes[typeof(BrowsableLabelStyleAttribute)]; 46 | if (attribute1 != null) 47 | { 48 | switch (attribute1.LabelStyle) 49 | { 50 | case LabelStyle.lsNormal: 51 | { 52 | return base.ConvertTo(context, culture, RuntimeHelpers.GetObjectValue(value), destinationType); 53 | } 54 | case LabelStyle.lsTypeName: 55 | { 56 | return ("(" + value.GetType().Name + ")"); 57 | } 58 | case LabelStyle.lsEllipsis: 59 | { 60 | return "(...)"; 61 | } 62 | } 63 | } 64 | return base.ConvertTo(context, culture, RuntimeHelpers.GetObjectValue(value), destinationType); 65 | } 66 | 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /Ior.Forms.PropertyGridEx/CustomChoices.cs: -------------------------------------------------------------------------------- 1 | namespace Swensen.Ior.Forms 2 | { 3 | using System; 4 | using System.Collections; 5 | using System.ComponentModel; 6 | using System.Windows.Forms; 7 | 8 | [Serializable()]public class CustomChoices : ArrayList 9 | { 10 | public CustomChoices(ArrayList array, bool IsSorted) 11 | { 12 | this.AddRange(array); 13 | if (IsSorted) 14 | { 15 | this.Sort(); 16 | } 17 | } 18 | 19 | public CustomChoices(ArrayList array) 20 | { 21 | this.AddRange(array); 22 | } 23 | 24 | public CustomChoices(string[] array, bool IsSorted) 25 | { 26 | this.AddRange(array); 27 | if (IsSorted) 28 | { 29 | this.Sort(); 30 | } 31 | } 32 | 33 | public CustomChoices(string[] array) 34 | { 35 | this.AddRange(array); 36 | } 37 | 38 | public CustomChoices(int[] array, bool IsSorted) 39 | { 40 | this.AddRange(array); 41 | if (IsSorted) 42 | { 43 | this.Sort(); 44 | } 45 | } 46 | 47 | public CustomChoices(int[] array) 48 | { 49 | this.AddRange(array); 50 | } 51 | 52 | public CustomChoices(double[] array, bool IsSorted) 53 | { 54 | this.AddRange(array); 55 | if (IsSorted) 56 | { 57 | this.Sort(); 58 | } 59 | } 60 | 61 | public CustomChoices(double[] array) 62 | { 63 | this.AddRange(array); 64 | } 65 | 66 | public CustomChoices(object[] array, bool IsSorted) 67 | { 68 | this.AddRange(array); 69 | if (IsSorted) 70 | { 71 | this.Sort(); 72 | } 73 | } 74 | 75 | public CustomChoices(object[] array) 76 | { 77 | this.AddRange(array); 78 | } 79 | 80 | public ArrayList Items 81 | { 82 | get 83 | { 84 | return this; 85 | } 86 | } 87 | 88 | public class CustomChoicesTypeConverter : TypeConverter 89 | { 90 | 91 | private CustomChoicesAttributeList oChoices = null; 92 | public override bool GetStandardValuesSupported(System.ComponentModel.ITypeDescriptorContext context) 93 | { 94 | bool returnValue; 95 | CustomChoicesAttributeList Choices = (CustomChoicesAttributeList) context.PropertyDescriptor.Attributes[typeof(CustomChoicesAttributeList)]; 96 | if (oChoices != null) 97 | { 98 | return true; 99 | } 100 | if (Choices != null) 101 | { 102 | oChoices = Choices; 103 | returnValue = true; 104 | } 105 | else 106 | { 107 | returnValue = false; 108 | } 109 | return returnValue; 110 | } 111 | public override bool GetStandardValuesExclusive(System.ComponentModel.ITypeDescriptorContext context) 112 | { 113 | bool returnValue; 114 | CustomChoicesAttributeList Choices = (CustomChoicesAttributeList) context.PropertyDescriptor.Attributes[typeof(CustomChoicesAttributeList)]; 115 | if (oChoices != null) 116 | { 117 | return true; 118 | } 119 | if (Choices != null) 120 | { 121 | oChoices = Choices; 122 | returnValue = true; 123 | } 124 | else 125 | { 126 | returnValue = false; 127 | } 128 | return returnValue; 129 | } 130 | public override System.ComponentModel.TypeConverter.StandardValuesCollection GetStandardValues(System.ComponentModel.ITypeDescriptorContext context) 131 | { 132 | CustomChoicesAttributeList Choices = (CustomChoices.CustomChoicesAttributeList) context.PropertyDescriptor.Attributes[typeof(CustomChoicesAttributeList)]; 133 | if (oChoices != null) 134 | { 135 | return oChoices.Values; 136 | } 137 | return base.GetStandardValues(context); 138 | } 139 | } 140 | 141 | public class CustomChoicesAttributeList : Attribute 142 | { 143 | 144 | private ArrayList oList = new ArrayList(); 145 | 146 | public ArrayList Item 147 | { 148 | get 149 | { 150 | return this.oList; 151 | } 152 | } 153 | 154 | public TypeConverter.StandardValuesCollection Values 155 | { 156 | get 157 | { 158 | return new TypeConverter.StandardValuesCollection(this.oList); 159 | } 160 | } 161 | 162 | public CustomChoicesAttributeList(string[] List) 163 | { 164 | oList.AddRange(List); 165 | } 166 | 167 | public CustomChoicesAttributeList(ArrayList List) 168 | { 169 | oList.AddRange(List); 170 | } 171 | 172 | public CustomChoicesAttributeList(ListBox.ObjectCollection List) 173 | { 174 | oList.AddRange(List); 175 | } 176 | } 177 | } 178 | } 179 | -------------------------------------------------------------------------------- /Ior.Forms.PropertyGridEx/CustomColorScheme.cs: -------------------------------------------------------------------------------- 1 | namespace Swensen.Ior.Forms 2 | { 3 | using System.Drawing; 4 | using System.Windows.Forms; 5 | 6 | public class CustomColorScheme : ProfessionalColorTable 7 | { 8 | 9 | 10 | public override Color ButtonCheckedGradientBegin 11 | { 12 | get 13 | { 14 | return Color.FromArgb(0xC1, 210, 0xEE); 15 | } 16 | } 17 | 18 | public override Color ButtonCheckedGradientEnd 19 | { 20 | get 21 | { 22 | return Color.FromArgb(0xC1, 210, 0xEE); 23 | } 24 | } 25 | 26 | public override Color ButtonCheckedGradientMiddle 27 | { 28 | get 29 | { 30 | return Color.FromArgb(0xC1, 210, 0xEE); 31 | } 32 | } 33 | 34 | public override Color ButtonPressedBorder 35 | { 36 | get 37 | { 38 | return Color.FromArgb(0x31, 0x6A, 0xC5); 39 | } 40 | } 41 | 42 | public override Color ButtonPressedGradientBegin 43 | { 44 | get 45 | { 46 | return Color.FromArgb(0x98, 0xB5, 0xE2); 47 | } 48 | } 49 | 50 | public override Color ButtonPressedGradientEnd 51 | { 52 | get 53 | { 54 | return Color.FromArgb(0x98, 0xB5, 0xE2); 55 | } 56 | } 57 | 58 | public override Color ButtonPressedGradientMiddle 59 | { 60 | get 61 | { 62 | return Color.FromArgb(0x98, 0xB5, 0xE2); 63 | } 64 | } 65 | 66 | public override Color ButtonSelectedBorder 67 | { 68 | get 69 | { 70 | return base.ButtonSelectedBorder; 71 | } 72 | } 73 | 74 | public override Color ButtonSelectedGradientBegin 75 | { 76 | get 77 | { 78 | return Color.FromArgb(0xC1, 210, 0xEE); 79 | } 80 | } 81 | 82 | public override Color ButtonSelectedGradientEnd 83 | { 84 | get 85 | { 86 | return Color.FromArgb(0xC1, 210, 0xEE); 87 | } 88 | } 89 | 90 | public override Color ButtonSelectedGradientMiddle 91 | { 92 | get 93 | { 94 | return Color.FromArgb(0xC1, 210, 0xEE); 95 | } 96 | } 97 | 98 | public override Color CheckBackground 99 | { 100 | get 101 | { 102 | return Color.FromArgb(0xE1, 230, 0xE8); 103 | } 104 | } 105 | 106 | public override Color CheckPressedBackground 107 | { 108 | get 109 | { 110 | return Color.FromArgb(0x31, 0x6A, 0xC5); 111 | } 112 | } 113 | 114 | public override Color CheckSelectedBackground 115 | { 116 | get 117 | { 118 | return Color.FromArgb(0x31, 0x6A, 0xC5); 119 | } 120 | } 121 | 122 | public override Color GripDark 123 | { 124 | get 125 | { 126 | return Color.FromArgb(0xC1, 190, 0xB3); 127 | } 128 | } 129 | 130 | public override Color GripLight 131 | { 132 | get 133 | { 134 | return Color.FromArgb(0xFF, 0xFF, 0xFF); 135 | } 136 | } 137 | 138 | public override Color ImageMarginGradientBegin 139 | { 140 | get 141 | { 142 | return Color.FromArgb(251, 250, 247); 143 | } 144 | } 145 | 146 | public override Color ImageMarginGradientEnd 147 | { 148 | get 149 | { 150 | return Color.FromArgb(0xBD, 0xBD, 0xA3); 151 | } 152 | } 153 | 154 | public override Color ImageMarginGradientMiddle 155 | { 156 | get 157 | { 158 | return Color.FromArgb(0xEC, 0xE7, 0xE0); 159 | } 160 | } 161 | 162 | public override Color ImageMarginRevealedGradientBegin 163 | { 164 | get 165 | { 166 | return Color.FromArgb(0xF7, 0xF6, 0xEF); 167 | } 168 | } 169 | 170 | public override Color ImageMarginRevealedGradientEnd 171 | { 172 | get 173 | { 174 | return Color.FromArgb(230, 0xE3, 210); 175 | } 176 | } 177 | 178 | public override Color ImageMarginRevealedGradientMiddle 179 | { 180 | get 181 | { 182 | return Color.FromArgb(0xF2, 240, 0xE4); 183 | } 184 | } 185 | 186 | public override Color MenuBorder 187 | { 188 | get 189 | { 190 | return Color.FromArgb(0x8A, 0x86, 0x7A); 191 | } 192 | } 193 | 194 | public override Color MenuItemBorder 195 | { 196 | get 197 | { 198 | return Color.FromArgb(0x31, 0x6A, 0xC5); 199 | } 200 | } 201 | 202 | public override Color MenuItemPressedGradientBegin 203 | { 204 | get 205 | { 206 | return base.MenuItemPressedGradientBegin; 207 | } 208 | } 209 | 210 | public override Color MenuItemPressedGradientEnd 211 | { 212 | get 213 | { 214 | return base.MenuItemPressedGradientEnd; 215 | } 216 | } 217 | 218 | public override Color MenuItemPressedGradientMiddle 219 | { 220 | get 221 | { 222 | return base.MenuItemPressedGradientMiddle; 223 | } 224 | } 225 | 226 | public override Color MenuItemSelected 227 | { 228 | get 229 | { 230 | return Color.FromArgb(0xC1, 210, 0xEE); 231 | } 232 | } 233 | 234 | public override Color MenuItemSelectedGradientBegin 235 | { 236 | get 237 | { 238 | return Color.FromArgb(0xC1, 210, 0xEE); 239 | } 240 | } 241 | 242 | public override Color MenuItemSelectedGradientEnd 243 | { 244 | get 245 | { 246 | return Color.FromArgb(0xC1, 210, 0xEE); 247 | } 248 | } 249 | 250 | public override Color MenuStripGradientBegin 251 | { 252 | get 253 | { 254 | return Color.FromArgb(0xE5, 0xE5, 0xD7); 255 | } 256 | } 257 | 258 | public override Color MenuStripGradientEnd 259 | { 260 | get 261 | { 262 | return Color.FromArgb(0xF4, 0xF2, 0xE8); 263 | } 264 | } 265 | 266 | public override Color OverflowButtonGradientBegin 267 | { 268 | get 269 | { 270 | return Color.FromArgb(0xF3, 0xF2, 240); 271 | } 272 | } 273 | 274 | public override Color OverflowButtonGradientEnd 275 | { 276 | get 277 | { 278 | return Color.FromArgb(0x92, 0x92, 0x76); 279 | } 280 | } 281 | 282 | public override Color OverflowButtonGradientMiddle 283 | { 284 | get 285 | { 286 | return Color.FromArgb(0xE2, 0xE1, 0xDB); 287 | } 288 | } 289 | 290 | public override Color RaftingContainerGradientBegin 291 | { 292 | get 293 | { 294 | return Color.FromArgb(0xE5, 0xE5, 0xD7); 295 | } 296 | } 297 | 298 | public override Color RaftingContainerGradientEnd 299 | { 300 | get 301 | { 302 | return Color.FromArgb(0xF4, 0xF2, 0xE8); 303 | } 304 | } 305 | 306 | public override Color SeparatorDark 307 | { 308 | get 309 | { 310 | return Color.FromArgb(0xC5, 0xC2, 0xB8); 311 | } 312 | } 313 | 314 | public override Color SeparatorLight 315 | { 316 | get 317 | { 318 | return Color.FromArgb(0xFF, 0xFF, 0xFF); 319 | } 320 | } 321 | 322 | public override Color ToolStripBorder 323 | { 324 | get 325 | { 326 | return Color.FromArgb(0xA3, 0xA3, 0x7C); 327 | } 328 | } 329 | 330 | public override Color ToolStripDropDownBackground 331 | { 332 | get 333 | { 334 | return Color.FromArgb(0xFC, 0xFC, 0xF9); 335 | } 336 | } 337 | 338 | public override Color ToolStripGradientBegin 339 | { 340 | get 341 | { 342 | return Color.FromArgb(0xF7, 0xF6, 0xEF); 343 | } 344 | } 345 | 346 | public override Color ToolStripGradientEnd 347 | { 348 | get 349 | { 350 | return Color.FromArgb(192, 192, 168); 351 | } 352 | } 353 | 354 | public override Color ToolStripGradientMiddle 355 | { 356 | get 357 | { 358 | return Color.FromArgb(0xF2, 240, 0xE4); 359 | } 360 | } 361 | 362 | public override System.Drawing.Color ToolStripPanelGradientBegin 363 | { 364 | get 365 | { 366 | return Color.FromArgb(0xE5, 0xE5, 0xD7); 367 | } 368 | } 369 | 370 | public override System.Drawing.Color ToolStripPanelGradientEnd 371 | { 372 | get 373 | { 374 | return Color.FromArgb(0xF4, 0xF2, 0xE8); 375 | } 376 | } 377 | } 378 | } 379 | 380 | -------------------------------------------------------------------------------- /Ior.Forms.PropertyGridEx/CustomPropertyCollectionSet.cs: -------------------------------------------------------------------------------- 1 | namespace Swensen.Ior.Forms 2 | { 3 | using System; 4 | using System.Collections; 5 | using System.Reflection; 6 | 7 | public class CustomPropertyCollectionSet : System.Collections.CollectionBase 8 | { 9 | 10 | 11 | public virtual int Add(CustomPropertyCollection value) 12 | { 13 | return base.List.Add(value); 14 | } 15 | 16 | public virtual int Add() 17 | { 18 | return base.List.Add(new CustomPropertyCollection()); 19 | } 20 | 21 | public virtual CustomPropertyCollection this[int index] 22 | { 23 | get 24 | { 25 | return ((CustomPropertyCollection) base.List[index]); 26 | } 27 | set 28 | { 29 | base.List[index] = value; 30 | } 31 | } 32 | 33 | public virtual object ToArray() 34 | { 35 | ArrayList list = new ArrayList(); 36 | list.AddRange(base.List); 37 | return list.ToArray(typeof(CustomPropertyCollection)); 38 | } 39 | 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Ior.Forms.PropertyGridEx/Ior.Forms.PropertyGridEx.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.50727 7 | 2.0 8 | {B0BB47F2-21C4-41FC-B6E6-40757ADFC4A1} 9 | Library 10 | Swensen.Ior.Forms 11 | PropertyGridEx 12 | Windows 13 | 14 | 15 | 2.0 16 | 17 | publish\ 18 | true 19 | Disk 20 | false 21 | Foreground 22 | 7 23 | Days 24 | false 25 | false 26 | true 27 | 0 28 | 1.0.0.%2a 29 | false 30 | false 31 | true 32 | v4.6.1 33 | 34 | 35 | 36 | true 37 | full 38 | true 39 | true 40 | bin\Debug\ 41 | 42 | 43 | 4 44 | AllRules.ruleset 45 | false 46 | 47 | 48 | pdbonly 49 | false 50 | true 51 | true 52 | bin\Release\ 53 | 54 | 55 | 4 56 | AllRules.ruleset 57 | false 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | False 72 | Microsoft .NET Framework 4 %28x86 and x64%29 73 | true 74 | 75 | 76 | False 77 | .NET Framework 3.5 SP1 Client Profile 78 | false 79 | 80 | 81 | False 82 | .NET Framework 3.5 SP1 83 | false 84 | 85 | 86 | False 87 | Windows Installer 3.1 88 | true 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | PropertyGridEx.cs 101 | 102 | 103 | Component 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 120 | 121 | -------------------------------------------------------------------------------- /Ior.Forms.PropertyGridEx/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | using System.Data; 3 | using System.Collections; 4 | using Microsoft.VisualBasic; 5 | using System.Collections.Generic; 6 | using System; 7 | using System.Reflection; 8 | using System.Runtime.InteropServices; 9 | 10 | 11 | // General Information about an assembly is controlled through the following 12 | // set of attributes. Change these attribute values to modify the information 13 | // associated with an assembly. 14 | 15 | // Review the values of the assembly attributes 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | //The following GUID is for the ID of the typelib if this project is exposed to COM 27 | 28 | 29 | // Version information for an assembly consists of the following four values: 30 | // 31 | // Major Version 32 | // Minor Version 33 | // Build Number 34 | // Revision 35 | // 36 | // You can specify all the values or you can default the Build and Revision Numbers 37 | // by using the '*' as shown below: 38 | // 39 | 40 | 41 | 42 | 43 | [assembly: AssemblyTitleAttribute("PropertyGridEx")] 44 | [assembly: AssemblyDescriptionAttribute("Extended PropertyGrid")] 45 | [assembly: AssemblyCopyrightAttribute("Danilo Corallo")] 46 | [assembly: AssemblyVersionAttribute("1.0.0.0")] 47 | [assembly: AssemblyFileVersionAttribute("1.0.0.0")] 48 | -------------------------------------------------------------------------------- /Ior.Forms.PropertyGridEx/PropertyGridEx.Designer.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | using System.Data; 3 | using System.Collections; 4 | using Microsoft.VisualBasic; 5 | using System.Collections.Generic; 6 | using System; 7 | 8 | namespace Swensen.Ior.Forms 9 | { 10 | [global::Microsoft.VisualBasic.CompilerServices.DesignerGenerated()]public partial class PropertyGridEx : System.Windows.Forms.PropertyGrid 11 | { 12 | 13 | 14 | //UserControl overrides dispose to clean up the component list. 15 | [System.Diagnostics.DebuggerNonUserCode()]protected override void Dispose(bool disposing) 16 | { 17 | if (disposing && (components != null)) 18 | { 19 | components.Dispose(); 20 | } 21 | base.Dispose(disposing); 22 | } 23 | 24 | //Required by the Windows Form Designer 25 | private System.ComponentModel.Container components = null; 26 | 27 | //NOTE: The following procedure is required by the Windows Form Designer 28 | //It can be modified using the Windows Form Designer. 29 | //Do not modify it using the code editor. 30 | [System.Diagnostics.DebuggerStepThrough()]private void InitializeComponent() 31 | { 32 | components = new System.ComponentModel.Container(); 33 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 34 | } 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Ior.Forms.PropertyGridEx/UICustomEventEditor.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | using System.Data; 3 | using System.Collections; 4 | using Microsoft.VisualBasic; 5 | using System.Collections.Generic; 6 | using System; 7 | using System.ComponentModel; 8 | using System.Drawing.Design; 9 | using System.Windows.Forms; 10 | 11 | 12 | namespace Swensen.Ior.Forms 13 | { 14 | public class UICustomEventEditor : System.Drawing.Design.UITypeEditor 15 | { 16 | public delegate object OnClick(object sender, EventArgs e); 17 | protected UICustomEventEditor.OnClick m_MethodDelegate; 18 | protected CustomProperty.CustomPropertyDescriptor m_sender; 19 | 20 | public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context) 21 | { 22 | if (context != null&& context.Instance != null) 23 | { 24 | if (! context.PropertyDescriptor.IsReadOnly) 25 | { 26 | return UITypeEditorEditStyle.Modal; 27 | } 28 | } 29 | return UITypeEditorEditStyle.None; 30 | } 31 | 32 | [RefreshProperties(RefreshProperties.All)]public override object EditValue(ITypeDescriptorContext context, System.IServiceProvider provider, object value) 33 | { 34 | if (context == null || provider == null || context.Instance == null) 35 | { 36 | return base.EditValue(provider, value); 37 | } 38 | if (m_MethodDelegate == null) 39 | { 40 | DelegateAttribute attr = (DelegateAttribute) context.PropertyDescriptor.Attributes[typeof(DelegateAttribute)]; 41 | m_MethodDelegate = attr.GetMethod; 42 | } 43 | if (m_sender == null) 44 | { 45 | m_sender = context.PropertyDescriptor as CustomProperty.CustomPropertyDescriptor; 46 | } 47 | return m_MethodDelegate.Invoke(m_sender, null); 48 | } 49 | 50 | [AttributeUsage(AttributeTargets.Property)]public class DelegateAttribute : Attribute 51 | { 52 | 53 | protected UICustomEventEditor.OnClick m_MethodDelegate; 54 | 55 | public UICustomEventEditor.OnClick GetMethod 56 | { 57 | get 58 | { 59 | return this.m_MethodDelegate; 60 | } 61 | } 62 | 63 | public DelegateAttribute(UICustomEventEditor.OnClick MethodDelegate) 64 | { 65 | this.m_MethodDelegate = MethodDelegate; 66 | } 67 | } 68 | } 69 | } 70 | 71 | -------------------------------------------------------------------------------- /Ior.Forms.PropertyGridEx/UIFilenameEditor.cs: -------------------------------------------------------------------------------- 1 | namespace Swensen.Ior.Forms 2 | { 3 | using System; 4 | using System.ComponentModel; 5 | using System.Drawing.Design; 6 | using System.Runtime.CompilerServices; 7 | using System.Windows.Forms; 8 | 9 | public class UIFilenameEditor : System.Drawing.Design.UITypeEditor 10 | { 11 | public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context) 12 | { 13 | if (context != null&& context.Instance != null) 14 | { 15 | if (! context.PropertyDescriptor.IsReadOnly) 16 | { 17 | return UITypeEditorEditStyle.Modal; 18 | } 19 | } 20 | return UITypeEditorEditStyle.None; 21 | } 22 | 23 | [RefreshProperties(RefreshProperties.All)] 24 | public override object EditValue(ITypeDescriptorContext context, System.IServiceProvider provider, object value) 25 | { 26 | if (context == null || provider == null || context.Instance == null) 27 | { 28 | return base.EditValue(provider, value); 29 | } 30 | 31 | FileDialog fileDlg; 32 | if (context.PropertyDescriptor.Attributes[typeof(SaveFileAttribute)] == null) 33 | { 34 | fileDlg = new OpenFileDialog(); 35 | } 36 | else 37 | { 38 | fileDlg = new SaveFileDialog(); 39 | } 40 | fileDlg.Title = "Select " + context.PropertyDescriptor.DisplayName; 41 | fileDlg.FileName = (string) value; 42 | 43 | FileDialogFilterAttribute filterAtt = (FileDialogFilterAttribute) context.PropertyDescriptor.Attributes[typeof(FileDialogFilterAttribute)]; 44 | if (filterAtt != null) 45 | { 46 | fileDlg.Filter = filterAtt.Filter; 47 | } 48 | if (fileDlg.ShowDialog() == DialogResult.OK) 49 | { 50 | value = fileDlg.FileName; 51 | } 52 | fileDlg.Dispose(); 53 | return value; 54 | } 55 | 56 | [AttributeUsage(AttributeTargets.Property)] 57 | public class FileDialogFilterAttribute : Attribute 58 | { 59 | private string _filter; 60 | 61 | public string Filter 62 | { 63 | get 64 | { 65 | return this._filter; 66 | } 67 | } 68 | 69 | public FileDialogFilterAttribute(string filter) 70 | { 71 | this._filter = filter; 72 | } 73 | } 74 | 75 | [AttributeUsage(AttributeTargets.Property)] 76 | public class SaveFileAttribute : Attribute 77 | { 78 | 79 | } 80 | 81 | public enum FileDialogType 82 | { 83 | LoadFileDialog, 84 | SaveFileDialog 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /Ior.Forms.PropertyGridEx/UIListboxEditor.cs: -------------------------------------------------------------------------------- 1 | namespace Swensen.Ior.Forms 2 | { 3 | using System; 4 | using System.ComponentModel; 5 | using System.Drawing.Design; 6 | using System.Runtime.CompilerServices; 7 | using System.Windows.Forms; 8 | using System.Windows.Forms.Design; 9 | 10 | public class UIListboxEditor : UITypeEditor 11 | { 12 | private bool bIsDropDownResizable = false; 13 | private ListBox oList = new ListBox(); 14 | private object oSelectedValue = null; 15 | private IWindowsFormsEditorService oEditorService; 16 | 17 | public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context) 18 | { 19 | if (context != null&& context.Instance != null) 20 | { 21 | UIListboxIsDropDownResizable attribute = (UIListboxIsDropDownResizable) context.PropertyDescriptor.Attributes[typeof(UIListboxIsDropDownResizable)]; 22 | if (attribute != null) 23 | { 24 | bIsDropDownResizable = true; 25 | } 26 | return UITypeEditorEditStyle.DropDown; 27 | } 28 | return UITypeEditorEditStyle.None; 29 | } 30 | 31 | public override bool IsDropDownResizable 32 | { 33 | get 34 | { 35 | return bIsDropDownResizable; 36 | } 37 | } 38 | 39 | [RefreshProperties(RefreshProperties.All)]public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, System.IServiceProvider provider, object value) 40 | { 41 | if (context == null || provider == null || context.Instance == null) 42 | { 43 | return base.EditValue(provider, value); 44 | } 45 | 46 | oEditorService = (System.Windows.Forms.Design.IWindowsFormsEditorService) provider.GetService(typeof(IWindowsFormsEditorService)); 47 | if (oEditorService != null) 48 | { 49 | 50 | // Get the Back reference to the Custom Property 51 | CustomProperty.CustomPropertyDescriptor oDescriptor = (CustomProperty.CustomPropertyDescriptor) context.PropertyDescriptor; 52 | CustomProperty cp = (CustomProperty) oDescriptor.CustomProperty; 53 | 54 | // Declare attributes 55 | UIListboxDatasource datasource; 56 | UIListboxValueMember valuemember; 57 | UIListboxDisplayMember displaymember; 58 | 59 | // Get attributes 60 | datasource = (UIListboxDatasource) context.PropertyDescriptor.Attributes[typeof(UIListboxDatasource)]; 61 | valuemember = (UIListboxValueMember) context.PropertyDescriptor.Attributes[typeof(UIListboxValueMember)]; 62 | displaymember = (UIListboxDisplayMember) context.PropertyDescriptor.Attributes[typeof(UIListboxDisplayMember)]; 63 | 64 | oList.BorderStyle = BorderStyle.None; 65 | oList.IntegralHeight = true; 66 | 67 | if (datasource != null) 68 | { 69 | oList.DataSource = datasource.Value; 70 | } 71 | 72 | if (displaymember != null) 73 | { 74 | oList.DisplayMember = displaymember.Value; 75 | } 76 | 77 | if (valuemember != null) 78 | { 79 | oList.ValueMember = valuemember.Value; 80 | } 81 | 82 | if (value != null) 83 | { 84 | if (value.GetType().Name == "String") 85 | { 86 | oList.Text = (string) value; 87 | } 88 | else 89 | { 90 | oList.SelectedItem = value; 91 | } 92 | } 93 | 94 | 95 | oList.SelectedIndexChanged += new System.EventHandler(this.SelectedItem); 96 | 97 | oEditorService.DropDownControl(oList); 98 | if (oList.SelectedIndices.Count == 1) 99 | { 100 | cp.SelectedItem = oList.SelectedItem; 101 | cp.SelectedValue = oSelectedValue; 102 | value = oList.Text; 103 | } 104 | oEditorService.CloseDropDown(); 105 | } 106 | else 107 | { 108 | return base.EditValue(provider, value); 109 | } 110 | 111 | return value; 112 | 113 | } 114 | 115 | private void SelectedItem(object sender, EventArgs e) 116 | { 117 | if (oEditorService != null) 118 | { 119 | if (oList.SelectedValue != null) 120 | { 121 | oSelectedValue = oList.SelectedValue; 122 | } 123 | oEditorService.CloseDropDown(); 124 | } 125 | } 126 | 127 | [AttributeUsage(AttributeTargets.Property)] 128 | public class UIListboxDatasource : Attribute 129 | { 130 | 131 | private object oDataSource; 132 | public UIListboxDatasource(ref object Datasource) 133 | { 134 | oDataSource = Datasource; 135 | } 136 | public object Value 137 | { 138 | get 139 | { 140 | return oDataSource; 141 | } 142 | } 143 | } 144 | 145 | [AttributeUsage(AttributeTargets.Property)] 146 | public class UIListboxValueMember : Attribute 147 | { 148 | 149 | private string sValueMember; 150 | public UIListboxValueMember(string ValueMember) 151 | { 152 | sValueMember = ValueMember; 153 | } 154 | public string Value 155 | { 156 | get 157 | { 158 | return sValueMember; 159 | } 160 | set 161 | { 162 | sValueMember = value; 163 | } 164 | } 165 | } 166 | 167 | [AttributeUsage(AttributeTargets.Property)] 168 | public class UIListboxDisplayMember : Attribute 169 | { 170 | 171 | private string sDisplayMember; 172 | public UIListboxDisplayMember(string DisplayMember) 173 | { 174 | sDisplayMember = DisplayMember; 175 | } 176 | public string Value 177 | { 178 | get 179 | { 180 | return sDisplayMember; 181 | } 182 | set 183 | { 184 | sDisplayMember = value; 185 | } 186 | } 187 | 188 | } 189 | 190 | [AttributeUsage(AttributeTargets.Property)] 191 | public class UIListboxIsDropDownResizable : Attribute 192 | { 193 | 194 | } 195 | } 196 | } 197 | -------------------------------------------------------------------------------- /Ior/Core/IorContentType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Globalization; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Net.Mime; 7 | using System.Xml.Linq; 8 | using Newtonsoft.Json; 9 | using TidyManaged; 10 | using System.IO; 11 | using NLog; 12 | 13 | namespace Swensen.Ior.Core { 14 | /// 15 | /// Broad categories of http media types that we know how to do special processing for (i.e. pretty printing, or choosing correct file extension). 16 | /// 17 | public enum IorMediaTypeCategory { 18 | Xml, Html, Json, Javascript, Text, Application, Other 19 | } 20 | 21 | //http://www.w3.org/TR/html4/types.html#h-6.7 22 | /// 23 | /// An immutable wrapper around our underlying content type representation which provides specialized processing for various processing 24 | /// like pretty printing and choosing correct file extensions. 25 | /// 26 | public class IorContentType { 27 | private static Logger log = LogManager.GetCurrentClassLogger(); 28 | 29 | private readonly ContentType ct; 30 | 31 | public readonly string MediaType; 32 | 33 | public readonly IorMediaTypeCategory MediaTypeCategory; 34 | 35 | public IorContentType() : this("application/octet-stream") { } 36 | 37 | public IorContentType(string contentType) { 38 | try { 39 | contentType = contentType.Split(';')[0]; //trim off paramaters, if any 40 | contentType = contentType.Split(',')[0]; //though illegal, we've seen comma separated content-types in the wild 41 | this.ct = new ContentType(contentType); 42 | } catch { 43 | this.ct = new ContentType("application/octet-stream"); 44 | } 45 | 46 | this.MediaType = ct.MediaType.ToLower(); 47 | this.MediaTypeCategory = GetMediaTypeCategory(this.MediaType); 48 | } 49 | 50 | public static IorMediaTypeCategory GetMediaTypeCategory(string mt) { 51 | if (mt == "text/html" || mt == "application/xhtml+xml") 52 | return IorMediaTypeCategory.Html; 53 | 54 | if (mt == "text/xml" || mt == "application/xml" || mt.EndsWith("+xml")) //+xml catch all must come after Html 55 | return IorMediaTypeCategory.Xml; 56 | 57 | if (mt == "text/json" || mt == "application/json" || mt.EndsWith("+json")) 58 | return IorMediaTypeCategory.Json; 59 | 60 | if (mt == "text/javascript" || mt == "application/javascript" || mt == "application/x-javascript") 61 | return IorMediaTypeCategory.Javascript; 62 | 63 | if (mt == "text/plain") 64 | return IorMediaTypeCategory.Text; 65 | 66 | if (mt.StartsWith("image/") || mt.StartsWith("video/") || mt.StartsWith("audio/") || mt == "application/zip" || mt == "application/octet-stream") 67 | return IorMediaTypeCategory.Application; 68 | 69 | return IorMediaTypeCategory.Other; 70 | } 71 | 72 | /// 73 | /// If contentType is an xml content type, then try to pretty print the rawContent. If that fails or otherwise, just return the rawContent 74 | /// 75 | public static string GetPrettyPrintedContent(IorMediaTypeCategory mtc, string content) { 76 | //see http://stackoverflow.com/a/2965701/236255 for list of xml content types (credit to http://stackoverflow.com/users/18936/bobince) 77 | try { 78 | switch (mtc) { 79 | case IorMediaTypeCategory.Xml: { 80 | var doc = XDocument.Parse(content); 81 | var xml = doc.ToString(); 82 | if (doc.Declaration != null) 83 | return doc.Declaration.ToString() + Environment.NewLine + xml; 84 | else 85 | return xml; 86 | } 87 | case IorMediaTypeCategory.Javascript: //some APIs incorrectly use e.g. text/javascript when actual content-type is JSON 88 | case IorMediaTypeCategory.Json: { 89 | dynamic parsedJson = JsonConvert.DeserializeObject(content); 90 | 91 | var jsonSerializer = new JsonSerializer(); 92 | var stringWriter = new StringWriter(new StringBuilder(256), CultureInfo.InvariantCulture); 93 | using (var jsonTextWriter = new JsonTextWriter(stringWriter)) { 94 | jsonTextWriter.Indentation = 2; 95 | jsonTextWriter.IndentChar = ' '; 96 | jsonTextWriter.Formatting = Formatting.Indented; 97 | jsonSerializer.Serialize(jsonTextWriter, parsedJson); 98 | } 99 | return stringWriter.ToString(); 100 | } 101 | case IorMediaTypeCategory.Html: { 102 | //need to convert to utf16-little endian stream and set Document input/output encoding since Document.FromString screws up encoding. 103 | var stream = new MemoryStream(Encoding.Unicode.GetBytes(content)); 104 | using (var doc = Document.FromStream(stream)) { 105 | doc.InputCharacterEncoding = EncodingType.Utf16LittleEndian; 106 | doc.OutputCharacterEncoding = EncodingType.Utf16LittleEndian; 107 | doc.ShowWarnings = false; 108 | doc.Quiet = true; 109 | doc.OutputXhtml = false; 110 | doc.OutputXml = false; 111 | doc.OutputHtml = false; 112 | doc.IndentBlockElements = AutoBool.Yes; 113 | doc.IndentSpaces = 2; 114 | doc.IndentAttributes = false; 115 | //doc.IndentCdata = true; 116 | doc.AddVerticalSpace = true; 117 | doc.AddTidyMetaElement = false; 118 | doc.WrapAt = 120; 119 | 120 | doc.MergeDivs = AutoBool.No; 121 | doc.MergeSpans = AutoBool.No; 122 | doc.JoinStyles = false; 123 | doc.ForceOutput = true; 124 | doc.CleanAndRepair(); 125 | 126 | string output = doc.Save(); 127 | return output; 128 | } 129 | } 130 | default: 131 | return content; 132 | } 133 | } catch (Exception ex) { 134 | log.Warn(ex, "Failed content conversion"); 135 | return content; 136 | } 137 | } 138 | 139 | public static string GetFileExtension(IorMediaTypeCategory mtc, string mt, Uri requestUri) { 140 | Func getUriExtensionOrBlank = () => { 141 | if(Path.HasExtension(requestUri.AbsolutePath)) 142 | return Path.GetExtension(requestUri.AbsoluteUri).Substring(1); 143 | else 144 | return ""; 145 | }; 146 | 147 | switch (mtc) { 148 | case IorMediaTypeCategory.Html: return "html"; 149 | case IorMediaTypeCategory.Json: return "json"; 150 | case IorMediaTypeCategory.Text: return "txt"; 151 | case IorMediaTypeCategory.Xml: return "xml"; 152 | case IorMediaTypeCategory.Application: 153 | var parts = mt.Split('/'); 154 | if(parts[1] == "octet-stream") 155 | return getUriExtensionOrBlank(); 156 | else 157 | return parts[1]; 158 | default: 159 | switch(mt) { 160 | case "text/csv": return "csv"; 161 | case "text/css": return "css"; 162 | case "text/ecmascript": 163 | case "text/javascript": 164 | case "application/javascript": 165 | case "application/x-javascript": 166 | return "js"; 167 | default: 168 | return getUriExtensionOrBlank(); 169 | } 170 | } 171 | } 172 | } 173 | } 174 | -------------------------------------------------------------------------------- /Ior/Core/LogMessageModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using NLog; 6 | using System.IO; 7 | using System.Text.RegularExpressions; 8 | 9 | namespace Swensen.Ior.Core 10 | { 11 | public class LogMessageModel { 12 | public string Message {get; private set;} 13 | public LogLevel Level {get; private set;} 14 | 15 | public static List ParseAllMessages(string logFilePath) { 16 | //can't use File.ReadAllText since file is locked by NLog 17 | using (var fileStream = new FileStream(logFilePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) 18 | using (var textReader = new StreamReader(fileStream, Encoding.UTF8)) 19 | { 20 | var logMessages = new List(); 21 | StringBuilder curBuilder = null; 22 | LogMessageModel curMessage = null; 23 | //commit current message, if any 24 | Action commitCurMessage = () => { 25 | if(curBuilder != null && curMessage != null) 26 | curMessage.Message = curBuilder.ToString(); 27 | }; 28 | while (!textReader.EndOfStream) { 29 | var logLine = textReader.ReadLine(); 30 | var logLevel = parseLogLevel(logLine); 31 | if (logLevel != null) { 32 | commitCurMessage(); 33 | 34 | //start new message 35 | curMessage = new LogMessageModel { Level = logLevel }; 36 | curBuilder = new StringBuilder().AppendLine(logLine); 37 | logMessages.Add(curMessage); 38 | } 39 | else if (curBuilder != null) { //curBuilder may be null if we have an empty file with only a newline char 40 | curBuilder.AppendLine(logLine); 41 | } 42 | } 43 | commitCurMessage(); 44 | 45 | return logMessages; 46 | } 47 | } 48 | 49 | private static List logLevelNames = new List { 50 | LogLevel.Debug, 51 | LogLevel.Error, 52 | LogLevel.Fatal, 53 | LogLevel.Info, 54 | LogLevel.Trace, 55 | LogLevel.Warn 56 | }; 57 | private static String logLevelPattern = String.Join("|", logLevelNames); 58 | 59 | private static Regex logLineRegex = new Regex( 60 | @"\] \[(" + logLevelPattern + @")\] \{", 61 | RegexOptions.IgnoreCase | RegexOptions.Compiled | RegexOptions.CultureInvariant 62 | ); 63 | 64 | private static LogLevel parseLogLevel(string logLine) { 65 | var match = logLineRegex.Match(logLine); 66 | if(match.Success) 67 | return LogLevel.FromString(match.Groups[1].Value); 68 | else 69 | return null; 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /Ior/Core/RequestModel.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2012 Stephen Swensen 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | using System; 17 | using System.Collections.Generic; 18 | using System.Globalization; 19 | using System.Linq; 20 | using System.Net.Http.Headers; 21 | using System.Reflection; 22 | using System.Net.Http; 23 | using System.Text.RegularExpressions; 24 | using Swensen.Utils; 25 | 26 | namespace Swensen.Ior.Core { 27 | public class RequestModel { 28 | public Uri Url { get; private set;} 29 | public HttpMethod Method { get; private set; } 30 | public Dictionary RequestHeaders { get; private set; } 31 | public Dictionary ContentHeaders { get; private set; } 32 | public HashSet AcceptEncodings { get; private set;} 33 | 34 | public string Body { get; private set; } 35 | 36 | public static List TryCreate(RequestViewModel vm, out RequestModel requestModel) { 37 | var validationErrors = new List(); 38 | 39 | Uri url = null; 40 | if(vm.Url.IsBlank()) 41 | validationErrors.Add("Request URL may not be empty"); 42 | else { 43 | var forgivingUrl = vm.Url.Contains("://") ? vm.Url : "http://" + vm.Url; 44 | if(!Uri.TryCreate(forgivingUrl, UriKind.Absolute, out url)) 45 | validationErrors.Add("Request URL is invalid"); 46 | } 47 | 48 | if(vm.Method.IsBlank()) 49 | validationErrors.Add("Request Method may not be empty"); 50 | 51 | var requestHeaders = new Dictionary(StringComparer.OrdinalIgnoreCase); 52 | var contentHeaders = new Dictionary(StringComparer.OrdinalIgnoreCase); 53 | var acceptEncodings = new HashSet(); 54 | foreach (var line in vm.Headers) { 55 | if (line.IsBlank()) 56 | continue; //allow empty lines 57 | 58 | var match = Regex.Match(line, @"^([0-9a-zA-Z-]+)\s*\:(.*)$", RegexOptions.Compiled); 59 | if (!match.Success) 60 | validationErrors.Add("Invalid header line (format incorrect): " + line); 61 | else { 62 | 63 | var key = match.Groups[1].Value.Trim(); 64 | var value = match.Groups[2].Value.Trim(); 65 | if (requestHeaders.ContainsKey(key) || contentHeaders.ContainsKey(key)) 66 | validationErrors.Add("Invalid header line (duplicate key, comma-separate multiple values for one key): " + line); 67 | else if (String.Equals(key, "authorization", StringComparison.OrdinalIgnoreCase) && !url.UserInfo.IsBlank()) { 68 | validationErrors.Add("Invalid header line (Authorization header cannot be specified when user information is given in the url): " + line); 69 | } else { 70 | //var values = value.Split(',').Select(x => x.Trim()).ToList().AsReadOnly(); 71 | //some ugliness to leverage system.net.http request and content header validation 72 | var hrhValidator = (HttpRequestHeaders)Activator.CreateInstance(typeof(HttpRequestHeaders), true); 73 | try { 74 | hrhValidator.Add(key, value); 75 | requestHeaders.Add(key, value); 76 | if(key.Equals("accept-encoding", StringComparison.OrdinalIgnoreCase)) { 77 | var encodings = value.Split(',').Select(x => x.Trim().ToLower()).Where(x => x != ""); 78 | foreach(var enc in encodings) 79 | acceptEncodings.Add(enc); 80 | } 81 | } catch (InvalidOperationException) { //i.e. header belongs in content headers 82 | var hchValidator = (HttpContentHeaders)Activator.CreateInstance(typeof(HttpContentHeaders), BindingFlags.Instance | BindingFlags.CreateInstance | BindingFlags.NonPublic, null, new[] { (object)(Func)(() => (long?)null) }, CultureInfo.CurrentCulture); 83 | try { 84 | hchValidator.Add(key, value); 85 | contentHeaders.Add(key, value); 86 | } catch (Exception e) { 87 | validationErrors.Add(string.Format("Invalid header line ({0}): {1}", e.Message, line)); 88 | } 89 | } catch (Exception e) { 90 | validationErrors.Add(string.Format("Invalid header line ({0}): {1}", e.Message, line)); 91 | } 92 | } 93 | } 94 | } 95 | 96 | if (validationErrors.Count > 0) 97 | requestModel = null; 98 | else { 99 | requestModel = new RequestModel() { 100 | Url = url, 101 | Method = new HttpMethod(vm.Method), 102 | RequestHeaders = requestHeaders, 103 | ContentHeaders = contentHeaders, 104 | AcceptEncodings = acceptEncodings, 105 | Body = vm.Body 106 | }; 107 | } 108 | 109 | return validationErrors; 110 | } 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /Ior/Core/RequestResponseSnapshot.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Swensen.Ior.Core { 7 | public class RequestResponseSnapshot { 8 | public RequestViewModel request { get; set; } 9 | public ResponseModel response { get; set; } 10 | 11 | public override string ToString() { 12 | return string.Format("[{0}] {1}", response.Start, request.Url); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Ior/Core/RequestViewModel.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2012 Stephen Swensen 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | using System.Net.Http; 18 | using System.IO; 19 | using System.Xml; 20 | using System.Xml.Serialization; 21 | 22 | namespace Swensen.Ior.Core { 23 | public class RequestViewModel { 24 | public string Url { get; set; } 25 | public string Method { get; set; } 26 | public string[] Headers { get; set; } 27 | public string Body { get; set; } 28 | 29 | public void Save(string fileName) { 30 | var ws = new XmlWriterSettings {NewLineHandling = NewLineHandling.Entitize}; 31 | 32 | using (var file = File.Create(fileName)) 33 | using (var writer = XmlWriter.Create(file, ws)) { 34 | var serializer = new XmlSerializer(typeof(RequestViewModel)); 35 | serializer.Serialize(writer, this); 36 | } 37 | } 38 | 39 | public static RequestViewModel Load(string fileName) { 40 | var rs = new XmlReaderSettings {IgnoreWhitespace = false}; 41 | 42 | using (var file = File.Open(fileName, FileMode.Open)) 43 | using (var reader = XmlReader.Create(file, rs)) { 44 | var serializer = new XmlSerializer(typeof(RequestViewModel)); 45 | return serializer.Deserialize(reader) as RequestViewModel; 46 | } 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Ior/Core/ResponseBodyOutput.cs: -------------------------------------------------------------------------------- 1 | namespace Swensen.Ior.Core { 2 | public enum ResponseBodyOutput { 3 | Hex, Plain, Pretty, Rendered 4 | } 5 | } -------------------------------------------------------------------------------- /Ior/Core/ResponseModel.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2012 Stephen Swensen 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | using System; 17 | using System.Collections.Generic; 18 | using System.Linq; 19 | using System.Net.Http; 20 | using Swensen.Utils; 21 | 22 | namespace Swensen.Ior.Core { 23 | public class ResponseModel { 24 | public IorContentType ContentType { get; private set;} 25 | 26 | /// 27 | /// Create an empty ResponseModel with ResponseStatus set to a loading message. 28 | /// 29 | public ResponseModel(string status="") { 30 | this.Status = status; 31 | this.ContentType = new IorContentType(); 32 | initLazyFields(new Uri("http://localhost")); 33 | } 34 | 35 | public ResponseModel(String errorMessage, DateTime start, DateTime end) : this() { 36 | ErrorMessage = errorMessage; 37 | Start = start; 38 | End = end; 39 | } 40 | 41 | /// 42 | /// Create a ResponseModel populated from an IRestResonse 43 | /// 44 | public ResponseModel(HttpResponseMessage response, DateTime start, DateTime end) { 45 | if (response == null) 46 | throw new ArgumentNullException("response"); 47 | 48 | this.Status = string.Format("{0} {1}", (int)response.StatusCode, response.ReasonPhrase); 49 | 50 | Start = start; 51 | End = end; 52 | 53 | var readContentBytesTask = response.Content.ReadAsByteArrayAsync(); 54 | readContentBytesTask.Wait(); 55 | this.ContentBytes = readContentBytesTask.Result; 56 | 57 | var readContentStringTask = response.Content.ReadAsStringAsync(); 58 | readContentStringTask.Wait(); 59 | this.Content = readContentStringTask.Result; 60 | 61 | var headers = response.Headers.Concat(response.Content.Headers); 62 | 63 | this.Headers = headers.Select(p => p.Key + ": " + p.Value.Coalesce().Join(", ")).Join(Environment.NewLine); 64 | 65 | var contentType = headers.FirstOrDefault(x => String.Equals(x.Key, "content-type", StringComparison.OrdinalIgnoreCase)).Value.Coalesce().Join(", "); 66 | this.ContentType = new IorContentType(contentType); 67 | 68 | this.ErrorMessage = null; 69 | 70 | initLazyFields(response.RequestMessage.RequestUri); 71 | } 72 | 73 | private void initLazyFields(Uri requestUri) { 74 | this.prettyPrintedContent = new Lazy(() => IorContentType.GetPrettyPrintedContent(this.ContentType.MediaTypeCategory, this.Content)); 75 | this.contentFileExtension = new Lazy(() => IorContentType.GetFileExtension(this.ContentType.MediaTypeCategory, this.ContentType.MediaType, requestUri)); 76 | this.temporaryFile = new Lazy(() => FileUtils.CreateTempFile(this.ContentBytes, this.ContentFileExtension)); 77 | } 78 | 79 | public string ErrorMessage { get; private set; } 80 | 81 | public DateTime Start { get; private set; } 82 | public DateTime End { get; private set; } 83 | public long ElapsedMilliseconds { get { return (long) (End - Start).TotalMilliseconds; } } 84 | 85 | public string Status { get; private set; } 86 | 87 | public byte[] ContentBytes { get; private set; } 88 | public string Content { get; private set; } 89 | public string Headers { get; set; } 90 | 91 | private Lazy prettyPrintedContent; 92 | public string PrettyPrintedContent { get { return prettyPrintedContent.Value; } } 93 | 94 | private Lazy contentFileExtension; 95 | public string ContentFileExtension { get { return contentFileExtension.Value; } } 96 | 97 | private Lazy temporaryFile; 98 | public string TemporaryFile { get { return temporaryFile.Value; } } 99 | 100 | public static ResponseModel Loading = new ResponseModel(status:"Loading..."); 101 | public static ResponseModel Empty = new ResponseModel(); 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /Ior/Core/SettingsViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.ComponentModel; 6 | using Swensen.Ior.Properties; 7 | using System.IO; 8 | using System.Windows.Forms.Design; 9 | using System.Drawing.Design; 10 | using System.Net.Mime; 11 | using Swensen.Utils; 12 | 13 | namespace Swensen.Ior.Core { 14 | 15 | /// 16 | /// View model for Settings to bind to the property grid. 17 | /// 18 | public class SettingsViewModel { 19 | private readonly Settings settings; 20 | 21 | public SettingsViewModel(Settings settings) { 22 | this.settings = settings; 23 | } 24 | 25 | //[Browsable(false)] 26 | private Tuple lastValidationError = Tuple.Create("",""); 27 | 28 | /// 29 | /// Return the last validation error, or Tuple.Create("","") if none, and reset the last validation error to Tuple.Create("","") 30 | /// 31 | public Tuple DequeueLastValidationError() { 32 | var temp = lastValidationError; 33 | lastValidationError = Tuple.Create("",""); 34 | return temp; 35 | } 36 | 37 | //possible have PeakLastValidationError 38 | 39 | [Category("Request")] 40 | [DisplayName("Save Request File Dialog Folder")] 41 | [Description("The default folder set for the Save Request file dialog. This location gets overwritten automatically whenever a request is saved to a different location.")] 42 | [EditorAttribute(typeof(FolderNameEditor), typeof(UITypeEditor))] 43 | public string SaveRequestFileDialogFolder { 44 | get { return settings.SaveRequestFileDialogFolder; } 45 | set { 46 | if (!value.IsBlank() && !Directory.Exists(value)) 47 | lastValidationError = Tuple.Create("SaveRequestFileDialogFolder", "Specified directory does not exist"); 48 | else 49 | settings.SaveRequestFileDialogFolder = (value ?? "").Trim(); 50 | } 51 | } 52 | 53 | [Category("Request")] 54 | [DisplayName("Default Request File Path")] 55 | [Description("The path for the default request file loaded upon startup.")] 56 | [EditorAttribute(typeof(FileNameEditor), typeof(UITypeEditor))] 57 | public string DefaultRequestFilePath { 58 | get { return settings.DefaultRequestFilePath; } 59 | set { 60 | if (!value.IsBlank() && !File.Exists(value)) 61 | lastValidationError = Tuple.Create("DefaultRequestFilePath", "Specified file does not exist"); 62 | else 63 | settings.DefaultRequestFilePath = (value ?? "").Trim(); 64 | } 65 | } 66 | 67 | [Category("Request")] 68 | [DisplayName("Default Request Content-Type")] 69 | [Description("The default request Content-Type used when none is otherwise explicitly specified.")] 70 | public string DefaultRequestContentType { 71 | get { return settings.DefaultRequestContentType; } 72 | set { 73 | if (value.IsBlank()) 74 | settings.DefaultRequestContentType = ""; 75 | else { 76 | try { 77 | var ct = new ContentType(value); 78 | settings.DefaultRequestContentType = ct.ToString(); 79 | } catch { 80 | lastValidationError = Tuple.Create("DefaultRequestContentType", "Content-Type is invalid"); 81 | } 82 | } 83 | } 84 | } 85 | 86 | [Category("Request")] 87 | [DisplayName("Encode UTF-8 Content with BOM")] 88 | [Description("Indicates whether or not UTF-8 content should be encoded with the optional BOM.")] 89 | public bool IncludeBomInUtf8RequestContent { 90 | get { return settings.IncludeBomInUtf8RequestContent; } 91 | set { settings.IncludeBomInUtf8RequestContent = value; } 92 | } 93 | 94 | [Category("Request")] 95 | [DisplayName("Proxy Server")] 96 | [Description("Proxy server used by requests. If blank, no proxy server is used.")] 97 | public string ProxyServer { 98 | get { return settings.ProxyServer; } 99 | set { 100 | Uri url = null; 101 | if(value.IsBlank()) 102 | settings.ProxyServer = ""; 103 | else { 104 | var forgivingUrl = value.Contains("://") ? value : "http://" + value; 105 | if (Uri.TryCreate(forgivingUrl, UriKind.Absolute, out url)) 106 | settings.ProxyServer = url.ToString(); 107 | else 108 | lastValidationError = Tuple.Create("ProxyServer", "The given URL is invalid"); 109 | } 110 | } 111 | } 112 | 113 | [Category("Response")] 114 | [DisplayName("Export Response Body File Dialog Folder")] 115 | [Description("The default folder set for the Export Response Body file dialog. This location gets overwritten automatically whenever a request body is saved to a different location.")] 116 | [EditorAttribute(typeof(FolderNameEditor), typeof(UITypeEditor))] 117 | public string ExportResponseFileDialogFolder { 118 | get { return settings.ExportResponseFileDialogFolder; } 119 | set { 120 | if (!value.IsBlank() && !Directory.Exists(value)) 121 | lastValidationError = Tuple.Create("ExportResponseFileDialogFolder", "Specified directory does not exist"); 122 | else 123 | settings.ExportResponseFileDialogFolder = (value ?? "").Trim(); 124 | } 125 | } 126 | 127 | [Category("Response")] 128 | [DisplayName("Follow Redirects")] 129 | [Description("Indicates whether or not redirects should be followed.")] 130 | public bool FollowRedirects { 131 | get { return settings.FollowRedirects; } 132 | set { settings.FollowRedirects = value; } 133 | } 134 | 135 | [Category("Response")] 136 | [DisplayName("Ignore SSL Validation Errors")] 137 | [Description("Indicates whether or not SSL validation errors should be ignored.")] 138 | public bool IgnoreSslValidationErrors { 139 | get { return settings.IgnoreSslValidationErrors; } 140 | set { settings.IgnoreSslValidationErrors = value; } 141 | } 142 | 143 | [Category("Response")] 144 | [DisplayName("Enable Automatic Content Decompression")] 145 | [Description("Indicates whether or not gzip and deflate compressed content should be automatically decompressed.")] 146 | public bool EnableAutomaticContentDecompression { 147 | get { return settings.EnableAutomaticContentDecompression; } 148 | set { settings.EnableAutomaticContentDecompression = value; } 149 | } 150 | 151 | [Category("User Interface")] 152 | [DisplayName("Max History")] 153 | [Description("The maximum request history and response snapshots to store.")] 154 | public ushort MaxSnapshots { 155 | get { return settings.MaxSnapshots; } 156 | set { settings.MaxSnapshots = value; } 157 | } 158 | } 159 | } 160 | -------------------------------------------------------------------------------- /Ior/Forms/AboutBox.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2012 Stephen Swensen 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | using System; 17 | using System.Collections.Generic; 18 | using System.ComponentModel; 19 | using System.Drawing; 20 | using System.Linq; 21 | using System.Reflection; 22 | using System.Windows.Forms; 23 | 24 | namespace Swensen.Ior.Forms { 25 | partial class AboutBox : Form { 26 | public AboutBox() { 27 | InitializeComponent(); 28 | } 29 | 30 | private void AboutBox_Load(object sender, EventArgs e) { 31 | this.Text = String.Format("About {0}", AssemblyTitle); 32 | this.labelProductName.Text = AssemblyProduct; 33 | this.labelVersion.Text = String.Format("Version {0}", AssemblyVersion); 34 | this.labelCopyright.Text = AssemblyCopyright; 35 | //this.labelDescription.Text = AssemblyCompany; 36 | this.linkDescription.Text = AssemblyDescription; //should be home page link 37 | } 38 | 39 | public string AssemblyTitle { 40 | get { 41 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false); 42 | if (attributes.Length > 0) { 43 | AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0]; 44 | if (titleAttribute.Title != "") { 45 | return titleAttribute.Title; 46 | } 47 | } 48 | return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase); 49 | } 50 | } 51 | 52 | public string AssemblyVersion { 53 | get { 54 | var version = Assembly.GetExecutingAssembly().GetName().Version; 55 | //we use an odd revision number to indicate pre-release. we also translate revision number into incrementing alpha numbers 56 | //so that revision {1,3,5,..} -> alpha {1,2,3} 57 | if(version.Revision % 2 == 0) 58 | return String.Format("{0}.{1}.{2}", version.Major, version.Minor, version.Build); 59 | else 60 | return String.Format("{0}.{1}.{2} (alpha {3})", version.Major, version.Minor, version.Build, (version.Revision + 1) / 2); 61 | } 62 | } 63 | 64 | public string AssemblyDescription { 65 | get { 66 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false); 67 | if (attributes.Length == 0) { 68 | return ""; 69 | } 70 | return ((AssemblyDescriptionAttribute)attributes[0]).Description; 71 | } 72 | } 73 | 74 | public string AssemblyProduct { 75 | get { 76 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false); 77 | if (attributes.Length == 0) { 78 | return ""; 79 | } 80 | return ((AssemblyProductAttribute)attributes[0]).Product; 81 | } 82 | } 83 | 84 | public string AssemblyCopyright { 85 | get { 86 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false); 87 | if (attributes.Length == 0) { 88 | return ""; 89 | } 90 | return ((AssemblyCopyrightAttribute)attributes[0]).Copyright; 91 | } 92 | } 93 | 94 | //public string AssemblyCompany { 95 | // get { 96 | // object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false); 97 | // if (attributes.Length == 0) { 98 | // return ""; 99 | // } 100 | // return ((AssemblyCompanyAttribute)attributes[0]).Company; 101 | // } 102 | //} 103 | 104 | private void okButton_Click(object sender, EventArgs e) { 105 | this.Close(); 106 | } 107 | 108 | private void linkDescription_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { 109 | System.Diagnostics.Process.Start(linkDescription.Text); 110 | } 111 | 112 | private void btnPayPal_Click(object sender, EventArgs e) 113 | { 114 | System.Diagnostics.Process.Start(@"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WXSPTXDPECJ9L"); 115 | } 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /Ior/Forms/ControlHelpers.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows.Forms; 6 | using System.Runtime.InteropServices; 7 | 8 | namespace Swensen.Ior.Forms { 9 | 10 | //credit to Adam Robinson (http://stackoverflow.com/users/82187/adam-robinson) for the SendMessage, ResumeDrawing, and SuspendDrawing (non-lambda) methods: http://stackoverflow.com/a/778133/236255 11 | public static class ControlHelpers { 12 | [DllImport("user32.dll", EntryPoint = "SendMessageA", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)] 13 | private static extern int SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam); 14 | private const int WM_SETREDRAW = 0xB; 15 | 16 | public static void SuspendDrawing(this Control target) { 17 | SendMessage(target.Handle, WM_SETREDRAW, 0, 0); 18 | } 19 | 20 | public static void ResumeDrawing(this Control target) { ResumeDrawing(target, true); } 21 | public static void ResumeDrawing(this Control target, bool redraw) { 22 | SendMessage(target.Handle, WM_SETREDRAW, 1, 0); 23 | 24 | if (redraw) { 25 | target.Refresh(); 26 | } 27 | } 28 | 29 | /// 30 | /// Suspend drawing while executing the action, resuming when done. 31 | /// 32 | public static void SuspendDrawing(this Control target, Action action) { 33 | target.SuspendDrawing(); 34 | action(); 35 | target.ResumeDrawing(); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Ior/Forms/LogViewer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Windows.Forms; 9 | using System.IO; 10 | using NLog; 11 | using Swensen.Ior.Core; 12 | using Swensen.Ior.Properties; 13 | using Swensen.Utils; 14 | 15 | namespace Swensen.Ior.Forms 16 | { 17 | public partial class LogViewer : Form 18 | { 19 | private static readonly Logger log = LogManager.GetCurrentClassLogger(); 20 | private List logMessages = new List(); 21 | private string logFilePath = String.Format("{1}{0}logs{0}log.txt", Path.DirectorySeparatorChar, AppDomain.CurrentDomain.BaseDirectory); 22 | 23 | public LogViewer() 24 | { 25 | InitializeComponent(); 26 | } 27 | 28 | private void LogViewer_Load(object sender, EventArgs e) 29 | { 30 | bindCbGroupLogLevels(); 31 | bindSettings(); 32 | txtLogViewer.DisableReplace(); 33 | readLogLines(); 34 | renderLogMessages(); 35 | //txtLogViewer.Scrolling.ScrollToLine(txtLogViewer.Lines.Count-1); 36 | } 37 | 38 | private IEnumerable cbGrpLogLevels { get { return filterPanel.Controls.OfType(); } } 39 | 40 | private void bindCbGroupLogLevels() { 41 | cbFatal.Tag = LogLevel.Fatal; 42 | cbError.Tag = LogLevel.Error; 43 | cbWarn.Tag = LogLevel.Warn; 44 | cbInfo.Tag = LogLevel.Info; 45 | cbDebug.Tag = LogLevel.Debug; 46 | cbTrace.Tag = LogLevel.Trace; 47 | } 48 | 49 | private void bindSettings() { 50 | var settings = Settings.Default; 51 | cbGrpLogLevels.Each(cb => { 52 | if(settings.LogViewerLevelFilter.Contains(cb.Tag.ToString())) 53 | cb.Checked = true; 54 | else 55 | cb.Checked = false; 56 | 57 | }); 58 | } 59 | 60 | private void readLogLines() { 61 | try { 62 | logMessages = LogMessageModel.ParseAllMessages(logFilePath); 63 | } 64 | catch (Exception ex) { 65 | MessageBox.Show(String.Format("Could not load {0}, the file may not exist", logFilePath), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); 66 | log.Error(ex); 67 | this.Close(); 68 | } 69 | } 70 | 71 | /// 72 | /// Render all log messages from newest to oldest. 73 | /// 74 | private void renderLogMessages() { 75 | txtLogViewer.SuspendReadonly(() => { 76 | txtLogViewer.Text = ""; 77 | foreach(var lm in logMessages) { 78 | if(!isCheckedLogLevel(lm.Level)) 79 | continue; 80 | 81 | txtLogViewer.InsertText(0, lm.Message); 82 | var marker = txtLogViewer.Lines[0].AddMarker(lm.Level.Ordinal); 83 | marker.Marker.BackColor = getMarkerBackColor(lm.Level); 84 | } 85 | }); 86 | } 87 | 88 | private bool isCheckedLogLevel(LogLevel ll) { 89 | if(ll == LogLevel.Fatal && cbFatal.Checked) 90 | return true; 91 | if(ll == LogLevel.Error && cbError.Checked) 92 | return true; 93 | if(ll == LogLevel.Warn && cbWarn.Checked) 94 | return true; 95 | if(ll == LogLevel.Info && cbInfo.Checked) 96 | return true; 97 | if(ll == LogLevel.Debug && cbDebug.Checked) 98 | return true; 99 | if(ll == LogLevel.Trace && cbTrace.Checked) 100 | return true; 101 | else 102 | return false; 103 | } 104 | 105 | private static Color getMarkerBackColor(LogLevel ll) { 106 | if(ll == LogLevel.Fatal) 107 | return Color.Red; 108 | else if(ll == LogLevel.Error) 109 | return Color.Orange; 110 | else if(ll == LogLevel.Warn) 111 | return Color.Yellow; 112 | else if(ll == LogLevel.Info) 113 | return Color.Blue; 114 | else if (ll == LogLevel.Debug) 115 | return Color.Gray; 116 | else if (ll == LogLevel.Trace) 117 | return Color.Black; 118 | else 119 | return Color.White; 120 | } 121 | 122 | private void btnRefresh_Click(object sender, EventArgs e) 123 | { 124 | renderLogMessages(); 125 | var checkedLogLevels = cbGrpLogLevels.Where(cb => cb.Checked).Select(cb => cb.Tag.ToString()); 126 | Settings.Default.LogViewerLevelFilter = String.Join("|", checkedLogLevels); 127 | Settings.Default.Save(); 128 | } 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /Ior/Forms/LogViewer.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | abstract boolean break byte case catch char class const continue debugger default delete do double else enum export extends false final finally float for function goto if implements import in instanceof int interface long native new null package private protected public return static super switch synchronized this throw throws transient true try typeof var void volatile while with 122 | 123 | -------------------------------------------------------------------------------- /Ior/Forms/MainForm.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 17, 17 122 | 123 | 124 | 148, 17 125 | 126 | 127 | 351, 17 128 | 129 | 130 | 560, 17 131 | 132 | 133 | 17, 56 134 | 135 | 136 | 150 137 | 138 | -------------------------------------------------------------------------------- /Ior/Forms/SettingsDialog.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace Swensen.Ior.Forms { 2 | partial class SettingsDialog { 3 | /// 4 | /// Required designer variable. 5 | /// 6 | private System.ComponentModel.IContainer components = null; 7 | 8 | /// 9 | /// Clean up any resources being used. 10 | /// 11 | /// true if managed resources should be disposed; otherwise, false. 12 | protected override void Dispose(bool disposing) { 13 | if (disposing && (components != null)) { 14 | components.Dispose(); 15 | } 16 | base.Dispose(disposing); 17 | } 18 | 19 | #region Windows Form Designer generated code 20 | 21 | /// 22 | /// Required method for Designer support - do not modify 23 | /// the contents of this method with the code editor. 24 | /// 25 | private void InitializeComponent() { 26 | this.components = new System.ComponentModel.Container(); 27 | this.pnlButtons = new System.Windows.Forms.Panel(); 28 | this.btnCancel = new System.Windows.Forms.Button(); 29 | this.btnSave = new System.Windows.Forms.Button(); 30 | this.pgridOptions = new Swensen.Ior.Forms.PropertyGridEx(); 31 | this.pnlButtons.SuspendLayout(); 32 | this.SuspendLayout(); 33 | // 34 | // pnlButtons 35 | // 36 | this.pnlButtons.Controls.Add(this.btnCancel); 37 | this.pnlButtons.Controls.Add(this.btnSave); 38 | this.pnlButtons.Dock = System.Windows.Forms.DockStyle.Bottom; 39 | this.pnlButtons.Location = new System.Drawing.Point(0, 324); 40 | this.pnlButtons.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); 41 | this.pnlButtons.Name = "pnlButtons"; 42 | this.pnlButtons.Size = new System.Drawing.Size(627, 28); 43 | this.pnlButtons.TabIndex = 0; 44 | // 45 | // btnCancel 46 | // 47 | this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 48 | this.btnCancel.AutoSize = true; 49 | this.btnCancel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; 50 | this.btnCancel.Location = new System.Drawing.Point(575, 2); 51 | this.btnCancel.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); 52 | this.btnCancel.Name = "btnCancel"; 53 | this.btnCancel.Size = new System.Drawing.Size(50, 23); 54 | this.btnCancel.TabIndex = 1; 55 | this.btnCancel.Text = "Cancel"; 56 | this.btnCancel.UseVisualStyleBackColor = true; 57 | this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); 58 | // 59 | // btnSave 60 | // 61 | this.btnSave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 62 | this.btnSave.AutoSize = true; 63 | this.btnSave.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; 64 | this.btnSave.Location = new System.Drawing.Point(533, 2); 65 | this.btnSave.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); 66 | this.btnSave.Name = "btnSave"; 67 | this.btnSave.Size = new System.Drawing.Size(42, 23); 68 | this.btnSave.TabIndex = 0; 69 | this.btnSave.Text = "Save"; 70 | this.btnSave.UseVisualStyleBackColor = true; 71 | this.btnSave.Click += new System.EventHandler(this.btnSave_Click); 72 | // 73 | // pgridOptions 74 | // 75 | this.pgridOptions.CommandsVisibleIfAvailable = false; 76 | // 77 | // 78 | // 79 | this.pgridOptions.DocCommentDescription.Location = new System.Drawing.Point(3, 18); 80 | this.pgridOptions.DocCommentDescription.Name = ""; 81 | this.pgridOptions.DocCommentDescription.Size = new System.Drawing.Size(621, 37); 82 | this.pgridOptions.DocCommentDescription.TabIndex = 1; 83 | this.pgridOptions.DocCommentImage = null; 84 | // 85 | // 86 | // 87 | this.pgridOptions.DocCommentTitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold); 88 | this.pgridOptions.DocCommentTitle.Location = new System.Drawing.Point(3, 3); 89 | this.pgridOptions.DocCommentTitle.Name = ""; 90 | this.pgridOptions.DocCommentTitle.Size = new System.Drawing.Size(621, 15); 91 | this.pgridOptions.DocCommentTitle.TabIndex = 0; 92 | this.pgridOptions.Dock = System.Windows.Forms.DockStyle.Fill; 93 | this.pgridOptions.Location = new System.Drawing.Point(0, 0); 94 | this.pgridOptions.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); 95 | this.pgridOptions.Name = "pgridOptions"; 96 | this.pgridOptions.PropertySort = System.Windows.Forms.PropertySort.Categorized; 97 | this.pgridOptions.Size = new System.Drawing.Size(627, 324); 98 | this.pgridOptions.TabIndex = 1; 99 | this.pgridOptions.ToolbarVisible = false; 100 | // 101 | // 102 | // 103 | this.pgridOptions.ToolStrip.Location = new System.Drawing.Point(0, 0); 104 | this.pgridOptions.ToolStrip.Name = ""; 105 | this.pgridOptions.ToolStrip.Size = new System.Drawing.Size(875, 25); 106 | this.pgridOptions.ToolStrip.TabIndex = 1; 107 | this.pgridOptions.ToolStrip.Visible = false; 108 | // 109 | // SettingsDialog 110 | // 111 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 112 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 113 | this.ClientSize = new System.Drawing.Size(627, 352); 114 | this.Controls.Add(this.pgridOptions); 115 | this.Controls.Add(this.pnlButtons); 116 | this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); 117 | this.MinimizeBox = false; 118 | this.Name = "SettingsDialog"; 119 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 120 | this.Text = "Settings"; 121 | this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.SettingsDialog_FormClosing); 122 | this.Load += new System.EventHandler(this.frmOptionsDialog_Load); 123 | this.pnlButtons.ResumeLayout(false); 124 | this.pnlButtons.PerformLayout(); 125 | this.ResumeLayout(false); 126 | 127 | } 128 | 129 | #endregion 130 | 131 | private System.Windows.Forms.Panel pnlButtons; 132 | private System.Windows.Forms.Button btnCancel; 133 | private System.Windows.Forms.Button btnSave; 134 | private Swensen.Ior.Forms.PropertyGridEx pgridOptions; 135 | } 136 | } -------------------------------------------------------------------------------- /Ior/Forms/SettingsDialog.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Windows.Forms; 9 | using System.Configuration; 10 | using Swensen.Ior.Core; 11 | using Swensen.Ior.Properties; 12 | using System.IO; 13 | 14 | namespace Swensen.Ior.Forms { 15 | public partial class SettingsDialog : Form { 16 | public SettingsDialog() { 17 | InitializeComponent(); 18 | } 19 | 20 | private void frmOptionsDialog_Load(object sender, EventArgs e) { 21 | this.pgridOptions.PropertyValueChanged += new PropertyValueChangedEventHandler(pgridOptions_PropertyValueChanged); 22 | pgridOptions.SelectedObject = new SettingsViewModel(Settings.Default); 23 | pgridOptions.AutoSizeProperties = true; 24 | } 25 | 26 | private void btnSave_Click(object sender, EventArgs e) { 27 | Settings.Default.Save(); 28 | this.DialogResult = System.Windows.Forms.DialogResult.OK; 29 | this.Close(); 30 | } 31 | 32 | private void btnCancel_Click(object sender, EventArgs e) { 33 | this.DialogResult = DialogResult.Cancel; 34 | this.Close(); //n.b. we call Settings.Default.Reload(); in the FormClosing event 35 | } 36 | 37 | //todo this validation is adhoc, get plugged in with TypeConverters etc. 38 | void pgridOptions_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) { 39 | var vm = pgridOptions.SelectedObject as SettingsViewModel; 40 | 41 | var lastValidationError = vm.DequeueLastValidationError(); 42 | if(e.ChangedItem.PropertyDescriptor.Name == lastValidationError.Item1) { 43 | showPropertyValidationWarning(lastValidationError.Item2); 44 | pgridOptions.Refresh(); 45 | } 46 | } 47 | 48 | private void showPropertyValidationWarning(string msg) { 49 | MessageBox.Show(this, msg, "Validation Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); 50 | } 51 | 52 | private void SettingsDialog_FormClosing(object sender, FormClosingEventArgs e) { 53 | if(e.CloseReason == CloseReason.UserClosing && this.DialogResult != System.Windows.Forms.DialogResult.OK) 54 | Settings.Default.Reload(); 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Ior/Forms/SettingsDialog.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /Ior/Forms/StandardScintilla.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | using System.Windows.Forms; 4 | 5 | namespace Swensen.Ior.Forms { 6 | public class StandardScintilla : ScintillaNET.Scintilla { 7 | MenuItem miUndo; 8 | MenuItem miRedo; 9 | MenuItem miCut; 10 | MenuItem miCopy; 11 | MenuItem miPaste; 12 | MenuItem miDelete; 13 | MenuItem miSelectAll; 14 | 15 | public StandardScintilla() : base() { 16 | initContextMenu(); 17 | 18 | this.Indentation.IndentWidth = 2; 19 | this.Indentation.TabWidth = 2; 20 | this.Indentation.UseTabs = false; 21 | //this.Indentation.ShowGuides = true; 22 | //this.Indentation.BackspaceUnindents = true; 23 | //this.Indentation.SmartIndentType = ScintillaNET.SmartIndent. 24 | 25 | this.FindReplace.Window.FormBorderStyle = FormBorderStyle.FixedDialog; //so we can actually see the text title 26 | 27 | this.ConfigurationManager.Language = "js"; //not a bad default language 28 | this.ConfigurationManager.Configure(); 29 | } 30 | 31 | private void initContextMenu() { 32 | var cm = this.ContextMenu = new ContextMenu(); 33 | { 34 | this.miUndo = new MenuItem("Undo", (s, ea) => this.UndoRedo.Undo()); 35 | cm.MenuItems.Add(this.miUndo); 36 | } 37 | { 38 | this.miRedo = new MenuItem("Redo", (s, ea) => this.UndoRedo.Redo()); 39 | cm.MenuItems.Add(this.miRedo); 40 | } 41 | cm.MenuItems.Add(new MenuItem("-")); 42 | { 43 | this.miCut = new MenuItem("Cut", (s, ea) => this.Clipboard.Cut()); 44 | cm.MenuItems.Add(miCut); 45 | } 46 | { 47 | this.miCopy = new MenuItem("Copy", (s, ea) => this.Clipboard.Copy()); 48 | cm.MenuItems.Add(miCopy); 49 | } 50 | { 51 | this.miPaste = new MenuItem("Paste", (s, ea) => this.Clipboard.Paste()); 52 | cm.MenuItems.Add(miPaste); 53 | } 54 | { 55 | this.miDelete = new MenuItem("Delete", (s, ea) => this.NativeInterface.ReplaceSel("")); 56 | cm.MenuItems.Add(miDelete); 57 | } 58 | cm.MenuItems.Add(new MenuItem("-")); 59 | { 60 | this.miSelectAll = new MenuItem("Select All", (s, ea) => this.Selection.SelectAll()); 61 | cm.MenuItems.Add(miSelectAll); 62 | } 63 | } 64 | 65 | protected override void OnMouseDown(MouseEventArgs e) { 66 | if (e.Button == MouseButtons.Right) { 67 | miUndo.Enabled = this.UndoRedo.CanUndo; 68 | miRedo.Enabled = this.UndoRedo.CanRedo; 69 | miCut.Enabled = !this.IsReadOnly && this.Clipboard.CanCut; 70 | miCopy.Enabled = this.Clipboard.CanCopy; 71 | miPaste.Enabled = !this.IsReadOnly && this.Clipboard.CanPaste; 72 | miDelete.Enabled = !this.IsReadOnly && this.Selection.Length > 0; 73 | miSelectAll.Enabled = this.TextLength > 0 && this.TextLength != this.Selection.Length; 74 | } 75 | else 76 | base.OnMouseDown(e); 77 | } 78 | 79 | protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { 80 | var form = this.FindForm(); 81 | if (keyData == (Keys.Control | Keys.Tab)) { 82 | form.SelectNextControl(this, true, true, true, true); 83 | return true; 84 | } else if (keyData == (Keys.Control | Keys.Shift | Keys.Tab)) { 85 | form.SelectNextControl(this, false, true, true, true); 86 | return true; 87 | } else if (keyData == (Keys.Control | Keys.Enter)) { 88 | form.AcceptButton.PerformClick(); 89 | return true; 90 | } else 91 | return base.ProcessCmdKey(ref msg, keyData); 92 | } 93 | 94 | public void DisableReplace() { 95 | this.Commands.RemoveBinding(Keys.H, Keys.Control); 96 | ((TabControl)this.FindReplace.Window.Controls.Find("tabAll", true)[0]).TabPages.RemoveAt(1); 97 | } 98 | 99 | //scintilla does not allow programmatic write when set to readonly. 100 | public void SuspendReadonly(Action act) { 101 | if (this.IsReadOnly) { 102 | try { 103 | this.IsReadOnly = false; 104 | act(); 105 | } finally { 106 | this.IsReadOnly = true; 107 | } 108 | } else 109 | act(); 110 | } 111 | 112 | public override string Text { 113 | get { 114 | return base.Text; 115 | } 116 | set { 117 | SuspendReadonly(() => base.Text = value); 118 | } 119 | } 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /Ior/Forms/StandardTextBox.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows.Forms; 6 | using System.Runtime.InteropServices; 7 | 8 | namespace Swensen.Ior.Forms { 9 | public class StandardTextBox : TextBox { 10 | MenuItem miCut; 11 | MenuItem miCopy; 12 | MenuItem miDelete; 13 | MenuItem miSelectAll; 14 | 15 | public StandardTextBox() : base() { 16 | initContextMenu(); 17 | } 18 | 19 | private void initContextMenu() { 20 | var cm = this.ContextMenu = new ContextMenu(); 21 | cm.MenuItems.Add(new MenuItem("Undo", (s, ea) => this.Undo())); 22 | cm.MenuItems.Add(new MenuItem("-")); 23 | { 24 | this.miCut = new MenuItem("Cut", (s, ea) => this.Cut()); 25 | cm.MenuItems.Add(miCut); 26 | } 27 | { 28 | this.miCopy = new MenuItem("Copy", (s, ea) => this.Copy()); 29 | cm.MenuItems.Add(miCopy); 30 | } 31 | cm.MenuItems.Add(new MenuItem("Paste", (s, ea) => this.Paste())); 32 | { 33 | this.miDelete = new MenuItem("Delete", (s, ea) => this.SelectedText = ""); 34 | cm.MenuItems.Add(miDelete); 35 | } 36 | cm.MenuItems.Add(new MenuItem("-")); 37 | { 38 | this.miSelectAll = new MenuItem("Select All", (s, ea) => this.SelectAll()); 39 | cm.MenuItems.Add(miSelectAll); 40 | } 41 | } 42 | 43 | protected override void OnMouseDown(MouseEventArgs e) { 44 | if (e.Button == System.Windows.Forms.MouseButtons.Right) { 45 | this.Focus(); 46 | var charIndex = this.GetCharIndexFromPosition(e.Location); 47 | if (this.SelectionLength == 0) { //no selected text 48 | this.SelectionStart = charIndex; 49 | } else if(charIndex < this.SelectionStart || charIndex > (this.SelectionStart + this.SelectionLength)) { // user clicks outside of selected text 50 | this.Select(charIndex, 0); 51 | } 52 | miCut.Enabled = this.SelectionLength > 0; 53 | miCopy.Enabled = this.SelectionLength > 0; 54 | miDelete.Enabled = this.SelectionLength > 0; 55 | miSelectAll.Enabled = this.TextLength > 0 && this.TextLength != this.SelectionLength; 56 | } else 57 | base.OnMouseDown(e); 58 | } 59 | 60 | //credit to Schotime, see http://schotime.net/blog/index.php/2008/03/12/select-all-ctrla-for-textbox/ 61 | protected override void OnKeyDown(KeyEventArgs e) { 62 | base.OnKeyDown(e); 63 | if (e.Control && (e.KeyCode == System.Windows.Forms.Keys.A)) { 64 | this.SelectAll(); 65 | e.SuppressKeyPress = true; 66 | e.Handled = true; 67 | } 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Ior/NLog.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Ior/NLog.Release.config: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | -------------------------------------------------------------------------------- /Ior/NLog.config: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Ior/Program.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2012 Stephen Swensen 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | using System; 17 | using System.Threading.Tasks; 18 | using System.Windows.Forms; 19 | using NLog; 20 | using System.Reflection; 21 | using System.Drawing; 22 | 23 | namespace Swensen.Ior 24 | { 25 | static class Program 26 | { 27 | private static Logger log = LogManager.GetCurrentClassLogger(); 28 | 29 | /// 30 | /// The main entry point for the application. 31 | /// 32 | [STAThread] 33 | static void Main() 34 | { 35 | log.Info("App starting"); 36 | var args = Environment.GetCommandLineArgs(); 37 | var launchFilePath = args.Length >= 2 ? args[1] : null; 38 | 39 | //set default form icon to project exe icon 40 | var defaultIcon = Icon.ExtractAssociatedIcon(Application.ExecutablePath); 41 | typeof(Form).GetField("defaultIcon", BindingFlags.NonPublic | BindingFlags.Static).SetValue(null, defaultIcon); 42 | 43 | AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; 44 | Application.ApplicationExit += Application_ApplicationExit; 45 | //TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException; 46 | 47 | Application.EnableVisualStyles(); 48 | Application.SetCompatibleTextRenderingDefault(false); 49 | Application.Run(new Forms.MainForm(launchFilePath)); 50 | } 51 | 52 | //private static void TaskScheduler_UnobservedTaskException(object sender, UnobservedTaskExceptionEventArgs e) { 53 | // log.Warn("Swallowing UnobseredTaskException: {0}", e.Exception); 54 | // e.SetObserved(); 55 | //} 56 | 57 | static void Application_ApplicationExit(object sender, EventArgs e) { 58 | log.Info("App shutting down"); 59 | } 60 | 61 | static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { 62 | log.Fatal((Exception) e.ExceptionObject, String.Format("Unhandled AppDomain exception, IsTerminating={0}", e.IsTerminating)); 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /Ior/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("I'm Only Resting")] 8 | [assembly: AssemblyDescription("http://www.swensensoftware.com/im-only-resting")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("I'm Only Resting")] 12 | [assembly: AssemblyCopyright("Copyright © Swensen Software 2012 - 2016")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("42d77ebc-de54-4916-b931-de852d2bacff")] 23 | 24 | //use odd revision number (fourth position) to indicate pre-release 25 | [assembly: AssemblyVersion("2.0.0.3")] -------------------------------------------------------------------------------- /Ior/Properties/HistorySettings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Swensen.Ior.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] 16 | public sealed partial class HistorySettings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static HistorySettings defaultInstance = ((HistorySettings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new HistorySettings()))); 19 | 20 | public static HistorySettings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | 26 | [global::System.Configuration.UserScopedSettingAttribute()] 27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 28 | [global::System.Configuration.DefaultSettingValueAttribute("")] 29 | public string HistoryList { 30 | get { 31 | return ((string)(this["HistoryList"])); 32 | } 33 | set { 34 | this["HistoryList"] = value; 35 | } 36 | } 37 | 38 | [global::System.Configuration.UserScopedSettingAttribute()] 39 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 40 | [global::System.Configuration.DefaultSettingValueAttribute("True")] 41 | public bool CallUpgrade { 42 | get { 43 | return ((bool)(this["CallUpgrade"])); 44 | } 45 | set { 46 | this["CallUpgrade"] = value; 47 | } 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Ior/Properties/HistorySettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using Swensen.Utils; 4 | using NLog; 5 | 6 | namespace Swensen.Ior.Properties { 7 | // This class allows you to handle specific events on the settings class: 8 | // The SettingChanging event is raised before a setting's value is changed. 9 | // The PropertyChanged event is raised after a setting's value is changed. 10 | // The SettingsLoaded event is raised after the setting values are loaded. 11 | // The SettingsSaving event is raised before the setting values are saved. 12 | public sealed partial class HistorySettings { 13 | private static Logger log = LogManager.GetCurrentClassLogger(); 14 | 15 | public HistorySettings() { } 16 | 17 | public void UpgradeAndSaveIfNeeded() { 18 | if (this.CallUpgrade) { 19 | log.Info("Upgrading history settings"); 20 | this.Upgrade(); 21 | this.CallUpgrade = false; 22 | this.Save(); 23 | } 24 | } 25 | 26 | private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) { 27 | // Add code to handle the SettingChangingEvent event here. 28 | } 29 | 30 | private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e) { 31 | // Add code to handle the SettingsSaving event here. 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Ior/Properties/HistorySettings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | <History></History> 7 | 8 | 9 | True 10 | 11 | 12 | -------------------------------------------------------------------------------- /Ior/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Swensen.Ior.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Swensen.Ior.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). 65 | /// 66 | internal static System.Drawing.Icon Camera { 67 | get { 68 | object obj = ResourceManager.GetObject("Camera", resourceCulture); 69 | return ((System.Drawing.Icon)(obj)); 70 | } 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /Ior/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | ..\Resources\Camera.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 123 | 124 | -------------------------------------------------------------------------------- /Ior/Properties/Settings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using Swensen.Utils; 4 | using NLog; 5 | 6 | namespace Swensen.Ior.Properties { 7 | // This class allows you to handle specific events on the settings class: 8 | // The SettingChanging event is raised before a setting's value is changed. 9 | // The PropertyChanged event is raised after a setting's value is changed. 10 | // The SettingsLoaded event is raised after the setting values are loaded. 11 | // The SettingsSaving event is raised before the setting values are saved. 12 | public sealed partial class Settings { 13 | private static Logger log = LogManager.GetCurrentClassLogger(); 14 | 15 | public Settings() { 16 | SetupCalculatedDefaultSettings(); 17 | } 18 | 19 | private void SetupCalculatedDefaultSettings() { 20 | if (this.SaveRequestFileDialogFolder.IsBlank()) 21 | this.SaveRequestFileDialogFolder = 22 | Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + Path.DirectorySeparatorChar + "Http Saved Requests"; 23 | 24 | if (this.ExportResponseFileDialogFolder.IsBlank()) 25 | this.ExportResponseFileDialogFolder = 26 | Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + Path.DirectorySeparatorChar + "Http Exported Responses"; 27 | } 28 | 29 | public void UpgradeAndSaveIfNeeded() { 30 | if (this.CallUpgrade) { 31 | log.Info("Upgrading user settings"); 32 | this.Upgrade(); 33 | this.SetupCalculatedDefaultSettings(); 34 | this.CallUpgrade = false; 35 | this.Save(); 36 | } 37 | } 38 | 39 | private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) { 40 | // Add code to handle the SettingChangingEvent event here. 41 | } 42 | 43 | private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e) { 44 | // Add code to handle the SettingsSaving event here. 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Ior/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | Vertical 7 | 8 | 9 | 50 10 | 11 | 12 | 1450 13 | 14 | 15 | 690 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | Rendered 31 | 32 | 33 | application/octet-stream 34 | 35 | 36 | True 37 | 38 | 39 | 15 40 | 41 | 42 | False 43 | 44 | 45 | False 46 | 47 | 48 | Fatal|Error|Warn 49 | 50 | 51 | False 52 | 53 | 54 | True 55 | 56 | 57 | -------------------------------------------------------------------------------- /Ior/Resources/Camera.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SwensenSoftware/im-only-resting/0c3709024810d886a2f1919a692886f286e7a082/Ior/Resources/Camera.ico -------------------------------------------------------------------------------- /Ior/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 |
7 |
8 | 9 | 10 | 11 | 12 | 13 | <History></History> 14 | 15 | 16 | True 17 | 18 | 19 | 20 | 21 | <History></History> 22 | 23 | 24 | 25 | 26 | Vertical 27 | 28 | 29 | 50 30 | 31 | 32 | 1450 33 | 34 | 35 | 690 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | Rendered 51 | 52 | 53 | application/octet-stream 54 | 55 | 56 | True 57 | 58 | 59 | 15 60 | 61 | 62 | False 63 | 64 | 65 | False 66 | 67 | 68 | Fatal|Error|Warn 69 | 70 | 71 | False 72 | 73 | 74 | True 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /Ior/logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SwensenSoftware/im-only-resting/0c3709024810d886a2f1919a692886f286e7a082/Ior/logo.ico -------------------------------------------------------------------------------- /Ior/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | I'm Only Resting 2 | Copyright 2012-2014 Stephen Swensen 3 | 4 | The I'm Only Resting icon was designed by Priya Swensen 5 | 6 | This software includes Microsoft Visual Studio 2010 Babel Icons 7 | 8 | This software links to JSON.NET, Copyright (c) 2007 James Newton-King, http://json.codeplex.com/license (MIT license) 9 | 10 | This software links to HTML Tidy, Copyright (c) 1998-2008 World Wide Web Consortium, http://tidy.sourceforge.net/#license (MIT-like license) 11 | 12 | This software includes source code from Danilo Corallo's PropertyGridEx, http://www.codeproject.com/Articles/13630/Add-Custom-Properties-to-a-PropertyGrid (Code Project Open License) 13 | 14 | This software links to NLog, Copyright (c) 2004-2011 Jaroslaw Kowalski, https://github.com/NLog/NLog/blob/master/LICENSE.txt (BSD license) 15 | 16 | This software links to Microsoft.Net.Http, Copyright (c) Microsoft, http://www.microsoft.com/web/webpi/eula/mvc_4_eula_enu.htm (non-standard Microsoft license, giving binary redistribution rights) 17 | 18 | This software links to ScintillaNET, Copyright 2002-2006 by Garrett Serack, which in turn links to Scintilla, Copyright 1998-2006 by Neil Hodgson, http://scintillanet.codeplex.com/license (both use the same permissive custom license) 19 | 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [User Guide](../../wiki/UserGuide) | [Downloads](http://www.swensensoftware.com/im-only-resting) | [Release Notes](../../wiki/ReleaseNotes) | [Issues](../../issues) 2 | 3 | --- 4 | 5 | I'm Only Resting is a feature-rich WinForms-based HTTP client that makes building and managing HTTP requests easy and offers various smart response content rendering modes. 6 | 7 | ![screenshot](https://i.stack.imgur.com/ZVdQv.png) 8 | 9 | Feature Overview 10 | * Easy request management 11 | * Save, Save As..., and Open... file menu options 12 | * URL auto-completion 13 | * Persistent request history with temporary response snapshots. 14 | * Choose from 3 response body output modes 15 | * Raw - content is displayed as plain text honoring the content-type charset 16 | * Pretty - content is displayed as plain text honoring the content-type charset and additionally performs pretty-printing on XML, JSON, and HTML content-types. 17 | * XML pretty-printing provided by the [.NET `XDocument` type](http://msdn.microsoft.com/en-us/library/system.xml.linq.xdocument(v=vs.100).aspx) 18 | * JSON pretty-printing provided by [Json.NET](http://json.codeplex.com/) 19 | * HTML pretty-printing provided by [HTML Tidy](http://tidy.sourceforge.net/) 20 | * Rendered - content is rendered in an embedded IE browser instance. XML, HTML, and images are rendered using IE's rendering engine. JSON is rendered using JSON.NET pretty-printing embedded in an html pre tag. Other types of plain text are embedded in an html pre tag. IE's search feature is enabled. 21 | * Export raw response body bytes with automatic file-type extension detection based on the content-type 22 | * Attempt to pretty-print XML and JSON request bodies using .NET `XDocument` type and Json.NET respectively 23 | * Configure a proxy server 24 | * User-interface for managing persistent user-settings 25 | * Request-response split panel view can toggle between horizontal and vertical orientation 26 | * Rich text editing and syntax highlighting provided by [ScintillaNET](http://scintillanet.codeplex.com/) 27 | * Interactive interface for inspecting log file 28 | 29 | --- 30 | [![build status](https://ci.appveyor.com/api/projects/status/eo4qpc6mmew39i6a?svg=true)](https://ci.appveyor.com/project/stephen-swensen/im-only-resting) 31 | 32 | You are welcome to [Pay What You Want](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WXSPTXDPECJ9L) for I'm Only Resting via PayPal. 33 | 34 | Copyright 2012-2014 [Swensen Software](http://www.swensensoftware.com) 35 | -------------------------------------------------------------------------------- /Tests.IorTests/Core/IorClientTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using NUnit.Framework; 3 | using Swensen.Ior.Core; 4 | using FluentAssertions; 5 | 6 | namespace Tests.IorTests { 7 | public class IorClientTests { 8 | [Test] 9 | public void GetEncodedBytes_utf16() { 10 | //default big endian w/ bom 11 | var actual = IorClient.GetEncodedBytes("echo", "utf-16", false); 12 | var expected = new byte[] { 0xFE, 0xFF, 0x00, 0x65, 0x00, 0x63, 0x00, 0x68, 0x00, 0x6F }; 13 | actual.ShouldBeEquivalentTo(expected); 14 | } 15 | 16 | [Test] 17 | public void GetEncodedBytes_utf16be() { 18 | //be no bom 19 | var actual = IorClient.GetEncodedBytes("echo", "utf-16be", false); 20 | var expected = new byte[] { 0x00, 0x65, 0x00, 0x63, 0x00, 0x68, 0x00, 0x6F }; 21 | actual.ShouldBeEquivalentTo(expected); 22 | } 23 | 24 | [Test] 25 | public void GetEncodedBytes_utf16le() { 26 | //le no bom 27 | var actual = IorClient.GetEncodedBytes("echo", "utf-16le", false); 28 | var expected = new byte[] { 0x65, 0x00, 0x63, 0x00, 0x68, 0x00, 0x6F, 0x00 }; 29 | actual.ShouldBeEquivalentTo(expected); 30 | } 31 | 32 | [Test] 33 | public void GetEncodedBytes_utf32() { 34 | //default big endian w/ bom 35 | var actual = IorClient.GetEncodedBytes("echo", "utf-32", false); 36 | var expected = new byte[] { 0x00, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x6F }; 37 | actual.ShouldBeEquivalentTo(expected); 38 | } 39 | 40 | [Test] 41 | public void GetEncodedBytes_utf32be() { 42 | //be no bom 43 | var actual = IorClient.GetEncodedBytes("echo", "utf-32be", false); 44 | var expected = new byte[] { 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x6F }; 45 | actual.ShouldBeEquivalentTo(expected); 46 | } 47 | 48 | [Test] 49 | public void GetEncodedBytes_utf32le() { 50 | //le no bom 51 | var actual = IorClient.GetEncodedBytes("echo", "utf-32le", false); 52 | var expected = new byte[] { 0x65, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x6F, 0x00, 0x00, 0x00 }; 53 | actual.ShouldBeEquivalentTo(expected); 54 | } 55 | 56 | [Test] 57 | public void GetEncodedBytes_utf8_no_bom() { 58 | var actual = IorClient.GetEncodedBytes("echo", "utf-8", false); 59 | var expected = new byte[] { 0x65, 0x63, 0x68, 0x6F }; 60 | actual.ShouldBeEquivalentTo(expected); 61 | } 62 | 63 | [Test] 64 | public void GetEncodedBytes_utf8_bom() { 65 | var actual = IorClient.GetEncodedBytes("echo", "utf-8", true); 66 | var expected = new byte[] { 0xEF, 0xBB, 0xBF, 0x65, 0x63, 0x68, 0x6F }; 67 | actual.ShouldBeEquivalentTo(expected); 68 | } 69 | 70 | [Test] 71 | public void GetEncodedBytes_default_ascii() { 72 | var actual = IorClient.GetEncodedBytes("echo", "", true); 73 | var expected = new byte[] { 0x65, 0x63, 0x68, 0x6F }; 74 | actual.ShouldBeEquivalentTo(expected); 75 | } 76 | 77 | [Test] 78 | public void Base64EncodeUrlUserInfo_wikipedia_example_with_space() { 79 | var url = new Uri("http://Aladdin:open sesame@example.com"); 80 | var actual = IorClient.Base64EncodeUrlUserInfo(url); 81 | var expected = "QWxhZGRpbjpvcGVuIHNlc2FtZQ=="; 82 | actual.ShouldBeEquivalentTo(expected); 83 | } 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /Tests.IorTests/Core/IorContentTypeTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using NUnit.Framework; 3 | using Swensen.Ior.Core; 4 | using FluentAssertions; 5 | 6 | namespace Tests.IorTests { 7 | public class IorContentTypeTests { 8 | [Test] 9 | public void ctor_forgives_illegal_comma_sep_content_type() { 10 | var ict = new IorContentType("text/xml, application/xml"); 11 | ict.MediaType.Should().Be("text/xml"); 12 | } 13 | 14 | [Test] 15 | public void default_ctor() { 16 | var ict = new IorContentType(); 17 | ict.MediaType.Should().Be("application/octet-stream"); 18 | } 19 | 20 | [Test] 21 | public void ctor_forgive_illegal_content_type_fallback() { 22 | var ict = new IorContentType("R#O@IJ@#R"); 23 | ict.MediaType.Should().Be("application/octet-stream"); 24 | } 25 | 26 | [Test] 27 | public void ctor_sets_category() { 28 | var ict = new IorContentType("text/xml"); 29 | ict.MediaType.Should().Be("text/xml"); 30 | ict.MediaTypeCategory.Should().Be(IorMediaTypeCategory.Xml); 31 | } 32 | 33 | [Test] 34 | public void parse_media_type_category() { 35 | IorContentType.GetMediaTypeCategory("text/xml").Should().Be(IorMediaTypeCategory.Xml); 36 | IorContentType.GetMediaTypeCategory("text/html").Should().Be(IorMediaTypeCategory.Html); 37 | IorContentType.GetMediaTypeCategory("text/json").Should().Be(IorMediaTypeCategory.Json); 38 | IorContentType.GetMediaTypeCategory("text/plain").Should().Be(IorMediaTypeCategory.Text); 39 | IorContentType.GetMediaTypeCategory("image/jpg").Should().Be(IorMediaTypeCategory.Application); 40 | IorContentType.GetMediaTypeCategory("application/octet-stream").Should().Be(IorMediaTypeCategory.Application); 41 | } 42 | 43 | [Test] 44 | public void get_file_ext() { 45 | var localhost = new Uri("http://localhost"); 46 | IorContentType.GetFileExtension(IorMediaTypeCategory.Xml, "text/xml", localhost).Should().Be("xml"); 47 | IorContentType.GetFileExtension(IorMediaTypeCategory.Html, "text/html", localhost).Should().Be("html"); 48 | IorContentType.GetFileExtension(IorMediaTypeCategory.Json, "text/json", localhost).Should().Be("json"); 49 | IorContentType.GetFileExtension(IorMediaTypeCategory.Text, "text/plain", localhost).Should().Be("txt"); 50 | IorContentType.GetFileExtension(IorMediaTypeCategory.Application, "image/jpg", localhost).Should().Be("jpg"); 51 | IorContentType.GetFileExtension(IorMediaTypeCategory.Other, "text/csv", localhost).Should().Be("csv"); 52 | IorContentType.GetFileExtension(IorMediaTypeCategory.Other, "text/css", localhost).Should().Be("css"); 53 | IorContentType.GetFileExtension(IorMediaTypeCategory.Other, "application/javascript", localhost).Should().Be("js"); 54 | IorContentType.GetFileExtension(IorMediaTypeCategory.Other, "application/python", localhost).Should().Be(""); 55 | IorContentType.GetFileExtension(IorMediaTypeCategory.Application, "application/zip", localhost).Should().Be("zip"); 56 | 57 | var imgUri = new Uri("http://localhost/test.img"); 58 | IorContentType.GetFileExtension(IorMediaTypeCategory.Application, "application/octet-stream", imgUri).Should().Be("img"); 59 | } 60 | 61 | [Test] 62 | public void pretty_print_xml_no_doctype() { 63 | var input = "world"; 64 | var output = IorContentType.GetPrettyPrintedContent(IorMediaTypeCategory.Xml, input); 65 | output.Should().Be("\r\n world\r\n"); 66 | } 67 | 68 | [Test] 69 | public void pretty_print_xml_with_doctype() { 70 | var input = "world"; 71 | var output = IorContentType.GetPrettyPrintedContent(IorMediaTypeCategory.Xml, input); 72 | output.Should().Be("\r\n\r\n world\r\n"); 73 | } 74 | 75 | [Test] 76 | public void pretty_print_xml_malformed_forgives() { 77 | var input = "world"; 78 | var output = IorContentType.GetPrettyPrintedContent(IorMediaTypeCategory.Xml, input); 79 | output.Should().Be(input); 80 | } 81 | 82 | [Test] 83 | public void pretty_print_json() { 84 | var input = "{ x: 23 }"; 85 | var output = IorContentType.GetPrettyPrintedContent(IorMediaTypeCategory.Json, input); 86 | output.Should().Be("{\r\n \"x\": 23\r\n}"); 87 | } 88 | 89 | [Test] 90 | public void pretty_print_json_malformed_forgives() { 91 | var input = "{ x: 23 + 3 }"; 92 | var output = IorContentType.GetPrettyPrintedContent(IorMediaTypeCategory.Json, input); 93 | output.Should().Be(input); 94 | } 95 | 96 | [Test] 97 | public void pretty_print_html() { 98 | var input = "hello world"; 99 | var output = IorContentType.GetPrettyPrintedContent(IorMediaTypeCategory.Html, input); 100 | output.Should().Be("\r\n\r\n \r\n \r\n \r\n \r\n \r\n hello world\r\n \r\n\r\n"); 101 | } 102 | 103 | [Test] 104 | public void pretty_print_other() { 105 | var input = "hello world"; 106 | var output = IorContentType.GetPrettyPrintedContent(IorMediaTypeCategory.Text, input); 107 | output.Should().Be(input); 108 | } 109 | 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /Tests.IorTests/Core/RequestViewModelTests.cs: -------------------------------------------------------------------------------- 1 | using System.Net.Http; 2 | using NUnit.Framework; 3 | using Swensen.Ior.Core; 4 | using Swensen.Utils; 5 | using FluentAssertions; 6 | 7 | namespace Tests.IorTests { 8 | public class RequestViewModelTests { 9 | [Test] 10 | public void serializeAndDeserialize() { 11 | var rvm = new RequestViewModel { 12 | Body = "body", 13 | Headers = new[] { "h1", "h2" }, 14 | Method = HttpMethod.Post.Method, 15 | Url = "url" 16 | }; 17 | 18 | var filepath = FileUtils.CreateTempFilePath("xml"); 19 | rvm.Save(filepath); 20 | 21 | var rvm_deserialized = RequestViewModel.Load(filepath); 22 | 23 | rvm.ShouldBeEquivalentTo(rvm_deserialized); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Tests.IorTests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Tests.IorTests")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Tests.IorTests")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2012")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("e7a5eaeb-ee96-4cf5-9c32-94e030d5e07a")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Tests.IorTests/Tests.IorTests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | {E18906ED-D117-49FF-A592-D724F5FDCB48} 9 | Library 10 | Properties 11 | Tests.IorTests 12 | Tests.IorTests 13 | v4.6.1 14 | 512 15 | ..\ 16 | true 17 | 18 | 19 | 20 | 21 | 22 | true 23 | full 24 | false 25 | bin\Debug\ 26 | DEBUG;TRACE 27 | prompt 28 | 4 29 | false 30 | 31 | 32 | pdbonly 33 | true 34 | bin\Release\ 35 | TRACE 36 | prompt 37 | 4 38 | false 39 | 40 | 41 | true 42 | bin\x86\Debug\ 43 | DEBUG;TRACE 44 | full 45 | x86 46 | bin\Debug\Tests.IorTests.dll.CodeAnalysisLog.xml 47 | true 48 | GlobalSuppressions.cs 49 | prompt 50 | MinimumRecommendedRules.ruleset 51 | ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets 52 | true 53 | ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules 54 | true 55 | false 56 | 57 | 58 | bin\x86\Release\ 59 | TRACE 60 | true 61 | pdbonly 62 | x86 63 | bin\Release\Tests.IorTests.dll.CodeAnalysisLog.xml 64 | true 65 | GlobalSuppressions.cs 66 | prompt 67 | MinimumRecommendedRules.ruleset 68 | ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets 69 | true 70 | ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules 71 | true 72 | false 73 | 74 | 75 | 76 | ..\packages\FluentAssertions.4.2.2\lib\net45\FluentAssertions.dll 77 | True 78 | 79 | 80 | ..\packages\FluentAssertions.4.2.2\lib\net45\FluentAssertions.Core.dll 81 | True 82 | 83 | 84 | ..\packages\NUnitTestAdapter.WithFramework.2.0.0\lib\nunit.core.dll 85 | False 86 | 87 | 88 | ..\packages\NUnitTestAdapter.WithFramework.2.0.0\lib\nunit.core.interfaces.dll 89 | False 90 | 91 | 92 | ..\packages\NUnitTestAdapter.WithFramework.2.0.0\lib\nunit.framework.dll 93 | True 94 | 95 | 96 | ..\packages\NUnitTestAdapter.WithFramework.2.0.0\lib\nunit.util.dll 97 | False 98 | 99 | 100 | ..\packages\NUnitTestAdapter.WithFramework.2.0.0\lib\NUnit.VisualStudio.TestAdapter.dll 101 | False 102 | 103 | 104 | 105 | 106 | 107 | ..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Extensions.dll 108 | True 109 | 110 | 111 | ..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Primitives.dll 112 | True 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | {B859DACC-2D94-46FC-973C-17EF37A5F64F} 131 | Ior 132 | 133 | 134 | {937C9CDB-4994-41F8-9219-50A63E6248A6} 135 | Utils 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 150 | 151 | 152 | 153 | 160 | -------------------------------------------------------------------------------- /Tests.IorTests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Utils/FilePathFormatter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | namespace Swensen.Utils { 5 | public enum FilePathFormat { 6 | Full, Short, Ellipsis, ShortFileFullDir, FullDir 7 | } 8 | 9 | public static class FilePathFormatter { 10 | public static string Format(this FileInfo filePath, FilePathFormat format) { 11 | switch (format) { 12 | case FilePathFormat.Full: 13 | return filePath.FullName; 14 | case FilePathFormat.Short: 15 | return filePath.Name; 16 | case FilePathFormat.ShortFileFullDir: 17 | return string.Format("{0} ({1})", filePath.Name, filePath.DirectoryName); 18 | case FilePathFormat.Ellipsis: 19 | return string.Format(@"{1}...{0}{2}{0}{3}", Path.DirectorySeparatorChar, filePath.Directory.Root.Name, filePath.Directory.Name, filePath.Name); 20 | case FilePathFormat.FullDir: 21 | return filePath.DirectoryName; 22 | default: 23 | throw new ArgumentOutOfRangeException("format"); 24 | } 25 | } 26 | 27 | public static string Format(string filePath, FilePathFormat format) { 28 | if (filePath.IsBlank()) 29 | return ""; 30 | 31 | return Format(new FileInfo(filePath), format); 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /Utils/FileUtils.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | 7 | namespace Swensen.Utils { 8 | public static class FileUtils { 9 | public static string CreateTempFilePath(string extension) { 10 | var path = Path.GetTempPath(); 11 | var fileName = Guid.NewGuid().ToString() + (extension.IsBlank() ? "" : "." + extension); 12 | var fullFileName = Path.Combine(path, fileName); 13 | return fullFileName; 14 | } 15 | 16 | /// 17 | /// Creates the temporary file with the given extension and returns its full path. 18 | /// 19 | /// 20 | /// 21 | /// 22 | public static string CreateTempFile(byte[] contentBytes, string extension) { 23 | var fullFileName = CreateTempFilePath(extension); 24 | File.WriteAllBytes(fullFileName, contentBytes); 25 | return fullFileName; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Utils/HistoryList.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace Swensen.Utils { 5 | public class HistoryList : IEnumerable { 6 | List list; 7 | 8 | /// 9 | /// Init with initial max history 10 | /// 11 | /// initial max history 12 | public HistoryList(int maxHistory) { 13 | this.maxHistory = maxHistory; 14 | this.list = new List(maxHistory); 15 | } 16 | 17 | 18 | int maxHistory; 19 | /// 20 | /// The movable max history 21 | /// 22 | public int MaxHistory { 23 | get { return maxHistory; } 24 | set { 25 | if (value < 0) 26 | throw new ArgumentOutOfRangeException("MaxHistory must be greater than or equal to 0"); 27 | 28 | maxHistory = value; 29 | ensureMaxHistory(); 30 | } 31 | } 32 | 33 | /// 34 | /// Remove any element from the tail of the list that are outside of maxHistory 35 | /// 36 | private void ensureMaxHistory() { 37 | if (list.Count > maxHistory) { 38 | //maxHistory = 10 and list.Count = 11, then list.RemoveRange(10, 11 - 10 == 1) 39 | list.RemoveRange(maxHistory, list.Count - maxHistory); 40 | } 41 | } 42 | 43 | /// 44 | /// Prepend a history item 45 | /// 46 | /// 47 | public void Add(T item) { 48 | list.Insert(0, item); 49 | ensureMaxHistory(); 50 | } 51 | 52 | public void Clear() { 53 | list.Clear(); 54 | } 55 | 56 | public int Count { get { return list.Count; } } 57 | 58 | public IEnumerator GetEnumerator() { 59 | return list.GetEnumerator(); 60 | } 61 | 62 | System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { 63 | return GetEnumerator(); 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /Utils/IEnumerableUtils.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace Swensen.Utils { 6 | public static class IEnumerableUtils { 7 | public static IEnumerable Coalesce(this IEnumerable input, IEnumerable fallback) { 8 | return input ?? fallback; 9 | } 10 | 11 | public static IEnumerable Coalesce(this IEnumerable input) { 12 | return input.Coalesce(new T[] { }); 13 | } 14 | 15 | public static string Join(this IEnumerable input, string sep) { 16 | return String.Join(sep, input); 17 | } 18 | 19 | /// 20 | /// Force the enumeration of this sequence, returning a readonly wrapper for the results. 21 | /// 22 | /// 23 | /// 24 | /// 25 | public static IEnumerable Force(this IEnumerable input) { 26 | return input.ToList().AsReadOnly().AsEnumerable(); 27 | } 28 | 29 | public static void Each(this IEnumerable input, Action f) { 30 | foreach(var x in input) 31 | f(x); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Utils/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Utils")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Utils")] 13 | [assembly: AssemblyCopyright("Copyright © Stephen Swensen 2012")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("d7986c35-96fb-46f7-afe2-22626c299564")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Utils/StringUtils.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Swensen.Utils { 4 | public enum StringCoalesceMode { Null, NullOrEmpty, NullOrBlank } 5 | 6 | public static class StringUtils { 7 | /// 8 | /// return String.IsNullOrWhiteSpace(input); 9 | /// 10 | /// 11 | /// 12 | /// 13 | public static bool IsBlank(this string input) { 14 | return String.IsNullOrWhiteSpace(input); 15 | } 16 | 17 | /// 18 | /// Coalesce the given string with the given mode using the given fallback. 19 | /// 20 | /// 21 | /// 22 | /// 23 | /// 24 | public static string Coalesce(this string input, string fallback, StringCoalesceMode mode) { 25 | switch (mode) { 26 | case StringCoalesceMode.Null : 27 | return input ?? fallback; 28 | case StringCoalesceMode.NullOrEmpty: 29 | return string.IsNullOrEmpty(input) ? fallback : input; 30 | case StringCoalesceMode.NullOrBlank: 31 | return string.IsNullOrWhiteSpace(input) ? fallback : input; 32 | default: 33 | throw new ArgumentOutOfRangeException("mode"); 34 | } 35 | } 36 | 37 | /// 38 | /// Coalesce the given string using the NullOrBlank mode with the given fallback. 39 | /// 40 | /// 41 | /// 42 | /// 43 | public static string Coalesce(this string input, string fallback) { 44 | return Coalesce(input, fallback, StringCoalesceMode.NullOrBlank); 45 | } 46 | 47 | /// 48 | /// Coalesce the given string using the NullOrBlank mode with "" as the fallback. 49 | /// 50 | /// 51 | /// 52 | public static string Coalesce(this string input) { 53 | return Coalesce(input, "", StringCoalesceMode.NullOrBlank); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Utils/Utils.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | {937C9CDB-4994-41F8-9219-50A63E6248A6} 9 | Library 10 | Properties 11 | Swensen.Utils 12 | Utils 13 | v4.6.1 14 | 512 15 | 16 | 17 | 18 | true 19 | full 20 | false 21 | bin\Debug\ 22 | DEBUG;TRACE 23 | prompt 24 | 4 25 | false 26 | 27 | 28 | pdbonly 29 | true 30 | bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | false 35 | 36 | 37 | true 38 | bin\x86\Debug\ 39 | DEBUG;TRACE 40 | full 41 | x86 42 | bin\Debug\Utils.dll.CodeAnalysisLog.xml 43 | true 44 | GlobalSuppressions.cs 45 | prompt 46 | MinimumRecommendedRules.ruleset 47 | ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets 48 | true 49 | ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules 50 | true 51 | false 52 | 53 | 54 | bin\x86\Release\ 55 | TRACE 56 | true 57 | pdbonly 58 | x86 59 | bin\Release\Utils.dll.CodeAnalysisLog.xml 60 | true 61 | GlobalSuppressions.cs 62 | prompt 63 | MinimumRecommendedRules.ruleset 64 | ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets 65 | true 66 | ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules 67 | true 68 | false 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 95 | -------------------------------------------------------------------------------- /archive-release.bat: -------------------------------------------------------------------------------- 1 | set /p versionNumber= 2 | 3 | REM clean up 4 | del builds\im-only-resting-%versionNumber%.zip 5 | rd /q /s builds\im-only-resting-%versionNumber% 6 | rd /q /s builds\im-only-resting 7 | 8 | REM preparing staging dir 9 | mkdir staging 10 | copy LICENSE staging 11 | copy NOTICE staging 12 | copy Ior\bin\Release\im-only-resting.exe staging 13 | copy Ior\bin\Release\libtidy.dll staging 14 | copy Ior\bin\Release\Newtonsoft.Json.dll staging 15 | copy Ior\bin\Release\NLog.config staging 16 | copy Ior\bin\Release\NLog.dll staging 17 | copy Ior\bin\Release\PropertyGridEx.dll staging 18 | copy Ior\bin\Release\System.Net.Http.Extensions.dll staging 19 | copy Ior\bin\Release\System.Net.Http.Primitives.dll staging 20 | copy Ior\bin\Release\SciLexer.dll staging 21 | copy Ior\bin\Release\ScintillaNET.dll staging 22 | copy Ior\bin\Release\Utils.dll staging 23 | copy Ior\bin\Release\TidyManaged.dll staging 24 | 25 | 26 | REM zip staging files 27 | cd staging 28 | "..\tools\7z\7za.exe" a -tzip "..\builds\im-only-resting-%versionNumber%.zip" * 29 | cd .. 30 | 31 | REM extract build 32 | "tools\7z\7za.exe" e "builds\im-only-resting-%versionNumber%.zip" -o"builds\im-only-resting-%versionNumber%" 33 | "tools\7z\7za.exe" e "builds\im-only-resting-%versionNumber%.zip" -o"builds\im-only-resting" 34 | 35 | REM clean up 36 | rd /q /s staging 37 | 38 | pause 39 | -------------------------------------------------------------------------------- /lib/scintilla/License.txt: -------------------------------------------------------------------------------- 1 | ScintillaNET is based on the Scintilla component by Neil Hodgson. 2 | 3 | ScintillaNET is released on this same license. 4 | 5 | The ScintillaNET bindings are Copyright 2002-2006 by Garrett Serack 6 | 7 | All Rights Reserved 8 | 9 | Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. 10 | 11 | GARRETT SERACK AND ALL EMPLOYERS PAST AND PRESENT DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL GARRETT SERACK AND ALL EMPLOYERS PAST AND PRESENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 12 | 13 | The license for Scintilla is as follows: 14 | ----------------------------------------------------------------------- 15 | Copyright 1998-2006 by Neil Hodgson 16 | 17 | All Rights Reserved 18 | 19 | Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. 20 | 21 | NEIL HODGSON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NEIL HODGSON BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -------------------------------------------------------------------------------- /lib/scintilla/ReadMe.htm: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | ScintillaNET 5 | 22 | 23 | 24 |

ScintillaNET

25 |

26 | ScintillaNET is a powerful text editing control for Windows® Forms applications and a managed wrapper around the versatile Scintilla component. 27 | Created with the developer in mind, the ScintillaNET API makes it simple to add advanced text editing and syntax highlighting to your application or IDE. 28 | In addition ScintillaNET adds features not found in other Scintilla wrappers such as Visual Studio® style code snippets, integrated find and replace dialogs, true regular expression searches, multiple key-command bindings, and back/forward document navigation. 29 |

30 |

31 | The ScintillaNET project is hosted on CodePlex at the following URL: http://scintillanet.codeplex.com. 32 | The most up-to-the-minute source code, binaries, and documentation can be found at that location. 33 |

34 |

35 | We hope you enjoy using ScintillaNET as much as we enjoy developing it. 36 |

37 |

38 | Cheers,
39 | The ScintillaNET Team 40 |

41 | 42 | 43 | -------------------------------------------------------------------------------- /lib/scintilla/SciLexer.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SwensenSoftware/im-only-resting/0c3709024810d886a2f1919a692886f286e7a082/lib/scintilla/SciLexer.dll -------------------------------------------------------------------------------- /lib/scintilla/ScintillaNET.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SwensenSoftware/im-only-resting/0c3709024810d886a2f1919a692886f286e7a082/lib/scintilla/ScintillaNET.dll -------------------------------------------------------------------------------- /lib/tidy/TidyManaged.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SwensenSoftware/im-only-resting/0c3709024810d886a2f1919a692886f286e7a082/lib/tidy/TidyManaged.dll -------------------------------------------------------------------------------- /lib/tidy/libtidy.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SwensenSoftware/im-only-resting/0c3709024810d886a2f1919a692886f286e7a082/lib/tidy/libtidy.dll -------------------------------------------------------------------------------- /tools/7z/7za.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SwensenSoftware/im-only-resting/0c3709024810d886a2f1919a692886f286e7a082/tools/7z/7za.exe -------------------------------------------------------------------------------- /tools/7z/license.txt: -------------------------------------------------------------------------------- 1 | 7-Zip Command line version 2 | ~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 | License for use and distribution 4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5 | 6 | 7-Zip Copyright (C) 1999-2010 Igor Pavlov. 7 | 8 | 7za.exe is distributed under the GNU LGPL license 9 | 10 | Notes: 11 | You can use 7-Zip on any computer, including a computer in a commercial 12 | organization. You don't need to register or pay for 7-Zip. 13 | 14 | 15 | GNU LGPL information 16 | -------------------- 17 | 18 | This library is free software; you can redistribute it and/or 19 | modify it under the terms of the GNU Lesser General Public 20 | License as published by the Free Software Foundation; either 21 | version 2.1 of the License, or (at your option) any later version. 22 | 23 | This library is distributed in the hope that it will be useful, 24 | but WITHOUT ANY WARRANTY; without even the implied warranty of 25 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 26 | Lesser General Public License for more details. 27 | 28 | You can receive a copy of the GNU Lesser General Public License from 29 | http://www.gnu.org/ 30 | -------------------------------------------------------------------------------- /tools/7z/readme.txt: -------------------------------------------------------------------------------- 1 | 7-Zip Command line version 9.20 2 | ------------------------------- 3 | 4 | 7-Zip is a file archiver with high compression ratio. 5 | 7za.exe is a standalone command line version of 7-Zip. 6 | 7 | 7-Zip Copyright (C) 1999-2010 Igor Pavlov. 8 | 9 | Features of 7za.exe: 10 | - High compression ratio in new 7z format 11 | - Supported formats: 12 | - Packing / unpacking: 7z, xz, ZIP, GZIP, BZIP2 and TAR 13 | - Unpacking only: Z, lzma 14 | - Highest compression ratio for ZIP and GZIP formats. 15 | - Fast compression and decompression 16 | - Strong AES-256 encryption in 7z and ZIP formats. 17 | 18 | 7za.exe is a free software distributed under the GNU LGPL. 19 | Read license.txt for more information. 20 | 21 | Source code of 7za.exe and 7-Zip can be found at 22 | http://www.7-zip.org/ 23 | 24 | 7za.exe can work in Windows 95/98/ME/NT/2000/2003/2008/XP/Vista/7. 25 | 26 | There is also port of 7za.exe for POSIX systems like Unix (Linux, Solaris, OpenBSD, 27 | FreeBSD, Cygwin, AIX, ...), MacOS X and BeOS: 28 | 29 | http://p7zip.sourceforge.net/ 30 | 31 | 32 | This distributive packet contains the following files: 33 | 34 | 7za.exe - 7-Zip standalone command line version. 35 | readme.txt - This file. 36 | license.txt - License information. 37 | 7-zip.chm - User's Manual in HTML Help format. 38 | 39 | 40 | --- 41 | End of document 42 | --------------------------------------------------------------------------------