diff --git a/.github/Get-BuildInfo.ps1 b/.github/Get-BuildInfo.ps1 index 879a4e3c7d..76e32b4bd0 100644 --- a/.github/Get-BuildInfo.ps1 +++ b/.github/Get-BuildInfo.ps1 @@ -58,3 +58,4 @@ Write-GitHubVariable "app_version_suffix" $app_version_suffix Write-GitHubVariable "app_version_full" $app_version_full Write-GitHubVariable "sign_binaries" $sign_binaries Write-GitHubVariable "publish_nuget" $publish_nuget +Write-GitHubVariable "nuget_packages_artifact_name" "NetOffice_packages_v$app_version_full" diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml index 52591f7ccb..8ecfd748a1 100644 --- a/.github/workflows/labels.yml +++ b/.github/workflows/labels.yml @@ -14,7 +14,7 @@ jobs: labels: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: gitlabels/gitlabels@v1 + - uses: actions/checkout@v6 + - uses: gitlabels/gitlabels@v2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5a4f155523..93a899ea5f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,11 +6,14 @@ on: - 'v*.*.*' permissions: + id-token: write contents: read jobs: release: - runs-on: windows-2022 + environment: production + + runs-on: windows-2025 strategy: matrix: @@ -20,41 +23,45 @@ jobs: DOTNET_NOLOGO: 1 DOTNET_CLI_TELEMETRY_OPTOUT: 1 DOTNET_GENERATE_ASPNET_CERTIFICATE: 0 + BUILD_SIGN_RELEASE: '${{ vars.BUILD_SIGN_RELEASE }}' ContinuousIntegrationBuild: true RestoreLockedMode: true RepositoryBranch: '${{ github.ref_name }}' RepositoryCommit: '${{ github.sha }}' Configuration: '${{ matrix.configuration }}' + outputs: + nuget_packages_artifact_name: ${{ steps.build.outputs.nuget_packages_artifact_name }} + steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v6 - name: Setup dotnet - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@v5 with: - dotnet-version: '7.0.201' + dotnet-version: 8 - name: Setup MSBuild - uses: microsoft/setup-msbuild@v1.1 + uses: microsoft/setup-msbuild@v2 - name: Cache dotnet tools - uses: actions/cache@v3 + uses: actions/cache@v5 id: cache-dotnettools with: path: ~/.dotnet/tools key: dotnettools - - name: Setup AzureSignTool + - name: Setup dotnet sign tool if: steps.cache-dotnettools.outputs.cache-hit != 'true' - run: dotnet tool install --verbosity minimal --global azuresigntool --version 3.0.0 + run: dotnet tool install --verbosity minimal --global sign --version 0.9.1-beta.25379.1 - - name: Setup NuGetKeyVaultSignTool + - name: Setup Knapcode.CertificateExtractor tool if: steps.cache-dotnettools.outputs.cache-hit != 'true' - run: dotnet tool install --verbosity minimal --global NuGetKeyVaultSignTool --version 3.2.2 + run: dotnet tool install --verbosity minimal --global Knapcode.CertificateExtractor --version 0.1.1 - name: Cache packages - uses: actions/cache@v3 + uses: actions/cache@v5 with: path: ~/.nuget/packages key: NetOffice-nuget-${{ hashFiles('**/packages.lock.json') }} @@ -77,59 +84,123 @@ jobs: $content = $content.Replace('${{ github.workspace }}', '..') $content | Set-Content obj/signlist.txt + - name: azure login + uses: azure/login@v2 + with: + client-id: ${{ secrets.TRUSTED_SIGNING_CLIENT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + - name: Sign NetOffice libraries if: success() && steps.build.outputs.sign_binaries == 'true' - uses: azure/trusted-signing-action@v0.3.19 + uses: azure/artifact-signing-action@v1 with: - azure-tenant-id: ${{ secrets.KEYVAULT_TENANT_ID }} - azure-client-id: ${{ secrets.KEYVAULT_CLIENT_ID }} - azure-client-secret: ${{ secrets.KEYVAULT_CLIENT_SECRET }} - endpoint: ${{ vars.KEYVAULT_ENDPOINT }} - trusted-signing-account-name: ${{ vars.KEYVAULT_ACCOUNT_NAME }} - certificate-profile-name: ${{ secrets.KEYVAULT_CERTIFICATE_PROFILE }} - files-catalog: '${{ github.workspace }}/obj/signlist.txt' - file-digest: SHA256 - timestamp-rfc3161: http://timestamp.acs.microsoft.com - timestamp-digest: SHA256 + endpoint: ${{ secrets.TRUSTED_SIGNING_ENDPOINT }} + signing-account-name: ${{ secrets.TRUSTED_SIGNING_ACCOUNT_NAME }} + certificate-profile-name: ${{ secrets.TRUSTED_SIGNING_CERTIFICATE_PROFILE }} + files-catalog: '${{ github.workspace }}/obj/signlist.txt' + files: | + ${{ github.workspace }}/Source/ClientApplication/bin/${{ matrix.configuration }}/AccessApi.dll + ${{ github.workspace }}/Source/ClientApplication/bin/${{ matrix.configuration }}/ADODBApi.dll + ${{ github.workspace }}/Source/ClientApplication/bin/${{ matrix.configuration }}/DAOApi.dll + ${{ github.workspace }}/Source/ClientApplication/bin/${{ matrix.configuration }}/ExcelApi.dll + ${{ github.workspace }}/Source/ClientApplication/bin/${{ matrix.configuration }}/MSComctlLibApi.dll + ${{ github.workspace }}/Source/ClientApplication/bin/${{ matrix.configuration }}/MSDATASRCApi.dll + ${{ github.workspace }}/Source/ClientApplication/bin/${{ matrix.configuration }}/NetOffice.dll + ${{ github.workspace }}/Source/ClientApplication/bin/${{ matrix.configuration }}/OfficeApi.dll + ${{ github.workspace }}/Source/ClientApplication/bin/${{ matrix.configuration }}/OfficeApi.Extensions.dll + ${{ github.workspace }}/Source/ClientApplication/bin/${{ matrix.configuration }}/OutlookApi.dll + ${{ github.workspace }}/Source/ClientApplication/bin/${{ matrix.configuration }}/OWC10Api.dll + ${{ github.workspace }}/Source/ClientApplication/bin/${{ matrix.configuration }}/PowerPointApi.dll + ${{ github.workspace }}/Source/ClientApplication/bin/${{ matrix.configuration }}/VBIDEApi.dll + ${{ github.workspace }}/Source/ClientApplication/bin/${{ matrix.configuration }}/WordApi.dll + file-digest: SHA256 + timestamp-rfc3161: http://timestamp.acs.microsoft.com + timestamp-digest: SHA256 - name: Archive NetOffice binaries - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v6 with: name: NetOffice_binaries_v${{ steps.build.outputs.app_version_full }}_${{ matrix.configuration }} path: '${{ github.workspace }}\Source\ClientApplication\bin\${{ matrix.configuration }}' - name: Pack NetOffice - if: steps.build.outputs.publish_nuget == 'true' run: | dotnet pack --no-build --no-restore Source\NetOffice.sln -c ${{ matrix.configuration }} -o dist env: VersionSuffix: ${{ steps.build.outputs.app_version_suffix }} - # - name: Sign NetOffice packages - # if: success() && steps.build.outputs.publish_nuget == 'true' && steps.build.outputs.sign_binaries == 'true' - # working-directory: '${{ github.workspace}}\dist' - # run: | - # NuGetKeyVaultSignTool.exe sign *.nupkg ` - # --file-digest sha256 ` - # --timestamp-rfc3161 http://timestamp.digicert.com ` - # --timestamp-digest sha256 ` - # --azure-key-vault-url https://opensourcesigning.vault.azure.net ` - # --azure-key-vault-tenant-id "${{ secrets.KEYVAULT_TENANT_ID }}" ` - # --azure-key-vault-client-id "${{ secrets.KEYVAULT_CLIENT_ID }}" ` - # --azure-key-vault-client-secret "${{ secrets.KEYVAULT_CLIENT_SECRET }}" ` - # --azure-key-vault-certificate "goITSolutions-until-2024-01" - - - name: Publish packages - if: success() && steps.build.outputs.publish_nuget == 'true' + - name: Sign NetOffice packages + if: success() && steps.build.outputs.sign_binaries == 'true' working-directory: '${{ github.workspace}}\dist' run: | - dotnet nuget push *.nupkg --api-key $env:NUGET_TOKEN --source https://api.nuget.org/v3/index.json - env: - NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }} + sign code trusted-signing *.nupkg ` + --publisher-name "NetOffice" ` + --description "NetOffice" ` + --description-url "https://github.com/NetOfficeFw/NetOffice" ` + --trusted-signing-endpoint "${{ secrets.TRUSTED_SIGNING_ENDPOINT }}" ` + --trusted-signing-account "${{ secrets.TRUSTED_SIGNING_ACCOUNT_NAME }}" ` + --trusted-signing-certificate-profile "${{ secrets.TRUSTED_SIGNING_CERTIFICATE_PROFILE }}" ` + --file-digest SHA256 ` + --timestamp-url http://timestamp.acs.microsoft.com ` + --timestamp-digest SHA256 + + - name: Extract trusted signing certificate + if: success() && steps.build.outputs.sign_binaries == 'true' + run: | + $nupkg = Get-ChildItem -Path '${{ github.workspace}}\dist' -Filter '*.nupkg' | Select-Object -First 1 + nuget-cert-extractor --file $nupkg --output '${{ github.workspace}}\dist' --code-signing --author --leaf - name: Archive NetOffice packages - if: success() && steps.build.outputs.publish_nuget == 'true' - uses: actions/upload-artifact@v3 + if: success() + uses: actions/upload-artifact@v6 with: - name: NetOffice_packages_v${{ steps.build.outputs.app_version_full }} + name: ${{ steps.build.outputs.nuget_packages_artifact_name }} path: '${{ github.workspace }}\dist' + + - name: Archive code signing certificate + if: success() && matrix.configuration == 'Release' + id: certificate_artifact + uses: actions/upload-artifact@v6 + with: + name: certificate + path: '${{ github.workspace }}/dist/*.cer' + + - name: Release documentation + if: matrix.configuration == 'Release' + run: | + $certUrl = '${{ steps.certificate_artifact.outputs.artifact-url }}' + 'To release the NuGet package, upload the signing certificate to NuGet Gallery via Account Settings: . ' >> $env:GITHUB_STEP_SUMMARY + 'See the `certificate` artifact for the signing certificate file.' >> $env:GITHUB_STEP_SUMMARY + '' >> $env:GITHUB_STEP_SUMMARY + "Download the [certiticate file]($certUrl)." >> $env:GITHUB_STEP_SUMMARY + '' >> $env:GITHUB_STEP_SUMMARY + 'Approve the `publish` job deployment to the `nuget-gallery` environment when the certificate was added to NuGet Gallery.' >> $env:GITHUB_STEP_SUMMARY + + publish: + environment: nuget-gallery + + permissions: + id-token: write + + needs: release + + runs-on: ubuntu-latest + + steps: + - name: Download NetOffice packages + uses: actions/download-artifact@v7 + with: + name: ${{ needs.release.outputs.nuget_packages_artifact_name }} + + - name: Authenticate Nuget Gallery + uses: NuGet/login@v1 + id: nuget + with: + user: ${{ secrets.NUGET_TRUSTED_PUBLISHING_USER }} + + - name: Publish packages + run: | + dotnet nuget push "*.nupkg" --api-key "$NUGET_API_KEY" --source https://api.nuget.org/v3/index.json + env: + NUGET_API_KEY: ${{ steps.nuget.outputs.NUGET_API_KEY }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 410d98c155..4e54487655 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -5,15 +5,18 @@ on: push: branches: - 'main' - - 'dev/*' - - 'releases/*' + - 'bugfix/**' + - 'dev/**' + - 'feature/**' + - 'tests/**' + - 'releases/**' permissions: contents: read jobs: tests: - runs-on: windows-2022 + runs-on: windows-2025 strategy: matrix: @@ -31,18 +34,18 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v6 - name: Setup dotnet - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@v5 with: - dotnet-version: '7.0.201' + dotnet-version: 8 - name: Setup MSBuild - uses: microsoft/setup-msbuild@v1.1 + uses: microsoft/setup-msbuild@v2 - name: Cache packages - uses: actions/cache@v3 + uses: actions/cache@v5 with: path: ~/.nuget/packages key: NetOffice-nuget-${{ hashFiles('**/packages.lock.json') }} @@ -66,7 +69,7 @@ jobs: VersionSuffix: ${{ steps.build.outputs.app_version_suffix }} - name: Archive NetOffice binaries - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v6 with: name: NetOffice_binaries_v${{ steps.build.outputs.app_version_full }}_${{ matrix.configuration }} path: '${{ github.workspace }}\Source\ClientApplication\bin\${{ matrix.configuration }}' diff --git a/.gitignore b/.gitignore index aabe096a08..21d8c786ce 100755 --- a/.gitignore +++ b/.gitignore @@ -9,8 +9,8 @@ NetOffice*.rar ReferenceIndex*.rar Assemblies/ Any\ CPU/ -Current\ Binaries\ -Persistance\ Cache*\ +Current\ Binaries/ +Persistance\ Cache*/ Toolbox/Libs/ ..svnbridge/ out/ diff --git a/BuildTools/Lib/HtmlAgilityPack.dll b/BuildTools/Lib/HtmlAgilityPack.dll deleted file mode 100644 index 3d96d71af9..0000000000 Binary files a/BuildTools/Lib/HtmlAgilityPack.dll and /dev/null differ diff --git a/BuildTools/Lib/HtmlAgilityPack.pdb b/BuildTools/Lib/HtmlAgilityPack.pdb deleted file mode 100644 index c2e6bca233..0000000000 Binary files a/BuildTools/Lib/HtmlAgilityPack.pdb and /dev/null differ diff --git a/BuildTools/Lib/HtmlAgilityPack.xml b/BuildTools/Lib/HtmlAgilityPack.xml deleted file mode 100644 index f47566cfc4..0000000000 --- a/BuildTools/Lib/HtmlAgilityPack.xml +++ /dev/null @@ -1,2468 +0,0 @@ - - - - HtmlAgilityPack - - - - - Represents a fragment of code in a mixed code document. - - - - - Represents a base class for fragments in a mixed code document. - - - - - Gets the fragement text. - - - - - Gets the type of fragment. - - - - - Gets the line number of the fragment. - - - - - Gets the line position (column) of the fragment. - - - - - Gets the fragment position in the document's stream. - - - - - Gets the fragment code text. - - - - - A utility class to get HTML document from HTTP. - - - - - Occurs after an HTTP request has been executed. - - - - - Occurs before an HTML document is handled. - - - - - Occurs before an HTTP request is executed. - - - - - Gets the MIME content type for a given path extension. - - The input path extension. - The default content type to return if any error occurs. - The path extension's MIME content type. - - - - Gets the path extension for a given MIME content type. - - The input MIME content type. - The default path extension to return if any error occurs. - The MIME content type's path extension. - - - - Creates an instance of the given type from the specified Internet resource. - - The requested URL, such as "http://Myserver/Mypath/Myfile.asp". - The requested type. - An newly created instance. - - - - Gets an HTML document from an Internet resource and saves it to the specified file. - - The requested URL, such as "http://Myserver/Mypath/Myfile.asp". - The location of the file where you want to save the document. - - - - Gets an HTML document from an Internet resource and saves it to the specified file. - Proxy aware - - The requested URL, such as "http://Myserver/Mypath/Myfile.asp". - The location of the file where you want to save the document. - - - - - - Gets an HTML document from an Internet resource and saves it to the specified file. - - The requested URL, such as "http://Myserver/Mypath/Myfile.asp". - The location of the file where you want to save the document. - The HTTP method used to open the connection, such as GET, POST, PUT, or PROPFIND. - - - - Gets an HTML document from an Internet resource and saves it to the specified file. Understands Proxies - - The requested URL, such as "http://Myserver/Mypath/Myfile.asp". - The location of the file where you want to save the document. - - The HTTP method used to open the connection, such as GET, POST, PUT, or PROPFIND. - - - - - Gets the cache file path for a specified url. - - The url fo which to retrieve the cache path. May not be null. - The cache file path. - - - - Gets an HTML document from an Internet resource. - - The requested URL, such as "http://Myserver/Mypath/Myfile.asp". - A new HTML document. - - - - Gets an HTML document from an Internet resource. - - The requested URL, such as "http://Myserver/Mypath/Myfile.asp". - Host to use for Proxy - Port the Proxy is on - User Id for Authentication - Password for Authentication - A new HTML document. - - - - Loads an HTML document from an Internet resource. - - The requested URL, such as "http://Myserver/Mypath/Myfile.asp". - The HTTP method used to open the connection, such as GET, POST, PUT, or PROPFIND. - A new HTML document. - - - - Loads an HTML document from an Internet resource. - - The requested URL, such as "http://Myserver/Mypath/Myfile.asp". - The HTTP method used to open the connection, such as GET, POST, PUT, or PROPFIND. - Proxy to use with this request - Credentials to use when authenticating - A new HTML document. - - - - Loads an HTML document from an Internet resource and saves it to the specified XmlTextWriter. - - The requested URL, such as "http://Myserver/Mypath/Myfile.asp". - The XmlTextWriter to which you want to save to. - - - - Creates an instance of the given type from the specified Internet resource. - - The requested URL, such as "http://Myserver/Mypath/Myfile.asp". - The URL that specifies the XSLT stylesheet to load. - An containing the namespace-qualified arguments used as input to the transform. - The requested type. - An newly created instance. - - - - Creates an instance of the given type from the specified Internet resource. - - The requested URL, such as "http://Myserver/Mypath/Myfile.asp". - The URL that specifies the XSLT stylesheet to load. - An containing the namespace-qualified arguments used as input to the transform. - The requested type. - A file path where the temporary XML before transformation will be saved. Mostly used for debugging purposes. - An newly created instance. - - - - Loads an HTML document from an Internet resource and saves it to the specified XmlTextWriter, after an XSLT transformation. - - The requested URL, such as "http://Myserver/Mypath/Myfile.asp". - The URL that specifies the XSLT stylesheet to load. - An XsltArgumentList containing the namespace-qualified arguments used as input to the transform. - The XmlTextWriter to which you want to save. - - - - Loads an HTML document from an Internet resource and saves it to the specified XmlTextWriter, after an XSLT transformation. - - The requested URL, such as "http://Myserver/Mypath/Myfile.asp". May not be null. - The URL that specifies the XSLT stylesheet to load. - An XsltArgumentList containing the namespace-qualified arguments used as input to the transform. - The XmlTextWriter to which you want to save. - A file path where the temporary XML before transformation will be saved. Mostly used for debugging purposes. - - - - Gets or Sets a value indicating if document encoding must be automatically detected. - - - - - Gets or sets the Encoding used to override the response stream from any web request - - - - - Gets or Sets a value indicating whether to get document only from the cache. - If this is set to true and document is not found in the cache, nothing will be loaded. - - - - - Gets or Sets the cache path. If null, no caching mechanism will be used. - - - - - Gets a value indicating if the last document was retrieved from the cache. - - - - - Gets the last request duration in milliseconds. - - - - - Gets the URI of the Internet resource that actually responded to the request. - - - - - Gets the last request status. - - - - - Gets or Sets the size of the buffer used for memory operations. - - - - - Gets or Sets a value indicating if cookies will be stored. - - - - - Gets or Sets the User Agent HTTP 1.1 header sent on any webrequest - - - - - Gets or Sets a value indicating whether the caching mechanisms should be used or not. - - - - - Represents the method that will handle the PostResponse event. - - - - - Represents the method that will handle the PreHandleDocument event. - - - - - Represents the method that will handle the PreRequest event. - - - - - Wraps getting AppDomain permissions - - - - - An interface for getting permissions of the running application - - - - - Checks to see if Registry access is available to the caller - - - - - - Checks to see if DNS information is available to the caller - - - - - - Checks to see if Registry access is available to the caller - - - - - - Checks to see if DNS information is available to the caller - - - - - - Represents a document with mixed code and text. ASP, ASPX, JSP, are good example of such documents. - - - - - Gets or sets the token representing code end. - - - - - Gets or sets the token representing code start. - - - - - Gets or sets the token representing code directive. - - - - - Gets or sets the token representing response write directive. - - - - - Creates a mixed code document instance. - - - - - Create a code fragment instances. - - The newly created code fragment instance. - - - - Create a text fragment instances. - - The newly created text fragment instance. - - - - Loads a mixed code document from a stream. - - The input stream. - - - - Loads a mixed code document from a stream. - - The input stream. - Indicates whether to look for byte order marks at the beginning of the file. - - - - Loads a mixed code document from a stream. - - The input stream. - The character encoding to use. - - - - Loads a mixed code document from a stream. - - The input stream. - The character encoding to use. - Indicates whether to look for byte order marks at the beginning of the file. - - - - Loads a mixed code document from a stream. - - The input stream. - The character encoding to use. - Indicates whether to look for byte order marks at the beginning of the file. - The minimum buffer size. - - - - Loads a mixed code document from a file. - - The complete file path to be read. - - - - Loads a mixed code document from a file. - - The complete file path to be read. - Indicates whether to look for byte order marks at the beginning of the file. - - - - Loads a mixed code document from a file. - - The complete file path to be read. - The character encoding to use. - - - - Loads a mixed code document from a file. - - The complete file path to be read. - The character encoding to use. - Indicates whether to look for byte order marks at the beginning of the file. - - - - Loads a mixed code document from a file. - - The complete file path to be read. - The character encoding to use. - Indicates whether to look for byte order marks at the beginning of the file. - The minimum buffer size. - - - - Loads the mixed code document from the specified TextReader. - - The TextReader used to feed the HTML data into the document. - - - - Loads a mixed document from a text - - The text to load. - - - - Saves the mixed document to the specified stream. - - The stream to which you want to save. - - - - Saves the mixed document to the specified stream. - - The stream to which you want to save. - The character encoding to use. - - - - Saves the mixed document to the specified file. - - The location of the file where you want to save the document. - - - - Saves the mixed document to the specified file. - - The location of the file where you want to save the document. - The character encoding to use. - - - - Saves the mixed document to the specified StreamWriter. - - The StreamWriter to which you want to save. - - - - Saves the mixed document to the specified TextWriter. - - The TextWriter to which you want to save. - - - - Gets the code represented by the mixed code document seen as a template. - - - - - Gets the list of code fragments in the document. - - - - - Gets the list of all fragments in the document. - - - - - Gets the encoding of the stream used to read the document. - - - - - Gets the list of text fragments in the document. - - - - - Represents a list of mixed code fragments. - - - - - Gets an enumerator that can iterate through the fragment list. - - - - - Appends a fragment to the list of fragments. - - The fragment to append. May not be null. - - - - Gets an enumerator that can iterate through the fragment list. - - - - - Prepends a fragment to the list of fragments. - - The fragment to append. May not be null. - - - - Remove a fragment from the list of fragments. If this fragment was not in the list, an exception will be raised. - - The fragment to remove. May not be null. - - - - Remove all fragments from the list. - - - - - Remove a fragment from the list of fragments, using its index in the list. - - The index of the fragment to remove. - - - - Gets the Document - - - - - Gets the number of fragments contained in the list. - - - - - Gets a fragment from the list using its index. - - - - - Represents a fragment enumerator. - - - - - Advances the enumerator to the next element of the collection. - - true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection. - - - - Sets the enumerator to its initial position, which is before the first element in the collection. - - - - - Gets the current element in the collection. - - - - - Gets the current element in the collection. - - - - - A utility class to replace special characters by entities and vice-versa. - Follows HTML 4.0 specification found at http://www.w3.org/TR/html4/sgml/entities.html - - - - - Replace known entities by characters. - - The source text. - The result text. - - - - Clone and entitize an HtmlNode. This will affect attribute values and nodes' text. It will also entitize all child nodes. - - The node to entitize. - An entitized cloned node. - - - - Replace characters above 127 by entities. - - The source text. - The result text. - - - - Replace characters above 127 by entities. - - The source text. - If set to false, the function will not use known entities name. Default is true. - The result text. - - - - Replace characters above 127 by entities. - - The source text. - If set to false, the function will not use known entities name. Default is true. - If set to true, the [quote], [ampersand], [lower than] and [greather than] characters will be entitized. - The result text - - - - A collection of entities indexed by name. - - - - - A collection of entities indexed by value. - - - - - Represents the type of fragment in a mixed code document. - - - - - The fragment contains code. - - - - - The fragment contains text. - - - - - Represents the type of a node. - - - - - The root of a document. - - - - - An HTML element. - - - - - An HTML comment. - - - - - A text node is always the child of an element or a document node. - - - - - Represents an HTML navigator on an HTML document seen as a data store. - - - - - Initializes a new instance of the HtmlNavigator and loads an HTML document from a stream. - - The input stream. - - - - Initializes a new instance of the HtmlNavigator and loads an HTML document from a stream. - - The input stream. - Indicates whether to look for byte order marks at the beginning of the stream. - - - - Initializes a new instance of the HtmlNavigator and loads an HTML document from a stream. - - The input stream. - The character encoding to use. - - - - Initializes a new instance of the HtmlNavigator and loads an HTML document from a stream. - - The input stream. - The character encoding to use. - Indicates whether to look for byte order marks at the beginning of the stream. - - - - Initializes a new instance of the HtmlNavigator and loads an HTML document from a stream. - - The input stream. - The character encoding to use. - Indicates whether to look for byte order marks at the beginning of the stream. - The minimum buffer size. - - - - Initializes a new instance of the HtmlNavigator and loads an HTML document from a TextReader. - - The TextReader used to feed the HTML data into the document. - - - - Initializes a new instance of the HtmlNavigator and loads an HTML document from a file. - - The complete file path to be read. - - - - Initializes a new instance of the HtmlNavigator and loads an HTML document from a file. - - The complete file path to be read. - Indicates whether to look for byte order marks at the beginning of the file. - - - - Initializes a new instance of the HtmlNavigator and loads an HTML document from a file. - - The complete file path to be read. - The character encoding to use. - - - - Initializes a new instance of the HtmlNavigator and loads an HTML document from a file. - - The complete file path to be read. - The character encoding to use. - Indicates whether to look for byte order marks at the beginning of the file. - - - - Initializes a new instance of the HtmlNavigator and loads an HTML document from a file. - - The complete file path to be read. - The character encoding to use. - Indicates whether to look for byte order marks at the beginning of the file. - The minimum buffer size. - - - - Creates a new HtmlNavigator positioned at the same node as this HtmlNavigator. - - A new HtmlNavigator object positioned at the same node as the original HtmlNavigator. - - - - Gets the value of the HTML attribute with the specified LocalName and NamespaceURI. - - The local name of the HTML attribute. - The namespace URI of the attribute. Unsupported with the HtmlNavigator implementation. - The value of the specified HTML attribute. String.Empty or null if a matching attribute is not found or if the navigator is not positioned on an element node. - - - - Returns the value of the namespace node corresponding to the specified local name. - Always returns string.Empty for the HtmlNavigator implementation. - - The local name of the namespace node. - Always returns string.Empty for the HtmlNavigator implementation. - - - - Determines whether the current HtmlNavigator is at the same position as the specified HtmlNavigator. - - The HtmlNavigator that you want to compare against. - true if the two navigators have the same position, otherwise, false. - - - - Moves to the same position as the specified HtmlNavigator. - - The HtmlNavigator positioned on the node that you want to move to. - true if successful, otherwise false. If false, the position of the navigator is unchanged. - - - - Moves to the HTML attribute with matching LocalName and NamespaceURI. - - The local name of the HTML attribute. - The namespace URI of the attribute. Unsupported with the HtmlNavigator implementation. - true if the HTML attribute is found, otherwise, false. If false, the position of the navigator does not change. - - - - Moves to the first sibling of the current node. - - true if the navigator is successful moving to the first sibling node, false if there is no first sibling or if the navigator is currently positioned on an attribute node. - - - - Moves to the first HTML attribute. - - true if the navigator is successful moving to the first HTML attribute, otherwise, false. - - - - Moves to the first child of the current node. - - true if there is a first child node, otherwise false. - - - - Moves the XPathNavigator to the first namespace node of the current element. - Always returns false for the HtmlNavigator implementation. - - An XPathNamespaceScope value describing the namespace scope. - Always returns false for the HtmlNavigator implementation. - - - - Moves to the node that has an attribute of type ID whose value matches the specified string. - - A string representing the ID value of the node to which you want to move. This argument does not need to be atomized. - true if the move was successful, otherwise false. If false, the position of the navigator is unchanged. - - - - Moves the XPathNavigator to the namespace node with the specified local name. - Always returns false for the HtmlNavigator implementation. - - The local name of the namespace node. - Always returns false for the HtmlNavigator implementation. - - - - Moves to the next sibling of the current node. - - true if the navigator is successful moving to the next sibling node, false if there are no more siblings or if the navigator is currently positioned on an attribute node. If false, the position of the navigator is unchanged. - - - - Moves to the next HTML attribute. - - - - - - Moves the XPathNavigator to the next namespace node. - Always returns falsefor the HtmlNavigator implementation. - - An XPathNamespaceScope value describing the namespace scope. - Always returns false for the HtmlNavigator implementation. - - - - Moves to the parent of the current node. - - true if there is a parent node, otherwise false. - - - - Moves to the previous sibling of the current node. - - true if the navigator is successful moving to the previous sibling node, false if there is no previous sibling or if the navigator is currently positioned on an attribute node. - - - - Moves to the root node to which the current node belongs. - - - - - Gets the base URI for the current node. - Always returns string.Empty in the case of HtmlNavigator implementation. - - - - - Gets the current HTML document. - - - - - Gets the current HTML node. - - - - - Gets a value indicating whether the current node has child nodes. - - - - - Gets a value indicating whether the current node has child nodes. - - - - - Gets a value indicating whether the current node is an empty element. - - - - - Gets the name of the current HTML node without the namespace prefix. - - - - - Gets the qualified name of the current node. - - - - - Gets the namespace URI (as defined in the W3C Namespace Specification) of the current node. - Always returns string.Empty in the case of HtmlNavigator implementation. - - - - - Gets the associated with this implementation. - - - - - Gets the type of the current node. - - - - - Gets the prefix associated with the current node. - Always returns string.Empty in the case of HtmlNavigator implementation. - - - - - Gets the text value of the current node. - - - - - Gets the xml:lang scope for the current node. - Always returns string.Empty in the case of HtmlNavigator implementation. - - - - - Represents an HTML text node. - - - - - Represents an HTML node. - - - - - Creates a new XPathNavigator object for navigating this HTML node. - - An XPathNavigator object. The XPathNavigator is positioned on the node from which the method was called. It is not positioned on the root of the document. - - - - Creates an XPathNavigator using the root of this document. - - - - - - Selects a list of nodes matching the expression. - - The XPath expression. - An containing a collection of nodes matching the query, or null if no node matched the XPath expression. - - - - Selects the first XmlNode that matches the XPath expression. - - The XPath expression. May not be null. - The first that matches the XPath query or a null reference if no matching node was found. - - - - Gets the name of a comment node. It is actually defined as '#comment'. - - - - - Gets the name of the document node. It is actually defined as '#document'. - - - - - Gets the name of a text node. It is actually defined as '#text'. - - - - - Gets a collection of flags that define specific behaviors for specific element nodes. - The table contains a DictionaryEntry list with the lowercase tag name as the Key, and a combination of HtmlElementFlags as the Value. - - - - - Initialize HtmlNode. Builds a list of all tags that have special allowances - - - - - Initializes HtmlNode, providing type, owner and where it exists in a collection - - - - - - - - Determines if an element node can be kept overlapped. - - The name of the element node to check. May not be null. - true if the name is the name of an element node that can be kept overlapped, false otherwise. - - - - Creates an HTML node from a string representing literal HTML. - - The HTML text. - The newly created node instance. - - - - Determines if an element node is a CDATA element node. - - The name of the element node to check. May not be null. - true if the name is the name of a CDATA element node, false otherwise. - - - - Determines if an element node is closed. - - The name of the element node to check. May not be null. - true if the name is the name of a closed element node, false otherwise. - - - - Determines if an element node is defined as empty. - - The name of the element node to check. May not be null. - true if the name is the name of an empty element node, false otherwise. - - - - Determines if a text corresponds to the closing tag of an node that can be kept overlapped. - - The text to check. May not be null. - true or false. - - - - Returns a collection of all ancestor nodes of this element. - - - - - - Get Ancestors with matching name - - - - - - - Returns a collection of all ancestor nodes of this element. - - - - - - Gets all anscestor nodes and the current node - - - - - - - Adds the specified node to the end of the list of children of this node. - - The node to add. May not be null. - The node added. - - - - Adds the specified node to the end of the list of children of this node. - - The node list to add. May not be null. - - - - Gets all Attributes with name - - - - - - - Creates a duplicate of the node - - - - - - Creates a duplicate of the node and changes its name at the same time. - - The new name of the cloned node. May not be null. - The cloned node. - - - - Creates a duplicate of the node and changes its name at the same time. - - The new name of the cloned node. May not be null. - true to recursively clone the subtree under the specified node; false to clone only the node itself. - The cloned node. - - - - Creates a duplicate of the node. - - true to recursively clone the subtree under the specified node; false to clone only the node itself. - The cloned node. - - - - Creates a duplicate of the node and the subtree under it. - - The node to duplicate. May not be null. - - - - Creates a duplicate of the node. - - The node to duplicate. May not be null. - true to recursively clone the subtree under the specified node, false to clone only the node itself. - - - - Gets all Descendant nodes for this node and each of child nodes - - - - - - Returns a collection of all descendant nodes of this element, in document order - - - - - - Gets all Descendant nodes in enumerated list - - - - - - Get all descendant nodes with matching name - - - - - - - Returns a collection of all descendant nodes of this element, in document order - - - - - - Gets all descendant nodes including this node - - - - - - - Gets first generation child node matching name - - - - - - - Gets matching first generation child nodes matching name - - - - - - - Helper method to get the value of an attribute of this node. If the attribute is not found, the default value will be returned. - - The name of the attribute to get. May not be null. - The default value to return if not found. - The value of the attribute if found, the default value if not found. - - - - Helper method to get the value of an attribute of this node. If the attribute is not found, the default value will be returned. - - The name of the attribute to get. May not be null. - The default value to return if not found. - The value of the attribute if found, the default value if not found. - - - - Helper method to get the value of an attribute of this node. If the attribute is not found, the default value will be returned. - - The name of the attribute to get. May not be null. - The default value to return if not found. - The value of the attribute if found, the default value if not found. - - - - Inserts the specified node immediately after the specified reference node. - - The node to insert. May not be null. - The node that is the reference node. The newNode is placed after the refNode. - The node being inserted. - - - - Inserts the specified node immediately before the specified reference node. - - The node to insert. May not be null. - The node that is the reference node. The newChild is placed before this node. - The node being inserted. - - - - Adds the specified node to the beginning of the list of children of this node. - - The node to add. May not be null. - The node added. - - - - Adds the specified node list to the beginning of the list of children of this node. - - The node list to add. May not be null. - - - - Removes node from parent collection - - - - - Removes all the children and/or attributes of the current node. - - - - - Removes all the children of the current node. - - - - - Removes the specified child node. - - The node being removed. May not be null. - The node removed. - - - - Removes the specified child node. - - The node being removed. May not be null. - true to keep grand children of the node, false otherwise. - The node removed. - - - - Replaces the child node oldChild with newChild node. - - The new node to put in the child list. - The node being replaced in the list. - The node replaced. - - - - Helper method to set the value of an attribute of this node. If the attribute is not found, it will be created automatically. - - The name of the attribute to set. May not be null. - The value for the attribute. - The corresponding attribute instance. - - - - Saves all the children of the node to the specified TextWriter. - - The TextWriter to which you want to save. - - - - Saves all the children of the node to a string. - - The saved string. - - - - Saves the current node to the specified TextWriter. - - The TextWriter to which you want to save. - - - - Saves the current node to the specified XmlWriter. - - The XmlWriter to which you want to save. - - - - Saves the current node to a string. - - The saved string. - - - - Gets the collection of HTML attributes for this node. May not be null. - - - - - Gets all the children of the node. - - - - - Gets a value indicating if this node has been closed or not. - - - - - Gets the collection of HTML attributes for the closing tag. May not be null. - - - - - Gets the first child of the node. - - - - - Gets a value indicating whether the current node has any attributes. - - - - - Gets a value indicating whether this node has any child nodes. - - - - - Gets a value indicating whether the current node has any attributes on the closing tag. - - - - - Gets or sets the value of the 'id' HTML attribute. The document must have been parsed using the OptionUseIdAttribute set to true. - - - - - Gets or Sets the HTML between the start and end tags of the object. - - - - - Gets or Sets the text between the start and end tags of the object. - - - - - Gets the last child of the node. - - - - - Gets the line number of this node in the document. - - - - - Gets the column number of this node in the document. - - - - - Gets or sets this node's name. - - - - - Gets the HTML node immediately following this element. - - - - - Gets the type of this node. - - - - - The original unaltered name of the tag - - - - - Gets or Sets the object and its content in HTML. - - - - - Gets the to which this node belongs. - - - - - Gets the parent of this node (for nodes that can have parents). - - - - - Gets the node immediately preceding this node. - - - - - Gets the stream position of this node in the document, relative to the start of the document. - - - - - Gets a valid XPath string that points to this node - - - - - Gets or Sets the HTML between the start and end tags of the object. In the case of a text node, it is equals to OuterHtml. - - - - - Gets or Sets the object and its content in HTML. - - - - - Gets or Sets the text of the node. - - - - - Represents a complete HTML document. - - - - - Adds Debugging attributes to node. Default is false. - - - - - Defines if closing for non closed nodes must be done at the end or directly in the document. - Setting this to true can actually change how browsers render the page. Default is false. - - - - - Defines if non closed nodes will be checked at the end of parsing. Default is true. - - - - - Defines if a checksum must be computed for the document while parsing. Default is false. - - - - - Defines the default stream encoding to use. Default is System.Text.Encoding.Default. - - - - - Defines if source text must be extracted while parsing errors. - If the document has a lot of errors, or cascading errors, parsing performance can be dramatically affected if set to true. - Default is false. - - - - - Defines the maximum length of source text or parse errors. Default is 100. - - - - - Defines if LI, TR, TH, TD tags must be partially fixed when nesting errors are detected. Default is false. - - - - - Defines if output must conform to XML, instead of HTML. - - - - - Defines if attribute value output must be optimized (not bound with double quotes if it is possible). Default is false. - - - - - Defines if name must be output with it's original case. Useful for asp.net tags and attributes - - - - - Defines if name must be output in uppercase. Default is false. - - - - - Defines if declared encoding must be read from the document. - Declared encoding is determined using the meta http-equiv="content-type" content="text/html;charset=XXXXX" html node. - Default is true. - - - - - Defines the name of a node that will throw the StopperNodeException when found as an end node. Default is null. - - - - - Defines if the 'id' attribute must be specifically used. Default is true. - - - - - Defines if empty nodes must be written as closed during output. Default is false. - - - - - Creates an instance of an HTML document. - - - - - Gets a valid XML name. - - Any text. - A string that is a valid XML name. - - - - Applies HTML encoding to a specified string. - - The input string to encode. May not be null. - The encoded string. - - - - Determines if the specified character is considered as a whitespace character. - - The character to check. - true if if the specified character is considered as a whitespace character. - - - - Creates an HTML attribute with the specified name. - - The name of the attribute. May not be null. - The new HTML attribute. - - - - Creates an HTML attribute with the specified name. - - The name of the attribute. May not be null. - The value of the attribute. - The new HTML attribute. - - - - Creates an HTML comment node. - - The new HTML comment node. - - - - Creates an HTML comment node with the specified comment text. - - The comment text. May not be null. - The new HTML comment node. - - - - Creates an HTML element node with the specified name. - - The qualified name of the element. May not be null. - The new HTML node. - - - - Creates an HTML text node. - - The new HTML text node. - - - - Creates an HTML text node with the specified text. - - The text of the node. May not be null. - The new HTML text node. - - - - Detects the encoding of an HTML stream. - - The input stream. May not be null. - The detected encoding. - - - - Detects the encoding of an HTML text provided on a TextReader. - - The TextReader used to feed the HTML. May not be null. - The detected encoding. - - - - Detects the encoding of an HTML text. - - The input html text. May not be null. - The detected encoding. - - - - Gets the HTML node with the specified 'id' attribute value. - - The attribute id to match. May not be null. - The HTML node with the matching id or null if not found. - - - - Loads an HTML document from a stream. - - The input stream. - - - - Loads an HTML document from a stream. - - The input stream. - Indicates whether to look for byte order marks at the beginning of the stream. - - - - Loads an HTML document from a stream. - - The input stream. - The character encoding to use. - - - - Loads an HTML document from a stream. - - The input stream. - The character encoding to use. - Indicates whether to look for byte order marks at the beginning of the stream. - - - - Loads an HTML document from a stream. - - The input stream. - The character encoding to use. - Indicates whether to look for byte order marks at the beginning of the stream. - The minimum buffer size. - - - - Loads the HTML document from the specified TextReader. - - The TextReader used to feed the HTML data into the document. May not be null. - - - - Loads the HTML document from the specified string. - - String containing the HTML document to load. May not be null. - - - - Saves the HTML document to the specified stream. - - The stream to which you want to save. - - - - Saves the HTML document to the specified stream. - - The stream to which you want to save. May not be null. - The character encoding to use. May not be null. - - - - Saves the HTML document to the specified StreamWriter. - - The StreamWriter to which you want to save. - - - - Saves the HTML document to the specified TextWriter. - - The TextWriter to which you want to save. May not be null. - - - - Saves the HTML document to the specified XmlWriter. - - The XmlWriter to which you want to save. - - - - Detects the encoding of an HTML document from a file first, and then loads the file. - - The complete file path to be read. - - - - Detects the encoding of an HTML document from a file first, and then loads the file. - - The complete file path to be read. May not be null. - true to detect encoding, false otherwise. - - - - Detects the encoding of an HTML file. - - Path for the file containing the HTML document to detect. May not be null. - The detected encoding. - - - - Loads an HTML document from a file. - - The complete file path to be read. May not be null. - - - - Loads an HTML document from a file. - - The complete file path to be read. May not be null. - Indicates whether to look for byte order marks at the beginning of the file. - - - - Loads an HTML document from a file. - - The complete file path to be read. May not be null. - The character encoding to use. May not be null. - - - - Loads an HTML document from a file. - - The complete file path to be read. May not be null. - The character encoding to use. May not be null. - Indicates whether to look for byte order marks at the beginning of the file. - - - - Loads an HTML document from a file. - - The complete file path to be read. May not be null. - The character encoding to use. May not be null. - Indicates whether to look for byte order marks at the beginning of the file. - The minimum buffer size. - - - - Saves the mixed document to the specified file. - - The location of the file where you want to save the document. - - - - Saves the mixed document to the specified file. - - The location of the file where you want to save the document. May not be null. - The character encoding to use. May not be null. - - - - Creates a new XPathNavigator object for navigating this HTML document. - - An XPathNavigator object. The XPathNavigator is positioned on the root of the document. - - - - Gets the document CRC32 checksum if OptionComputeChecksum was set to true before parsing, 0 otherwise. - - - - - Gets the document's declared encoding. - Declared encoding is determined using the meta http-equiv="content-type" content="text/html;charset=XXXXX" html node. - - - - - Gets the root node of the document. - - - - - Gets the document's output encoding. - - - - - Gets a list of parse errors found in the document. - - - - - Gets the remaining text. - Will always be null if OptionStopperNodeName is null. - - - - - Gets the offset of Remainder in the original Html text. - If OptionStopperNodeName is null, this will return the length of the original Html text. - - - - - Gets the document's stream encoding. - - - - - Represents an HTML attribute. - - - - - Compares the current instance with another attribute. Comparison is based on attributes' name. - - An attribute to compare with this instance. - A 32-bit signed integer that indicates the relative order of the names comparison. - - - - Creates a duplicate of this attribute. - - The cloned attribute. - - - - Removes this attribute from it's parents collection - - - - - Gets the line number of this attribute in the document. - - - - - Gets the column number of this attribute in the document. - - - - - Gets the qualified name of the attribute. - - - - - Name of attribute with original case - - - - - Gets the HTML document to which this attribute belongs. - - - - - Gets the HTML node to which this attribute belongs. - - - - - Specifies what type of quote the data should be wrapped in - - - - - Gets the stream position of this attribute in the document, relative to the start of the document. - - - - - Gets or sets the value of the attribute. - - - - - Gets a valid XPath string that points to this Attribute - - - - - An Enum representing different types of Quotes used for surrounding attribute values - - - - - A single quote mark ' - - - - - A double quote mark " - - - - - Represents a combined list and collection of HTML nodes. - - - - - Initialize the HtmlNodeCollection with the base parent node - - The base node of the collection - - - - Add node to the collection - - - - - - Clears out the collection of HtmlNodes. Removes each nodes reference to parentnode, nextnode and prevnode - - - - - Gets existence of node in collection - - - - - - - Copy collection to array - - - - - - - Get Enumerator - - - - - - Get Explicit Enumerator - - - - - - Get index of node - - - - - - - Insert node at index - - - - - - - Remove node - - - - - - - Remove at index - - - - - - Get first instance of node in supplied collection - - - - - - - - Add node to the end of the collection - - - - - - Get first instance of node with name - - - - - - - Get index of node - - - - - - - Add node to the beginning of the collection - - - - - - Remove node at index - - - - - - - Replace node at index - - - - - - - Get all node descended from this collection - - - - - - Get all node descended from this collection with matching name - - - - - - Gets all first generation elements in collection - - - - - - Gets all first generation elements matching name - - - - - - - All first generation nodes in collection - - - - - - Gets a given node from the list. - - - - - Get node with tag name - - - - - - - Gets the number of elements actually contained in the list. - - - - - Is collection read only - - - - - Gets the node at the specified index. - - - - - Represents an HTML comment. - - - - - Gets or Sets the comment text of the node. - - - - - Gets or Sets the HTML between the start and end tags of the object. In the case of a text node, it is equals to OuterHtml. - - - - - Gets or Sets the object and its content in HTML. - - - - - Flags that describe the behavior of an Element node. - - - - - The node is a CDATA node. - - - - - The node is empty. META or IMG are example of such nodes. - - - - - The node will automatically be closed during parsing. - - - - - The node can overlap. - - - - - Represents the type of parsing error. - - - - - A tag was not closed. - - - - - A tag was not opened. - - - - - There is a charset mismatch between stream and declared (META) encoding. - - - - - An end tag was not required. - - - - - An end tag is invalid at this position. - - - - - A utility class to compute CRC32. - - - - - Compute a checksum for a given array of bytes. - - The array of bytes to compute the checksum for. - The computed checksum. - - - - Compute a checksum for a given string. - - The string to compute the checksum for. - The computed checksum. - - - - Represents a fragment of text in a mixed code document. - - - - - Gets the fragment text. - - - - - Represents a combined list and collection of HTML nodes. - - - - - Adds supplied item to collection - - - - - - Explicit clear - - - - - Retreives existence of supplied item - - - - - - - Copies collection to array - - - - - - - Get Explicit enumerator - - - - - - Explicit non-generic enumerator - - - - - - Retrieves the index for the supplied item, -1 if not found - - - - - - - Inserts given item into collection at supplied index - - - - - - - Explicit collection remove - - - - - - - Removes the attribute at the specified index. - - The index of the attribute to remove. - - - - Adds a new attribute to the collection with the given values - - - - - - - Inserts the specified attribute as the last attribute in the collection. - - The attribute to insert. May not be null. - The appended attribute. - - - - Creates and inserts a new attribute as the last attribute in the collection. - - The name of the attribute to insert. - The appended attribute. - - - - Creates and inserts a new attribute as the last attribute in the collection. - - The name of the attribute to insert. - The value of the attribute to insert. - The appended attribute. - - - - Checks for existance of attribute with given name - - - - - - - Inserts the specified attribute as the first node in the collection. - - The attribute to insert. May not be null. - The prepended attribute. - - - - Removes a given attribute from the list. - - The attribute to remove. May not be null. - - - - Removes an attribute from the list, using its name. If there are more than one attributes with this name, they will all be removed. - - The attribute's name. May not be null. - - - - Remove all attributes in the list. - - - - - Returns all attributes with specified name. Handles case insentivity - - Name of the attribute - - - - - Removes all attributes from the collection - - - - - Clears the attribute collection - - - - - Gets a given attribute from the list using its name. - - - - - Gets the number of elements actually contained in the list. - - - - - Gets readonly status of colelction - - - - - Gets the attribute at the specified index. - - - - - Represents an exception thrown by the HtmlWeb utility class. - - - - - Creates an instance of the HtmlWebException. - - The exception's message. - - - - Represents a parsing error found during document parsing. - - - - - Gets the type of error. - - - - - Gets the line number of this error in the document. - - - - - Gets the column number of this error in the document. - - - - - Gets a description for the error. - - - - - Gets the the full text of the line containing the error. - - - - - Gets the absolute stream position of this error in the document, relative to the start of the document. - - - - diff --git a/BuildTools/NOBuildTools.sln b/BuildTools/NOBuildTools.sln deleted file mode 100644 index 91cc28192c..0000000000 --- a/BuildTools/NOBuildTools.sln +++ /dev/null @@ -1,66 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NOBuildTools.SearchAndReplace", "SearchAndReplace\NOBuildTools.SearchAndReplace.csproj", "{CA71246E-CEB7-4399-B7C3-C5A18B5CC801}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NOBuildTools.SourceUpdater", "SourceUpdater\NOBuildTools.SourceUpdater.csproj", "{FE3B95E3-990A-4F82-92D5-6C26046C3EC2}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NOBuildTools.VersionUpdater", "VersionUpdater\NOBuildTools.VersionUpdater.csproj", "{3CDA84DA-CC00-49FE-B05F-EB12E38E5AF1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NOBuildTools.ReferenceAnalyzer", "ReferenceAnalyzer\NOBuildTools.ReferenceAnalyzer.csproj", "{C6CD402C-0B5B-45F2-9D96-4F670D379124}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|Mixed Platforms = Debug|Mixed Platforms - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|Mixed Platforms = Release|Mixed Platforms - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {CA71246E-CEB7-4399-B7C3-C5A18B5CC801}.Debug|Any CPU.ActiveCfg = Debug|x86 - {CA71246E-CEB7-4399-B7C3-C5A18B5CC801}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {CA71246E-CEB7-4399-B7C3-C5A18B5CC801}.Debug|Mixed Platforms.Build.0 = Debug|x86 - {CA71246E-CEB7-4399-B7C3-C5A18B5CC801}.Debug|x86.ActiveCfg = Debug|x86 - {CA71246E-CEB7-4399-B7C3-C5A18B5CC801}.Debug|x86.Build.0 = Debug|x86 - {CA71246E-CEB7-4399-B7C3-C5A18B5CC801}.Release|Any CPU.ActiveCfg = Release|x86 - {CA71246E-CEB7-4399-B7C3-C5A18B5CC801}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {CA71246E-CEB7-4399-B7C3-C5A18B5CC801}.Release|Mixed Platforms.Build.0 = Release|x86 - {CA71246E-CEB7-4399-B7C3-C5A18B5CC801}.Release|x86.ActiveCfg = Release|x86 - {CA71246E-CEB7-4399-B7C3-C5A18B5CC801}.Release|x86.Build.0 = Release|x86 - {FE3B95E3-990A-4F82-92D5-6C26046C3EC2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FE3B95E3-990A-4F82-92D5-6C26046C3EC2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FE3B95E3-990A-4F82-92D5-6C26046C3EC2}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {FE3B95E3-990A-4F82-92D5-6C26046C3EC2}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {FE3B95E3-990A-4F82-92D5-6C26046C3EC2}.Debug|x86.ActiveCfg = Debug|Any CPU - {FE3B95E3-990A-4F82-92D5-6C26046C3EC2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FE3B95E3-990A-4F82-92D5-6C26046C3EC2}.Release|Any CPU.Build.0 = Release|Any CPU - {FE3B95E3-990A-4F82-92D5-6C26046C3EC2}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {FE3B95E3-990A-4F82-92D5-6C26046C3EC2}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {FE3B95E3-990A-4F82-92D5-6C26046C3EC2}.Release|x86.ActiveCfg = Release|Any CPU - {3CDA84DA-CC00-49FE-B05F-EB12E38E5AF1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3CDA84DA-CC00-49FE-B05F-EB12E38E5AF1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3CDA84DA-CC00-49FE-B05F-EB12E38E5AF1}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {3CDA84DA-CC00-49FE-B05F-EB12E38E5AF1}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {3CDA84DA-CC00-49FE-B05F-EB12E38E5AF1}.Debug|x86.ActiveCfg = Debug|Any CPU - {3CDA84DA-CC00-49FE-B05F-EB12E38E5AF1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3CDA84DA-CC00-49FE-B05F-EB12E38E5AF1}.Release|Any CPU.Build.0 = Release|Any CPU - {3CDA84DA-CC00-49FE-B05F-EB12E38E5AF1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {3CDA84DA-CC00-49FE-B05F-EB12E38E5AF1}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {3CDA84DA-CC00-49FE-B05F-EB12E38E5AF1}.Release|x86.ActiveCfg = Release|Any CPU - {C6CD402C-0B5B-45F2-9D96-4F670D379124}.Debug|Any CPU.ActiveCfg = Debug|x86 - {C6CD402C-0B5B-45F2-9D96-4F670D379124}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {C6CD402C-0B5B-45F2-9D96-4F670D379124}.Debug|Mixed Platforms.Build.0 = Debug|x86 - {C6CD402C-0B5B-45F2-9D96-4F670D379124}.Debug|x86.ActiveCfg = Debug|x86 - {C6CD402C-0B5B-45F2-9D96-4F670D379124}.Debug|x86.Build.0 = Debug|x86 - {C6CD402C-0B5B-45F2-9D96-4F670D379124}.Release|Any CPU.ActiveCfg = Release|x86 - {C6CD402C-0B5B-45F2-9D96-4F670D379124}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {C6CD402C-0B5B-45F2-9D96-4F670D379124}.Release|Mixed Platforms.Build.0 = Release|x86 - {C6CD402C-0B5B-45F2-9D96-4F670D379124}.Release|x86.ActiveCfg = Release|x86 - {C6CD402C-0B5B-45F2-9D96-4F670D379124}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/BuildTools/ReferenceAnalyzer/ExceptionDisplayer.cs b/BuildTools/ReferenceAnalyzer/ExceptionDisplayer.cs deleted file mode 100644 index 7ee37edf1a..0000000000 --- a/BuildTools/ReferenceAnalyzer/ExceptionDisplayer.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Windows.Forms; -using System.Text; - -namespace NOBuildTools.ReferenceAnalyzer -{ - /// - /// Exception display helper - /// - internal static class ExceptionDisplayer - { - /// - /// Shows exception as string message box to the user - /// - /// modal parent - /// exception as any - public static void ShowException(IWin32Window parent, Exception exception) - { - string message = "An error is occured." + Environment.NewLine; - string detailsMessage = "Details: " + Environment.NewLine; - - while (null != exception) - { - detailsMessage += "Exception: " + exception.GetType().Name + Environment.NewLine; - detailsMessage += "Exception: " + exception.Message + Environment.NewLine; - - exception = exception.InnerException; - } - - MessageBox.Show(parent, message + detailsMessage, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } -} diff --git a/BuildTools/ReferenceAnalyzer/Form1.Designer.cs b/BuildTools/ReferenceAnalyzer/Form1.Designer.cs deleted file mode 100644 index b8409feb12..0000000000 --- a/BuildTools/ReferenceAnalyzer/Form1.Designer.cs +++ /dev/null @@ -1,117 +0,0 @@ -namespace NOBuildTools.ReferenceAnalyzer -{ - partial class Form1 - { - /// - /// Erforderliche Designervariable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Verwendete Ressourcen bereinigen. - /// - /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Vom Windows Form-Designer generierter Code - - /// - /// Erforderliche Methode für die Designerunterstützung. - /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. - /// - private void InitializeComponent() - { - this.LabelFile = new System.Windows.Forms.Label(); - this.ButttonChooseFile = new System.Windows.Forms.Button(); - this.TextBoxFile = new System.Windows.Forms.TextBox(); - this.ButtonStart = new System.Windows.Forms.Button(); - this.RichTextBoxLog = new System.Windows.Forms.RichTextBox(); - this.SuspendLayout(); - // - // LabelFile - // - this.LabelFile.AutoSize = true; - this.LabelFile.Location = new System.Drawing.Point(20, 28); - this.LabelFile.Name = "LabelFile"; - this.LabelFile.Size = new System.Drawing.Size(58, 13); - this.LabelFile.TabIndex = 6; - this.LabelFile.Text = "Output File"; - // - // ButttonChooseFile - // - this.ButttonChooseFile.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.ButttonChooseFile.Location = new System.Drawing.Point(459, 23); - this.ButttonChooseFile.Name = "ButttonChooseFile"; - this.ButttonChooseFile.Size = new System.Drawing.Size(40, 22); - this.ButttonChooseFile.TabIndex = 5; - this.ButttonChooseFile.Text = "..."; - this.ButttonChooseFile.UseVisualStyleBackColor = true; - this.ButttonChooseFile.Click += new System.EventHandler(this.ButttonChooseFile_Click); - // - // TextBoxFile - // - this.TextBoxFile.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.TextBoxFile.Location = new System.Drawing.Point(83, 25); - this.TextBoxFile.Name = "TextBoxFile"; - this.TextBoxFile.Size = new System.Drawing.Size(366, 20); - this.TextBoxFile.TabIndex = 4; - // - // ButtonStart - // - this.ButtonStart.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.ButtonStart.Location = new System.Drawing.Point(23, 59); - this.ButtonStart.Name = "ButtonStart"; - this.ButtonStart.Size = new System.Drawing.Size(476, 23); - this.ButtonStart.TabIndex = 8; - this.ButtonStart.Text = "Start"; - this.ButtonStart.UseVisualStyleBackColor = true; - this.ButtonStart.Click += new System.EventHandler(this.ButtonStart_Click); - // - // RichTextBoxLog - // - this.RichTextBoxLog.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.RichTextBoxLog.Location = new System.Drawing.Point(23, 109); - this.RichTextBoxLog.Name = "RichTextBoxLog"; - this.RichTextBoxLog.ReadOnly = true; - this.RichTextBoxLog.Size = new System.Drawing.Size(476, 282); - this.RichTextBoxLog.TabIndex = 7; - this.RichTextBoxLog.Text = ""; - // - // Form1 - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(526, 416); - this.Controls.Add(this.ButtonStart); - this.Controls.Add(this.RichTextBoxLog); - this.Controls.Add(this.LabelFile); - this.Controls.Add(this.ButttonChooseFile); - this.Controls.Add(this.TextBoxFile); - this.Name = "Form1"; - this.Text = "NOBuildTools.ReferenceAnalyzer"; - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Label LabelFile; - private System.Windows.Forms.Button ButttonChooseFile; - private System.Windows.Forms.TextBox TextBoxFile; - private System.Windows.Forms.Button ButtonStart; - private System.Windows.Forms.RichTextBox RichTextBoxLog; - } -} - diff --git a/BuildTools/ReferenceAnalyzer/Form1.cs b/BuildTools/ReferenceAnalyzer/Form1.cs deleted file mode 100644 index 9d969a3f9e..0000000000 --- a/BuildTools/ReferenceAnalyzer/Form1.cs +++ /dev/null @@ -1,74 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.IO; -using System.Drawing; -using System.Linq; -using System.Xml; -using System.Xml.Linq; -using System.Text; -using System.Windows.Forms; - -namespace NOBuildTools.ReferenceAnalyzer -{ - /// - /// Main form in the application - /// - public partial class Form1 : Form - { - #region - - /// - /// Creates an instance of the class - /// - public Form1() - { - InitializeComponent(); - } - - #endregion - - #region Methods - - private void LogAction(string message) - { - if (!String.IsNullOrWhiteSpace(message)) - RichTextBoxLog.Text = message + Environment.NewLine + RichTextBoxLog.Text; - this.Refresh(); - Application.DoEvents(); // not nice but okay for this simple one - } - - #endregion - - #region Trigger - - private void ButttonChooseFile_Click(object sender, EventArgs e) - { - SaveFileDialog dialog = new SaveFileDialog(); - dialog.Filter = "Xml Files(*.xml)|*.xml"; - if (DialogResult.OK == dialog.ShowDialog(this)) - TextBoxFile.Text = dialog.FileName; - } - - private void ButtonStart_Click(object sender, EventArgs e) - { - try - { - if (String.IsNullOrWhiteSpace(TextBoxFile.Text)) - return; - RichTextBoxLog.Clear(); - XDocument document = Parser.ParseReference(LogAction); - if (File.Exists(TextBoxFile.Text)) - File.Delete(TextBoxFile.Text); - document.Save(TextBoxFile.Text); - } - catch (Exception exception) - { - ExceptionDisplayer.ShowException(this, exception); - } - } - - #endregion - } -} diff --git a/BuildTools/ReferenceAnalyzer/Form1.resx b/BuildTools/ReferenceAnalyzer/Form1.resx deleted file mode 100644 index 1af7de150c..0000000000 --- a/BuildTools/ReferenceAnalyzer/Form1.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/BuildTools/ReferenceAnalyzer/NOBuildTools.ReferenceAnalyzer.csproj b/BuildTools/ReferenceAnalyzer/NOBuildTools.ReferenceAnalyzer.csproj deleted file mode 100644 index 7ab4d16076..0000000000 --- a/BuildTools/ReferenceAnalyzer/NOBuildTools.ReferenceAnalyzer.csproj +++ /dev/null @@ -1,91 +0,0 @@ - - - - Debug - x86 - 8.0.30703 - 2.0 - {C6CD402C-0B5B-45F2-9D96-4F670D379124} - WinExe - Properties - NOBuildTools.ReferenceAnalyzer - NOBuildTools.ReferenceAnalyzer - v4.0 - Client - 512 - - - x86 - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - x86 - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\Lib\HtmlAgilityPack.dll - - - - - - - - - - - - - - - Form - - - Form1.cs - - - - - - Form1.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - - - \ No newline at end of file diff --git a/BuildTools/ReferenceAnalyzer/Parser.cs b/BuildTools/ReferenceAnalyzer/Parser.cs deleted file mode 100644 index 3a07d296f3..0000000000 --- a/BuildTools/ReferenceAnalyzer/Parser.cs +++ /dev/null @@ -1,1803 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Xml; -using System.Xml.Linq; -using System.Text; -using HtmlAgilityPack; - -namespace NOBuildTools.ReferenceAnalyzer -{ - /// - /// Progress log action handler - /// - /// log action message - public delegate void LogAction(string message); - - internal static class Parser - { - #region Fields - - private static string _rootAdress = "http://msdn.microsoft.com/en-us"; - - private static string _excelTypesRelative = "/library/office/ff194068.aspx"; - private static string _excelEnumsRelative = "/library/office/ff838815.aspx"; - - private static string _accessTypesRelative = "/library/office/ff192120.aspx"; - private static string _accessEnumsRelative = "/library/office/jj713155.aspx"; - private static string _accessConstantsRelative = "/library/office/jj713057.aspx"; - - private static string _officeTypesRelative = "/library/office/ff861484.aspx"; - private static string _officeEnumsRelative = "/library/office/jj229676.aspx"; - - private static string _outlookTypesRelative = "/library/office/ff866465.aspx"; - private static string _outlookEnumsRelative = "/library/office/ff860961.aspx"; - - private static string _powerPointTypesRelative = "/library/office/ff743835.aspx"; - private static string _powerPointEnumsRelative = "/library/office/ff744042.aspx"; - - private static string _projectTypesRelative = "/library/office/ff920539(v=office.14).aspx"; - private static string _projectEnumsRelative = "/library/office/ff920788(v=office.14).aspx"; - - private static string _visioTypesRelative = "/library/ff765377(v=office.14).aspx"; - private static string _visioEnumsRelative = "/library/ff769457(v=office.14).aspx"; - - private static string _wordTypesRelative = "/library/office/ff837519.aspx"; - private static string _wordEnumsRelative = "/library/office/dn353221.aspx"; - - #endregion - - #region Parse Word - - /// - /// Parse Word Docu pages - /// - /// document to fill - /// progress handler - internal static void ParseWord(XDocument document, LogAction func) - { - XElement WordNode = new XElement("Word"); - (document.FirstNode as XElement).Add(WordNode); - ParseWordTypes(WordNode, func); - ParseWordEnums(WordNode, func); - ParseWordTypesMembers(WordNode, func); - } - - private static void ParseWordTypes(XElement excelNode, LogAction func) - { - func("Parse Word Types"); - - XElement rootNode = new XElement("Types"); - excelNode.Add(rootNode); - - int counter = 0; - string excelRootReferencePage = _rootAdress + _wordTypesRelative; - using (var client = new System.Net.WebClient()) - { - string pageContent = DownloadPage(client, excelRootReferencePage); - HtmlDocument doc = new HtmlDocument(); - doc.LoadHtml(pageContent); - var root = doc.DocumentNode; - - var divNodes = root.Descendants("div").ToList(); - foreach (var item in divNodes) - { - string className = item.GetAttributeValue("class", null); - if (className == "toclevel2") - { - string href = item.FirstChild.NextSibling.GetAttributeValue("href", null); - string name = item.FirstChild.NextSibling.GetAttributeValue("title", null); - if (null != href && null != name) - { - if (name.EndsWith(" Object", StringComparison.InvariantCultureIgnoreCase)) - { - name = name.Substring(0, name.Length - " Object".Length); - rootNode.Add(new XElement("Type", new XElement("Name", name), new XElement("Link", _rootAdress + href))); - counter++; - } - } - } - - } - } - - func(String.Format("{0} Word Types recieved", counter)); - } - - private static void ParseWordEnums(XElement excelNode, LogAction func) - { - func("Parse Word Enums"); - - XElement rootNode = new XElement("Enums"); - excelNode.Add(rootNode); - - int counter = 0; - string excelRootReferencePage = _rootAdress + _wordEnumsRelative; - using (var client = new System.Net.WebClient()) - { - string pageContent = DownloadPage(client, excelRootReferencePage); - HtmlDocument doc = new HtmlDocument(); - doc.LoadHtml(pageContent); - var root = doc.DocumentNode; - - var divNodes = root.Descendants("div").ToList(); - foreach (var item in divNodes) - { - string className = item.GetAttributeValue("class", null); - if (className == "toclevel2") - { - string href = item.FirstChild.NextSibling.GetAttributeValue("href", null); - string name = item.FirstChild.NextSibling.GetAttributeValue("title", null); - if (null != href && null != name) - { - name = name.Substring(0, name.Length - " Enumeration".Length); - rootNode.Add(new XElement("Enum", new XElement("Name", name), new XElement("Link", _rootAdress + href))); - counter++; - } - } - - } - - } - - func(String.Format("{0} Word Enums recieved", counter)); - } - - private static void ParseWordTypesMembers(XElement typeNode, LogAction func) - { - func("Parse Word Type Members"); - foreach (XElement item in typeNode.Element("Types").Elements("Type")) - { - ParseOfficeTypeMembers(item, func); - } - } - - private static void ParseWordTypeMembers(XElement typeNode, LogAction func) - { - XElement propsNode = new XElement("Properties"); - XElement methodsNode = new XElement("Methods"); - XElement eventsNode = new XElement("Events"); - typeNode.Add(propsNode); - typeNode.Add(methodsNode); - typeNode.Add(eventsNode); - - using (var client = new System.Net.WebClient()) - { - string pageLink = typeNode.Element("Link").Value; - string pageContent = DownloadPage(client, pageLink); - HtmlDocument doc = new HtmlDocument(); - doc.LoadHtml(pageContent); - var root = doc.DocumentNode; - - var divNodes = root.Descendants("div").ToList(); - foreach (var item in divNodes) - { - string className = item.GetAttributeValue("class", null); - if (className == "toclevel2") - { - string href = item.FirstChild.NextSibling.GetAttributeValue("href", null); - string name = item.FirstChild.NextSibling.GetAttributeValue("title", null); - if (null != href && null != name) - { - name = name.ToLower().Trim(); - switch (name) - { - case "properties": - propsNode.Add(new XAttribute("Link", XmlConvert.EncodeName(_rootAdress + href))); - ParseWordTypeProperties(propsNode, func); - break; - case "methods": - methodsNode.Add(new XAttribute("Link", XmlConvert.EncodeName(_rootAdress + href))); - ParseWordTypeMethods(methodsNode, func); - break; - case "events": - eventsNode.Add(new XAttribute("Link", XmlConvert.EncodeName(_rootAdress + href))); - ParseWordTypeEvents(eventsNode, func); - break; - default: - break; - } - } - } - } - } - } - - private static void ParseWordTypeProperties(XElement propertiesNode, LogAction func) - { - using (var client = new System.Net.WebClient()) - { - string pageLink = XmlConvert.DecodeName(propertiesNode.Attribute("Link").Value); - string pageContent = DownloadPage(client, pageLink); - HtmlDocument doc = new HtmlDocument(); - doc.LoadHtml(pageContent); - var root = doc.DocumentNode; - var divNodes = root.Descendants("div").ToList(); - foreach (var item in divNodes) - { - string className = item.GetAttributeValue("class", null); - if (className == "toclevel2") - { - string href = item.FirstChild.NextSibling.GetAttributeValue("href", null); - string name = item.FirstChild.NextSibling.GetAttributeValue("title", null); - if (null != href && null != name) - { - if (name.IndexOf(" ") > -1) - name = name.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries)[0]; - propertiesNode.Add(new XElement("Property", new XElement("Name", name), new XElement("Link", _rootAdress + href))); - func(""); - } - } - } - } - } - - private static void ParseWordTypeMethods(XElement propertiesNode, LogAction func) - { - using (var client = new System.Net.WebClient()) - { - string pageLink = XmlConvert.DecodeName(propertiesNode.Attribute("Link").Value); - string pageContent = DownloadPage(client, pageLink); - HtmlDocument doc = new HtmlDocument(); - doc.LoadHtml(pageContent); - var root = doc.DocumentNode; - var divNodes = root.Descendants("div").ToList(); - foreach (var item in divNodes) - { - string className = item.GetAttributeValue("class", null); - if (className == "toclevel2") - { - string href = item.FirstChild.NextSibling.GetAttributeValue("href", null); - string name = item.FirstChild.NextSibling.GetAttributeValue("title", null); - if (null != href && null != name) - { - if (name.IndexOf(" ") > -1) - name = name.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries)[0]; - propertiesNode.Add(new XElement("Method", new XElement("Name", name), new XElement("Link", _rootAdress + href))); - func(""); - } - } - } - } - } - - private static void ParseWordTypeEvents(XElement propertiesNode, LogAction func) - { - using (var client = new System.Net.WebClient()) - { - string pageLink = XmlConvert.DecodeName(propertiesNode.Attribute("Link").Value); - string pageContent = DownloadPage(client, pageLink); - HtmlDocument doc = new HtmlDocument(); - doc.LoadHtml(pageContent); - var root = doc.DocumentNode; - var divNodes = root.Descendants("div").ToList(); - foreach (var item in divNodes) - { - string className = item.GetAttributeValue("class", null); - if (className == "toclevel2") - { - string href = item.FirstChild.NextSibling.GetAttributeValue("href", null); - string name = item.FirstChild.NextSibling.GetAttributeValue("title", null); - if (null != href && null != name) - { - if (name.IndexOf(" ") > -1) - name = name.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries)[0]; - propertiesNode.Add(new XElement("Event", new XElement("Name", name), new XElement("Link", _rootAdress + href))); - func(""); - } - } - } - } - } - - #endregion - - #region Parse Project - - private static void ParseProjectTypes(XElement excelNode, LogAction func) - { - func("Parse Project Types"); - - XElement rootNode = new XElement("Types"); - excelNode.Add(rootNode); - - int counter = 0; - string excelRootReferencePage = _rootAdress + _projectTypesRelative; - using (var client = new System.Net.WebClient()) - { - string pageContent = DownloadPage(client, excelRootReferencePage); - HtmlDocument doc = new HtmlDocument(); - doc.LoadHtml(pageContent); - var root = doc.DocumentNode; - - var divNodes = root.Descendants("div").ToList(); - foreach (var item in divNodes) - { - string className = item.GetAttributeValue("class", null); - if (className == "toclevel2") - { - string href = item.FirstChild.NextSibling.GetAttributeValue("href", null); - string name = item.FirstChild.NextSibling.GetAttributeValue("title", null); - if (null != href && null != name) - { - if (name.EndsWith(" Object", StringComparison.InvariantCultureIgnoreCase)) - { - name = name.Substring(0, name.Length - " Object".Length); - rootNode.Add(new XElement("Type", new XElement("Name", name), new XElement("Link", _rootAdress + href))); - counter++; - } - } - } - - } - } - - func(String.Format("{0} Project Types recieved", counter)); - } - - private static void ParseProjectEnums(XElement excelNode, LogAction func) - { - func("Parse Project Enums"); - - XElement rootNode = new XElement("Enums"); - excelNode.Add(rootNode); - - int counter = 0; - string excelRootReferencePage = _rootAdress + _projectEnumsRelative; - using (var client = new System.Net.WebClient()) - { - string pageContent = DownloadPage(client, excelRootReferencePage); - HtmlDocument doc = new HtmlDocument(); - doc.LoadHtml(pageContent); - var root = doc.DocumentNode; - - var divNodes = root.Descendants("div").ToList(); - foreach (var item in divNodes) - { - string className = item.GetAttributeValue("class", null); - if (className == "toclevel2") - { - string href = item.FirstChild.NextSibling.GetAttributeValue("href", null); - string name = item.FirstChild.NextSibling.GetAttributeValue("title", null); - if (null != href && null != name) - { - name = name.Substring(0, name.Length - " Enumeration".Length); - rootNode.Add(new XElement("Enum", new XElement("Name", name), new XElement("Link", _rootAdress + href))); - counter++; - } - } - - } - - } - - func(String.Format("{0} Project Enums recieved", counter)); - } - - private static void ParseProjectTypesMembers(XElement typeNode, LogAction func) - { - func("Parse Project Type Members"); - foreach (XElement item in typeNode.Element("Types").Elements("Type")) - { - ParseOfficeTypeMembers(item, func); - } - } - - private static void ParseProjectTypeMembers(XElement typeNode, LogAction func) - { - XElement propsNode = new XElement("Properties"); - XElement methodsNode = new XElement("Methods"); - XElement eventsNode = new XElement("Events"); - typeNode.Add(propsNode); - typeNode.Add(methodsNode); - typeNode.Add(eventsNode); - - using (var client = new System.Net.WebClient()) - { - string pageLink = typeNode.Element("Link").Value; - string pageContent = DownloadPage(client, pageLink); - HtmlDocument doc = new HtmlDocument(); - doc.LoadHtml(pageContent); - var root = doc.DocumentNode; - - var divNodes = root.Descendants("div").ToList(); - foreach (var item in divNodes) - { - string className = item.GetAttributeValue("class", null); - if (className == "toclevel2") - { - string href = item.FirstChild.NextSibling.GetAttributeValue("href", null); - string name = item.FirstChild.NextSibling.GetAttributeValue("title", null); - if (null != href && null != name) - { - name = name.ToLower().Trim(); - switch (name) - { - case "properties": - propsNode.Add(new XAttribute("Link", XmlConvert.EncodeName(_rootAdress + href))); - ParseProjectTypeProperties(propsNode, func); - break; - case "methods": - methodsNode.Add(new XAttribute("Link", XmlConvert.EncodeName(_rootAdress + href))); - ParseProjectTypeMethods(methodsNode, func); - break; - case "events": - eventsNode.Add(new XAttribute("Link", XmlConvert.EncodeName(_rootAdress + href))); - ParseProjectTypeEvents(eventsNode, func); - break; - default: - break; - } - } - } - } - } - } - - private static void ParseProjectTypeProperties(XElement propertiesNode, LogAction func) - { - using (var client = new System.Net.WebClient()) - { - string pageLink = XmlConvert.DecodeName(propertiesNode.Attribute("Link").Value); - string pageContent = DownloadPage(client, pageLink); - HtmlDocument doc = new HtmlDocument(); - doc.LoadHtml(pageContent); - var root = doc.DocumentNode; - var divNodes = root.Descendants("div").ToList(); - foreach (var item in divNodes) - { - string className = item.GetAttributeValue("class", null); - if (className == "toclevel2") - { - string href = item.FirstChild.NextSibling.GetAttributeValue("href", null); - string name = item.FirstChild.NextSibling.GetAttributeValue("title", null); - if (null != href && null != name) - { - if (name.IndexOf(" ") > -1) - name = name.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries)[0]; - propertiesNode.Add(new XElement("Property", new XElement("Name", name), new XElement("Link", _rootAdress + href))); - func(""); - } - } - } - } - } - - private static void ParseProjectTypeMethods(XElement propertiesNode, LogAction func) - { - using (var client = new System.Net.WebClient()) - { - string pageLink = XmlConvert.DecodeName(propertiesNode.Attribute("Link").Value); - string pageContent = DownloadPage(client, pageLink); - HtmlDocument doc = new HtmlDocument(); - doc.LoadHtml(pageContent); - var root = doc.DocumentNode; - var divNodes = root.Descendants("div").ToList(); - foreach (var item in divNodes) - { - string className = item.GetAttributeValue("class", null); - if (className == "toclevel2") - { - string href = item.FirstChild.NextSibling.GetAttributeValue("href", null); - string name = item.FirstChild.NextSibling.GetAttributeValue("title", null); - if (null != href && null != name) - { - if (name.IndexOf(" ") > -1) - name = name.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries)[0]; - propertiesNode.Add(new XElement("Method", new XElement("Name", name), new XElement("Link", _rootAdress + href))); - func(""); - } - } - } - } - } - - private static void ParseProjectTypeEvents(XElement propertiesNode, LogAction func) - { - using (var client = new System.Net.WebClient()) - { - string pageLink = XmlConvert.DecodeName(propertiesNode.Attribute("Link").Value); - string pageContent = DownloadPage(client, pageLink); - HtmlDocument doc = new HtmlDocument(); - doc.LoadHtml(pageContent); - var root = doc.DocumentNode; - var divNodes = root.Descendants("div").ToList(); - foreach (var item in divNodes) - { - string className = item.GetAttributeValue("class", null); - if (className == "toclevel2") - { - string href = item.FirstChild.NextSibling.GetAttributeValue("href", null); - string name = item.FirstChild.NextSibling.GetAttributeValue("title", null); - if (null != href && null != name) - { - if (name.IndexOf(" ") > -1) - name = name.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries)[0]; - propertiesNode.Add(new XElement("Event", new XElement("Name", name), new XElement("Link", _rootAdress + href))); - func(""); - } - } - } - } - } - - #endregion - - #region Parse PowerPoint - - /// - /// Parse PPoint Docu pages - /// - /// document to fill - /// progress handler - internal static void ParsePowerPoint(XDocument document, LogAction func) - { - XElement pPointNode = new XElement("PowerPoint"); - (document.FirstNode as XElement).Add(pPointNode); - ParsePowerPointTypes(pPointNode, func); - ParsePowerPointEnums(pPointNode, func); - ParsePowerPointTypesMembers(pPointNode, func); - } - - private static void ParsePowerPointTypes(XElement excelNode, LogAction func) - { - func("Parse PowerPoint Types"); - - XElement rootNode = new XElement("Types"); - excelNode.Add(rootNode); - - int counter = 0; - string excelRootReferencePage = _rootAdress + _powerPointTypesRelative; - using (var client = new System.Net.WebClient()) - { - string pageContent = DownloadPage(client, excelRootReferencePage); - HtmlDocument doc = new HtmlDocument(); - doc.LoadHtml(pageContent); - var root = doc.DocumentNode; - - var divNodes = root.Descendants("div").ToList(); - foreach (var item in divNodes) - { - string className = item.GetAttributeValue("class", null); - if (className == "toclevel2") - { - string href = item.FirstChild.NextSibling.GetAttributeValue("href", null); - string name = item.FirstChild.NextSibling.GetAttributeValue("title", null); - if (null != href && null != name) - { - if (name.EndsWith(" Object", StringComparison.InvariantCultureIgnoreCase)) - { - name = name.Substring(0, name.Length - " Object".Length); - rootNode.Add(new XElement("Type", new XElement("Name", name), new XElement("Link", _rootAdress + href))); - counter++; - } - } - } - - } - } - - func(String.Format("{0} PowerPoint Types recieved", counter)); - } - - private static void ParsePowerPointEnums(XElement excelNode, LogAction func) - { - func("Parse PowerPoint Enums"); - - XElement rootNode = new XElement("Enums"); - excelNode.Add(rootNode); - - int counter = 0; - string excelRootReferencePage = _rootAdress + _powerPointEnumsRelative; - using (var client = new System.Net.WebClient()) - { - string pageContent = DownloadPage(client, excelRootReferencePage); - HtmlDocument doc = new HtmlDocument(); - doc.LoadHtml(pageContent); - var root = doc.DocumentNode; - - var divNodes = root.Descendants("div").ToList(); - foreach (var item in divNodes) - { - string className = item.GetAttributeValue("class", null); - if (className == "toclevel2") - { - string href = item.FirstChild.NextSibling.GetAttributeValue("href", null); - string name = item.FirstChild.NextSibling.GetAttributeValue("title", null); - if (null != href && null != name) - { - name = name.Substring(0, name.Length - " Enumeration".Length); - rootNode.Add(new XElement("Enum", new XElement("Name", name), new XElement("Link", _rootAdress + href))); - counter++; - } - } - - } - - } - - func(String.Format("{0} PowerPoint Enums recieved", counter)); - } - - private static void ParsePowerPointTypesMembers(XElement typeNode, LogAction func) - { - func("Parse PowerPoint Type Members"); - foreach (XElement item in typeNode.Element("Types").Elements("Type")) - { - ParseOfficeTypeMembers(item, func); - } - } - - private static void ParsePowerPointTypeMembers(XElement typeNode, LogAction func) - { - XElement propsNode = new XElement("Properties"); - XElement methodsNode = new XElement("Methods"); - XElement eventsNode = new XElement("Events"); - typeNode.Add(propsNode); - typeNode.Add(methodsNode); - typeNode.Add(eventsNode); - - using (var client = new System.Net.WebClient()) - { - string pageLink = typeNode.Element("Link").Value; - string pageContent = DownloadPage(client, pageLink); - HtmlDocument doc = new HtmlDocument(); - doc.LoadHtml(pageContent); - var root = doc.DocumentNode; - - var divNodes = root.Descendants("div").ToList(); - foreach (var item in divNodes) - { - string className = item.GetAttributeValue("class", null); - if (className == "toclevel2") - { - string href = item.FirstChild.NextSibling.GetAttributeValue("href", null); - string name = item.FirstChild.NextSibling.GetAttributeValue("title", null); - if (null != href && null != name) - { - name = name.ToLower().Trim(); - switch (name) - { - case "properties": - propsNode.Add(new XAttribute("Link", XmlConvert.EncodeName(_rootAdress + href))); - ParsePowerPointTypeProperties(propsNode, func); - break; - case "methods": - methodsNode.Add(new XAttribute("Link", XmlConvert.EncodeName(_rootAdress + href))); - ParsePowerPointTypeMethods(methodsNode, func); - break; - case "events": - eventsNode.Add(new XAttribute("Link", XmlConvert.EncodeName(_rootAdress + href))); - ParsePowerPointTypeEvents(eventsNode, func); - break; - default: - break; - } - } - } - } - } - } - - private static void ParsePowerPointTypeProperties(XElement propertiesNode, LogAction func) - { - using (var client = new System.Net.WebClient()) - { - string pageLink = XmlConvert.DecodeName(propertiesNode.Attribute("Link").Value); - string pageContent = DownloadPage(client, pageLink); - HtmlDocument doc = new HtmlDocument(); - doc.LoadHtml(pageContent); - var root = doc.DocumentNode; - var divNodes = root.Descendants("div").ToList(); - foreach (var item in divNodes) - { - string className = item.GetAttributeValue("class", null); - if (className == "toclevel2") - { - string href = item.FirstChild.NextSibling.GetAttributeValue("href", null); - string name = item.FirstChild.NextSibling.GetAttributeValue("title", null); - if (null != href && null != name) - { - if (name.IndexOf(" ") > -1) - name = name.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries)[0]; - propertiesNode.Add(new XElement("Property", new XElement("Name", name), new XElement("Link", _rootAdress + href))); - func(""); - } - } - } - } - } - - private static void ParsePowerPointTypeMethods(XElement propertiesNode, LogAction func) - { - using (var client = new System.Net.WebClient()) - { - string pageLink = XmlConvert.DecodeName(propertiesNode.Attribute("Link").Value); - string pageContent = DownloadPage(client, pageLink); - HtmlDocument doc = new HtmlDocument(); - doc.LoadHtml(pageContent); - var root = doc.DocumentNode; - var divNodes = root.Descendants("div").ToList(); - foreach (var item in divNodes) - { - string className = item.GetAttributeValue("class", null); - if (className == "toclevel2") - { - string href = item.FirstChild.NextSibling.GetAttributeValue("href", null); - string name = item.FirstChild.NextSibling.GetAttributeValue("title", null); - if (null != href && null != name) - { - if (name.IndexOf(" ") > -1) - name = name.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries)[0]; - propertiesNode.Add(new XElement("Method", new XElement("Name", name), new XElement("Link", _rootAdress + href))); - func(""); - } - } - } - } - } - - private static void ParsePowerPointTypeEvents(XElement propertiesNode, LogAction func) - { - using (var client = new System.Net.WebClient()) - { - string pageLink = XmlConvert.DecodeName(propertiesNode.Attribute("Link").Value); - string pageContent = DownloadPage(client, pageLink); - HtmlDocument doc = new HtmlDocument(); - doc.LoadHtml(pageContent); - var root = doc.DocumentNode; - var divNodes = root.Descendants("div").ToList(); - foreach (var item in divNodes) - { - string className = item.GetAttributeValue("class", null); - if (className == "toclevel2") - { - string href = item.FirstChild.NextSibling.GetAttributeValue("href", null); - string name = item.FirstChild.NextSibling.GetAttributeValue("title", null); - if (null != href && null != name) - { - if (name.IndexOf(" ") > -1) - name = name.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries)[0]; - propertiesNode.Add(new XElement("Event", new XElement("Name", name), new XElement("Link", _rootAdress + href))); - func(""); - } - } - } - } - } - - #endregion - - #region Parse Outlook - - /// - /// Parse Outlook Docu pages - /// - /// document to fill - /// progress handler - internal static void ParseOutlook(XDocument document, LogAction func) - { - XElement outlookNode = new XElement("Outlook"); - (document.FirstNode as XElement).Add(outlookNode); - ParseOutlookTypes(outlookNode, func); - ParseOutlookEnums(outlookNode, func); - ParseOutlookTypesMembers(outlookNode, func); - } - - private static void ParseOutlookTypes(XElement excelNode, LogAction func) - { - func("Parse Outlook Types"); - - XElement rootNode = new XElement("Types"); - excelNode.Add(rootNode); - - int counter = 0; - string excelRootReferencePage = _rootAdress + _outlookTypesRelative; - using (var client = new System.Net.WebClient()) - { - string pageContent = DownloadPage(client, excelRootReferencePage); - HtmlDocument doc = new HtmlDocument(); - doc.LoadHtml(pageContent); - var root = doc.DocumentNode; - - var divNodes = root.Descendants("div").ToList(); - foreach (var item in divNodes) - { - string className = item.GetAttributeValue("class", null); - if (className == "toclevel2") - { - string href = item.FirstChild.NextSibling.GetAttributeValue("href", null); - string name = item.FirstChild.NextSibling.GetAttributeValue("title", null); - if (null != href && null != name) - { - if (name.EndsWith(" Object", StringComparison.InvariantCultureIgnoreCase)) - { - name = name.Substring(0, name.Length - " Object".Length); - rootNode.Add(new XElement("Type", new XElement("Name", name), new XElement("Link", _rootAdress + href))); - counter++; - } - } - } - - } - } - - func(String.Format("{0} Outlook Types recieved", counter)); - } - - private static void ParseOutlookEnums(XElement excelNode, LogAction func) - { - func("Parse Outlook Enums"); - - XElement rootNode = new XElement("Enums"); - excelNode.Add(rootNode); - - int counter = 0; - string excelRootReferencePage = _rootAdress + _outlookEnumsRelative; - using (var client = new System.Net.WebClient()) - { - string pageContent = DownloadPage(client, excelRootReferencePage); - HtmlDocument doc = new HtmlDocument(); - doc.LoadHtml(pageContent); - var root = doc.DocumentNode; - - var divNodes = root.Descendants("div").ToList(); - foreach (var item in divNodes) - { - string className = item.GetAttributeValue("class", null); - if (className == "toclevel2") - { - string href = item.FirstChild.NextSibling.GetAttributeValue("href", null); - string name = item.FirstChild.NextSibling.GetAttributeValue("title", null); - if (null != href && null != name) - { - name = name.Substring(0, name.Length - " Enumeration".Length); - rootNode.Add(new XElement("Enum", new XElement("Name", name), new XElement("Link", _rootAdress + href))); - counter++; - } - } - - } - - } - - func(String.Format("{0} Outlook Enums recieved", counter)); - } - - private static void ParseOutlookTypesMembers(XElement typeNode, LogAction func) - { - func("Parse Outlook Type Members"); - foreach (XElement item in typeNode.Element("Types").Elements("Type")) - { - ParseOfficeTypeMembers(item, func); - } - } - - private static void ParseOutlookTypeMembers(XElement typeNode, LogAction func) - { - XElement propsNode = new XElement("Properties"); - XElement methodsNode = new XElement("Methods"); - XElement eventsNode = new XElement("Events"); - typeNode.Add(propsNode); - typeNode.Add(methodsNode); - typeNode.Add(eventsNode); - - using (var client = new System.Net.WebClient()) - { - string pageLink = typeNode.Element("Link").Value; - string pageContent = DownloadPage(client, pageLink); - HtmlDocument doc = new HtmlDocument(); - doc.LoadHtml(pageContent); - var root = doc.DocumentNode; - - var divNodes = root.Descendants("div").ToList(); - foreach (var item in divNodes) - { - string className = item.GetAttributeValue("class", null); - if (className == "toclevel2") - { - string href = item.FirstChild.NextSibling.GetAttributeValue("href", null); - string name = item.FirstChild.NextSibling.GetAttributeValue("title", null); - if (null != href && null != name) - { - name = name.ToLower().Trim(); - switch (name) - { - case "properties": - propsNode.Add(new XAttribute("Link", XmlConvert.EncodeName(_rootAdress + href))); - ParseOutlookTypeProperties(propsNode, func); - break; - case "methods": - methodsNode.Add(new XAttribute("Link", XmlConvert.EncodeName(_rootAdress + href))); - ParseOutlookTypeMethods(methodsNode, func); - break; - case "events": - eventsNode.Add(new XAttribute("Link", XmlConvert.EncodeName(_rootAdress + href))); - ParseOutlookTypeEvents(eventsNode, func); - break; - default: - break; - } - } - } - } - } - } - - private static void ParseOutlookTypeProperties(XElement propertiesNode, LogAction func) - { - using (var client = new System.Net.WebClient()) - { - string pageLink = XmlConvert.DecodeName(propertiesNode.Attribute("Link").Value); - string pageContent = DownloadPage(client, pageLink); - HtmlDocument doc = new HtmlDocument(); - doc.LoadHtml(pageContent); - var root = doc.DocumentNode; - var divNodes = root.Descendants("div").ToList(); - foreach (var item in divNodes) - { - string className = item.GetAttributeValue("class", null); - if (className == "toclevel2") - { - string href = item.FirstChild.NextSibling.GetAttributeValue("href", null); - string name = item.FirstChild.NextSibling.GetAttributeValue("title", null); - if (null != href && null != name) - { - if (name.IndexOf(" ") > -1) - name = name.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries)[0]; - propertiesNode.Add(new XElement("Property", new XElement("Name", name), new XElement("Link", _rootAdress + href))); - func(""); - } - } - } - } - } - - private static void ParseOutlookTypeMethods(XElement propertiesNode, LogAction func) - { - using (var client = new System.Net.WebClient()) - { - string pageLink = XmlConvert.DecodeName(propertiesNode.Attribute("Link").Value); - string pageContent = DownloadPage(client, pageLink); - HtmlDocument doc = new HtmlDocument(); - doc.LoadHtml(pageContent); - var root = doc.DocumentNode; - var divNodes = root.Descendants("div").ToList(); - foreach (var item in divNodes) - { - string className = item.GetAttributeValue("class", null); - if (className == "toclevel2") - { - string href = item.FirstChild.NextSibling.GetAttributeValue("href", null); - string name = item.FirstChild.NextSibling.GetAttributeValue("title", null); - if (null != href && null != name) - { - if (name.IndexOf(" ") > -1) - name = name.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries)[0]; - propertiesNode.Add(new XElement("Method", new XElement("Name", name), new XElement("Link", _rootAdress + href))); - func(""); - } - } - } - } - } - - private static void ParseOutlookTypeEvents(XElement propertiesNode, LogAction func) - { - using (var client = new System.Net.WebClient()) - { - string pageLink = XmlConvert.DecodeName(propertiesNode.Attribute("Link").Value); - string pageContent = DownloadPage(client, pageLink); - HtmlDocument doc = new HtmlDocument(); - doc.LoadHtml(pageContent); - var root = doc.DocumentNode; - var divNodes = root.Descendants("div").ToList(); - foreach (var item in divNodes) - { - string className = item.GetAttributeValue("class", null); - if (className == "toclevel2") - { - string href = item.FirstChild.NextSibling.GetAttributeValue("href", null); - string name = item.FirstChild.NextSibling.GetAttributeValue("title", null); - if (null != href && null != name) - { - if (name.IndexOf(" ") > -1) - name = name.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries)[0]; - propertiesNode.Add(new XElement("Event", new XElement("Name", name), new XElement("Link", _rootAdress + href))); - func(""); - } - } - } - } - } - - #endregion - - #region Parse Office - - /// - /// Parse Common Office Docu pages - /// - /// document to fill - /// progress handler - internal static void ParseOffice(XDocument document, LogAction func) - { - XElement officeNode = new XElement("Office"); - (document.FirstNode as XElement).Add(officeNode); - ParseOfficeTypes(officeNode, func); - ParseOfficeEnums(officeNode, func); - ParseOfficeTypesMembers(officeNode, func); - } - - private static void ParseOfficeTypes(XElement excelNode, LogAction func) - { - func("Parse Office Types"); - - XElement rootNode = new XElement("Types"); - excelNode.Add(rootNode); - - int counter = 0; - string excelRootReferencePage = _rootAdress + _officeTypesRelative; - using (var client = new System.Net.WebClient()) - { - string pageContent = DownloadPage(client, excelRootReferencePage); - HtmlDocument doc = new HtmlDocument(); - doc.LoadHtml(pageContent); - var root = doc.DocumentNode; - - var divNodes = root.Descendants("div").ToList(); - foreach (var item in divNodes) - { - string className = item.GetAttributeValue("class", null); - if (className == "toclevel2") - { - string href = item.FirstChild.NextSibling.GetAttributeValue("href", null); - string name = item.FirstChild.NextSibling.GetAttributeValue("title", null); - if (null != href && null != name) - { - if (name.EndsWith(" Object", StringComparison.InvariantCultureIgnoreCase)) - { - name = name.Substring(0, name.Length - " Object".Length); - rootNode.Add(new XElement("Type", new XElement("Name", name), new XElement("Link", _rootAdress + href))); - counter++; - } - } - } - - } - } - - func(String.Format("{0} Office Types recieved", counter)); - } - - private static void ParseOfficeEnums(XElement excelNode, LogAction func) - { - func("Parse Office Enums"); - - XElement rootNode = new XElement("Enums"); - excelNode.Add(rootNode); - - int counter = 0; - string excelRootReferencePage = _rootAdress + _officeEnumsRelative; - using (var client = new System.Net.WebClient()) - { - string pageContent = DownloadPage(client, excelRootReferencePage); - HtmlDocument doc = new HtmlDocument(); - doc.LoadHtml(pageContent); - var root = doc.DocumentNode; - - var divNodes = root.Descendants("div").ToList(); - foreach (var item in divNodes) - { - string className = item.GetAttributeValue("class", null); - if (className == "toclevel2") - { - string href = item.FirstChild.NextSibling.GetAttributeValue("href", null); - string name = item.FirstChild.NextSibling.GetAttributeValue("title", null); - if (null != href && null != name) - { - name = name.Substring(0, name.Length - " Enumeration".Length); - rootNode.Add(new XElement("Enum", new XElement("Name", name), new XElement("Link", _rootAdress + href))); - counter++; - } - } - - } - - } - - func(String.Format("{0} Office Enums recieved", counter)); - } - - private static void ParseOfficeTypesMembers(XElement typeNode, LogAction func) - { - func("Parse Office Type Members"); - foreach (XElement item in typeNode.Element("Types").Elements("Type")) - { - ParseOfficeTypeMembers(item, func); - } - } - - private static void ParseOfficeTypeMembers(XElement typeNode, LogAction func) - { - XElement propsNode = new XElement("Properties"); - XElement methodsNode = new XElement("Methods"); - XElement eventsNode = new XElement("Events"); - typeNode.Add(propsNode); - typeNode.Add(methodsNode); - typeNode.Add(eventsNode); - - using (var client = new System.Net.WebClient()) - { - string pageLink = typeNode.Element("Link").Value; - string pageContent = DownloadPage(client, pageLink); - HtmlDocument doc = new HtmlDocument(); - doc.LoadHtml(pageContent); - var root = doc.DocumentNode; - - var divNodes = root.Descendants("div").ToList(); - foreach (var item in divNodes) - { - string className = item.GetAttributeValue("class", null); - if (className == "toclevel2") - { - string href = item.FirstChild.NextSibling.GetAttributeValue("href", null); - string name = item.FirstChild.NextSibling.GetAttributeValue("title", null); - if (null != href && null != name) - { - name = name.ToLower().Trim(); - switch (name) - { - case "properties": - propsNode.Add(new XAttribute("Link", XmlConvert.EncodeName(_rootAdress + href))); - ParseOfficeTypeProperties(propsNode, func); - break; - case "methods": - methodsNode.Add(new XAttribute("Link", XmlConvert.EncodeName(_rootAdress + href))); - ParseOfficeTypeMethods(methodsNode, func); - break; - case "events": - eventsNode.Add(new XAttribute("Link", XmlConvert.EncodeName(_rootAdress + href))); - ParseOfficeTypeEvents(eventsNode, func); - break; - default: - break; - } - } - } - } - } - } - - private static void ParseOfficeTypeProperties(XElement propertiesNode, LogAction func) - { - using (var client = new System.Net.WebClient()) - { - string pageLink = XmlConvert.DecodeName(propertiesNode.Attribute("Link").Value); - string pageContent = DownloadPage(client, pageLink); - HtmlDocument doc = new HtmlDocument(); - doc.LoadHtml(pageContent); - var root = doc.DocumentNode; - var divNodes = root.Descendants("div").ToList(); - foreach (var item in divNodes) - { - string className = item.GetAttributeValue("class", null); - if (className == "toclevel2") - { - string href = item.FirstChild.NextSibling.GetAttributeValue("href", null); - string name = item.FirstChild.NextSibling.GetAttributeValue("title", null); - if (null != href && null != name) - { - if (name.IndexOf(" ") > -1) - name = name.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries)[0]; - propertiesNode.Add(new XElement("Property", new XElement("Name", name), new XElement("Link", _rootAdress + href))); - func(""); - } - } - } - } - } - - private static void ParseOfficeTypeMethods(XElement propertiesNode, LogAction func) - { - using (var client = new System.Net.WebClient()) - { - string pageLink = XmlConvert.DecodeName(propertiesNode.Attribute("Link").Value); - string pageContent = DownloadPage(client, pageLink); - HtmlDocument doc = new HtmlDocument(); - doc.LoadHtml(pageContent); - var root = doc.DocumentNode; - var divNodes = root.Descendants("div").ToList(); - foreach (var item in divNodes) - { - string className = item.GetAttributeValue("class", null); - if (className == "toclevel2") - { - string href = item.FirstChild.NextSibling.GetAttributeValue("href", null); - string name = item.FirstChild.NextSibling.GetAttributeValue("title", null); - if (null != href && null != name) - { - if (name.IndexOf(" ") > -1) - name = name.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries)[0]; - propertiesNode.Add(new XElement("Method", new XElement("Name", name), new XElement("Link", _rootAdress + href))); - func(""); - } - } - } - } - } - - private static void ParseOfficeTypeEvents(XElement propertiesNode, LogAction func) - { - using (var client = new System.Net.WebClient()) - { - string pageLink = XmlConvert.DecodeName(propertiesNode.Attribute("Link").Value); - string pageContent = DownloadPage(client, pageLink); - HtmlDocument doc = new HtmlDocument(); - doc.LoadHtml(pageContent); - var root = doc.DocumentNode; - var divNodes = root.Descendants("div").ToList(); - foreach (var item in divNodes) - { - string className = item.GetAttributeValue("class", null); - if (className == "toclevel2") - { - string href = item.FirstChild.NextSibling.GetAttributeValue("href", null); - string name = item.FirstChild.NextSibling.GetAttributeValue("title", null); - if (null != href && null != name) - { - if (name.IndexOf(" ") > -1) - name = name.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries)[0]; - propertiesNode.Add(new XElement("Event", new XElement("Name", name), new XElement("Link", _rootAdress + href))); - func(""); - } - } - } - } - } - - #endregion - - #region Parse Excel - - /// - /// Parse Excel Docu pages - /// - /// document to fill - /// progress handler - internal static void ParseExcel(XDocument document, LogAction func) - { - XElement excelNode = new XElement("Excel"); - (document.FirstNode as XElement).Add(excelNode); - ParseExcelTypes(excelNode, func); - ParseExcelEnums(excelNode, func); - ParseExcelTypesMembers(excelNode, func); - } - - private static void ParseExcelTypes(XElement excelNode, LogAction func) - { - func("Parse Excel Types"); - - XElement rootNode = new XElement("Types"); - excelNode.Add(rootNode); - - int counter = 0; - string excelRootReferencePage = _rootAdress + _excelTypesRelative; - using (var client = new System.Net.WebClient()) - { - string pageContent = DownloadPage(client, excelRootReferencePage); - HtmlDocument doc = new HtmlDocument(); - doc.LoadHtml(pageContent); - var root = doc.DocumentNode; - - var divNodes = root.Descendants("div").ToList(); - foreach (var item in divNodes) - { - string className = item.GetAttributeValue("class", null); - if (className == "toclevel2") - { - string href = item.FirstChild.NextSibling.GetAttributeValue("href", null); - string name = item.FirstChild.NextSibling.GetAttributeValue("title", null); - if (null != href && null != name) - { - if (name.EndsWith(" Object", StringComparison.InvariantCultureIgnoreCase)) - { - name = name.Substring(0, name.Length - " Object".Length); - rootNode.Add(new XElement("Type", new XElement("Name", name), new XElement("Link", _rootAdress + href))); - counter++; - } - } - } - - } - } - - func(String.Format("{0} Excel Types recieved", counter)); - } - - private static void ParseExcelEnums(XElement excelNode, LogAction func) - { - func("Parse Excel Enums"); - - XElement rootNode = new XElement("Enums"); - excelNode.Add(rootNode); - - int counter = 0; - string excelRootReferencePage = _rootAdress + _excelEnumsRelative; - using (var client = new System.Net.WebClient()) - { - string pageContent = DownloadPage(client, excelRootReferencePage); - HtmlDocument doc = new HtmlDocument(); - doc.LoadHtml(pageContent); - var root = doc.DocumentNode; - - var divNodes = root.Descendants("div").ToList(); - foreach (var item in divNodes) - { - string className = item.GetAttributeValue("class", null); - if (className == "toclevel2") - { - string href = item.FirstChild.NextSibling.GetAttributeValue("href", null); - string name = item.FirstChild.NextSibling.GetAttributeValue("title", null); - if (null != href && null != name) - { - name = name.Substring(0, name.Length - " Enumeration".Length); - rootNode.Add(new XElement("Enum", new XElement("Name", name), new XElement("Link", _rootAdress + href))); - counter++; - } - } - - } - - } - - func(String.Format("{0} Excel Enums recieved", counter)); - } - - private static void ParseExcelTypesMembers(XElement typeNode, LogAction func) - { - func("Parse Excel Type Members"); - foreach (XElement item in typeNode.Element("Types").Elements("Type")) - { - ParseExcelTypeMembers(item, func); - } - } - - private static void ParseExcelTypeMembers(XElement typeNode, LogAction func) - { - XElement propsNode = new XElement("Properties"); - XElement methodsNode = new XElement("Methods"); - XElement eventsNode = new XElement("Events"); - typeNode.Add(propsNode); - typeNode.Add(methodsNode); - typeNode.Add(eventsNode); - - using (var client = new System.Net.WebClient()) - { - string pageLink = typeNode.Element("Link").Value; - string pageContent = DownloadPage(client, pageLink); - HtmlDocument doc = new HtmlDocument(); - doc.LoadHtml(pageContent); - var root = doc.DocumentNode; - - var divNodes = root.Descendants("div").ToList(); - foreach (var item in divNodes) - { - string className = item.GetAttributeValue("class", null); - if (className == "toclevel2") - { - string href = item.FirstChild.NextSibling.GetAttributeValue("href", null); - string name = item.FirstChild.NextSibling.GetAttributeValue("title", null); - if (null != href && null != name) - { - name = name.ToLower().Trim(); - switch (name) - { - case "properties": - propsNode.Add(new XAttribute("Link", XmlConvert.EncodeName(_rootAdress + href))); - ParseExcelTypeProperties(propsNode, func); - break; - case "methods": - methodsNode.Add(new XAttribute("Link", XmlConvert.EncodeName(_rootAdress + href))); - ParseExcelTypeMethods(methodsNode, func); - break; - case "events": - eventsNode.Add(new XAttribute("Link", XmlConvert.EncodeName(_rootAdress + href))); - ParseExcelTypeEvents(eventsNode, func); - break; - default: - break; - } - } - } - } - } - } - - private static void ParseExcelTypeProperties(XElement propertiesNode, LogAction func) - { - using (var client = new System.Net.WebClient()) - { - string pageLink = XmlConvert.DecodeName(propertiesNode.Attribute("Link").Value); - string pageContent = DownloadPage(client, pageLink); - HtmlDocument doc = new HtmlDocument(); - doc.LoadHtml(pageContent); - var root = doc.DocumentNode; - var divNodes = root.Descendants("div").ToList(); - foreach (var item in divNodes) - { - string className = item.GetAttributeValue("class", null); - if (className == "toclevel2") - { - string href = item.FirstChild.NextSibling.GetAttributeValue("href", null); - string name = item.FirstChild.NextSibling.GetAttributeValue("title", null); - if (null != href && null != name) - { - if (name.IndexOf(" ") > -1) - name = name.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries)[0]; - propertiesNode.Add(new XElement("Property", new XElement("Name", name), new XElement("Link", _rootAdress + href))); - func(""); - } - } - } - } - } - - private static void ParseExcelTypeMethods(XElement propertiesNode, LogAction func) - { - using (var client = new System.Net.WebClient()) - { - string pageLink = XmlConvert.DecodeName(propertiesNode.Attribute("Link").Value); - string pageContent = DownloadPage(client, pageLink); - HtmlDocument doc = new HtmlDocument(); - doc.LoadHtml(pageContent); - var root = doc.DocumentNode; - var divNodes = root.Descendants("div").ToList(); - foreach (var item in divNodes) - { - string className = item.GetAttributeValue("class", null); - if (className == "toclevel2") - { - string href = item.FirstChild.NextSibling.GetAttributeValue("href", null); - string name = item.FirstChild.NextSibling.GetAttributeValue("title", null); - if (null != href && null != name) - { - if (name.IndexOf(" ") > -1) - name = name.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries)[0]; - propertiesNode.Add(new XElement("Method", new XElement("Name", name), new XElement("Link", _rootAdress + href))); - func(""); - } - } - } - } - } - - private static void ParseExcelTypeEvents(XElement propertiesNode, LogAction func) - { - using (var client = new System.Net.WebClient()) - { - string pageLink = XmlConvert.DecodeName(propertiesNode.Attribute("Link").Value); - string pageContent = DownloadPage(client, pageLink); - HtmlDocument doc = new HtmlDocument(); - doc.LoadHtml(pageContent); - var root = doc.DocumentNode; - var divNodes = root.Descendants("div").ToList(); - foreach (var item in divNodes) - { - string className = item.GetAttributeValue("class", null); - if (className == "toclevel2") - { - string href = item.FirstChild.NextSibling.GetAttributeValue("href", null); - string name = item.FirstChild.NextSibling.GetAttributeValue("title", null); - if (null != href && null != name) - { - if (name.IndexOf(" ") > -1) - name = name.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries)[0]; - propertiesNode.Add(new XElement("Event", new XElement("Name", name), new XElement("Link", _rootAdress + href))); - func(""); - } - } - } - } - } - - #endregion - - #region Parse Access - - /// - /// Parse Access Docu pages - /// - /// document to fill - /// progress handler - internal static void ParseAccess(XDocument document, LogAction func) - { - XElement accessNode = new XElement("Access"); - (document.FirstNode as XElement).Add(accessNode); - ParseAccessTypes(accessNode, func); - ParseAccessEnums(accessNode, func); - ParseAccessConstants(accessNode, func); - ParseAccessTypesMembers(accessNode, func); - } - - private static void ParseAccessTypes(XElement excelNode, LogAction func) - { - func("Parse Access Types"); - - XElement rootNode = new XElement("Types"); - excelNode.Add(rootNode); - - int counter = 0; - string excelRootReferencePage = _rootAdress + _accessTypesRelative; - using (var client = new System.Net.WebClient()) - { - string pageContent = DownloadPage(client, excelRootReferencePage); - HtmlDocument doc = new HtmlDocument(); - doc.LoadHtml(pageContent); - var root = doc.DocumentNode; - - var divNodes = root.Descendants("div").ToList(); - foreach (var item in divNodes) - { - string className = item.GetAttributeValue("class", null); - if (className == "toclevel2") - { - string href = item.FirstChild.NextSibling.GetAttributeValue("href", null); - string name = item.FirstChild.NextSibling.GetAttributeValue("title", null); - if (null != href && null != name) - { - if (name.EndsWith(" Object", StringComparison.InvariantCultureIgnoreCase)) - { - name = name.Substring(0, name.Length - " Object".Length); - rootNode.Add(new XElement("Type", new XElement("Name", name), new XElement("Link", _rootAdress + href))); - counter++; - } - } - } - - } - } - - func(String.Format("{0} Access Types recieved", counter)); - } - - private static void ParseAccessEnums(XElement excelNode, LogAction func) - { - func("Parse Access Enums"); - - XElement rootNode = new XElement("Enums"); - excelNode.Add(rootNode); - - int counter = 0; - string excelRootReferencePage = _rootAdress + _accessEnumsRelative; - using (var client = new System.Net.WebClient()) - { - string pageContent = DownloadPage(client, excelRootReferencePage); - HtmlDocument doc = new HtmlDocument(); - doc.LoadHtml(pageContent); - var root = doc.DocumentNode; - - var divNodes = root.Descendants("div").ToList(); - foreach (var item in divNodes) - { - string className = item.GetAttributeValue("class", null); - if (className == "toclevel2") - { - string href = item.FirstChild.NextSibling.GetAttributeValue("href", null); - string name = item.FirstChild.NextSibling.GetAttributeValue("title", null); - if (null != href && null != name) - { - name = name.Substring(0, name.Length - " Enumeration".Length); - - if (!name.Equals("OldConstants", StringComparison.InvariantCultureIgnoreCase)) - { - rootNode.Add(new XElement("Enum", new XElement("Name", name), new XElement("Link", _rootAdress + href))); - counter++; - } - } - } - - } - - } - - func(String.Format("{0} Access Enums recieved", counter)); - } - - private static void ParseAccessTypesMembers(XElement typeNode, LogAction func) - { - func("Parse Access Type Members"); - foreach (XElement item in typeNode.Element("Types").Elements("Type")) - { - ParseAccessTypeMembers(item, func); - } - } - - private static void ParseAccessTypeMembers(XElement typeNode, LogAction func) - { - XElement propsNode = new XElement("Properties"); - XElement methodsNode = new XElement("Methods"); - XElement eventsNode = new XElement("Events"); - typeNode.Add(propsNode); - typeNode.Add(methodsNode); - typeNode.Add(eventsNode); - - using (var client = new System.Net.WebClient()) - { - string pageLink = typeNode.Element("Link").Value; - string pageContent = DownloadPage(client, pageLink); - HtmlDocument doc = new HtmlDocument(); - doc.LoadHtml(pageContent); - var root = doc.DocumentNode; - - var divNodes = root.Descendants("div").ToList(); - foreach (var item in divNodes) - { - string className = item.GetAttributeValue("class", null); - if (className == "toclevel2") - { - string href = item.FirstChild.NextSibling.GetAttributeValue("href", null); - string name = item.FirstChild.NextSibling.GetAttributeValue("title", null); - if (null != href && null != name) - { - name = name.ToLower().Trim(); - switch (name) - { - case "properties": - propsNode.Add(new XAttribute("Link", XmlConvert.EncodeName(_rootAdress + href))); - ParseAccessTypeProperties(propsNode, func); - break; - case "methods": - methodsNode.Add(new XAttribute("Link", XmlConvert.EncodeName(_rootAdress + href))); - ParseAccessTypeMethods(methodsNode, func); - break; - case "events": - eventsNode.Add(new XAttribute("Link", XmlConvert.EncodeName(_rootAdress + href))); - ParseAccessTypeEvents(eventsNode, func); - break; - default: - break; - } - } - } - } - } - } - - private static void ParseAccessTypeProperties(XElement propertiesNode, LogAction func) - { - using (var client = new System.Net.WebClient()) - { - string pageLink = XmlConvert.DecodeName(propertiesNode.Attribute("Link").Value); - string pageContent = DownloadPage(client, pageLink); - HtmlDocument doc = new HtmlDocument(); - doc.LoadHtml(pageContent); - var root = doc.DocumentNode; - var divNodes = root.Descendants("div").ToList(); - foreach (var item in divNodes) - { - string className = item.GetAttributeValue("class", null); - if (className == "toclevel2") - { - string href = item.FirstChild.NextSibling.GetAttributeValue("href", null); - string name = item.FirstChild.NextSibling.GetAttributeValue("title", null); - if (null != href && null != name) - { - if (name.IndexOf(" ") > -1) - name = name.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries)[0]; - propertiesNode.Add(new XElement("Property", new XElement("Name", name), new XElement("Link", _rootAdress + href))); - func(""); - } - } - } - } - } - - private static void ParseAccessTypeMethods(XElement propertiesNode, LogAction func) - { - using (var client = new System.Net.WebClient()) - { - string pageLink = XmlConvert.DecodeName(propertiesNode.Attribute("Link").Value); - string pageContent = DownloadPage(client, pageLink); - HtmlDocument doc = new HtmlDocument(); - doc.LoadHtml(pageContent); - var root = doc.DocumentNode; - var divNodes = root.Descendants("div").ToList(); - foreach (var item in divNodes) - { - string className = item.GetAttributeValue("class", null); - if (className == "toclevel2") - { - string href = item.FirstChild.NextSibling.GetAttributeValue("href", null); - string name = item.FirstChild.NextSibling.GetAttributeValue("title", null); - if (null != href && null != name) - { - if (name.IndexOf(" ") > -1) - name = name.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries)[0]; - propertiesNode.Add(new XElement("Method", new XElement("Name", name), new XElement("Link", _rootAdress + href))); - func(""); - } - } - } - } - } - - private static void ParseAccessTypeEvents(XElement propertiesNode, LogAction func) - { - using (var client = new System.Net.WebClient()) - { - string pageLink = XmlConvert.DecodeName(propertiesNode.Attribute("Link").Value); - string pageContent = DownloadPage(client, pageLink); - HtmlDocument doc = new HtmlDocument(); - doc.LoadHtml(pageContent); - var root = doc.DocumentNode; - var divNodes = root.Descendants("div").ToList(); - foreach (var item in divNodes) - { - string className = item.GetAttributeValue("class", null); - if (className == "toclevel2") - { - string href = item.FirstChild.NextSibling.GetAttributeValue("href", null); - string name = item.FirstChild.NextSibling.GetAttributeValue("title", null); - if (null != href && null != name) - { - if (name.IndexOf(" ") > -1) - name = name.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries)[0]; - propertiesNode.Add(new XElement("Event", new XElement("Name", name), new XElement("Link", _rootAdress + href))); - func(""); - } - } - } - } - } - - private static void ParseAccessConstants(XElement excelNode, LogAction func) - { - func("Parse Access Constants"); - XElement constantNode = new XElement("OldConstants", _rootAdress + _accessConstantsRelative); - excelNode.Add(constantNode); - func(String.Format("{0} Access Contants recieved", 1)); - } - - #endregion - - #region Methods - - /// - /// Parse MSDN Docu pages for MS-Office - /// - /// document to fill - /// progress handler - internal static XDocument ParseReference(LogAction func) - { - func("Parse References "); - XDocument document = new XDocument(); - document.Add(new XElement("NOBuildTools.ReferenceAnalyzer")); - ParseExcel(document, func); - ParseAccess(document, func); - ParseOffice(document, func); - ParseOutlook(document, func); - ParsePowerPoint(document, func); - ParseWord(document, func); - func("Done!"); - - return document; - } - - private static string DownloadPage(System.Net.WebClient client, string uri) - { - try - { - string pageContent = client.DownloadString(uri); - return pageContent; - } - catch - { - return DownloadPage(client, uri); - } - } - - #endregion - - } -} diff --git a/BuildTools/ReferenceAnalyzer/Program.cs b/BuildTools/ReferenceAnalyzer/Program.cs deleted file mode 100644 index 1e96a63a31..0000000000 --- a/BuildTools/ReferenceAnalyzer/Program.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Windows.Forms; - -namespace NOBuildTools.ReferenceAnalyzer -{ - static class Program - { - /// - /// Der Haupteinstiegspunkt für die Anwendung. - /// - [STAThread] - static void Main() - { - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new Form1()); - } - } -} diff --git a/BuildTools/ReferenceAnalyzer/Properties/AssemblyInfo.cs b/BuildTools/ReferenceAnalyzer/Properties/AssemblyInfo.cs deleted file mode 100644 index a2fa71a348..0000000000 --- a/BuildTools/ReferenceAnalyzer/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// Allgemeine Informationen über eine Assembly werden über die folgenden -// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, -// die mit einer Assembly verknüpft sind. -[assembly: AssemblyTitle("NOBuildTools.ReferenceAnalyzer")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("NOBuildTools.ReferenceAnalyzer")] -[assembly: AssemblyCopyright("Copyright © 2013")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar -// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von -// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest. -[assembly: ComVisible(false)] - -// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird -[assembly: Guid("d4050595-94c2-4ef5-acfe-500aa84b4079")] - -// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: -// -// Hauptversion -// Nebenversion -// Buildnummer -// Revision -// -// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern -// übernehmen, indem Sie "*" eingeben: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/BuildTools/ReferenceAnalyzer/Properties/Resources.Designer.cs b/BuildTools/ReferenceAnalyzer/Properties/Resources.Designer.cs deleted file mode 100644 index 146a18ca6c..0000000000 --- a/BuildTools/ReferenceAnalyzer/Properties/Resources.Designer.cs +++ /dev/null @@ -1,71 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Dieser Code wurde von einem Tool generiert. -// Laufzeitversion:4.0.30319.1 -// -// Änderungen an dieser Datei können fehlerhaftes Verhalten verursachen und gehen verloren, wenn -// der Code neu generiert wird. -// -//------------------------------------------------------------------------------ - -namespace NOBuildTools.ReferenceAnalyzer.Properties -{ - - - /// - /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. - /// - // Diese Klasse wurde von der StronglyTypedResourceBuilder-Klasse - // über ein Tool wie ResGen oder Visual Studio automatisch generiert. - // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen - // mit der Option /str erneut aus, oder erstellen Sie Ihr VS-Projekt neu. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources - { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() - { - } - - /// - /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get - { - if ((resourceMan == null)) - { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NOBuildTools.ReferenceAnalyzer.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle - /// Ressourcenlookups, die diese stark typisierte Ressourcenklasse verwenden. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { - return resourceCulture; - } - set - { - resourceCulture = value; - } - } - } -} diff --git a/BuildTools/ReferenceAnalyzer/Properties/Resources.resx b/BuildTools/ReferenceAnalyzer/Properties/Resources.resx deleted file mode 100644 index af7dbebbac..0000000000 --- a/BuildTools/ReferenceAnalyzer/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/BuildTools/ReferenceAnalyzer/Properties/Settings.Designer.cs b/BuildTools/ReferenceAnalyzer/Properties/Settings.Designer.cs deleted file mode 100644 index 9cdc5d0769..0000000000 --- a/BuildTools/ReferenceAnalyzer/Properties/Settings.Designer.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.1 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace NOBuildTools.ReferenceAnalyzer.Properties -{ - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { - return defaultInstance; - } - } - } -} diff --git a/BuildTools/ReferenceAnalyzer/Properties/Settings.settings b/BuildTools/ReferenceAnalyzer/Properties/Settings.settings deleted file mode 100644 index 39645652af..0000000000 --- a/BuildTools/ReferenceAnalyzer/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/BuildTools/SearchAndReplace/ConfigManager.cs b/BuildTools/SearchAndReplace/ConfigManager.cs deleted file mode 100644 index a16b6d2de1..0000000000 --- a/BuildTools/SearchAndReplace/ConfigManager.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.IO; -using System.Xml; -using System.Xml.Linq; -using System.Text; - -namespace NOBuildTools.SearchAndReplace -{ - /// - /// Little helper to read and save config - /// - internal static class ConfigManager - { - /// - /// Save a configuration file - /// - /// target config file name - /// update folder - /// filter extension - /// search expression - /// replace value - public static void SaveConfigurationToXMLFile(string fullFileName, string targetFolder, string fileFilter, string search, string replace) - { - if (File.Exists(fullFileName)) - File.Delete(fullFileName); - - XDocument document = new XDocument(new XElement("NOBuildTools.SearchAndReplace")); - XElement root = document.FirstNode as XElement; - root.Add(new XElement("TargetFolder", XmlConvert.EncodeName(targetFolder))); - root.Add(new XElement("FileFilter", XmlConvert.EncodeName(fileFilter))); - root.Add(new XElement("Search", XmlConvert.EncodeName(search))); - root.Add(new XElement("Replace", XmlConvert.EncodeName(replace))); - - document.Save(fullFileName); - } - - /// - /// Load a configuration file - /// - /// target config file name - /// update folder - /// filter extension - /// search expression - /// replace value - public static void LoadConfigurationFromConfigFile(string fullFileName, ref string targetFolder, ref string fileFilter, ref string search, ref string replace) - { - if (!File.Exists(fullFileName)) - throw new FileNotFoundException(fullFileName); - - XDocument document = XDocument.Load(fullFileName); - XElement root = document.FirstNode as XElement; - if (root.Name != "NOBuildTools.SearchAndReplace") - throw new FormatException("Wrong Magic"); - - targetFolder = XmlConvert.DecodeName(root.Element("TargetFolder").Value); - fileFilter = XmlConvert.DecodeName(root.Element("FileFilter").Value); - search = XmlConvert.DecodeName(root.Element("Search").Value); - replace = XmlConvert.DecodeName(root.Element("Replace").Value); - } - } -} diff --git a/BuildTools/SearchAndReplace/ExceptionDisplayer.cs b/BuildTools/SearchAndReplace/ExceptionDisplayer.cs deleted file mode 100644 index 3ba0dfe518..0000000000 --- a/BuildTools/SearchAndReplace/ExceptionDisplayer.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Windows.Forms; -using System.Text; - -namespace NOBuildTools.SearchAndReplace -{ - /// - /// Exception display helper - /// - internal static class ExceptionDisplayer - { /// - /// Shows exception as string message box to the user - /// - /// modal parent - /// exception as any - public static void ShowException(IWin32Window parent, Exception exception) - { - string message = "An error is occured." + Environment.NewLine; - string detailsMessage = "Details: " + Environment.NewLine; - - while (null != exception) - { - detailsMessage += "Exception: " + exception.GetType().Name + Environment.NewLine; - detailsMessage += "Exception: " + exception.Message + Environment.NewLine; - - exception = exception.InnerException; - } - - MessageBox.Show(parent, message + detailsMessage, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } -} diff --git a/BuildTools/SearchAndReplace/Form1.Designer.cs b/BuildTools/SearchAndReplace/Form1.Designer.cs deleted file mode 100644 index ab2abb5f16..0000000000 --- a/BuildTools/SearchAndReplace/Form1.Designer.cs +++ /dev/null @@ -1,220 +0,0 @@ -namespace NOBuildTools.SearchAndReplace -{ - partial class Form1 - { - /// - /// Erforderliche Designervariable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Verwendete Ressourcen bereinigen. - /// - /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Vom Windows Form-Designer generierter Code - - /// - /// Erforderliche Methode für die Designerunterstützung. - /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. - /// - private void InitializeComponent() - { - this.TextBoxFolder = new System.Windows.Forms.TextBox(); - this.ButttonChooseFolder = new System.Windows.Forms.Button(); - this.RichTextBoxLog = new System.Windows.Forms.RichTextBox(); - this.LabelFolder = new System.Windows.Forms.Label(); - this.ButtonStart = new System.Windows.Forms.Button(); - this.TextBoxFilter = new System.Windows.Forms.TextBox(); - this.LabelFilter = new System.Windows.Forms.Label(); - this.LabelSearch = new System.Windows.Forms.Label(); - this.TextBoxSearch = new System.Windows.Forms.TextBox(); - this.TextBoxReplace = new System.Windows.Forms.TextBox(); - this.LabelReplace = new System.Windows.Forms.Label(); - this.ButtonLoadConfig = new System.Windows.Forms.Button(); - this.ButtonSaveConfig = new System.Windows.Forms.Button(); - this.SuspendLayout(); - // - // TextBoxFolder - // - this.TextBoxFolder.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.TextBoxFolder.Location = new System.Drawing.Point(67, 21); - this.TextBoxFolder.Name = "TextBoxFolder"; - this.TextBoxFolder.Size = new System.Drawing.Size(431, 20); - this.TextBoxFolder.TabIndex = 0; - // - // ButttonChooseFolder - // - this.ButttonChooseFolder.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.ButttonChooseFolder.Location = new System.Drawing.Point(507, 20); - this.ButttonChooseFolder.Name = "ButttonChooseFolder"; - this.ButttonChooseFolder.Size = new System.Drawing.Size(40, 22); - this.ButttonChooseFolder.TabIndex = 1; - this.ButttonChooseFolder.Text = "..."; - this.ButttonChooseFolder.UseVisualStyleBackColor = true; - this.ButttonChooseFolder.Click += new System.EventHandler(this.ButtonChooseFolder_Click); - // - // RichTextBoxLog - // - this.RichTextBoxLog.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.RichTextBoxLog.Location = new System.Drawing.Point(67, 209); - this.RichTextBoxLog.Name = "RichTextBoxLog"; - this.RichTextBoxLog.ReadOnly = true; - this.RichTextBoxLog.Size = new System.Drawing.Size(746, 282); - this.RichTextBoxLog.TabIndex = 2; - this.RichTextBoxLog.Text = ""; - // - // LabelFolder - // - this.LabelFolder.AutoSize = true; - this.LabelFolder.Location = new System.Drawing.Point(12, 24); - this.LabelFolder.Name = "LabelFolder"; - this.LabelFolder.Size = new System.Drawing.Size(49, 13); - this.LabelFolder.TabIndex = 3; - this.LabelFolder.Text = "Directory"; - // - // ButtonStart - // - this.ButtonStart.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.ButtonStart.Location = new System.Drawing.Point(67, 159); - this.ButtonStart.Name = "ButtonStart"; - this.ButtonStart.Size = new System.Drawing.Size(746, 23); - this.ButtonStart.TabIndex = 4; - this.ButtonStart.Text = "Start"; - this.ButtonStart.UseVisualStyleBackColor = true; - this.ButtonStart.Click += new System.EventHandler(this.ButtonStart_Click); - // - // TextBoxFilter - // - this.TextBoxFilter.Location = new System.Drawing.Point(67, 62); - this.TextBoxFilter.Multiline = true; - this.TextBoxFilter.Name = "TextBoxFilter"; - this.TextBoxFilter.Size = new System.Drawing.Size(141, 79); - this.TextBoxFilter.TabIndex = 5; - this.TextBoxFilter.Text = "*.csproj\r\n*.vbproj"; - // - // LabelFilter - // - this.LabelFilter.AutoSize = true; - this.LabelFilter.Location = new System.Drawing.Point(12, 64); - this.LabelFilter.Name = "LabelFilter"; - this.LabelFilter.Size = new System.Drawing.Size(29, 13); - this.LabelFilter.TabIndex = 6; - this.LabelFilter.Text = "Filter"; - // - // LabelSearch - // - this.LabelSearch.AutoSize = true; - this.LabelSearch.Location = new System.Drawing.Point(214, 63); - this.LabelSearch.Name = "LabelSearch"; - this.LabelSearch.Size = new System.Drawing.Size(41, 13); - this.LabelSearch.TabIndex = 7; - this.LabelSearch.Text = "Search"; - // - // TextBoxSearch - // - this.TextBoxSearch.Location = new System.Drawing.Point(261, 62); - this.TextBoxSearch.Multiline = true; - this.TextBoxSearch.Name = "TextBoxSearch"; - this.TextBoxSearch.Size = new System.Drawing.Size(237, 79); - this.TextBoxSearch.TabIndex = 8; - this.TextBoxSearch.Text = "True"; - // - // TextBoxReplace - // - this.TextBoxReplace.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.TextBoxReplace.Location = new System.Drawing.Point(557, 62); - this.TextBoxReplace.Multiline = true; - this.TextBoxReplace.Name = "TextBoxReplace"; - this.TextBoxReplace.Size = new System.Drawing.Size(256, 79); - this.TextBoxReplace.TabIndex = 10; - this.TextBoxReplace.Text = "False"; - // - // LabelReplace - // - this.LabelReplace.AutoSize = true; - this.LabelReplace.Location = new System.Drawing.Point(504, 63); - this.LabelReplace.Name = "LabelReplace"; - this.LabelReplace.Size = new System.Drawing.Size(47, 13); - this.LabelReplace.TabIndex = 9; - this.LabelReplace.Text = "Replace"; - // - // ButtonLoadConfig - // - this.ButtonLoadConfig.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.ButtonLoadConfig.Location = new System.Drawing.Point(558, 18); - this.ButtonLoadConfig.Name = "ButtonLoadConfig"; - this.ButtonLoadConfig.Size = new System.Drawing.Size(127, 27); - this.ButtonLoadConfig.TabIndex = 11; - this.ButtonLoadConfig.Text = "Load Config"; - this.ButtonLoadConfig.UseVisualStyleBackColor = true; - this.ButtonLoadConfig.Click += new System.EventHandler(this.ButtonLoadConfig_Click); - // - // ButtonSaveConfig - // - this.ButtonSaveConfig.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.ButtonSaveConfig.Location = new System.Drawing.Point(697, 18); - this.ButtonSaveConfig.Name = "ButtonSaveConfig"; - this.ButtonSaveConfig.Size = new System.Drawing.Size(116, 27); - this.ButtonSaveConfig.TabIndex = 12; - this.ButtonSaveConfig.Text = "Save Config"; - this.ButtonSaveConfig.UseVisualStyleBackColor = true; - this.ButtonSaveConfig.Click += new System.EventHandler(this.ButtonSaveConfig_Click); - // - // Form1 - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(839, 512); - this.Controls.Add(this.ButtonSaveConfig); - this.Controls.Add(this.ButtonLoadConfig); - this.Controls.Add(this.TextBoxReplace); - this.Controls.Add(this.LabelReplace); - this.Controls.Add(this.TextBoxSearch); - this.Controls.Add(this.LabelSearch); - this.Controls.Add(this.LabelFilter); - this.Controls.Add(this.TextBoxFilter); - this.Controls.Add(this.ButtonStart); - this.Controls.Add(this.LabelFolder); - this.Controls.Add(this.RichTextBoxLog); - this.Controls.Add(this.ButttonChooseFolder); - this.Controls.Add(this.TextBoxFolder); - this.Name = "Form1"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "NOBuildTools.SearchAndReplace"; - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.TextBox TextBoxFolder; - private System.Windows.Forms.Button ButttonChooseFolder; - private System.Windows.Forms.RichTextBox RichTextBoxLog; - private System.Windows.Forms.Label LabelFolder; - private System.Windows.Forms.Button ButtonStart; - private System.Windows.Forms.TextBox TextBoxFilter; - private System.Windows.Forms.Label LabelFilter; - private System.Windows.Forms.Label LabelSearch; - private System.Windows.Forms.TextBox TextBoxSearch; - private System.Windows.Forms.TextBox TextBoxReplace; - private System.Windows.Forms.Label LabelReplace; - private System.Windows.Forms.Button ButtonLoadConfig; - private System.Windows.Forms.Button ButtonSaveConfig; - } -} - diff --git a/BuildTools/SearchAndReplace/Form1.cs b/BuildTools/SearchAndReplace/Form1.cs deleted file mode 100644 index 6663d610a9..0000000000 --- a/BuildTools/SearchAndReplace/Form1.cs +++ /dev/null @@ -1,112 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.IO; -using System.Text; -using System.Windows.Forms; - -namespace NOBuildTools.SearchAndReplace -{ - /// - /// Main form in the application - /// - public partial class Form1 : Form - { - #region Ctor - - /// - /// Creates an instance of the class - /// - public Form1() - { - InitializeComponent(); - TextBoxFolder.Text = Application.StartupPath; - } - - #endregion - - #region Methods - - private void LogAction(string message) - { - if(!String.IsNullOrWhiteSpace(message)) - RichTextBoxLog.Text = message + Environment.NewLine + RichTextBoxLog.Text; - this.Refresh(); - } - - #endregion - - #region Triger - - private void ButtonChooseFolder_Click(object sender, EventArgs e) - { - FolderBrowserDialog dlg = new FolderBrowserDialog(); - if (dlg.ShowDialog() == DialogResult.Cancel) - return; - TextBoxFolder.Text = dlg.SelectedPath; - } - - private void ButtonStart_Click(object sender, EventArgs e) - { - try - { - RichTextBoxLog.Clear(); - SearchAndReplaceManager.SearchAndReplace(TextBoxFolder.Text, TextBoxFilter.Text, TextBoxSearch.Text, TextBoxReplace.Text, LogAction); - } - catch (Exception exception) - { - ExceptionDisplayer.ShowException(this, exception); - } - } - - private void ButtonSaveConfig_Click(object sender, EventArgs e) - { - try - { - SaveFileDialog dlg = new SaveFileDialog(); - dlg.InitialDirectory = Application.StartupPath; - dlg.Filter = "Xml Files(*.xml)|*.xml"; - if (dlg.ShowDialog(this) == DialogResult.Cancel) - return; - - ConfigManager.SaveConfigurationToXMLFile(dlg.FileName, TextBoxFolder.Text, TextBoxFilter.Text, TextBoxSearch.Text, TextBoxReplace.Text); - } - catch (Exception exception) - { - ExceptionDisplayer.ShowException(this, exception); - } - } - - private void ButtonLoadConfig_Click(object sender, EventArgs e) - { - try - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.InitialDirectory = Application.StartupPath; - dlg.Filter = "Xml Files(*.xml)|*.xml"; - if (dlg.ShowDialog(this) == DialogResult.Cancel) - return; - - string targetFolder = string.Empty; - string filter = string.Empty; - string search = string.Empty; - string replace = string.Empty; - - ConfigManager.LoadConfigurationFromConfigFile(dlg.FileName, ref targetFolder, ref filter, ref search, ref replace); - - TextBoxFolder.Text = targetFolder; - TextBoxFilter.Text = filter; - TextBoxSearch.Text = search; - TextBoxReplace.Text = replace; - } - catch (Exception exception) - { - ExceptionDisplayer.ShowException(this, exception); - } - } - - #endregion - } -} diff --git a/BuildTools/SearchAndReplace/Form1.resx b/BuildTools/SearchAndReplace/Form1.resx deleted file mode 100644 index 1af7de150c..0000000000 --- a/BuildTools/SearchAndReplace/Form1.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/BuildTools/SearchAndReplace/NOBuildTools.SearchAndReplace.csproj b/BuildTools/SearchAndReplace/NOBuildTools.SearchAndReplace.csproj deleted file mode 100644 index ccd77dabe6..0000000000 --- a/BuildTools/SearchAndReplace/NOBuildTools.SearchAndReplace.csproj +++ /dev/null @@ -1,90 +0,0 @@ - - - - Debug - x86 - 8.0.30703 - 2.0 - {CA71246E-CEB7-4399-B7C3-C5A18B5CC801} - WinExe - Properties - NOBuildTools.SearchAndReplace - NOBuildTools.SearchAndReplace - v4.0 - Client - 512 - - - x86 - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - x86 - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - Form - - - Form1.cs - - - - - - Form1.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - True - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - - - \ No newline at end of file diff --git a/BuildTools/SearchAndReplace/Program.cs b/BuildTools/SearchAndReplace/Program.cs deleted file mode 100644 index 1265546edb..0000000000 --- a/BuildTools/SearchAndReplace/Program.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Windows.Forms; - -namespace NOBuildTools.SearchAndReplace -{ - static class Program - { - /// - /// Der Haupteinstiegspunkt für die Anwendung. - /// - [STAThread] - static void Main() - { - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new Form1()); - } - } -} diff --git a/BuildTools/SearchAndReplace/Properties/AssemblyInfo.cs b/BuildTools/SearchAndReplace/Properties/AssemblyInfo.cs deleted file mode 100644 index 4a72587203..0000000000 --- a/BuildTools/SearchAndReplace/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// Allgemeine Informationen über eine Assembly werden über die folgenden -// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, -// die mit einer Assembly verknüpft sind. -[assembly: AssemblyTitle("NOBuildTools.SearchAndReplace")] -[assembly: AssemblyDescription("Search And Replace in Files")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("http://netoffice.codeplex.com")] -[assembly: AssemblyCopyright("Copyright © 2013 Sebastian Lange")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar -// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von -// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest. -[assembly: ComVisible(false)] - -// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird -[assembly: Guid("acbaadf2-d4f0-4c3d-a604-de6b16f01e90")] - -// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: -// -// Hauptversion -// Nebenversion -// Buildnummer -// Revision -// -// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern -// übernehmen, indem Sie "*" eingeben: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/BuildTools/SearchAndReplace/Properties/Resources.Designer.cs b/BuildTools/SearchAndReplace/Properties/Resources.Designer.cs deleted file mode 100644 index 508e25e733..0000000000 --- a/BuildTools/SearchAndReplace/Properties/Resources.Designer.cs +++ /dev/null @@ -1,63 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Dieser Code wurde von einem Tool generiert. -// Laufzeitversion:4.0.30319.1 -// -// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn -// der Code erneut generiert wird. -// -//------------------------------------------------------------------------------ - -namespace NOBuildTools.SearchAndReplace.Properties { - using System; - - - /// - /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. - /// - // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert - // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. - // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen - // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NOBuildTools.SearchAndReplace.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle - /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - } -} diff --git a/BuildTools/SearchAndReplace/Properties/Resources.resx b/BuildTools/SearchAndReplace/Properties/Resources.resx deleted file mode 100644 index af7dbebbac..0000000000 --- a/BuildTools/SearchAndReplace/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/BuildTools/SearchAndReplace/Properties/Settings.Designer.cs b/BuildTools/SearchAndReplace/Properties/Settings.Designer.cs deleted file mode 100644 index 005abfc523..0000000000 --- a/BuildTools/SearchAndReplace/Properties/Settings.Designer.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Dieser Code wurde von einem Tool generiert. -// Laufzeitversion:4.0.30319.1 -// -// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn -// der Code erneut generiert wird. -// -//------------------------------------------------------------------------------ - -namespace NOBuildTools.SearchAndReplace.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default { - get { - return defaultInstance; - } - } - } -} diff --git a/BuildTools/SearchAndReplace/Properties/Settings.settings b/BuildTools/SearchAndReplace/Properties/Settings.settings deleted file mode 100644 index 39645652af..0000000000 --- a/BuildTools/SearchAndReplace/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/BuildTools/SearchAndReplace/SearchAndReplaceManager.cs b/BuildTools/SearchAndReplace/SearchAndReplaceManager.cs deleted file mode 100644 index f4310d8ed0..0000000000 --- a/BuildTools/SearchAndReplace/SearchAndReplaceManager.cs +++ /dev/null @@ -1,256 +0,0 @@ -using System; -using System.IO; -using System.Windows.Forms; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace NOBuildTools.SearchAndReplace -{ - /// Progress log action handler - /// - /// log action message - public delegate void LogAction(string message); - - /// - /// Search and replace logic for text files - /// - internal static class SearchAndReplaceManager - { - /// - /// Read all files in a directory and replace arg search with arg replace in file content(s) - /// - /// target root directory - /// exclude filter as file extension - /// search expression - /// replace value - /// log handler - public static void SearchAndReplace(string directoryName, string fileFilter, string search, string replace, LogAction func) - { - if (!Directory.Exists(directoryName)) - throw new DirectoryNotFoundException(directoryName); - if (null == func || String.IsNullOrWhiteSpace(replace) || String.IsNullOrWhiteSpace(search) || String.IsNullOrWhiteSpace(fileFilter) || String.IsNullOrWhiteSpace(directoryName)) - throw new ArgumentNullException(); - - string[] filterArray = BuildFilterArray(fileFilter); - string[] searchArray = BuildSearchArray(search); - string[] replaceArray = BuildReplaceArray(replace); - if (searchArray.Length != replaceArray.Length) - throw new FormatException("Search and Repleace terms count must equal"); - SearchAndReplace(directoryName, filterArray, searchArray, replaceArray, func); - } - - private static string[] BuildFilterArray(string fileFilter) - { - List list = new List(); - if (!String.IsNullOrWhiteSpace(fileFilter)) - { - string[] tempArray = fileFilter.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries); - foreach (var item in tempArray) - list.Add(item.Trim()); - if (list.Count == 0) - list.Add("*.*"); - } - else - list.Add("*.*"); - return list.ToArray(); - } - - private static string[] BuildSearchArray(string search) - { - List list = new List(); - if (!String.IsNullOrWhiteSpace(search)) - { - string[] tempArray = search.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries); - foreach (var item in tempArray) - list.Add(item.Trim()); - if(list.Count == 0) - throw new FormatException("Search term can't be empty."); - } - else - throw new FormatException("Search term can't be empty."); - return list.ToArray(); - } - - private static string[] BuildReplaceArray(string replace) - { - List list = new List(); - if (!String.IsNullOrWhiteSpace(replace)) - { - string[] tempArray = replace.Split(new string[] { Environment.NewLine }, StringSplitOptions.None); - foreach (var item in tempArray) - list.Add(item.Trim()); - if (list.Count == 0) - throw new FormatException("Replace term can't be empty."); - } - else - throw new FormatException("Replace term can't be empty."); - return list.ToArray(); - } - - private static bool FilterPassed(string file, string[] fileFilter) - { - foreach (var item in fileFilter) - { - string end = item; - string extenstion = Path.GetExtension(file); - if (extenstion.StartsWith(".")) - extenstion = extenstion.Substring(1); - int pos = item.IndexOf("."); - if (pos > -1) - end = item.Substring(pos + 1); - if (end.Equals(extenstion, StringComparison.InvariantCultureIgnoreCase)) - return true; - } - return false; - } - - private static bool DoSearchAndReplace(ref string fileContent, string[] searchArray, string[] replaceArray, LogAction func) - { - bool oneOrMoreReplaced = false; - for (int i = 0; i < searchArray.Length; i++) - { - string search = searchArray[i]; - string replace = replaceArray[i]; - int cnt = 0; - while (fileContent.IndexOf(search) > -1) - { - fileContent = fileContent.Replace(search, replace); - cnt++; - } - if (cnt > 0) - { - oneOrMoreReplaced = true; - func(String.Format("{0} entries of {1} replaced", cnt, search)); - } - - } - - return oneOrMoreReplaced; - } - - private static bool WriteFile(string file, string fileContent, LogAction func) - { - try - { - File.WriteAllText(file, fileContent); - return true; - } - catch (Exception exception) - { - func("File write error." + exception.ToString()); - return false; - } - } - - private static bool ReverseMoveBackupFile(string backupFile, string originFile) - { - try - { - File.Move(backupFile, originFile); - return true; - } - catch - { - return false; - } - } - - private static string CopyFileBackup(string file, LogAction func) - { - try - { - string fileName = System.IO.Path.GetFileName(file); - string newFile = System.IO.Path.Combine(Application.StartupPath, "BackupSearchAndReplace", fileName); - - if(!Directory.Exists( System.IO.Path.Combine(Application.StartupPath, "BackupSearchAndReplace"))) - Directory.CreateDirectory(System.IO.Path.Combine(Application.StartupPath, "BackupSearchAndReplace")); - - File.Copy(file, newFile); - return newFile; - } - catch (Exception exception) - { - func("File copy error." + exception.ToString()); - return null; - } - } - - private static bool FileDelete(string file, LogAction func) - { - try - { - File.Delete(file); - return true; - } - catch (Exception exception) - { - func("File delete error." + exception.ToString()); - return false; - } - } - - private static bool ReadFile(string file, ref string fileContent, LogAction func) - { - try - { - fileContent = File.ReadAllText(file, Encoding.UTF8); - return true; - } - catch (Exception exception) - { - func("File reading error." + exception.ToString()); - return false; - } - } - - private static void DeleteBackupFile(string fileName) - { - File.Delete(fileName); - } - - private static void SearchAndReplace(string directoryName, string[] fileFilter, string[] search, string[] replace, LogAction func) - { - int i = 0; - func("Search and Replace is started"); - foreach (var item in Directory.GetFiles(directoryName, "*.*", SearchOption.AllDirectories)) - { - i++; - if(i.ToString().EndsWith("00")) - func(""); - - bool filterPassed = FilterPassed(item, fileFilter); - if (!filterPassed) - continue; - string fileContent = string.Empty; - if (ReadFile(item, ref fileContent, func)) - { - if (DoSearchAndReplace(ref fileContent, search, replace, func)) - { - string newFileName = CopyFileBackup(item, func); - if (null != newFileName) - { - if(FileDelete(item, func)) - { - if (WriteFile(item, fileContent, func)) - { - DeleteBackupFile(newFileName); - func("changed: " + item); - } - else - { - if(ReverseMoveBackupFile(newFileName, item)) - func("backup file restored after write error: " + item); - else - func("WARNING: backup file not restored after write error: " + item); - } - } - - } - } - } - } - func("Search and Replace is complete"); - } - } -} diff --git a/BuildTools/SourceUpdater/Form1.Designer.cs b/BuildTools/SourceUpdater/Form1.Designer.cs deleted file mode 100644 index 39c783b716..0000000000 --- a/BuildTools/SourceUpdater/Form1.Designer.cs +++ /dev/null @@ -1,158 +0,0 @@ -namespace NOBuildTools.SourceUpdater -{ - partial class Form1 - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.label1 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.textBoxSource = new System.Windows.Forms.TextBox(); - this.textBoxDest = new System.Windows.Forms.TextBox(); - this.buttonChooseSource = new System.Windows.Forms.Button(); - this.buttonChooseDest = new System.Windows.Forms.Button(); - this.buttonStart = new System.Windows.Forms.Button(); - this.textBoxLog = new System.Windows.Forms.TextBox(); - this.label3 = new System.Windows.Forms.Label(); - this.SuspendLayout(); - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(29, 62); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(41, 13); - this.label1.TabIndex = 0; - this.label1.Text = "Source"; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(29, 88); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(29, 13); - this.label2.TabIndex = 1; - this.label2.Text = "Dest"; - // - // textBoxSource - // - this.textBoxSource.Location = new System.Drawing.Point(76, 59); - this.textBoxSource.Name = "textBoxSource"; - this.textBoxSource.Size = new System.Drawing.Size(606, 20); - this.textBoxSource.TabIndex = 2; - this.textBoxSource.Text = "C:\\LateBindingApi\\LateBindingApi.CodeGenerator.WFApplication\\bin\\Debug\\NetOffice"; - // - // textBoxDest - // - this.textBoxDest.Location = new System.Drawing.Point(76, 85); - this.textBoxDest.Name = "textBoxDest"; - this.textBoxDest.Size = new System.Drawing.Size(606, 20); - this.textBoxDest.TabIndex = 3; - this.textBoxDest.Text = "C:\\NetOffice\\Source"; - // - // buttonChooseSource - // - this.buttonChooseSource.Location = new System.Drawing.Point(688, 57); - this.buttonChooseSource.Name = "buttonChooseSource"; - this.buttonChooseSource.Size = new System.Drawing.Size(44, 23); - this.buttonChooseSource.TabIndex = 4; - this.buttonChooseSource.Text = "..."; - this.buttonChooseSource.UseVisualStyleBackColor = true; - this.buttonChooseSource.Click += new System.EventHandler(this.buttonChooseSource_Click); - // - // buttonChooseDest - // - this.buttonChooseDest.Location = new System.Drawing.Point(688, 88); - this.buttonChooseDest.Name = "buttonChooseDest"; - this.buttonChooseDest.Size = new System.Drawing.Size(44, 23); - this.buttonChooseDest.TabIndex = 5; - this.buttonChooseDest.Text = "..."; - this.buttonChooseDest.UseVisualStyleBackColor = true; - this.buttonChooseDest.Click += new System.EventHandler(this.buttonChooseDest_Click); - // - // buttonStart - // - this.buttonStart.Location = new System.Drawing.Point(596, 126); - this.buttonStart.Name = "buttonStart"; - this.buttonStart.Size = new System.Drawing.Size(77, 23); - this.buttonStart.TabIndex = 6; - this.buttonStart.Text = "Start"; - this.buttonStart.UseVisualStyleBackColor = true; - this.buttonStart.Click += new System.EventHandler(this.buttonStart_Click); - // - // textBoxLog - // - this.textBoxLog.Location = new System.Drawing.Point(76, 129); - this.textBoxLog.Name = "textBoxLog"; - this.textBoxLog.ReadOnly = true; - this.textBoxLog.Size = new System.Drawing.Size(485, 20); - this.textBoxLog.TabIndex = 7; - // - // label3 - // - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(73, 9); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(624, 13); - this.label3.TabIndex = 8; - this.label3.Text = "This tool update the existing NetOffice source folder with a newer version. (repl" + - "ace by windows explorer kills .svn meta informations)"; - // - // Form1 - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(761, 180); - this.Controls.Add(this.label3); - this.Controls.Add(this.textBoxLog); - this.Controls.Add(this.buttonStart); - this.Controls.Add(this.buttonChooseDest); - this.Controls.Add(this.buttonChooseSource); - this.Controls.Add(this.textBoxDest); - this.Controls.Add(this.textBoxSource); - this.Controls.Add(this.label2); - this.Controls.Add(this.label1); - this.Name = "Form1"; - this.Text = "SVN friendly CodeIntegrator"; - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.TextBox textBoxSource; - private System.Windows.Forms.TextBox textBoxDest; - private System.Windows.Forms.Button buttonChooseSource; - private System.Windows.Forms.Button buttonChooseDest; - private System.Windows.Forms.Button buttonStart; - private System.Windows.Forms.TextBox textBoxLog; - private System.Windows.Forms.Label label3; - } -} - diff --git a/BuildTools/SourceUpdater/Form1.cs b/BuildTools/SourceUpdater/Form1.cs deleted file mode 100644 index aa6c0e5d6f..0000000000 --- a/BuildTools/SourceUpdater/Form1.cs +++ /dev/null @@ -1,104 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Text; -using System.Windows.Forms; -using System.IO; - -namespace NOBuildTools.SourceUpdater -{ - /// - /// Main form in the application - /// - public partial class Form1 : Form - { - #region Ctor - - /// - /// Creates an instance of the class - /// - public Form1() - { - InitializeComponent(); - } - - #endregion - - #region Methods - - private bool GetIsInSvnFolder(string file) - { - if (file.IndexOf(".svn",StringComparison.InvariantCultureIgnoreCase) > -1) - return true; - else - return false; - - } - - #endregion - - #region Trigger - - private void buttonStart_Click(object sender, EventArgs e) - { - if (!Directory.Exists(textBoxSource.Text)) - { - MessageBox.Show("SourceDir not found"); - return; - } - - if (!Directory.Exists(textBoxDest.Text)) - { - MessageBox.Show("DestDir not found"); - return; - } - - int i = 0; - string[] codeFiles = Directory.GetFiles(textBoxSource.Text, "*.*", SearchOption.AllDirectories); - foreach (string item in codeFiles) - { - bool isInSvnFolder = GetIsInSvnFolder(item); - if (false == isInSvnFolder) - { - textBoxLog.Text = item; - string newFilePath = GetNewFilePath(textBoxSource.Text, textBoxDest.Text, item); - if (File.Exists(newFilePath)) - File.Delete(newFilePath); - - if (!Directory.Exists(Path.GetDirectoryName(newFilePath))) - Directory.CreateDirectory(Path.GetDirectoryName(newFilePath)); - - File.Copy(item, newFilePath); - i++; - } - } - - textBoxLog.Text = "Finish " + i.ToString() + " Files."; - } - - private string GetNewFilePath(string sourceDir, string DestDir, string file) - { - file = file.Substring(sourceDir.Length); - return DestDir + file; - } - - private void buttonChooseSource_Click(object sender, EventArgs e) - { - FolderBrowserDialog fbd = new FolderBrowserDialog(); - if (DialogResult.OK == fbd.ShowDialog(this)) - textBoxSource.Text = fbd.SelectedPath; - } - - private void buttonChooseDest_Click(object sender, EventArgs e) - { - FolderBrowserDialog fbd = new FolderBrowserDialog(); - if (DialogResult.OK == fbd.ShowDialog(this)) - textBoxDest.Text = fbd.SelectedPath; - } - - #endregion - - } -} diff --git a/BuildTools/SourceUpdater/Form1.resx b/BuildTools/SourceUpdater/Form1.resx deleted file mode 100644 index 7080a7d118..0000000000 --- a/BuildTools/SourceUpdater/Form1.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/BuildTools/SourceUpdater/NOBuildTools.SourceUpdater.csproj b/BuildTools/SourceUpdater/NOBuildTools.SourceUpdater.csproj deleted file mode 100644 index 72fb52a336..0000000000 --- a/BuildTools/SourceUpdater/NOBuildTools.SourceUpdater.csproj +++ /dev/null @@ -1,92 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {FE3B95E3-990A-4F82-92D5-6C26046C3EC2} - WinExe - Properties - NOBuildTools.SourceUpdater - NOBuildTools.SourceUpdater - v4.0 - 512 - - - 3.5 - - Client - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - - - - - 3.5 - - - - - - - - - - Form - - - Form1.cs - - - - - Form1.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - True - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - - - \ No newline at end of file diff --git a/BuildTools/SourceUpdater/Program.cs b/BuildTools/SourceUpdater/Program.cs deleted file mode 100644 index 429807d85c..0000000000 --- a/BuildTools/SourceUpdater/Program.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Windows.Forms; - -namespace NOBuildTools.SourceUpdater -{ - static class Program - { - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main() - { - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new Form1()); - } - } -} diff --git a/BuildTools/SourceUpdater/Properties/AssemblyInfo.cs b/BuildTools/SourceUpdater/Properties/AssemblyInfo.cs deleted file mode 100644 index c2007bb55c..0000000000 --- a/BuildTools/SourceUpdater/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("NOBuildTools.SourceUpdater")] -[assembly: AssemblyDescription("Smart Source Integrator")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("http://netoffice.codeplex.com")] -[assembly: AssemblyCopyright("Copyright 2011 © Sebastian Lange")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("187348b1-6889-4a37-ada3-f93fa8a7dad9")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/BuildTools/SourceUpdater/Properties/Resources.Designer.cs b/BuildTools/SourceUpdater/Properties/Resources.Designer.cs deleted file mode 100644 index 3043851823..0000000000 --- a/BuildTools/SourceUpdater/Properties/Resources.Designer.cs +++ /dev/null @@ -1,63 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Dieser Code wurde von einem Tool generiert. -// Laufzeitversion:4.0.30319.1 -// -// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn -// der Code erneut generiert wird. -// -//------------------------------------------------------------------------------ - -namespace NOBuildTools.SourceUpdater.Properties { - using System; - - - /// - /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. - /// - // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert - // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. - // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen - // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NOBuildTools.SourceUpdater.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle - /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - } -} diff --git a/BuildTools/SourceUpdater/Properties/Resources.resx b/BuildTools/SourceUpdater/Properties/Resources.resx deleted file mode 100644 index af7dbebbac..0000000000 --- a/BuildTools/SourceUpdater/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/BuildTools/SourceUpdater/Properties/Settings.Designer.cs b/BuildTools/SourceUpdater/Properties/Settings.Designer.cs deleted file mode 100644 index 60145aad08..0000000000 --- a/BuildTools/SourceUpdater/Properties/Settings.Designer.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Dieser Code wurde von einem Tool generiert. -// Laufzeitversion:4.0.30319.1 -// -// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn -// der Code erneut generiert wird. -// -//------------------------------------------------------------------------------ - -namespace NOBuildTools.SourceUpdater.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default { - get { - return defaultInstance; - } - } - } -} diff --git a/BuildTools/SourceUpdater/Properties/Settings.settings b/BuildTools/SourceUpdater/Properties/Settings.settings deleted file mode 100644 index 39645652af..0000000000 --- a/BuildTools/SourceUpdater/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/BuildTools/SourceUpdater/app.config b/BuildTools/SourceUpdater/app.config deleted file mode 100644 index a293d0a0e3..0000000000 --- a/BuildTools/SourceUpdater/app.config +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/BuildTools/VersionUpdater/ConfigManager.cs b/BuildTools/VersionUpdater/ConfigManager.cs deleted file mode 100644 index ebd91fc38a..0000000000 --- a/BuildTools/VersionUpdater/ConfigManager.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.IO; -using System.Xml; -using System.Xml.Linq; -using System.Text; - -namespace NOBuildTools.VersionUpdater -{ - /// - /// Little helper to read and save config - /// - internal static class ConfigManager - { - /// - /// Save a configuration file - /// - /// target config file - /// target update root directory - /// change Marker - /// from .net version - /// to .net versions - /// change also key files - /// root folder with key files - public static void SaveConfigurationToXMLFile(string fullFileName, string directory, bool changeMarker, string fromNet, string toNet, bool changeKeyFiles, string keyFilesFolder) - { - if (File.Exists(fullFileName)) - File.Delete(fullFileName); - XDocument document = new XDocument(new XElement("NOBuildTools.VersionUpdater")); - XElement root = document.FirstNode as XElement; - - root.Add(new XElement("TargetFolder", XmlConvert.EncodeName(directory))); - root.Add(new XElement("ChangeMarker", XmlConvert.EncodeName(changeMarker.ToString()))); - root.Add(new XElement("From", XmlConvert.EncodeName(fromNet))); - root.Add(new XElement("To", XmlConvert.EncodeName(fromNet))); - root.Add(new XElement("ChangeKeyFiles", XmlConvert.EncodeName(changeKeyFiles.ToString()))); - root.Add(new XElement("KeyFilesFolder", XmlConvert.EncodeName(keyFilesFolder))); - - document.Save(fullFileName); - } - - /// - /// Loads a configuration file - /// - /// target config file - /// target update root directory - /// change Marker - /// from .net version - /// to .net versions - /// change also key files - /// root folder with key files - public static void LoadConfigurationFromConfigFile(string fullFileName, ref string directory, ref bool changeMarker, ref string fromNet, ref string toNet, ref bool changeKeyFiles, ref string keyFilesFolder) - { - if (!File.Exists(fullFileName)) - throw new FileNotFoundException(fullFileName); - - XDocument document = XDocument.Load(fullFileName); - XElement root = document.FirstNode as XElement; - if (root.Name != "NOBuildTools.VersionUpdater") - throw new FormatException("Wrong Magic"); - - directory = XmlConvert.DecodeName(root.Element("TargetFolder").Value); - changeMarker = Convert.ToBoolean(XmlConvert.DecodeName(root.Element("ChangeMarker").Value)); - fromNet = XmlConvert.DecodeName(root.Element("From").Value); - toNet = XmlConvert.DecodeName(root.Element("To").Value); - changeKeyFiles = Convert.ToBoolean(XmlConvert.DecodeName(root.Element("ChangeKeyFiles").Value)); - keyFilesFolder = XmlConvert.DecodeName(root.Element("KeyFilesFolder").Value); - } - } -} diff --git a/BuildTools/VersionUpdater/ExceptionDisplayer.cs b/BuildTools/VersionUpdater/ExceptionDisplayer.cs deleted file mode 100644 index 3f54b8f4aa..0000000000 --- a/BuildTools/VersionUpdater/ExceptionDisplayer.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Windows.Forms; -using System.Text; - -namespace NOBuildTools.VersionUpdater -{ - /// - /// Exception display helper - /// - internal static class ExceptionDisplayer - { - /// - /// Shows exception as string message box to the user - /// - /// modal parent - /// exception as any - public static void ShowException(IWin32Window parent, Exception exception) - { - string message = "An error is occured." + Environment.NewLine; - string detailsMessage = "Details: " + Environment.NewLine; - - while (null != exception) - { - detailsMessage += "Exception: " + exception.GetType().Name + Environment.NewLine; - detailsMessage += "Exception: " + exception.Message + Environment.NewLine; - - exception = exception.InnerException; - } - - MessageBox.Show(parent, message + detailsMessage, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } -} diff --git a/BuildTools/VersionUpdater/Form1.Designer.cs b/BuildTools/VersionUpdater/Form1.Designer.cs deleted file mode 100644 index 879f6e90c8..0000000000 --- a/BuildTools/VersionUpdater/Form1.Designer.cs +++ /dev/null @@ -1,255 +0,0 @@ -namespace NOBuildTools.VersionUpdater -{ - partial class Form1 - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.textBoxFolder = new System.Windows.Forms.TextBox(); - this.textBoxLog = new System.Windows.Forms.TextBox(); - this.buttonChooseFolder = new System.Windows.Forms.Button(); - this.buttonStart = new System.Windows.Forms.Button(); - this.comboBoxToNetVersion = new System.Windows.Forms.ComboBox(); - this.checkBoxChangeKeyFiles = new System.Windows.Forms.CheckBox(); - this.textBoxKeyFilesRootFolder = new System.Windows.Forms.TextBox(); - this.labelKeyFolder = new System.Windows.Forms.Label(); - this.checkBoxChangeNetMarker = new System.Windows.Forms.CheckBox(); - this.labelFolder = new System.Windows.Forms.Label(); - this.labelNetVersion = new System.Windows.Forms.Label(); - this.buttonLoadConfig = new System.Windows.Forms.Button(); - this.buttonSaveConfig = new System.Windows.Forms.Button(); - this.label1 = new System.Windows.Forms.Label(); - this.comboBoxFromNetVersion = new System.Windows.Forms.ComboBox(); - this.SuspendLayout(); - // - // textBoxFolder - // - this.textBoxFolder.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBoxFolder.Location = new System.Drawing.Point(100, 19); - this.textBoxFolder.Name = "textBoxFolder"; - this.textBoxFolder.Size = new System.Drawing.Size(740, 20); - this.textBoxFolder.TabIndex = 0; - // - // textBoxLog - // - this.textBoxLog.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBoxLog.Location = new System.Drawing.Point(101, 155); - this.textBoxLog.Multiline = true; - this.textBoxLog.Name = "textBoxLog"; - this.textBoxLog.ReadOnly = true; - this.textBoxLog.Size = new System.Drawing.Size(739, 305); - this.textBoxLog.TabIndex = 1; - // - // buttonChooseFolder - // - this.buttonChooseFolder.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonChooseFolder.Location = new System.Drawing.Point(863, 16); - this.buttonChooseFolder.Name = "buttonChooseFolder"; - this.buttonChooseFolder.Size = new System.Drawing.Size(45, 24); - this.buttonChooseFolder.TabIndex = 2; - this.buttonChooseFolder.Text = "..."; - this.buttonChooseFolder.UseVisualStyleBackColor = true; - this.buttonChooseFolder.Click += new System.EventHandler(this.buttonChooseFolder_Click); - // - // buttonStart - // - this.buttonStart.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.buttonStart.Location = new System.Drawing.Point(100, 125); - this.buttonStart.Name = "buttonStart"; - this.buttonStart.Size = new System.Drawing.Size(540, 24); - this.buttonStart.TabIndex = 3; - this.buttonStart.Text = "Start"; - this.buttonStart.UseVisualStyleBackColor = true; - this.buttonStart.Click += new System.EventHandler(this.buttonStart_Click); - // - // comboBoxToNetVersion - // - this.comboBoxToNetVersion.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.comboBoxToNetVersion.FormattingEnabled = true; - this.comboBoxToNetVersion.Items.AddRange(new object[] { - ".Net 2.0", - ".Net 3.0", - ".Net 3.5", - ".Net 4.0", - ".Net 4.5"}); - this.comboBoxToNetVersion.Location = new System.Drawing.Point(476, 51); - this.comboBoxToNetVersion.Name = "comboBoxToNetVersion"; - this.comboBoxToNetVersion.Size = new System.Drawing.Size(172, 21); - this.comboBoxToNetVersion.TabIndex = 4; - // - // checkBoxChangeKeyFiles - // - this.checkBoxChangeKeyFiles.AutoSize = true; - this.checkBoxChangeKeyFiles.Location = new System.Drawing.Point(100, 91); - this.checkBoxChangeKeyFiles.Name = "checkBoxChangeKeyFiles"; - this.checkBoxChangeKeyFiles.Size = new System.Drawing.Size(105, 17); - this.checkBoxChangeKeyFiles.TabIndex = 6; - this.checkBoxChangeKeyFiles.Text = "Change KeyFiles"; - this.checkBoxChangeKeyFiles.UseVisualStyleBackColor = true; - // - // textBoxKeyFilesRootFolder - // - this.textBoxKeyFilesRootFolder.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBoxKeyFilesRootFolder.Location = new System.Drawing.Point(330, 89); - this.textBoxKeyFilesRootFolder.Name = "textBoxKeyFilesRootFolder"; - this.textBoxKeyFilesRootFolder.Size = new System.Drawing.Size(510, 20); - this.textBoxKeyFilesRootFolder.TabIndex = 7; - this.textBoxKeyFilesRootFolder.Text = "C:\\NetOffice\\KeyFiles"; - // - // labelKeyFolder - // - this.labelKeyFolder.AutoSize = true; - this.labelKeyFolder.Location = new System.Drawing.Point(219, 93); - this.labelKeyFolder.Name = "labelKeyFolder"; - this.labelKeyFolder.Size = new System.Drawing.Size(101, 13); - this.labelKeyFolder.TabIndex = 8; - this.labelKeyFolder.Text = "KeyFiles RootFolder"; - // - // checkBoxChangeNetMarker - // - this.checkBoxChangeNetMarker.AutoSize = true; - this.checkBoxChangeNetMarker.Location = new System.Drawing.Point(668, 55); - this.checkBoxChangeNetMarker.Name = "checkBoxChangeNetMarker"; - this.checkBoxChangeNetMarker.Size = new System.Drawing.Size(116, 17); - this.checkBoxChangeNetMarker.TabIndex = 12; - this.checkBoxChangeNetMarker.Text = "Change NetMarker"; - this.checkBoxChangeNetMarker.UseVisualStyleBackColor = true; - // - // labelFolder - // - this.labelFolder.AutoSize = true; - this.labelFolder.Location = new System.Drawing.Point(21, 22); - this.labelFolder.Name = "labelFolder"; - this.labelFolder.Size = new System.Drawing.Size(49, 13); - this.labelFolder.TabIndex = 13; - this.labelFolder.Text = "Directory"; - // - // labelNetVersion - // - this.labelNetVersion.AutoSize = true; - this.labelNetVersion.Location = new System.Drawing.Point(384, 55); - this.labelNetVersion.Name = "labelNetVersion"; - this.labelNetVersion.Size = new System.Drawing.Size(86, 13); - this.labelNetVersion.TabIndex = 15; - this.labelNetVersion.Text = "To .NET Version"; - // - // buttonLoadConfig - // - this.buttonLoadConfig.Location = new System.Drawing.Point(653, 125); - this.buttonLoadConfig.Name = "buttonLoadConfig"; - this.buttonLoadConfig.Size = new System.Drawing.Size(90, 24); - this.buttonLoadConfig.TabIndex = 21; - this.buttonLoadConfig.Text = "Load Config"; - this.buttonLoadConfig.UseVisualStyleBackColor = true; - this.buttonLoadConfig.Click += new System.EventHandler(this.buttonLoadConfig_Click); - // - // buttonSaveConfig - // - this.buttonSaveConfig.Location = new System.Drawing.Point(750, 125); - this.buttonSaveConfig.Name = "buttonSaveConfig"; - this.buttonSaveConfig.Size = new System.Drawing.Size(90, 24); - this.buttonSaveConfig.TabIndex = 22; - this.buttonSaveConfig.Text = "Save Config"; - this.buttonSaveConfig.UseVisualStyleBackColor = true; - this.buttonSaveConfig.Click += new System.EventHandler(this.buttonSaveConfig_Click); - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(101, 55); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(93, 13); - this.label1.TabIndex = 24; - this.label1.Text = "From NET Version"; - // - // comboBoxFromNetVersion - // - this.comboBoxFromNetVersion.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.comboBoxFromNetVersion.FormattingEnabled = true; - this.comboBoxFromNetVersion.Items.AddRange(new object[] { - ".Net 2.0", - ".Net 3.0", - ".Net 3.5", - ".Net 4.0", - ".Net 4.5"}); - this.comboBoxFromNetVersion.Location = new System.Drawing.Point(200, 51); - this.comboBoxFromNetVersion.Name = "comboBoxFromNetVersion"; - this.comboBoxFromNetVersion.Size = new System.Drawing.Size(172, 21); - this.comboBoxFromNetVersion.TabIndex = 23; - // - // Form1 - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(925, 472); - this.Controls.Add(this.label1); - this.Controls.Add(this.comboBoxFromNetVersion); - this.Controls.Add(this.buttonSaveConfig); - this.Controls.Add(this.buttonLoadConfig); - this.Controls.Add(this.labelNetVersion); - this.Controls.Add(this.labelFolder); - this.Controls.Add(this.checkBoxChangeNetMarker); - this.Controls.Add(this.labelKeyFolder); - this.Controls.Add(this.textBoxKeyFilesRootFolder); - this.Controls.Add(this.checkBoxChangeKeyFiles); - this.Controls.Add(this.comboBoxToNetVersion); - this.Controls.Add(this.buttonStart); - this.Controls.Add(this.buttonChooseFolder); - this.Controls.Add(this.textBoxLog); - this.Controls.Add(this.textBoxFolder); - this.Name = "Form1"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "NOBuildTools.VersionUpdater"; - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.TextBox textBoxFolder; - private System.Windows.Forms.TextBox textBoxLog; - private System.Windows.Forms.Button buttonChooseFolder; - private System.Windows.Forms.Button buttonStart; - private System.Windows.Forms.ComboBox comboBoxToNetVersion; - private System.Windows.Forms.CheckBox checkBoxChangeKeyFiles; - private System.Windows.Forms.TextBox textBoxKeyFilesRootFolder; - private System.Windows.Forms.Label labelKeyFolder; - private System.Windows.Forms.CheckBox checkBoxChangeNetMarker; - private System.Windows.Forms.Label labelFolder; - private System.Windows.Forms.Label labelNetVersion; - private System.Windows.Forms.Button buttonLoadConfig; - private System.Windows.Forms.Button buttonSaveConfig; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.ComboBox comboBoxFromNetVersion; - } -} - diff --git a/BuildTools/VersionUpdater/Form1.cs b/BuildTools/VersionUpdater/Form1.cs deleted file mode 100644 index 3b927552cd..0000000000 --- a/BuildTools/VersionUpdater/Form1.cs +++ /dev/null @@ -1,463 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.IO; -using System.Drawing; -using System.Text; -using System.Windows.Forms; - -namespace NOBuildTools.VersionUpdater -{ - /// - /// Main form in the application - /// - public partial class Form1 : Form - { - #region Ctor - - /// - /// Creates an instance of the class - /// - public Form1() - { - InitializeComponent(); - textBoxFolder.Text = Application.StartupPath; - comboBoxFromNetVersion.SelectedIndex = 0; - comboBoxToNetVersion.SelectedIndex = 0; - } - - #endregion - - #region Methods - - private string GetSelectedFromNetVersion() - { - switch (comboBoxFromNetVersion.SelectedIndex) - { - case 0: - return "2.0"; - case 1: - return "3.0"; - case 2: - return "3.5"; - case 3: - return "4.0"; - case 4: - return "4.5"; - } - throw (new Exception("From .NET Version not selected.")); - } - - private string GetSelectedToNetVersion() - { - switch (comboBoxToNetVersion.SelectedIndex) - { - case 0: - return "2.0"; - case 1: - return "3.0"; - case 2: - return "3.5"; - case 3: - return "4.0"; - case 4: - return "4.5"; - } - throw (new Exception("To .NET Version not selected.")); - } - - private bool CheckPrequsits() - { - if (!Directory.Exists(textBoxFolder.Text)) - { - MessageBox.Show("Directory not exists", "Doooh", MessageBoxButtons.OK, MessageBoxIcon.Error); - return false; - } - - return true; - } - - private void ChangeKeyFileInProjectFile(ref string fileContent, string currentFolder, string name, string netVersion) - { - if (!checkBoxChangeKeyFiles.Checked) - return; - - int position1 = fileContent.IndexOf(""); - if (position1 < 0) - { - textBoxLog.AppendText("\t\tKeyFile Entry not found:" + name + "\r\n"); - return; - } - - int position2 = fileContent.IndexOf("", position1); - string keyFile = fileContent.Substring(position1 + "".Length, position2 - (position1 + "".Length)); - string[] arr = keyFile.Split(new string[] {"_"},StringSplitOptions.RemoveEmptyEntries); - string newKeyFile = arr[0] + "_v" + netVersion + ".snk"; - string newLine = "" + newKeyFile + ""; - - string net1 = "" + keyFile + ""; - fileContent = fileContent.Replace(net1, newLine); - - string sourceFile = System.IO.Path.Combine(textBoxKeyFilesRootFolder.Text, netVersion); - sourceFile = System.IO.Path.Combine(sourceFile, newKeyFile); - - string destFile = System.IO.Path.Combine(currentFolder, newKeyFile); - if(!System.IO.File.Exists(destFile)) - System.IO.File.Copy(sourceFile, destFile); - } - - private void ChangeToolCodeInCSharpSolutionFile(ref string fileContent, string toNetVersion) - { - if (toNetVersion == "4.5") - { - string replaceToolsString = "# Visual Studio Express 2012 for Windows Desktop"; - - string tools2008 = "# Visual Studio 2008"; - int position = fileContent.IndexOf(tools2008); - if (position > -1) - { - fileContent = fileContent.Replace(tools2008, replaceToolsString); - return; - } - - string tools2010 = "# Visual Studio 2010"; - position = fileContent.IndexOf(tools2010); - if (position > -1) - { - fileContent = fileContent.Replace(tools2010, replaceToolsString); - return; - } - } - else - { - string replaceToolsString = "# Visual C# Express 2010"; - - string tools2008 = "# Visual Studio 2008"; - int position = fileContent.IndexOf(tools2008); - if (position > -1) - { - fileContent = fileContent.Replace(tools2008, replaceToolsString); - return; - } - - string tools2010 = "# Visual Studio 2010"; - position = fileContent.IndexOf(tools2010); - if (position > -1) - { - fileContent = fileContent.Replace(tools2010, replaceToolsString); - return; - } - } - } - - private void ChangeToolCodeInVBSolutionFile(ref string fileContent, string toNetVersion) - { - if (toNetVersion == "4.5") - { - string replaceToolsString = "# Visual Studio Express 2012 for Windows Desktop"; - - string tools2008 = "# Visual Studio 2008"; - int position = fileContent.IndexOf(tools2008); - if (position > -1) - { - fileContent = fileContent.Replace(tools2008, replaceToolsString); - return; - } - - string tools2010 = "# Visual Studio 2010"; - position = fileContent.IndexOf(tools2010); - if (position > -1) - { - fileContent = fileContent.Replace(tools2010, replaceToolsString); - return; - } - } - else - { - string replaceToolsString = "# Visual Basic Express 2010"; - - string tools2008 = "# Visual Studio 2008"; - int position = fileContent.IndexOf(tools2008); - if (position > -1) - { - fileContent = fileContent.Replace(tools2008, replaceToolsString); - return; - } - - string tools2010 = "# Visual Studio 2010"; - position = fileContent.IndexOf(tools2010); - if (position > -1) - { - fileContent = fileContent.Replace(tools2010, replaceToolsString); - return; - } - } - } - - private void ChangeToolsVersionEntryInProjectFile(ref string fileContent) - { - string replacedString = ""; - replacedString = "ToolsVersion=\"4.0\""; - - string searchTools1 = "ToolsVersion=\"3.5\""; - int position = fileContent.IndexOf(searchTools1); - if (position > -1) - { - fileContent = fileContent.Replace(searchTools1, replacedString); - return; - } - } - - private void ChangeNetVersionEntryInProjectFile(ref string fileContent, string toNetVersion) - { - if (toNetVersion != "4.0") - { - fileContent = fileContent.Replace("Client", ""); - } - - - string net1 = "v2.0"; - int position = fileContent.IndexOf(net1); - if (position > -1) - { - fileContent = fileContent.Replace(net1, "v" + toNetVersion + ""); - return; - } - - string net2 = "v3.0"; - position = fileContent.IndexOf(net2); - if (position > -1) - { - fileContent = fileContent.Replace(net2, "v" + toNetVersion + ""); - return; - } - - string net3 = "v3.5"; - position = fileContent.IndexOf(net3); - if (position > -1) - { - fileContent = fileContent.Replace(net3, "v" + toNetVersion + ""); - return; - } - - string net4 = "v4.0"; - position = fileContent.IndexOf(net4); - if (position > -1) - { - fileContent = fileContent.Replace(net4, "v" + toNetVersion + ""); - return; - } - - string net5 = "v4.5"; - position = fileContent.IndexOf(net5); - if (position > -1) - { - fileContent = fileContent.Replace(net4, "v" + toNetVersion + ""); - return; - } - - } - - private void ChangeFormatVersionInSolutionFile(ref string fileContent, string toNetVersion) - { - if (toNetVersion == "4.5") - { - string replacedString = ""; - replacedString = "Format Version 12.00"; - - string tools1 = "Format Version 10.00"; // vs2008 - int position = fileContent.IndexOf(tools1); - if (position > -1) - { - fileContent = fileContent.Replace(tools1, replacedString); - return; - } - - string tools2 = "Format Version 11.00"; //vs2010 - position = fileContent.IndexOf(tools2); - if (position > -1) - { - fileContent = fileContent.Replace(tools2, replacedString); - return; - } - } - else - { - string replacedString = ""; - replacedString = "Format Version 11.00"; - - string tools1 = "Format Version 10.00"; // vs2008 - int position = fileContent.IndexOf(tools1); - if (position > -1) - { - fileContent = fileContent.Replace(tools1, replacedString); - return; - } - - string tools2 = "Format Version 12.00"; // vs2012 - position = fileContent.IndexOf(tools2); - if (position > -1) - { - fileContent = fileContent.Replace(tools2, replacedString); - return; - } - } - } - - #endregion - - #region Trigger - - private void buttonStart_Click(object sender, EventArgs e) - { - if (!CheckPrequsits()) - return; - - textBoxLog.Clear(); - string netFromVersion = GetSelectedFromNetVersion(); - string netToVersion = GetSelectedToNetVersion(); - - //change projects - string[] files = Directory.GetFiles(textBoxFolder.Text, "*.*", SearchOption.AllDirectories); - foreach (string file in files) - { - if (file.EndsWith("vbproj") || file.EndsWith("csproj")) - { - textBoxLog.AppendText("Change : " + System.IO.Path.GetFileName(file) + "\r\n"); - string fileContent = File.ReadAllText(file); - - ChangeNetVersionEntryInProjectFile(ref fileContent, netToVersion); - ChangeToolsVersionEntryInProjectFile(ref fileContent); - if (checkBoxChangeKeyFiles.Checked) - ChangeKeyFileInProjectFile(ref fileContent, System.IO.Path.GetDirectoryName(file), System.IO.Path.GetFileNameWithoutExtension(file), netToVersion); - - File.Delete(file); - File.WriteAllText(file, fileContent, Encoding.UTF8); - } - } - - //change solution - string[] slnFiles = Directory.GetFiles(textBoxFolder.Text, "*.sln", SearchOption.AllDirectories); - foreach (string slnFile in slnFiles) - { - textBoxLog.AppendText("Change : " + System.IO.Path.GetFileName(slnFile) + "\r\n"); - - string fileContent = File.ReadAllText(slnFile); - ChangeFormatVersionInSolutionFile(ref fileContent, netToVersion); - if (fileContent.IndexOf(".csproj") > -1) - ChangeToolCodeInCSharpSolutionFile(ref fileContent, netToVersion); - else if (fileContent.IndexOf(".vbproj") > -1) - ChangeToolCodeInVBSolutionFile(ref fileContent, netToVersion); - else - { - throw new IndexOutOfRangeException(); - } - - File.Delete(slnFile); - File.WriteAllText(slnFile, fileContent, Encoding.UTF8); - } - - //change net marker - if (!checkBoxChangeNetMarker.Checked) - return; - string[] allFiles = Directory.GetFiles(textBoxFolder.Text, "*.*", SearchOption.AllDirectories); - foreach (string file in allFiles) - { - if (file.EndsWith(".cs") || file.EndsWith(".csproj")) - { - string fileContent = File.ReadAllText(file); - string csMarkerSource = "CS" + netFromVersion.Replace(".", ""); - string csMarkerTarget = "CS" + netToVersion.Replace(".", ""); - if (csMarkerSource.EndsWith("0")) - csMarkerSource = csMarkerSource.Substring(0, csMarkerSource.Length - 1); - if (csMarkerTarget.EndsWith("0")) - csMarkerTarget = csMarkerTarget.Substring(0, csMarkerTarget.Length - 1); - - if (fileContent.IndexOf(csMarkerSource) > -1) - { - fileContent = fileContent.Replace(csMarkerSource, csMarkerTarget); - File.Delete(file); - File.WriteAllText(file, fileContent, Encoding.UTF8); - } - } - else if (file.EndsWith(".vb") || file.EndsWith(".vbproj")) - { - string fileContent = File.ReadAllText(file); - string vbMarkerSource = "VB" + netFromVersion.Replace(".", ""); - string vbMarkerTarget = "VB" + netToVersion.Replace(".", ""); - if (vbMarkerSource.EndsWith("0")) - vbMarkerSource = vbMarkerSource.Substring(0, vbMarkerSource.Length - 1); - if (vbMarkerTarget.EndsWith("0")) - vbMarkerTarget = vbMarkerTarget.Substring(0, vbMarkerTarget.Length - 1); - - if (fileContent.IndexOf(vbMarkerSource) > -1) - { - fileContent = fileContent.Replace(vbMarkerSource, vbMarkerTarget); - File.Delete(file); - File.WriteAllText(file, fileContent, Encoding.UTF8); - } - } - } - } - - private void buttonChooseFolder_Click(object sender, EventArgs e) - { - FolderBrowserDialog fdg = new FolderBrowserDialog(); - if (DialogResult.OK == fdg.ShowDialog(this)) - textBoxFolder.Text = fdg.SelectedPath; - } - - private void buttonLoadConfig_Click(object sender, EventArgs e) - { - try - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.InitialDirectory = Application.StartupPath; - dlg.Filter = "Xml Files(*.xml)|*.xml"; - if (dlg.ShowDialog(this) == DialogResult.Cancel) - return; - - string targetFolder = string.Empty; - bool changeNetMarker = false; - string from = string.Empty; - string to = string.Empty; - bool changeKeyFiles = false; - string keyFilesFolder = string.Empty; - - ConfigManager.LoadConfigurationFromConfigFile(dlg.FileName, ref targetFolder, ref changeNetMarker, ref from, ref to, ref changeKeyFiles, ref keyFilesFolder); - - textBoxFolder.Text = targetFolder; - checkBoxChangeNetMarker.Checked = changeNetMarker; - comboBoxFromNetVersion.Text = from; - comboBoxToNetVersion.Text = to; - checkBoxChangeKeyFiles.Checked = changeKeyFiles; - textBoxKeyFilesRootFolder.Text = keyFilesFolder; - } - catch (Exception exception) - { - ExceptionDisplayer.ShowException(this, exception); - } - } - - private void buttonSaveConfig_Click(object sender, EventArgs e) - { - try - { - SaveFileDialog dlg = new SaveFileDialog(); - dlg.InitialDirectory = Application.StartupPath; - dlg.Filter = "Xml Files(*.xml)|*.xml"; - if (dlg.ShowDialog(this) == DialogResult.Cancel) - return; - - ConfigManager.SaveConfigurationToXMLFile(dlg.FileName, textBoxFolder.Text, checkBoxChangeNetMarker.Checked, comboBoxFromNetVersion.Text, comboBoxToNetVersion.Text, checkBoxChangeKeyFiles.Checked, textBoxKeyFilesRootFolder.Text); - } - catch (Exception exception) - { - ExceptionDisplayer.ShowException(this, exception); - } - } - - #endregion - } -} diff --git a/BuildTools/VersionUpdater/Form1.resx b/BuildTools/VersionUpdater/Form1.resx deleted file mode 100644 index 1af7de150c..0000000000 --- a/BuildTools/VersionUpdater/Form1.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/BuildTools/VersionUpdater/NOBuildTools.VersionUpdater.csproj b/BuildTools/VersionUpdater/NOBuildTools.VersionUpdater.csproj deleted file mode 100644 index 6c5169d8e0..0000000000 --- a/BuildTools/VersionUpdater/NOBuildTools.VersionUpdater.csproj +++ /dev/null @@ -1,124 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {3CDA84DA-CC00-49FE-B05F-EB12E38E5AF1} - WinExe - Properties - NOBuildTools.VersionUpdater - NOBuildTools.VersionUpdater - v4.0 - 512 - - - 3.5 - - Client - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - - - - - - - - - - - - - - - Form - - - Form1.cs - - - - - Form1.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - True - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - \ No newline at end of file diff --git a/BuildTools/VersionUpdater/Program.cs b/BuildTools/VersionUpdater/Program.cs deleted file mode 100644 index ff86639dc9..0000000000 --- a/BuildTools/VersionUpdater/Program.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Windows.Forms; - -namespace NOBuildTools.VersionUpdater -{ - static class Program - { - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main() - { - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new Form1()); - } - } -} diff --git a/BuildTools/VersionUpdater/Properties/AssemblyInfo.cs b/BuildTools/VersionUpdater/Properties/AssemblyInfo.cs deleted file mode 100644 index 09645156bc..0000000000 --- a/BuildTools/VersionUpdater/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("NOBuildTools.VersionUpdater")] -[assembly: AssemblyDescription("Change the .NET/version in VS Solutions/Projects")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("http://netoffice.codeplex.com")] -[assembly: AssemblyCopyright("Copyright 2011 © Sebastian Lange")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("dcfb10e2-d7d1-49dd-ba2a-09f3a044c08d")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/BuildTools/VersionUpdater/Properties/Resources.Designer.cs b/BuildTools/VersionUpdater/Properties/Resources.Designer.cs deleted file mode 100644 index c2b7fc9b8c..0000000000 --- a/BuildTools/VersionUpdater/Properties/Resources.Designer.cs +++ /dev/null @@ -1,63 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Dieser Code wurde von einem Tool generiert. -// Laufzeitversion:4.0.30319.1 -// -// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn -// der Code erneut generiert wird. -// -//------------------------------------------------------------------------------ - -namespace NOBuildTools.VersionUpdater.Properties { - using System; - - - /// - /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. - /// - // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert - // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. - // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen - // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NOBuildTools.VersionUpdater.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle - /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - } -} diff --git a/BuildTools/VersionUpdater/Properties/Resources.resx b/BuildTools/VersionUpdater/Properties/Resources.resx deleted file mode 100644 index af7dbebbac..0000000000 --- a/BuildTools/VersionUpdater/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/BuildTools/VersionUpdater/Properties/Settings.Designer.cs b/BuildTools/VersionUpdater/Properties/Settings.Designer.cs deleted file mode 100644 index e44624b390..0000000000 --- a/BuildTools/VersionUpdater/Properties/Settings.Designer.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Dieser Code wurde von einem Tool generiert. -// Laufzeitversion:4.0.30319.1 -// -// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn -// der Code erneut generiert wird. -// -//------------------------------------------------------------------------------ - -namespace NOBuildTools.VersionUpdater.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default { - get { - return defaultInstance; - } - } - } -} diff --git a/BuildTools/VersionUpdater/Properties/Settings.settings b/BuildTools/VersionUpdater/Properties/Settings.settings deleted file mode 100644 index 39645652af..0000000000 --- a/BuildTools/VersionUpdater/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/BuildTools/VersionUpdater/app.config b/BuildTools/VersionUpdater/app.config deleted file mode 100644 index a293d0a0e3..0000000000 --- a/BuildTools/VersionUpdater/app.config +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/CHANGELOG.md b/CHANGELOG.md index 3418aadacd..cea68308b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## v1.9.8 + +### Fixed +* Fix bug in `ContentControlBeforeContentUpdate` code by verifying the correct event name [#454](https://github.com/NetOfficeFw/NetOffice/pull/454) + + ## v1.9.7 ### Added diff --git a/Source/ClientApplication/packages.lock.json b/Source/ClientApplication/packages.lock.json index d26077df7b..8845b5b34d 100644 --- a/Source/ClientApplication/packages.lock.json +++ b/Source/ClientApplication/packages.lock.json @@ -167,6 +167,6 @@ } } }, - ".NETFramework,Version=v4.6.2/win7-x86": {} + ".NETFramework,Version=v4.6.2/win-x86": {} } } \ No newline at end of file diff --git a/Source/NetOffice.Tests/NetOffice.Tests.csproj b/Source/NetOffice.Tests/NetOffice.Tests.csproj index a023343643..f9e693a995 100644 --- a/Source/NetOffice.Tests/NetOffice.Tests.csproj +++ b/Source/NetOffice.Tests/NetOffice.Tests.csproj @@ -28,6 +28,7 @@ + @@ -42,4 +43,12 @@ + + + + + + PreserveNewest + + diff --git a/Source/NetOffice.Tests/PowerPointApi/Docs/AutoSaveOn_PresentationSavedLocally_FeatureAutoSaveIsOff.pptx b/Source/NetOffice.Tests/PowerPointApi/Docs/AutoSaveOn_PresentationSavedLocally_FeatureAutoSaveIsOff.pptx new file mode 100644 index 0000000000..a17160352b Binary files /dev/null and b/Source/NetOffice.Tests/PowerPointApi/Docs/AutoSaveOn_PresentationSavedLocally_FeatureAutoSaveIsOff.pptx differ diff --git a/Source/NetOffice.Tests/PowerPointApi/PresentationTests.cs b/Source/NetOffice.Tests/PowerPointApi/PresentationTests.cs new file mode 100644 index 0000000000..fe6a5a271a --- /dev/null +++ b/Source/NetOffice.Tests/PowerPointApi/PresentationTests.cs @@ -0,0 +1,76 @@ +using System; +using NUnit.Framework; +using NetOffice.PowerPointApi; +using System.IO; + +namespace NetOffice.Tests.PowerPointApi +{ + [TestFixture] + [Category("IntegrationTests")] + [Category("IntegrationTests_PowerPoint")] + public class PresentationTests + { + public Application PowerPointApp { get; set; } + public Documents Docs { get; set; } + + [SetUp] + public void SetUp() + { + this.PowerPointApp = new Application(); + this.Docs = new Documents(TestContext.CurrentContext); + } + + [TearDown] + public void TearDown() + { + this.PowerPointApp?.Quit(); + this.PowerPointApp?.Dispose(); + } + + [Test] + public void AutoSaveOn_PresentationSavedLocally_FeatureAutoSaveIsOff_ReturnsFalse() + { + // Arrange + var presentation = PowerPointApp.Presentations.Open(this.Docs.AutoSaveOn_PresentationSavedLocally_FeatureAutoSaveIsOff, false); + + // Act + var actualValue = presentation.AutoSaveOn; + + // Assert + Assert.IsFalse(actualValue); + + // Cleanup + presentation.Close(); + } + + [Test] + public void AutoSaveOn_PresentationSavedInOneDrive_FeatureAutoSaveIsOn_ReturnsTrue() + { + // Arrange + var presentation = PowerPointApp.Presentations.Open(this.Docs.AutoSaveOn_PresentationSavedInOneDrive_FeatureAutoSaveIsOn, false); + + // Act + var actualValue = presentation.AutoSaveOn; + + // Assert + Assert.IsTrue(actualValue); + + // Cleanup + presentation.Close(); + } + + public class Documents + { + public string AutoSaveOn_PresentationSavedLocally_FeatureAutoSaveIsOff { get; set; } + public string AutoSaveOn_PresentationSavedInOneDrive_FeatureAutoSaveIsOn { get; set; } + + public Documents(TestContext context) + { + this.AutoSaveOn_PresentationSavedLocally_FeatureAutoSaveIsOff = Path.Combine(context.TestDirectory, @"PowerPointApi\Docs", "AutoSaveOn_PresentationSavedLocally_FeatureAutoSaveIsOff.pptx"); + + // Public link: https://1drv.ms/p/c/8cd14a64b99957bc/EVX1bUNmBtxDvfvg-aNQjKkBX35RJ3BJ6_2ey2Ox5gnIfA?e=DVyExX + this.AutoSaveOn_PresentationSavedInOneDrive_FeatureAutoSaveIsOn = @"https://d.docs.live.net/8CD14A64B99957BC/Developer/NetOfficeFw/PowerPoint/AutoSaveOn_PresentationSavedInOneDrive_FeatureAutoSaveIsOn.pptx"; + } + } + } +} diff --git a/Source/NetOffice.Tests/WordApi/Events/DocumentEvents2_SinkHelperTests.cs b/Source/NetOffice.Tests/WordApi/Events/DocumentEvents2_SinkHelperTests.cs new file mode 100644 index 0000000000..6bf13cc76a --- /dev/null +++ b/Source/NetOffice.Tests/WordApi/Events/DocumentEvents2_SinkHelperTests.cs @@ -0,0 +1,45 @@ +// Copyright 2024 Cisco Systems, Inc. +// Licensed under MIT-style license (see LICENSE.txt file). + +using System; +using NetOffice.WordApi; +using NetOffice.WordApi.Events; +using NetOffice.Tests.Helpers; +using NUnit.Framework; + +namespace NetOffice.Tests.WordApi.Events +{ + [TestFixture] + public class DocumentEvents2_SinkHelperTests + { + /// + /// Regression test for #453 - Ensures ContentControlBeforeContentUpdate event uses correct event name + /// in both Validate() and EventBinding.RaiseCustomEvent() calls + /// + [Test] + public void ContentControlBeforeContentUpdate_EventRaised_CallsHandlerWithCorrectEventName() + { + // Arrange + var eventBinder = new TestableComObjectStub(); + eventBinder.AddEventRecipient(nameof(DocumentEvents2_SinkHelper.ContentControlBeforeContentUpdate)); + var connectionPoint = new ConnectionPointStub(); + + var events = new DocumentEvents2_SinkHelper(eventBinder, connectionPoint); + var parameter1 = new FakeComObject(); + var content = new object(); + + // Act + events.ContentControlBeforeContentUpdate(parameter1, ref content); + var actualParametersPassToEvent = eventBinder.LastRaisedEventParameters; + + // Assert + Assert.AreEqual("ContentControlBeforeContentUpdate", eventBinder.LastRaisedEventName, + "EventBinding.RaiseCustomEvent must be called with 'ContentControlBeforeContentUpdate' event name"); + + CollectionAssert.IsNotEmpty(actualParametersPassToEvent); + var actualParameter1 = actualParametersPassToEvent[0]; + Assert.IsInstanceOf(actualParameter1, + "Event ContentControlBeforeContentUpdate parameter must be of type ContentControl."); + } + } +} diff --git a/Source/NetOffice.Tests/packages.lock.json b/Source/NetOffice.Tests/packages.lock.json index 12724d1732..b0d202f5e6 100644 --- a/Source/NetOffice.Tests/packages.lock.json +++ b/Source/NetOffice.Tests/packages.lock.json @@ -142,6 +142,15 @@ "NetOfficeFw.Core": "[1.9.3, )", "NetOfficeFw.Office": "[1.9.3, )" } + }, + "NetOfficeFw.Word": { + "type": "Project", + "dependencies": { + "NetOfficeFw.Core": "[1.9.3, )", + "NetOfficeFw.Office": "[1.9.3, )", + "NetOfficeFw.VBIDE": "[1.9.3, )", + "stdole": "[7.0.3300, )" + } } } } diff --git a/Source/NetOffice.props b/Source/NetOffice.props index 59cce4aa0f..47f2bb4115 100644 --- a/Source/NetOffice.props +++ b/Source/NetOffice.props @@ -1,7 +1,7 @@  - 1.9.7 + 1.9.8 diff --git a/Source/PowerPoint/DispatchInterfaces/_Presentation.cs b/Source/PowerPoint/DispatchInterfaces/_Presentation.cs index b80b61b6b6..2ca77c8973 100644 --- a/Source/PowerPoint/DispatchInterfaces/_Presentation.cs +++ b/Source/PowerPoint/DispatchInterfaces/_Presentation.cs @@ -1272,6 +1272,28 @@ public NetOffice.PowerPointApi.Guides Guides return Factory.ExecuteKnownReferencePropertyGet(this, "Guides", NetOffice.PowerPointApi.Guides.LateBindingApiWrapperType); } } + + /// + /// True if the edits in the Presentation are automatically saved. Read/write Boolean. + /// + /// SupportByVersion PowerPoint 16 + /// Get/Set + /// + /// Docs: + [SupportByVersion("PowerPoint", 16)] + public bool AutoSaveOn + { + get + { + return Factory.ExecuteBoolPropertyGet(this, "AutoSaveOn"); + } + set + { + Factory.ExecuteValuePropertySet(this, "AutoSaveOn", value); + } + } + + #endregion diff --git a/Source/Word/Events/DocumentEvents2.cs b/Source/Word/Events/DocumentEvents2.cs index 610253fef5..4b23b6e7db 100644 --- a/Source/Word/Events/DocumentEvents2.cs +++ b/Source/Word/Events/DocumentEvents2.cs @@ -279,7 +279,7 @@ public void ContentControlBeforeStoreUpdate([In, MarshalAs(UnmanagedType.IDispat public void ContentControlBeforeContentUpdate([In, MarshalAs(UnmanagedType.IDispatch)] object contentControl, [In] [Out] ref object content) { - if (!Validate("ContentControlBeforeStoreUpdate")) + if (!Validate("ContentControlBeforeContentUpdate")) { Invoker.ReleaseParamsArray(contentControl, content); return;