├── .gitignore ├── BuildProcessTemplates ├── DefaultTemplate.xaml └── UpgradeTemplate.xaml ├── Fiddler ├── FiddlerJsonViewer.csproj ├── JsonInspectorBase.cs ├── JsonRequestInspector.cs ├── JsonResponseInspector.cs └── Properties │ └── AssemblyInfo.cs ├── JsonView ├── AboutJsonViewer.cs ├── AboutJsonViewer.designer.cs ├── AboutJsonViewer.resx ├── JsonView.csproj ├── MainForm.Designer.cs ├── MainForm.cs ├── MainForm.resx ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings └── app.config ├── JsonViewer.sln ├── JsonViewer ├── GridVisualizer.Designer.cs ├── GridVisualizer.cs ├── GridVisualizer.resx ├── IJsonViewerPlugin.cs ├── InternalPlugins.cs ├── JsonFields.cs ├── JsonObject.cs ├── JsonObjectTree.cs ├── JsonObjectVisualizer.Designer.cs ├── JsonObjectVisualizer.cs ├── JsonObjectVisualizer.resx ├── JsonTreeObjectTypeDescriptor.cs ├── JsonViewer.Designer.cs ├── JsonViewer.cs ├── JsonViewer.csproj ├── JsonViewer.dll.config ├── JsonViewer.resx ├── PluginsManager.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── UnbufferedStringReader.cs ├── ViewerConfiguration.cs ├── array.bmp ├── btn.bmp ├── obj.bmp └── packages.config ├── LICENSE ├── README.md ├── Samples ├── GridSample.txt ├── Sample1.txt └── Sample2.txt └── Visualizer ├── JsonVisualizer.cs ├── JsonVisualizer.csproj ├── JsonVisualizerForm.Designer.cs ├── JsonVisualizerForm.cs ├── JsonVisualizerForm.resx └── Properties └── AssemblyInfo.cs /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Aa][Rr][Mm]/ 27 | [Aa][Rr][Mm]64/ 28 | bld/ 29 | [Bb]in/ 30 | [Oo]bj/ 31 | [Ll]og/ 32 | [Ll]ogs/ 33 | 34 | # Visual Studio 2015/2017 cache/options directory 35 | .vs/ 36 | # Uncomment if you have tasks that create the project's static files in wwwroot 37 | #wwwroot/ 38 | 39 | # Visual Studio 2017 auto generated files 40 | Generated\ Files/ 41 | 42 | # MSTest test Results 43 | [Tt]est[Rr]esult*/ 44 | [Bb]uild[Ll]og.* 45 | 46 | # NUnit 47 | *.VisualState.xml 48 | TestResult.xml 49 | nunit-*.xml 50 | 51 | # Build Results of an ATL Project 52 | [Dd]ebugPS/ 53 | [Rr]eleasePS/ 54 | dlldata.c 55 | 56 | # Benchmark Results 57 | BenchmarkDotNet.Artifacts/ 58 | 59 | # .NET Core 60 | project.lock.json 61 | project.fragment.lock.json 62 | artifacts/ 63 | 64 | # StyleCop 65 | StyleCopReport.xml 66 | 67 | # Files built by Visual Studio 68 | *_i.c 69 | *_p.c 70 | *_h.h 71 | *.ilk 72 | *.meta 73 | *.obj 74 | *.iobj 75 | *.pch 76 | *.pdb 77 | *.ipdb 78 | *.pgc 79 | *.pgd 80 | *.rsp 81 | *.sbr 82 | *.tlb 83 | *.tli 84 | *.tlh 85 | *.tmp 86 | *.tmp_proj 87 | *_wpftmp.csproj 88 | *.log 89 | *.vspscc 90 | *.vssscc 91 | .builds 92 | *.pidb 93 | *.svclog 94 | *.scc 95 | 96 | # Chutzpah Test files 97 | _Chutzpah* 98 | 99 | # Visual C++ cache files 100 | ipch/ 101 | *.aps 102 | *.ncb 103 | *.opendb 104 | *.opensdf 105 | *.sdf 106 | *.cachefile 107 | *.VC.db 108 | *.VC.VC.opendb 109 | 110 | # Visual Studio profiler 111 | *.psess 112 | *.vsp 113 | *.vspx 114 | *.sap 115 | 116 | # Visual Studio Trace Files 117 | *.e2e 118 | 119 | # TFS 2012 Local Workspace 120 | $tf/ 121 | 122 | # Guidance Automation Toolkit 123 | *.gpState 124 | 125 | # ReSharper is a .NET coding add-in 126 | _ReSharper*/ 127 | *.[Rr]e[Ss]harper 128 | *.DotSettings.user 129 | 130 | # TeamCity is a build add-in 131 | _TeamCity* 132 | 133 | # DotCover is a Code Coverage Tool 134 | *.dotCover 135 | 136 | # AxoCover is a Code Coverage Tool 137 | .axoCover/* 138 | !.axoCover/settings.json 139 | 140 | # Visual Studio code coverage results 141 | *.coverage 142 | *.coveragexml 143 | 144 | # NCrunch 145 | _NCrunch_* 146 | .*crunch*.local.xml 147 | nCrunchTemp_* 148 | 149 | # MightyMoose 150 | *.mm.* 151 | AutoTest.Net/ 152 | 153 | # Web workbench (sass) 154 | .sass-cache/ 155 | 156 | # Installshield output folder 157 | [Ee]xpress/ 158 | 159 | # DocProject is a documentation generator add-in 160 | DocProject/buildhelp/ 161 | DocProject/Help/*.HxT 162 | DocProject/Help/*.HxC 163 | DocProject/Help/*.hhc 164 | DocProject/Help/*.hhk 165 | DocProject/Help/*.hhp 166 | DocProject/Help/Html2 167 | DocProject/Help/html 168 | 169 | # Click-Once directory 170 | publish/ 171 | 172 | # Publish Web Output 173 | *.[Pp]ublish.xml 174 | *.azurePubxml 175 | # Note: Comment the next line if you want to checkin your web deploy settings, 176 | # but database connection strings (with potential passwords) will be unencrypted 177 | *.pubxml 178 | *.publishproj 179 | 180 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 181 | # checkin your Azure Web App publish settings, but sensitive information contained 182 | # in these scripts will be unencrypted 183 | PublishScripts/ 184 | 185 | # NuGet Packages 186 | *.nupkg 187 | # NuGet Symbol Packages 188 | *.snupkg 189 | # The packages folder can be ignored because of Package Restore 190 | **/[Pp]ackages/* 191 | # except build/, which is used as an MSBuild target. 192 | !**/[Pp]ackages/build/ 193 | # Uncomment if necessary however generally it will be regenerated when needed 194 | #!**/[Pp]ackages/repositories.config 195 | # NuGet v3's project.json files produces more ignorable files 196 | *.nuget.props 197 | *.nuget.targets 198 | 199 | # Microsoft Azure Build Output 200 | csx/ 201 | *.build.csdef 202 | 203 | # Microsoft Azure Emulator 204 | ecf/ 205 | rcf/ 206 | 207 | # Windows Store app package directories and files 208 | AppPackages/ 209 | BundleArtifacts/ 210 | Package.StoreAssociation.xml 211 | _pkginfo.txt 212 | *.appx 213 | *.appxbundle 214 | *.appxupload 215 | 216 | # Visual Studio cache files 217 | # files ending in .cache can be ignored 218 | *.[Cc]ache 219 | # but keep track of directories ending in .cache 220 | !?*.[Cc]ache/ 221 | 222 | # Others 223 | ClientBin/ 224 | ~$* 225 | *~ 226 | *.dbmdl 227 | *.dbproj.schemaview 228 | *.jfm 229 | *.pfx 230 | *.publishsettings 231 | orleans.codegen.cs 232 | 233 | # Including strong name files can present a security risk 234 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 235 | #*.snk 236 | 237 | # Since there are multiple workflows, uncomment next line to ignore bower_components 238 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 239 | #bower_components/ 240 | 241 | # RIA/Silverlight projects 242 | Generated_Code/ 243 | 244 | # Backup & report files from converting an old project file 245 | # to a newer Visual Studio version. Backup files are not needed, 246 | # because we have git ;-) 247 | _UpgradeReport_Files/ 248 | Backup*/ 249 | UpgradeLog*.XML 250 | UpgradeLog*.htm 251 | ServiceFabricBackup/ 252 | *.rptproj.bak 253 | 254 | # SQL Server files 255 | *.mdf 256 | *.ldf 257 | *.ndf 258 | 259 | # Business Intelligence projects 260 | *.rdl.data 261 | *.bim.layout 262 | *.bim_*.settings 263 | *.rptproj.rsuser 264 | *- [Bb]ackup.rdl 265 | *- [Bb]ackup ([0-9]).rdl 266 | *- [Bb]ackup ([0-9][0-9]).rdl 267 | 268 | # Microsoft Fakes 269 | FakesAssemblies/ 270 | 271 | # GhostDoc plugin setting file 272 | *.GhostDoc.xml 273 | 274 | # Node.js Tools for Visual Studio 275 | .ntvs_analysis.dat 276 | node_modules/ 277 | 278 | # Visual Studio 6 build log 279 | *.plg 280 | 281 | # Visual Studio 6 workspace options file 282 | *.opt 283 | 284 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 285 | *.vbw 286 | 287 | # Visual Studio LightSwitch build output 288 | **/*.HTMLClient/GeneratedArtifacts 289 | **/*.DesktopClient/GeneratedArtifacts 290 | **/*.DesktopClient/ModelManifest.xml 291 | **/*.Server/GeneratedArtifacts 292 | **/*.Server/ModelManifest.xml 293 | _Pvt_Extensions 294 | 295 | # Paket dependency manager 296 | .paket/paket.exe 297 | paket-files/ 298 | 299 | # FAKE - F# Make 300 | .fake/ 301 | 302 | # CodeRush personal settings 303 | .cr/personal 304 | 305 | # Python Tools for Visual Studio (PTVS) 306 | __pycache__/ 307 | *.pyc 308 | 309 | # Cake - Uncomment if you are using it 310 | # tools/** 311 | # !tools/packages.config 312 | 313 | # Tabs Studio 314 | *.tss 315 | 316 | # Telerik's JustMock configuration file 317 | *.jmconfig 318 | 319 | # BizTalk build output 320 | *.btp.cs 321 | *.btm.cs 322 | *.odx.cs 323 | *.xsd.cs 324 | 325 | # OpenCover UI analysis results 326 | OpenCover/ 327 | 328 | # Azure Stream Analytics local run output 329 | ASALocalRun/ 330 | 331 | # MSBuild Binary and Structured Log 332 | *.binlog 333 | 334 | # NVidia Nsight GPU debugger configuration file 335 | *.nvuser 336 | 337 | # MFractors (Xamarin productivity tool) working folder 338 | .mfractor/ 339 | 340 | # Local History for Visual Studio 341 | .localhistory/ 342 | 343 | # BeatPulse healthcheck temp database 344 | healthchecksdb 345 | 346 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 347 | MigrationBackup/ 348 | 349 | # Ionide (cross platform F# VS Code tools) working folder 350 | .ionide/ 351 | -------------------------------------------------------------------------------- /BuildProcessTemplates/UpgradeTemplate.xaml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | [New Microsoft.TeamFoundation.Build.Workflow.Activities.AgentSettings() With {.MaxWaitTime = New System.TimeSpan(4, 0, 0), .MaxExecutionTime = New System.TimeSpan(0, 0, 0), .TagComparison = Microsoft.TeamFoundation.Build.Workflow.Activities.TagComparison.MatchExactly }] 21 | 22 | 23 | 24 | [Microsoft.TeamFoundation.Build.Workflow.Activities.ToolPlatform.Auto] 25 | [False] 26 | [False] 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | [Microsoft.TeamFoundation.VersionControl.Client.RecursionType.OneLevel] 37 | [Microsoft.TeamFoundation.Build.Workflow.BuildVerbosity.Normal] 38 | 39 | 40 | 41 | All 42 | Assembly references and imported namespaces serialized as XML namespaces 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /Fiddler/FiddlerJsonViewer.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 9.0.30729 7 | 2.0 8 | {4B6A26FA-0D44-4354-92E7-54FC5A75469B} 9 | Library 10 | Properties 11 | EPocalipse.Json.Fiddler 12 | FiddlerJsonViewer 13 | SAK 14 | SAK 15 | SAK 16 | SAK 17 | v4.5 18 | 19 | 20 | 21 | 22 | 3.5 23 | 24 | publish\ 25 | true 26 | Disk 27 | false 28 | Foreground 29 | 7 30 | Days 31 | false 32 | false 33 | true 34 | 0 35 | 1.0.0.%2a 36 | false 37 | false 38 | true 39 | 40 | 41 | true 42 | full 43 | false 44 | bin\debug\ 45 | DEBUG;TRACE 46 | prompt 47 | 4 48 | false 49 | 50 | 51 | pdbonly 52 | true 53 | ..\Bin\Fiddler\ 54 | TRACE 55 | prompt 56 | 4 57 | false 58 | 59 | 60 | 61 | False 62 | $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fiddler2@InstallPath)\Fiddler.exe 63 | False 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | {3AE264FB-52DC-4295-A37F-CE63CAF54930} 80 | JsonViewer 81 | 82 | 83 | 84 | 85 | False 86 | .NET Framework 3.5 SP1 87 | true 88 | 89 | 90 | 91 | 98 | -------------------------------------------------------------------------------- /Fiddler/JsonInspectorBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.Windows.Forms; 5 | using System.IO; 6 | using EPocalipse.Json.Viewer; 7 | using Fiddler; 8 | using System.Drawing; 9 | 10 | namespace EPocalipse.Json.Fiddler 11 | { 12 | 13 | 14 | 15 | 16 | public abstract class JsonInspectorBase : Inspector2 17 | { 18 | protected HTTPHeaders _headers; 19 | private byte[] _body; 20 | private JsonViewer viewer; 21 | 22 | public override void AddToTab(TabPage tabPage) 23 | { 24 | viewer = new JsonViewer(); 25 | tabPage.Text = "JSON"; 26 | tabPage.Controls.Add(viewer); 27 | viewer.Dock = DockStyle.Fill; 28 | } 29 | 30 | public override void ShowAboutBox() 31 | { 32 | MessageBox.Show("Json Inspector 1.1\nCopyright (c) 2007 Eyal Post\nhttp://www.epocalipse.com/blog", "Json Viewer", MessageBoxButtons.OK, MessageBoxIcon.Information); 33 | } 34 | 35 | public override int ScoreForContentType(string sMIMEType) 36 | { 37 | if (string.Compare(sMIMEType, "text/json", true) == 0) 38 | { 39 | return 50; 40 | } 41 | return 0; 42 | } 43 | 44 | public override int GetOrder() 45 | { 46 | return 0; 47 | } 48 | 49 | public void Clear() 50 | { 51 | _body = null; 52 | viewer.Clear(); 53 | } 54 | 55 | public bool bDirty 56 | { 57 | get 58 | { 59 | return false; 60 | } 61 | } 62 | 63 | public bool bReadOnly 64 | { 65 | get 66 | { 67 | return false; 68 | } 69 | set 70 | { 71 | //_readOnly = value; 72 | } 73 | } 74 | 75 | public byte[] body 76 | { 77 | get 78 | { 79 | return _body; 80 | } 81 | set 82 | { 83 | _body = value; 84 | string json=Encoding.UTF8.GetString(_body); 85 | bool encoded = _headers.Exists("Transfer-Encoding") || _headers.Exists("Content-Encoding"); 86 | if (_headers.ExistsAndEquals("Transfer-Encoding", "chunked")) 87 | { 88 | //response in chuncked but still may contain the entire json string. Try to fix it. 89 | json = json.Trim(); 90 | int startPos = json.IndexOf('\n'); 91 | int endPos = json.LastIndexOf('\r'); 92 | if (startPos >= 0 && endPos >= 0 && startPos != endPos) 93 | { 94 | json = json.Substring(startPos, endPos - startPos + 1); 95 | json = json.Trim(); 96 | } 97 | } 98 | viewer.ShowTab(Tabs.Viewer); 99 | viewer.Json = json; 100 | if (viewer.HasErrors && encoded) 101 | { 102 | viewer.ShowInfo("Error parsing JSON. Try using the Transformer to remove the encoding from this response"); 103 | } 104 | } 105 | } 106 | 107 | public override void SetFontSize(float flSizeInPoints) 108 | { 109 | viewer.Font = new Font(viewer.Font.FontFamily, flSizeInPoints, FontStyle.Regular, GraphicsUnit.Point); 110 | } 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /Fiddler/JsonRequestInspector.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.Windows.Forms; 5 | using System.IO; 6 | using EPocalipse.Json.Viewer; 7 | using Fiddler; 8 | using System.Drawing; 9 | 10 | namespace EPocalipse.Json.Fiddler 11 | { 12 | public sealed class JsonRequestInspector: JsonInspectorBase, IRequestInspector2 13 | { 14 | public HTTPRequestHeaders headers 15 | { 16 | get 17 | { 18 | return null; 19 | } 20 | set 21 | { 22 | _headers = value; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Fiddler/JsonResponseInspector.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.Windows.Forms; 5 | using System.IO; 6 | using EPocalipse.Json.Viewer; 7 | using Fiddler; 8 | using System.Drawing; 9 | 10 | namespace EPocalipse.Json.Fiddler 11 | { 12 | public sealed class JsonResponseInspector: JsonInspectorBase, IResponseInspector2 13 | { 14 | public HTTPResponseHeaders headers 15 | { 16 | get 17 | { 18 | return null; 19 | } 20 | set 21 | { 22 | _headers = value; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Fiddler/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | using Fiddler; 5 | 6 | // General Information about an assembly is controlled through the following 7 | // set of attributes. Change these attribute values to modify the information 8 | // associated with an assembly. 9 | [assembly: AssemblyTitle("JsonViewer")] 10 | [assembly: AssemblyDescription("")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany("Clarizen")] 13 | [assembly: AssemblyProduct("JsonViewer")] 14 | [assembly: AssemblyCopyright("Copyright © Clarizen 2007")] 15 | [assembly: AssemblyTrademark("")] 16 | [assembly: AssemblyCulture("")] 17 | 18 | // Setting ComVisible to false makes the types in this assembly not visible 19 | // to COM components. If you need to access a type in this assembly from 20 | // COM, set the ComVisible attribute to true on that type. 21 | [assembly: ComVisible(false)] 22 | 23 | // The following GUID is for the ID of the typelib if this project is exposed to COM 24 | [assembly: Guid("356e16cc-67ca-4802-aa4c-abd97d623a72")] 25 | 26 | // Version information for an assembly consists of the following four values: 27 | // 28 | // Major Version 29 | // Minor Version 30 | // Build Number 31 | // Revision 32 | // 33 | // You can specify all the values or you can default the Revision and Build Numbers 34 | // by using the '*' as shown below: 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | [assembly: RequiredVersion("2.1.0.0")] -------------------------------------------------------------------------------- /JsonView/AboutJsonViewer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Drawing; 5 | using System.Windows.Forms; 6 | using System.Reflection; 7 | 8 | namespace EPocalipse.Json.JsonView 9 | { 10 | partial class AboutJsonViewer : Form 11 | { 12 | public AboutJsonViewer() 13 | { 14 | InitializeComponent(); 15 | 16 | // Initialize the AboutBox to display the product information from the assembly information. 17 | // Change assembly information settings for your application through either: 18 | // - Project->Properties->Application->Assembly Information 19 | // - AssemblyInfo.cs 20 | this.Text = String.Format("About {0}", AssemblyTitle); 21 | this.labelProductName.Text = AssemblyProduct; 22 | this.labelVersion.Text = String.Format("Version {0}", AssemblyVersion); 23 | this.labelCopyright.Text = AssemblyCopyright; 24 | this.labelCompanyName.Text = AssemblyCompany; 25 | this.textBoxDescription.Text = AssemblyDescription; 26 | } 27 | 28 | #region Assembly Attribute Accessors 29 | 30 | public string AssemblyTitle 31 | { 32 | get 33 | { 34 | // Get all Title attributes on this assembly 35 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false); 36 | // If there is at least one Title attribute 37 | if (attributes.Length > 0) 38 | { 39 | // Select the first one 40 | AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0]; 41 | // If it is not an empty string, return it 42 | if (titleAttribute.Title != "") 43 | return titleAttribute.Title; 44 | } 45 | // If there was no Title attribute, or if the Title attribute was the empty string, return the .exe name 46 | return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase); 47 | } 48 | } 49 | 50 | public string AssemblyVersion 51 | { 52 | get 53 | { 54 | return Assembly.GetExecutingAssembly().GetName().Version.ToString(); 55 | } 56 | } 57 | 58 | public string AssemblyDescription 59 | { 60 | get 61 | { 62 | // Get all Description attributes on this assembly 63 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false); 64 | // If there aren't any Description attributes, return an empty string 65 | if (attributes.Length == 0) 66 | return ""; 67 | // If there is a Description attribute, return its value 68 | return ((AssemblyDescriptionAttribute)attributes[0]).Description; 69 | } 70 | } 71 | 72 | public string AssemblyProduct 73 | { 74 | get 75 | { 76 | // Get all Product attributes on this assembly 77 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false); 78 | // If there aren't any Product attributes, return an empty string 79 | if (attributes.Length == 0) 80 | return ""; 81 | // If there is a Product attribute, return its value 82 | return ((AssemblyProductAttribute)attributes[0]).Product; 83 | } 84 | } 85 | 86 | public string AssemblyCopyright 87 | { 88 | get 89 | { 90 | // Get all Copyright attributes on this assembly 91 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false); 92 | // If there aren't any Copyright attributes, return an empty string 93 | if (attributes.Length == 0) 94 | return ""; 95 | // If there is a Copyright attribute, return its value 96 | return ((AssemblyCopyrightAttribute)attributes[0]).Copyright; 97 | } 98 | } 99 | 100 | public string AssemblyCompany 101 | { 102 | get 103 | { 104 | // Get all Company attributes on this assembly 105 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false); 106 | // If there aren't any Company attributes, return an empty string 107 | if (attributes.Length == 0) 108 | return ""; 109 | // If there is a Company attribute, return its value 110 | return ((AssemblyCompanyAttribute)attributes[0]).Company; 111 | } 112 | } 113 | #endregion 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /JsonView/AboutJsonViewer.designer.cs: -------------------------------------------------------------------------------- 1 | namespace EPocalipse.Json.JsonView 2 | { 3 | partial class AboutJsonViewer 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | protected override void Dispose(bool disposing) 14 | { 15 | if (disposing && (components != null)) 16 | { 17 | components.Dispose(); 18 | } 19 | base.Dispose(disposing); 20 | } 21 | 22 | #region Windows Form Designer generated code 23 | 24 | /// 25 | /// Required method for Designer support - do not modify 26 | /// the contents of this method with the code editor. 27 | /// 28 | private void InitializeComponent() 29 | { 30 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AboutJsonViewer)); 31 | this.tableLayoutPanel = new System.Windows.Forms.TableLayoutPanel(); 32 | this.logoPictureBox = new System.Windows.Forms.PictureBox(); 33 | this.labelProductName = new System.Windows.Forms.Label(); 34 | this.labelVersion = new System.Windows.Forms.Label(); 35 | this.labelCopyright = new System.Windows.Forms.Label(); 36 | this.labelCompanyName = new System.Windows.Forms.Label(); 37 | this.textBoxDescription = new System.Windows.Forms.TextBox(); 38 | this.okButton = new System.Windows.Forms.Button(); 39 | this.tableLayoutPanel.SuspendLayout(); 40 | ((System.ComponentModel.ISupportInitialize)(this.logoPictureBox)).BeginInit(); 41 | this.SuspendLayout(); 42 | // 43 | // tableLayoutPanel 44 | // 45 | this.tableLayoutPanel.ColumnCount = 2; 46 | this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33F)); 47 | this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 67F)); 48 | this.tableLayoutPanel.Controls.Add(this.logoPictureBox, 0, 0); 49 | this.tableLayoutPanel.Controls.Add(this.labelProductName, 1, 0); 50 | this.tableLayoutPanel.Controls.Add(this.labelVersion, 1, 1); 51 | this.tableLayoutPanel.Controls.Add(this.labelCopyright, 1, 2); 52 | this.tableLayoutPanel.Controls.Add(this.labelCompanyName, 1, 3); 53 | this.tableLayoutPanel.Controls.Add(this.textBoxDescription, 1, 4); 54 | this.tableLayoutPanel.Controls.Add(this.okButton, 1, 5); 55 | this.tableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill; 56 | this.tableLayoutPanel.Location = new System.Drawing.Point(9, 9); 57 | this.tableLayoutPanel.Name = "tableLayoutPanel"; 58 | this.tableLayoutPanel.RowCount = 6; 59 | this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); 60 | this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); 61 | this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); 62 | this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); 63 | this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); 64 | this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); 65 | this.tableLayoutPanel.Size = new System.Drawing.Size(417, 265); 66 | this.tableLayoutPanel.TabIndex = 0; 67 | // 68 | // logoPictureBox 69 | // 70 | this.logoPictureBox.Dock = System.Windows.Forms.DockStyle.Fill; 71 | this.logoPictureBox.Image = ((System.Drawing.Image)(resources.GetObject("logoPictureBox.Image"))); 72 | this.logoPictureBox.Location = new System.Drawing.Point(3, 3); 73 | this.logoPictureBox.Name = "logoPictureBox"; 74 | this.tableLayoutPanel.SetRowSpan(this.logoPictureBox, 6); 75 | this.logoPictureBox.Size = new System.Drawing.Size(131, 259); 76 | this.logoPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; 77 | this.logoPictureBox.TabIndex = 12; 78 | this.logoPictureBox.TabStop = false; 79 | // 80 | // labelProductName 81 | // 82 | this.labelProductName.Dock = System.Windows.Forms.DockStyle.Fill; 83 | this.labelProductName.Location = new System.Drawing.Point(143, 0); 84 | this.labelProductName.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0); 85 | this.labelProductName.MaximumSize = new System.Drawing.Size(0, 17); 86 | this.labelProductName.Name = "labelProductName"; 87 | this.labelProductName.Size = new System.Drawing.Size(271, 17); 88 | this.labelProductName.TabIndex = 19; 89 | this.labelProductName.Text = "Product Name"; 90 | this.labelProductName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; 91 | // 92 | // labelVersion 93 | // 94 | this.labelVersion.Dock = System.Windows.Forms.DockStyle.Fill; 95 | this.labelVersion.Location = new System.Drawing.Point(143, 26); 96 | this.labelVersion.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0); 97 | this.labelVersion.MaximumSize = new System.Drawing.Size(0, 17); 98 | this.labelVersion.Name = "labelVersion"; 99 | this.labelVersion.Size = new System.Drawing.Size(271, 17); 100 | this.labelVersion.TabIndex = 0; 101 | this.labelVersion.Text = "Version"; 102 | this.labelVersion.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; 103 | // 104 | // labelCopyright 105 | // 106 | this.labelCopyright.Dock = System.Windows.Forms.DockStyle.Fill; 107 | this.labelCopyright.Location = new System.Drawing.Point(143, 52); 108 | this.labelCopyright.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0); 109 | this.labelCopyright.MaximumSize = new System.Drawing.Size(0, 17); 110 | this.labelCopyright.Name = "labelCopyright"; 111 | this.labelCopyright.Size = new System.Drawing.Size(271, 17); 112 | this.labelCopyright.TabIndex = 21; 113 | this.labelCopyright.Text = "Copyright"; 114 | this.labelCopyright.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; 115 | // 116 | // labelCompanyName 117 | // 118 | this.labelCompanyName.Dock = System.Windows.Forms.DockStyle.Fill; 119 | this.labelCompanyName.Location = new System.Drawing.Point(143, 78); 120 | this.labelCompanyName.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0); 121 | this.labelCompanyName.MaximumSize = new System.Drawing.Size(0, 17); 122 | this.labelCompanyName.Name = "labelCompanyName"; 123 | this.labelCompanyName.Size = new System.Drawing.Size(271, 17); 124 | this.labelCompanyName.TabIndex = 22; 125 | this.labelCompanyName.Text = "Company Name"; 126 | this.labelCompanyName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; 127 | // 128 | // textBoxDescription 129 | // 130 | this.textBoxDescription.Dock = System.Windows.Forms.DockStyle.Fill; 131 | this.textBoxDescription.Location = new System.Drawing.Point(143, 107); 132 | this.textBoxDescription.Margin = new System.Windows.Forms.Padding(6, 3, 3, 3); 133 | this.textBoxDescription.Multiline = true; 134 | this.textBoxDescription.Name = "textBoxDescription"; 135 | this.textBoxDescription.ReadOnly = true; 136 | this.textBoxDescription.ScrollBars = System.Windows.Forms.ScrollBars.Both; 137 | this.textBoxDescription.Size = new System.Drawing.Size(271, 126); 138 | this.textBoxDescription.TabIndex = 23; 139 | this.textBoxDescription.TabStop = false; 140 | this.textBoxDescription.Text = "Description"; 141 | // 142 | // okButton 143 | // 144 | this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 145 | this.okButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; 146 | this.okButton.Location = new System.Drawing.Point(339, 239); 147 | this.okButton.Name = "okButton"; 148 | this.okButton.Size = new System.Drawing.Size(75, 23); 149 | this.okButton.TabIndex = 24; 150 | this.okButton.Text = "&OK"; 151 | // 152 | // AboutJsonViewer 153 | // 154 | this.AcceptButton = this.okButton; 155 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 156 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 157 | this.ClientSize = new System.Drawing.Size(435, 283); 158 | this.Controls.Add(this.tableLayoutPanel); 159 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; 160 | this.MaximizeBox = false; 161 | this.MinimizeBox = false; 162 | this.Name = "AboutJsonViewer"; 163 | this.Padding = new System.Windows.Forms.Padding(9); 164 | this.ShowIcon = false; 165 | this.ShowInTaskbar = false; 166 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 167 | this.Text = "AboutJsonViewer"; 168 | this.tableLayoutPanel.ResumeLayout(false); 169 | this.tableLayoutPanel.PerformLayout(); 170 | ((System.ComponentModel.ISupportInitialize)(this.logoPictureBox)).EndInit(); 171 | this.ResumeLayout(false); 172 | 173 | } 174 | 175 | #endregion 176 | 177 | private System.Windows.Forms.TableLayoutPanel tableLayoutPanel; 178 | private System.Windows.Forms.PictureBox logoPictureBox; 179 | private System.Windows.Forms.Label labelProductName; 180 | private System.Windows.Forms.Label labelVersion; 181 | private System.Windows.Forms.Label labelCopyright; 182 | private System.Windows.Forms.Label labelCompanyName; 183 | private System.Windows.Forms.TextBox textBoxDescription; 184 | private System.Windows.Forms.Button okButton; 185 | } 186 | } 187 | -------------------------------------------------------------------------------- /JsonView/JsonView.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.50727 7 | 2.0 8 | {83D82889-66FA-41AC-932F-9AF3AE8EAA9C} 9 | WinExe 10 | Properties 11 | EPocalipse.Json.JsonView 12 | JsonView 13 | SAK 14 | SAK 15 | SAK 16 | SAK 17 | 18 | 19 | 3.5 20 | 21 | 22 | v4.5 23 | 24 | publish\ 25 | true 26 | Disk 27 | false 28 | Foreground 29 | 7 30 | Days 31 | false 32 | false 33 | true 34 | 0 35 | 1.0.0.%2a 36 | false 37 | false 38 | true 39 | 40 | 41 | true 42 | full 43 | false 44 | bin\debug\ 45 | DEBUG;TRACE 46 | prompt 47 | 4 48 | false 49 | 50 | 51 | pdbonly 52 | true 53 | ..\Bin\JsonView\ 54 | TRACE 55 | prompt 56 | 4 57 | false 58 | false 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | Form 71 | 72 | 73 | AboutJsonViewer.cs 74 | 75 | 76 | Form 77 | 78 | 79 | MainForm.cs 80 | 81 | 82 | 83 | 84 | AboutJsonViewer.cs 85 | Designer 86 | 87 | 88 | Designer 89 | MainForm.cs 90 | 91 | 92 | ResXFileCodeGenerator 93 | Resources.Designer.cs 94 | Designer 95 | 96 | 97 | True 98 | Resources.resx 99 | True 100 | 101 | 102 | 103 | SettingsSingleFileGenerator 104 | Settings.Designer.cs 105 | 106 | 107 | True 108 | Settings.settings 109 | True 110 | 111 | 112 | 113 | 114 | {3AE264FB-52DC-4295-A37F-CE63CAF54930} 115 | JsonViewer 116 | 117 | 118 | 119 | 120 | False 121 | .NET Framework 3.5 SP1 122 | true 123 | 124 | 125 | 126 | 133 | -------------------------------------------------------------------------------- /JsonView/MainForm.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace EPocalipse.Json.JsonView 2 | { 3 | partial class MainForm 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); 32 | this.menuStrip1 = new System.Windows.Forms.MenuStrip(); 33 | this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 34 | this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 35 | this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); 36 | this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 37 | this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 38 | this.undoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 39 | this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); 40 | this.cutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 41 | this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 42 | this.pasteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 43 | this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 44 | this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); 45 | this.selectAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 46 | this.viewerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 47 | this.findToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 48 | this.expandAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 49 | this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); 50 | this.copyToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); 51 | this.copyValueToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 52 | this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 53 | this.aboutJSONViewerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 54 | this.JsonViewer = new EPocalipse.Json.Viewer.JsonViewer(); 55 | this.menuStrip1.SuspendLayout(); 56 | this.SuspendLayout(); 57 | // 58 | // menuStrip1 59 | // 60 | this.menuStrip1.ImageScalingSize = new System.Drawing.Size(28, 28); 61 | this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 62 | this.fileToolStripMenuItem, 63 | this.editToolStripMenuItem, 64 | this.viewerToolStripMenuItem, 65 | this.helpToolStripMenuItem}); 66 | this.menuStrip1.Location = new System.Drawing.Point(0, 0); 67 | this.menuStrip1.Name = "menuStrip1"; 68 | this.menuStrip1.Padding = new System.Windows.Forms.Padding(11, 3, 0, 3); 69 | this.menuStrip1.Size = new System.Drawing.Size(1527, 27); 70 | this.menuStrip1.TabIndex = 1; 71 | this.menuStrip1.Text = "menuStrip1"; 72 | // 73 | // fileToolStripMenuItem 74 | // 75 | this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { 76 | this.openToolStripMenuItem, 77 | this.toolStripSeparator1, 78 | this.exitToolStripMenuItem}); 79 | this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; 80 | this.fileToolStripMenuItem.Size = new System.Drawing.Size(39, 21); 81 | this.fileToolStripMenuItem.Text = "File"; 82 | // 83 | // openToolStripMenuItem 84 | // 85 | this.openToolStripMenuItem.BackColor = System.Drawing.Color.Transparent; 86 | this.openToolStripMenuItem.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; 87 | this.openToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("openToolStripMenuItem.Image"))); 88 | this.openToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Fuchsia; 89 | this.openToolStripMenuItem.Name = "openToolStripMenuItem"; 90 | this.openToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O))); 91 | this.openToolStripMenuItem.Size = new System.Drawing.Size(155, 22); 92 | this.openToolStripMenuItem.Text = "Open"; 93 | this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click); 94 | // 95 | // toolStripSeparator1 96 | // 97 | this.toolStripSeparator1.Name = "toolStripSeparator1"; 98 | this.toolStripSeparator1.Size = new System.Drawing.Size(152, 6); 99 | // 100 | // exitToolStripMenuItem 101 | // 102 | this.exitToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("exitToolStripMenuItem.Image"))); 103 | this.exitToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Fuchsia; 104 | this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; 105 | this.exitToolStripMenuItem.Size = new System.Drawing.Size(155, 22); 106 | this.exitToolStripMenuItem.Text = "Exit"; 107 | this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click); 108 | // 109 | // editToolStripMenuItem 110 | // 111 | this.editToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { 112 | this.undoToolStripMenuItem, 113 | this.toolStripSeparator2, 114 | this.cutToolStripMenuItem, 115 | this.copyToolStripMenuItem, 116 | this.pasteToolStripMenuItem, 117 | this.deleteToolStripMenuItem, 118 | this.toolStripSeparator3, 119 | this.selectAllToolStripMenuItem}); 120 | this.editToolStripMenuItem.Name = "editToolStripMenuItem"; 121 | this.editToolStripMenuItem.Size = new System.Drawing.Size(42, 21); 122 | this.editToolStripMenuItem.Text = "Edit"; 123 | // 124 | // undoToolStripMenuItem 125 | // 126 | this.undoToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("undoToolStripMenuItem.Image"))); 127 | this.undoToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Fuchsia; 128 | this.undoToolStripMenuItem.Name = "undoToolStripMenuItem"; 129 | this.undoToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Z))); 130 | this.undoToolStripMenuItem.Size = new System.Drawing.Size(173, 22); 131 | this.undoToolStripMenuItem.Text = "Undo"; 132 | this.undoToolStripMenuItem.Click += new System.EventHandler(this.undoToolStripMenuItem_Click); 133 | // 134 | // toolStripSeparator2 135 | // 136 | this.toolStripSeparator2.Name = "toolStripSeparator2"; 137 | this.toolStripSeparator2.Size = new System.Drawing.Size(170, 6); 138 | // 139 | // cutToolStripMenuItem 140 | // 141 | this.cutToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("cutToolStripMenuItem.Image"))); 142 | this.cutToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Fuchsia; 143 | this.cutToolStripMenuItem.Name = "cutToolStripMenuItem"; 144 | this.cutToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.X))); 145 | this.cutToolStripMenuItem.Size = new System.Drawing.Size(173, 22); 146 | this.cutToolStripMenuItem.Text = "Cut"; 147 | this.cutToolStripMenuItem.Click += new System.EventHandler(this.cutToolStripMenuItem_Click); 148 | // 149 | // copyToolStripMenuItem 150 | // 151 | this.copyToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("copyToolStripMenuItem.Image"))); 152 | this.copyToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Fuchsia; 153 | this.copyToolStripMenuItem.Name = "copyToolStripMenuItem"; 154 | this.copyToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C))); 155 | this.copyToolStripMenuItem.Size = new System.Drawing.Size(173, 22); 156 | this.copyToolStripMenuItem.Text = "Copy"; 157 | this.copyToolStripMenuItem.Click += new System.EventHandler(this.copyToolStripMenuItem_Click); 158 | // 159 | // pasteToolStripMenuItem 160 | // 161 | this.pasteToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("pasteToolStripMenuItem.Image"))); 162 | this.pasteToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Fuchsia; 163 | this.pasteToolStripMenuItem.Name = "pasteToolStripMenuItem"; 164 | this.pasteToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V))); 165 | this.pasteToolStripMenuItem.Size = new System.Drawing.Size(173, 22); 166 | this.pasteToolStripMenuItem.Text = "Paste"; 167 | this.pasteToolStripMenuItem.Click += new System.EventHandler(this.pasteToolStripMenuItem_Click); 168 | // 169 | // deleteToolStripMenuItem 170 | // 171 | this.deleteToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("deleteToolStripMenuItem.Image"))); 172 | this.deleteToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Fuchsia; 173 | this.deleteToolStripMenuItem.Name = "deleteToolStripMenuItem"; 174 | this.deleteToolStripMenuItem.Size = new System.Drawing.Size(173, 22); 175 | this.deleteToolStripMenuItem.Text = "Delete"; 176 | this.deleteToolStripMenuItem.Click += new System.EventHandler(this.deleteToolStripMenuItem_Click); 177 | // 178 | // toolStripSeparator3 179 | // 180 | this.toolStripSeparator3.Name = "toolStripSeparator3"; 181 | this.toolStripSeparator3.Size = new System.Drawing.Size(170, 6); 182 | // 183 | // selectAllToolStripMenuItem 184 | // 185 | this.selectAllToolStripMenuItem.Name = "selectAllToolStripMenuItem"; 186 | this.selectAllToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A))); 187 | this.selectAllToolStripMenuItem.Size = new System.Drawing.Size(173, 22); 188 | this.selectAllToolStripMenuItem.Text = "Select All"; 189 | this.selectAllToolStripMenuItem.Click += new System.EventHandler(this.selectAllToolStripMenuItem_Click); 190 | // 191 | // viewerToolStripMenuItem 192 | // 193 | this.viewerToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { 194 | this.findToolStripMenuItem, 195 | this.expandAllToolStripMenuItem, 196 | this.toolStripSeparator4, 197 | this.copyToolStripMenuItem1, 198 | this.copyValueToolStripMenuItem}); 199 | this.viewerToolStripMenuItem.Name = "viewerToolStripMenuItem"; 200 | this.viewerToolStripMenuItem.Size = new System.Drawing.Size(59, 21); 201 | this.viewerToolStripMenuItem.Text = "Viewer"; 202 | // 203 | // findToolStripMenuItem 204 | // 205 | this.findToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("findToolStripMenuItem.Image"))); 206 | this.findToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Fuchsia; 207 | this.findToolStripMenuItem.Name = "findToolStripMenuItem"; 208 | this.findToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F))); 209 | this.findToolStripMenuItem.Size = new System.Drawing.Size(143, 22); 210 | this.findToolStripMenuItem.Text = "Find"; 211 | this.findToolStripMenuItem.Click += new System.EventHandler(this.findToolStripMenuItem_Click); 212 | // 213 | // expandAllToolStripMenuItem 214 | // 215 | this.expandAllToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("expandAllToolStripMenuItem.Image"))); 216 | this.expandAllToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Fuchsia; 217 | this.expandAllToolStripMenuItem.Name = "expandAllToolStripMenuItem"; 218 | this.expandAllToolStripMenuItem.Size = new System.Drawing.Size(143, 22); 219 | this.expandAllToolStripMenuItem.Text = "Expand All"; 220 | this.expandAllToolStripMenuItem.Click += new System.EventHandler(this.expandAllToolStripMenuItem_Click); 221 | // 222 | // toolStripSeparator4 223 | // 224 | this.toolStripSeparator4.Name = "toolStripSeparator4"; 225 | this.toolStripSeparator4.Size = new System.Drawing.Size(140, 6); 226 | // 227 | // copyToolStripMenuItem1 228 | // 229 | this.copyToolStripMenuItem1.Image = ((System.Drawing.Image)(resources.GetObject("copyToolStripMenuItem1.Image"))); 230 | this.copyToolStripMenuItem1.ImageTransparentColor = System.Drawing.Color.Fuchsia; 231 | this.copyToolStripMenuItem1.Name = "copyToolStripMenuItem1"; 232 | this.copyToolStripMenuItem1.Size = new System.Drawing.Size(143, 22); 233 | this.copyToolStripMenuItem1.Text = "Copy"; 234 | this.copyToolStripMenuItem1.Click += new System.EventHandler(this.copyToolStripMenuItem1_Click); 235 | // 236 | // copyValueToolStripMenuItem 237 | // 238 | this.copyValueToolStripMenuItem.Name = "copyValueToolStripMenuItem"; 239 | this.copyValueToolStripMenuItem.Size = new System.Drawing.Size(143, 22); 240 | this.copyValueToolStripMenuItem.Text = "Copy Value"; 241 | this.copyValueToolStripMenuItem.Click += new System.EventHandler(this.copyValueToolStripMenuItem_Click); 242 | // 243 | // helpToolStripMenuItem 244 | // 245 | this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { 246 | this.aboutJSONViewerToolStripMenuItem}); 247 | this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; 248 | this.helpToolStripMenuItem.Size = new System.Drawing.Size(47, 21); 249 | this.helpToolStripMenuItem.Text = "Help"; 250 | // 251 | // aboutJSONViewerToolStripMenuItem 252 | // 253 | this.aboutJSONViewerToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("aboutJSONViewerToolStripMenuItem.Image"))); 254 | this.aboutJSONViewerToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Fuchsia; 255 | this.aboutJSONViewerToolStripMenuItem.Name = "aboutJSONViewerToolStripMenuItem"; 256 | this.aboutJSONViewerToolStripMenuItem.Size = new System.Drawing.Size(190, 22); 257 | this.aboutJSONViewerToolStripMenuItem.Text = "About JSON Viewer"; 258 | this.aboutJSONViewerToolStripMenuItem.Click += new System.EventHandler(this.aboutJSONViewerToolStripMenuItem_Click); 259 | // 260 | // JsonViewer 261 | // 262 | this.JsonViewer.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 263 | | System.Windows.Forms.AnchorStyles.Left) 264 | | System.Windows.Forms.AnchorStyles.Right))); 265 | this.JsonViewer.Json = ""; 266 | this.JsonViewer.Location = new System.Drawing.Point(0, 44); 267 | this.JsonViewer.Margin = new System.Windows.Forms.Padding(11, 8, 11, 8); 268 | this.JsonViewer.Name = "JsonViewer"; 269 | this.JsonViewer.Size = new System.Drawing.Size(1527, 869); 270 | this.JsonViewer.TabIndex = 0; 271 | // 272 | // MainForm 273 | // 274 | this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 21F); 275 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 276 | this.ClientSize = new System.Drawing.Size(1527, 914); 277 | this.Controls.Add(this.JsonViewer); 278 | this.Controls.Add(this.menuStrip1); 279 | this.MainMenuStrip = this.menuStrip1; 280 | this.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5); 281 | this.Name = "MainForm"; 282 | this.Text = "JSON Viewer"; 283 | this.Load += new System.EventHandler(this.MainForm_Load); 284 | this.Shown += new System.EventHandler(this.MainForm_Shown); 285 | this.menuStrip1.ResumeLayout(false); 286 | this.menuStrip1.PerformLayout(); 287 | this.ResumeLayout(false); 288 | this.PerformLayout(); 289 | 290 | } 291 | 292 | #endregion 293 | 294 | private EPocalipse.Json.Viewer.JsonViewer JsonViewer; 295 | private System.Windows.Forms.MenuStrip menuStrip1; 296 | private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; 297 | private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem; 298 | private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; 299 | private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; 300 | private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem; 301 | private System.Windows.Forms.ToolStripMenuItem undoToolStripMenuItem; 302 | private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; 303 | private System.Windows.Forms.ToolStripMenuItem cutToolStripMenuItem; 304 | private System.Windows.Forms.ToolStripMenuItem copyToolStripMenuItem; 305 | private System.Windows.Forms.ToolStripMenuItem pasteToolStripMenuItem; 306 | private System.Windows.Forms.ToolStripMenuItem deleteToolStripMenuItem; 307 | private System.Windows.Forms.ToolStripSeparator toolStripSeparator3; 308 | private System.Windows.Forms.ToolStripMenuItem selectAllToolStripMenuItem; 309 | private System.Windows.Forms.ToolStripMenuItem viewerToolStripMenuItem; 310 | private System.Windows.Forms.ToolStripMenuItem findToolStripMenuItem; 311 | private System.Windows.Forms.ToolStripMenuItem expandAllToolStripMenuItem; 312 | private System.Windows.Forms.ToolStripSeparator toolStripSeparator4; 313 | private System.Windows.Forms.ToolStripMenuItem copyToolStripMenuItem1; 314 | private System.Windows.Forms.ToolStripMenuItem copyValueToolStripMenuItem; 315 | private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem; 316 | private System.Windows.Forms.ToolStripMenuItem aboutJSONViewerToolStripMenuItem; 317 | } 318 | } 319 | 320 | -------------------------------------------------------------------------------- /JsonView/MainForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Text; 7 | using System.Windows.Forms; 8 | using EPocalipse.Json.Viewer; 9 | using System.IO; 10 | 11 | namespace EPocalipse.Json.JsonView 12 | { 13 | public partial class MainForm : Form 14 | { 15 | public MainForm() 16 | { 17 | InitializeComponent(); 18 | } 19 | 20 | private void MainForm_Shown(object sender, EventArgs e) 21 | { 22 | string[] args = Environment.GetCommandLineArgs(); 23 | for (int i = 1; i < args.Length; i++) 24 | { 25 | string arg = args[i]; 26 | if (arg.Equals("/c", StringComparison.OrdinalIgnoreCase)) 27 | { 28 | LoadFromClipboard(); 29 | } 30 | else if (File.Exists(arg)) 31 | { 32 | LoadFromFile(arg); 33 | } 34 | } 35 | } 36 | 37 | private void LoadFromFile(string fileName) 38 | { 39 | string json = File.ReadAllText(fileName); 40 | JsonViewer.ShowTab(Tabs.Viewer); 41 | JsonViewer.Json = json; 42 | } 43 | 44 | private void LoadFromClipboard() 45 | { 46 | string json = Clipboard.GetText(); 47 | if (!String.IsNullOrEmpty(json)) 48 | { 49 | JsonViewer.ShowTab(Tabs.Viewer); 50 | JsonViewer.Json = json; 51 | } 52 | } 53 | 54 | private void MainForm_Load(object sender, EventArgs e) 55 | { 56 | JsonViewer.ShowTab(Tabs.Text); 57 | } 58 | 59 | /// 60 | /// Closes the program 61 | /// 62 | /// 63 | /// 64 | /// Menu item File > Exit 65 | private void exitToolStripMenuItem_Click(object sender, EventArgs e) 66 | { 67 | Application.Exit(); 68 | } 69 | 70 | /// 71 | /// Open File Dialog for Yahoo! Pipe files or JSON files 72 | /// 73 | /// 74 | /// 75 | /// Menu item File > Open 76 | private void openToolStripMenuItem_Click(object sender, EventArgs e) 77 | { 78 | OpenFileDialog dialog = new OpenFileDialog(); 79 | dialog.Filter = 80 | "Yahoo! Pipe files (*.run)|*.run|json files (*.json)|*.json|All files (*.*)|*.*"; 81 | dialog.InitialDirectory = Application.StartupPath; 82 | dialog.Title = "Select a JSON file"; 83 | if (dialog.ShowDialog() == DialogResult.OK) 84 | { 85 | this.LoadFromFile(dialog.FileName); 86 | } 87 | } 88 | 89 | /// 90 | /// Launches About JSONViewer dialog box 91 | /// 92 | /// 93 | /// 94 | /// Menu item Help > About JSON Viewer 95 | private void aboutJSONViewerToolStripMenuItem_Click(object sender, EventArgs e) 96 | { 97 | new AboutJsonViewer().ShowDialog(); 98 | } 99 | 100 | /// 101 | /// Selects all text in the textbox 102 | /// 103 | /// 104 | /// 105 | /// Menu item Edit > Select All 106 | private void selectAllToolStripMenuItem_Click(object sender, EventArgs e) 107 | { 108 | Control c; 109 | c = this.JsonViewer.Controls.Find("txtJson", true)[0]; 110 | ((TextBox)c).SelectAll(); 111 | } 112 | 113 | /// 114 | /// Deletes selected text in the textbox 115 | /// 116 | /// 117 | /// 118 | /// Menu item Edit > Delete 119 | private void deleteToolStripMenuItem_Click(object sender, EventArgs e) 120 | { 121 | Control c; 122 | c = this.JsonViewer.Controls.Find("txtJson", true)[0]; 123 | string text; 124 | if (((TextBox)c).SelectionLength > 0) 125 | text = ((TextBox)c).SelectedText; 126 | else 127 | text = ((TextBox)c).Text; 128 | ((TextBox)c).SelectedText = ""; 129 | } 130 | 131 | /// 132 | /// Pastes text in the clipboard into the textbox 133 | /// 134 | /// 135 | /// 136 | /// Menu item Edit > Paste 137 | private void pasteToolStripMenuItem_Click(object sender, EventArgs e) 138 | { 139 | Control c; 140 | c = this.JsonViewer.Controls.Find("txtJson", true)[0]; 141 | ((TextBox)c).Paste(); 142 | } 143 | 144 | /// 145 | /// Copies text in the textbox into the clipboard 146 | /// 147 | /// 148 | /// 149 | /// Menu item Edit > Copy 150 | private void copyToolStripMenuItem_Click(object sender, EventArgs e) 151 | { 152 | Control c; 153 | c = this.JsonViewer.Controls.Find("txtJson", true)[0]; 154 | ((TextBox)c).Copy(); 155 | } 156 | 157 | /// 158 | /// Cuts selected text from the textbox 159 | /// 160 | /// 161 | /// 162 | /// Menu item Edit > Cut 163 | private void cutToolStripMenuItem_Click(object sender, EventArgs e) 164 | { 165 | Control c; 166 | c = this.JsonViewer.Controls.Find("txtJson", true)[0]; 167 | ((TextBox)c).Cut(); 168 | } 169 | 170 | /// 171 | /// Undo the last action 172 | /// 173 | /// 174 | /// 175 | /// Menu item Edit > Undo 176 | private void undoToolStripMenuItem_Click(object sender, EventArgs e) 177 | { 178 | Control c; 179 | c = this.JsonViewer.Controls.Find("txtJson", true)[0]; 180 | ((TextBox)c).Undo(); 181 | } 182 | 183 | /// 184 | /// Displays the find prompt 185 | /// 186 | /// 187 | /// 188 | /// Menu item Viewer > Find 189 | private void findToolStripMenuItem_Click(object sender, EventArgs e) 190 | { 191 | Control c; 192 | c = this.JsonViewer.Controls.Find("pnlFind", true)[0]; 193 | ((Panel)c).Visible = true; 194 | Control t; 195 | t = this.JsonViewer.Controls.Find("txtFind", true)[0]; 196 | ((TextBox)t).Focus(); 197 | } 198 | 199 | /// 200 | /// Expands all the nodes 201 | /// 202 | /// 203 | /// 204 | /// Menu item Viewer > Expand All 205 | /// 206 | private void expandAllToolStripMenuItem_Click(object sender, EventArgs e) 207 | { 208 | Control c; 209 | c = this.JsonViewer.Controls.Find("tvJson", true)[0]; 210 | ((TreeView)c).BeginUpdate(); 211 | try 212 | { 213 | if (((TreeView)c).SelectedNode != null) 214 | { 215 | TreeNode topNode = ((TreeView)c).TopNode; 216 | ((TreeView)c).SelectedNode.ExpandAll(); 217 | ((TreeView)c).TopNode = topNode; 218 | } 219 | } 220 | finally 221 | { 222 | ((TreeView)c).EndUpdate(); 223 | } 224 | } 225 | 226 | /// 227 | /// Copies a node 228 | /// 229 | /// 230 | /// 231 | /// Menu item Viewer > Copy 232 | private void copyToolStripMenuItem1_Click(object sender, EventArgs e) 233 | { 234 | Control c; 235 | c = this.JsonViewer.Controls.Find("tvJson", true)[0]; 236 | TreeNode node = ((TreeView)c).SelectedNode; 237 | if (node != null) 238 | { 239 | Clipboard.SetText(node.Text); 240 | } 241 | } 242 | 243 | /// 244 | /// Copies just the node's value 245 | /// 246 | /// 247 | /// 248 | /// Menu item Viewer > Copy Value 249 | /// 250 | private void copyValueToolStripMenuItem_Click(object sender, EventArgs e) 251 | { 252 | Control c; 253 | c = this.JsonViewer.Controls.Find("tvJson", true)[0]; 254 | JsonViewerTreeNode node = (JsonViewerTreeNode)((TreeView)c).SelectedNode; 255 | if (node != null && node.JsonObject.Value != null) 256 | { 257 | Clipboard.SetText(node.JsonObject.Value.ToString()); 258 | } 259 | } 260 | } 261 | } -------------------------------------------------------------------------------- /JsonView/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 | 125 | 126 | iVBORw0KGgoAAAANSUhEUgAAABAAAAAPCAYAAADtc08vAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 127 | YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAABcSURBVDhPvY4BCsAgDMR8uj/vCHJlruLUjgWOol6K5S/s 128 | lm2eks5Hy0T4jS5WtoaumRHoHkcZ4vJs0mv1iJdmk16rR7ykyd1GEHu51vdIhpQMKRlSMuhhJV9TygVb 129 | V+81pzOLAgAAAABJRU5ErkJggg== 130 | 131 | 132 | 133 | 134 | iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 135 | YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAABXSURBVDhPzY1RCsAgDEN7/0tPshERzWKFfvggoI19xjU8 136 | CPiuFvn2HTJzOWD7LkDEo7/5gpKM5xRdwpwKQM0ycyJRS2mJWiZbiVsmrksJgO1tWUnVRxENMzKIeApf 137 | i5oAAAAASUVORK5CYII= 138 | 139 | 140 | 141 | 142 | iVBORw0KGgoAAAANSUhEUgAAABAAAAAPCAYAAADtc08vAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 143 | YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAABDSURBVDhPYxgFxICG/6iYAYSxAbAkEoBrQAM4DUHWgE0j 144 | MsAqDzOAkGYQIGgAIUOIMgCrIiAAi+OQIwzwGDxSAQMDABUaLeFkMMc6AAAAAElFTkSuQmCC 145 | 146 | 147 | 148 | 149 | iVBORw0KGgoAAAANSUhEUgAAABAAAAAPCAYAAADtc08vAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 150 | YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAABLSURBVDhPzY0BCgAgCAN9ej8vFg5EAtOIOogZeFNu0TWJ 151 | /4f8UUDJzilsQQleLheAE7np9ZkVKCL5tvCCFcOS1fL7AoA5lElmWWQAN0A2V/LDDiUAAAAASUVORK5C 152 | YII= 153 | 154 | 155 | 156 | 157 | iVBORw0KGgoAAAANSUhEUgAAABAAAAAPCAYAAADtc08vAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 158 | YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAABqSURBVDhPrY8LCsAgDEM9+m6u60+7aGlhPghKG0NsN+iB 159 | ynSEZqoS+mxhMzrZkeDN7v4E2uFHCJmRKESX89+qc4Cdr2fCQ2SZJVDu1uDbRJd5A88WgFgA7VEydwFn 160 | 1RsE1BsEXGiQ6zetDZvIY72fGzRlAAAAAElFTkSuQmCC 161 | 162 | 163 | 164 | 165 | iVBORw0KGgoAAAANSUhE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OqSauJRvMr9qmXQ4P8/RoWvU16eyBUEq5kbigwiKoOMTBQ0zbKlTq6TxihwejkZ1iOJwfEwmiC 238 | BQ49yaW50J7Fh0xJw3IxbM3hwo2x0ICRHZzFgveTunYERK5lgo5YMxx8WPFw5Li+U8wYm66jNz+Naov+ 239 | Beqiao58N5NrPluoryJO0QeKU7sNGKPPazh9aRzGo/eYmVvEMk270fTlmzl2N3XW9xL/jv7iaxw7+wAH 240 | E9ew//AVxE8OItv/9O/Cf0ck8gud2vKswuxNZgAAAABJRU5ErkJggg== 241 | 242 | 243 | -------------------------------------------------------------------------------- /JsonView/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Windows.Forms; 4 | 5 | namespace EPocalipse.Json.JsonView 6 | { 7 | static class Program 8 | { 9 | /// 10 | /// The main entry point for the application. 11 | /// 12 | [STAThread] 13 | static void Main() 14 | { 15 | Application.EnableVisualStyles(); 16 | Application.SetCompatibleTextRenderingDefault(false); 17 | Application.Run(new MainForm()); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /JsonView/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("JsonViewer")] 9 | [assembly: AssemblyDescription("A standalone viewer for JSON objects.")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("EPocalipse Software")] 12 | [assembly: AssemblyProduct("JsonViewer")] 13 | [assembly: AssemblyCopyright("Copyright © 2008")] 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("bf508807-3b54-45e3-b282-096cc2a0cb45")] 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 | [assembly: AssemblyVersion("1.1.0.0")] 33 | [assembly: AssemblyFileVersion("1.1.0.0")] 34 | -------------------------------------------------------------------------------- /JsonView/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本:4.0.30319.42000 5 | // 6 | // 对此文件的更改可能会导致不正确的行为,并且如果 7 | // 重新生成代码,这些更改将会丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace EPocalipse.Json.JsonView.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// 一个强类型的资源类,用于查找本地化的字符串等。 17 | /// 18 | // 此类是由 StronglyTypedResourceBuilder 19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 20 | // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen 21 | // (以 /str 作为命令选项),或重新生成 VS 项目。 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.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 | /// 返回此类使用的缓存的 ResourceManager 实例。 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("EPocalipse.Json.JsonView.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// 重写当前线程的 CurrentUICulture 属性,对 51 | /// 使用此强类型资源类的所有资源查找执行重写。 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 | -------------------------------------------------------------------------------- /JsonView/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 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /JsonView/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本:4.0.30319.42000 5 | // 6 | // 对此文件的更改可能会导致不正确的行为,并且如果 7 | // 重新生成代码,这些更改将会丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace EPocalipse.Json.JsonView.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /JsonView/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /JsonView/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /JsonViewer.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{E9E44130-70CC-442C-A77C-A1112310354A}" 7 | ProjectSection(SolutionItems) = preProject 8 | Samples\GridSample.txt = Samples\GridSample.txt 9 | Samples\Sample2.txt = Samples\Sample2.txt 10 | EndProjectSection 11 | EndProject 12 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0508F31B-5B21-4096-A3B7-280815BBECAE}" 13 | EndProject 14 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FiddlerJsonViewer", "Fiddler\FiddlerJsonViewer.csproj", "{4B6A26FA-0D44-4354-92E7-54FC5A75469B}" 15 | EndProject 16 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JsonVisualizer", "Visualizer\JsonVisualizer.csproj", "{32BEAE8D-282C-4414-9B7F-2F0E9450369A}" 17 | EndProject 18 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JsonView", "JsonView\JsonView.csproj", "{83D82889-66FA-41AC-932F-9AF3AE8EAA9C}" 19 | EndProject 20 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JsonViewer", "JsonViewer\JsonViewer.csproj", "{3AE264FB-52DC-4295-A37F-CE63CAF54930}" 21 | EndProject 22 | Global 23 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 24 | Debug|Any CPU = Debug|Any CPU 25 | Release|Any CPU = Release|Any CPU 26 | EndGlobalSection 27 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 28 | {4B6A26FA-0D44-4354-92E7-54FC5A75469B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 29 | {4B6A26FA-0D44-4354-92E7-54FC5A75469B}.Debug|Any CPU.Build.0 = Debug|Any CPU 30 | {4B6A26FA-0D44-4354-92E7-54FC5A75469B}.Release|Any CPU.ActiveCfg = Release|Any CPU 31 | {4B6A26FA-0D44-4354-92E7-54FC5A75469B}.Release|Any CPU.Build.0 = Release|Any CPU 32 | {32BEAE8D-282C-4414-9B7F-2F0E9450369A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 33 | {32BEAE8D-282C-4414-9B7F-2F0E9450369A}.Debug|Any CPU.Build.0 = Debug|Any CPU 34 | {32BEAE8D-282C-4414-9B7F-2F0E9450369A}.Release|Any CPU.ActiveCfg = Release|Any CPU 35 | {32BEAE8D-282C-4414-9B7F-2F0E9450369A}.Release|Any CPU.Build.0 = Release|Any CPU 36 | {83D82889-66FA-41AC-932F-9AF3AE8EAA9C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 37 | {83D82889-66FA-41AC-932F-9AF3AE8EAA9C}.Debug|Any CPU.Build.0 = Debug|Any CPU 38 | {83D82889-66FA-41AC-932F-9AF3AE8EAA9C}.Release|Any CPU.ActiveCfg = Release|Any CPU 39 | {83D82889-66FA-41AC-932F-9AF3AE8EAA9C}.Release|Any CPU.Build.0 = Release|Any CPU 40 | {3AE264FB-52DC-4295-A37F-CE63CAF54930}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 41 | {3AE264FB-52DC-4295-A37F-CE63CAF54930}.Debug|Any CPU.Build.0 = Debug|Any CPU 42 | {3AE264FB-52DC-4295-A37F-CE63CAF54930}.Release|Any CPU.ActiveCfg = Release|Any CPU 43 | {3AE264FB-52DC-4295-A37F-CE63CAF54930}.Release|Any CPU.Build.0 = Release|Any CPU 44 | EndGlobalSection 45 | GlobalSection(SolutionProperties) = preSolution 46 | HideSolutionNode = FALSE 47 | EndGlobalSection 48 | EndGlobal 49 | -------------------------------------------------------------------------------- /JsonViewer/GridVisualizer.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace EPocalipse.Json.Viewer 2 | { 3 | partial class GridVisualizer 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.lvGrid = new System.Windows.Forms.ListView(); 32 | this.SuspendLayout(); 33 | // 34 | // lvGrid 35 | // 36 | this.lvGrid.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; 37 | this.lvGrid.Dock = System.Windows.Forms.DockStyle.Fill; 38 | this.lvGrid.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; 39 | this.lvGrid.Location = new System.Drawing.Point(0, 0); 40 | this.lvGrid.Name = "lvGrid"; 41 | this.lvGrid.Size = new System.Drawing.Size(727, 301); 42 | this.lvGrid.TabIndex = 0; 43 | this.lvGrid.UseCompatibleStateImageBehavior = false; 44 | this.lvGrid.View = System.Windows.Forms.View.Details; 45 | // 46 | // GridVisualizer 47 | // 48 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 49 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 50 | this.Controls.Add(this.lvGrid); 51 | this.Name = "GridVisualizer"; 52 | this.Size = new System.Drawing.Size(727, 301); 53 | this.ResumeLayout(false); 54 | 55 | } 56 | 57 | #endregion 58 | 59 | private System.Windows.Forms.ListView lvGrid; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /JsonViewer/GridVisualizer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Drawing; 5 | using System.Data; 6 | using System.Text; 7 | using System.Windows.Forms; 8 | 9 | namespace EPocalipse.Json.Viewer 10 | { 11 | public partial class GridVisualizer : UserControl, IJsonVisualizer 12 | { 13 | public GridVisualizer() 14 | { 15 | InitializeComponent(); 16 | } 17 | 18 | Control IJsonVisualizer.GetControl(JsonObject jsonObject) 19 | { 20 | return this; 21 | } 22 | 23 | void IJsonVisualizer.Visualize(JsonObject jsonObject) 24 | { 25 | lvGrid.BeginUpdate(); 26 | try 27 | { 28 | lvGrid.Columns.Clear(); 29 | lvGrid.Items.Clear(); 30 | FillHeaders(jsonObject.Fields["headers"]); 31 | FillRows(jsonObject.Fields["rows"]); 32 | } 33 | finally 34 | { 35 | lvGrid.EndUpdate(); 36 | } 37 | } 38 | 39 | private void FillHeaders(JsonObject jsonObject) 40 | { 41 | foreach (JsonObject header in jsonObject.Fields) 42 | { 43 | JsonObject nameHeader = header.Fields["name"]; 44 | if (nameHeader.JsonType == JsonType.Value && nameHeader.Value is string) 45 | { 46 | string name = (string)nameHeader.Value; 47 | lvGrid.Columns.Add(name); 48 | } 49 | } 50 | } 51 | 52 | private void FillRows(JsonObject jsonObject) 53 | { 54 | string value; 55 | foreach (JsonObject row in jsonObject.Fields) 56 | { 57 | List rowValues = new List(); 58 | foreach (JsonObject rowValue in row.Fields) 59 | { 60 | if (rowValue.JsonType == JsonType.Value && rowValue.Value != null) 61 | { 62 | value = rowValue.Value.ToString(); 63 | } 64 | else 65 | value = String.Empty; 66 | rowValues.Add(value); 67 | } 68 | ListViewItem rowItem = new ListViewItem(rowValues.ToArray()); 69 | lvGrid.Items.Add(rowItem); 70 | } 71 | } 72 | 73 | string IJsonViewerPlugin.DisplayName 74 | { 75 | get { return "Grid"; } 76 | } 77 | 78 | bool IJsonViewerPlugin.CanVisualize(JsonObject jsonObject) 79 | { 80 | return jsonObject.ContainsField("headers", JsonType.Array) && 81 | jsonObject.ContainsField("rows", JsonType.Array); 82 | } 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /JsonViewer/GridVisualizer.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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /JsonViewer/IJsonViewerPlugin.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.Windows.Forms; 5 | 6 | namespace EPocalipse.Json.Viewer 7 | { 8 | public interface IJsonViewerPlugin 9 | { 10 | string DisplayName {get;} 11 | bool CanVisualize(JsonObject jsonObject); 12 | } 13 | 14 | public interface ICustomTextProvider : IJsonViewerPlugin 15 | { 16 | string GetText(JsonObject jsonObject); 17 | } 18 | 19 | public interface IJsonVisualizer : IJsonViewerPlugin 20 | { 21 | Control GetControl(JsonObject jsonObject); 22 | void Visualize(JsonObject jsonObject); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /JsonViewer/InternalPlugins.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.Windows.Forms; 5 | 6 | namespace EPocalipse.Json.Viewer 7 | { 8 | class AjaxNetDateTime: ICustomTextProvider 9 | { 10 | static readonly long epoch=new DateTime(1970, 1, 1).Ticks; 11 | 12 | public string GetText(JsonObject jsonObject) 13 | { 14 | string text = (string)jsonObject.Value; 15 | return "Ajax.Net Date:"+ConvertJSTicksToDateTime(Convert.ToInt64(text.Substring(1, text.Length - 2))).ToString(); 16 | } 17 | 18 | private DateTime ConvertJSTicksToDateTime(long ticks) 19 | { 20 | return new DateTime((ticks * 10000) + epoch); 21 | } 22 | 23 | public string DisplayName 24 | { 25 | get { return "Ajax.Net DateTime"; } 26 | } 27 | 28 | public bool CanVisualize(JsonObject jsonObject) 29 | { 30 | if (jsonObject.JsonType == JsonType.Value && jsonObject.Value is string) 31 | { 32 | string text = (string)jsonObject.Value; 33 | return (text.Length > 2 && text[0] == '@' && text[text.Length - 1] == '@'); 34 | } 35 | return false; 36 | } 37 | } 38 | 39 | class CustomDate : ICustomTextProvider 40 | { 41 | public string GetText(JsonObject jsonObject) 42 | { 43 | int year,month,day,hour,min,second,ms; 44 | year = (int)(long)jsonObject.Fields["y"].Value; 45 | month = (int)(long)jsonObject.Fields["M"].Value; 46 | day = (int)(long)jsonObject.Fields["d"].Value; 47 | hour = (int)(long)jsonObject.Fields["h"].Value; 48 | min = (int)(long)jsonObject.Fields["m"].Value; 49 | second = (int)(long)jsonObject.Fields["s"].Value; 50 | ms = (int)(long)jsonObject.Fields["ms"].Value; 51 | return new DateTime(year, month, day, hour, min, second, ms).ToString(); 52 | } 53 | 54 | public string DisplayName 55 | { 56 | get { return "Date"; } 57 | } 58 | 59 | public bool CanVisualize(JsonObject jsonObject) 60 | { 61 | return jsonObject.ContainsFields("y","M","d","h","m","s","ms"); 62 | } 63 | } 64 | 65 | class Sample : IJsonVisualizer 66 | { 67 | TextBox tb; 68 | 69 | public Control GetControl(JsonObject jsonObject) 70 | { 71 | if (tb == null) 72 | { 73 | tb = new TextBox(); 74 | tb.Multiline = true; 75 | } 76 | return tb; 77 | } 78 | 79 | public void Visualize(JsonObject jsonObject) 80 | { 81 | tb.Text = String.Format("Array {0} has {1} items", jsonObject.Id, jsonObject.Fields.Count); 82 | } 83 | 84 | public string DisplayName 85 | { 86 | get { return "Sample"; } 87 | } 88 | 89 | public bool CanVisualize(JsonObject jsonObject) 90 | { 91 | return (jsonObject.JsonType == JsonType.Array) && (jsonObject.ContainsFields("[0]")); 92 | } 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /JsonViewer/JsonFields.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.Collections; 5 | 6 | namespace EPocalipse.Json.Viewer 7 | { 8 | public class JsonFields : IEnumerable 9 | { 10 | private List _fields = new List(); 11 | private Dictionary _fieldsById = new Dictionary(); 12 | private JsonObject _parent; 13 | 14 | public JsonFields(JsonObject parent) 15 | { 16 | _parent = parent; 17 | } 18 | 19 | public IEnumerator GetEnumerator() 20 | { 21 | return _fields.GetEnumerator(); 22 | } 23 | 24 | IEnumerator IEnumerable.GetEnumerator() 25 | { 26 | return GetEnumerator(); 27 | } 28 | 29 | public void Add(JsonObject field) 30 | { 31 | field.Parent = _parent; 32 | _fields.Add(field); 33 | _fieldsById[field.Id] = field; 34 | _parent.Modified(); 35 | } 36 | 37 | public int Count 38 | { 39 | get 40 | { 41 | return _fields.Count; 42 | } 43 | } 44 | 45 | public JsonObject this[int index] 46 | { 47 | get 48 | { 49 | return _fields[index]; 50 | } 51 | } 52 | 53 | public JsonObject this[string id] 54 | { 55 | get 56 | { 57 | JsonObject result; 58 | if (_fieldsById.TryGetValue(id, out result)) 59 | return result; 60 | return null; 61 | } 62 | } 63 | 64 | public bool ContainId(string id) 65 | { 66 | return _fieldsById.ContainsKey(id); 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /JsonViewer/JsonObject.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.Collections.ObjectModel; 5 | using System.Diagnostics; 6 | 7 | namespace EPocalipse.Json.Viewer 8 | { 9 | [DebuggerDisplay("Text = {Text}")] 10 | public class JsonObject 11 | { 12 | private string _id; 13 | private object _value; 14 | private JsonType _jsonType; 15 | private JsonFields _fields; 16 | private JsonObject _parent; 17 | private string _text; 18 | 19 | public JsonObject() 20 | { 21 | _fields=new JsonFields(this); 22 | } 23 | 24 | public string Id 25 | { 26 | get 27 | { 28 | return _id; 29 | } 30 | set 31 | { 32 | _id = value; 33 | } 34 | } 35 | 36 | public object Value 37 | { 38 | get 39 | { 40 | return _value; 41 | } 42 | set 43 | { 44 | _value = value; 45 | } 46 | } 47 | 48 | public JsonType JsonType 49 | { 50 | get 51 | { 52 | return _jsonType; 53 | } 54 | set 55 | { 56 | _jsonType = value; 57 | } 58 | } 59 | 60 | public JsonObject Parent 61 | { 62 | get 63 | { 64 | return _parent; 65 | } 66 | set 67 | { 68 | _parent = value; 69 | } 70 | } 71 | 72 | public string Text 73 | { 74 | get 75 | { 76 | if (_text == null) 77 | { 78 | if (JsonType == JsonType.Value) 79 | { 80 | string val = (Value == null ? "" : Value.ToString()); 81 | if (Value is string) 82 | val = "\"" + val + "\""; 83 | _text = String.Format("{0} : {1}", Id, val); 84 | } 85 | else 86 | _text = Id; 87 | } 88 | return _text; 89 | } 90 | } 91 | 92 | public JsonFields Fields 93 | { 94 | get 95 | { 96 | return _fields; 97 | } 98 | } 99 | 100 | internal void Modified() 101 | { 102 | _text = null; 103 | } 104 | 105 | public bool ContainsFields(params string[] ids ) 106 | { 107 | foreach (string s in ids) 108 | { 109 | if (!_fields.ContainId(s)) 110 | return false; 111 | } 112 | return true; 113 | } 114 | 115 | public bool ContainsField(string id, JsonType type) 116 | { 117 | JsonObject field = Fields[id]; 118 | return (field != null && field.JsonType == type); 119 | } 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /JsonViewer/JsonObjectTree.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Runtime.Serialization; 4 | using System.Text.RegularExpressions; 5 | 6 | using Newtonsoft.Json; 7 | using Newtonsoft.Json.Linq; 8 | 9 | namespace EPocalipse.Json.Viewer 10 | { 11 | public enum JsonType { Object, Array, Value }; 12 | 13 | internal class JsonParseError : ApplicationException 14 | { 15 | public JsonParseError() : base() { } 16 | public JsonParseError(string message) : base(message) { } 17 | protected JsonParseError(SerializationInfo info, StreamingContext context) : base(info, context) { } 18 | public JsonParseError(string message, Exception innerException) : base(message, innerException) { } 19 | 20 | } 21 | 22 | public class JsonObjectTree 23 | { 24 | private JsonObject _root; 25 | private static Regex dateRegex = new Regex("^/Date\\(([0-9]*)([+-][0-9]{4}){0,1}\\)/$"); 26 | 27 | public static JsonObjectTree Parse(string json) 28 | { 29 | //Parse the JSON string 30 | object jsonObject; 31 | try 32 | { 33 | jsonObject = JsonConvert.DeserializeObject(json); 34 | } 35 | catch (Exception e) 36 | { 37 | throw new JsonParseError(e.Message, e); 38 | } 39 | //Parse completed, build the tree 40 | return new JsonObjectTree(jsonObject); 41 | } 42 | 43 | public JsonObjectTree(object rootObject) 44 | { 45 | _root = ConvertToObject("JSON", rootObject); 46 | } 47 | 48 | private static JsonObject ConvertToObject(string id, object jsonObject) 49 | { 50 | JsonObject obj = CreateJsonObject(jsonObject); 51 | obj.Id = id; 52 | AddChildren(jsonObject, obj); 53 | return obj; 54 | } 55 | 56 | private static void AddChildren(object jsonObject, JsonObject obj) 57 | { 58 | JObject javaScriptObject = jsonObject as JObject; 59 | if (javaScriptObject != null) 60 | { 61 | foreach (KeyValuePair pair in javaScriptObject) 62 | { 63 | obj.Fields.Add(ConvertToObject(pair.Key, pair.Value)); 64 | } 65 | } 66 | else 67 | { 68 | JArray javaScriptArray = jsonObject as JArray; 69 | if (javaScriptArray != null) 70 | { 71 | for (int i = 0; i < javaScriptArray.Count; i++) 72 | { 73 | obj.Fields.Add(ConvertToObject("[" + i.ToString() + "]", javaScriptArray[i])); 74 | } 75 | } 76 | } 77 | } 78 | 79 | private static JsonObject CreateJsonObject(object jsonObject) 80 | { 81 | JsonObject obj = new JsonObject(); 82 | if (jsonObject is JArray) 83 | obj.JsonType = JsonType.Array; 84 | else if (jsonObject is JObject) 85 | obj.JsonType = JsonType.Object; 86 | else 87 | { 88 | if (typeof(string) == jsonObject.GetType()) { 89 | Match match = dateRegex.Match(jsonObject as string); 90 | if (match.Success) { 91 | // I'm not sure why this is match.Groups[1] and not match.Groups[0] 92 | // we need to convert milliseconds to windows ticks (one tick is one hundred nanoseconds (e-9)) 93 | Int64 ticksSinceEpoch = Int64.Parse(match.Groups[1].Value) * (Int64)10e3; 94 | jsonObject = DateTime.SpecifyKind(new DateTime(1970, 1, 1).Add(new TimeSpan(ticksSinceEpoch)), DateTimeKind.Utc); 95 | // Take care of the timezone offset 96 | if (!string.IsNullOrEmpty(match.Groups[2].Value)) { 97 | Int64 timeZoneOffset = Int64.Parse(match.Groups[2].Value); 98 | jsonObject = ((DateTime)jsonObject).AddHours(timeZoneOffset/100); 99 | // Some timezones like India Tehran and Nepal have fractional offsets from GMT 100 | jsonObject = ((DateTime)jsonObject).AddMinutes(timeZoneOffset%100); 101 | } 102 | } 103 | } 104 | obj.JsonType = JsonType.Value; 105 | obj.Value = jsonObject; 106 | } 107 | return obj; 108 | } 109 | 110 | public JsonObject Root 111 | { 112 | get 113 | { 114 | return _root; 115 | } 116 | } 117 | 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /JsonViewer/JsonObjectVisualizer.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace EPocalipse.Json.Viewer 2 | { 3 | partial class JsonObjectVisualizer 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.pgJsonObject = new System.Windows.Forms.PropertyGrid(); 32 | this.SuspendLayout(); 33 | // 34 | // pgJsonObject 35 | // 36 | this.pgJsonObject.Dock = System.Windows.Forms.DockStyle.Fill; 37 | this.pgJsonObject.HelpVisible = false; 38 | this.pgJsonObject.Location = new System.Drawing.Point(0, 0); 39 | this.pgJsonObject.Name = "pgJsonObject"; 40 | this.pgJsonObject.PropertySort = System.Windows.Forms.PropertySort.Alphabetical; 41 | this.pgJsonObject.Size = new System.Drawing.Size(304, 467); 42 | this.pgJsonObject.TabIndex = 4; 43 | this.pgJsonObject.ToolbarVisible = false; 44 | // 45 | // JsonObjectVisualizer 46 | // 47 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 48 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 49 | this.Controls.Add(this.pgJsonObject); 50 | this.Name = "JsonObjectVisualizer"; 51 | this.Size = new System.Drawing.Size(304, 467); 52 | this.ResumeLayout(false); 53 | 54 | } 55 | 56 | #endregion 57 | 58 | private System.Windows.Forms.PropertyGrid pgJsonObject; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /JsonViewer/JsonObjectVisualizer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Drawing; 5 | using System.Data; 6 | using System.Text; 7 | using System.Windows.Forms; 8 | 9 | namespace EPocalipse.Json.Viewer 10 | { 11 | public partial class JsonObjectVisualizer : UserControl, IJsonVisualizer 12 | { 13 | public JsonObjectVisualizer() 14 | { 15 | InitializeComponent(); 16 | } 17 | 18 | string IJsonViewerPlugin.DisplayName 19 | { 20 | get { return "Property Grid"; } 21 | } 22 | 23 | Control IJsonVisualizer.GetControl(JsonObject jsonObject) 24 | { 25 | return this; 26 | } 27 | 28 | void IJsonVisualizer.Visualize(JsonObject jsonObject) 29 | { 30 | this.pgJsonObject.SelectedObject = new JsonTreeObjectTypeDescriptor(jsonObject); 31 | } 32 | 33 | 34 | bool IJsonViewerPlugin.CanVisualize(JsonObject jsonObject) 35 | { 36 | return true; 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /JsonViewer/JsonObjectVisualizer.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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /JsonViewer/JsonTreeObjectTypeDescriptor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.ComponentModel; 5 | 6 | namespace EPocalipse.Json.Viewer 7 | { 8 | class JsonTreeObjectTypeDescriptor : ICustomTypeDescriptor 9 | { 10 | JsonObject _jsonObject; 11 | PropertyDescriptorCollection _propertyCollection; 12 | 13 | public JsonTreeObjectTypeDescriptor(JsonObject jsonObject) 14 | { 15 | _jsonObject = jsonObject; 16 | InitPropertyCollection(); 17 | } 18 | 19 | private void InitPropertyCollection() 20 | { 21 | List propertyDescriptors = new List(); 22 | 23 | foreach (JsonObject field in _jsonObject.Fields) 24 | { 25 | PropertyDescriptor pd = new JsonTreeObjectPropertyDescriptor(field); 26 | propertyDescriptors.Add(pd); 27 | } 28 | _propertyCollection = new PropertyDescriptorCollection(propertyDescriptors.ToArray()); 29 | } 30 | 31 | AttributeCollection ICustomTypeDescriptor.GetAttributes() 32 | { 33 | return TypeDescriptor.GetAttributes(_jsonObject, true); 34 | } 35 | 36 | string ICustomTypeDescriptor.GetClassName() 37 | { 38 | return TypeDescriptor.GetClassName(_jsonObject, true); 39 | } 40 | 41 | string ICustomTypeDescriptor.GetComponentName() 42 | { 43 | return TypeDescriptor.GetComponentName(_jsonObject, true); 44 | } 45 | 46 | TypeConverter ICustomTypeDescriptor.GetConverter() 47 | { 48 | return TypeDescriptor.GetConverter(_jsonObject, true); 49 | } 50 | 51 | EventDescriptor ICustomTypeDescriptor.GetDefaultEvent() 52 | { 53 | return TypeDescriptor.GetDefaultEvent(_jsonObject, true); 54 | } 55 | 56 | PropertyDescriptor ICustomTypeDescriptor.GetDefaultProperty() 57 | { 58 | return null; 59 | } 60 | 61 | object ICustomTypeDescriptor.GetEditor(Type editorBaseType) 62 | { 63 | return TypeDescriptor.GetEditor(_jsonObject, editorBaseType, true); 64 | } 65 | 66 | EventDescriptorCollection ICustomTypeDescriptor.GetEvents(Attribute[] attributes) 67 | { 68 | return TypeDescriptor.GetEvents(this, attributes, true); 69 | } 70 | 71 | EventDescriptorCollection ICustomTypeDescriptor.GetEvents() 72 | { 73 | return TypeDescriptor.GetEvents(_jsonObject, true); 74 | } 75 | 76 | PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties(Attribute[] attributes) 77 | { 78 | return _propertyCollection; 79 | } 80 | 81 | PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties() 82 | { 83 | return ((ICustomTypeDescriptor)this).GetProperties(null); 84 | } 85 | 86 | object ICustomTypeDescriptor.GetPropertyOwner(PropertyDescriptor pd) 87 | { 88 | return _jsonObject; 89 | } 90 | } 91 | 92 | class JsonTreeObjectPropertyDescriptor : PropertyDescriptor 93 | { 94 | JsonObject _jsonObject; 95 | JsonTreeObjectTypeDescriptor[] _jsonObjects; 96 | 97 | public JsonTreeObjectPropertyDescriptor(JsonObject jsonObject) 98 | : base(jsonObject.Id, null) 99 | { 100 | _jsonObject = jsonObject; 101 | if (_jsonObject.JsonType == JsonType.Array) 102 | InitJsonObject(); 103 | } 104 | 105 | private void InitJsonObject() 106 | { 107 | List jsonObjectList = new List(); 108 | foreach (JsonObject field in _jsonObject.Fields) 109 | { 110 | jsonObjectList.Add(new JsonTreeObjectTypeDescriptor(field)); 111 | } 112 | _jsonObjects = jsonObjectList.ToArray(); 113 | } 114 | 115 | public override bool CanResetValue(object component) 116 | { 117 | return false; 118 | } 119 | 120 | public override Type ComponentType 121 | { 122 | get 123 | { 124 | return null; 125 | } 126 | } 127 | 128 | public override object GetValue(object component) 129 | { 130 | switch (_jsonObject.JsonType) 131 | { 132 | case JsonType.Array: 133 | return _jsonObjects; 134 | case JsonType.Object: 135 | return _jsonObject; 136 | default: 137 | return _jsonObject.Value; 138 | } 139 | } 140 | 141 | public override bool IsReadOnly 142 | { 143 | get 144 | { 145 | return false; 146 | } 147 | } 148 | 149 | public override Type PropertyType 150 | { 151 | get 152 | { 153 | switch (_jsonObject.JsonType) 154 | { 155 | case JsonType.Array: 156 | return typeof(object[]); 157 | case JsonType.Object: 158 | return typeof(JsonObject); 159 | default: 160 | return _jsonObject.Value == null ? typeof(string) : _jsonObject.Value.GetType(); 161 | } 162 | } 163 | } 164 | 165 | public override void ResetValue(object component) 166 | { 167 | throw new Exception("The method or operation is not implemented."); 168 | } 169 | 170 | public override void SetValue(object component, object value) 171 | { 172 | //TODO: Implement? 173 | } 174 | 175 | public override bool ShouldSerializeValue(object component) 176 | { 177 | return false; 178 | } 179 | 180 | public override object GetEditor(Type editorBaseType) 181 | { 182 | return base.GetEditor(editorBaseType); 183 | } 184 | } 185 | } 186 | -------------------------------------------------------------------------------- /JsonViewer/JsonViewer.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.50727 7 | 2.0 8 | {3AE264FB-52DC-4295-A37F-CE63CAF54930} 9 | Library 10 | Properties 11 | EPocalipse.Json.Viewer 12 | JsonViewer 13 | SAK 14 | SAK 15 | SAK 16 | SAK 17 | 18 | 19 | 3.5 20 | 21 | 22 | v4.5 23 | 24 | publish\ 25 | true 26 | Disk 27 | false 28 | Foreground 29 | 7 30 | Days 31 | false 32 | false 33 | true 34 | 0 35 | 1.0.0.%2a 36 | false 37 | false 38 | true 39 | 40 | 41 | true 42 | full 43 | false 44 | bin\Debug\ 45 | DEBUG;TRACE 46 | prompt 47 | 4 48 | false 49 | 50 | 51 | pdbonly 52 | true 53 | bin\Release\ 54 | TRACE 55 | prompt 56 | 4 57 | false 58 | 59 | 60 | 61 | ..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll 62 | 63 | 64 | ..\packages\Newtonsoft.Json.Bson.1.0.2\lib\net45\Newtonsoft.Json.Bson.dll 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | UserControl 76 | 77 | 78 | GridVisualizer.cs 79 | 80 | 81 | 82 | True 83 | True 84 | Resources.resx 85 | 86 | 87 | 88 | 89 | Code 90 | 91 | 92 | 93 | 94 | 95 | UserControl 96 | 97 | 98 | JsonViewer.cs 99 | 100 | 101 | UserControl 102 | 103 | 104 | JsonObjectVisualizer.cs 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | Designer 114 | GridVisualizer.cs 115 | 116 | 117 | Designer 118 | JsonViewer.cs 119 | 120 | 121 | Designer 122 | JsonObjectVisualizer.cs 123 | 124 | 125 | Designer 126 | ResXFileCodeGenerator 127 | Resources.Designer.cs 128 | 129 | 130 | 131 | 132 | PreserveNewest 133 | 134 | 135 | 136 | 137 | 138 | False 139 | .NET Framework 3.5 SP1 140 | true 141 | 142 | 143 | 144 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | -------------------------------------------------------------------------------- /JsonViewer/JsonViewer.dll.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /JsonViewer/JsonViewer.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 | 203, 17 122 | 123 | 124 | 17, 17 125 | 126 | 127 | 128 | AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w 129 | LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 130 | ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAW 131 | BQAAAk1TRnQBSQFMAgEBAwEAAQwBAAEMAQ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2AAC6AADPAADeAADrAADlAADyAADvAAD1 165 | AABGyNDUyNDUAAA8HhflGRPcAADIAACCOTCRAADBAADdDQCVDACDAADdAADyAAD1AABvyNDUyNDUAABB 166 | ODHjMSvaLiXTwb3F4+HaQjacAACU2tjU2tjRHwrVAADyAAD1AABvyNDUyNDUAABaUkniSkLZTUbZ3Nrm 167 | 7ern7+7q4+Hi7ero5uToJQjpAADvAADzAACByNDUyNDUAAB2ZVvgXlPZXVLZU0nY4OHt/Pv7/Pv78e/z 168 | CADHAADdAADeAADlAACQyNDUyNDUAACPemnecmDZbV3XeXbF+fn8////////////UEioAAC6AADPAADR 169 | AACfyNDUyNDUAACtg3HdeWfZh3jc+fn8////+vn+6uj5////////dmTSOBfQc1/dEAW5yNDUyNDUAADD 170 | h3PcfWrZd2DX19Hz+vn+i3rddmDX7+767+76gG7agW/ahnLaEwPKyNDUyNDUAADCh3PcfGnZfGnZdF/X 171 | inndeWXYe2jYfWrZfWrZe2jYfGnZg3HaFAjIyNDUyNDUGxzEg3Pcjn3di3rdi3rdinjdi3rdi3rdi3nd 172 | i3ndi3rdjXzdjXrdCQnCyNDUyNDUkZfPFAzKsKboy8Luyr/uyr/uyr/uyr/uyr/uyr/uy8LuubDrEwrK 173 | Y2fLyNDUyNDUyNDUkZfPGxzEAADBAADBAADBAADBAADBAADBAADBAADBERLCcnbNyNDUyNDUyNDUyNDU 174 | yNDUyNDUyNDUyNDUyNDUyNDUyNDUyNDUyNDUyNDUyNDUyNDUyNDUyNDU 175 | 176 | 177 | 178 | 104, 17 179 | 180 | 181 | 182 | iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 183 | YQUAAAAJcEhZcwAAGdYAABnWARjRyu0AAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG 184 | YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5X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ZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D 237 | TgDQASA1MVpwzwAAAABJRU5ErkJggg== 238 | 239 | 240 | 241 | 242 | iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 243 | YQUAAAAJcEhZcwAAGdYAABnWARjRyu0AAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG 244 | YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9 245 | 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw 246 | bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc 247 | VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9 248 | c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32 249 | Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo 250 | mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+ 251 | kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D 252 | TgDQASA1MVpwzwAAAABJRU5ErkJggg== 253 | 254 | 255 | -------------------------------------------------------------------------------- /JsonViewer/PluginsManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.Collections.Specialized; 5 | using System.Configuration; 6 | using System.Reflection; 7 | using System.IO; 8 | 9 | namespace EPocalipse.Json.Viewer 10 | { 11 | class PluginsManager 12 | { 13 | List plugins = new List(); 14 | List textVisualizers = new List(); 15 | List visualizers = new List(); 16 | IJsonVisualizer _defaultVisualizer; 17 | 18 | public PluginsManager() 19 | { 20 | } 21 | 22 | public void Initialize() 23 | { 24 | try 25 | { 26 | string myDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); 27 | //AppDomain.CurrentDomain.SetupInformation.PrivateBinPath; 28 | 29 | Configuration config = ConfigurationManager.OpenExeConfiguration(Assembly.GetExecutingAssembly().Location); 30 | if (config == null) 31 | InitDefaults(); 32 | ViewerConfiguration viewerConfig = (ViewerConfiguration)config.GetSection("jsonViewer"); 33 | InternalConfig(viewerConfig); 34 | } 35 | catch 36 | { 37 | InitDefaults(); 38 | } 39 | } 40 | 41 | private void InitDefaults() 42 | { 43 | if (this._defaultVisualizer == null) 44 | { 45 | AddPlugin(new JsonObjectVisualizer()); 46 | AddPlugin(new AjaxNetDateTime()); 47 | AddPlugin(new CustomDate()); 48 | } 49 | } 50 | 51 | private void InternalConfig(ViewerConfiguration viewerConfig) 52 | { 53 | if (viewerConfig != null) 54 | { 55 | foreach (KeyValueConfigurationElement keyValue in viewerConfig.Plugins) 56 | { 57 | string type = keyValue.Value; 58 | Type pluginType = Type.GetType(type, false); 59 | if (pluginType != null && typeof(IJsonViewerPlugin).IsAssignableFrom(pluginType)) 60 | { 61 | try 62 | { 63 | IJsonViewerPlugin plugin = (IJsonViewerPlugin)Activator.CreateInstance(pluginType); 64 | AddPlugin(plugin); 65 | } 66 | catch 67 | { 68 | //Silently ignore any errors in plugin creation 69 | } 70 | } 71 | } 72 | } 73 | } 74 | 75 | private void AddPlugin(IJsonViewerPlugin plugin) 76 | { 77 | plugins.Add(plugin); 78 | if (plugin is ICustomTextProvider) 79 | textVisualizers.Add((ICustomTextProvider)plugin); 80 | if (plugin is IJsonVisualizer) 81 | { 82 | if (_defaultVisualizer == null) 83 | _defaultVisualizer = (IJsonVisualizer)plugin; 84 | visualizers.Add((IJsonVisualizer)plugin); 85 | } 86 | } 87 | 88 | public IEnumerable TextVisualizers 89 | { 90 | get 91 | { 92 | return textVisualizers; 93 | } 94 | } 95 | 96 | public IEnumerable Visualizers 97 | { 98 | get 99 | { 100 | return visualizers; 101 | } 102 | } 103 | 104 | public IJsonVisualizer DefaultVisualizer 105 | { 106 | get 107 | { 108 | return _defaultVisualizer; 109 | } 110 | } 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /JsonViewer/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("JsonViewer")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("JsonViewer")] 13 | [assembly: AssemblyCopyright("Copyright © 2007")] 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("78e1bb93-a3fc-4b6b-bede-85ece6272836")] 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 Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /JsonViewer/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本:4.0.30319.42000 5 | // 6 | // 对此文件的更改可能会导致不正确的行为,并且如果 7 | // 重新生成代码,这些更改将会丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace EPocalipse.Json.Viewer.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// 一个强类型的资源类,用于查找本地化的字符串等。 17 | /// 18 | // 此类是由 StronglyTypedResourceBuilder 19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 20 | // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen 21 | // (以 /str 作为命令选项),或重新生成 VS 项目。 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.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 | /// 返回此类使用的缓存的 ResourceManager 实例。 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("EPocalipse.Json.Viewer.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// 重写当前线程的 CurrentUICulture 属性,对 51 | /// 使用此强类型资源类的所有资源查找执行重写。 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 | /// 查找类似 There was an error during initialization. If you get this message when trying to use the Fiddler plugin or the Visual Studio Visualizer, please follow the instructions in the ReadMe.txt file. 65 | ///The error was: {0} 的本地化字符串。 66 | /// 67 | internal static string ConfigMessage { 68 | get { 69 | return ResourceManager.GetString("ConfigMessage", resourceCulture); 70 | } 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /JsonViewer/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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | There was an error during initialization. If you get this message when trying to use the Fiddler plugin or the Visual Studio Visualizer, please follow the instructions in the ReadMe.txt file. 122 | The error was: {0} 123 | 124 | -------------------------------------------------------------------------------- /JsonViewer/UnbufferedStringReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.IO; 5 | 6 | namespace EPocalipse.Json.Viewer 7 | { 8 | [Serializable] 9 | public class UnbufferedStringReader : TextReader 10 | { 11 | // Fields 12 | private int _length; 13 | private int _pos; 14 | private string _s; 15 | 16 | // Methods 17 | public UnbufferedStringReader(string s) 18 | { 19 | if (s == null) 20 | { 21 | throw new ArgumentNullException("s"); 22 | } 23 | this._s = s; 24 | this._length = (s == null) ? 0 : s.Length; 25 | } 26 | 27 | public override void Close() 28 | { 29 | this.Dispose(true); 30 | } 31 | 32 | protected override void Dispose(bool disposing) 33 | { 34 | this._s = null; 35 | this._pos = 0; 36 | this._length = 0; 37 | base.Dispose(disposing); 38 | } 39 | 40 | public override int Peek() 41 | { 42 | if (this._s == null) 43 | { 44 | throw new Exception("object closed"); 45 | } 46 | if (this._pos == this._length) 47 | { 48 | return -1; 49 | } 50 | return this._s[this._pos]; 51 | } 52 | 53 | public override int Read() 54 | { 55 | if (this._s == null) 56 | { 57 | throw new Exception("object closed"); 58 | } 59 | if (this._pos == this._length) 60 | { 61 | return -1; 62 | } 63 | return this._s[this._pos++]; 64 | } 65 | 66 | public override int Read(char[] buffer, int index, int count) 67 | { 68 | if (buffer == null) 69 | { 70 | throw new ArgumentNullException("buffer"); 71 | } 72 | if (index < 0) 73 | { 74 | throw new ArgumentOutOfRangeException("index"); 75 | } 76 | if (count < 0) 77 | { 78 | throw new ArgumentOutOfRangeException("count"); 79 | } 80 | if ((buffer.Length - index) < count) 81 | { 82 | throw new ArgumentException("invalid offset length"); 83 | } 84 | if (this._s == null) 85 | { 86 | throw new Exception("object closed"); 87 | } 88 | int num = this._length - this._pos; 89 | if (num > 0) 90 | { 91 | if (num > count) 92 | { 93 | num = count; 94 | } 95 | this._s.CopyTo(this._pos, buffer, index, num); 96 | this._pos += num; 97 | } 98 | return num; 99 | } 100 | 101 | public override string ReadLine() 102 | { 103 | if (this._s == null) 104 | { 105 | throw new Exception("object closed"); 106 | } 107 | int num = this._pos; 108 | while (num < this._length) 109 | { 110 | char ch = this._s[num]; 111 | switch (ch) 112 | { 113 | case '\r': 114 | case '\n': 115 | { 116 | string text = this._s.Substring(this._pos, num - this._pos); 117 | this._pos = num + 1; 118 | if (((ch == '\r') && (this._pos < this._length)) && (this._s[this._pos] == '\n')) 119 | { 120 | this._pos++; 121 | } 122 | return text; 123 | } 124 | } 125 | num++; 126 | } 127 | if (num > this._pos) 128 | { 129 | string text2 = this._s.Substring(this._pos, num - this._pos); 130 | this._pos = num; 131 | return text2; 132 | } 133 | return null; 134 | } 135 | 136 | public override string ReadToEnd() 137 | { 138 | string text; 139 | if (this._s == null) 140 | { 141 | throw new Exception("object closed"); 142 | } 143 | if (this._pos == 0) 144 | { 145 | text = this._s; 146 | } 147 | else 148 | { 149 | text = this._s.Substring(this._pos, this._length - this._pos); 150 | } 151 | this._pos = this._length; 152 | return text; 153 | } 154 | 155 | public int Position 156 | { 157 | get 158 | { 159 | return _pos; 160 | } 161 | } 162 | } 163 | 164 | } 165 | -------------------------------------------------------------------------------- /JsonViewer/ViewerConfiguration.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.Configuration; 5 | 6 | namespace EPocalipse.Json.Viewer 7 | { 8 | public class ViewerConfiguration: ConfigurationSection 9 | { 10 | [ConfigurationProperty("plugins")] 11 | public KeyValueConfigurationCollection Plugins 12 | { 13 | get 14 | { 15 | return (KeyValueConfigurationCollection)base["plugins"]; 16 | } 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /JsonViewer/array.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-ailemon/JsonViewer/a5ab0070787710e15e6d9dd814293f4580d23ede/JsonViewer/array.bmp -------------------------------------------------------------------------------- /JsonViewer/btn.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-ailemon/JsonViewer/a5ab0070787710e15e6d9dd814293f4580d23ede/JsonViewer/btn.bmp -------------------------------------------------------------------------------- /JsonViewer/obj.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-ailemon/JsonViewer/a5ab0070787710e15e6d9dd814293f4580d23ede/JsonViewer/obj.bmp -------------------------------------------------------------------------------- /JsonViewer/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # JsonViewer介绍 2 | [![Apache 2.0 Licensed](https://img.shields.io/badge/License-Apache2.0-blue.svg?style=flat)](https://opensource.org/licenses/Apache-2.0) 3 | 4 | JsonViewer是一个.net平台下的json数据查看器,最早在[CodePlex](http://jsonviewer.codeplex.com/)开源,它包含了3个组件 5 | 1. 一个独立的winform查看器--JsonView.exe 6 | 2. Fiddler 2(http://www.fiddler2.com/)的插件 - FiddlerJsonViewer.dll 7 | 3. Visual Studio 2019 - JsonVisualizer.dll的可视化程序 8 | 9 | ## 感谢 10 | 再次感谢JsonViewer的原作者[eyalp](http://www.codeplex.com/site/users/view/eyalp) 11 | -------------------------------------------------------------------------------- /Samples/GridSample.txt: -------------------------------------------------------------------------------- 1 | { 2 | "grid": { 3 | "headers": [ 4 | { 5 | "name": "Name" 6 | }, 7 | { 8 | "name": "Count" 9 | } 10 | ], 11 | "rows": [ 12 | [ 13 | "Joe", 14 | 10 15 | ], 16 | [ 17 | "Jack", 18 | 20 19 | ] 20 | ] 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Samples/Sample1.txt: -------------------------------------------------------------------------------- 1 | { 2 | "name": "My Object", 3 | "Date 1": new Date(997612400000), 4 | "Date 2": "@997612400000@", 5 | "Custom Date": {"y":2007,"M":5,"d":28,"h":8,"m":0,"s":0,"ms":0}, 6 | "Double": 100.5, 7 | "array": [ 8 | 1, 9 | 1.5, 10 | "@997612400000@" 11 | ], 12 | "grid": { 13 | "headers": [ 14 | { 15 | "name": "Name" 16 | }, 17 | { 18 | "name": "Count" 19 | } 20 | ], 21 | "rows": [ 22 | [ 23 | "Joe", 24 | 10 25 | ], 26 | [ 27 | "Jack", 28 | 20 29 | ] 30 | ] 31 | } 32 | } -------------------------------------------------------------------------------- /Samples/Sample2.txt: -------------------------------------------------------------------------------- 1 | {"web-app": { 2 | "servlet": [ 3 | { 4 | "servlet-name": "cofaxCDS", 5 | "servlet-class": "org.cofax.cds.CDSServlet", 6 | "init-param": { 7 | "configGlossary:installationAt": "Philadelphia, PA", 8 | "configGlossary:adminEmail": "ksm@pobox.com", 9 | "configGlossary:poweredBy": "Cofax", 10 | "configGlossary:poweredByIcon": "/images/cofax.gif", 11 | "configGlossary:staticPath": "/content/static", 12 | "templateProcessorClass": "org.cofax.WysiwygTemplate", 13 | "templateLoaderClass": "org.cofax.FilesTemplateLoader", 14 | "templatePath": "templates", 15 | "templateOverridePath": "", 16 | "defaultListTemplate": "listTemplate.htm", 17 | "defaultFileTemplate": "articleTemplate.htm", 18 | "useJSP": false, 19 | "jspListTemplate": "listTemplate.jsp", 20 | "jspFileTemplate": "articleTemplate.jsp", 21 | "cachePackageTagsTrack": 200, 22 | "cachePackageTagsStore": 200, 23 | "cachePackageTagsRefresh": 60, 24 | "cacheTemplatesTrack": 100, 25 | "cacheTemplatesStore": 50, 26 | "cacheTemplatesRefresh": 15, 27 | "cachePagesTrack": 200, 28 | "cachePagesStore": 100, 29 | "cachePagesRefresh": 10, 30 | "cachePagesDirtyRead": 10, 31 | "searchEngineListTemplate": "forSearchEnginesList.htm", 32 | "searchEngineFileTemplate": "forSearchEngines.htm", 33 | "searchEngineRobotsDb": "WEB-INF/robots.db", 34 | "useDataStore": true, 35 | "dataStoreClass": "org.cofax.SqlDataStore", 36 | "redirectionClass": "org.cofax.SqlRedirection", 37 | "dataStoreName": "cofax", 38 | "dataStoreDriver": "com.microsoft.jdbc.sqlserver.SQLServerDriver", 39 | "dataStoreUrl": "jdbc:microsoft:sqlserver://LOCALHOST:1433;DatabaseName=goon", 40 | "dataStoreUser": "sa", 41 | "dataStorePassword": "dataStoreTestQuery", 42 | "dataStoreTestQuery": "SET NOCOUNT ON;select test='test';", 43 | "dataStoreLogFile": "/usr/local/tomcat/logs/datastore.log", 44 | "dataStoreInitConns": 10, 45 | "dataStoreMaxConns": 100, 46 | "dataStoreConnUsageLimit": 100, 47 | "dataStoreLogLevel": "debug", 48 | "maxUrlLength": 500}}, 49 | { 50 | "servlet-name": "cofaxEmail", 51 | "servlet-class": "org.cofax.cds.EmailServlet", 52 | "init-param": { 53 | "mailHost": "mail1", 54 | "mailHostOverride": "mail2"}}, 55 | { 56 | "servlet-name": "cofaxAdmin", 57 | "servlet-class": "org.cofax.cds.AdminServlet"}, 58 | 59 | { 60 | "servlet-name": "fileServlet", 61 | "servlet-class": "org.cofax.cds.FileServlet"}, 62 | { 63 | "servlet-name": "cofaxTools", 64 | "servlet-class": "org.cofax.cms.CofaxToolsServlet", 65 | "init-param": { 66 | "templatePath": "toolstemplates/", 67 | "log": 1, 68 | "logLocation": "/usr/local/tomcat/logs/CofaxTools.log", 69 | "logMaxSize": "", 70 | "dataLog": 1, 71 | "dataLogLocation": "/usr/local/tomcat/logs/dataLog.log", 72 | "dataLogMaxSize": "", 73 | "removePageCache": "/content/admin/remove?cache=pages&id=", 74 | "removeTemplateCache": "/content/admin/remove?cache=templates&id=", 75 | "fileTransferFolder": "/usr/local/tomcat/webapps/content/fileTransferFolder", 76 | "lookInContext": 1, 77 | "adminGroupID": 4, 78 | "betaServer": true}}], 79 | "servlet-mapping": { 80 | "cofaxCDS": "/", 81 | "cofaxEmail": "/cofaxutil/aemail/*", 82 | "cofaxAdmin": "/admin/*", 83 | "fileServlet": "/static/*", 84 | "cofaxTools": "/tools/*"}, 85 | 86 | "taglib": { 87 | "taglib-uri": "cofax.tld", 88 | "taglib-location": "/WEB-INF/tlds/cofax.tld"}}} 89 | -------------------------------------------------------------------------------- /Visualizer/JsonVisualizer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using Microsoft.VisualStudio.DebuggerVisualizers; 5 | using System.Diagnostics; 6 | 7 | [assembly: DebuggerVisualizer(typeof(EPocalipse.Json.Visualizer.JsonVisualizer), 8 | Target = typeof(string), Description = "JSON")] 9 | 10 | namespace EPocalipse.Json.Visualizer 11 | { 12 | public class JsonVisualizer : DialogDebuggerVisualizer 13 | { 14 | protected override void Show(IDialogVisualizerService windowService, 15 | IVisualizerObjectProvider objectProvider) 16 | { 17 | using (JsonVisualizerForm form = new JsonVisualizerForm()) 18 | { 19 | form.Viewer.Json = objectProvider.GetObject().ToString(); 20 | windowService.ShowDialog(form); 21 | } 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Visualizer/JsonVisualizer.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.50727 7 | 2.0 8 | {32BEAE8D-282C-4414-9B7F-2F0E9450369A} 9 | Library 10 | Properties 11 | EPocalipse.Json.Visualizer 12 | JsonVisualizer 13 | SAK 14 | SAK 15 | SAK 16 | SAK 17 | 18 | 19 | 3.5 20 | 21 | 22 | v4.5 23 | 24 | publish\ 25 | true 26 | Disk 27 | false 28 | Foreground 29 | 7 30 | Days 31 | false 32 | false 33 | true 34 | 0 35 | 1.0.0.%2a 36 | false 37 | false 38 | true 39 | 40 | 41 | true 42 | full 43 | false 44 | Bin\Debug\ 45 | DEBUG;TRACE 46 | prompt 47 | 4 48 | false 49 | 50 | 51 | pdbonly 52 | true 53 | ..\Bin\Visualizer\ 54 | TRACE 55 | prompt 56 | 4 57 | true 58 | false 59 | 60 | 61 | 62 | False 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | Form 74 | 75 | 76 | JsonVisualizerForm.cs 77 | 78 | 79 | 80 | 81 | 82 | {3AE264FB-52DC-4295-A37F-CE63CAF54930} 83 | JsonViewer 84 | 85 | 86 | 87 | 88 | Designer 89 | JsonVisualizerForm.cs 90 | 91 | 92 | 93 | 94 | False 95 | .NET Framework 3.5 SP1 96 | true 97 | 98 | 99 | 100 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /Visualizer/JsonVisualizerForm.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace EPocalipse.Json.Visualizer 2 | { 3 | partial class JsonVisualizerForm 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.Viewer = new EPocalipse.Json.Viewer.JsonViewer(); 32 | this.SuspendLayout(); 33 | // 34 | // Viewer 35 | // 36 | this.Viewer.Dock = System.Windows.Forms.DockStyle.Fill; 37 | this.Viewer.Json = null; 38 | this.Viewer.Location = new System.Drawing.Point(0, 0); 39 | this.Viewer.Name = "Viewer"; 40 | this.Viewer.Size = new System.Drawing.Size(875, 617); 41 | this.Viewer.TabIndex = 0; 42 | // 43 | // JsonVisualizerForm 44 | // 45 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 46 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 47 | this.ClientSize = new System.Drawing.Size(875, 617); 48 | this.Controls.Add(this.Viewer); 49 | this.MaximizeBox = false; 50 | this.MinimizeBox = false; 51 | this.Name = "JsonVisualizerForm"; 52 | this.Text = "JsonVisualizerForm"; 53 | this.ResumeLayout(false); 54 | 55 | } 56 | 57 | #endregion 58 | 59 | internal EPocalipse.Json.Viewer.JsonViewer Viewer; 60 | 61 | } 62 | } -------------------------------------------------------------------------------- /Visualizer/JsonVisualizerForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Text; 7 | using System.Windows.Forms; 8 | 9 | namespace EPocalipse.Json.Visualizer 10 | { 11 | public partial class JsonVisualizerForm : Form 12 | { 13 | public JsonVisualizerForm() 14 | { 15 | InitializeComponent(); 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /Visualizer/JsonVisualizerForm.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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /Visualizer/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("Visualizer")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Visualizer")] 13 | [assembly: AssemblyCopyright("Copyright © 2007")] 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("56ede389-7f59-438e-b80e-85840b7b6d71")] 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 Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | --------------------------------------------------------------------------------