diff --git a/CSE/App.config b/CSE/App.config index 64f37225efb61fd0517dde35420ed83e51fb2013..e6bcccabcc7bc70ee676c9ae05863f510546989f 100644 --- a/CSE/App.config +++ b/CSE/App.config @@ -1,6 +1,15 @@ <?xml version="1.0" encoding="utf-8" ?> <configuration> - <startup> - <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client" /> - </startup> + <runtime> + <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> + <dependentAssembly> + <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" + culture="neutral"/> + <bindingRedirect oldVersion="4.5.0.0" newVersion="6.0.0.0"/> + </dependentAssembly> + </assemblyBinding> + </runtime> + <startup> + <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client" /> + </startup> </configuration> \ No newline at end of file diff --git a/CSE/CSE.vbproj b/CSE/CSE.vbproj index 4948053db474c59c0fef8700e8ac5f8799b86681..c24326f47da2b738278af801e98403ea27e1af94 100644 --- a/CSE/CSE.vbproj +++ b/CSE/CSE.vbproj @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> + <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">x86</Platform> <ProductVersion> @@ -15,6 +16,21 @@ <MyType>WindowsForms</MyType> <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <TargetFrameworkProfile>Client</TargetFrameworkProfile> + <PublishUrl>publish\</PublishUrl> + <Install>true</Install> + <InstallFrom>Disk</InstallFrom> + <UpdateEnabled>false</UpdateEnabled> + <UpdateMode>Foreground</UpdateMode> + <UpdateInterval>7</UpdateInterval> + <UpdateIntervalUnits>Days</UpdateIntervalUnits> + <UpdatePeriodically>false</UpdatePeriodically> + <UpdateRequired>false</UpdateRequired> + <MapFileExtensions>true</MapFileExtensions> + <ApplicationRevision>0</ApplicationRevision> + <ApplicationVersion>1.0.0.%2a</ApplicationVersion> + <IsWebBootstrapper>false</IsWebBootstrapper> + <UseApplicationTrust>false</UseApplicationTrust> + <BootstrapperEnabled>true</BootstrapperEnabled> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> <PlatformTarget>x86</PlatformTarget> @@ -24,7 +40,9 @@ <DefineTrace>true</DefineTrace> <OutputPath>bin\Debug\</OutputPath> <DocumentationFile>CSE.xml</DocumentationFile> - <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn> + <NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036</NoWarn> + <WarningsAsErrors> + </WarningsAsErrors> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> <PlatformTarget>x86</PlatformTarget> @@ -34,7 +52,9 @@ <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> <DocumentationFile>CSE.xml</DocumentationFile> - <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn> + <NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036</NoWarn> + <WarningsAsErrors> + </WarningsAsErrors> </PropertyGroup> <PropertyGroup> <OptionExplicit>On</OptionExplicit> @@ -52,7 +72,8 @@ <ApplicationIcon>Resources\CSE.ico</ApplicationIcon> </PropertyGroup> <ItemGroup> - <Reference Include="Newtonsoft.Json"> + <Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> <HintPath>..\Libs\JSON.Net\Net40\Newtonsoft.Json.dll</HintPath> </Reference> <Reference Include="System" /> @@ -251,6 +272,28 @@ <ItemGroup> <None Include="Resources\Licencefile.png" /> </ItemGroup> + <ItemGroup> + <BootstrapperPackage Include=".NETFramework,Version=v4.0,Profile=Client"> + <Visible>False</Visible> + <ProductName>Microsoft .NET Framework 4 Client Profile %28x86 and x64%29</ProductName> + <Install>true</Install> + </BootstrapperPackage> + <BootstrapperPackage Include="Microsoft.Net.Client.3.5"> + <Visible>False</Visible> + <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName> + <Install>false</Install> + </BootstrapperPackage> + <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1"> + <Visible>False</Visible> + <ProductName>.NET Framework 3.5 SP1</ProductName> + <Install>false</Install> + </BootstrapperPackage> + <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1"> + <Visible>False</Visible> + <ProductName>Windows Installer 3.1</ProductName> + <Install>true</Install> + </BootstrapperPackage> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. diff --git a/CSE/Classes/cSettings.vb b/CSE/Classes/cSettings.vb index 85a31da10c7954dccd3d7002290d09e2681dec2a..d9eb9ec9763a20385522d9f6319313baeb3dd502 100644 --- a/CSE/Classes/cSettings.vb +++ b/CSE/Classes/cSettings.vb @@ -1,4 +1,6 @@ -Imports Newtonsoft.Json.Linq +Option Strict Off + +Imports Newtonsoft.Json.Linq Imports Newtonsoft.Json.Schema Public Class cSettings @@ -9,116 +11,124 @@ Public Class cSettings End Function - ' A 'true' | 'false' string used by json-schema validation, when false, more strict validation - Private schema_AllowsAdditionalProps As String + Public Json_Contents As JObject - Private Json_Contents As JObject ' Default-settings specified here. - Private ReadOnly JsonStr_Contents As String = <json>{ - "Header": { - "FileVersion": "1.0" - }, - "Body": { - "WorkingDir": null, - "WriteLog": true, - "LogSize": 2, - "LogLevel": 5, - "Editor": "notepad.exe", - } - }</json>.Value - - Private JSchema As JsonSchema - Private ReadOnly JSchemaStr As String = <json>{ + Function JsonStr_Contents() As String + Return <json>{ + "Header": { + "FileVersion": "1.0", + "Strict": false, + }, + "Body": { + "WorkingDir": null, + "WriteLog": true, + "LogSize": 2, + "LogLevel": 5, + "Editor": "notepad.exe", + } + }</json>.Value + End Function + + ''' <param name="allowsAdditionalProps">when false, more strict validation</param> + Function JSchemaStr(ByVal allowsAdditionalProps As Boolean) As String + Dim allowsAdditionalProps_str As String = IIf(allowsAdditionalProps, "false", "true") + Return <json>{ "title": "Vecto_cse-settings.ver1.0", - "type": "object", "AllowAdditionalProperties": <%= schema_AllowsAdditionalProps %>, - "required": ["Header", "Body"] + "type": "object", "AllowAdditionalProperties": <%= allowsAdditionalProps_str %>, "properties": { "Header": { - "type": "object", "AllowAdditionalProperties": <%= schema_AllowsAdditionalProps %>, - "required": ["FileVersion"] + "type": "object", "AllowAdditionalProperties": <%= allowsAdditionalProps_str %>, + "required": true, "properties": { - "FileVersion": {"type": "string"} + "FileVersion": { + "type": "string", + "required": true, + }, + "Strict": { + "type": "boolean", + "required": true, + "default": false, + } } }, "Body": { - "type": "object", "AllowAdditionalProperties": <%= schema_AllowsAdditionalProps %>, - "required": ["WorkingDir", "WriteLog", "LogSize", "LogLevel", "Editor"] + "type": "object", "AllowAdditionalProperties": <%= allowsAdditionalProps_str %>, + "required": true, "properties": { "WorkingDir": { - "type": "string", - "description": "Last used Working Directory Path for input/output files" (default: null - 'use app's dir')", + "type": ["string", "null"], + "required": false, + "default": null, + "description": "Last used Working Directory Path for input/output files, when null/empty, uses app's dir (default: null)", }, "WriteLog": { "type": "boolean", + "required": true, "description": "Whether to write messages to log file (default: true)", }, "LogSize": { - "type": "integer" + "type": "integer", + "required": true, "description": "Allowed Log-file size limit [MiB] (default: 2)", }, "LogLevel": { - "type": "integer" + "type": "integer", + "required": true, "description": "Message Output Level (default: 5 - 'info')", }, "Editor": { "type": "string", + "required": true, "description": "Path (or filename if in PATH) of some (text or JSON) editor (default: 'notepad.exe')", }, } } } }</json>.Value + End Function - ''' <summary> - ''' Reads from file or creates defaults - ''' </summary> + ''' <summary>Reads from file or creates defaults</summary> ''' <param name="inputFilePath">If unspecifed, default settings used, otherwise data read from file</param> - ''' <param name="isStrict">when True, no additional json-properties allowed in the data</param> ''' <remarks></remarks> - Friend Sub New(Optional ByVal inputFilePath As String = Nothing, Optional ByVal isStrict As Boolean = False) - Me.schema_AllowsAdditionalProps = IIf(isStrict, "false", "true") - Me.JSchema = JsonSchema.Parse(JSchemaStr) - - Dim validateMsgs As IList(Of String) = New List(Of String) - - If (inputFilePath Is Nothing) Then '' Read defaults - ReadAndValidateJsonText(JsonStr_Contents, JSchema, validateMsgs) - Else '' Read from file - Me.Json_Contents = ReadAndValidateJsonFile(inputFilePath, JSchema, validateMsgs) - fInfWarErr(7, False, format("Read Settings({0}).", inputFilePath)) - End If - - If (validateMsgs.Any()) Then - Throw New SystemException(format("Invalid Settings({0}) due to: \n\i{1}", inputFilePath, String.Join(vbCrLf, validateMsgs))) + Sub New(Optional ByVal inputFilePath As String = Nothing) + If (inputFilePath Is Nothing) Then + Me.Json_Contents = JObject.Parse(JsonStr_Contents()) + Else + Me.Json_Contents = ReadJsonFile(inputFilePath) End If End Sub - ' Writing to the config file + ''' <summary>Validates and Writing to the config file</summary> Sub Store(ByVal settings_fpath As String) - Dim basedir As String = System.IO.Path.GetDirectoryName(settings_fpath) + Validate(Me.Strict) + WriteJsonFile(settings_fpath, Json_Contents) + End Sub - If (Not System.IO.Directory.Exists(basedir)) Then - System.IO.Directory.CreateDirectory(basedir) - End If - ' Validate settings - ' - Dim jschema As JsonSchema = JsonSchema.Parse(JSchemaStr) - Json_Contents.Validate(jschema) + ''' <exception cref="SystemException">includes all validation errors</exception> + ''' <param name="isStrict">when True, no additional json-properties allowed in the data, when nothing, use value from Header</param> + Friend Sub Validate(Optional ByVal isStrict As Boolean? = Nothing) + Dim allowsAdditionalProps As Boolean = IIf(isStrict Is Nothing, Me.Strict, Not isStrict) + Dim schema = JsonSchema.Parse(JSchemaStr(allowsAdditionalProps)) + Dim validateMsgs As IList(Of String) = New List(Of String) - WriteJsonFile(settings_fpath, Json_Contents) + ValidateJson(Me.Json_Contents, schema, validateMsgs) - fInfWarErr(7, False, "Writting settings to file: " & settings_fpath) + If (validateMsgs.Any()) Then + Throw New SystemException(format("Invalid Settings due to: {0}", String.Join(vbCrLf, validateMsgs))) + End If End Sub + Public Overrides Function Equals(ByVal obj As Object) As Boolean If obj Is Nothing OrElse Not Me.GetType().Equals(obj.GetType()) Then Return False Else - Return Me.Json_Contents.Equals(obj.Json_Contents) + Return Me.Json_Contents.Equals(DirectCast(obj, cSettings).Json_Contents) End If End Function @@ -130,20 +140,58 @@ Public Class cSettings End Get End Property + Public ReadOnly Property Strict As Boolean + Get + Return Me.Json_Contents("Header")("Strict") + End Get + End Property + + Public Property WorkingDir As String Get Dim value As String = Me.Json_Contents("Body")("WorkingDir") - If value Is Nothing Or value.Trim().Length = 0 Then + If value Is Nothing OrElse value.Trim().Length = 0 Then value = MyPath End If Return value End Get Set(ByVal value As String) - If Not value Is Nothing And value.Trim().Length = 0 Then - value = Nothing + If value IsNot Nothing Then + '' Convert emtpy-paths into MyPath and store them as null. + '' + value = value.Trim() + If value.Length = 0 Then + value = Nothing + Else + '' Convert MyPath-prefixed paths into relative ones. + '' + Dim myPlainPath = IO.Path.GetFullPath(StripBackslash(MyPath)) + value = IO.Path.GetFullPath(value) + If value.StartsWith(myPlainPath, StringComparison.OrdinalIgnoreCase) Then + value = value.Substring(myPlainPath.Length) + If (value.Last <> "\"c) Then + value = value & "\" + End If + + If value.Length = 1 Then + value = Nothing + End If + End If + + '' Store MyPath as null. + '' + If String.Equals(value, MyPath, StringComparison.OrdinalIgnoreCase) Then + value = Nothing + End If + End If + End If + + If value Is Nothing Then + Me.Json_Contents("Body")("WorkingDir") = Nothing + Else + Me.Json_Contents("Body")("WorkingDir") = value End If - Me.Json_Contents("Body")("WorkingDir") = value End Set End Property @@ -179,6 +227,10 @@ Public Class cSettings Return Me.Json_Contents("Body")("Editor") End Get Set(ByVal value As String) + If value Is Nothing OrElse value.Trim().Length = 0 Then + value = "notepad.exe" + End If + Me.Json_Contents("Body")("Editor") = value End Set End Property diff --git a/CSE/GUI/CSEMain.vb b/CSE/GUI/CSEMain.vb index 90d3c0e8e0d792cc77681202bd0ffa43a3dfc464..369f49962f48c661b2ddc33c40197cc812e08c5b 100644 --- a/CSE/GUI/CSEMain.vb +++ b/CSE/GUI/CSEMain.vb @@ -29,9 +29,11 @@ Public Class CSEMain ' Dim settings_fpath = cSettings.SettingsPath() Try - AppSettings = New cSettings(settings_fpath) + Dim fileSettings As New cSettings(settings_fpath) + fileSettings.Validate() + AppSettings = fileSettings Catch ex As Exception - fInfWarErr(9, False, format("Failed reading Settings({0}) due to: {1}", settings_fpath, ex.Message)) + fInfWarErr(9, False, format("Failed loading Settings({0}) due to: {1}", settings_fpath, ex.Message)) configL = False End Try @@ -42,9 +44,8 @@ Public Class CSEMain ' Polling if the working dir exist (If not then generate the folder) ' - Dim wd_fPath As String = MyPath & AppSettings.WorkingDir - If Not IO.Directory.Exists(wd_fPath) Then - MkDir(wd_fPath) + If Not IO.Directory.Exists(AppSettings.WorkingDir) Then + IO.Directory.CreateDirectory(AppSettings.WorkingDir) End If ' Write the beginning in the AppSettings.WriteLog @@ -61,8 +62,9 @@ Public Class CSEMain If Not configL Then Try AppSettings.Store(settings_fpath) + fInfWarErr(7, False, format("Created Settings({0}).", settings_fpath)) Catch ex As Exception - fInfWarErr(9, False, format("Failed writting settings({0} due to: {1}", settings_fpath, ex.Message)) + fInfWarErr(9, False, format("Failed storing Settings({0}) due to: {1}", settings_fpath, ex.Message)) End Try End If End Sub diff --git a/CSE/GUI/CSE_Config.designer.vb b/CSE/GUI/CSE_Config.designer.vb index fe243a8dd262ba77f443e36bb4db2e91c4b7828b..073be3d3f19f27cf45b27813ba123d0163f9786f 100644 --- a/CSE/GUI/CSE_Config.designer.vb +++ b/CSE/GUI/CSE_Config.designer.vb @@ -22,6 +22,7 @@ Partial Class CSE_Config 'Das Bearbeiten mit dem Code-Editor ist nicht möglich. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(CSE_Config)) Me.TextBoxWorDir = New System.Windows.Forms.TextBox() Me.ButtonSelectWorDir = New System.Windows.Forms.Button() Me.GroupBoxWorDir = New System.Windows.Forms.GroupBox() @@ -164,8 +165,8 @@ Partial Class CSE_Config 'TabControl1 ' Me.TabControl1.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ - Or System.Windows.Forms.AnchorStyles.Left) _ - Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.TabControl1.Controls.Add(Me.TabPage2) Me.TabControl1.Location = New System.Drawing.Point(3, 3) Me.TabControl1.Name = "TabControl1" @@ -195,7 +196,7 @@ Partial Class CSE_Config Me.GroupBoxNotepad.Size = New System.Drawing.Size(490, 51) Me.GroupBoxNotepad.TabIndex = 3 Me.GroupBoxNotepad.TabStop = False - Me.GroupBoxNotepad.Text = "Notepad Directory" + Me.GroupBoxNotepad.Text = "Editor" ' 'ButtonSelectNotepad ' @@ -214,7 +215,7 @@ Partial Class CSE_Config Me.TextBoxNotepad.Size = New System.Drawing.Size(444, 20) Me.TextBoxNotepad.TabIndex = 1 ' - 'VECTO_Config + 'CSE_Config ' Me.AcceptButton = Me.ButtonOK Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) @@ -225,10 +226,11 @@ Partial Class CSE_Config Me.Controls.Add(Me.ButtonCancel) Me.Controls.Add(Me.ButtonOK) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) Me.MaximizeBox = False Me.MinimizeBox = False Me.MinimumSize = New System.Drawing.Size(521, 294) - Me.Name = "VECTO_Config" + Me.Name = "CSE_Config" Me.Text = "Settings" Me.GroupBoxWorDir.ResumeLayout(False) Me.GroupBoxWorDir.PerformLayout() diff --git a/CSE/GUI/CSE_Config.resx b/CSE/GUI/CSE_Config.resx index d58980a38d71402abe7cf7bbbdeb69d761a29c47..deeb9a4c76f2c5f61d7085275b29bc137c5a6b0c 100644 --- a/CSE/GUI/CSE_Config.resx +++ b/CSE/GUI/CSE_Config.resx @@ -117,4 +117,44 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> + <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> + <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value> + AAABAAEAIA8AAAEAIADkBwAAFgAAACgAAAAgAAAAHgAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAD+/v6v////////////////v7/U/3Z2yP9OTsv/Tk7L/2Zmx/+qqs/////4////////////2NjY/7W1 + tf+srKz/rKys/62trf+/v7//9PT0//////////////////X1+f+Ojsf/hYXK/4iIzP+IiMz/iIjM/4iI + zP+Cgsf/wsLj//7+/qP/////6eni/0lJuv8AANz/AAD+/wAA//8AAP//AAD//wAA7f8lJbn/6Ojo/7y8 + uv+bm5v/u7u7/76+vv+7u7v/wMDA/7CwsP+Xl5f/0NDQ////////////iIi4/wAA4f8AAPf/AAD//wAA + //8AAP//AAD//wAA/v8zM8T//v7+o///+v8/P7j/AAD7/wAA//8AAOv/JCS+/zs7tP8tLbz/AADe/wAA + 2v+3t8j/ra2m/6ampv+ampr/m5ub/6CgoP+ampr/vLy8/8XFxf+Wlpb/5+fn//////+Cgrv/AADx/wAA + //8WFsL/MzO7/zMzu/8zM7v/NDS7/4aGxv/+/v6juLjV/wAA4/8AAP//AADl/4qKvP/39+P////y//7+ + 6f/Dw8//XV2p/93d5//IyMb/q6ur/+Pj4//8/Pz//////+jo6P+ampr/xMTE/6Wlpf+4uLj//////4SE + u/8AAPD/AAD6/3BwrP////D////w////8P////D////9//7+9aNfX8j/AAD//wAA/f9MTLb////4//// + ////////////////////////////////////////////////////////+vr6/5iYmP/AwMD/rq6u/62t + rf//////hIS7/wAA8P8AAPr/b2+6////////////////////////////8vLZozY20f8AAP//AADo/5yc + vv///////////////////////////////////////////////////////Pz8/83Nzf+goKD/s7Oz/8fH + x/+jo6P/vLy8//////+EhLv/AADw/wAA+v9wcK3////x////8v////H////6///////c3MujIiLY/wAA + //8AANr/vr7H/////////////////////////////////////////////////9LS0v+bm5v/nJyc/7q6 + uv/Jycn/ubm5/5qamv/y8vL//////4SEu/8AAO//AAD+/xsbwv9CQrj/Pz+9/zs7uv9VVa//+/v3/97e + zaMkJNf/AAD//wAA3f+2tsb////////////////////////////////////////////Dw8P/mZmZ/7u7 + u//Kysr/vr6+/6Kiov+dnZ3/5eXl////////////hIS7/wAA7v8AAP//AAD//wAA+f8AAPn/AAD6/wAA + vf/z8+v/9fXcozk50P8AAP//AADp/5eXvv//////////////////////////////////////4eHh/5WV + lf/FxcX/w8PD/6Ojo/+ampr/v7+///j4+P////////////////+EhLv/AADv/wAA/f8zM67/d3e2/3Z2 + uv9zc7j/kZG+/////f/+/vijamrI/wAA/f8AAPv/WFi2////+/////////////////////////////// + //+3t7j/pqam/8bGxv+ioqL/wsLC//n5+f///////////////////////////4SEu/8AAPD/AAD6/3V1 + tv////////////////////////////7+/qPJydr/AADc/wAA//8EBNv/sLDC////9//////////7/+Li + 3v+Dg7L/7+/z/7y8u/+oqKj/wsLC/5WVlf/////////////////m5ub/5ubm////////////hIS7/wAA + 8P8AAPr/dna2/////////////////////////////v7+o////f9QULj/AAD4/wAA//8DA9n/Vla1/3p6 + uP9cXLX/ExPN/wAAy//Hx9L/4uLe/5iYmP/Ly8v/qamp/6qqqv+5ubn/p6en/5SUlP+YmJj///////// + //+Dg7v/AADw/wAA/f80NK//eXm4/3l5uP95ebj/eXm4/7W10f/+/v6j//////Dw5v9ISLv/AADi/wAA + //8AAP//AAD//wAA//8AAP//CgrA/93d2v//////ra2t/6Ghof/Dw8P/tra2/6ysrP+3t7f/tbW1/5ub + m//+/v7//////4CAt/8AAPD/AAD//wAA//8AAP3/AAD9/wAA/f8AAP3/OzvA//7+/q////////////// + //+ystP/WVnI/y4u1P8hIdv/NjbR/29vx//d3eb/////////////////z8/P/62trf+tra3/r6+v/6ys + rP+wsLD/8PDw////////////4ODr/1JSxf9DQ87/RkbR/0ZG0f9GRtH/RkbR/0FBzP+goNz//v7+aP7+ + /qP+/v6j/v7+o/7+/qP+/vGj6enTo9nZy6Px8dij/v77o/7+/qP+/v6j/v7+o/7+/qP+/v6j8vLyo9DQ + 0KPKysqj3t7eo/7+/qP+/v6j/v7+o/7+/qP+/v6j/v7to/7+4aP+/uOj/v7jo/7+46P+/uOj/v7ho/7+ + /qMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAA + AAA= +</value> + </data> </root> \ No newline at end of file diff --git a/CSE/GUI/CSE_Config.vb b/CSE/GUI/CSE_Config.vb index b4d2c00099cae8fb80217e1e4c339379ca57cf2e..00d290ee8f98adb2d7e767c317f236c1ea8093ce 100644 --- a/CSE/GUI/CSE_Config.vb +++ b/CSE/GUI/CSE_Config.vb @@ -20,6 +20,7 @@ Public Class CSE_Config Private Function settings_PopulateTo() As cSettings Dim value = New cSettings() + value.Validate() value.WorkingDir = Me.TextBoxWorDir.Text value.Editor = Me.TextBoxNotepad.Text @@ -52,11 +53,11 @@ Public Class CSE_Config ' Message for the restart of VECTO RestartN = True - fInfWarErr(7, False, "Settings changed. Please restart to use the new settings!") ' XXX: Why double-log for restartng-vecto here?? - fInfWarErr(7, True, format("Settings changed. Please restart to use the new settings!\n Do you want to restart VECTO now?")) + fInfWarErr(7, False, "Settings changed. Please restart to use the new Settings!") ' XXX: Why double-log for restartng-vecto here?? + fInfWarErr(7, True, format("Settings changed. Please restart to use the new Settings!\n Do you want to restart VECTO now?")) Catch ex As Exception - fInfWarErr(9, False, format("Failed writting settings({0} due to: {1}", settings_fpath, ex.Message)) + fInfWarErr(9, False, format("Failed storing Settings({0}) due to: {1} \n Settings left unmodified!", settings_fpath, ex.Message)) End Try End If @@ -71,8 +72,8 @@ Public Class CSE_Config ' Select the Notepad path Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonSelectNotepad.Click - If fbWorkDir.OpenDialog(Me.TextBoxWorDir.Text) Then - Me.TextBoxNotepad.Text = fbWorkDir.Files(0) + If fbExe.OpenDialog(Me.TextBoxWorDir.Text) Then + Me.TextBoxNotepad.Text = fbExe.Files(0) End If End Sub diff --git a/CSE/GUI/CSE_Info.Designer.vb b/CSE/GUI/CSE_Info.Designer.vb index 86e521f23518231eb49f9618863cba9866835284..62f19cc7bb6315116d9ca3910ab4c0e5a678242a 100644 --- a/CSE/GUI/CSE_Info.Designer.vb +++ b/CSE/GUI/CSE_Info.Designer.vb @@ -22,6 +22,7 @@ Partial Class CSE_Info 'Das Bearbeiten mit dem Code-Editor ist nicht möglich. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(CSE_Info)) Me.Label1 = New System.Windows.Forms.Label() Me.Label3 = New System.Windows.Forms.Label() Me.Label5 = New System.Windows.Forms.Label() @@ -127,7 +128,7 @@ Partial Class CSE_Info Me.Label8.Size = New System.Drawing.Size(158, 65) Me.Label8.TabIndex = 3 Me.Label8.Text = "European Commission" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "DG CLIMA" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "and" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "Joint Research Centre" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "Sustainable Transport " & _ - "Unit" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) + "Unit" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) ' 'PictureBoxJRC ' @@ -278,6 +279,7 @@ Partial Class CSE_Info Me.Controls.Add(Me.Label3) Me.Controls.Add(Me.Label1) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) Me.MaximumSize = New System.Drawing.Size(480, 591) Me.MinimumSize = New System.Drawing.Size(480, 591) Me.Name = "CSE_Info" diff --git a/CSE/GUI/CSE_Info.resx b/CSE/GUI/CSE_Info.resx index d58980a38d71402abe7cf7bbbdeb69d761a29c47..deeb9a4c76f2c5f61d7085275b29bc137c5a6b0c 100644 --- a/CSE/GUI/CSE_Info.resx +++ b/CSE/GUI/CSE_Info.resx @@ -117,4 +117,44 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> + <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> + <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value> + AAABAAEAIA8AAAEAIADkBwAAFgAAACgAAAAgAAAAHgAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAD+/v6v////////////////v7/U/3Z2yP9OTsv/Tk7L/2Zmx/+qqs/////4////////////2NjY/7W1 + tf+srKz/rKys/62trf+/v7//9PT0//////////////////X1+f+Ojsf/hYXK/4iIzP+IiMz/iIjM/4iI + zP+Cgsf/wsLj//7+/qP/////6eni/0lJuv8AANz/AAD+/wAA//8AAP//AAD//wAA7f8lJbn/6Ojo/7y8 + uv+bm5v/u7u7/76+vv+7u7v/wMDA/7CwsP+Xl5f/0NDQ////////////iIi4/wAA4f8AAPf/AAD//wAA + //8AAP//AAD//wAA/v8zM8T//v7+o///+v8/P7j/AAD7/wAA//8AAOv/JCS+/zs7tP8tLbz/AADe/wAA + 2v+3t8j/ra2m/6ampv+ampr/m5ub/6CgoP+ampr/vLy8/8XFxf+Wlpb/5+fn//////+Cgrv/AADx/wAA + //8WFsL/MzO7/zMzu/8zM7v/NDS7/4aGxv/+/v6juLjV/wAA4/8AAP//AADl/4qKvP/39+P////y//7+ + 6f/Dw8//XV2p/93d5//IyMb/q6ur/+Pj4//8/Pz//////+jo6P+ampr/xMTE/6Wlpf+4uLj//////4SE + u/8AAPD/AAD6/3BwrP////D////w////8P////D////9//7+9aNfX8j/AAD//wAA/f9MTLb////4//// + ////////////////////////////////////////////////////////+vr6/5iYmP/AwMD/rq6u/62t + rf//////hIS7/wAA8P8AAPr/b2+6////////////////////////////8vLZozY20f8AAP//AADo/5yc + vv///////////////////////////////////////////////////////Pz8/83Nzf+goKD/s7Oz/8fH + x/+jo6P/vLy8//////+EhLv/AADw/wAA+v9wcK3////x////8v////H////6///////c3MujIiLY/wAA + //8AANr/vr7H/////////////////////////////////////////////////9LS0v+bm5v/nJyc/7q6 + uv/Jycn/ubm5/5qamv/y8vL//////4SEu/8AAO//AAD+/xsbwv9CQrj/Pz+9/zs7uv9VVa//+/v3/97e + zaMkJNf/AAD//wAA3f+2tsb////////////////////////////////////////////Dw8P/mZmZ/7u7 + u//Kysr/vr6+/6Kiov+dnZ3/5eXl////////////hIS7/wAA7v8AAP//AAD//wAA+f8AAPn/AAD6/wAA + vf/z8+v/9fXcozk50P8AAP//AADp/5eXvv//////////////////////////////////////4eHh/5WV + lf/FxcX/w8PD/6Ojo/+ampr/v7+///j4+P////////////////+EhLv/AADv/wAA/f8zM67/d3e2/3Z2 + uv9zc7j/kZG+/////f/+/vijamrI/wAA/f8AAPv/WFi2////+/////////////////////////////// + //+3t7j/pqam/8bGxv+ioqL/wsLC//n5+f///////////////////////////4SEu/8AAPD/AAD6/3V1 + tv////////////////////////////7+/qPJydr/AADc/wAA//8EBNv/sLDC////9//////////7/+Li + 3v+Dg7L/7+/z/7y8u/+oqKj/wsLC/5WVlf/////////////////m5ub/5ubm////////////hIS7/wAA + 8P8AAPr/dna2/////////////////////////////v7+o////f9QULj/AAD4/wAA//8DA9n/Vla1/3p6 + uP9cXLX/ExPN/wAAy//Hx9L/4uLe/5iYmP/Ly8v/qamp/6qqqv+5ubn/p6en/5SUlP+YmJj///////// + //+Dg7v/AADw/wAA/f80NK//eXm4/3l5uP95ebj/eXm4/7W10f/+/v6j//////Dw5v9ISLv/AADi/wAA + //8AAP//AAD//wAA//8AAP//CgrA/93d2v//////ra2t/6Ghof/Dw8P/tra2/6ysrP+3t7f/tbW1/5ub + m//+/v7//////4CAt/8AAPD/AAD//wAA//8AAP3/AAD9/wAA/f8AAP3/OzvA//7+/q////////////// + //+ystP/WVnI/y4u1P8hIdv/NjbR/29vx//d3eb/////////////////z8/P/62trf+tra3/r6+v/6ys + rP+wsLD/8PDw////////////4ODr/1JSxf9DQ87/RkbR/0ZG0f9GRtH/RkbR/0FBzP+goNz//v7+aP7+ + /qP+/v6j/v7+o/7+/qP+/vGj6enTo9nZy6Px8dij/v77o/7+/qP+/v6j/v7+o/7+/qP+/v6j8vLyo9DQ + 0KPKysqj3t7eo/7+/qP+/v6j/v7+o/7+/qP+/v6j/v7to/7+4aP+/uOj/v7jo/7+46P+/uOj/v7ho/7+ + /qMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAA + AAA= +</value> + </data> </root> \ No newline at end of file diff --git a/CSE/Tools/ApplicationEvents.vb b/CSE/Tools/ApplicationEvents.vb index 3de3e31dccb969d1c35b7eba49f14eb909187952..36ec3c241f6df53b31e99321b01bc3828aa1221c 100644 --- a/CSE/Tools/ApplicationEvents.vb +++ b/CSE/Tools/ApplicationEvents.vb @@ -29,18 +29,19 @@ ' Declaration Dim fiAss As New IO.FileInfo(joinPaths(Application.Info.DirectoryPath, Application.Info.AssemblyName & ".exe")) - ' compile date - AppDate = fiAss.LastWriteTime.Date - - ' Path to the *.exe MyPath = My.Application.Info.DirectoryPath & "\" - ' Generateion of folder for the file history if not exists FB_FilHisDir = joinPaths(MyPath, "config", "fileHistory\") If Not IO.Directory.Exists(FB_FilHisDir) Then IO.Directory.CreateDirectory(FB_FilHisDir) + ' compile date + AppDate = fiAss.LastWriteTime.Date + + AppSettings = New cSettings() + ''AppSettings.Validate() !!!Skip schema-validation here, or else app hangs as zombie! (do it instead when creating new for Dialog) + ' Licencemodul Lic.FilePath = joinPaths(MyPath, "License.dat") Lic.AppVersion = AppVers @@ -52,6 +53,9 @@ fbTXT = New cFileBrowser("TXT") fbTXT.Extensions = New String() {"txt"} + fbExe = New cFileBrowser("EXE") + fbExe.Extensions = New String() {"exe"} + fbCSV = New cFileBrowser("CSV") fbCSV.Extensions = New String() {"csv", "txt"} diff --git a/CSE/Tools/Minor_routines.vb b/CSE/Tools/Minor_routines.vb index f63d016eaad08ecf66b46befec3f10286da5cfd7..2debd428367e1eafdeabdfaa0461a9a903fa8885 100644 --- a/CSE/Tools/Minor_routines.vb +++ b/CSE/Tools/Minor_routines.vb @@ -64,6 +64,16 @@ Module Minor_routines Return obj.Aggregate(Function(x, y) IO.Path.Combine(x.ToString(), y.ToString())) End Function + Function StripBackslash(ByVal path As String) As String + If path Is Nothing Then + Return Nothing + ElseIf (path.Last = "\"c) Then + Return path.Substring(0, path.Length - 1) + Else + Return path + End If + End Function + #End Region ' File paths' ' Function for a linear interpolation @@ -266,7 +276,7 @@ Module Minor_routines #End Region -#Region "Json IO" +#Region "Json" Function ReadJsonFile(ByVal path As String) As JObject Dim jobj As New JObject @@ -282,7 +292,7 @@ Module Minor_routines Dim validator As New JsonValidatingReader(New JsonTextReader(reader)) validator.Schema = jschema - AddHandler validator.ValidationEventHandler, Sub(o, a) validationMsgs.Add(a.Message) + AddHandler validator.ValidationEventHandler, Sub(o, a) validationMsgs.Add(format("{0}-->{1}", a.Path, a.Message)) Dim jobj As JObject = JObject.ReadFrom(validator) @@ -295,7 +305,7 @@ Module Minor_routines Dim validator As New JsonValidatingReader(New JsonTextReader(reader)) validator.Schema = jschema - AddHandler validator.ValidationEventHandler, Sub(o, a) validationMsgs.Add(a.Message) + AddHandler validator.ValidationEventHandler, Sub(o, a) validationMsgs.Add(format("{0}-->{1}", a.Path, a.Message)) Dim jobj As JObject = JObject.ReadFrom(validator) @@ -303,6 +313,10 @@ Module Minor_routines End Using End Function + Sub ValidateJson(ByVal json As JObject, ByVal jschema As JsonSchema, ByVal validationMsgs As IList(Of String)) + json.Validate(jschema, Sub(o, a) validationMsgs.Add(format("{0}-->{1}", a.Path, a.Message))) + End Sub + Sub WriteJsonFile(ByVal path As String, ByVal content As Object, Optional ByVal formatting As Formatting = Formatting.Indented) Dim jser As New JsonSerializer jser.Formatting = formatting @@ -329,7 +343,7 @@ Module Minor_routines Return value End Function -#End Region ' "Json IO" +#End Region ' "Json" #Region "Strings" diff --git a/CSE/declaration_public.vb b/CSE/declaration_public.vb index a0d29e3ce6195bcf0f16ceaf00e2560feca929f1..9eabd9eb44d75ac45587f05dfa4f4d44794baaa1 100644 --- a/CSE/declaration_public.vb +++ b/CSE/declaration_public.vb @@ -88,7 +88,7 @@ Public GradC As Boolean = False ' Variable for the gradient correction Public AppSettingsFName As String = "settings.json" - Public AppSettings As cSettings = New cSettings() ' Default settings + Public AppSettings As cSettings 'File browser Public FB_Drives() As String @@ -101,6 +101,7 @@ Public fbCSV As cFileBrowser Public fbDir As cFileBrowser Public fbWorkDir As cFileBrowser + Public fbExe As cFileBrowser Public fbVEH As cFileBrowser Public fbAMB As cFileBrowser Public fbALT As cFileBrowser diff --git a/Libs/JSON.Net/Net40/Newtonsoft.Json.dll b/Libs/JSON.Net/Net40/Newtonsoft.Json.dll index 446b8781e981a74417fbf6d759548de7a35309d4..054c933790f0902868b9b8aee57eabb907859f38 100644 Binary files a/Libs/JSON.Net/Net40/Newtonsoft.Json.dll and b/Libs/JSON.Net/Net40/Newtonsoft.Json.dll differ diff --git a/Libs/JSON.Net/Net40/Newtonsoft.Json.xml b/Libs/JSON.Net/Net40/Newtonsoft.Json.xml index 6f5cd80056a915c6d71c150534e3c04d32f4b7e3..eed2aee4f97af65df4850044da8bd63e585927f4 100644 --- a/Libs/JSON.Net/Net40/Newtonsoft.Json.xml +++ b/Libs/JSON.Net/Net40/Newtonsoft.Json.xml @@ -116,6 +116,15 @@ the reader is closed; otherwise false. The default is true. </value> </member> + <member name="P:Newtonsoft.Json.JsonReader.SupportMultipleContent"> + <summary> + Gets or sets a value indicating whether multiple pieces of JSON content can + be read from a continuous stream without erroring. + </summary> + <value> + true to support reading multiple pieces of JSON content; otherwise false. The default is false. + </value> + </member> <member name="P:Newtonsoft.Json.JsonReader.QuoteChar"> <summary> Gets the quotation mark character used to enclose the value of a string. @@ -136,6 +145,11 @@ Get or set how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. </summary> </member> + <member name="P:Newtonsoft.Json.JsonReader.DateFormatString"> + <summary> + Get or set how custom date formatted strings are parsed when reading JSON. + </summary> + </member> <member name="P:Newtonsoft.Json.JsonReader.MaxDepth"> <summary> Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a <see cref="T:Newtonsoft.Json.JsonReaderException"/>. @@ -1236,6 +1250,38 @@ <c>true</c> if this instance can convert the specified object type; otherwise, <c>false</c>. </returns> </member> + <member name="T:Newtonsoft.Json.Converters.DiscriminatedUnionConverter"> + <summary> + Converts a F# discriminated union type to and from JSON. + </summary> + </member> + <member name="M:Newtonsoft.Json.Converters.DiscriminatedUnionConverter.WriteJson(Newtonsoft.Json.JsonWriter,System.Object,Newtonsoft.Json.JsonSerializer)"> + <summary> + Writes the JSON representation of the object. + </summary> + <param name="writer">The <see cref="T:Newtonsoft.Json.JsonWriter"/> to write to.</param> + <param name="value">The value.</param> + <param name="serializer">The calling serializer.</param> + </member> + <member name="M:Newtonsoft.Json.Converters.DiscriminatedUnionConverter.ReadJson(Newtonsoft.Json.JsonReader,System.Type,System.Object,Newtonsoft.Json.JsonSerializer)"> + <summary> + Reads the JSON representation of the object. + </summary> + <param name="reader">The <see cref="T:Newtonsoft.Json.JsonReader"/> to read from.</param> + <param name="objectType">Type of the object.</param> + <param name="existingValue">The existing value of object being read.</param> + <param name="serializer">The calling serializer.</param> + <returns>The object value.</returns> + </member> + <member name="M:Newtonsoft.Json.Converters.DiscriminatedUnionConverter.CanConvert(System.Type)"> + <summary> + Determines whether this instance can convert the specified object type. + </summary> + <param name="objectType">Type of the object.</param> + <returns> + <c>true</c> if this instance can convert the specified object type; otherwise, <c>false</c>. + </returns> + </member> <member name="T:Newtonsoft.Json.Converters.EntityKeyMemberConverter"> <summary> Converts an Entity Framework EntityKey to and from JSON. @@ -1409,6 +1455,11 @@ Converts an <see cref="T:System.Enum"/> to and from its name string value. </summary> </member> + <member name="M:Newtonsoft.Json.Converters.StringEnumConverter.#ctor"> + <summary> + Initializes a new instance of the <see cref="T:Newtonsoft.Json.Converters.StringEnumConverter"/> class. + </summary> + </member> <member name="M:Newtonsoft.Json.Converters.StringEnumConverter.WriteJson(Newtonsoft.Json.JsonWriter,System.Object,Newtonsoft.Json.JsonSerializer)"> <summary> Writes the JSON representation of the object. @@ -1442,6 +1493,12 @@ </summary> <value><c>true</c> if the written enum text will be camel case; otherwise, <c>false</c>.</value> </member> + <member name="P:Newtonsoft.Json.Converters.StringEnumConverter.AllowIntegerValues"> + <summary> + Gets or sets a value indicating whether integer values are allowed. + </summary> + <value><c>true</c> if integers are allowed; otherwise, <c>false</c>.</value> + </member> <member name="T:Newtonsoft.Json.ConstructorHandling"> <summary> Specifies how constructors are used when initializing objects during deserialization by the <see cref="T:Newtonsoft.Json.JsonSerializer"/>. @@ -1727,7 +1784,44 @@ </member> <member name="T:Newtonsoft.Json.JsonExtensionDataAttribute"> <summary> - Instructs the <see cref="T:Newtonsoft.Json.JsonSerializer"/> to populate properties with no matching class member onto the specified collection. + Instructs the <see cref="T:Newtonsoft.Json.JsonSerializer"/> to deserialize properties with no matching class member into the specified collection + and write values during serialization. + </summary> + </member> + <member name="M:Newtonsoft.Json.JsonExtensionDataAttribute.#ctor"> + <summary> + Initializes a new instance of the <see cref="T:Newtonsoft.Json.JsonExtensionDataAttribute"/> class. + </summary> + </member> + <member name="P:Newtonsoft.Json.JsonExtensionDataAttribute.WriteData"> + <summary> + Gets or sets a value that indicates whether to write extension data when serializing the object. + </summary> + <value> + <c>true</c> to write extension data when serializing the object; otherwise, <c>false</c>. The default is <c>true</c>. + </value> + </member> + <member name="P:Newtonsoft.Json.JsonExtensionDataAttribute.ReadData"> + <summary> + Gets or sets a value that indicates whether to read extension data when deserializing the object. + </summary> + <value> + <c>true</c> to read extension data when deserializing the object; otherwise, <c>false</c>. The default is <c>true</c>. + </value> + </member> + <member name="T:Newtonsoft.Json.MetadataPropertyHandling"> + <summary> + Specifies metadata property handling options for the <see cref="T:Newtonsoft.Json.JsonSerializer"/>. + </summary> + </member> + <member name="F:Newtonsoft.Json.MetadataPropertyHandling.Default"> + <summary> + Read metadata properties located at the start of a JSON object. + </summary> + </member> + <member name="F:Newtonsoft.Json.MetadataPropertyHandling.ReadAhead"> + <summary> + Read metadata properties located anywhere in a JSON object. Note that this setting will impact performance. </summary> </member> <member name="T:Newtonsoft.Json.Serialization.DiagnosticsTraceWriter"> @@ -2267,6 +2361,13 @@ <param name="value">The value.</param> <returns>The result of the conversion.</returns> </member> + <member name="M:Newtonsoft.Json.Linq.JToken.op_Explicit(Newtonsoft.Json.Linq.JToken)~System.SByte"> + <summary> + Performs an explicit conversion from <see cref="T:Newtonsoft.Json.Linq.JToken"/> to <see cref="T:System.SByte"/>. + </summary> + <param name="value">The value.</param> + <returns>The result of the conversion.</returns> + </member> <member name="M:Newtonsoft.Json.Linq.JToken.op_Explicit(Newtonsoft.Json.Linq.JToken)~System.Nullable{System.Int32}"> <summary> Performs an explicit conversion from <see cref="T:Newtonsoft.Json.Linq.JToken"/> to <see cref="T:System.Nullable`1"/>. @@ -2295,6 +2396,13 @@ <param name="value">The value.</param> <returns>The result of the conversion.</returns> </member> + <member name="M:Newtonsoft.Json.Linq.JToken.op_Explicit(Newtonsoft.Json.Linq.JToken)~System.Nullable{System.SByte}"> + <summary> + Performs an explicit conversion from <see cref="T:Newtonsoft.Json.Linq.JToken"/> to <see cref="T:System.Nullable`1"/>. + </summary> + <param name="value">The value.</param> + <returns>The result of the conversion.</returns> + </member> <member name="M:Newtonsoft.Json.Linq.JToken.op_Explicit(Newtonsoft.Json.Linq.JToken)~System.DateTime"> <summary> Performs an explicit conversion from <see cref="T:Newtonsoft.Json.Linq.JToken"/> to <see cref="T:System.DateTime"/>. @@ -2428,6 +2536,34 @@ <param name="value">The value to create a <see cref="T:Newtonsoft.Json.Linq.JValue"/> from.</param> <returns>The <see cref="T:Newtonsoft.Json.Linq.JValue"/> initialized with the specified value.</returns> </member> + <member name="M:Newtonsoft.Json.Linq.JToken.op_Implicit(System.Byte)~Newtonsoft.Json.Linq.JToken"> + <summary> + Performs an implicit conversion from <see cref="T:System.Byte"/> to <see cref="T:Newtonsoft.Json.Linq.JToken"/>. + </summary> + <param name="value">The value to create a <see cref="T:Newtonsoft.Json.Linq.JValue"/> from.</param> + <returns>The <see cref="T:Newtonsoft.Json.Linq.JValue"/> initialized with the specified value.</returns> + </member> + <member name="M:Newtonsoft.Json.Linq.JToken.op_Implicit(System.Nullable{System.Byte})~Newtonsoft.Json.Linq.JToken"> + <summary> + Performs an implicit conversion from <see cref="T:System.Nullable`1"/> to <see cref="T:Newtonsoft.Json.Linq.JToken"/>. + </summary> + <param name="value">The value to create a <see cref="T:Newtonsoft.Json.Linq.JValue"/> from.</param> + <returns>The <see cref="T:Newtonsoft.Json.Linq.JValue"/> initialized with the specified value.</returns> + </member> + <member name="M:Newtonsoft.Json.Linq.JToken.op_Implicit(System.SByte)~Newtonsoft.Json.Linq.JToken"> + <summary> + Performs an implicit conversion from <see cref="T:System.SByte"/> to <see cref="T:Newtonsoft.Json.Linq.JToken"/>. + </summary> + <param name="value">The value to create a <see cref="T:Newtonsoft.Json.Linq.JValue"/> from.</param> + <returns>The <see cref="T:Newtonsoft.Json.Linq.JValue"/> initialized with the specified value.</returns> + </member> + <member name="M:Newtonsoft.Json.Linq.JToken.op_Implicit(System.Nullable{System.SByte})~Newtonsoft.Json.Linq.JToken"> + <summary> + Performs an implicit conversion from <see cref="T:System.Nullable`1"/> to <see cref="T:Newtonsoft.Json.Linq.JToken"/>. + </summary> + <param name="value">The value to create a <see cref="T:Newtonsoft.Json.Linq.JValue"/> from.</param> + <returns>The <see cref="T:Newtonsoft.Json.Linq.JValue"/> initialized with the specified value.</returns> + </member> <member name="M:Newtonsoft.Json.Linq.JToken.op_Implicit(System.Nullable{System.Boolean})~Newtonsoft.Json.Linq.JToken"> <summary> Performs an implicit conversion from <see cref="T:System.Nullable`1"/> to <see cref="T:Newtonsoft.Json.Linq.JToken"/>. @@ -2713,28 +2849,41 @@ </member> <member name="M:Newtonsoft.Json.Linq.JToken.SelectToken(System.String)"> <summary> - Selects the token that matches the object path. + Selects a <see cref="T:Newtonsoft.Json.Linq.JToken"/> using a JPath expression. Selects the token that matches the object path. </summary> <param name="path"> - The object path from the current <see cref="T:Newtonsoft.Json.Linq.JToken"/> to the <see cref="T:Newtonsoft.Json.Linq.JToken"/> - to be returned. This must be a string of property names or array indexes separated - by periods, such as <code>Tables[0].DefaultView[0].Price</code> in C# or - <code>Tables(0).DefaultView(0).Price</code> in Visual Basic. + A <see cref="T:System.String"/> that contains a JPath expression. </param> - <returns>The <see cref="T:Newtonsoft.Json.Linq.JToken"/> that matches the object path or a null reference if no matching token is found.</returns> + <returns>A <see cref="T:Newtonsoft.Json.Linq.JToken"/>, or null.</returns> </member> <member name="M:Newtonsoft.Json.Linq.JToken.SelectToken(System.String,System.Boolean)"> <summary> - Selects the token that matches the object path. + Selects a <see cref="T:Newtonsoft.Json.Linq.JToken"/> using a JPath expression. Selects the token that matches the object path. + </summary> + <param name="path"> + A <see cref="T:System.String"/> that contains a JPath expression. + </param> + <param name="errorWhenNoMatch">A flag to indicate whether an error should be thrown if no tokens are found when evaluating part of the expression.</param> + <returns>A <see cref="T:Newtonsoft.Json.Linq.JToken"/>.</returns> + </member> + <member name="M:Newtonsoft.Json.Linq.JToken.SelectTokens(System.String)"> + <summary> + Selects a collection of elements using a JPath expression. + </summary> + <param name="path"> + A <see cref="T:System.String"/> that contains a JPath expression. + </param> + <returns>An <see cref="T:System.Collections.Generic.IEnumerable`1"/> that contains the selected elements.</returns> + </member> + <member name="M:Newtonsoft.Json.Linq.JToken.SelectTokens(System.String,System.Boolean)"> + <summary> + Selects a collection of elements using a JPath expression. </summary> <param name="path"> - The object path from the current <see cref="T:Newtonsoft.Json.Linq.JToken"/> to the <see cref="T:Newtonsoft.Json.Linq.JToken"/> - to be returned. This must be a string of property names or array indexes separated - by periods, such as <code>Tables[0].DefaultView[0].Price</code> in C# or - <code>Tables(0).DefaultView(0).Price</code> in Visual Basic. + A <see cref="T:System.String"/> that contains a JPath expression. </param> - <param name="errorWhenNoMatch">A flag to indicate whether an error should be thrown if no token is found.</param> - <returns>The <see cref="T:Newtonsoft.Json.Linq.JToken"/> that matches the object path.</returns> + <param name="errorWhenNoMatch">A flag to indicate whether an error should be thrown if no tokens are found when evaluating part of the expression.</param> + <returns>An <see cref="T:System.Collections.Generic.IEnumerable`1"/> that contains the selected elements.</returns> </member> <member name="M:Newtonsoft.Json.Linq.JToken.GetMetaObject(System.Linq.Expressions.Expression)"> <summary> @@ -2786,7 +2935,7 @@ </member> <member name="P:Newtonsoft.Json.Linq.JToken.HasValues"> <summary> - Gets a value indicating whether this token has childen tokens. + Gets a value indicating whether this token has child tokens. </summary> <value> <c>true</c> if this token has child values; otherwise, <c>false</c>. @@ -2839,6 +2988,12 @@ </summary> <param name="value">The value.</param> </member> + <member name="M:Newtonsoft.Json.Linq.JValue.#ctor(System.Decimal)"> + <summary> + Initializes a new instance of the <see cref="T:Newtonsoft.Json.Linq.JValue"/> class with the given value. + </summary> + <param name="value">The value.</param> + </member> <member name="M:Newtonsoft.Json.Linq.JValue.#ctor(System.Char)"> <summary> Initializes a new instance of the <see cref="T:Newtonsoft.Json.Linq.JValue"/> class with the given value. @@ -2869,6 +3024,12 @@ </summary> <param name="value">The value.</param> </member> + <member name="M:Newtonsoft.Json.Linq.JValue.#ctor(System.DateTimeOffset)"> + <summary> + Initializes a new instance of the <see cref="T:Newtonsoft.Json.Linq.JValue"/> class with the given value. + </summary> + <param name="value">The value.</param> + </member> <member name="M:Newtonsoft.Json.Linq.JValue.#ctor(System.Boolean)"> <summary> Initializes a new instance of the <see cref="T:Newtonsoft.Json.Linq.JValue"/> class with the given value. @@ -3022,7 +3183,7 @@ </member> <member name="P:Newtonsoft.Json.Linq.JValue.HasValues"> <summary> - Gets a value indicating whether this token has childen tokens. + Gets a value indicating whether this token has child tokens. </summary> <value> <c>true</c> if this token has child values; otherwise, <c>false</c>. @@ -3195,12 +3356,11 @@ Represents a view of a <see cref="T:Newtonsoft.Json.Linq.JProperty"/>. </summary> </member> - <member name="M:Newtonsoft.Json.Linq.JPropertyDescriptor.#ctor(System.String,System.Type)"> + <member name="M:Newtonsoft.Json.Linq.JPropertyDescriptor.#ctor(System.String)"> <summary> Initializes a new instance of the <see cref="T:Newtonsoft.Json.Linq.JPropertyDescriptor"/> class. </summary> <param name="name">The name.</param> - <param name="propertyType">Type of the property.</param> </member> <member name="M:Newtonsoft.Json.Linq.JPropertyDescriptor.CanResetValue(System.Object)"> <summary> @@ -3395,7 +3555,7 @@ <summary> Ignore members where the member value is the same as the member's default value when serializing objects so that is is not written to JSON. - This option will ignore all default values (e.g. <c>null</c> for objects and nullable typesl; <c>0</c> for integers, + This option will ignore all default values (e.g. <c>null</c> for objects and nullable types; <c>0</c> for integers, decimals and floating point numbers; and <c>false</c> for booleans). The default value ignored can be changed by placing the <see cref="T:System.ComponentModel.DefaultValueAttribute"/> on the property. </summary> @@ -3522,6 +3682,12 @@ </summary> <value>The type name handling.</value> </member> + <member name="P:Newtonsoft.Json.JsonSerializerSettings.MetadataPropertyHandling"> + <summary> + Gets or sets how metadata properties are used during deserialization. + </summary> + <value>The metadata properties handling.</value> + </member> <member name="P:Newtonsoft.Json.JsonSerializerSettings.TypeNameAssemblyFormat"> <summary> Gets or sets how a type name assembly is written and resolved by the serializer. @@ -4733,6 +4899,22 @@ A JSON string representation of the object. </returns> </member> + <member name="M:Newtonsoft.Json.JsonConvert.SerializeObject(System.Object,System.Type,Newtonsoft.Json.JsonSerializerSettings)"> + <summary> + Serializes the specified object to a JSON string using a type, formatting and <see cref="T:Newtonsoft.Json.JsonSerializerSettings"/>. + </summary> + <param name="value">The object to serialize.</param> + <param name="settings">The <see cref="T:Newtonsoft.Json.JsonSerializerSettings"/> used to serialize the object. + If this is null, default serialization settings will be is used.</param> + <param name="type"> + The type of the value being serialized. + This parameter is used when <see cref="T:Newtonsoft.Json.TypeNameHandling"/> is Auto to write out the type name if the type of the value does not match. + Specifing the type is optional. + </param> + <returns> + A JSON string representation of the object. + </returns> + </member> <member name="M:Newtonsoft.Json.JsonConvert.SerializeObject(System.Object,Newtonsoft.Json.Formatting,Newtonsoft.Json.JsonSerializerSettings)"> <summary> Serializes the specified object to a JSON string using formatting and <see cref="T:Newtonsoft.Json.JsonSerializerSettings"/>. @@ -5002,7 +5184,7 @@ </member> <member name="M:Newtonsoft.Json.JsonConvert.SerializeXmlNode(System.Xml.XmlNode,Newtonsoft.Json.Formatting,System.Boolean)"> <summary> - Serializes the XML node to a JSON string using formatting and omits the root object if <see cref="!:omitRootObject"/> is <c>true</c>. + Serializes the XML node to a JSON string using formatting and omits the root object if <paramref name="omitRootObject"/> is <c>true</c>. </summary> <param name="node">The node to serialize.</param> <param name="formatting">Indicates how the output is formatted.</param> @@ -5018,7 +5200,7 @@ </member> <member name="M:Newtonsoft.Json.JsonConvert.DeserializeXmlNode(System.String,System.String)"> <summary> - Deserializes the XmlNode from a JSON string nested in a root elment specified by <see cref="!:deserializeRootElementName"/>. + Deserializes the XmlNode from a JSON string nested in a root elment specified by <paramref name="deserializeRootElementName"/>. </summary> <param name="value">The JSON string.</param> <param name="deserializeRootElementName">The name of the root element to append when deserializing.</param> @@ -5026,7 +5208,7 @@ </member> <member name="M:Newtonsoft.Json.JsonConvert.DeserializeXmlNode(System.String,System.String,System.Boolean)"> <summary> - Deserializes the XmlNode from a JSON string nested in a root elment specified by <see cref="!:deserializeRootElementName"/> + Deserializes the XmlNode from a JSON string nested in a root elment specified by <paramref name="deserializeRootElementName"/> and writes a .NET array attribute for collections. </summary> <param name="value">The JSON string.</param> @@ -5054,7 +5236,7 @@ </member> <member name="M:Newtonsoft.Json.JsonConvert.SerializeXNode(System.Xml.Linq.XObject,Newtonsoft.Json.Formatting,System.Boolean)"> <summary> - Serializes the <see cref="T:System.Xml.Linq.XNode"/> to a JSON string using formatting and omits the root object if <see cref="!:omitRootObject"/> is <c>true</c>. + Serializes the <see cref="T:System.Xml.Linq.XNode"/> to a JSON string using formatting and omits the root object if <paramref name="omitRootObject"/> is <c>true</c>. </summary> <param name="node">The node to serialize.</param> <param name="formatting">Indicates how the output is formatted.</param> @@ -5070,7 +5252,7 @@ </member> <member name="M:Newtonsoft.Json.JsonConvert.DeserializeXNode(System.String,System.String)"> <summary> - Deserializes the <see cref="T:System.Xml.Linq.XNode"/> from a JSON string nested in a root elment specified by <see cref="!:deserializeRootElementName"/>. + Deserializes the <see cref="T:System.Xml.Linq.XNode"/> from a JSON string nested in a root elment specified by <paramref name="deserializeRootElementName"/>. </summary> <param name="value">The JSON string.</param> <param name="deserializeRootElementName">The name of the root element to append when deserializing.</param> @@ -5078,7 +5260,7 @@ </member> <member name="M:Newtonsoft.Json.JsonConvert.DeserializeXNode(System.String,System.String,System.Boolean)"> <summary> - Deserializes the <see cref="T:System.Xml.Linq.XNode"/> from a JSON string nested in a root elment specified by <see cref="!:deserializeRootElementName"/> + Deserializes the <see cref="T:System.Xml.Linq.XNode"/> from a JSON string nested in a root elment specified by <paramref name="deserializeRootElementName"/> and writes a .NET array attribute for collections. </summary> <param name="value">The JSON string.</param> @@ -5344,6 +5526,12 @@ </summary> <value>The constructor handling.</value> </member> + <member name="P:Newtonsoft.Json.JsonSerializer.MetadataPropertyHandling"> + <summary> + Gets or sets how metadata properties are used during deserialization. + </summary> + <value>The metadata properties handling.</value> + </member> <member name="P:Newtonsoft.Json.JsonSerializer.Converters"> <summary> Gets a collection <see cref="T:Newtonsoft.Json.JsonConverter"/> that will be used during serialization. @@ -5634,7 +5822,7 @@ </member> <member name="P:Newtonsoft.Json.Linq.JContainer.HasValues"> <summary> - Gets a value indicating whether this token has childen tokens. + Gets a value indicating whether this token has child tokens. </summary> <value> <c>true</c> if this token has child values; otherwise, <c>false</c>. @@ -6321,6 +6509,11 @@ true if the next token was read successfully; false if there are no more tokens to read. </returns> </member> + <member name="P:Newtonsoft.Json.Linq.JTokenReader.Path"> + <summary> + Gets the path of the current JSON token. + </summary> + </member> <member name="T:Newtonsoft.Json.Linq.JTokenWriter"> <summary> Represents a writer that provides a fast, non-cached, forward-only way of generating Json data. @@ -7112,7 +7305,7 @@ </member> <member name="P:Newtonsoft.Json.Serialization.ErrorContext.Error"> <summary> - Gets or sets the error. + Gets the error. </summary> <value>The error.</value> </member> @@ -7186,6 +7379,12 @@ <param name="key">The extension data key.</param> <param name="value">The extension data value.</param> </member> + <member name="T:Newtonsoft.Json.Serialization.ExtensionDataGetter"> + <summary> + Gets extension data for an object during serialization. + </summary> + <param name="o">The object to set extension data on.</param> + </member> <member name="T:Newtonsoft.Json.Serialization.JsonDictionaryContract"> <summary> Contract details for a <see cref="T:System.Type"/> used by the <see cref="T:Newtonsoft.Json.JsonSerializer"/>. @@ -7273,31 +7472,31 @@ </member> <member name="P:Newtonsoft.Json.Serialization.JsonProperty.MemberConverter"> <summary> - Gets the member converter. + Gets or sets the member converter. </summary> <value>The member converter.</value> </member> <member name="P:Newtonsoft.Json.Serialization.JsonProperty.Ignored"> <summary> - Gets a value indicating whether this <see cref="T:Newtonsoft.Json.Serialization.JsonProperty"/> is ignored. + Gets or sets a value indicating whether this <see cref="T:Newtonsoft.Json.Serialization.JsonProperty"/> is ignored. </summary> <value><c>true</c> if ignored; otherwise, <c>false</c>.</value> </member> <member name="P:Newtonsoft.Json.Serialization.JsonProperty.Readable"> <summary> - Gets a value indicating whether this <see cref="T:Newtonsoft.Json.Serialization.JsonProperty"/> is readable. + Gets or sets a value indicating whether this <see cref="T:Newtonsoft.Json.Serialization.JsonProperty"/> is readable. </summary> <value><c>true</c> if readable; otherwise, <c>false</c>.</value> </member> <member name="P:Newtonsoft.Json.Serialization.JsonProperty.Writable"> <summary> - Gets a value indicating whether this <see cref="T:Newtonsoft.Json.Serialization.JsonProperty"/> is writable. + Gets or sets a value indicating whether this <see cref="T:Newtonsoft.Json.Serialization.JsonProperty"/> is writable. </summary> <value><c>true</c> if writable; otherwise, <c>false</c>.</value> </member> <member name="P:Newtonsoft.Json.Serialization.JsonProperty.HasMemberAttribute"> <summary> - Gets a value indicating whether this <see cref="T:Newtonsoft.Json.Serialization.JsonProperty"/> has a member attribute. + Gets or sets a value indicating whether this <see cref="T:Newtonsoft.Json.Serialization.JsonProperty"/> has a member attribute. </summary> <value><c>true</c> if has a member attribute; otherwise, <c>false</c>.</value> </member> @@ -7309,13 +7508,13 @@ </member> <member name="P:Newtonsoft.Json.Serialization.JsonProperty.Required"> <summary> - Gets a value indicating whether this <see cref="T:Newtonsoft.Json.Serialization.JsonProperty"/> is required. + Gets or sets a value indicating whether this <see cref="T:Newtonsoft.Json.Serialization.JsonProperty"/> is required. </summary> <value>A value indicating whether this <see cref="T:Newtonsoft.Json.Serialization.JsonProperty"/> is required.</value> </member> <member name="P:Newtonsoft.Json.Serialization.JsonProperty.IsReference"> <summary> - Gets a value indicating whether this property preserves object references. + Gets or sets a value indicating whether this property preserves object references. </summary> <value> <c>true</c> if this instance is reference; otherwise, <c>false</c>. @@ -7323,31 +7522,31 @@ </member> <member name="P:Newtonsoft.Json.Serialization.JsonProperty.NullValueHandling"> <summary> - Gets the property null value handling. + Gets or sets the property null value handling. </summary> <value>The null value handling.</value> </member> <member name="P:Newtonsoft.Json.Serialization.JsonProperty.DefaultValueHandling"> <summary> - Gets the property default value handling. + Gets or sets the property default value handling. </summary> <value>The default value handling.</value> </member> <member name="P:Newtonsoft.Json.Serialization.JsonProperty.ReferenceLoopHandling"> <summary> - Gets the property reference loop handling. + Gets or sets the property reference loop handling. </summary> <value>The reference loop handling.</value> </member> <member name="P:Newtonsoft.Json.Serialization.JsonProperty.ObjectCreationHandling"> <summary> - Gets the property object creation handling. + Gets or sets the property object creation handling. </summary> <value>The object creation handling.</value> </member> <member name="P:Newtonsoft.Json.Serialization.JsonProperty.TypeNameHandling"> <summary> - Gets or sets the type name handling. + Gets or sets or sets the type name handling. </summary> <value>The type name handling.</value> </member> @@ -7898,6 +8097,11 @@ Gets or sets the extension data setter. </summary> </member> + <member name="P:Newtonsoft.Json.Serialization.JsonObjectContract.ExtensionDataGetter"> + <summary> + Gets or sets the extension data getter. + </summary> + </member> <member name="T:Newtonsoft.Json.Serialization.JsonStringContract"> <summary> Contract details for a <see cref="T:System.Type"/> used by the <see cref="T:Newtonsoft.Json.JsonSerializer"/>. @@ -8001,27 +8205,6 @@ Include the .NET type name when the type of the object being serialized is not the same as its declared type. </summary> </member> - <member name="M:Newtonsoft.Json.Utilities.ConvertUtils.Convert(System.Object,System.Globalization.CultureInfo,System.Type)"> - <summary> - Converts the value to the specified type. - </summary> - <param name="initialValue">The value to convert.</param> - <param name="culture">The culture to use when converting.</param> - <param name="targetType">The type to convert the value to.</param> - <returns>The converted type.</returns> - </member> - <member name="M:Newtonsoft.Json.Utilities.ConvertUtils.TryConvert(System.Object,System.Globalization.CultureInfo,System.Type,System.Object@)"> - <summary> - Converts the value to the specified type. - </summary> - <param name="initialValue">The value to convert.</param> - <param name="culture">The culture to use when converting.</param> - <param name="targetType">The type to convert the value to.</param> - <param name="convertedValue">The converted value if the conversion was successful or the default value of <c>T</c> if it failed.</param> - <returns> - <c>true</c> if <c>initialValue</c> was converted successfully; otherwise, <c>false</c>. - </returns> - </member> <member name="M:Newtonsoft.Json.Utilities.ConvertUtils.ConvertOrCast(System.Object,System.Globalization.CultureInfo,System.Type)"> <summary> Converts the value to the specified type. If the value is unable to be converted, the diff --git a/Libs/JSON.Net/readme.txt b/Libs/JSON.Net/readme.txt index 29dea6c81a7b9eb6122867675ee94f1a82cc45ec..46beeee8d4c6125da5ebd73a003f289778e1a83f 100644 --- a/Libs/JSON.Net/readme.txt +++ b/Libs/JSON.Net/readme.txt @@ -1,7 +1,7 @@ Json.NET -http://james.newtonking.com/projects/json-net.aspx -http://www.codeplex.com/json/ +http://james.newtonking.com/json +http://www.codeplex.com/json https://github.com/JamesNK/Newtonsoft.Json @@ -24,7 +24,7 @@ http://james.newtonking.com/projects/json/help/ Versions: -Json.NET has different libaries for the various .NET Framework versions. +Json.NET has different libraries for the various .NET Framework versions. -Net45: .NET latest (4.5) @@ -45,12 +45,10 @@ Json.NET has different libaries for the various .NET Framework versions. .NET 4.5, Windows Phone 8, Windows 8 Store -Portable40: - .NET 4.0, Windows Phone 7, Windows 8 Store, Silverlight 4 + .NET 4.0, Windows Phone 8, Windows 8 Store, Silverlight 5, MonoTouch, MonoDroid Notes: -Microsoft stopped support for the Compact Framework in Visual Studio 2010. -For a Compact Framework 3.5 build download Json.NET 3.5. - -For a Silverlight 3.0 build download Json.NET 3.5. \ No newline at end of file +For a Compact Framework 3.5 and Silverlight 3.0 builds download Json.NET 3.5 +For a Silverlight 4.0 and Windows Phone 7 builds download Json.NET 5 \ No newline at end of file