Skip to content

Commit

Permalink
ADD Добавлены инструменты для работы с датами.
Browse files Browse the repository at this point in the history
ADD Добавлены инструменты для работы с электронной почтой.
ADD Добавлены инструменты для работы с сущностями.
ADD Добавлены инструменты для работы с запросами FetchXML.
ADD Добавлены инструменты для работы с файлами.
ADD Добавлены инструменты для работы со строками в формате JSON.
ADD Добавлены инструменты для работы с полями поиска.
ADD Добавлены инструменты для работы с файлами PDF.
  • Loading branch information
ZooY committed Aug 1, 2017
1 parent 515320e commit 0956d8d
Show file tree
Hide file tree
Showing 81 changed files with 5,046 additions and 3 deletions.
94 changes: 94 additions & 0 deletions Source/Dynamics 365 Tools.sln
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,42 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common Plug-ins", "Common\C
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "String Tests", "Tools\String\String Tests\String Tests.csproj", "{CD7E81E7-1CC9-464B-9A18-588EBFB9EC1D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PDF", "PDF", "{1D999D3C-F6DF-4246-B0ED-8506216E70C8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PDF", "Tools\PDF\PDF\PDF.csproj", "{1FDF56DD-0FB9-47A2-8241-A1EEA2823861}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Lookup", "Lookup", "{9D706971-7745-4984-A279-C444921D5B22}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lookup", "Tools\Lookup\Lookup\Lookup.csproj", "{B0FEF8CC-532D-437C-91E5-81CEDCDC9DCC}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "JSON", "JSON", "{2C3D8D6B-40C2-416E-87F0-B958BDD73346}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JSON", "Tools\JSON\JSON\JSON.csproj", "{AB67CE04-B7A8-4981-9ACD-3729C84CCFE3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JSON Tests", "Tools\JSON\JSON Tests\JSON Tests.csproj", "{E0D70FC5-AC9E-410A-B0AF-9B9E8BE11EB6}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "File", "File", "{2380DF60-9772-480E-922E-331D6DD30D6B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "File", "Tools\File\File\File.csproj", "{5C2F2331-F71C-4CA3-BB94-31F31998ED22}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Entity", "Entity", "{5BB903A7-F254-4D58-8A26-C03ADD7743A2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Entity", "Tools\Entity\Entity\Entity.csproj", "{64ABA335-848E-4C2B-8C77-826610D76F6C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "E-mail", "E-mail", "{CC41A44F-5AFE-4F26-8993-51F0436F5D43}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "E-mail", "Tools\E-mail\E-mail\E-mail.csproj", "{82EF36C6-48A3-4F73-83A1-0A1A7834025B}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Date", "Date", "{FA51A1E6-9E6B-4B82-85D5-B107B060A1F8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Date", "Tools\Date\Date\Date.csproj", "{E80ADB15-5B01-4CF1-9929-1F5343080A0D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Date Tests", "Tools\Date\Date Tests\Date Tests.csproj", "{E5FDD3B0-B1DD-49D8-8816-EFD1468D97E6}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DaData", "DaData", "{503EE20E-C61D-4062-9305-BE45A20B9DA8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DaData", "Tools\DaData\DaData\DaData.csproj", "{E06E4993-27E7-43E7-8A41-4C45006723FC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -95,6 +131,46 @@ Global
{CD7E81E7-1CC9-464B-9A18-588EBFB9EC1D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CD7E81E7-1CC9-464B-9A18-588EBFB9EC1D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CD7E81E7-1CC9-464B-9A18-588EBFB9EC1D}.Release|Any CPU.Build.0 = Release|Any CPU
{1FDF56DD-0FB9-47A2-8241-A1EEA2823861}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1FDF56DD-0FB9-47A2-8241-A1EEA2823861}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1FDF56DD-0FB9-47A2-8241-A1EEA2823861}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1FDF56DD-0FB9-47A2-8241-A1EEA2823861}.Release|Any CPU.Build.0 = Release|Any CPU
{B0FEF8CC-532D-437C-91E5-81CEDCDC9DCC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B0FEF8CC-532D-437C-91E5-81CEDCDC9DCC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B0FEF8CC-532D-437C-91E5-81CEDCDC9DCC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B0FEF8CC-532D-437C-91E5-81CEDCDC9DCC}.Release|Any CPU.Build.0 = Release|Any CPU
{AB67CE04-B7A8-4981-9ACD-3729C84CCFE3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AB67CE04-B7A8-4981-9ACD-3729C84CCFE3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AB67CE04-B7A8-4981-9ACD-3729C84CCFE3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AB67CE04-B7A8-4981-9ACD-3729C84CCFE3}.Release|Any CPU.Build.0 = Release|Any CPU
{E0D70FC5-AC9E-410A-B0AF-9B9E8BE11EB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E0D70FC5-AC9E-410A-B0AF-9B9E8BE11EB6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E0D70FC5-AC9E-410A-B0AF-9B9E8BE11EB6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E0D70FC5-AC9E-410A-B0AF-9B9E8BE11EB6}.Release|Any CPU.Build.0 = Release|Any CPU
{5C2F2331-F71C-4CA3-BB94-31F31998ED22}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5C2F2331-F71C-4CA3-BB94-31F31998ED22}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5C2F2331-F71C-4CA3-BB94-31F31998ED22}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5C2F2331-F71C-4CA3-BB94-31F31998ED22}.Release|Any CPU.Build.0 = Release|Any CPU
{64ABA335-848E-4C2B-8C77-826610D76F6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{64ABA335-848E-4C2B-8C77-826610D76F6C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{64ABA335-848E-4C2B-8C77-826610D76F6C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{64ABA335-848E-4C2B-8C77-826610D76F6C}.Release|Any CPU.Build.0 = Release|Any CPU
{82EF36C6-48A3-4F73-83A1-0A1A7834025B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{82EF36C6-48A3-4F73-83A1-0A1A7834025B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{82EF36C6-48A3-4F73-83A1-0A1A7834025B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{82EF36C6-48A3-4F73-83A1-0A1A7834025B}.Release|Any CPU.Build.0 = Release|Any CPU
{E80ADB15-5B01-4CF1-9929-1F5343080A0D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E80ADB15-5B01-4CF1-9929-1F5343080A0D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E80ADB15-5B01-4CF1-9929-1F5343080A0D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E80ADB15-5B01-4CF1-9929-1F5343080A0D}.Release|Any CPU.Build.0 = Release|Any CPU
{E5FDD3B0-B1DD-49D8-8816-EFD1468D97E6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E5FDD3B0-B1DD-49D8-8816-EFD1468D97E6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E5FDD3B0-B1DD-49D8-8816-EFD1468D97E6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E5FDD3B0-B1DD-49D8-8816-EFD1468D97E6}.Release|Any CPU.Build.0 = Release|Any CPU
{E06E4993-27E7-43E7-8A41-4C45006723FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E06E4993-27E7-43E7-8A41-4C45006723FC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E06E4993-27E7-43E7-8A41-4C45006723FC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E06E4993-27E7-43E7-8A41-4C45006723FC}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -117,5 +193,23 @@ Global
{9903EBDE-F29B-4A64-8BD2-24E07FD5AD74} = {1697C91F-DBC5-480C-A3BC-5525E29DE133}
{E159054D-DFF5-4CAE-8EA0-2B8F5E28EE60} = {5957BE99-2162-4812-B103-265E5DC209FB}
{CD7E81E7-1CC9-464B-9A18-588EBFB9EC1D} = {6BBA6926-5043-410C-A5AA-B32F2DF45C6A}
{1D999D3C-F6DF-4246-B0ED-8506216E70C8} = {FB4ED8D2-4CDF-49A3-97C7-FD814755C451}
{1FDF56DD-0FB9-47A2-8241-A1EEA2823861} = {1D999D3C-F6DF-4246-B0ED-8506216E70C8}
{9D706971-7745-4984-A279-C444921D5B22} = {FB4ED8D2-4CDF-49A3-97C7-FD814755C451}
{B0FEF8CC-532D-437C-91E5-81CEDCDC9DCC} = {9D706971-7745-4984-A279-C444921D5B22}
{2C3D8D6B-40C2-416E-87F0-B958BDD73346} = {FB4ED8D2-4CDF-49A3-97C7-FD814755C451}
{AB67CE04-B7A8-4981-9ACD-3729C84CCFE3} = {2C3D8D6B-40C2-416E-87F0-B958BDD73346}
{E0D70FC5-AC9E-410A-B0AF-9B9E8BE11EB6} = {2C3D8D6B-40C2-416E-87F0-B958BDD73346}
{2380DF60-9772-480E-922E-331D6DD30D6B} = {FB4ED8D2-4CDF-49A3-97C7-FD814755C451}
{5C2F2331-F71C-4CA3-BB94-31F31998ED22} = {2380DF60-9772-480E-922E-331D6DD30D6B}
{5BB903A7-F254-4D58-8A26-C03ADD7743A2} = {FB4ED8D2-4CDF-49A3-97C7-FD814755C451}
{64ABA335-848E-4C2B-8C77-826610D76F6C} = {5BB903A7-F254-4D58-8A26-C03ADD7743A2}
{CC41A44F-5AFE-4F26-8993-51F0436F5D43} = {FB4ED8D2-4CDF-49A3-97C7-FD814755C451}
{82EF36C6-48A3-4F73-83A1-0A1A7834025B} = {CC41A44F-5AFE-4F26-8993-51F0436F5D43}
{FA51A1E6-9E6B-4B82-85D5-B107B060A1F8} = {FB4ED8D2-4CDF-49A3-97C7-FD814755C451}
{E80ADB15-5B01-4CF1-9929-1F5343080A0D} = {FA51A1E6-9E6B-4B82-85D5-B107B060A1F8}
{E5FDD3B0-B1DD-49D8-8816-EFD1468D97E6} = {FA51A1E6-9E6B-4B82-85D5-B107B060A1F8}
{503EE20E-C61D-4062-9305-BE45A20B9DA8} = {FB4ED8D2-4CDF-49A3-97C7-FD814755C451}
{E06E4993-27E7-43E7-8A41-4C45006723FC} = {503EE20E-C61D-4062-9305-BE45A20B9DA8}
EndGlobalSection
EndGlobal
117 changes: 117 additions & 0 deletions Source/Tools/DaData/DaData/DaData.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{E06E4993-27E7-43E7-8A41-4C45006723FC}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PZone.DaDataTools</RootNamespace>
<AssemblyName>PZone.DaDataTools</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>PZone.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Crm.Sdk.Proxy, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.CrmSdk.CoreAssemblies.8.2.0\lib\net45\Microsoft.Crm.Sdk.Proxy.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.IdentityModel.6.1.7600.16394\lib\net35\Microsoft.IdentityModel.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.CrmSdk.CoreAssemblies.8.2.0\lib\net45\Microsoft.Xrm.Sdk.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Xrm.Sdk.Workflow, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.CrmSdk.Workflow.8.2.0.2\lib\net452\Microsoft.Xrm.Sdk.Workflow.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Newtonsoft.Json.6.0.5\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="PresentationFramework" />
<Reference Include="PZone.Core">
<HintPath>..\..\..\..\..\PZone SDK Core\Source\PZone.Core\bin\Debug\PZone.Core.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Activities" />
<Reference Include="System.Activities.Presentation" />
<Reference Include="System.Core" />
<Reference Include="System.DirectoryServices" />
<Reference Include="System.DirectoryServices.AccountManagement" />
<Reference Include="System.IdentityModel" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Security" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.ServiceModel.Web" />
<Reference Include="System.Web" />
<Reference Include="System.Workflow.Activities" />
<Reference Include="System.Workflow.ComponentModel" />
<Reference Include="System.Workflow.Runtime" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Services\Class1.cs" />
<Compile Include="Services\Class2.cs" />
<Compile Include="Workflow\Class1.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include="PZone.snk" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Common\Common Workflow\Common Workflow.csproj">
<Project>{284e4b2f-4072-4f7b-8d5f-c91f7108e839}</Project>
<Name>Common Workflow</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Common\Common\Common.csproj">
<Project>{ba975349-739a-4b4f-8003-499e62dea6bc}</Project>
<Name>Common</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>md "$(TargetDir)Release"
"$(SolutionDir)packages\ILMerge.2.14.1208\tools\ILMerge" /t:library /targetplatform:"v4,C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2" /copyattrs /keyfile:"$(ProjectDir)PZone.snk" /out:"$(TargetDir)Release\$(TargetFileName)" "$(TargetPath)" "$(TargetDir)PZone.Core.dll" "$(TargetDir)PZone.Common.dll" "$(TargetDir)PZone.Common.Workflow.dll"</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
Binary file added Source/Tools/DaData/DaData/PZone.snk
Binary file not shown.
36 changes: 36 additions & 0 deletions Source/Tools/DaData/DaData/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
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("DaData")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DaData")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[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("e06e4993-27e7-43e7-8a41-4c45006723fc")]

// 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")]
75 changes: 75 additions & 0 deletions Source/Tools/DaData/DaData/Services/Class1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
//using System;
//using System.IO;
//using System.Net;
//using System.Text;
//using System.Text.RegularExpressions;
//using System.Web;
//using Microsoft.Xrm.Sdk;
//using Newtonsoft.Json;


//namespace PZone.DaDataTools.Services
//{
// public class DaDataService
// {
// /// <summary>
// /// Ссылка на сервис CRM.
// /// </summary>
// protected readonly IOrganizationService Service;


// private readonly Lazy<DaDataSettings> _settings;


// /// <summary>
// /// Конструтор класса.
// /// </summary>
// /// <param name="service">Ссылка на сервис CRM.</param>
// public DaDataService(IOrganizationService service)
// {
// Service = service;
// _settings = new Lazy<DaDataSettings>(() => new DaDataSettingsService(Service).Retrieve());
// }


// public string RetrieveAddresses(string query, int count)
// {
// query = new Regex(@"[\\""']").Replace(query, "");
// HttpWebRequest request;
// if (_settings.Value.UseProxy)
// {
// request = WebRequest.CreateHttp($@"{_settings.Value.AddressesUrl}?query={HttpUtility.UrlEncode(query)}&count={count}");
// request.Method = "GET";
// if (_settings.Value.UseAuthentication)
// request.UseDefaultCredentials = true;
// }
// else
// {
// var data = JsonConvert.SerializeObject(new { query = query, count = count });
// var postData = Encoding.UTF8.GetBytes(data);
// request = WebRequest.CreateHttp(_settings.Value.AddressesUrl);
// request.Method = "POST";
// request.ContentType = "application/json";
// request.Accept = "application/json";
// request.Headers.Add(HttpRequestHeader.Authorization, $@"Token {_settings.Value.ApiKey}");
// request.ContentLength = postData.Length;
// using (var dataStream = request.GetRequestStream())
// {
// dataStream.Write(postData, 0, postData.Length);
// }
// }
// string json;
// using (var response = request.GetResponse())
// {
// var responseStream = response.GetResponseStream();
// if (responseStream == null)
// throw new Exception("Сервис DaData вернул пустой ответ.");
// using (var streamReader = new StreamReader(responseStream))
// {
// json = streamReader.ReadToEnd();
// }
// }
// return json;
// }
// }
//}
Loading

0 comments on commit 0956d8d

Please sign in to comment.