content stringlengths 5 1.04M | avg_line_length float64 1.75 12.9k | max_line_length int64 2 244k | alphanum_fraction float64 0 0.98 | licenses list | repository_name stringlengths 7 92 | path stringlengths 3 249 | size int64 5 1.04M | lang stringclasses 2 values |
|---|---|---|---|---|---|---|---|---|
using FanKit.Transformers;
using System;
namespace Retouch_Photo2.Layers
{
/// <summary>
/// ID of <see cref="ILayer"/>.
/// </summary>
public partial class Layerage : IGetActualTransformer
{
/// <summary>
/// Set value.
/// </summary>
/// <param name="action"> action </param>
public void SetValue(Action<Layerage> action)
{
action(this);
}
/// <summary>
/// Set value with group layerage's children.
/// </summary>
/// <param name="action"> action </param>
public void SetValueWithChildrenOnlyGroup(Action<Layerage> action)
{
action(this);
ILayer layer = this.Self;
if (layer.Type == LayerType.Group)
{
foreach (Layerage child in this.Children)
{
child.SetValueWithChildrenOnlyGroup(action);
}
}
}
/// <summary>
/// Set value with children.
/// </summary>
/// <param name="action"> action </param>
public void SetValueWithChildren(Action<Layerage> action)
{
action(this);
if (this.Children.Count != 0)
{
foreach (Layerage child in this.Children)
{
child.SetValueWithChildren(action);
}
}
}
}
}
| 25.034483 | 74 | 0.48416 | [
"MIT"
] | ysdy44/Retouch-Photo2-UWP | Retouch Photo2.Layers/Layerages/Layerage.SetValue.cs | 1,454 | C# |
namespace Microsoft.AspNetCore.Authorization;
public static class AuthorizePolicy
{
public const string Default = "default";
} | 22 | 46 | 0.787879 | [
"MIT"
] | BearerPipelineTest/Adnc | src/ServerApi/Services/Shared/Adnc.Shared.WebApi/Authorize/AuthorizePolicy.cs | 134 | C# |
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Seed.API.Migrations
{
public partial class UserModel : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Users",
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
FullName = table.Column<string>(nullable: true),
EmailAddress = table.Column<string>(nullable: true),
PasswordHash = table.Column<byte[]>(nullable: true),
PasswordSalt = table.Column<byte[]>(nullable: true),
EnrollmentDate = table.Column<DateTime>(nullable: false),
Username = table.Column<string>(nullable: true),
AccountConfirmed = table.Column<bool>(nullable: false),
PhotoUrl = table.Column<string>(nullable: true),
EmailVerified = table.Column<bool>(nullable: false),
IsLogged = table.Column<bool>(nullable: false),
Uid = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Users", x => x.Id);
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Users");
}
}
}
| 39.219512 | 77 | 0.524254 | [
"MIT"
] | HeyBaldur/CoRM | Seed.API/Migrations/20210801221801_UserModel.cs | 1,610 | C# |
using SortAlgorithm;
using SortAlgorithm.Logics;
using System;
using System.Collections.Generic;
using System.Linq;
using Xunit;
namespace SortTests
{
public class QuickSortMedian3InsertTests
{
private ISort<int> sort;
private string algorithm;
private SortType sortType;
public QuickSortMedian3InsertTests()
{
sort = new QuickSortMedian3Insert<int>();
algorithm = nameof(QuickSortMedian3Insert<int>);
sortType = SortType.Partition;
}
[Fact]
public void SortTypeTest()
{
sort.SortType.Is(sortType);
}
[Theory]
[ClassData(typeof(MockRandomData))]
public void RandomInputTypeTest(IInputSample<int> inputSample)
{
inputSample.InputType.Is(InputType.Random);
}
[Theory]
[ClassData(typeof(MockNegativePositiveRandomData))]
public void MixRandomInputTypeTest(IInputSample<int> inputSample)
{
inputSample.InputType.Is(InputType.MixRandom);
}
[Theory]
[ClassData(typeof(MockNegativeRandomData))]
public void NegativeRandomInputTypeTest(IInputSample<int> inputSample)
{
inputSample.InputType.Is(InputType.NegativeRandom);
}
[Theory]
[ClassData(typeof(MockReversedData))]
public void ReverseInputTypeTest(IInputSample<int> inputSample)
{
inputSample.InputType.Is(InputType.Reversed);
}
[Theory]
[ClassData(typeof(MockMountainData))]
public void MountainInputTypeTest(IInputSample<int> inputSample)
{
inputSample.InputType.Is(InputType.Mountain);
}
[Theory]
[ClassData(typeof(MockNearlySortedData))]
public void NearlySortedInputTypeTest(IInputSample<int> inputSample)
{
inputSample.InputType.Is(InputType.NearlySorted);
}
[Theory]
[ClassData(typeof(MockSortedData))]
public void SortedInputTypeTest(IInputSample<int> inputSample)
{
inputSample.InputType.Is(InputType.Sorted);
}
[Theory]
[ClassData(typeof(MockSameValuesData))]
public void SameValuesInputTypeTest(IInputSample<int> inputSample)
{
inputSample.InputType.Is(InputType.SameValues);
}
[Theory]
[ClassData(typeof(MockRandomData))]
[ClassData(typeof(MockNegativePositiveRandomData))]
[ClassData(typeof(MockNegativeRandomData))]
[ClassData(typeof(MockReversedData))]
[ClassData(typeof(MockMountainData))]
[ClassData(typeof(MockNearlySortedData))]
[ClassData(typeof(MockSortedData))]
[ClassData(typeof(MockSameValuesData))]
public void SortResultOrderTest(IInputSample<int> inputSample)
{
sort.Sort(inputSample.Samples).Is(inputSample.Samples.OrderBy(x => x));
}
[Theory]
[ClassData(typeof(MockRandomData))]
[ClassData(typeof(MockNegativePositiveRandomData))]
[ClassData(typeof(MockNegativeRandomData))]
[ClassData(typeof(MockReversedData))]
[ClassData(typeof(MockMountainData))]
[ClassData(typeof(MockNearlySortedData))]
[ClassData(typeof(MockSameValuesData))]
public void StatisticsTest(IInputSample<int> inputSample)
{
sort.Sort(inputSample.Samples);
sort.Statistics.Algorithm.Is(algorithm);
sort.Statistics.ArraySize.Is(inputSample.Samples.Length);
sort.Statistics.IndexAccessCount.IsNot<ulong>(0);
sort.Statistics.CompareCount.IsNot<ulong>(0);
sort.Statistics.SwapCount.IsNot<ulong>(0);
}
[Theory]
[ClassData(typeof(MockSortedData))]
public void StatisticsNoSwapCountTest(IInputSample<int> inputSample)
{
sort.Sort(inputSample.Samples);
sort.Statistics.Algorithm.Is(algorithm);
sort.Statistics.ArraySize.Is(inputSample.Samples.Length);
sort.Statistics.IndexAccessCount.IsNot<ulong>(0);
sort.Statistics.CompareCount.IsNot<ulong>(0);
sort.Statistics.SwapCount.IsNot<ulong>(0);
}
[Theory]
[ClassData(typeof(MockRandomData))]
[ClassData(typeof(MockNegativePositiveRandomData))]
[ClassData(typeof(MockNegativeRandomData))]
[ClassData(typeof(MockReversedData))]
[ClassData(typeof(MockMountainData))]
[ClassData(typeof(MockNearlySortedData))]
[ClassData(typeof(MockSortedData))]
[ClassData(typeof(MockSameValuesData))]
public void StatisticsResetTest(IInputSample<int> inputSample)
{
sort.Sort(inputSample.Samples);
sort.Statistics.Reset();
sort.Statistics.IndexAccessCount.Is<ulong>(0);
sort.Statistics.CompareCount.Is<ulong>(0);
sort.Statistics.SwapCount.Is<ulong>(0);
}
}
} | 34.204082 | 83 | 0.638027 | [
"MIT"
] | guitarrapc/SortAlgorithm | src/SortAlgorithm/SortTests/QuickSortMedian3InsertTests.cs | 5,028 | C# |
using ContosoPets.Ui.Models;
using ContosoPets.Ui.Services;
using Microsoft.AspNetCore.Mvc.RazorPages;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace ContosoPets.Ui.Pages.Orders
{
public class IndexModel : PageModel
{
private readonly OrderService _orderService;
public IEnumerable<Order> Orders { get; private set; } = new List<Order>();
public IndexModel(OrderService orderService)
{
_orderService = orderService;
}
public async Task OnGet() =>
Orders = await _orderService.GetOrders();
}
} | 27.590909 | 83 | 0.68369 | [
"MIT"
] | ambilyks/mslearn-aspnet-core | modules/secure-aspnet-core-identity/src/ContosoPets.Ui/Pages/Orders/Index.cshtml.cs | 609 | C# |
using System;
using Microsoft.SPOT;
using System.Collections;
using System.Diagnostics;
namespace NfxLab.MicroFramework.Logging
{
public class Log
{
LogFormatter formatter = new LogFormatter();
public string Name { get; set; }
public int Level { get; set; }
public IAppender[] Appenders { get; set; }
public Log(params IAppender[] appenders)
{
this.Appenders = appenders;
}
public void Info(params object[] data)
{
Write(LogCategory.Info, data);
}
[Conditional("DEBUG")]
public void Debug(params object[] data)
{
Write(LogCategory.Debug, data);
}
public void Warning(params object[] data)
{
Write(LogCategory.Warning, data);
}
public void Error(params object[] data)
{
Write(LogCategory.Error, data);
}
private void Write(LogCategory category, params object[] data)
{
string message = formatter.Format(category, data);
foreach (IAppender appender in Appenders)
appender.Write(message);
}
}
}
| 23.627451 | 70 | 0.559336 | [
"MIT"
] | NicolasFatoux/NfxLab.Sensors | NfxLab.MicroFramework/Logging/Log.cs | 1,205 | C# |
namespace MagicGradients.Forms.Animation
{
public class IntegerTweener : ITweener<int>
{
public int Tween(int @from, int to, double progress)
{
return (int)(from + (to - from) * progress);
}
}
public class IntegerAnimation : PropertyAnimation<int>
{
public override ITweener<int> Tweener { get; } = new IntegerTweener();
}
public class IntegerAnimationUsingKeyFrames : PropertyAnimationUsingKeyFrames<int>
{
public override ITweener<int> Tweener { get; } = new IntegerTweener();
}
public class IntegerKeyFrame : KeyFrame<int> { }
}
| 27.304348 | 86 | 0.64172 | [
"MIT"
] | rnwelsh/MagicGradients | src/MagicGradients.Forms/Animation/Library/IntegerAnimation.cs | 630 | C# |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
namespace Azure.ResourceManager.Cdn.Models
{
/// <summary> The json object containing secret parameters. </summary>
internal partial class SecretParameters
{
/// <summary> Initializes a new instance of SecretParameters. </summary>
public SecretParameters()
{
}
/// <summary> Initializes a new instance of SecretParameters. </summary>
/// <param name="secretType"> The type of the secret resource. </param>
internal SecretParameters(SecretType secretType)
{
SecretType = secretType;
}
/// <summary> The type of the secret resource. </summary>
internal SecretType SecretType { get; set; }
}
}
| 29.206897 | 80 | 0.646989 | [
"MIT"
] | ChenTanyi/azure-sdk-for-net | sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/SecretParameters.cs | 847 | C# |
using Svelto.DataStructures;
using Svelto.ECS.DataStructures;
using Svelto.ECS.Internal;
namespace Svelto.ECS.Internal
{
public interface IReactEngine : IEngine
{
}
public interface IReactOnAdd : IReactEngine
{
}
public interface IReactOnAddEx : IReactEngine
{
}
public interface IReactOnRemoveEx : IReactEngine
{
}
public interface IReactOnSwapEx : IReactEngine
{
}
public interface IReactOnRemove : IReactEngine
{
}
public interface IReactOnDispose : IReactEngine
{
}
public interface IReactOnSwap : IReactEngine
{
}
}
namespace Svelto.ECS
{
public interface IEngine
{
}
public interface IGetReadyEngine : IEngine
{
void Ready();
}
public interface IQueryingEntitiesEngine : IGetReadyEngine
{
EntitiesDB entitiesDB { set; }
}
/// <summary>
/// Interface to mark an Engine as reacting on entities added
/// </summary>
/// <typeparam name="T"></typeparam>
public interface IReactOnAdd<T> : IReactOnAdd where T : IEntityComponent
{
void Add(ref T entityComponent, EGID egid);
}
public interface IReactOnAddEx<T> : IReactOnAddEx where T : struct, IEntityComponent
{
void Add((uint start, uint end) rangeOfEntities, in EntityCollection<T> collection,
ExclusiveGroupStruct groupID);
}
/// <summary>
/// Interface to mark an Engine as reacting on entities removed
/// </summary>
/// <typeparam name="T"></typeparam>
public interface IReactOnRemove<T> : IReactOnRemove where T : IEntityComponent
{
void Remove(ref T entityComponent, EGID egid);
}
public interface IReactOnRemoveEx<T> : IReactOnRemoveEx where T : struct, IEntityComponent
{
void Remove((uint start, uint end) rangeOfEntities, in EntityCollection<T> collection,
ExclusiveGroupStruct groupID);
}
public interface IReactOnAddAndRemove<T> : IReactOnAdd<T>, IReactOnRemove<T> where T : IEntityComponent
{
}
/// <summary>
/// Interface to mark an Engine as reacting on engines root disposed.
/// It can work together with IReactOnRemove which normally is not called on enginesroot disposed
/// </summary>
/// <typeparam name="T"></typeparam>
public interface IReactOnDispose<T> : IReactOnDispose where T : IEntityComponent
{
void Remove(ref T entityComponent, EGID egid);
}
/// <summary>
/// Interface to mark an Engine as reacting to entities swapping group
/// </summary>
/// <typeparam name="T"></typeparam>
public interface IReactOnSwap<T> : IReactOnSwap where T : IEntityComponent
{
void MovedTo(ref T entityComponent, ExclusiveGroupStruct previousGroup, EGID egid);
}
public interface IReactOnSwapEx<T> : IReactOnSwapEx where T : struct, IEntityComponent
{
void MovedTo((uint start, uint end) rangeOfEntities, in EntityCollection<T> collection,
ExclusiveGroupStruct fromGroup, ExclusiveGroupStruct toGroup);
}
/// <summary>
/// Interface to mark an Engine as reacting after each entities submission phase
/// </summary>
public interface IReactOnSubmission : IReactEngine
{
void EntitiesSubmitted();
}
} | 27.196721 | 107 | 0.668475 | [
"MIT"
] | cathei/Svelto.ECS.Schema | com.sebaslab.svelto.ecs/Core/IEngine.cs | 3,318 | C# |
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using CinemaConstructor.Database.Entities;
using Microsoft.EntityFrameworkCore;
namespace CinemaConstructor.Database.Repositories
{
public class CompanyRepository
{
private readonly ApplicationDbContext _context;
public CompanyRepository(ApplicationDbContext context)
{
_context = context;
}
public async Task<IEnumerable<Company>> GetAllAsync(CancellationToken token)
{
return await _context.Companies.ToListAsync(token);
}
public async Task<Company> FindByIdAsync(long id, CancellationToken token)
{
var keys = new object[] { id };
return await _context.Companies.FindAsync(keys, token);
}
public async Task<Company> AddAsync(Company company, CancellationToken token)
{
company.Id = 0;
_context.Companies.Add(company);
await _context.SaveChangesAsync(token);
return company;
}
public async Task<Company> UpdateAsync(Company company, CancellationToken token)
{
_context.Companies.Update(company);
await _context.SaveChangesAsync(token);
return company;
}
}
}
| 27.708333 | 88 | 0.646617 | [
"MIT"
] | dnskk/CinemaConstructor | CinemaConstructor.Database/Repositories/CompanyRepository.cs | 1,332 | C# |
// <copyright file="ValidateControlExtensions.cs" company="Automate The Planet Ltd.">
// Copyright 2021 Automate The Planet Ltd.
// Licensed under the Apache License, Version 2.0 (the "License");
// You may not use this file except in compliance with the License.
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
// <author>Anton Angelov</author>
// <site>https://bellatrix.solutions/</site>
using Bellatrix.Mobile.Exceptions;
using Bellatrix.Mobile.Untils;
using Bellatrix.Mobile.Validates;
using OpenQA.Selenium;
using OpenQA.Selenium.Appium;
using OpenQA.Selenium.Support.UI;
using System;
namespace Bellatrix.Mobile
{
internal static class ValidateControlWaitService
{
internal static void WaitUntil<TDriver, TDriverElement>(Func<bool> waitCondition, string exceptionMessage, int? timeoutInSeconds, int? sleepIntervalInSeconds)
where TDriver : AppiumDriver<TDriverElement>
where TDriverElement : AppiumWebElement
{
var localTimeout = timeoutInSeconds ?? ConfigurationService.GetSection<MobileSettings>().TimeoutSettings.ValidationsTimeout;
var localSleepInterval = sleepIntervalInSeconds ?? ConfigurationService.GetSection<MobileSettings>().TimeoutSettings.SleepInterval;
var wrappedWebDriver = ServicesCollection.Current.Resolve<TDriver>();
var webDriverWait = new AppiumDriverWait<TDriver, TDriverElement>(wrappedWebDriver, new SystemClock(), TimeSpan.FromSeconds(localTimeout), TimeSpan.FromSeconds(localSleepInterval));
webDriverWait.IgnoreExceptionTypes(typeof(NoSuchElementException), typeof(StaleElementReferenceException));
bool LocalCondition(IWebDriver s)
{
try
{
return waitCondition();
}
catch (Exception)
{
return false;
}
}
try
{
webDriverWait.Until(LocalCondition);
}
catch (WebDriverTimeoutException)
{
var elementPropertyValidateException = new ComponentPropertyValidateException(exceptionMessage);
ValidatedExceptionThrowedEvent?.Invoke(waitCondition, new ComponentNotFulfillingValidateConditionEventArgs(elementPropertyValidateException));
throw elementPropertyValidateException;
}
}
public static event EventHandler<ComponentNotFulfillingValidateConditionEventArgs> ValidatedExceptionThrowedEvent;
}
}
| 47.419355 | 193 | 0.701361 | [
"Apache-2.0"
] | 48x16/BELLATRIX | src/Bellatrix.Mobile/validators/ValidateControlExtensions.cs | 2,942 | C# |
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
namespace Qzone
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
private void Application_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
{
MessageBox.Show(e.Exception.ToString());
e.Handled = true;
}
}
}
| 24.565217 | 142 | 0.690265 | [
"MIT"
] | zhaotianff/Qzone | Qzone/Qzone/App.xaml.cs | 567 | C# |
using System.Windows;
using System.Windows.Forms.Integration;
namespace Gearset.UserInterface.Wpf.About
{
/// <summary>
/// Interaction logic for AboutWindow.xaml
/// </summary>
public partial class AboutWindow : Window
{
public AboutWindow()
{
InitializeComponent();
ElementHost.EnableModelessKeyboardInterop(this);
}
}
}
| 22.055556 | 60 | 0.634761 | [
"MIT"
] | PumpkinPaul/Gearset | Gearset/UserInterface/Wpf/About/AboutWindow.xaml.cs | 399 | C# |
using System.ComponentModel.DataAnnotations;
namespace NotificationHub.Sample.API.Models.Notifications
{
public class NotificationHubOptions
{
[Required]
public string Name { get; set; }
[Required]
public string ConnectionString { get; set; }
}
}
| 20.928571 | 57 | 0.672355 | [
"Apache-2.0"
] | deepakrout/azure-notificationhubs-samples | NotificationHubSample/NotificationHub.Sample.API/NotificationHub.Sample.API/Models/Notifications/NotificationHubOptions.cs | 293 | C# |
namespace Cars
{
public class Tesla : ICar, IElectricCar
{
public string Model { get; set; }
public string Color { get; set; }
public int Battery { get; set; }
public Tesla(string model, string color, int battery)
{
this.Model = model;
this.Color = color;
this.Battery = battery;
}
public string Start()
{
return "Engine start";
}
public string Stop()
{
return "Breaaak!";
}
public override string ToString()
{
return $"{this.Color} {this.GetType().Name} {this.Model} with {this.Battery} Batteries" +
$"\n{Start()} " +
$"\n{Stop()}";
}
}
} | 24.121212 | 101 | 0.461055 | [
"MIT"
] | VeselinBPavlov/csharp-oop-basics | 09. Interfaces and Abstraction - Lab/Cars/Tesla.cs | 796 | C# |
using UnityEngine;
using System.Collections;
public class SwitchScene : MonoBehaviour {
public string levelName = "Main";
public float minWaitTime = 2f;
void Start() {
GameManager.Instance.LoadSceneInBackground (this, levelName, false, minWaitTime);
}
}
| 20.307692 | 83 | 0.757576 | [
"MIT"
] | waynewolf/abucket | mermaid/Assets/Script/SwitchScene.cs | 266 | C# |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。
// アセンブリに関連付けられている情報を変更するには、
// これらの属性値を変更してください。
[assembly: AssemblyTitle("JFactory.CsSrcLib.Console")]
[assembly: AssemblyDescription("Source Library")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("JFactory.CsSrcLib.Console")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから
// 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、
// その型の ComVisible 属性を true に設定してください。
[assembly: ComVisible(false)]
// このプロジェクトが COM に公開される場合、次の GUID が typelib の ID になります
[assembly: Guid("ad0a3a2f-41d4-4857-a341-f9f815d526cb")]
// アセンブリのバージョン情報は次の 4 つの値で構成されています:
//
// メジャー バージョン
// マイナー バージョン
// ビルド番号
// Revision
//
// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を
// 既定値にすることができます:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| 30.297297 | 57 | 0.749331 | [
"MIT"
] | manbou404/CSharpLab | SourceLibrary/00-TemplateCS/CsSrcLib/Console/Properties/AssemblyInfo.cs | 1,690 | C# |
/**********************************************
* Pantagruel
* Copyright 2015-2016 James Clark
**********************************************/
using UnityEngine;
using System.Collections;
namespace Pantagruel.Serializer
{
/// <summary>
/// Simple dummy component used by the serializer to identify
/// GameObjects as prefab references and not simply normal scene objects.
/// </summary>
[ExecuteInEditMode]
public class PrefabId : MonoBehaviour
{
public string ManifestId;
void Reset()
{
ManifestId = gameObject.name;
}
void Awake()
{
//We never want runtime instance to have this component.
//Only prefabs should be allowed to have this.
Destroy(this);
}
}
}
| 24.515152 | 77 | 0.532756 | [
"MIT"
] | jamClark/Pantagruel | Assets/Pantagruel/Serializer/Scripts/PrefabId.cs | 811 | C# |
using Xunit;
namespace Lncodes.DesignPattern.Bridge.Test
{
public sealed class BridgeTheoryData : TheoryData<Enemy, Element, uint, uint>
{
public BridgeTheoryData()
{
Add(new OrcEnemy(new FireElement()), new WaterElement(), 10, 87);
Add(new SlimeEnemy(new WindElement()), new FireElement(), 20, 5);
Add(new GoblinEnemy(new WaterElement()), new WindElement(), 30, 10);
}
}
}
| 29.866667 | 81 | 0.620536 | [
"MIT"
] | lncodes/design-pattern-bridge | c#/test/Theory Data/BridgeTheoryData.cs | 450 | C# |
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("test")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyProductAttribute("test")]
[assembly: System.Reflection.AssemblyTitleAttribute("test")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// Generated by the MSBuild WriteCodeFragment class.
| 40.083333 | 80 | 0.640333 | [
"MIT"
] | BoomlabsInc/BCSF | 2022-S1/W6/test/obj/Debug/net6.0/test.AssemblyInfo.cs | 962 | C# |
using System;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using LibUA.Core;
using LibUA.Security.Cryptography;
using RSACng = LibUA.Security.Cryptography.RSACng;
namespace LibUA
{
public static class UASecurity
{
public const int Sha1Size = 20;
public const int Sha256Size = 32;
public const int RsaPkcs1PaddingSize = 11;
public const int RsaPkcs1OaepPaddingSize = 42;
public const int ActivationNonceSize = 32;
public enum HashAlgorithm : int
{
None = 0,
SHA_160,
SHA_224,
SHA_256,
SHA_384,
SHA_512,
}
public enum PaddingAlgorithm : int
{
None = 0,
PKCS1,
PKCS1_OAEP
}
public static PaddingAlgorithm PaddingMethodForSecurityPolicy(SecurityPolicy policy)
{
switch (policy)
{
case SecurityPolicy.Basic256: return PaddingAlgorithm.PKCS1_OAEP;
case SecurityPolicy.Basic256Sha256: return PaddingAlgorithm.PKCS1_OAEP;
case SecurityPolicy.Basic128Rsa15: return PaddingAlgorithm.PKCS1;
}
throw new Exception();
}
public static int SymmetricKeySizeForSecurityPolicy(SecurityPolicy policy, int clientNonceLength = -1)
{
switch (policy)
{
case SecurityPolicy.Basic256: return 32;
case SecurityPolicy.Basic256Sha256: return clientNonceLength < 1 ? 32 : clientNonceLength;
case SecurityPolicy.Basic128Rsa15: return 16;
}
throw new Exception();
}
public static int SymmetricBlockSizeForSecurityPolicy()
{
return 16;
}
public static int SymmetricSignatureKeySizeForSecurityPolicy(SecurityPolicy policy)
{
switch (policy)
{
case SecurityPolicy.Basic256: return 24;
case SecurityPolicy.Basic256Sha256: return 32;
case SecurityPolicy.Basic128Rsa15: return SymmetricKeySizeForSecurityPolicy(policy);
default:
break;
}
throw new Exception();
}
public static bool UseOaepForSecurityPolicy(SecurityPolicy policy)
{
switch (policy)
{
case SecurityPolicy.Basic256:
case SecurityPolicy.Basic256Sha256:
return true;
}
return false;
}
public static int CalculatePublicKeyLength(X509Certificate2 cert)
{
RSACryptoServiceProvider rsa = cert.PublicKey.Key as RSACryptoServiceProvider;
if (rsa == null)
{
throw new Exception("Could not create RSACryptoServiceProvider");
}
return rsa.KeySize;
}
public static int CalculatePaddingSize(X509Certificate2 cert, SecurityPolicy policy, int position, int sigSize)
{
int plainBlockSize = GetPlainBlockSize(cert, UseOaepForSecurityPolicy(policy));
int pad = plainBlockSize;
pad -= (position + sigSize) % plainBlockSize;
if (pad < 0)
{
throw new Exception();
}
return pad;
}
public static int CalculateSymmetricEncryptedSize(int keySize, int position)
{
int numBlocks = (position + keySize - 1) / keySize;
return numBlocks * keySize;
}
public static int CalculateSymmetricPaddingSize(int keySize, int position)
{
if (keySize > 256)
{
throw new Exception("TODO: Handle keys above 2048 bits");
}
int pad = position + keySize;
// Size byte
pad++;
if (keySize > 0)
{
pad -= pad % keySize;
}
pad -= position;
if (pad < 0 || pad > 256)
{
throw new Exception();
}
return pad;
}
public static int CalculateSignatureSize(RSACryptoServiceProvider key)
{
return key.KeySize / 8;
}
public static int CalculateSignatureSize(X509Certificate2 cert)
{
return CalculateSignatureSize(cert.PublicKey.Key as RSACryptoServiceProvider);
}
public static int CalculateEncryptedSize(X509Certificate2 cert, int messageSize, PaddingAlgorithm paddingAlgorithm)
{
RSACryptoServiceProvider rsa = cert.PublicKey.Key as RSACryptoServiceProvider;
if (rsa == null)
{
throw new Exception("Could not create RSACryptoServiceProvider");
}
int pad = PaddingSizeForMethod(paddingAlgorithm);
int keySize = CalculatePublicKeyLength(cert) / 8;
if (keySize < pad)
{
throw new Exception();
}
int blockSize = keySize - pad;
int numBlocks = (messageSize + blockSize - 1) / blockSize;
return numBlocks * keySize;
}
public static int PaddingSizeForMethod(PaddingAlgorithm paddingMethod)
{
switch (paddingMethod)
{
case PaddingAlgorithm.None: return 0;
case PaddingAlgorithm.PKCS1: return RsaPkcs1PaddingSize;
case PaddingAlgorithm.PKCS1_OAEP: return RsaPkcs1OaepPaddingSize;
}
throw new Exception();
}
public static string ExportPEM(X509Certificate cert)
{
StringBuilder sb = new StringBuilder();
sb.AppendLine("-----BEGIN CERTIFICATE-----");
sb.AppendLine(Convert.ToBase64String(cert.Export(X509ContentType.Cert), Base64FormattingOptions.InsertLineBreaks));
sb.AppendLine("-----END CERTIFICATE-----");
return sb.ToString();
}
public static byte[] GenerateRandomBits(int numBits)
{
return GenerateRandomBytes((numBits + 7) / 8);
}
public static byte[] GenerateRandomBytes(int numBytes)
{
//var arr = Enumerable.Range(1, numBytes).Select(i => (byte)(i & 0xFF)).ToArray();
//return arr;
RandomNumberGenerator rng = new RNGCryptoServiceProvider();
var res = new byte[numBytes];
rng.GetBytes(res);
return res;
}
public static byte[] AesEncrypt(ArraySegment<byte> data, byte[] key, byte[] iv)
{
using (var aes = new AesManaged()
{
Mode = CipherMode.CBC,
IV = iv, // new byte[16] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
Key = key,
Padding = PaddingMode.PKCS7
})
{
using (var crypt = aes.CreateEncryptor(aes.Key, aes.IV))
{
using (var ms = new MemoryStream())
{
using (var cs = new CryptoStream(ms, crypt, CryptoStreamMode.Write))
{
var lengthBytes = new byte[]
{
(byte)(data.Count & 0xFF),
(byte)((data.Count >> 8) & 0xFF),
(byte)((data.Count >> 16) & 0xFF),
(byte)((data.Count >> 24) & 0xFF),
};
cs.Write(lengthBytes, 0, 4);
cs.Write(data.Array, data.Offset, data.Count);
}
return ms.ToArray();
}
}
}
}
public static byte[] AesDecrypt(ArraySegment<byte> data, byte[] key, byte[] iv)
{
if (data.Count < 4)
{
return null;
}
using (var aes = new AesManaged()
{
Mode = CipherMode.CBC,
IV = iv, // new byte[16] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
Key = key,
Padding = PaddingMode.PKCS7
})
{
using (var crypt = aes.CreateDecryptor(aes.Key, aes.IV))
{
using (var ms = new MemoryStream(data.Array, data.Offset, data.Count))
{
byte[] plain = new byte[data.Count];
int plainLength = 0;
using (var cs = new CryptoStream(ms, crypt, CryptoStreamMode.Read))
{
plainLength = cs.Read(plain, 0, plain.Length);
}
using (var msRead = new MemoryStream(plain))
{
var lengthBytes = new byte[4];
msRead.Read(lengthBytes, 0, 4);
int length = lengthBytes[0] | (lengthBytes[1] << 8) | (lengthBytes[2] << 16) | (lengthBytes[3] << 24);
if (length + 4 > plainLength)
{
return null;
}
var res = new byte[length];
Array.Copy(plain, 4, res, 0, length);
return res;
}
}
}
}
}
public static int RijndaelEncryptInplace(ArraySegment<byte> data, byte[] key, byte[] iv)
{
using (var rijn = new RijndaelManaged()
{
Mode = CipherMode.CBC,
IV = iv,
Key = key,
Padding = PaddingMode.None
})
{
using (var crypt = rijn.CreateEncryptor(rijn.Key, rijn.IV))
{
if (data.Count % crypt.InputBlockSize != 0)
{
throw new Exception(string.Format("Input data is not a multiple of block size, {0}/{1}", data.Count, crypt.InputBlockSize));
}
crypt.TransformBlock(data.Array, data.Offset, data.Count, data.Array, data.Offset);
return ((data.Count + crypt.InputBlockSize - 1) / crypt.InputBlockSize) * crypt.InputBlockSize;
}
}
}
public static int RijndaelDecryptInplace(ArraySegment<byte> data, byte[] key, byte[] iv)
{
using (var rijn = new RijndaelManaged()
{
Mode = CipherMode.CBC,
IV = iv,
Key = key,
Padding = PaddingMode.None
})
{
using (var crypt = rijn.CreateDecryptor(rijn.Key, rijn.IV))
{
if (data.Count % crypt.InputBlockSize != 0)
{
throw new Exception(string.Format("Input data is not a multiple of block size, {0}/{1}", data.Count, crypt.InputBlockSize));
}
crypt.TransformBlock(data.Array, data.Offset, data.Count, data.Array, data.Offset);
int numBlocks = (data.Count + crypt.InputBlockSize - 1) / crypt.InputBlockSize;
return numBlocks * crypt.InputBlockSize;
}
}
}
public static string ExportRSAPrivateKey(RSAParameters parameters)
{
MemoryStream ms = new MemoryStream();
using (var outputStream = new StreamWriter(ms))
{
using (var stream = new MemoryStream())
{
var writer = new BinaryWriter(stream);
writer.Write((byte)0x30); // Sequence
using (var innerStream = new MemoryStream())
{
var innerWriter = new BinaryWriter(innerStream);
EncodeIntBigEndian(innerWriter, new byte[] { 0x00 }); // Version
EncodeIntBigEndian(innerWriter, parameters.Modulus);
EncodeIntBigEndian(innerWriter, parameters.Exponent);
EncodeIntBigEndian(innerWriter, parameters.D);
EncodeIntBigEndian(innerWriter, parameters.P);
EncodeIntBigEndian(innerWriter, parameters.Q);
EncodeIntBigEndian(innerWriter, parameters.DP);
EncodeIntBigEndian(innerWriter, parameters.DQ);
EncodeIntBigEndian(innerWriter, parameters.InverseQ);
var length = (int)innerStream.Length;
EncodeLength(writer, length);
writer.Write(innerStream.ToArray(), 0, length);
}
var base64 = Convert.ToBase64String(stream.ToArray(), 0, (int)stream.Length).ToCharArray();
outputStream.WriteLine("-----BEGIN RSA PRIVATE KEY-----");
for (int i = 0; i < base64.Length; i += 64)
{
outputStream.WriteLine(base64, i, Math.Min(64, base64.Length - i));
}
outputStream.WriteLine("-----END RSA PRIVATE KEY-----");
}
}
return System.Text.Encoding.ASCII.GetString(ms.ToArray());
}
public static RSAParameters ImportRSAPrivateKey(string buf)
{
var rsa = new RSACng();
var parameters = rsa.ExportParameters(false);
var b64line = string.Join(string.Empty, buf
.Split(Environment.NewLine.ToArray())
.Where(line => !line.Trim().StartsWith("-"))
.ToArray());
var byteArr = Convert.FromBase64String(b64line);
var ms = new MemoryStream();
ms.Write(byteArr, 0, byteArr.Length);
ms.Seek(0, SeekOrigin.Begin);
using (var inputStream = new BinaryReader(ms))
{
if (inputStream.ReadByte() != 0x30)
{
return parameters;
}
int length = DecodeLength(inputStream);
byte[] version = DecodeIntBigEndian(inputStream);
if (version.Length != 1 || version[0] != 0)
{
return parameters;
}
parameters.Modulus = DecodeIntBigEndian(inputStream);
parameters.Exponent = DecodeIntBigEndian(inputStream);
parameters.D = DecodeIntBigEndian(inputStream);
parameters.P = DecodeIntBigEndian(inputStream);
parameters.Q = DecodeIntBigEndian(inputStream);
parameters.DP = DecodeIntBigEndian(inputStream);
parameters.DQ = DecodeIntBigEndian(inputStream);
parameters.InverseQ = DecodeIntBigEndian(inputStream);
}
return parameters;
}
public static string ExportRSAPublicKey(RSAParameters parameters)
{
MemoryStream ms = new MemoryStream();
using (var outputStream = new StreamWriter(ms))
{
using (var stream = new MemoryStream())
{
var writer = new BinaryWriter(stream);
writer.Write((byte)0x30); // Sequence
using (var innerStream = new MemoryStream())
{
var innerWriter = new BinaryWriter(innerStream);
EncodeIntBigEndian(innerWriter, new byte[] { 0x00 }); // Version
EncodeIntBigEndian(innerWriter, parameters.Modulus);
EncodeIntBigEndian(innerWriter, parameters.Exponent);
EncodeIntBigEndian(innerWriter, parameters.Exponent);
EncodeIntBigEndian(innerWriter, parameters.Exponent);
EncodeIntBigEndian(innerWriter, parameters.Exponent);
EncodeIntBigEndian(innerWriter, parameters.Exponent);
EncodeIntBigEndian(innerWriter, parameters.Exponent);
EncodeIntBigEndian(innerWriter, parameters.Exponent);
var length = (int)innerStream.Length;
EncodeLength(writer, length);
writer.Write(innerStream.ToArray(), 0, length);
}
var base64 = Convert.ToBase64String(stream.ToArray(), 0, (int)stream.Length).ToCharArray();
outputStream.WriteLine("-----BEGIN RSA PUBLIC KEY-----");
for (int i = 0; i < base64.Length; i += 64)
{
outputStream.WriteLine(base64, i, Math.Min(64, base64.Length - i));
}
outputStream.WriteLine("-----END RSA PUBLIC KEY-----");
}
}
return System.Text.Encoding.ASCII.GetString(ms.ToArray());
}
public static RSAParameters ImportRSAPublicKey(string buf)
{
var rsa = new RSACng();
var parameters = rsa.ExportParameters(false);
var b64line = string.Join(string.Empty, buf
.Split(Environment.NewLine.ToArray())
.Where(line => !line.Trim().StartsWith("-"))
.ToArray());
var byteArr = Convert.FromBase64String(b64line);
var ms = new MemoryStream();
ms.Write(byteArr, 0, byteArr.Length);
ms.Seek(0, SeekOrigin.Begin);
using (var inputStream = new BinaryReader(ms))
{
if (inputStream.ReadByte() != 0x30)
{
return parameters;
}
int length = DecodeLength(inputStream);
byte[] version = DecodeIntBigEndian(inputStream);
if (version.Length != 1 || version[0] != 0)
{
return parameters;
}
parameters.Modulus = DecodeIntBigEndian(inputStream);
parameters.Exponent = DecodeIntBigEndian(inputStream);
DecodeIntBigEndian(inputStream);
DecodeIntBigEndian(inputStream);
DecodeIntBigEndian(inputStream);
DecodeIntBigEndian(inputStream);
DecodeIntBigEndian(inputStream);
DecodeIntBigEndian(inputStream);
}
return parameters;
}
private static int DecodeLength(BinaryReader stream)
{
int length = stream.ReadByte();
if (length < 0x80)
{
return length;
}
int bytesRequired = length - 0x80;
length = 0;
for (int i = bytesRequired - 1; i >= 0; i--)
{
length |= (int)(stream.ReadByte() << (8 * i));
}
return length;
}
private static void EncodeLength(BinaryWriter stream, int length)
{
if (length < 0)
{
throw new ArgumentOutOfRangeException("length", "Length must be non-negative");
}
if (length < 0x80)
{
stream.Write((byte)length);
}
else
{
var bytesRequired = 0;
for (int temp = length; temp > 0; temp >>= 8)
{
bytesRequired++;
}
stream.Write((byte)(bytesRequired | 0x80));
for (int i = bytesRequired - 1; i >= 0; i--)
{
stream.Write((byte)(length >> (8 * i) & 0xff));
}
}
}
private static byte[] DecodeIntBigEndian(BinaryReader stream)
{
if (stream.ReadByte() != 0x02)
{
return null;
}
int length = DecodeLength(stream);
if (length < 0)
{
return null;
}
var arr = new byte[length];
for (int i = 0; i < length; i++)
{
arr[i] = stream.ReadByte();
}
return arr;
}
private static void EncodeIntBigEndian(BinaryWriter stream, byte[] value)
{
stream.Write((byte)0x02); // Integer
EncodeLength(stream, value.Length);
for (int i = 0; i < value.Length; i++)
{
stream.Write(value[i]);
}
}
public static int GetPlainBlockSize(X509Certificate2 cert, bool useOaep)
{
var rsa = cert.PublicKey.Key as RSACryptoServiceProvider;
if (rsa == null)
{
throw new Exception("Could not create RSACryptoServiceProvider");
}
return (rsa.KeySize / 8) - (useOaep ? RsaPkcs1OaepPaddingSize : RsaPkcs1PaddingSize);
}
public static int GetCipherTextBlockSize(X509Certificate2 cert, bool useOaep)
{
var rsa = cert.PublicKey.Key as RSACryptoServiceProvider;
if (rsa == null)
{
throw new Exception("Could not create RSACryptoServiceProvider");
}
return rsa.KeySize / 8;
}
public static int GetSignatureLength(X509Certificate2 cert, bool useOaep)
{
var rsa = cert.PublicKey.Key as RSACryptoServiceProvider;
if (rsa == null)
{
throw new Exception("Could not create RSACryptoServiceProvider");
}
return rsa.KeySize / 8;
}
public static int GetSignatureLength(X509Certificate2 cert, SecurityPolicy policy)
{
return GetSignatureLength(cert, UseOaepForSecurityPolicy(policy));
}
public static byte[] RsaPkcs15Sha_Sign(ArraySegment<byte> data, RSACryptoServiceProvider privProvider,
SecurityPolicy policy)
{
var hash = HashAlgorithmForSecurityPolicy(policy);
var digest = hash.ComputeHash(data.Array, data.Offset, data.Count);
byte[] signature = privProvider.SignHash(digest, HashStrForSecurityPolicy(policy));
return signature;
}
private static string HashStrForSecurityPolicy(SecurityPolicy policy)
{
return policy == SecurityPolicy.Basic256Sha256 ? "SHA256" : "SHA1";
}
private static System.Security.Cryptography.HashAlgorithm HashAlgorithmForSecurityPolicy(SecurityPolicy policy)
{
return policy == SecurityPolicy.Basic256Sha256 ?
new SHA256Managed() :
(System.Security.Cryptography.HashAlgorithm)new SHA1Managed();
}
public static bool RsaPkcs15Sha_VerifySigned(ArraySegment<byte> data, byte[] signature, X509Certificate2 cert,
SecurityPolicy policy)
{
var rsa = cert.PublicKey.Key as RSACryptoServiceProvider;
var hash = HashAlgorithmForSecurityPolicy(policy);
var digest = hash.ComputeHash(data.Array, data.Offset, data.Count);
bool match = rsa.VerifyHash(digest, HashStrForSecurityPolicy(policy), signature);
return match;
}
public static byte[] RsaPkcs15Sha_Encrypt(ArraySegment<byte> data, X509Certificate2 cert, SecurityPolicy policy)
{
var rsa = cert.PublicKey.Key as RSACryptoServiceProvider;
int inputBlockSize = GetPlainBlockSize(cert, UseOaepForSecurityPolicy(policy));
if (data.Count % inputBlockSize != 0)
{
throw new Exception(string.Format("Input data is not a multiple of block size, {0}/{1}", data.Count, inputBlockSize));
}
var input = new byte[inputBlockSize];
var ms = new MemoryStream();
for (int i = 0; i < data.Count; i += inputBlockSize)
{
Array.Copy(data.Array, data.Offset + i, input, 0, input.Length);
var encoded = rsa.Encrypt(input, UseOaepForSecurityPolicy(policy));
ms.Write(encoded, 0, encoded.Length);
}
ms.Close();
return ms.ToArray();
}
public static byte[] RsaPkcs15Sha_Decrypt(ArraySegment<byte> data, X509Certificate2 cert,
RSACryptoServiceProvider rsaPrivate, SecurityPolicy policy)
{
int cipherBlockSize = GetCipherTextBlockSize(cert, UseOaepForSecurityPolicy(policy));
int plainSize = data.Count / cipherBlockSize;
int blockSize = GetPlainBlockSize(cert, UseOaepForSecurityPolicy(policy));
plainSize *= blockSize;
var buffer = new byte[plainSize];
int inputBlockSize = rsaPrivate.KeySize / 8;
int outputBlockSize = GetPlainBlockSize(cert, UseOaepForSecurityPolicy(policy));
if (data.Count % inputBlockSize != 0)
{
throw new Exception(string.Format("Input data is not a multiple of block size, {0}/{1}", data.Count, inputBlockSize));
}
var ms = new MemoryStream(buffer);
var block = new byte[inputBlockSize];
for (int i = data.Offset; i < data.Offset + data.Count; i += inputBlockSize)
{
Array.Copy(data.Array, i, block, 0, block.Length);
var plain = rsaPrivate.Decrypt(block, UseOaepForSecurityPolicy(policy));
ms.Write(plain, 0, plain.Length);
}
ms.Close();
return buffer;
}
public static bool VerifyCertificate(X509Certificate2 senderCert)
{
return senderCert != null;
}
public static byte[] SHACalculate(byte[] data, SecurityPolicy policy)
{
using (var sha = HashAlgorithmForSecurityPolicy(policy))
{
return sha.ComputeHash(data);
}
}
public static byte[] SymmetricSign(byte[] key, ArraySegment<byte> data, SecurityPolicy policy)
{
HMAC hmac = HMACForSecurityPolicy(key, policy);
using (MemoryStream ms = new MemoryStream(data.Array, data.Offset, data.Count))
{
byte[] signature = hmac.ComputeHash(ms);
return signature;
}
}
private static HMAC HMACForSecurityPolicy(byte[] key, SecurityPolicy policy)
{
return policy == SecurityPolicy.Basic256Sha256 ?
(HMAC)new HMACSHA256(key) : new HMACSHA1(key);
}
public static byte[] SHACalculate(ArraySegment<byte> data, SecurityPolicy policy)
{
using (var sha = HashAlgorithmForSecurityPolicy(policy))
{
return sha.ComputeHash(data.Array, data.Offset, data.Count);
}
}
public static bool SHAVerify(byte[] data, byte[] hash, SecurityPolicy policy)
{
var calc = SHACalculate(data, policy);
if (calc.Length != hash.Length)
{
return false;
}
for (int i = 0; i < calc.Length; i++)
{
if (hash[i] != calc[i])
{
return false;
}
}
return true;
}
public static byte[] PSHA(byte[] secret, byte[] seed, int length, SecurityPolicy policy)
{
var hmac = HMACForSecurityPolicy(secret, policy);
int sigSize = SignatureSizeForSecurityPolicy(policy);
var tmp = hmac.ComputeHash(seed);
var keySeed = new byte[sigSize + seed.Length];
Array.Copy(tmp, keySeed, tmp.Length);
Array.Copy(seed, 0, keySeed, tmp.Length, seed.Length);
var output = new byte[length];
int pos = 0;
while (pos < length)
{
byte[] hash = hmac.ComputeHash(keySeed);
int writeLen = Math.Min(sigSize, length - pos);
Array.Copy(hash, 0, output, pos, writeLen);
pos += writeLen;
tmp = hmac.ComputeHash(tmp);
Array.Copy(tmp, keySeed, tmp.Length);
}
return output;
}
private static int SignatureSizeForSecurityPolicy(SecurityPolicy policy)
{
return policy == SecurityPolicy.Basic256Sha256 ? Sha256Size : Sha1Size;
}
public static StatusCode UnsecureSymmetric(MemoryBuffer recvBuf, uint tokenID, uint? prevTokenID, int messageEncodedBlockStart, SLChannel.Keyset localKeyset, SLChannel.Keyset[] remoteKeysets, SecurityPolicy policy, MessageSecurityMode securityMode, out int decrSize)
{
decrSize = -1;
int restorePos = recvBuf.Position;
byte type = 0;
uint messageSize = 0;
UInt32 secureChannelId, securityTokenId, securitySeqNum, securityReqId;
if (!recvBuf.Decode(out type)) { return StatusCode.BadDecodingError; }
if (!recvBuf.Decode(out messageSize)) { return StatusCode.BadDecodingError; }
if (!recvBuf.Decode(out secureChannelId)) { return StatusCode.BadDecodingError; }
if (!recvBuf.Decode(out securityTokenId)) { return StatusCode.BadDecodingError; }
int keysetIdx = -1;
if (tokenID == securityTokenId)
{
keysetIdx = 0;
}
else if (prevTokenID.HasValue && prevTokenID.Value == securityTokenId)
{
keysetIdx = 1;
}
else
{
return StatusCode.BadSecureChannelTokenUnknown;
}
//UInt32 respDecodeSize = messageSize;
if (securityMode == MessageSecurityMode.SignAndEncrypt)
{
try
{
decrSize = UASecurity.RijndaelDecryptInplace(
new ArraySegment<byte>(recvBuf.Buffer, messageEncodedBlockStart, (int)messageSize - messageEncodedBlockStart),
remoteKeysets[keysetIdx].SymEncKey, remoteKeysets[keysetIdx].SymIV) + messageEncodedBlockStart;
//respDecodeSize = (UInt32)(messageEncodedBlockStart + decrSize);
}
catch
{
return StatusCode.BadSecurityChecksFailed;
}
}
if (securityMode >= MessageSecurityMode.Sign)
{
try
{
int sigSize = SignatureSizeForSecurityPolicy(policy);
var sigData = new ArraySegment<byte>(recvBuf.Buffer, 0, (int)messageSize - sigSize);
var sig = new ArraySegment<byte>(recvBuf.Buffer, (int)messageSize - sigSize, sigSize).ToArray();
var sigExpect = UASecurity.SymmetricSign(remoteKeysets[keysetIdx].SymSignKey, sigData, policy);
if (sig.Length != sigExpect.Length)
{
return StatusCode.BadSecurityChecksFailed;
}
for (int i = 0; i < sig.Length; i++)
{
if (sig[i] != sigExpect[i])
{
return StatusCode.BadSecurityChecksFailed;
}
}
byte padValue = (byte)(recvBuf.Buffer[messageSize - sigSize - 1] + 1);
if (decrSize > 0)
{
decrSize -= sigSize;
decrSize -= (int)padValue;
if (decrSize <= 0)
{
return StatusCode.BadSecurityChecksFailed;
}
}
}
catch
{
return StatusCode.BadSecurityChecksFailed;
}
}
if (!recvBuf.Decode(out securitySeqNum)) { return StatusCode.BadDecodingError; }
if (!recvBuf.Decode(out securityReqId)) { return StatusCode.BadDecodingError; }
recvBuf.Position = restorePos;
return StatusCode.Good;
}
public static StatusCode SecureSymmetric(MemoryBuffer respBuf, int messageEncodedBlockStart, SLChannel.Keyset localKeyset, SLChannel.Keyset remoteKeyset, SecurityPolicy policy, MessageSecurityMode securityMode)
{
if (securityMode == MessageSecurityMode.None)
{
return StatusCode.Good;
}
int sigSize = SignatureSizeForSecurityPolicy(policy);
if (securityMode >= MessageSecurityMode.SignAndEncrypt)
{
//int padSize2 = CalculateSymmetricPaddingSize(remoteKeyset.SymEncKey.Length, sigSize + respBuf.Position - messageEncodedBlockStart);
int padSize = CalculateSymmetricPaddingSize(localKeyset.SymEncKey.Length, sigSize + respBuf.Position - messageEncodedBlockStart);
byte paddingValue = (byte)((padSize - 1) & 0xFF);
var appendPadding = new byte[padSize];
for (int i = 0; i < padSize; i++) { appendPadding[i] = paddingValue; }
respBuf.Append(appendPadding);
}
int msgSize = respBuf.Position + sigSize;
if (securityMode >= MessageSecurityMode.SignAndEncrypt)
{
msgSize = messageEncodedBlockStart + CalculateSymmetricEncryptedSize(localKeyset.SymEncKey.Length, msgSize - messageEncodedBlockStart);
}
if (msgSize >= respBuf.Capacity)
{
return StatusCode.BadEncodingLimitsExceeded;
}
MarkUAMessageSize(respBuf, (UInt32)msgSize);
var sig = UASecurity.SymmetricSign(localKeyset.SymSignKey, new ArraySegment<byte>(respBuf.Buffer, 0, respBuf.Position), policy);
respBuf.Append(sig);
if (msgSize != respBuf.Position)
{
throw new Exception();
}
if (securityMode >= MessageSecurityMode.SignAndEncrypt)
{
int encrLen = UASecurity.RijndaelEncryptInplace(
new ArraySegment<byte>(respBuf.Buffer, messageEncodedBlockStart, msgSize - messageEncodedBlockStart),
localKeyset.SymEncKey, localKeyset.SymIV);
}
return StatusCode.Good;
}
private static void MarkUAMessageSize(MemoryBuffer buf, UInt32 position)
{
int restorePos = buf.Position;
buf.Position = 4;
buf.Encode(position);
buf.Position = restorePos;
}
}
}
| 27.704197 | 268 | 0.680903 | [
"Apache-2.0"
] | pspeybro/LibUA | NET/LibUA/Security.cs | 27,067 | C# |
namespace Kartverket.Geosynkronisering
{
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.233")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://www.opengis.net/ows/1.1")]
public partial class DCP
{
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("HTTP")]
public HTTP Item;
}
}
| 31.736842 | 112 | 0.661692 | [
"MIT"
] | HaraldLund/geosynkronisering | Kartverket.Geosynkronisering.Server/Kartverket.Geosynkronisering/Datacontract/ows/DCP.cs | 603 | C# |
//------------------------------------------------------------------------------
// <auto-generated>
// Этот код создан программой.
// Исполняемая версия:4.0.30319.42000
//
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
// повторной генерации кода.
// </auto-generated>
//------------------------------------------------------------------------------
namespace MinimalMVVM.Properties {
using System;
/// <summary>
/// Класс ресурса со строгой типизацией для поиска локализованных строк и т.д.
/// </summary>
// Этот класс создан автоматически классом StronglyTypedResourceBuilder
// с помощью такого средства, как ResGen или Visual Studio.
// Чтобы добавить или удалить член, измените файл .ResX и снова запустите ResGen
// с параметром /str или перестройте свой проект VS.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.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() {
}
/// <summary>
/// Возвращает кэшированный экземпляр ResourceManager, использованный этим классом.
/// </summary>
[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("MinimalMVVM.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Перезаписывает свойство CurrentUICulture текущего потока для всех
/// обращений к ресурсу с помощью этого класса ресурса со строгой типизацией.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}
| 44.671875 | 177 | 0.626093 | [
"MIT"
] | Pepsi4/MVVM-Twitter | MinimalMVVM/Properties/Resources.Designer.cs | 3,370 | C# |
using System;
namespace NMolecules.DDD
{
/// <summary>
/// Identifies a Repository. Repositories simulate a collection of aggregates to which aggregate instances can be
/// added and removed. They usually also expose API to select a subset of aggregates matching certain criteria. Access to
/// projections of an aggregate might be provided as well but also via a dedicated separate abstraction.
///
/// Implementations use a dedicated persistence mechanism appropriate to the data structure and query requirements at
/// hand. However, they should make sure that no persistence mechanism specific APIs leak into client code.
///
/// <see href="https://domainlanguage.com/wp-content/uploads/2016/05/DDD_Reference_2015-03.pdf">Domain-Driven Design
/// Reference (Evans) - Repositories</see>
/// </summary>
[AttributeUsage(
AttributeTargets.Class |
AttributeTargets.Interface)]
public class RepositoryAttribute : Attribute
{
}
}
| 45.909091 | 125 | 0.718812 | [
"Apache-2.0"
] | GibSral/nmolecules | src/nMolecules.DDD/Attributes/RepositoryAttribute.cs | 1,012 | C# |
using System;
using System.Globalization;
using System.Linq;
using GAPoTNumLib.GAPoT;
namespace GAPoTNumLib.Framework.Samples
{
public static class ClarkeRotation4DSample
{
public static void Execute()
{
CultureInfo.CurrentCulture = new CultureInfo("en-US");
//Define basis vectors before rotation
var u1 = "1<1>".GaPoTNumParseVector();
var u2 = "1<2>".GaPoTNumParseVector();
var u3 = "1<3>".GaPoTNumParseVector();
var u4 = "1<4>".GaPoTNumParseVector();
var u1234 = GaPoTNumUtils.OuterProduct(u1, u2, u3, u4);
Console.WriteLine($@"u1 = {u1.TermsToText()}");
Console.WriteLine($@"u2 = {u2.TermsToText()}");
Console.WriteLine($@"u3 = {u3.TermsToText()}");
Console.WriteLine($@"u4 = {u4.TermsToText()}");
Console.WriteLine();
Console.WriteLine($@"u1234 = {u1234.TermsToText()}");
Console.WriteLine($@"inverse(u1234) = {u1234.Inverse().TermsToText()}");
Console.WriteLine();
//Define voltage vector basis e1, e2, e3
var e1 = u2 - u1;
var e2 = u3 - u1;
var e3 = u4 - u1;
var e123 = GaPoTNumUtils.OuterProduct(e1, e2, e3);
Console.WriteLine($@"e1 = {e1.TermsToText()}");
Console.WriteLine($@"e2 = {e2.TermsToText()}");
Console.WriteLine($@"e3 = {e3.TermsToText()}");
Console.WriteLine($@"e123 = {e123.TermsToText()}");
Console.WriteLine();
//Ortho-normalize e1, e2, e3
var orthoVectors = new[] {e1, e2, e3}.ApplyGramSchmidt(true).ToArray();
var c1 = orthoVectors[0];
var c2 = orthoVectors[1];
var c3 = orthoVectors[2];
var c4 = -GaPoTNumUtils.OuterProduct(c1, c2, c3).Gp(u1234.Inverse()).GetVectorPart();
var c1234 = GaPoTNumUtils.OuterProduct(c1, c2, c3, c4);
Console.WriteLine($@"c1 = {c1.TermsToText()}");
Console.WriteLine($@"c2 = {c2.TermsToText()}");
Console.WriteLine($@"c3 = {c3.TermsToText()}");
Console.WriteLine($@"c4 = {c4.TermsToText()}");
Console.WriteLine();
//Make sure c1,c2,c3,c4 are mutually orthonormal
Console.WriteLine($@"c1 . c1 = {c1.DotProduct(c1):G}");
Console.WriteLine($@"c2 . c2 = {c2.DotProduct(c2):G}");
Console.WriteLine($@"c3 . c3 = {c3.DotProduct(c3):G}");
Console.WriteLine($@"c4 . c4 = {c4.DotProduct(c4):G}");
Console.WriteLine($@"c1 . c2 = {c1.DotProduct(c2):G}");
Console.WriteLine($@"c2 . c3 = {c2.DotProduct(c3):G}");
Console.WriteLine($@"c3 . c4 = {c3.DotProduct(c4):G}");
Console.WriteLine($@"c4 . c1 = {c4.DotProduct(c1):G}");
Console.WriteLine($@"c1 . c3 = {c1.DotProduct(c3):G}");
Console.WriteLine($@"c2 . c4 = {c2.DotProduct(c4):G}");
Console.WriteLine();
Console.WriteLine($@"c1234 = {c1234.TermsToText()}");
Console.WriteLine($@"inverse(c1234) = {c1234.Inverse().TermsToText()}");
Console.WriteLine();
//Find a simple rotor to get c1 from u1
var rotor1 = u1.GetRotorToVector(c1);
//Make sure this is a rotor
Console.WriteLine($@"rotor1 = {rotor1.TermsToText()}");
Console.WriteLine($@"reverse(rotor1) = {rotor1.Reverse().TermsToText()}");
Console.WriteLine($@"rotor1 gp reverse(rotor1) = {rotor1.Gp(rotor1.Reverse()).TermsToText()}");
Console.WriteLine();
//Rotate all basis vectors using rotor1
var u1_1 = u1.ApplyRotor(rotor1);
var u2_1 = u2.ApplyRotor(rotor1);
var u3_1 = u3.ApplyRotor(rotor1);
var u4_1 = u4.ApplyRotor(rotor1);
Console.WriteLine($@"rotation of u1 under rotor1 = {u1_1.TermsToText()}");
Console.WriteLine($@"rotation of u2 under rotor1 = {u2_1.TermsToText()}");
Console.WriteLine($@"rotation of u3 under rotor1 = {u3_1.TermsToText()}");
Console.WriteLine($@"rotation of u4 under rotor1 = {u4_1.TermsToText()}");
Console.WriteLine();
//Find a simple rotor to get c2 from u2_1
var rotor2 = u2_1.GetRotorToVector(c2);
//Make sure this is a rotor
Console.WriteLine($@"rotor2 = {rotor2.TermsToText()}");
Console.WriteLine($@"reverse(rotor2) = {rotor2.Reverse().TermsToText()}");
Console.WriteLine($@"rotor2 gp reverse(rotor2) = {rotor2.Gp(rotor2.Reverse()).TermsToText()}");
Console.WriteLine();
//We can combine the two simple rotors to get <c1, c2> from <u1, u2> directly
var rotor21 = rotor2.Gp(rotor1);
Console.WriteLine($@"rotor21 = {rotor21.TermsToText()}");
Console.WriteLine($@"reverse(rotor21) = {rotor21.Reverse().TermsToText()}");
Console.WriteLine($@"rotor21 gp reverse(rotor21) = {rotor21.Gp(rotor21.Reverse()).TermsToText()}");
Console.WriteLine();
Console.WriteLine($@"rotation of u1 under rotor21 = {u1.ApplyRotor(rotor21).TermsToText()}");
Console.WriteLine($@"rotation of u2 under rotor21 = {u2.ApplyRotor(rotor21).TermsToText()}");
Console.WriteLine($@"rotation of u3 under rotor21 = {u3.ApplyRotor(rotor21).TermsToText()}");
Console.WriteLine($@"rotation of u4 under rotor21 = {u4.ApplyRotor(rotor21).TermsToText()}");
Console.WriteLine();
//Rotate all basis vectors using rotor2
var u1_2 = u1_1.ApplyRotor(rotor2);
var u2_2 = u2_1.ApplyRotor(rotor2);
var u3_2 = u3_1.ApplyRotor(rotor2);
var u4_2 = u4_1.ApplyRotor(rotor2);
Console.WriteLine($@"rotation of u1_1 under rotor2 = {u1_2.TermsToText()}");
Console.WriteLine($@"rotation of u2_1 under rotor2 = {u2_2.TermsToText()}");
Console.WriteLine($@"rotation of u3_1 under rotor2 = {u3_2.TermsToText()}");
Console.WriteLine($@"rotation of u4_1 under rotor2 = {u4_2.TermsToText()}");
Console.WriteLine();
//Find a simple rotor to get c3 from u3_2
var rotor3 = u3_2.GetRotorToVector(c3);
//Make sure this is a rotor
Console.WriteLine($@"rotor3 = {rotor3.TermsToText()}");
Console.WriteLine($@"reverse(rotor3) = {rotor3.Reverse().TermsToText()}");
Console.WriteLine($@"rotor3 gp reverse(rotor3) = {rotor3.Gp(rotor3.Reverse()).TermsToText()}");
Console.WriteLine();
//Rotate all basis vectors using rotor2
var u1_3 = u1_2.ApplyRotor(rotor3);
var u2_3 = u2_2.ApplyRotor(rotor3);
var u3_3 = u3_2.ApplyRotor(rotor3);
var u4_3 = u4_2.ApplyRotor(rotor3);
Console.WriteLine($@"rotation of u1_2 under rotor3 = {u1_3.TermsToText()}");
Console.WriteLine($@"rotation of u2_2 under rotor3 = {u2_3.TermsToText()}");
Console.WriteLine($@"rotation of u3_2 under rotor3 = {u3_3.TermsToText()}");
Console.WriteLine($@"rotation of u4_2 under rotor3 = {u4_3.TermsToText()}");
Console.WriteLine();
//Compute final rotor as rotor3 gp rotor2 gp rotor1
var rotor = rotor3.Gp(rotor2).Gp(rotor1);
//Make sure this is a rotor
Console.WriteLine($@"rotor = {rotor.TermsToText()}");
Console.WriteLine($@"reverse(rotor) = {rotor.Reverse().TermsToText()}");
Console.WriteLine($@"rotor gp reverse(rotor) = {rotor.Gp(rotor.Reverse()).TermsToText()}");
Console.WriteLine();
//Are the two rotors are orthogonal? No.
//var diffRotors = rotor21.Gp(rotor3) - rotor3.Gp(rotor21);
//Console.WriteLine($@"Are the two rotors are orthogonal (0 means Yes)? {diffRotors.TermsToText()}");
//Console.WriteLine();
//Rotate all original basis vectors using final rotor
var cc1 = u1.ApplyRotor(rotor);
var cc2 = u2.ApplyRotor(rotor);
var cc3 = u3.ApplyRotor(rotor);
var cc4 = u4.ApplyRotor(rotor);
Console.WriteLine($@"rotation of u1 under rotor = {cc1.TermsToText()}");
Console.WriteLine($@"rotation of u2 under rotor = {cc2.TermsToText()}");
Console.WriteLine($@"rotation of u3 under rotor = {cc3.TermsToText()}");
Console.WriteLine($@"rotation of u4 under rotor = {cc4.TermsToText()}");
Console.WriteLine();
//Find the projections of u1, u2, u3, u4 on e234
var pu1 = u1.GetProjectionOnBlade(e123);
var pu2 = u2.GetProjectionOnBlade(e123);
var pu3 = u3.GetProjectionOnBlade(e123);
var pu4 = u4.GetProjectionOnBlade(e123);
Console.WriteLine($@"projection of u1 on e123 = {pu1.TermsToText()}");
Console.WriteLine($@"projection of u2 on e123 = {pu2.TermsToText()}");
Console.WriteLine($@"projection of u3 on e123 = {pu3.TermsToText()}");
Console.WriteLine($@"projection of u4 on e123 = {pu4.TermsToText()}");
Console.WriteLine();
Console.WriteLine($@"angle between projections of u1,u2 on e123 = {pu1.GetAngle(pu2).RadiansToDegrees():G}");
Console.WriteLine($@"angle between projections of u2,u3 on e123 = {pu2.GetAngle(pu3).RadiansToDegrees():G}");
Console.WriteLine($@"angle between projections of u1,u3 on e123 = {pu1.GetAngle(pu3).RadiansToDegrees():G}");
Console.WriteLine($@"angle between projections of u1,u4 on e123 = {pu1.GetAngle(pu4).RadiansToDegrees():G}");
Console.WriteLine($@"angle between projections of u2,u4 on e123 = {pu2.GetAngle(pu4).RadiansToDegrees():G}");
Console.WriteLine($@"angle between projections of u3,u4 on e123 = {pu3.GetAngle(pu4).RadiansToDegrees():G}");
Console.WriteLine();
}
}
} | 52.444444 | 121 | 0.565774 | [
"MIT"
] | ga-explorer/GAPoTNumLib | GAPoTNumLib/GAPoTNumLib.Framework/Samples/ClarkeRotation4DSample.cs | 10,386 | C# |
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class StoreManager : MonoBehaviour
{
[SerializeField] private Image phone = null;
[SerializeField] private Button store = null;
[SerializeField] private Button storeExit = null;
public List<Item> Items { get; private set; } = new List<Item>();
private void Start()
{
LoadStoreDataIntoVariables();
CheckAllItemAvailability();
UpdateAllItemCostTexts();
}
public void CheckAllItemAvailability()
{
for (int i = 0; i < Items.Count; i++)
{
Items[i].CheckForButtonInteractivity();
}
}
private void UpdateAllItemCostTexts()
{
for (int i = 0; i < Items.Count; i++)
{
Items[i].UpdateCostText();
}
}
public StoreItemData GenerateStoreItemData()
{
StoreItemData data = new StoreItemData()
{
costs = new int[Items.Count],
restrictedUses = new bool[Items.Count]
};
for(int i = 0; i < data.costs.Length; i++)
{
data.costs[i] = Items[i].Cost;
data.restrictedUses[i] = Items[i].RestrictUse;
}
return data;
}
private void LoadStoreDataIntoVariables()
{
StoreItemData data = SaveSystem.Instance.LoadStoreItemData();
if (data != null)
{
for (int i = 0; i < data.costs.Length; i++)
{
Items[i].Cost = data.costs[i];
Items[i].RestrictUse = data.restrictedUses[i];
}
}
}
//Animation Event Methods
private void TurnOffPhoneRaycast()
{
phone.raycastTarget = false;
}
private void TurnOnPhoneRaycast()
{
phone.raycastTarget = true;
}
private void TurnOffStoreIconRaycast()
{
store.interactable = false;
}
private void TurnOnStoreIconRaycast()
{
store.interactable = true;
}
private void TurnOnStoreButtons()
{
for(int i = 0; i < Items.Count; i++)
{
Items[i].CheckForButtonInteractivity();
}
storeExit.interactable = true;
}
private void TurnOffStoreButtons()
{
storeExit.interactable = false;
for (int i = 0; i < Items.Count; i++)
{
Items[i].DisableButton();
}
}
}
| 22.933333 | 69 | 0.553987 | [
"MIT"
] | TheRaizer/ClickerGame | Assets/Scripts/StoreManager.cs | 2,410 | C# |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
using System.Reflection;
using System.Resources;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("Microsoft Azure Batch AI Management Library")]
[assembly: AssemblyDescription("Provides management functionality for Microsoft Azure Batch AI Resources.")]
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("Microsoft Azure .NET SDK")]
[assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
| 41.2 | 108 | 0.783981 | [
"MIT"
] | 0rland0Wats0n/azure-sdk-for-net | sdk/batchai/Microsoft.Azure.Management.BatchAI/src/Properties/AssemblyInfo.cs | 824 | C# |
using System;
using System.Collections.Generic;
using System.Numerics;
namespace VrmLib
{
public class MToonMaterial : UnlitMaterial
{
public override LinearColor BaseColorFactor
{
get => Definition.Color.LitColor;
set => Definition.Color.LitColor = value;
}
public override TextureInfo BaseColorTexture
{
get => Definition.Color.LitMultiplyTexture;
set => Definition.Color.LitMultiplyTexture = value;
}
public override AlphaModeType AlphaMode
{
get
{
switch (Definition.Rendering.RenderMode)
{
case MToon.RenderMode.Opaque: return AlphaModeType.OPAQUE;
case MToon.RenderMode.Cutout: return AlphaModeType.MASK;
case MToon.RenderMode.Transparent: return AlphaModeType.BLEND;
case MToon.RenderMode.TransparentWithZWrite: return AlphaModeType.BLEND_ZWRITE;
default: throw new NotImplementedException();
}
}
set
{
switch (value)
{
case AlphaModeType.OPAQUE: Definition.Rendering.RenderMode = MToon.RenderMode.Opaque; break;
case AlphaModeType.MASK: Definition.Rendering.RenderMode = MToon.RenderMode.Cutout; break;
case AlphaModeType.BLEND: Definition.Rendering.RenderMode = MToon.RenderMode.Transparent; break;
case AlphaModeType.BLEND_ZWRITE: Definition.Rendering.RenderMode = MToon.RenderMode.TransparentWithZWrite; break;
default: throw new NotImplementedException();
}
}
}
public override float AlphaCutoff
{
get => Definition.Color.CutoutThresholdValue;
set => Definition.Color.CutoutThresholdValue = value;
}
public MToonMaterial(string name) : base(name)
{
}
public new const string ExtensionName = "VRMC_materials_mtoon";
public override string ToString()
{
return "[MTOON]";
}
public float _DebugMode;
public float _SrcBlend;
public float _DstBlend;
public float _ZWrite;
public Dictionary<string, bool> KeyWords = new Dictionary<string, bool>();
bool? MTOON_OUTLINE_COLORED;
bool? MTOON_OUTLINE_COLOR_MIXED;
bool? MTOON_OUTLINE_WIDTH_WORLD;
bool? _ALPHABLEND_ON;
string RenderType;
MToon.CullMode _OutlineCullMode;
public MToon.MToonDefinition Definition;
public override bool CanIntegrate(Material _rhs)
{
var rhs = _rhs as MToonMaterial;
if (rhs == null)
{
return false;
}
if (!Definition.Equals(rhs.Definition)) return false;
return true;
}
public const string MToonShaderName = "VRM/MToon";
}
} | 32.153061 | 134 | 0.566487 | [
"MIT"
] | hiroj/UniVRM_1_0 | Assets/vrmlib/Runtime/Vrm/MToonMaterial.cs | 3,151 | C# |
// <copyright file="TestRunLogService.cs" company="Automate The Planet Ltd.">
// Copyright 2020 Automate The Planet Ltd.
// Licensed under the Apache License, Version 2.0 (the "License");
// You may not use this file except in compliance with the License.
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
// <author>Anton Angelov</author>
// <site>https://bellatrix.solutions/</site>
using System;
using System.Diagnostics;
using System.Threading.Tasks;
using Meissa.Core.Contracts;
using Meissa.Core.Model;
using Meissa.Server.Models;
namespace Meissa.Core.Services
{
public class TestRunLogService : ITestRunLogService
{
private readonly IServiceClient<TestRunLogDto> _testRunLogRepository;
private readonly IConsoleProvider _consoleProvider;
public TestRunLogService(
IServiceClient<TestRunLogDto> testRunLogRepository,
IConsoleProvider consoleProvider)
{
_testRunLogRepository = testRunLogRepository;
_consoleProvider = consoleProvider;
}
public async Task CreateTestRunLogAsync(string message, Guid testRunId)
{
if (!string.IsNullOrEmpty(message))
{
var testRunLog = new TestRunLogDto
{
Message = message,
TestRunId = testRunId,
Status = TestRunLogStatus.New,
};
try
{
await _testRunLogRepository.CreateAsync(testRunLog).ConfigureAwait(false);
_consoleProvider.WriteLine(message);
}
catch (Exception e)
{
Debug.WriteLine(e);
_consoleProvider.WriteLine(e.Message);
}
}
}
}
}
| 36.683333 | 94 | 0.632894 | [
"Apache-2.0"
] | AutomateThePlanet/Meissa | Meissa.Core.Services/TestRunLogService.cs | 2,203 | C# |
using System;
using System.Net;
namespace Htc.Vita.Core.Net
{
public static class SecurityProtocolManager
{
public static SecurityProtocolType GetAvailableProtocol()
{
var result = (SecurityProtocolType) 0;
foreach (var securityProtocolType in (SecurityProtocolType[]) Enum.GetValues(typeof(SecurityProtocolType)))
{
result |= securityProtocolType;
}
return result;
}
}
}
| 25.578947 | 119 | 0.615226 | [
"MIT"
] | kenykhung/vita_core_csharp | source/Htc.Vita.Core/Net/SecurityProtocolManager.cs | 488 | C# |
namespace NotificationApi.Common.Configuration
{
public class SettingsConfiguration
{
public bool DisableHttpsRedirection { get; set; }
}
}
| 20 | 57 | 0.7125 | [
"MIT"
] | hmcts/vh-notification-api | NotificationApi/NotificationApi.Common/Configuration/SettingsConfiguration.cs | 160 | C# |
using System.Collections.Generic;
using Bio.Algorithms.Assembly.Graph;
namespace Bio.Algorithms.Assembly.Padena
{
/// <summary>
/// Interface for eroding graph nodes that have
/// low coverage.
/// </summary>
public interface IGraphEndsEroder
{
/// <summary>
/// Gets the name of the sequence assembly algorithm being
/// implemented. This is intended to give the
/// developer some information of the current sequence assembly algorithm.
/// </summary>
string Name { get; }
/// <summary>
/// Gets the description of the sequence assembly algorithm being
/// implemented. This is intended to give the
/// developer some information of the current sequence assembly algorithm.
/// </summary>
string Description { get; }
/// <summary>
/// Erode ends of graph that have low coverage.
/// For optimization of another step (dangling link purger)
/// in assembly process, this returns a list of integers.
/// In case this optimization is not used, a single element
/// list containing the number of eroded nodes can be returned.
/// </summary>
/// <param name="graph">Input graph.</param>
/// <param name="erosionThreshold">Threshold for erosion.</param>
/// <returns>List containing the number of nodes eroded.</returns>
IEnumerable<int> ErodeGraphEnds(DeBruijnGraph graph, int erosionThreshold);
}
}
| 38.769231 | 83 | 0.637566 | [
"Apache-2.0"
] | dotnetbio/bio | Source/Bio.Core/Algorithms/Assembly/Padena/IGraphNodesEroder.cs | 1,514 | C# |
// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
// Ported from um/d3d12.h in the Windows SDK for Windows 10.0.22000.0
// Original source is Copyright © Microsoft. All rights reserved.
using NUnit.Framework;
using System.Runtime.InteropServices;
namespace TerraFX.Interop.DirectX.UnitTests;
/// <summary>Provides validation of the <see cref="D3D12_RANGE_UINT64" /> struct.</summary>
public static unsafe partial class D3D12_RANGE_UINT64Tests
{
/// <summary>Validates that the <see cref="D3D12_RANGE_UINT64" /> struct is blittable.</summary>
[Test]
public static void IsBlittableTest()
{
Assert.That(Marshal.SizeOf<D3D12_RANGE_UINT64>(), Is.EqualTo(sizeof(D3D12_RANGE_UINT64)));
}
/// <summary>Validates that the <see cref="D3D12_RANGE_UINT64" /> struct has the right <see cref="LayoutKind" />.</summary>
[Test]
public static void IsLayoutSequentialTest()
{
Assert.That(typeof(D3D12_RANGE_UINT64).IsLayoutSequential, Is.True);
}
/// <summary>Validates that the <see cref="D3D12_RANGE_UINT64" /> struct has the correct size.</summary>
[Test]
public static void SizeOfTest()
{
Assert.That(sizeof(D3D12_RANGE_UINT64), Is.EqualTo(16));
}
}
| 37.771429 | 145 | 0.720877 | [
"MIT"
] | reflectronic/terrafx.interop.windows | tests/Interop/Windows/DirectX/um/d3d12/D3D12_RANGE_UINT64Tests.cs | 1,324 | C# |
using System;
using System.Collections.Generic;
using System.Diagnostics.Tracing;
using System.Fabric;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.ServiceFabric.Services.Runtime;
namespace BadStateful
{
[EventSource(Name = "MyCompany-BadApplication-BadStateful")]
internal sealed class ServiceEventSource : EventSource
{
public static readonly ServiceEventSource Current = new ServiceEventSource();
static ServiceEventSource()
{
// A workaround for the problem where ETW activities do not get tracked until Tasks infrastructure is initialized.
// This problem will be fixed in .NET Framework 4.6.2.
Task.Run(() => { });
}
// Instance constructor is private to enforce singleton semantics
private ServiceEventSource() : base() { }
#region Keywords
// Event keywords can be used to categorize events.
// Each keyword is a bit flag. A single event can be associated with multiple keywords (via EventAttribute.Keywords property).
// Keywords must be defined as a public class named 'Keywords' inside EventSource that uses them.
public static class Keywords
{
public const EventKeywords Requests = (EventKeywords)0x1L;
public const EventKeywords ServiceInitialization = (EventKeywords)0x2L;
}
#endregion
#region Events
// Define an instance method for each event you want to record and apply an [Event] attribute to it.
// The method name is the name of the event.
// Pass any parameters you want to record with the event (only primitive integer types, DateTime, Guid & string are allowed).
// Each event method implementation should check whether the event source is enabled, and if it is, call WriteEvent() method to raise the event.
// The number and types of arguments passed to every event method must exactly match what is passed to WriteEvent().
// Put [NonEvent] attribute on all methods that do not define an event.
// For more information see https://msdn.microsoft.com/en-us/library/system.diagnostics.tracing.eventsource.aspx
[NonEvent]
public void Message(string message, params object[] args)
{
if (this.IsEnabled())
{
string finalMessage = string.Format(message, args);
Message(finalMessage);
}
}
private const int MessageEventId = 1;
[Event(MessageEventId, Level = EventLevel.Informational, Message = "{0}")]
public void Message(string message)
{
if (this.IsEnabled())
{
WriteEvent(MessageEventId, message);
}
}
[NonEvent]
public void ServiceMessage(StatefulServiceContext serviceContext, string message, params object[] args)
{
if (this.IsEnabled())
{
string finalMessage = string.Format(message, args);
ServiceMessage(
serviceContext.ServiceName.ToString(),
serviceContext.ServiceTypeName,
serviceContext.ReplicaId,
serviceContext.PartitionId,
serviceContext.CodePackageActivationContext.ApplicationName,
serviceContext.CodePackageActivationContext.ApplicationTypeName,
serviceContext.NodeContext.NodeName,
finalMessage);
}
}
// For very high-frequency events it might be advantageous to raise events using WriteEventCore API.
// This results in more efficient parameter handling, but requires explicit allocation of EventData structure and unsafe code.
// To enable this code path, define UNSAFE conditional compilation symbol and turn on unsafe code support in project properties.
private const int ServiceMessageEventId = 2;
[Event(ServiceMessageEventId, Level = EventLevel.Informational, Message = "{7}")]
private
#if UNSAFE
unsafe
#endif
void ServiceMessage(
string serviceName,
string serviceTypeName,
long replicaOrInstanceId,
Guid partitionId,
string applicationName,
string applicationTypeName,
string nodeName,
string message)
{
#if !UNSAFE
WriteEvent(ServiceMessageEventId, serviceName, serviceTypeName, replicaOrInstanceId, partitionId, applicationName, applicationTypeName, nodeName, message);
#else
const int numArgs = 8;
fixed (char* pServiceName = serviceName, pServiceTypeName = serviceTypeName, pApplicationName = applicationName, pApplicationTypeName = applicationTypeName, pNodeName = nodeName, pMessage = message)
{
EventData* eventData = stackalloc EventData[numArgs];
eventData[0] = new EventData { DataPointer = (IntPtr) pServiceName, Size = SizeInBytes(serviceName) };
eventData[1] = new EventData { DataPointer = (IntPtr) pServiceTypeName, Size = SizeInBytes(serviceTypeName) };
eventData[2] = new EventData { DataPointer = (IntPtr) (&replicaOrInstanceId), Size = sizeof(long) };
eventData[3] = new EventData { DataPointer = (IntPtr) (&partitionId), Size = sizeof(Guid) };
eventData[4] = new EventData { DataPointer = (IntPtr) pApplicationName, Size = SizeInBytes(applicationName) };
eventData[5] = new EventData { DataPointer = (IntPtr) pApplicationTypeName, Size = SizeInBytes(applicationTypeName) };
eventData[6] = new EventData { DataPointer = (IntPtr) pNodeName, Size = SizeInBytes(nodeName) };
eventData[7] = new EventData { DataPointer = (IntPtr) pMessage, Size = SizeInBytes(message) };
WriteEventCore(ServiceMessageEventId, numArgs, eventData);
}
#endif
}
private const int ServiceTypeRegisteredEventId = 3;
[Event(ServiceTypeRegisteredEventId, Level = EventLevel.Informational, Message = "Service host process {0} registered service type {1}", Keywords = Keywords.ServiceInitialization)]
public void ServiceTypeRegistered(int hostProcessId, string serviceType)
{
WriteEvent(ServiceTypeRegisteredEventId, hostProcessId, serviceType);
}
private const int ServiceHostInitializationFailedEventId = 4;
[Event(ServiceHostInitializationFailedEventId, Level = EventLevel.Error, Message = "Service host initialization failed", Keywords = Keywords.ServiceInitialization)]
public void ServiceHostInitializationFailed(string exception)
{
WriteEvent(ServiceHostInitializationFailedEventId, exception);
}
// A pair of events sharing the same name prefix with a "Start"/"Stop" suffix implicitly marks boundaries of an event tracing activity.
// These activities can be automatically picked up by debugging and profiling tools, which can compute their execution time, child activities,
// and other statistics.
private const int ServiceRequestStartEventId = 5;
[Event(ServiceRequestStartEventId, Level = EventLevel.Informational, Message = "Service request '{0}' started", Keywords = Keywords.Requests)]
public void ServiceRequestStart(string requestTypeName)
{
WriteEvent(ServiceRequestStartEventId, requestTypeName);
}
private const int ServiceRequestStopEventId = 6;
[Event(ServiceRequestStopEventId, Level = EventLevel.Informational, Message = "Service request '{0}' finished", Keywords = Keywords.Requests)]
public void ServiceRequestStop(string requestTypeName, string exception = "")
{
WriteEvent(ServiceRequestStopEventId, requestTypeName, exception);
}
#endregion
#region Private methods
#if UNSAFE
private int SizeInBytes(string s)
{
if (s == null)
{
return 0;
}
else
{
return (s.Length + 1) * sizeof(char);
}
}
#endif
#endregion
}
}
| 47.804598 | 210 | 0.653282 | [
"MIT"
] | Haishi2016/ProgrammingServiceFabric | Chapter-6/BadApplication/BadStateful/ServiceEventSource.cs | 8,320 | C# |
using System.Windows;
namespace Shouter.Views
{
/// <summary>
/// Interaction logic for AddEditDialog.xaml
/// </summary>
public partial class AddEditDialog : Window
{
public AddEditDialog()
{
InitializeComponent();
this.Owner = Application.Current.MainWindow;
}
}
}
| 20.058824 | 56 | 0.589443 | [
"MIT"
] | mpnogaj/Radio | Shouter/Views/AddEditDialog.xaml.cs | 343 | C# |
// *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
namespace Pulumi.AzureNative.Network.V20200801.Outputs
{
[OutputType]
public sealed class RetentionPolicyParametersResponse
{
/// <summary>
/// Number of days to retain flow log records.
/// </summary>
public readonly int? Days;
/// <summary>
/// Flag to enable/disable retention.
/// </summary>
public readonly bool? Enabled;
[OutputConstructor]
private RetentionPolicyParametersResponse(
int? days,
bool? enabled)
{
Days = days;
Enabled = enabled;
}
}
}
| 25.5 | 81 | 0.617647 | [
"Apache-2.0"
] | pulumi-bot/pulumi-azure-native | sdk/dotnet/Network/V20200801/Outputs/RetentionPolicyParametersResponse.cs | 918 | C# |
using Microsoft.AspNetCore.Components;
using System;
using System.Reflection;
using System.Collections.Generic;
using System.Linq;
namespace Supercode.Blazor.BreadcrumbNavigation.Services
{
class BreadcrumbService : IBreadcrumbService
{
public event Action<RenderFragment>? Added;
public event Action? Reset;
public IBreadcrumbService Clear()
{
Reset?.Invoke();
return this;
}
public IBreadcrumbService Set<TBreadcrumb>(IReadOnlyDictionary<string, object> parameters)
where TBreadcrumb : IComponent
{
ClearIfRootBreadcrumb<TBreadcrumb>();
AddComponent<TBreadcrumb>(parameters);
return this;
}
private void ClearIfRootBreadcrumb<TBreadcrumb>()
where TBreadcrumb : IComponent
{
var isRootBreadcrumb = typeof(TBreadcrumb)
.GetCustomAttributes<RootBreadcrumbAttribute>()
.Any();
if(isRootBreadcrumb)
{
Clear();
}
}
private void AddComponent<TBreadcrumb>(IReadOnlyDictionary<string, object> parameters)
where TBreadcrumb : IComponent
{
var renderFragment = new RenderFragment(builder =>
{
builder.OpenComponent(0, typeof(TBreadcrumb));
builder.AddMultipleAttributes(1, parameters.ToList());
builder.CloseComponent();
});
Added?.Invoke(renderFragment);
}
}
}
| 27.631579 | 98 | 0.593016 | [
"MIT"
] | jnprr/blazor-breadcrumb-navigation | src/Supercode.Blazor.BreadcrumbNavigation/Services/BreadcrumbService.cs | 1,577 | C# |
using UnityEngine;
namespace Febucci.UI.Core
{
class BounceBehavior : BehaviorSine
{
public override void SetDefaultValues(BehaviorDefaultValues data)
{
amplitude = data.defaults.bounceAmplitude;
frequency = data.defaults.bounceFrequency;
waveSize = data.defaults.bounceWaveSize;
}
public override void ApplyEffect(ref CharacterData data, int charIndex)
{
//Calculates the tween percentage
float BounceTween(float t)
{
const float stillTime = .2f;
const float easeIn = .2f;
const float bounce = 1 - stillTime - easeIn;
if (t <= easeIn)
return Tween.EaseInOut(t / easeIn);
t -= easeIn;
if (t <= bounce)
return 1 - Tween.BounceOut(t / bounce);
return 0;
}
data.vertices.MoveChar(Vector3.up * effectIntensity * BounceTween((Mathf.Repeat(animatorTime* frequency - waveSize * charIndex, 1))) * amplitude);
}
}
} | 29.552632 | 158 | 0.549421 | [
"Apache-2.0"
] | gerlogu/Shooter | Game/Assets/Game/Plugins/Febucci/Text Animator/Effects/Behavior Effects/Defaults/BounceBehavior.cs | 1,125 | C# |
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Sky.Common;
using Sky.Entity;
using Sky.RepsonsityService.IService;
using Sky.Web.WebApi.Jwt;
using Sky.Web.WebApi.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Threading.Tasks;
namespace Sky.Web.WebApi.Controllers.RoutersControllers
{
[Route("api/[controller]")]
[Authorize]
[ApiController]
public class RoutersController : ControllerBase
{
readonly IRoutersRepsonsityService _routersRepsonsity;
readonly IRoles_RoutersRepsonsityService _roles_RoutersRepsonsityService;
readonly IJwtAuthorization _jwtAuthorization;
public RoutersController(
IRoutersRepsonsityService routersRepsonsity,
IRoles_RoutersRepsonsityService roles_RoutersRepsonsityService,
IJwtAuthorization jwtAuthorization
)
{
_routersRepsonsity = routersRepsonsity;
_roles_RoutersRepsonsityService = roles_RoutersRepsonsityService;
_jwtAuthorization = jwtAuthorization;
}
/// <summary>
/// 获取权限列表
/// </summary>
/// <returns></returns>
[Route("GetPersion")]
[HttpGet]
public string GetRoutersList(string name,string rid)
{
DataResult result = new DataResult()
{
Verifiaction = false
};
Expression<Func<RoutersEntity, bool>> expression = null;
if (!name.IsEmpty())
{
expression = exp => exp.Name == name;
}
expression = exp => exp.ParentID == "0";
List<RoutersEntity> list = _routersRepsonsity.GetAllList(expression);
List<TreeChildViewModel> treeViewModels = new List<TreeChildViewModel>();
treeViewModels = AddChildN("0");
if (treeViewModels.Count > 0)
{
result.Verifiaction = true;
result.Rows = treeViewModels.OrderBy(x=>x.Sorts);
}
return JsonConvert.SerializeObject(result);
}
/// <summary>
/// 父级菜单
/// </summary>
/// <param name="Pid"></param>
/// <returns></returns>
private List<TreeChildViewModel> AddChildN(string pid)
{
var data = _routersRepsonsity.GetAllList().Where(x => x.ParentID == pid).OrderBy(x=>x.Sorts);
List<TreeChildViewModel> list = new List<TreeChildViewModel>();
List<Roles_routersEntity> roles_Routers = new List<Roles_routersEntity>();
string ss = _jwtAuthorization.GetField("RolesID");
roles_Routers = _roles_RoutersRepsonsityService.GetAllList(x => x.RolesID == _jwtAuthorization.GetField("RolesID"));
foreach (var item in data)
{
foreach (var router in roles_Routers)
{
if (router.RoutersID == item.ID)
{
TreeChildViewModel childViewModel = new TreeChildViewModel
{
Id = item.ID,
PId = item.ParentID,
PathRouter = item.PathRouter,
Component = item.Component,
Name = item.Name,
Meta_icon = item.Meta_icon,
Meta_title = item.Meta_title,
Meta_content = item.Meta_content,
Sorts = item.Sorts
};
childViewModel.TreeChildren = GetChildList(childViewModel);
list.Add(childViewModel);
break;
}
}
}
return list;
}
/// <summary>
/// 子集菜单
/// </summary>
/// <param name="treeChildView"></param>
/// <returns></returns>
private List<TreeChildViewModel> GetChildList(TreeChildViewModel treeChildView)
{
if (!_routersRepsonsity.IsExists(x => x.ParentID == treeChildView.Id))
{
return null;
}
else
{
return AddChildN(treeChildView.Id);
}
}
}
}
| 34.007576 | 129 | 0.543551 | [
"MIT"
] | mylinx/Sky.Web | Sky.Web.WebApi/Controllers/RoutersControllers/RoutersController.cs | 4,519 | C# |
using System;
namespace Yort.Zip.InStore
{
/// <summary>
/// Provides details of a successful refund created by <see cref="IZipClient.RefundOrderAsync(RefundOrderRequest)"/>.
/// </summary>
public class RefundOrderResponse
{
/// <summary>
/// A unique refund id generated by Zip.
/// </summary>
public string Id { get; set; } = null!;
/// <summary>
/// The UTC timestamp when the refund was processed.
/// </summary>
public DateTimeOffset? RefundedDateTime { get; set; } = null;
/// <summary>
/// The merchant reference for this refund as specified in <see cref="RefundOrderRequest.MerchantRefundReference"/>.
/// </summary>
public string MerchantReference { get; set; } = null!;
/// <summary>
/// The amount refunded.
/// </summary>
public decimal Amount { get; set; }
}
}
| 26.354839 | 118 | 0.663403 | [
"MIT"
] | Yortw/Yort.Zip.InStore | src/RefundOrderResponse.cs | 819 | C# |
using System;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Polly;
using Silky.Core;
using Silky.Core.Exceptions;
using Silky.Core.Extensions;
using Silky.Core.Logging;
using Silky.Core.Runtime.Rpc;
using Silky.Rpc.Auditing;
using Silky.Rpc.Diagnostics;
using Silky.Rpc.Transport.Messages;
namespace Silky.Rpc.Runtime.Server
{
public class DefaultServerFallbackHandler : IServerFallbackHandler
{
public ILogger<DefaultServerFallbackHandler> Logger { get; set; }
private readonly IServerDiagnosticListener _serverDiagnosticListener;
private readonly IFallbackDiagnosticListener _fallbackDiagnosticListener;
public DefaultServerFallbackHandler(IServerDiagnosticListener serverDiagnosticListener,
IFallbackDiagnosticListener fallbackDiagnosticListener)
{
_serverDiagnosticListener = serverDiagnosticListener;
_fallbackDiagnosticListener = fallbackDiagnosticListener;
Logger = NullLogger<DefaultServerFallbackHandler>.Instance;
}
public async Task<RemoteResultMessage> Handle(RemoteInvokeMessage message, Context ctx,
CancellationToken cancellationToken)
{
var tracingTimestamp = ctx[PollyContextNames.TracingTimestamp]?.To<long>();
var remoteResultMessage = new RemoteResultMessage()
{
ServiceEntryId = message.ServiceEntryId,
StatusCode = StatusCode.Success,
Status = (int)StatusCode.Success,
};
var exception = ctx[PollyContextNames.Exception] as Exception;
Check.NotNull(exception, nameof(exception));
_serverDiagnosticListener.TracingError(tracingTimestamp, RpcContext.Context.GetMessageId(),
message.ServiceEntryId, exception.GetExceptionStatusCode(), exception);
if (exception is RpcAuthenticationException || exception is NotFindLocalServiceEntryException)
{
remoteResultMessage.StatusCode = exception.GetExceptionStatusCode();
remoteResultMessage.Status = exception.GetExceptionStatus();
remoteResultMessage.ExceptionMessage = exception.Message;
return remoteResultMessage;
}
if (!ctx.TryGetValue(PollyContextNames.ServiceEntry, out var ctxValue))
{
remoteResultMessage.StatusCode = exception.GetExceptionStatusCode();
remoteResultMessage.Status = exception.GetExceptionStatus();
remoteResultMessage.ExceptionMessage = exception.GetExceptionMessage();
return remoteResultMessage;
}
var serviceEntry = ctxValue as ServiceEntry;
Check.NotNull(serviceEntry, nameof(serviceEntry));
if (serviceEntry.FallbackMethodExecutor != null && serviceEntry.FallbackProvider != null)
{
var fallbackTracingTimestamp =
_fallbackDiagnosticListener.TracingFallbackBefore(message.ServiceEntryId, message.Parameters,
RpcContext.Context.GetMessageId(),
FallbackExecType.Server,
serviceEntry.FallbackProvider);
object instance = EngineContext.Current.Resolve(serviceEntry.FallbackProvider.Type);
if (instance == null)
{
remoteResultMessage.StatusCode = StatusCode.NotFindFallbackInstance;
remoteResultMessage.Status = (int)StatusCode.NotFindFallbackInstance;
remoteResultMessage.ExceptionMessage =
$"Failed to instantiate the instance of the fallback service;{Environment.NewLine}" +
$"Type:{serviceEntry.FallbackProvider.Type.FullName}";
_fallbackDiagnosticListener.TracingFallbackError(fallbackTracingTimestamp,
RpcContext.Context.GetMessageId(), serviceEntry.Id, remoteResultMessage.StatusCode,
new NotFindFallbackInstanceException(
"Failed to instantiate the instance of the fallback service."),
serviceEntry.FallbackProvider);
return remoteResultMessage;
}
object result = null;
try
{
var parameters = serviceEntry.ConvertParameters(message.Parameters);
result = await serviceEntry.FallbackMethodExecutor.ExecuteMethodWithAuditingAsync(instance,
parameters, serviceEntry);
remoteResultMessage.StatusCode = StatusCode.Success;
remoteResultMessage.Status = (int)StatusCode.Success;
remoteResultMessage.Result = result;
remoteResultMessage.Attachments = RpcContext.Context.GetResultAttachments();
_fallbackDiagnosticListener.TracingFallbackAfter(fallbackTracingTimestamp,
RpcContext.Context.GetMessageId(), serviceEntry.Id, result,
serviceEntry.FallbackProvider);
return remoteResultMessage;
}
catch (Exception ex)
{
Logger.LogException(ex);
remoteResultMessage.StatusCode = ex.GetExceptionStatusCode();
remoteResultMessage.Status = exception.GetExceptionStatus();
remoteResultMessage.ExceptionMessage = ex.GetExceptionMessage();
_fallbackDiagnosticListener.TracingFallbackError(fallbackTracingTimestamp,
RpcContext.Context.GetMessageId(), serviceEntry.Id, ex.GetExceptionStatusCode(),
ex, serviceEntry.FallbackProvider);
return remoteResultMessage;
}
finally
{
remoteResultMessage.Attachments = RpcContext.Context.GetResultAttachments();
}
}
remoteResultMessage.StatusCode = exception.GetExceptionStatusCode();
remoteResultMessage.Status = exception.GetExceptionStatus();
remoteResultMessage.ExceptionMessage = exception.GetExceptionMessage();
remoteResultMessage.Attachments = RpcContext.Context.GetResultAttachments();
return remoteResultMessage;
}
}
} | 51.234375 | 113 | 0.642116 | [
"MIT"
] | Dishone/silky | framework/src/Silky.Rpc/Runtime/Server/DefaultServerFallbackHandler.cs | 6,558 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace SudokuGame
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
| 22.130435 | 65 | 0.611002 | [
"Apache-2.0"
] | pranavd/sudoku | SudokuGame/Program.cs | 511 | C# |
/*
* ArcsToLines.cs - part of CNC Controls library for Grbl
*
* v0.15 / 2020-04-20 / Io Engineering (Terje Io)
*
*/
/*
Copyright (c) 2020, Io Engineering (Terje Io)
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
· Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
· Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
· Neither the name of the copyright holder nor the names of its contributors may
be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Collections.Generic;
using System.Windows.Media.Media3D;
using CNC.Core;
using CNC.GCode;
namespace CNC.Controls
{
public class ArcsToLines : IGCodeTransformer
{
public void Apply()
{
double arcTolerance = GrblSettings.GetDouble(GrblSetting.ArcTolerance);
GCodeEmulator emu = new GCodeEmulator();
List<GCodeToken> toolPath = new List<GCodeToken>();
using (new UIUtils.WaitCursor())
{
toolPath.Add(new GCComment(Commands.Comment, 0, "Arcs to lines transform applied"));
foreach (var cmd in emu.Execute(GCode.File.Tokens))
{
switch (cmd.Token.Command)
{
case Commands.G2:
case Commands.G3:
{
var arc = cmd.Token as GCArc;
var lnr = arc.LineNumber;
toolPath.Add(new GCComment(Commands.Comment, lnr++, "Arc to lines start: " + arc.ToString()));
List<Point3D> points = arc.GeneratePoints(emu.Plane, ToPos(cmd.Start, emu.IsImperial), arcTolerance, emu.DistanceMode == DistanceMode.Incremental); // Dynamic resolution
foreach (Point3D point in points)
toolPath.Add(new GCLinearMotion(Commands.G1, lnr++, ToPos(point, emu.IsImperial), AxisFlags.XYZ));
toolPath.Add(new GCComment(Commands.Comment, lnr, "Arc to lines end"));
}
break;
case Commands.G5:
{
var spline = cmd.Token as GCSpline;
var lnr = spline.LineNumber;
toolPath.Add(new GCComment(Commands.Comment, lnr++, "Spline to lines start: " + spline.ToString()));
List<Point3D> points = spline.GeneratePoints(ToPos(cmd.Start, emu.IsImperial), arcTolerance, emu.DistanceMode == DistanceMode.Incremental); // Dynamic resolution
foreach (Point3D point in points)
toolPath.Add(new GCLinearMotion(Commands.G1, lnr++, ToPos(point, emu.IsImperial), AxisFlags.XYZ));
toolPath.Add(new GCComment(Commands.Comment, lnr, "Spline to lines end"));
}
break;
default:
toolPath.Add(cmd.Token);
break;
}
}
List<string> gc = GCodeParser.TokensToGCode(toolPath);
GCode.File.AddBlock(string.Format("Arcs to lines transform applied: {0}", GCode.File.Model.FileName), CNC.Core.Action.New);
foreach (string block in gc)
GCode.File.AddBlock(block, CNC.Core.Action.Add);
GCode.File.AddBlock("", CNC.Core.Action.End);
}
}
double[] ToPos(Point3D pos, bool imperial)
{
int res = imperial ? 4 : 3;
return new double[] { Math.Round(pos.X, res), Math.Round(pos.Y, res), Math.Round(pos.Z, res) };
}
}
}
| 42.576271 | 201 | 0.594148 | [
"BSD-3-Clause"
] | Jmerk523/Grbl-GCode-Sender | CNC Controls/CNC Controls/ArcsToLines.cs | 5,029 | C# |
using Blazorise;
using System;
namespace BlazorBase.CRUD.Attributes
{
public class DateDisplayModeAttribute : Attribute
{
public DateInputMode DateInputMode { get; set; }
}
}
| 17.909091 | 56 | 0.71066 | [
"MIT"
] | Shevrar/BlazorBase | BlazorBase.CRUD/Attributes/DateDisplayModeAttribute.cs | 199 | C# |
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
namespace Pulumi.Oci.Waas.Outputs
{
[OutputType]
public sealed class GetWaasPoliciesWaasPolicyWafConfigCaptchaResult
{
/// <summary>
/// The text to show when incorrect CAPTCHA text is entered. If unspecified, defaults to `The CAPTCHA was incorrect. Try again.`
/// </summary>
public readonly string FailureMessage;
/// <summary>
/// The text to show in the footer when showing a CAPTCHA challenge. If unspecified, defaults to 'Enter the letters and numbers as they are shown in the image above.'
/// </summary>
public readonly string FooterText;
/// <summary>
/// The text to show in the header when showing a CAPTCHA challenge. If unspecified, defaults to 'We have detected an increased number of attempts to access this website. To help us keep this site secure, please let us know that you are not a robot by entering the text from the image below.'
/// </summary>
public readonly string HeaderText;
/// <summary>
/// The amount of time before the CAPTCHA expires, in seconds. If unspecified, defaults to `300`.
/// </summary>
public readonly int SessionExpirationInSeconds;
/// <summary>
/// The text to show on the label of the CAPTCHA challenge submit button. If unspecified, defaults to `Yes, I am human`.
/// </summary>
public readonly string SubmitLabel;
/// <summary>
/// The title used when displaying a CAPTCHA challenge. If unspecified, defaults to `Are you human?`
/// </summary>
public readonly string Title;
/// <summary>
/// The unique URL path at which to show the CAPTCHA challenge.
/// </summary>
public readonly string Url;
[OutputConstructor]
private GetWaasPoliciesWaasPolicyWafConfigCaptchaResult(
string failureMessage,
string footerText,
string headerText,
int sessionExpirationInSeconds,
string submitLabel,
string title,
string url)
{
FailureMessage = failureMessage;
FooterText = footerText;
HeaderText = headerText;
SessionExpirationInSeconds = sessionExpirationInSeconds;
SubmitLabel = submitLabel;
Title = title;
Url = url;
}
}
}
| 38.394366 | 300 | 0.640499 | [
"ECL-2.0",
"Apache-2.0"
] | EladGabay/pulumi-oci | sdk/dotnet/Waas/Outputs/GetWaasPoliciesWaasPolicyWafConfigCaptchaResult.cs | 2,726 | C# |
using Exceptionless.Dependency;
using Exceptionless.Serializer;
namespace Exceptionless.MessagePack {
public static class ExceptionlessConfigurationExtensions {
public static void UseMessagePackSerializer(this ExceptionlessConfiguration config) {
config.Resolver.Register<IStorageSerializer>(new MessagePackStorageSerializer(config.Resolver));
}
}
}
| 35.272727 | 108 | 0.780928 | [
"Apache-2.0"
] | PolitovArtyom/Exceptionless.Net | src/Platforms/Exceptionless.MessagePack/ExceptionlessConfigurationExtensions.cs | 390 | C# |
using System;
using System.Linq;
using System.IO;
using System.Text;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using PureCloudPlatform.Client.V2.Client;
namespace PureCloudPlatform.Client.V2.Model
{
/// <summary>
/// SurveyForm
/// </summary>
[DataContract]
public partial class SurveyForm : IEquatable<SurveyForm>
{
/// <summary>
/// Initializes a new instance of the <see cref="SurveyForm" /> class.
/// </summary>
[JsonConstructorAttribute]
protected SurveyForm() { }
/// <summary>
/// Initializes a new instance of the <see cref="SurveyForm" /> class.
/// </summary>
/// <param name="Name">The survey form name (required).</param>
/// <param name="Disabled">Is this form disabled.</param>
/// <param name="Language">Language for survey viewer localization. Currently localized languages: da, de, en-US, es, fi, fr, it, ja, ko, nl, no, pl, pt-BR, sv, th, tr, zh-CH, zh-TW (required).</param>
/// <param name="HeaderImageId">Id of the header image appearing at the top of the form..</param>
/// <param name="Header">Markdown text for the top of the form..</param>
/// <param name="Footer">Markdown text for the bottom of the form..</param>
/// <param name="QuestionGroups">A list of question groups (required).</param>
/// <param name="PublishedVersions">List of published version of this form.</param>
public SurveyForm(string Name = null, bool? Disabled = null, string Language = null, string HeaderImageId = null, string Header = null, string Footer = null, List<SurveyQuestionGroup> QuestionGroups = null, DomainEntityListingSurveyForm PublishedVersions = null)
{
this.Name = Name;
this.Disabled = Disabled;
this.Language = Language;
this.HeaderImageId = HeaderImageId;
this.Header = Header;
this.Footer = Footer;
this.QuestionGroups = QuestionGroups;
this.PublishedVersions = PublishedVersions;
}
/// <summary>
/// The globally unique identifier for the object.
/// </summary>
/// <value>The globally unique identifier for the object.</value>
[DataMember(Name="id", EmitDefaultValue=false)]
public string Id { get; private set; }
/// <summary>
/// The survey form name
/// </summary>
/// <value>The survey form name</value>
[DataMember(Name="name", EmitDefaultValue=false)]
public string Name { get; set; }
/// <summary>
/// Last modified date. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ
/// </summary>
/// <value>Last modified date. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ</value>
[DataMember(Name="modifiedDate", EmitDefaultValue=false)]
public DateTime? ModifiedDate { get; private set; }
/// <summary>
/// Is this form published
/// </summary>
/// <value>Is this form published</value>
[DataMember(Name="published", EmitDefaultValue=false)]
public bool? Published { get; private set; }
/// <summary>
/// Is this form disabled
/// </summary>
/// <value>Is this form disabled</value>
[DataMember(Name="disabled", EmitDefaultValue=false)]
public bool? Disabled { get; set; }
/// <summary>
/// Unique Id for all versions of this form
/// </summary>
/// <value>Unique Id for all versions of this form</value>
[DataMember(Name="contextId", EmitDefaultValue=false)]
public string ContextId { get; private set; }
/// <summary>
/// Language for survey viewer localization. Currently localized languages: da, de, en-US, es, fi, fr, it, ja, ko, nl, no, pl, pt-BR, sv, th, tr, zh-CH, zh-TW
/// </summary>
/// <value>Language for survey viewer localization. Currently localized languages: da, de, en-US, es, fi, fr, it, ja, ko, nl, no, pl, pt-BR, sv, th, tr, zh-CH, zh-TW</value>
[DataMember(Name="language", EmitDefaultValue=false)]
public string Language { get; set; }
/// <summary>
/// Id of the header image appearing at the top of the form.
/// </summary>
/// <value>Id of the header image appearing at the top of the form.</value>
[DataMember(Name="headerImageId", EmitDefaultValue=false)]
public string HeaderImageId { get; set; }
/// <summary>
/// Temporary URL for accessing header image
/// </summary>
/// <value>Temporary URL for accessing header image</value>
[DataMember(Name="headerImageUrl", EmitDefaultValue=false)]
public string HeaderImageUrl { get; private set; }
/// <summary>
/// Markdown text for the top of the form.
/// </summary>
/// <value>Markdown text for the top of the form.</value>
[DataMember(Name="header", EmitDefaultValue=false)]
public string Header { get; set; }
/// <summary>
/// Markdown text for the bottom of the form.
/// </summary>
/// <value>Markdown text for the bottom of the form.</value>
[DataMember(Name="footer", EmitDefaultValue=false)]
public string Footer { get; set; }
/// <summary>
/// A list of question groups
/// </summary>
/// <value>A list of question groups</value>
[DataMember(Name="questionGroups", EmitDefaultValue=false)]
public List<SurveyQuestionGroup> QuestionGroups { get; set; }
/// <summary>
/// List of published version of this form
/// </summary>
/// <value>List of published version of this form</value>
[DataMember(Name="publishedVersions", EmitDefaultValue=false)]
public DomainEntityListingSurveyForm PublishedVersions { get; set; }
/// <summary>
/// The URI for this object
/// </summary>
/// <value>The URI for this object</value>
[DataMember(Name="selfUri", EmitDefaultValue=false)]
public string SelfUri { get; private set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class SurveyForm {\n");
sb.Append(" Id: ").Append(Id).Append("\n");
sb.Append(" Name: ").Append(Name).Append("\n");
sb.Append(" ModifiedDate: ").Append(ModifiedDate).Append("\n");
sb.Append(" Published: ").Append(Published).Append("\n");
sb.Append(" Disabled: ").Append(Disabled).Append("\n");
sb.Append(" ContextId: ").Append(ContextId).Append("\n");
sb.Append(" Language: ").Append(Language).Append("\n");
sb.Append(" HeaderImageId: ").Append(HeaderImageId).Append("\n");
sb.Append(" HeaderImageUrl: ").Append(HeaderImageUrl).Append("\n");
sb.Append(" Header: ").Append(Header).Append("\n");
sb.Append(" Footer: ").Append(Footer).Append("\n");
sb.Append(" QuestionGroups: ").Append(QuestionGroups).Append("\n");
sb.Append(" PublishedVersions: ").Append(PublishedVersions).Append("\n");
sb.Append(" SelfUri: ").Append(SelfUri).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public string ToJson()
{
return JsonConvert.SerializeObject(this, Formatting.Indented);
}
/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="obj">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object obj)
{
// credit: http://stackoverflow.com/a/10454552/677735
return this.Equals(obj as SurveyForm);
}
/// <summary>
/// Returns true if SurveyForm instances are equal
/// </summary>
/// <param name="other">Instance of SurveyForm to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(SurveyForm other)
{
// credit: http://stackoverflow.com/a/10454552/677735
if (other == null)
return false;
return true &&
(
this.Id == other.Id ||
this.Id != null &&
this.Id.Equals(other.Id)
) &&
(
this.Name == other.Name ||
this.Name != null &&
this.Name.Equals(other.Name)
) &&
(
this.ModifiedDate == other.ModifiedDate ||
this.ModifiedDate != null &&
this.ModifiedDate.Equals(other.ModifiedDate)
) &&
(
this.Published == other.Published ||
this.Published != null &&
this.Published.Equals(other.Published)
) &&
(
this.Disabled == other.Disabled ||
this.Disabled != null &&
this.Disabled.Equals(other.Disabled)
) &&
(
this.ContextId == other.ContextId ||
this.ContextId != null &&
this.ContextId.Equals(other.ContextId)
) &&
(
this.Language == other.Language ||
this.Language != null &&
this.Language.Equals(other.Language)
) &&
(
this.HeaderImageId == other.HeaderImageId ||
this.HeaderImageId != null &&
this.HeaderImageId.Equals(other.HeaderImageId)
) &&
(
this.HeaderImageUrl == other.HeaderImageUrl ||
this.HeaderImageUrl != null &&
this.HeaderImageUrl.Equals(other.HeaderImageUrl)
) &&
(
this.Header == other.Header ||
this.Header != null &&
this.Header.Equals(other.Header)
) &&
(
this.Footer == other.Footer ||
this.Footer != null &&
this.Footer.Equals(other.Footer)
) &&
(
this.QuestionGroups == other.QuestionGroups ||
this.QuestionGroups != null &&
this.QuestionGroups.SequenceEqual(other.QuestionGroups)
) &&
(
this.PublishedVersions == other.PublishedVersions ||
this.PublishedVersions != null &&
this.PublishedVersions.Equals(other.PublishedVersions)
) &&
(
this.SelfUri == other.SelfUri ||
this.SelfUri != null &&
this.SelfUri.Equals(other.SelfUri)
);
}
/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
// credit: http://stackoverflow.com/a/263416/677735
unchecked // Overflow is fine, just wrap
{
int hash = 41;
// Suitable nullity checks etc, of course :)
if (this.Id != null)
hash = hash * 59 + this.Id.GetHashCode();
if (this.Name != null)
hash = hash * 59 + this.Name.GetHashCode();
if (this.ModifiedDate != null)
hash = hash * 59 + this.ModifiedDate.GetHashCode();
if (this.Published != null)
hash = hash * 59 + this.Published.GetHashCode();
if (this.Disabled != null)
hash = hash * 59 + this.Disabled.GetHashCode();
if (this.ContextId != null)
hash = hash * 59 + this.ContextId.GetHashCode();
if (this.Language != null)
hash = hash * 59 + this.Language.GetHashCode();
if (this.HeaderImageId != null)
hash = hash * 59 + this.HeaderImageId.GetHashCode();
if (this.HeaderImageUrl != null)
hash = hash * 59 + this.HeaderImageUrl.GetHashCode();
if (this.Header != null)
hash = hash * 59 + this.Header.GetHashCode();
if (this.Footer != null)
hash = hash * 59 + this.Footer.GetHashCode();
if (this.QuestionGroups != null)
hash = hash * 59 + this.QuestionGroups.GetHashCode();
if (this.PublishedVersions != null)
hash = hash * 59 + this.PublishedVersions.GetHashCode();
if (this.SelfUri != null)
hash = hash * 59 + this.SelfUri.GetHashCode();
return hash;
}
}
}
}
| 34.18552 | 270 | 0.485043 | [
"MIT"
] | nmusco/platform-client-sdk-dotnet | build/src/PureCloudPlatform.Client.V2/Model/SurveyForm.cs | 15,110 | C# |
#if !SLEETLEGACY
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Amazon.S3;
using Amazon.S3.Model;
using Amazon.S3.Transfer;
namespace Sleet
{
public static class AmazonS3FileSystemAbstraction
{
public const int DefaultCopyBufferSize = 81920;
private const int MaximumNumberOfObjectsToFetch = 100;
public static Task CreateFileAsync(
IAmazonS3 client,
string bucketName,
string key,
string contentBody,
ServerSideEncryptionMethod serverSideEncryptionMethod,
CancellationToken token)
{
var putObjectRequest = new PutObjectRequest
{
BucketName = bucketName,
Key = key,
ContentBody = contentBody,
ServerSideEncryptionMethod = serverSideEncryptionMethod
};
return client.PutObjectAsync(putObjectRequest, token);
}
public static async Task<string> DownloadFileAsync(
IAmazonS3 client,
string bucketName,
string key,
Stream writer,
CancellationToken token)
{
using (var response = await client
.GetObjectAsync(bucketName, key, token)
.ConfigureAwait(false))
using (var responseStream = response.ResponseStream)
{
await responseStream.CopyToAsync(writer, DefaultCopyBufferSize, token).ConfigureAwait(false);
return response.Headers.ContentEncoding;
}
}
public static async Task<bool> FileExistsAsync(
IAmazonS3 client,
string bucketName,
string key,
CancellationToken token)
{
var listObjectsRequest = new ListObjectsV2Request
{
BucketName = bucketName,
Prefix = key,
};
var listObjectsResponse = await client
.ListObjectsV2Async(listObjectsRequest, token)
.ConfigureAwait(false);
return listObjectsResponse.S3Objects
.Any(x => x.Key.Equals(key, StringComparison.Ordinal));
}
public static async Task<List<S3Object>> GetFilesAsync(
IAmazonS3 client,
string bucketName,
CancellationToken token)
{
List<S3Object> s3Objects = null;
var listObjectsRequest = new ListObjectsV2Request
{
BucketName = bucketName,
MaxKeys = MaximumNumberOfObjectsToFetch,
};
ListObjectsV2Response listObjectsResponse;
do
{
listObjectsResponse = await client.ListObjectsV2Async(listObjectsRequest, token).ConfigureAwait(false);
listObjectsRequest.ContinuationToken = listObjectsResponse.NextContinuationToken;
if (s3Objects == null)
s3Objects = listObjectsResponse.S3Objects;
else
s3Objects.AddRange(listObjectsResponse.S3Objects);
} while (listObjectsResponse.IsTruncated);
return s3Objects;
}
public static Task RemoveFileAsync(IAmazonS3 client, string bucketName, string key, CancellationToken token)
{
return client.DeleteObjectAsync(bucketName, key, token);
}
public static Task RemoveMultipleFilesAsync(
IAmazonS3 client,
string bucketName,
IEnumerable<KeyVersion> objects,
CancellationToken token)
{
var request = new DeleteObjectsRequest
{
BucketName = bucketName,
Objects = objects.ToList(),
};
return request.Objects.Count == 0
? TaskUtils.CompletedTask
: client.DeleteObjectsAsync(request, token);
}
public static async Task UploadFileAsync(
IAmazonS3 client,
string bucketName,
string key,
string contentType,
string contentEncoding,
Stream reader,
ServerSideEncryptionMethod serverSideEncryptionMethod,
CancellationToken token)
{
var transferUtility = new TransferUtility(client);
var request = new TransferUtilityUploadRequest
{
BucketName = bucketName,
Key = key,
InputStream = reader,
AutoCloseStream = false,
AutoResetStreamPosition = false,
Headers = { CacheControl = "no-store" },
ServerSideEncryptionMethod = serverSideEncryptionMethod
};
if (contentType != null)
{
request.ContentType = contentType;
request.Headers.ContentType = contentType;
}
if (contentEncoding != null)
request.Headers.ContentEncoding = contentEncoding;
using (transferUtility)
await transferUtility.UploadAsync(request, token).ConfigureAwait(false);
}
}
}
#endif | 33.377358 | 119 | 0.576032 | [
"MIT"
] | ryancraig/Sleet | src/SleetLib/FileSystem/AmazonS3FileSystemAbstraction.cs | 5,307 | C# |
using System;
using System.Threading;
namespace MongoDB.Messaging.Change
{
/// <summary>
/// A change subscription
/// </summary>
public class Subscription : ISubscription
{
private readonly WeakReference _reference;
/// <summary>
/// Initializes a new instance of the <see cref="Subscription"/> class.
/// </summary>
/// <param name="handler">The change handler.</param>
/// <param name="filter">The MongoDB collection namespace wildcard filter.</param>
/// <exception cref="ArgumentNullException"><paramref name="handler"/> is <see langword="null" />.</exception>
public Subscription(IHandleChange handler, string filter)
{
if (handler == null)
throw new ArgumentNullException(nameof(handler));
_reference = new WeakReference(handler);
Filter = filter;
}
/// <summary>
/// Gets MongoDB collection namespace wildcard filter.
/// </summary>
/// <value>
/// The MongoDB collection namespace wildcard filter.
/// </value>
public string Filter { get; }
/// <summary>
/// Gets the change notification handler.
/// </summary>
/// <value>
/// The change notification handler.
/// </value>
public IHandleChange Handler => _reference.Target as IHandleChange;
/// <summary>
/// Begin invoke of <see cref="Handler"/> on the thread-pool background thread.
/// </summary>
/// <param name="change">The change record to send.</param>
/// <returns><c>true</c> if the Handler is still alive and was able to be invoked; otherwise <c>false</c>.</returns>
public bool BeginInvoke(ChangeRecord change)
{
// handler might have been disposed
var handler = _reference.Target as IHandleChange;
if (handler == null)
return false;
// fire and forget
return ThreadPool.QueueUserWorkItem(state => handler.HandleChange(change));
}
}
} | 34.225806 | 124 | 0.583883 | [
"Apache-2.0"
] | IsaacSee/MongoDB.Messaging | Source/MongoDB.Messaging/Change/Subscription.cs | 2,122 | C# |
using HotChocolate.Language;
namespace HotChocolate.Validation
{
/// <summary>
/// Fragments must be specified on types that exist in the schema.
/// This applies for both named and inline fragments.
/// If they are not defined in the schema, the query does not validate.
///
/// http://spec.graphql.org/June2018/#sec-Fragment-Spread-Type-Existence
/// </summary>
internal sealed class FragmentSpreadTypeExistenceRule
: QueryVisitorValidationErrorBase
{
protected override QueryVisitorErrorBase CreateVisitor(ISchema schema)
{
return new FragmentSpreadTypeExistenceVisitor(schema);
}
}
}
| 32.047619 | 78 | 0.690936 | [
"MIT"
] | husseinraoouf/hotchocolate | src/HotChocolate/Core/src/Core/Validation/FragmentSpreadTypeExistenceRule.cs | 673 | C# |
/***************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
***************************************************************************/
// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project. Project-level
// suppressions either have no target or are given a specific target
// and scoped to a namespace, type, member, etc.
//
// To add a suppression to this file, right-click the message in the
// Error List, point to "Suppress Message(s)", and click "In Project
// Suppression File". You do not need to add suppressions to this
// file manually.
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1017:MarkAssembliesWithComVisible")]
| 45.545455 | 118 | 0.659681 | [
"MIT"
] | 48355746/VSSDK-Extensibility-Samples | MSDNSearch/C#/MSDNSearch/GlobalSuppressions.cs | 1,004 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace Gold_Client.View
{
/// <summary>
/// Interaction logic for SendFileControl.xaml
/// </summary>
public partial class SendFileControl : UserControl
{
public SendFileControl()
{
InitializeComponent();
}
}
}
| 22.689655 | 54 | 0.723404 | [
"MIT"
] | Radseq/Gold-Chat | Gold-Chat/Gold_Client/View/SendFileControl.xaml.cs | 660 | C# |
// ***********************************************************************
// Assembly : IronyModManager.Storage.Tests
// Author : Mario
// Created : 01-28-2020
//
// Last Modified By : Mario
// Last Modified On : 03-16-2021
// ***********************************************************************
// <copyright file="StorageTests.cs" company="Mario">
// Mario
// </copyright>
// <summary></summary>
// ***********************************************************************
using System;
using System.Collections.Generic;
using System.Text;
using Xunit;
using Moq;
using IronyModManager.Models;
using AutoMapper;
using IronyModManager.Models.Common;
using FluentAssertions;
using SimpleInjector;
using IronyModManager.DI;
using IronyModManager.Shared;
using IronyModManager.Tests.Common;
using System.Linq;
using IronyModManager.Storage.Common;
namespace IronyModManager.Storage.Tests
{
/// <summary>
/// Class StorageTests.
/// </summary>
public class StorageTests
{
/// <summary>
/// Defines the test method Should_return_same_preferences_object.
/// </summary>
[Fact]
public void Should_return_same_preferences_object()
{
// I know totally redundant test, done just for a bit of practice
DISetup.SetupContainer();
var dbMock = GetDbMock();
var mapper = new Mock<IMapper>();
mapper.Setup(p => p.Map<IPreferences, IPreferences>(It.IsAny<IPreferences>())).Returns(dbMock.Preferences);
var storage = new Storage(dbMock, mapper.Object);
var pref = storage.GetPreferences();
pref.Locale.Should().Be(GetDbMock().Preferences.Locale);
}
/// <summary>
/// Defines the test method Should_return_same_app_state_object.
/// </summary>
[Fact]
public void Should_return_same_app_state_object()
{
DISetup.SetupContainer();
var dbMock = GetDbMock();
var mapper = new Mock<IMapper>();
mapper.Setup(p => p.Map<IAppState, IAppState>(It.IsAny<IAppState>())).Returns(dbMock.AppState);
var storage = new Storage(dbMock, mapper.Object);
var state = storage.GetAppState();
state.CollectionModsSearchTerm.Should().Be(GetDbMock().AppState.CollectionModsSearchTerm);
}
/// <summary>
/// Defines the test method Should_return_same_window_state_object.
/// </summary>
[Fact]
public void Should_return_same_window_state_object()
{
// I know totally redundant test, done just for a bit of practice
DISetup.SetupContainer();
var dbMock = GetDbMock();
var mapper = new Mock<IMapper>();
mapper.Setup(p => p.Map<IWindowState, IWindowState>(It.IsAny<IWindowState>())).Returns(dbMock.WindowState);
var storage = new Storage(dbMock, mapper.Object);
var state = storage.GetWindowState();
state.IsMaximized.Should().Be(GetDbMock().WindowState.IsMaximized);
}
/// <summary>
/// Defines the test method Should_return_same_themes_object.
/// </summary>
[Fact]
public void Should_return_same_themes_object()
{
DISetup.SetupContainer();
var dbMock = GetDbMock();
var mapper = new Mock<IMapper>();
mapper.Setup(p => p.Map<List<IThemeType>>(It.IsAny<IEnumerable<IThemeType>>())).Returns(() =>
{
return dbMock.Themes.ToList();
});
var storage = new Storage(dbMock, mapper.Object);
var themes = storage.GetThemes();
themes.Count().Should().Be(1);
themes.FirstOrDefault().Name.Should().Be("test");
}
/// <summary>
/// Defines the test method Should_return_same_notification_position_object.
/// </summary>
[Fact]
public void Should_return_same_notification_position_object()
{
DISetup.SetupContainer();
var dbMock = GetDbMock();
var mapper = new Mock<IMapper>();
mapper.Setup(p => p.Map<List<INotificationPositionType>>(It.IsAny<IEnumerable<INotificationPositionType>>())).Returns(() =>
{
return dbMock.NotificationPosition.ToList();
});
var storage = new Storage(dbMock, mapper.Object);
var result = storage.GetNotificationPositions();
result.Count().Should().Be(1);
result.FirstOrDefault().Position.Should().Be(Models.Common.NotificationPosition.BottomLeft);
}
/// <summary>
/// Defines the test method Should_return_same_mod_collection_object.
/// </summary>
[Fact]
public void Should_return_same_mod_collection_object()
{
DISetup.SetupContainer();
var dbMock = GetDbMock();
var mapper = new Mock<IMapper>();
mapper.Setup(p => p.Map<List<IModCollection>>(It.IsAny<IEnumerable<IModCollection>>())).Returns(() =>
{
return dbMock.ModCollection.ToList();
});
var storage = new Storage(dbMock, mapper.Object);
var result = storage.GetModCollections();
result.Count().Should().Be(1);
result.FirstOrDefault().Name.Should().Be("fake");
}
/// <summary>
/// Defines the test method Should_return_same_game_settings_object.
/// </summary>
[Fact]
public void Should_return_same_game_settings_object()
{
DISetup.SetupContainer();
var dbMock = GetDbMock();
var mapper = new Mock<IMapper>();
mapper.Setup(p => p.Map<List<IGameSettings>>(It.IsAny<IEnumerable<IGameSettings>>())).Returns(() =>
{
return dbMock.GameSettings.ToList();
});
var storage = new Storage(dbMock, mapper.Object);
var result = storage.GetGameSettings();
result.Count().Should().Be(1);
result.FirstOrDefault().Type.Should().Be("fake");
}
/// <summary>
/// Defines the test method Should_return_same_games_object.
/// </summary>
[Fact]
public void Should_return_same_games_object()
{
DISetup.SetupContainer();
var dbMock = GetDbMock();
var mapper = new Mock<IMapper>();
mapper.Setup(p => p.Map<List<IGameType>>(It.IsAny<IEnumerable<IGameType>>())).Returns(() =>
{
return dbMock.Games.ToList();
});
var storage = new Storage(dbMock, mapper.Object);
var result = storage.GetGames();
result.Count().Should().Be(1);
result.FirstOrDefault().Name.Should().Be("test");
}
/// <summary>
/// Defines the test method Should_overwrite_preferences_object.
/// </summary>
[Fact]
public void Should_overwrite_preferences_object()
{
DISetup.SetupContainer();
var dbMock = GetDbMock();
var newPref = new Preferences()
{
Locale = "test2"
};
var mapper = new Mock<IMapper>();
mapper.Setup(p => p.Map<IPreferences>(It.IsAny<IPreferences>())).Returns((IPreferences s) =>
{
return new Preferences()
{
Locale = s.Locale
};
});
var storage = new Storage(dbMock, mapper.Object);
storage.SetPreferences(newPref);
dbMock.Preferences.Locale.Should().Be(newPref.Locale);
}
/// <summary>
/// Defines the test method Should_overwrite_app_state_object.
/// </summary>
[Fact]
public void Should_overwrite_app_state_object()
{
DISetup.SetupContainer();
var dbMock = GetDbMock();
var state = new AppState()
{
CollectionModsSearchTerm = "test2"
};
var mapper = new Mock<IMapper>();
mapper.Setup(p => p.Map<IAppState>(It.IsAny<IAppState>())).Returns((IAppState s) =>
{
return new AppState()
{
CollectionModsSearchTerm = s.CollectionModsSearchTerm
};
});
var storage = new Storage(dbMock, mapper.Object);
var result = storage.SetAppState(state);
dbMock.AppState.CollectionModsSearchTerm.Should().Be(state.CollectionModsSearchTerm);
}
/// <summary>
/// Defines the test method Should_add_new_theme.
/// </summary>
[Fact]
public void Should_add_new_theme()
{
DISetup.SetupContainer();
var dbMock = GetDbMock();
var newThemeKey = "test2";
var storage = new Storage(dbMock, new Mock<IMapper>().Object);
storage.RegisterTheme(newThemeKey);
dbMock.Themes.Count.Should().Be(2);
dbMock.Themes.FirstOrDefault(p => p.Name == newThemeKey).Should().NotBeNull();
}
/// <summary>
/// Defines the test method Should_add_new_notification_position.
/// </summary>
[Fact]
public void Should_add_new_notification_position()
{
DISetup.SetupContainer();
var dbMock = GetDbMock();
var newItem = new NotificationPositionType()
{
Position = Models.Common.NotificationPosition.TopLeft
};
var storage = new Storage(dbMock, new Mock<IMapper>().Object);
storage.RegisterNotificationPosition(newItem);
dbMock.NotificationPosition.Count.Should().Be(2);
dbMock.NotificationPosition.FirstOrDefault(p => p.Position == newItem.Position).Should().NotBeNull();
}
/// <summary>
/// Defines the test method Should_add_new_game.
/// </summary>
[Fact]
public void Should_add_new_game()
{
DISetup.SetupContainer();
var dbMock = GetDbMock();
var key = "test2";
var storage = new Storage(dbMock, new Mock<IMapper>().Object);
var game = new GameType()
{
Name = key,
SteamAppId = 1,
ChecksumFolders = new List<string>() { "test" },
GameFolders = new List<string>() { "testgame" },
LogLocation = "test.log",
UserDirectory = "user_directory",
WorkshopDirectory = new List<string>() { "workshop1" },
BaseSteamGameDirectory = "base",
ExecutablePath = "exe",
ExecutableArgs = "args",
LauncherSettingsFileName = "settings",
LauncherSettingsPrefix = "prefix",
AdvancedFeaturesSupported = true,
RemoteSteamUserDirectory = new List<string>() { "remotesave" },
Abrv = "abrv"
};
storage.RegisterGame(game);
dbMock.Games.Count.Should().Be(2);
dbMock.Games.FirstOrDefault(p => p.Name == key).Should().NotBeNull();
dbMock.Games.FirstOrDefault(p => p.Name == key).UserDirectory.Should().Be("user_directory");
dbMock.Games.FirstOrDefault(p => p.Name == key).SteamAppId.Should().Be(1);
dbMock.Games.FirstOrDefault(p => p.Name == key).WorkshopDirectory.FirstOrDefault().Should().Be("workshop1");
dbMock.Games.FirstOrDefault(p => p.Name == key).LogLocation.Should().Be("test.log");
dbMock.Games.FirstOrDefault(p => p.Name == key).ChecksumFolders.FirstOrDefault().Should().Be("test");
dbMock.Games.FirstOrDefault(p => p.Name == key).GameFolders.FirstOrDefault().Should().Be("testgame");
dbMock.Games.FirstOrDefault(p => p.Name == key).BaseSteamGameDirectory.Should().Be("base");
dbMock.Games.FirstOrDefault(p => p.Name == key).ExecutablePath.Should().Be("exe");
dbMock.Games.FirstOrDefault(p => p.Name == key).ExecutableArgs.Should().Be("args");
dbMock.Games.FirstOrDefault(p => p.Name == key).LauncherSettingsFileName.Should().Be("settings");
dbMock.Games.FirstOrDefault(p => p.Name == key).LauncherSettingsPrefix.Should().Be("prefix");
dbMock.Games.FirstOrDefault(p => p.Name == key).RemoteSteamUserDirectory.FirstOrDefault().Should().Be("remotesave");
dbMock.Games.FirstOrDefault(p => p.Name == key).AdvancedFeaturesSupported.Should().BeTrue();
dbMock.Games.FirstOrDefault(p => p.Name == key).Abrv.Should().Be("abrv");
}
/// <summary>
/// Defines the test method Should_overwrite_window_state_object.
/// </summary>
[Fact]
public void Should_overwrite_window_state_object()
{
DISetup.SetupContainer();
var dbMock = GetDbMock();
var state = new WindowState()
{
Height = 300
};
var mapper = new Mock<IMapper>();
mapper.Setup(p => p.Map<IWindowState>(It.IsAny<IWindowState>())).Returns((IWindowState s) =>
{
return new WindowState()
{
Height = s.Height
};
});
var storage = new Storage(dbMock, mapper.Object);
storage.SetWindowState(state);
dbMock.WindowState.Height.Should().Be(state.Height);
}
/// <summary>
/// Defines the test method Should_overwrite_modcollection_objects.
/// </summary>
[Fact]
public void Should_overwrite_modcollection_objects()
{
DISetup.SetupContainer();
var dbMock = GetDbMock();
var col = new List<IModCollection>()
{
new ModCollection()
{
Name = "fake2"
}
};
var mapper = new Mock<IMapper>();
mapper.Setup(p => p.Map<IEnumerable<IModCollection>>(It.IsAny<IEnumerable<IModCollection>>())).Returns((IEnumerable<IModCollection> s) =>
{
return s;
});
var storage = new Storage(dbMock, mapper.Object);
storage.SetModCollections(col);
dbMock.ModCollection.Count().Should().Be(1);
dbMock.ModCollection.First().Name.Should().Be(col.First().Name);
}
/// <summary>
/// Defines the test method Should_overwrite_and_return_same_preferences_object.
/// </summary>
[Fact]
public void Should_overwrite_and_return_same_preferences_object()
{
DISetup.SetupContainer();
var newPref = new Preferences()
{
Locale = "test2"
};
var storage = new Storage(GetDbMock(), DIResolver.Get<IMapper>());
storage.SetPreferences(newPref);
var pref = storage.GetPreferences();
pref.Locale.Should().Be(newPref.Locale);
}
/// <summary>
/// Defines the test method Should_overwrite_and_return_same_app_state_object.
/// </summary>
[Fact]
public void Should_overwrite_and_return_same_app_state_object()
{
DISetup.SetupContainer();
var newState = new AppState()
{
CollectionModsSearchTerm = "test2"
};
var storage = new Storage(GetDbMock(), DIResolver.Get<IMapper>());
storage.SetAppState(newState);
var state = storage.GetAppState();
state.CollectionModsSearchTerm.Should().Be(newState.CollectionModsSearchTerm);
}
/// <summary>
/// Defines the test method Should_overwrite_and_return_same_mod_collection_objects.
/// </summary>
[Fact]
public void Should_overwrite_and_return_same_mod_collection_objects()
{
DISetup.SetupContainer();
var col = new List<IModCollection>()
{
new ModCollection()
{
Name = "fake2"
}
};
var storage = new Storage(GetDbMock(), DIResolver.Get<IMapper>());
storage.SetModCollections(col);
var result = storage.GetModCollections();
result.Count().Should().Be(1);
result.First().Name.Should().Be(col.First().Name);
}
/// <summary>
/// Defines the test method Should_overwrite_and_return_same_game_settings_objects.
/// </summary>
[Fact]
public void Should_overwrite_and_return_same_game_settings_objects()
{
DISetup.SetupContainer();
var col = new List<IGameSettings>()
{
new GameSettings()
{
Type = "fake2"
}
};
var storage = new Storage(GetDbMock(), DIResolver.Get<IMapper>());
storage.SetGameSettings(col);
var result = storage.GetGameSettings();
result.Count().Should().Be(1);
result.First().Type.Should().Be(col.First().Type);
}
/// <summary>
/// Defines the test method Should_add_and_return_added_theme.
/// </summary>
[Fact]
public void Should_add_and_return_added_theme()
{
DISetup.SetupContainer();
var dbMock = GetDbMock();
var newThemeKey = "test2";
var mapper = new Mock<IMapper>();
mapper.Setup(p => p.Map<List<IThemeType>>(It.IsAny<IEnumerable<IThemeType>>())).Returns(() =>
{
return dbMock.Themes.ToList();
});
var storage = new Storage(dbMock, mapper.Object);
storage.RegisterTheme(newThemeKey);
var themes = storage.GetThemes();
themes.Count().Should().Be(2);
themes.FirstOrDefault(p => p.Name == newThemeKey).Should().NotBeNull();
}
/// <summary>
/// Defines the test method Should_add_and_return_added_notification_position.
/// </summary>
[Fact]
public void Should_add_and_return_added_notification_position()
{
DISetup.SetupContainer();
var dbMock = GetDbMock();
var newItem = new NotificationPositionType()
{
Position = Models.Common.NotificationPosition.TopLeft
};
var mapper = new Mock<IMapper>();
mapper.Setup(p => p.Map<List<INotificationPositionType>>(It.IsAny<IEnumerable<INotificationPositionType>>())).Returns(() =>
{
return dbMock.NotificationPosition.ToList();
});
var storage = new Storage(dbMock, mapper.Object);
storage.RegisterNotificationPosition(newItem);
var result = storage.GetNotificationPositions();
result.Count().Should().Be(2);
result.FirstOrDefault(p => p.Position == newItem.Position).Should().NotBeNull();
}
/// <summary>
/// Defines the test method Should_add_and_return_added_game.
/// </summary>
[Fact]
public void Should_add_and_return_added_game()
{
DISetup.SetupContainer();
var dbMock = GetDbMock();
var key = "test2";
var mapper = new Mock<IMapper>();
mapper.Setup(p => p.Map<List<IGameType>>(It.IsAny<IEnumerable<IGameType>>())).Returns(() =>
{
return dbMock.Games.ToList();
});
var storage = new Storage(dbMock, mapper.Object);
var game = new GameType()
{
Name = key,
SteamAppId = 1,
ChecksumFolders = new List<string>() { "test" },
GameFolders = new List<string>() { "testgame" },
LogLocation = "test.log",
UserDirectory = "user_directory",
WorkshopDirectory = new List<string>() { "workshop1" },
BaseSteamGameDirectory = "base",
ExecutablePath = "exe",
ExecutableArgs = "args",
LauncherSettingsFileName = "settings",
LauncherSettingsPrefix = "prefix",
AdvancedFeaturesSupported = true,
RemoteSteamUserDirectory = new List<string>() { "remotesave" },
Abrv = "abrv"
};
storage.RegisterGame(game);
var result = storage.GetGames();
result.Count().Should().Be(2);
result.FirstOrDefault(p => p.Name == key).Should().NotBeNull();
result.FirstOrDefault(p => p.Name == key).UserDirectory.Should().Be("user_directory");
result.FirstOrDefault(p => p.Name == key).SteamAppId.Should().Be(1);
result.FirstOrDefault(p => p.Name == key).WorkshopDirectory.FirstOrDefault().Should().Be("workshop1");
result.FirstOrDefault(p => p.Name == key).LogLocation.Should().Be("test.log");
result.FirstOrDefault(p => p.Name == key).ChecksumFolders.FirstOrDefault().Should().Be("test");
result.FirstOrDefault(p => p.Name == key).GameFolders.FirstOrDefault().Should().Be("testgame");
result.FirstOrDefault(p => p.Name == key).BaseSteamGameDirectory.Should().Be("base");
result.FirstOrDefault(p => p.Name == key).ExecutablePath.Should().Be("exe");
result.FirstOrDefault(p => p.Name == key).ExecutableArgs.Should().Be("args");
result.FirstOrDefault(p => p.Name == key).LauncherSettingsFileName.Should().Be("settings");
result.FirstOrDefault(p => p.Name == key).LauncherSettingsPrefix.Should().Be("prefix");
result.FirstOrDefault(p => p.Name == key).RemoteSteamUserDirectory.FirstOrDefault().Should().Be("remotesave");
result.FirstOrDefault(p => p.Name == key).AdvancedFeaturesSupported.Should().BeTrue();
result.FirstOrDefault(p => p.Name == key).Abrv.Should().Be("abrv");
}
/// <summary>
/// Defines the test method Should_overwrite_and_return_same_window_state_object.
/// </summary>
[Fact]
public void Should_overwrite_and_return_same_window_state_object()
{
DISetup.SetupContainer();
var newState = new WindowState()
{
Height = 300
};
var storage = new Storage(GetDbMock(), DIResolver.Get<IMapper>());
storage.SetWindowState(newState);
var state = storage.GetWindowState();
state.Height.Should().Be(newState.Height);
}
/// <summary>
/// Gets the database mock.
/// </summary>
/// <returns>Database.</returns>
private Database GetDbMock()
{
return new Database()
{
Preferences = new Preferences() { Locale = "test" },
WindowState = new WindowState() { IsMaximized = true },
Themes = new List<IThemeType>() { new ThemeType()
{
Name = "test",
IsDefault = true,
} },
Games = new List<IGameType>()
{
new GameType()
{
Name = "test"
}
},
AppState = new AppState()
{
CollectionModsSearchTerm = "test"
},
ModCollection = new List<IModCollection>()
{
new ModCollection()
{
Name = "fake"
}
},
GameSettings = new List<IGameSettings>()
{
new GameSettings()
{
Type = "fake"
}
},
NotificationPosition = new List<INotificationPositionType>()
{
new NotificationPositionType()
{
Position = Models.Common.NotificationPosition.BottomLeft
}
}
};
}
}
}
| 40.600329 | 149 | 0.540409 | [
"MIT"
] | SANagisa/IronyModManager | src/IronyModManager.Storage.Tests/StorageTests.cs | 24,687 | C# |
// ReSharper disable All
using System.Collections.Generic;
using System.Diagnostics;
using System.Dynamic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using MixERP.Net.Api.Framework;
using MixERP.Net.ApplicationState.Cache;
using MixERP.Net.Common.Extensions;
using MixERP.Net.EntityParser;
using MixERP.Net.Framework;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using MixERP.Net.Schemas.Core.Data;
using MixERP.Net.Api.Core.Fakes;
using Xunit;
namespace MixERP.Net.Api.Core.Tests
{
public class BankAccountViewTests
{
public static BankAccountViewController Fixture()
{
BankAccountViewController controller = new BankAccountViewController(new BankAccountViewRepository(), "", new LoginView());
return controller;
}
[Fact]
[Conditional("Debug")]
public void Count()
{
long count = Fixture().Count();
Assert.Equal(1, count);
}
[Fact]
[Conditional("Debug")]
public void Get()
{
int count = Fixture().Get().Count();
Assert.Equal(1, count);
}
[Fact]
[Conditional("Debug")]
public void GetPaginatedResult()
{
int count = Fixture().GetPaginatedResult().Count();
Assert.Equal(1, count);
count = Fixture().GetPaginatedResult(1).Count();
Assert.Equal(1, count);
}
[Fact]
[Conditional("Debug")]
public void GetDisplayFields()
{
int count = Fixture().GetDisplayFields().Count();
Assert.Equal(1, count);
}
[Fact]
[Conditional("Debug")]
public void CountWhere()
{
long count = Fixture().CountWhere(new JArray());
Assert.Equal(1, count);
}
[Fact]
[Conditional("Debug")]
public void GetWhere()
{
int count = Fixture().GetWhere(1, new JArray()).Count();
Assert.Equal(1, count);
}
[Fact]
[Conditional("Debug")]
public void CountFiltered()
{
long count = Fixture().CountFiltered("");
Assert.Equal(1, count);
}
[Fact]
[Conditional("Debug")]
public void GetFiltered()
{
int count = Fixture().GetFiltered(1, "").Count();
Assert.Equal(1, count);
}
}
} | 24.60396 | 135 | 0.558954 | [
"MPL-2.0"
] | asine/mixerp | src/Libraries/Web API/Core/Tests/BankAccountViewTests.cs | 2,485 | C# |
using System;
using System.Collections.Generic;
using System.Threading;
using Content.Server.GameObjects.Components.Doors;
using Content.Server.GameObjects.EntitySystems.AI.Pathfinding.GraphUpdates;
using Content.Server.GameObjects.EntitySystems.AI.Pathfinding.Pathfinders;
using Content.Server.GameObjects.EntitySystems.JobQueues;
using Content.Server.GameObjects.EntitySystems.JobQueues.Queues;
using Content.Server.GameObjects.EntitySystems.Pathfinding;
using Robust.Shared.GameObjects.Components;
using Robust.Shared.GameObjects.Components.Transform;
using Robust.Shared.GameObjects.Systems;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.Map;
using Robust.Shared.IoC;
using Robust.Shared.Map;
namespace Content.Server.GameObjects.EntitySystems.AI.Pathfinding
{
/*
// TODO: IMO use rectangular symmetry reduction on the nodes with collision at all., or
alternatively store all rooms and have an alternative graph for humanoid mobs (same collision mask, needs access etc). You could also just path from room to room as needed.
// TODO: Longer term -> Handle collision layer changes?
*/
/// <summary>
/// This system handles pathfinding graph updates as well as dispatches to the pathfinder
/// (90% of what it's doing is graph updates so not much point splitting the 2 roles)
/// </summary>
public class PathfindingSystem : EntitySystem
{
#pragma warning disable 649
[Dependency] private readonly IMapManager _mapManager;
#pragma warning restore 649
public IReadOnlyDictionary<GridId, Dictionary<MapIndices, PathfindingChunk>> Graph => _graph;
private readonly Dictionary<GridId, Dictionary<MapIndices, PathfindingChunk>> _graph = new Dictionary<GridId, Dictionary<MapIndices, PathfindingChunk>>();
// Every tick we queue up all the changes and do them at once
private readonly Queue<IPathfindingGraphUpdate> _queuedGraphUpdates = new Queue<IPathfindingGraphUpdate>();
private readonly PathfindingJobQueue _pathfindingQueue = new PathfindingJobQueue();
// Need to store previously known entity positions for collidables for when they move
private readonly Dictionary<IEntity, TileRef> _lastKnownPositions = new Dictionary<IEntity, TileRef>();
/// <summary>
/// Ask for the pathfinder to gimme somethin
/// </summary>
/// <param name="pathfindingArgs"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public Job<Queue<TileRef>> RequestPath(PathfindingArgs pathfindingArgs, CancellationToken cancellationToken)
{
var startNode = GetNode(pathfindingArgs.Start);
var endNode = GetNode(pathfindingArgs.End);
var job = new AStarPathfindingJob(0.003, startNode, endNode, pathfindingArgs, cancellationToken);
_pathfindingQueue.EnqueueJob(job);
return job;
}
public override void Update(float frameTime)
{
base.Update(frameTime);
// Make sure graph is updated, then get pathfinders
ProcessGraphUpdates();
_pathfindingQueue.Process();
}
private void ProcessGraphUpdates()
{
for (var i = 0; i < Math.Min(50, _queuedGraphUpdates.Count); i++)
{
var update = _queuedGraphUpdates.Dequeue();
switch (update)
{
case CollidableMove move:
HandleCollidableMove(move);
break;
case CollisionChange change:
if (change.Value)
{
HandleCollidableAdd(change.Owner);
}
else
{
HandleCollidableRemove(change.Owner);
}
break;
case GridRemoval removal:
HandleGridRemoval(removal);
break;
case TileUpdate tile:
HandleTileUpdate(tile);
break;
default:
throw new ArgumentOutOfRangeException();
}
}
}
private void HandleGridRemoval(GridRemoval removal)
{
if (!_graph.ContainsKey(removal.GridId))
{
throw new InvalidOperationException();
}
_graph.Remove(removal.GridId);
}
private void HandleTileUpdate(TileUpdate tile)
{
var chunk = GetChunk(tile.Tile);
chunk.UpdateNode(tile.Tile);
}
public PathfindingChunk GetChunk(TileRef tile)
{
var chunkX = (int) (Math.Floor((float) tile.X / PathfindingChunk.ChunkSize) * PathfindingChunk.ChunkSize);
var chunkY = (int) (Math.Floor((float) tile.Y / PathfindingChunk.ChunkSize) * PathfindingChunk.ChunkSize);
var mapIndices = new MapIndices(chunkX, chunkY);
if (_graph.TryGetValue(tile.GridIndex, out var chunks))
{
if (!chunks.ContainsKey(mapIndices))
{
CreateChunk(tile.GridIndex, mapIndices);
}
return chunks[mapIndices];
}
var newChunk = CreateChunk(tile.GridIndex, mapIndices);
return newChunk;
}
private PathfindingChunk CreateChunk(GridId gridId, MapIndices indices)
{
var newChunk = new PathfindingChunk(gridId, indices);
newChunk.Initialize();
if (_graph.TryGetValue(gridId, out var chunks))
{
for (var x = -1; x < 2; x++)
{
for (var y = -1; y < 2; y++)
{
if (x == 0 && y == 0) continue;
var neighborIndices = new MapIndices(
indices.X + x * PathfindingChunk.ChunkSize,
indices.Y + y * PathfindingChunk.ChunkSize);
if (chunks.TryGetValue(neighborIndices, out var neighborChunk))
{
neighborChunk.AddNeighbor(newChunk);
}
}
}
}
else
{
_graph.Add(gridId, new Dictionary<MapIndices, PathfindingChunk>());
}
_graph[gridId].Add(indices, newChunk);
return newChunk;
}
public PathfindingNode GetNode(TileRef tile)
{
var chunk = GetChunk(tile);
var node = chunk.GetNode(tile);
return node;
}
public override void Initialize()
{
IoCManager.InjectDependencies(this);
SubscribeLocalEvent<CollisionChangeEvent>(QueueCollisionEnabledEvent);
SubscribeLocalEvent<MoveEvent>(QueueCollidableMove);
// Handle all the base grid changes
// Anything that affects traversal (i.e. collision layer) is handled separately.
_mapManager.OnGridRemoved += QueueGridRemoval;
_mapManager.GridChanged += QueueGridChange;
_mapManager.TileChanged += QueueTileChange;
}
public override void Shutdown()
{
base.Shutdown();
_mapManager.OnGridRemoved -= QueueGridRemoval;
_mapManager.GridChanged -= QueueGridChange;
_mapManager.TileChanged -= QueueTileChange;
}
private void QueueGridRemoval(GridId gridId)
{
_queuedGraphUpdates.Enqueue(new GridRemoval(gridId));
}
private void QueueGridChange(object sender, GridChangedEventArgs eventArgs)
{
foreach (var (position, _) in eventArgs.Modified)
{
_queuedGraphUpdates.Enqueue(new TileUpdate(eventArgs.Grid.GetTileRef(position)));
}
}
private void QueueTileChange(object sender, TileChangedEventArgs eventArgs)
{
_queuedGraphUpdates.Enqueue(new TileUpdate(eventArgs.NewTile));
}
#region collidable
/// <summary>
/// If an entity's collision gets turned on then we need to update its current position
/// </summary>
/// <param name="entity"></param>
private void HandleCollidableAdd(IEntity entity)
{
// It's a grid / gone / a door / we already have it (which probably shouldn't happen)
if (entity.Prototype == null ||
entity.Deleted ||
entity.HasComponent<ServerDoorComponent>() ||
entity.HasComponent<AirlockComponent>() ||
_lastKnownPositions.ContainsKey(entity))
{
return;
}
var grid = _mapManager.GetGrid(entity.Transform.GridID);
var tileRef = grid.GetTileRef(entity.Transform.GridPosition);
var collisionLayer = entity.GetComponent<CollidableComponent>().CollisionLayer;
var chunk = GetChunk(tileRef);
var node = chunk.GetNode(tileRef);
node.AddCollisionLayer(collisionLayer);
_lastKnownPositions.Add(entity, tileRef);
}
/// <summary>
/// If an entity's collision is removed then stop tracking it from the graph
/// </summary>
/// <param name="entity"></param>
private void HandleCollidableRemove(IEntity entity)
{
if (entity.Prototype == null ||
entity.Deleted ||
entity.HasComponent<ServerDoorComponent>() ||
entity.HasComponent<AirlockComponent>() ||
!_lastKnownPositions.ContainsKey(entity))
{
return;
}
_lastKnownPositions.Remove(entity);
var grid = _mapManager.GetGrid(entity.Transform.GridID);
var tileRef = grid.GetTileRef(entity.Transform.GridPosition);
if (!entity.TryGetComponent(out CollidableComponent collidableComponent))
{
return;
}
var collisionLayer = collidableComponent.CollisionLayer;
var chunk = GetChunk(tileRef);
var node = chunk.GetNode(tileRef);
node.RemoveCollisionLayer(collisionLayer);
}
private void QueueCollidableMove(MoveEvent moveEvent)
{
_queuedGraphUpdates.Enqueue(new CollidableMove(moveEvent));
}
private void HandleCollidableMove(CollidableMove move)
{
if (!_lastKnownPositions.ContainsKey(move.MoveEvent.Sender))
{
return;
}
// The pathfinding graph is tile-based so first we'll check if they're on a different tile and if we need to update.
// If you get entities bigger than 1 tile wide you'll need some other system so god help you.
var moveEvent = move.MoveEvent;
if (moveEvent.Sender.Deleted)
{
HandleCollidableRemove(moveEvent.Sender);
return;
}
_lastKnownPositions.TryGetValue(moveEvent.Sender, out var oldTile);
var newTile = _mapManager.GetGrid(moveEvent.NewPosition.GridID).GetTileRef(moveEvent.NewPosition);
if (oldTile == newTile)
{
return;
}
_lastKnownPositions[moveEvent.Sender] = newTile;
if (!moveEvent.Sender.TryGetComponent(out CollidableComponent collidableComponent))
{
HandleCollidableRemove(moveEvent.Sender);
return;
}
var collisionLayer = collidableComponent.CollisionLayer;
var gridIds = new HashSet<GridId>(2) {oldTile.GridIndex, newTile.GridIndex};
foreach (var gridId in gridIds)
{
if (oldTile.GridIndex == gridId)
{
var oldChunk = GetChunk(oldTile);
var oldNode = oldChunk.GetNode(oldTile);
oldNode.RemoveCollisionLayer(collisionLayer);
}
if (newTile.GridIndex == gridId)
{
var newChunk = GetChunk(newTile);
var newNode = newChunk.GetNode(newTile);
newNode.RemoveCollisionLayer(collisionLayer);
}
}
}
private void QueueCollisionEnabledEvent(CollisionChangeEvent collisionEvent)
{
// TODO: Handle containers
var entityManager = IoCManager.Resolve<IEntityManager>();
var entity = entityManager.GetEntity(collisionEvent.Owner);
switch (collisionEvent.CanCollide)
{
case true:
_queuedGraphUpdates.Enqueue(new CollisionChange(entity, true));
break;
case false:
_queuedGraphUpdates.Enqueue(new CollisionChange(entity, false));
break;
}
}
#endregion
}
}
| 37.27933 | 176 | 0.576053 | [
"MIT"
] | hiddenfloret/space-station-14 | Content.Server/GameObjects/EntitySystems/AI/Pathfinding/PathfindingSystem.cs | 13,346 | C# |
//
// Copyright (c) 2018 The nanoFramework project contributors
// Portions Copyright (c) 2016 STMicroelectronics. All rights reserved.
// See LICENSE file in the project root for full license information.
//
using System;
using Windows.Devices.Gpio;
using Windows.Devices.Spi;
namespace nanoFramework.Drivers
{
public class L3GD20
{
/// <summary>
/// most significant bit of address set to 1 for read operations
/// </summary>
private const byte READ_BIT = 0x80;
/// <summary>
/// Multiple address R/W operation on which the address is automatically incremented
/// </summary>
private const byte MULTIPLE_OPERATION_BIT = 0x40;
/// <summary>
/// device identification register
/// </summary>
private const byte WHO_AM_I = 0x0F;
/// <summary>
/// Control register 1
/// </summary>
private const byte ControlRegister1 = 0x20;
/// <summary>
/// Control register 2
/// </summary>
private const byte ControlRegister2 = 0x21;
/// <summary>
/// Control register 3
/// </summary>
private const byte ControlRegister3 = 0x22;
/// <summary>
/// Control register 4
/// </summary>
private const byte ControlRegister4 = 0x23;
/// <summary>
/// Control register 5
/// </summary>
private const byte ControlRegister5 = 0x24;
/// <summary>
/// Reference register
/// </summary>
private const byte REFERENCE_REG = 0x25;
/// <summary>
/// Out temp register
/// </summary>
private const byte OUT_TEMP = 0x26;
/// <summary>
/// Status register
/// </summary>
private const byte STATUS_REG = 0x27;
/// <summary>
/// Output Register X
/// </summary>
private const byte OUT_X_L = 0x28;
/// <summary>
/// Output Register X
/// </summary>
private const byte OUT_X_H = 0x29;
/// <summary>
/// Output Register Y
/// </summary>
private const byte OUT_Y_L = 0x2A;
/// <summary>
/// Output Register Y
/// </summary>
private const byte OUT_Y_H = 0x2B;
/// <summary>
/// Output Register Z
/// </summary>
private const byte OUT_Z_L = 0x2C;
/// <summary>
/// Output Register Z
/// </summary>
private const byte OUT_Z_H = 0x2D;
/// <summary>
/// FIFO control Register
/// </summary>
private const byte FIFO_ControlRegister = 0x2E;
/// <summary>
/// FIFO src Register
/// </summary>
private const byte FIFO_SRC_REG = 0x2F;
/// <summary>
/// Interrupt 1 configuration Register
/// </summary>
private const byte INT1_CFG = 0x30;
/// <summary>
/// Interrupt 1 source Register
/// </summary>
private const byte INT1_SRC = 0x31;
/// <summary>
/// Interrupt 1 Threshold X register
/// </summary>
private const byte INT1_TSH_XH = 0x32;
/// <summary>
/// Interrupt 1 Threshold X register
/// </summary>
private const byte INT1_TSH_XL = 0x33;
/// <summary>
/// Interrupt 1 Threshold Y register
/// </summary>
private const byte INT1_TSH_YH = 0x34;
/// <summary>
/// Interrupt 1 Threshold Y register
/// </summary>
private const byte INT1_TSH_YL = 0x35;
/// <summary>
/// Interrupt 1 Threshold Z register
/// </summary>
private const byte INT1_TSH_ZH = 0x36;
/// <summary>
/// Interrupt 1 Threshold Z register
/// </summary>
private const byte INT1_TSH_ZL = 0x37;
/// <summary>
/// Interrupt 1 DURATION register
/// </summary>
private const byte INT1_DURATION = 0x38;
/// <summary>
/// This is the ID reading from the <see cref="WHO_AM_I"/> register.
/// </summary>
private const byte I_AM_L3GD20 = 0xD4;
private byte _chipId;
private readonly SpiDevice _gyroscope;
private readonly GpioPin _chipSelectLine;
public L3GD20(string spiBus, GpioPin chipSelectLine)
{
_chipSelectLine = chipSelectLine;
_chipSelectLine.SetDriveMode(GpioPinDriveMode.Output);
var connectionSettings = new SpiConnectionSettings(chipSelectLine.PinNumber);
connectionSettings.DataBitLength = 8;
connectionSettings.ClockFrequency = 10000000;
// create SPI device for gyroscope
_gyroscope = SpiDevice.FromId(spiBus, connectionSettings);
}
public void Initialize(DataRate ouputDataRate = DataRate._95Hz,
AxisSelection axisSelection = AxisSelection.All,
PowerMode powerMode = PowerMode.Active,
HighPassFilterMode hpMode = HighPassFilterMode.Normal,
HighPassConfiguration hpConfiguration = HighPassConfiguration.HPConf0,
Scale scale = Scale._0250,
LowPass2Mode lpMode = LowPass2Mode.Bypassed)
{
// we are setting the 5 control registers in a single SPI write operation
// by taking advantage on the consecutive write capability
byte[] configBuffer = new byte[5];
// control register 1
configBuffer[0] = (byte)axisSelection;
configBuffer[0] |= (byte)powerMode;
configBuffer[0] |= (byte)ouputDataRate;
// control register 2
if (hpMode != HighPassFilterMode.Bypassed)
{
configBuffer[1] = (byte)hpConfiguration;
}
// control register 3 skipped
// control register 4
configBuffer[3] = (byte)scale;
// TDB
// block auto-update
// endianess
// control register 5
if (hpMode != HighPassFilterMode.Bypassed)
{
// high pass filter enabled
configBuffer[4] = 0x10;
if(lpMode != LowPass2Mode.Bypassed)
{
configBuffer[4] |= 0x08 | 0x02;
}
else
{
configBuffer[4] |= 0x04 | 0x01;
}
}
WriteOperation(ControlRegister1, configBuffer);
}
/// <summary>
/// Device identification.
/// </summary>
public byte ChipID
{
get
{
// do we have this already?
if (_chipId == 0)
{
// no, need to get it from the device
byte[] buffer = new byte[1];
ReadOperation(WHO_AM_I, buffer);
_chipId = buffer[0];
// sanity check
if (_chipId != I_AM_L3GD20)
{
throw new ApplicationException();
}
return buffer[0];
}
return _chipId;
}
}
public int[] GetXYZ()
{
byte[] buffer = new byte[2 * 3];
int[] readings = new int[3];
// read raw data from gyroscope registers
// by taking advantage on the consecutive read capability
ReadOperation(OUT_X_L, buffer);
readings[0] = buffer[2 * 0] + (buffer[2 * 0 + 1] << 8);
readings[1] = buffer[2 * 1] + (buffer[2 * 1 + 1] << 8);
readings[2] = buffer[2 * 2] + (buffer[2 * 2 + 1] << 8);
return readings;
}
//void LowPower(uint16_t InitStruct);
//void RebootCmd();
///* Interrupt Configuration Functions
//void INT1InterruptConfig(uint16_t Int1Config);
//void EnableIT(uint8_t IntSel);
//void DisableIT(uint8_t IntSel);
///* High Pass Filter Configuration Functions
//void FilterConfig(uint8_t FilterStruct);
//void FilterCmd(uint8_t HighPassFilterState);
//void ReadXYZAngRate(float* pfData);
//uint8_t GetDataStatus();
///* Gyroscope IO functions
//void GYRO_IO_Init();
//void GYRO_IO_DeInit();
//void GYRO_IO_Write(uint8_t* pBuffer, uint8_t WriteAddr, uint16_t NumByteToWrite);
//void GYRO_IO_Read(uint8_t* pBuffer, uint8_t ReadAddr, uint16_t NumByteToRead);
//
// for SPI operations with L3GD20 the address has to be tweaked by setting the R/W bit and the MS bit for operations with multiple read/writes
private void ReadOperation(byte address, byte[] buffer)
{
// read operations have to set R/W bite
address |= READ_BIT;
// multiple address access has to set MS bit to have the read address auto-increment
address |= buffer.Length > 1 ? MULTIPLE_OPERATION_BIT : (byte)0x00;
// set CS line low to select the device
//_chipSelectLine.Write(GpioPinValue.Low);
_gyroscope.TransferSequential(new byte[] { address }, buffer);
// set CS line high to unselect the device
//_chipSelectLine.Write(GpioPinValue.High);
}
private void WriteOperation(byte address, byte[] buffer)
{
// write operations have to reset MSb
// don't do anything about this as all address constants already have that
// if this is a multiple address write set MS bit
address |= buffer.Length > 1 ? MULTIPLE_OPERATION_BIT : (byte)0x00;
// need to create a write buffer with the address as the first element, followed by the data to be written
byte[] writeBuffer = new byte[1 + buffer.Length];
writeBuffer[0] = address;
// copy address to start of write buffer
Array.Copy(buffer, 0, writeBuffer, 1, buffer.Length);
// set CS line low to select the device
//_chipSelectLine.Write(GpioPinValue.Low);
_gyroscope.Write(writeBuffer);
// set CS line high to unselect the device
//_chipSelectLine.Write(GpioPinValue.High);
}
#region Enums
public enum PowerMode : byte
{
PowerDown = 0x00,
Active = 0x08
}
public enum DataRate : byte
{
/// <summary>
/// Output data rate 95 Hz.
/// </summary>
_95Hz = 0x00,
/// <summary>
/// Output data rate 190 Hz.
/// </summary>
_190Hz = 0x40,
/// <summary>
/// Output data rate 380 Hz.
/// </summary>
_380Hz = 0x80,
/// <summary>
/// Output data rate 760 Hz.
/// </summary>
_760Hz = 0xC0,
}
[Flags]
public enum AxisSelection : byte
{
None = 0,
Y = 0x01,
X = 0x02,
Z = 0x04,
All = X | Y | Z,
}
public enum Scale : byte
{
_0250 = 0x00,
_0500 = 0x10,
_2000 = 0x20,
}
public enum Sensivity
{
_0250dps,
_0500dps,
_2000dps,
}
/// <summary>
/// low pass filter 1 bandwidth, depends on Output data rate ODR.
/// </summary>
public enum LPFilter1Bandwith : byte
{
BW0 = 0x00,
BW1 = 0x40,
BW2 = 0x80,
BW3 = 0xC0,
}
public enum HighPassFilterMode : byte
{
Normal = 0x00,
ReferenceSignal = 0x10,
AutoReset = 0x30,
Bypassed = 0xFF,
}
/// <summary>
/// High-Pass filter configuration. depends on Output data rate ODR. See table 26 on datasheet for details)
/// </summary>
public enum HighPassConfiguration : byte
{
HPConf0 = 0x00,
HPConf1 = 0x01,
HPConf2 = 0x02,
HPConf3 = 0x03,
HPConf4 = 0x04,
HPConf5 = 0x05,
HPConf6 = 0x06,
HPConf7 = 0x07,
HPConf8 = 0x08,
HPConf9 = 0x09,
}
public enum LowPass2Mode
{
On,
Bypassed,
}
public enum Endianess : byte
{
LittleEndian = 0x00,
BigEndian = 040,
}
#endregion
}
}
| 28.775281 | 150 | 0.51925 | [
"MIT"
] | Andrulko/Samples | samples/SPI/L3GD20.Driver/L3GD20.cs | 12,807 | C# |
using System.Collections.Generic;
namespace Amazon.Lambda.CloudWatchEvents.ECSEvents
{
/// <summary>
/// A Docker container that is part of a task.
/// https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_Container.html
/// </summary>
public class Container
{
/// <summary>
/// The Amazon Resource Name (ARN) of the container.
/// </summary>
public string ContainerArn { get; set; }
/// <summary>
/// The number of CPU units set for the container. The value will be 0 if no value was specified in the container definition when the task definition was registered.
/// </summary>
public string Cpu { get; set; }
/// <summary>
/// The exit code returned from the container.
/// </summary>
public int ExitCode { get; set; }
/// <summary>
/// The IDs of each GPU assigned to the container.
/// </summary>
public List<string> GpuIds { get; set; }
/// <summary>
/// The health status of the container. If health checks are not configured for this container in its task definition, then it reports the health status as UNKNOWN.
/// </summary>
public string HealthStatus { get; set; }
/// <summary>
/// The image used for the container.
/// </summary>
public string Image { get; set; }
/// <summary>
/// The container image manifest digest.
/// </summary>
public string ImageDigest { get; set; }
/// <summary>
/// The last known status of the container.
/// </summary>
public string LastStatus { get; set; }
/// <summary>
/// The details of any Amazon ECS managed agents associated with the container.
/// </summary>
public List<ManagedAgent> ManagedAgents { get; set; }
/// <summary>
/// The hard limit (in MiB) of memory set for the container.
/// </summary>
public string Memory { get; set; }
/// <summary>
/// The soft limit (in MiB) of memory set for the container.
/// </summary>
public string MemoryReservation { get; set; }
/// <summary>
/// The name of the container.
/// </summary>
public string Name { get; set; }
/// <summary>
/// The network bindings associated with the container.
/// </summary>
public List<NetworkBinding> NetworkBindings { get; set; }
/// <summary>
/// The network interfaces associated with the container.
/// </summary>
public List<NetworkInterface> NetworkInterfaces { get; set; }
/// <summary>
/// A short (255 max characters) human-readable string to provide additional details about a running or stopped container.
/// </summary>
public string Reason { get; set; }
/// <summary>
/// The ID of the Docker container.
/// </summary>
public string RuntimeId { get; set; }
/// <summary>
/// The ARN of the task.
/// </summary>
public string TaskArn { get; set; }
}
}
| 32.896907 | 173 | 0.566907 | [
"Apache-2.0"
] | Dreamescaper/aws-lambda-dotnet | Libraries/src/Amazon.Lambda.CloudWatchEvents/ECSEvents/Container.cs | 3,193 | C# |
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Leisn.UI.Xaml.Extensions;
using Microsoft.UI.Xaml.Controls;
using Windows.Foundation;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
namespace Leisn.UI.Xaml.Controls
{
internal class AutoFillLayoutState
{
VirtualizingLayoutContext _Context;
List<AutoFillItem> _Items { get; } = new List<AutoFillItem>();
RectClips _AvailableRects { get; } = new RectClips();
public bool Initialized { get; private set; }
public AutoFillLayoutState(VirtualizingLayoutContext context)
{
this._Context = context;
this.Initialized = false;
}
#region save old state
public double ClientWidth { get; internal set; }
public double ClientHeight { get; internal set; }
Size AvailableSize { get; set; }
Thickness Padding { get; set; }
Orientation Orientation { get; set; }
double HorizontalSpacing { get; set; }
double VerticalSpacing { get; set; }
public bool SavePropertiesIfChange(Orientation ori, Thickness padding,
double hSpacing, double vSpacing, Size availableSize)
{
var changed = this.Orientation != ori || this.Padding != padding
|| this.HorizontalSpacing != hSpacing || this.VerticalSpacing != vSpacing
|| this.AvailableSize != availableSize;
if (changed)
{
this.Orientation = ori;
this.Padding = padding;
this.HorizontalSpacing = hSpacing;
this.VerticalSpacing = vSpacing;
this.AvailableSize = availableSize;
}
return changed;
}
#endregion
public int ItemCount => _Items.Count;
public AutoFillItem this[int index]
{
get => _Items[index];
set => _Items[index] = value;
}
public AutoFillItem GetOrCreateItemAt(int index)
{
if (index < 0)
throw new IndexOutOfRangeException("< 0");
if (index < _Items.Count)
return _Items[index];
else
{
var item = new AutoFillItem(index);
this._Items.Add(item);
return item;
}
}
public void Reset()
{
//System.Diagnostics.Debug.WriteLine("Rest states");
_Items.Clear();
_AvailableRects.Clear();
Initialized = false;
}
public void Initialize(Rect canvasBounds)
{
if (!Initialized)
_AvailableRects.MergeItem(canvasBounds);
Initialized = true;
}
public Size GetTotalSize()
{
var rects = from item in _Items select item.Bounds;
return rects.GetOutBounds().Size();
}
public Size GetVirtualizedSize()
{
var rects = from item in _Items
where item.ShouldDisplay
select item.Bounds;
return rects.GetOutBounds().Size();
}
internal void RemoveItemsFrom(int index)
{
if (index >= ItemCount)
return;
List<Rect> backRects = new List<Rect>();
for (int i = index; i < ItemCount; i++)
{
var item = _Items[i];
var bounds = item.Bounds;
if (!bounds.IsEmpty())
{
bounds.Width += HorizontalSpacing;
bounds.Height += VerticalSpacing;
backRects.Add(bounds);
}
}
_Items.RemoveRange(index, ItemCount - index);
if (backRects.Count > 0)
{
_AvailableRects.MergeItems(backRects);
sortAvailableRects();
}
}
internal void RecycleElementAt(int index)
{
_Context.RecycleElement(_Context.GetOrCreateElementAt(index));
}
internal void FitItem(AutoFillItem item)
{
var calSize = new Size(item.Width + HorizontalSpacing, item.Height + VerticalSpacing);
var (index, rect) = findAvailableRect(calSize);
Debug.Assert(index != -1);
var (target, clipRight, clipBottom) = rect.Clip(calSize);
item.Left = target.Left;
item.Top = target.Top;
_AvailableRects.RemoveAt(index);
_AvailableRects.CutThenMergeOthers(target,
clipRight.GetValueOrDefault(),
clipBottom.GetValueOrDefault());
sortAvailableRects();
}
#region handle available rects
(int Index, Rect Area) findAvailableRect(Size size)
{
return Rects.FindEnoughArea(_AvailableRects, size);
}
void sortAvailableRects()
{
if (Orientation == Orientation.Horizontal)
_AvailableRects.Sort(compareRectTop);
else
_AvailableRects.Sort(compareRectLeft);
}
int compareRectTop(Rect rect1, Rect rect2)
{
var offset = rect1.Top - rect2.Top;
if (offset == 0)
return (int)(rect1.Left - rect2.Left);
if (offset < 0)
return -1;
else
return 1;
}
int compareRectLeft(Rect rect1, Rect rect2)
{
var offset = rect1.Left - rect2.Left;
if (offset == 0)
return (int)(rect1.Top - rect2.Top);
if (offset < 0)
return -1;
else
return 1;
}
#endregion
}
}
| 29.69 | 98 | 0.531829 | [
"MIT"
] | leisn/WindowsUIControls | Leisn.UI.Xaml/AutoFill/AutoFillLayoutState.cs | 5,940 | C# |
// Copyright (c) Pomelo Foundation. All rights reserved.
// Licensed under the MIT. See LICENSE in the project root for license information.
using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore.Query.Expressions;
using Microsoft.EntityFrameworkCore.Query.Sql;
using Microsoft.EntityFrameworkCore.Utilities;
using Pomelo.EntityFrameworkCore.MySql.Infrastructure.Internal;
namespace Pomelo.EntityFrameworkCore.MySql.Query.Sql.Internal
{
public class MySqlQuerySqlGeneratorFactory : QuerySqlGeneratorFactoryBase
{
private readonly IMySqlOptions _options;
public MySqlQuerySqlGeneratorFactory([NotNull] QuerySqlGeneratorDependencies dependencies, IMySqlOptions options)
: base(dependencies)
{
_options = options;
}
public override IQuerySqlGenerator CreateDefault(SelectExpression selectExpression)
=> new MySqlQuerySqlGenerator(
Dependencies,
Check.NotNull(selectExpression, nameof(selectExpression)), _options);
}
}
| 37.535714 | 121 | 0.749762 | [
"MIT"
] | DeeJayTC/Pomelo.EntityFrameworkCore.MySql | src/EFCore.MySql/Query/Sql/Internal/MySqlQuerySqlGeneratorFactory.cs | 1,053 | C# |
namespace Cake.Core.Text
{
/// <summary>
/// Represents a text template.
/// </summary>
public interface ITextTransformationTemplate
{
/// <summary>
/// Registers a key and an associated value.
/// </summary>
/// <param name="key">The key.</param>
/// <param name="value">The value.</param>
void Register(string key, object value);
/// <summary>
/// Renders the text template using the registered tokens.
/// </summary>
/// <returns>The rendered template.</returns>
string Render();
}
} | 28.571429 | 66 | 0.556667 | [
"MIT"
] | EvilMindz/cake | src/Cake.Core/Text/ITextTransformationTemplate.cs | 602 | C# |
// <copyright file="DetailLevel.cs" company="Matt Lacey Ltd.">
// Copyright (c) Matt Lacey Ltd. All rights reserved.
// </copyright>
namespace GetLiveXamlInfo
{
public enum DetailLevel
{
Outline,
Local,
All,
}
}
| 17.857143 | 63 | 0.612 | [
"MIT"
] | mrlacey/GetLiveXamlInfo | GetLiveXamlInfo/DetailLevel.cs | 252 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using Foundation;
using UIKit;
namespace YutShot.iOS
{
// The UIApplicationDelegate for the application. This class is responsible for launching the
// User Interface of the application, as well as listening (and optionally responding) to
// application events from iOS.
/*[Register("AppDelegate")]
public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
{
//
// This method is invoked when the application has loaded and is ready to run. In this
// method you should instantiate the window, load the UI into it and then make the window
// visible.
//
// You have 17 seconds to return from this method, or iOS will terminate your application.
//
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
global::Xamarin.Forms.Forms.Init();
LoadApplication(new App());
return base.FinishedLaunching(app, options);
}
}*/
}
| 34.4375 | 98 | 0.674229 | [
"MIT"
] | ys-li/yutshot-mobile-game | TestApp/TestApp.iOS/AppDelegate.cs | 1,104 | C# |
using System;
using System.Collections.Generic;
namespace UserLogs
{
class Program
{
static void Main(string[] args)
{
var logs = new SortedDictionary<string, Dictionary<string, int>>();
GetLogs(logs);
DisplayLogs(logs);
}
private static void DisplayLogs(SortedDictionary<string, Dictionary<string, int>> logs)
{
foreach(var log in logs)
{
Console.WriteLine(log.Key + ":");
List<string> infos = new List<string>();
foreach(var info in log.Value)
{
string message = $"{info.Key}=> {info.Value}";
infos.Add(message);
}
Console.WriteLine(String.Join(", ", infos) + ".");
}
}
private static void GetLogs(SortedDictionary<string, Dictionary<string, int>> logs)
{
while (true)
{
var logArgs = Console.ReadLine().Split(new string[] {"IP=", "message=", "user=", }, StringSplitOptions.RemoveEmptyEntries);
if (logArgs[0] == "end")
{
break;
}
AddLog(logs, logArgs);
}
}
private static void AddLog(SortedDictionary<string, Dictionary<string, int>> logs, string[] logArgs)
{
string IP = logArgs[0];
string user = logArgs[2];
if (logs.ContainsKey(user))
{
if (logs[user].ContainsKey(IP))
{
++logs[user][IP];
return;
}
logs[user].Add(IP, 1);
return;
}
var log = new Dictionary<string, int>
{
{ IP, 1 }
};
logs.Add(user, log);
}
}
}
| 26.589041 | 139 | 0.438949 | [
"MIT"
] | MartsTech/IT-Career | 02. Programming/07 - Dictionaries-and-hash-tables/30. Lambda expressions and dictionaries/06. UserLogs/Program.cs | 1,943 | C# |
using System;
using System.Collections.Generic;
using System.Data.Linq;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Text;
#if !SILVERLIGHT && !NETFX_CORE
using System.Data.SqlTypes;
#endif
using JetBrains.Annotations;
#region ReSharper disables
// ReSharper disable RedundantTypeArgumentsOfMethod
// ReSharper disable RedundantCast
// ReSharper disable PossibleInvalidOperationException
// ReSharper disable CSharpWarnings::CS0693
// ReSharper disable RedundantToStringCall
// ReSharper disable RedundantLambdaParameterType
#endregion
namespace LinqToDB.Linq
{
using Common;
using Extensions;
using LinqToDB.Expressions;
using Mapping;
[PublicAPI]
public static class Expressions
{
#region MapMember
public static void MapMember(MemberInfo memberInfo, LambdaExpression expression)
{
MapMember("", memberInfo, expression);
}
public static void MapMember(MemberInfo memberInfo, IExpressionInfo expressionInfo)
{
MapMember("", memberInfo, expressionInfo);
}
public static void MapMember(string providerName, MemberInfo memberInfo, LambdaExpression expression)
{
Dictionary<MemberInfo,IExpressionInfo> dic;
if (!Members.TryGetValue(providerName, out dic))
Members.Add(providerName, dic = new Dictionary<MemberInfo,IExpressionInfo>());
var expr = new LazyExpressionInfo();
expr.SetExpression(expression);
dic[memberInfo] = expr;
_checkUserNamespace = false;
}
public static void MapMember(string providerName, MemberInfo memberInfo, IExpressionInfo expressionInfo)
{
Dictionary<MemberInfo,IExpressionInfo> dic;
if (!Members.TryGetValue(providerName, out dic))
Members.Add(providerName, dic = new Dictionary<MemberInfo,IExpressionInfo>());
dic[memberInfo] = expressionInfo;
_checkUserNamespace = false;
}
public static void MapMember(Expression<Func<object>> memberInfo, LambdaExpression expression)
{
MapMember("", M(memberInfo), expression);
}
public static void MapMember(string providerName, Expression<Func<object>> memberInfo, LambdaExpression expression)
{
MapMember(providerName, M(memberInfo), expression);
}
public static void MapMember<T>(Expression<Func<T,object>> memberInfo, LambdaExpression expression)
{
MapMember("", M(memberInfo), expression);
}
public static void MapMember<T>(string providerName, Expression<Func<T,object>> memberInfo, LambdaExpression expression)
{
MapMember(providerName, M(memberInfo), expression);
}
public static void MapMember<TR> (string providerName, Expression<Func<TR>> memberInfo, Expression<Func<TR>> expression) { MapMember(providerName, MemberHelper.GetMemberInfo(memberInfo), expression); }
public static void MapMember<TR> ( Expression<Func<TR>> memberInfo, Expression<Func<TR>> expression) { MapMember("", MemberHelper.GetMemberInfo(memberInfo), expression); }
public static void MapMember<T1,TR> (string providerName, Expression<Func<T1,TR>> memberInfo, Expression<Func<T1,TR>> expression) { MapMember(providerName, MemberHelper.GetMemberInfo(memberInfo), expression); }
public static void MapMember<T1,TR> ( Expression<Func<T1,TR>> memberInfo, Expression<Func<T1,TR>> expression) { MapMember("", MemberHelper.GetMemberInfo(memberInfo), expression); }
public static void MapMember<T1,T2,TR> (string providerName, Expression<Func<T1,T2,TR>> memberInfo, Expression<Func<T1,T2,TR>> expression) { MapMember(providerName, MemberHelper.GetMemberInfo(memberInfo), expression); }
public static void MapMember<T1,T2,TR> ( Expression<Func<T1,T2,TR>> memberInfo, Expression<Func<T1,T2,TR>> expression) { MapMember("", MemberHelper.GetMemberInfo(memberInfo), expression); }
public static void MapMember<T1,T2,T3,TR> (string providerName, Expression<Func<T1,T2,T3,TR>> memberInfo, Expression<Func<T1,T2,T3,TR>> expression) { MapMember(providerName, MemberHelper.GetMemberInfo(memberInfo), expression); }
public static void MapMember<T1,T2,T3,TR> ( Expression<Func<T1,T2,T3,TR>> memberInfo, Expression<Func<T1,T2,T3,TR>> expression) { MapMember("", MemberHelper.GetMemberInfo(memberInfo), expression); }
public static void MapMember<T1,T2,T3,T4,TR> (string providerName, Expression<Func<T1,T2,T3,T4,TR>> memberInfo, Expression<Func<T1,T2,T3,T4,TR>> expression) { MapMember(providerName, MemberHelper.GetMemberInfo(memberInfo), expression); }
public static void MapMember<T1,T2,T3,T4,TR> ( Expression<Func<T1,T2,T3,T4,TR>> memberInfo, Expression<Func<T1,T2,T3,T4,TR>> expression) { MapMember("", MemberHelper.GetMemberInfo(memberInfo), expression); }
public static void MapMember<T1,T2,T3,T4,T5,TR>(string providerName, Expression<Func<T1,T2,T3,T4,T5,TR>> memberInfo, Expression<Func<T1,T2,T3,T4,T5,TR>> expression) { MapMember(providerName, MemberHelper.GetMemberInfo(memberInfo), expression); }
public static void MapMember<T1,T2,T3,T4,T5,TR>( Expression<Func<T1,T2,T3,T4,T5,TR>> memberInfo, Expression<Func<T1,T2,T3,T4,T5,TR>> expression) { MapMember("", MemberHelper.GetMemberInfo(memberInfo), expression); }
#endregion
#region IGenericInfoProvider
static volatile Dictionary<Type,List<Type[]>> _genericConvertProviders = new Dictionary<Type,List<Type[]>>();
static bool InitGenericConvertProvider(Type[] types, MappingSchema mappingSchema)
{
var changed = false;
lock (_genericConvertProviders)
{
foreach (var type in _genericConvertProviders)
{
var args = type.Key.GetGenericArgumentsEx();
if (args.Length == types.Length)
{
if (type.Value.Aggregate(false, (cur,ts) => cur || ts.SequenceEqual(types)))
continue;
var gtype = type.Key.MakeGenericType(types);
var provider = (IGenericInfoProvider)Activator.CreateInstance(gtype);
provider.SetInfo(new MappingSchema(mappingSchema));
type.Value.Add(types);
changed = true;
}
}
}
return changed;
}
public static void SetGenericInfoProvider(Type type)
{
if (!type.IsGenericTypeDefinitionEx())
throw new LinqToDBException("'{0}' must be a generic type.".Args(type));
if (!typeof(IGenericInfoProvider).IsSameOrParentOf(type))
throw new LinqToDBException("'{0}' must inherit from 'IGenericInfoProvider'.".Args(type));
if (!_genericConvertProviders.ContainsKey(type))
lock (_genericConvertProviders)
if (!_genericConvertProviders.ContainsKey(type))
_genericConvertProviders[type] = new List<Type[]>();
}
#endregion
#region Public Members
static bool _checkUserNamespace = true;
public static LambdaExpression ConvertMember(MappingSchema mappingSchema, Type objectType, MemberInfo mi)
{
if (_checkUserNamespace)
{
if (IsUserNamespace(mi.DeclaringType.Namespace))
return null;
_checkUserNamespace = false;
}
IExpressionInfo expr;
{
Dictionary<MemberInfo,IExpressionInfo> dic;
foreach (var configuration in mappingSchema.ConfigurationList)
if (Members.TryGetValue(configuration, out dic))
if (dic.TryGetValue(mi, out expr))
return expr.GetExpression(mappingSchema);
Type[] args = null;
if (mi is MethodInfo)
{
var mm = (MethodInfo)mi;
var isTypeGeneric = mm.DeclaringType.IsGenericTypeEx() && !mm.DeclaringType.IsGenericTypeDefinitionEx();
var isMethodGeneric = mm.IsGenericMethod && !mm.IsGenericMethodDefinition;
if (isTypeGeneric || isMethodGeneric)
{
var typeGenericArgs = isTypeGeneric ? mm.DeclaringType.GetGenericArgumentsEx() : Array<Type>.Empty;
var methodGenericArgs = isMethodGeneric ? mm.GetGenericArguments() : Array<Type>.Empty;
args = typeGenericArgs.SequenceEqual(methodGenericArgs) ?
typeGenericArgs : typeGenericArgs.Concat(methodGenericArgs).ToArray();
}
}
if (args != null && InitGenericConvertProvider(args, mappingSchema))
foreach (var configuration in mappingSchema.ConfigurationList)
if (Members.TryGetValue(configuration, out dic))
if (dic.TryGetValue(mi, out expr))
return expr.GetExpression(mappingSchema);
if (!Members[""].TryGetValue(mi, out expr))
{
if (mi is MethodInfo && mi.Name == "CompareString" && mi.DeclaringType.FullName == "Microsoft.VisualBasic.CompilerServices.Operators")
{
lock (_memberSync)
{
if (!Members[""].TryGetValue(mi, out expr))
{
expr = new LazyExpressionInfo();
((LazyExpressionInfo)expr).SetExpression(L<String,String,Boolean,Int32>((s1,s2,b) => b ? string.CompareOrdinal(s1.ToUpper(), s2.ToUpper()) : string.CompareOrdinal(s1, s2)));
Members[""].Add(mi, expr);
}
}
}
}
}
if (expr == null && objectType != null)
{
Dictionary<TypeMember,IExpressionInfo> dic;
var key = new TypeMember(objectType, mi.Name);
foreach (var configuration in mappingSchema.ConfigurationList)
if (_typeMembers.TryGetValue(configuration, out dic))
if (dic.TryGetValue(key, out expr))
return expr.GetExpression(mappingSchema);
_typeMembers[""].TryGetValue(key, out expr);
}
return expr == null ? null : expr.GetExpression(mappingSchema);
}
#endregion
#region Function Mapping
#region Helpers
static bool IsUserNamespace(string typeNamespace)
{
if (typeNamespace == null)
return true;
var dotIndex = typeNamespace.IndexOf('.');
var root = dotIndex != -1 ? typeNamespace.Substring(0, dotIndex) : typeNamespace;
// Startup optimization.
//
switch (root)
{
case "LinqToDB" :
case "System" :
case "Microsoft": return false;
default : return true;
}
}
public static MemberInfo M<T>(Expression<Func<T,object>> func)
{
return MemberHelper.GetMemberInfo(func);
}
public static MemberInfo M<T>(Expression<Func<T>> func)
{
return MemberHelper.GetMemberInfo(func);
}
public static LambdaExpression L<TR> (Expression<Func<TR>> func) { return func; }
public static LambdaExpression L<T1,TR> (Expression<Func<T1,TR>> func) { return func; }
public static LambdaExpression L<T1,T2,TR> (Expression<Func<T1,T2,TR>> func) { return func; }
public static LambdaExpression L<T1,T2,T3,TR> (Expression<Func<T1,T2,T3,TR>> func) { return func; }
public static LambdaExpression L<T1,T2,T3,T4,TR> (Expression<Func<T1,T2,T3,T4,TR>> func) { return func; }
public static LambdaExpression L<T1,T2,T3,T4,T5,TR> (Expression<Func<T1,T2,T3,T4,T5,TR>> func) { return func; }
public static LambdaExpression L<T1,T2,T3,T4,T5,T6,TR> (Expression<Func<T1,T2,T3,T4,T5,T6,TR>> func) { return func; }
public static LazyExpressionInfo N (Func<LambdaExpression> func) { return new LazyExpressionInfo { Lambda = func }; }
#endregion
public class LazyExpressionInfo : IExpressionInfo
{
public Func<LambdaExpression> Lambda;
LambdaExpression _expression;
public LambdaExpression GetExpression(MappingSchema mappingSchema)
{
return _expression ?? (_expression = Lambda());
}
public void SetExpression(LambdaExpression expression)
{
_expression = expression;
}
}
static Dictionary<string,Dictionary<MemberInfo,IExpressionInfo>> Members
{
get
{
if (_members == null)
lock (_memberSync)
if (_members == null)
_members = LoadMembers();
return _members;
}
}
interface ISetInfo
{
void SetInfo();
}
class GetValueOrDefaultExpressionInfo<T1> : IExpressionInfo, ISetInfo
where T1 : struct
{
static T1? _member = null;
public LambdaExpression GetExpression(MappingSchema mappingSchema)
{
var p = Expression.Parameter(typeof(T1?), "p");
return Expression.Lambda<Func<T1?,T1>>(
Expression.Coalesce(p, Expression.Constant(mappingSchema.GetDefaultValue(typeof(T1)))),
p);
}
public void SetInfo()
{
_members[""][M(() => _member.GetValueOrDefault() )] = this; // N(() => L<T1?,T1>((T1? obj) => obj ?? default(T1)));
}
}
class GenericInfoProvider<T> : IGenericInfoProvider
{
public void SetInfo(MappingSchema mappingSchema)
{
if (!typeof(T).IsClassEx() && !typeof(T).IsInterfaceEx() && !typeof(T).IsNullable())
{
var gtype = typeof(GetValueOrDefaultExpressionInfo<>).MakeGenericType(typeof(T));
var provider = (ISetInfo)Activator.CreateInstance(gtype);
provider.SetInfo();
}
}
}
#region Mapping
static Dictionary<string,Dictionary<MemberInfo,IExpressionInfo>> _members;
static readonly object _memberSync = new object();
static Dictionary<string,Dictionary<MemberInfo,IExpressionInfo>> LoadMembers()
{
SetGenericInfoProvider(typeof(GenericInfoProvider<>));
return new Dictionary<string,Dictionary<MemberInfo,IExpressionInfo>>
{
{ "", new Dictionary<MemberInfo,IExpressionInfo> {
#region String
{ M(() => "".Length ), N(() => L<String,Int32> ((String obj) => Sql.Length(obj).Value)) },
{ M(() => "".Substring (0) ), N(() => L<String,Int32,String> ((String obj,Int32 p0) => Sql.Substring(obj, p0 + 1, obj.Length - p0))) },
{ M(() => "".Substring (0,0) ), N(() => L<String,Int32,Int32,String> ((String obj,Int32 p0,Int32 p1) => Sql.Substring(obj, p0 + 1, p1))) },
{ M(() => "".IndexOf ("") ), N(() => L<String,String,Int32> ((String obj,String p0) => p0.Length == 0 ? 0 : (Sql.CharIndex(p0, obj) .Value) - 1)) },
{ M(() => "".IndexOf ("",0) ), N(() => L<String,String,Int32,Int32> ((String obj,String p0,Int32 p1) => p0.Length == 0 && obj.Length > p1 ? p1 : (Sql.CharIndex(p0, obj, p1 + 1).Value) - 1)) },
{ M(() => "".IndexOf ("",0,0) ), N(() => L<String,String,Int32,Int32,Int32>((String obj,String p0,Int32 p1,Int32 p2) => p0.Length == 0 && obj.Length > p1 ? p1 : (Sql.CharIndex(p0, Sql.Left(obj, p2), p1) .Value) - 1)) },
{ M(() => "".IndexOf (' ') ), N(() => L<String,Char,Int32> ((String obj,Char p0) => (Sql.CharIndex(p0, obj) .Value) - 1)) },
{ M(() => "".IndexOf (' ',0) ), N(() => L<String,Char,Int32,Int32> ((String obj,Char p0,Int32 p1) => (Sql.CharIndex(p0, obj, p1 + 1).Value) - 1)) },
{ M(() => "".IndexOf (' ',0,0) ), N(() => L<String,Char,Int32,Int32,Int32> ((String obj,Char p0,Int32 p1,Int32 p2) => (Sql.CharIndex(p0, Sql.Left(obj, p2), p1) ?? 0) - 1)) },
{ M(() => "".LastIndexOf("") ), N(() => L<String,String,Int32> ((String obj,String p0) => p0.Length == 0 ? obj.Length - 1 : (Sql.CharIndex(p0, obj) .Value) == 0 ? -1 : obj.Length - (Sql.CharIndex(Sql.Reverse(p0), Sql.Reverse(obj)) .Value) - p0.Length + 1)) },
{ M(() => "".LastIndexOf("",0) ), N(() => L<String,String,Int32,Int32> ((String obj,String p0,Int32 p1) => p0.Length == 0 ? p1 : (Sql.CharIndex(p0, obj, p1 + 1).Value) == 0 ? -1 : obj.Length - (Sql.CharIndex(Sql.Reverse(p0), Sql.Reverse(obj.Substring(p1, obj.Length - p1))).Value) - p0.Length + 1)) },
{ M(() => "".LastIndexOf("",0,0) ), N(() => L<String,String,Int32,Int32,Int32>((String obj,String p0,Int32 p1,Int32 p2) => p0.Length == 0 ? p1 : (Sql.CharIndex(p0, Sql.Left(obj, p1 + p2), p1 + 1).Value) == 0 ? -1 : p1 + p2 - (Sql.CharIndex(Sql.Reverse(p0), Sql.Reverse(obj.Substring(p1, p2))) .Value) - p0.Length + 1)) },
{ M(() => "".LastIndexOf(' ') ), N(() => L<String,Char,Int32> ((String obj,Char p0) => (Sql.CharIndex(p0, obj) .Value) == 0 ? -1 : obj.Length - (Sql.CharIndex(p0, Sql.Reverse(obj)) .Value))) },
{ M(() => "".LastIndexOf(' ',0) ), N(() => L<String,Char,Int32,Int32> ((String obj,Char p0,Int32 p1) => (Sql.CharIndex(p0, obj, p1 + 1) .Value) == 0 ? -1 : obj.Length - (Sql.CharIndex(p0, Sql.Reverse(obj.Substring(p1, obj.Length - p1))).Value))) },
{ M(() => "".LastIndexOf(' ',0,0) ), N(() => L<String,Char,Int32,Int32,Int32> ((String obj,Char p0,Int32 p1,Int32 p2) => (Sql.CharIndex(p0, Sql.Left(obj, p1 + p2), p1 + 1).Value) == 0 ? -1 : p1 + p2 - (Sql.CharIndex(p0, Sql.Reverse(obj.Substring(p1, p2))) .Value))) },
{ M(() => "".Insert (0,"") ), N(() => L<String,Int32,String,String> ((String obj,Int32 p0,String p1) => obj.Length == p0 ? obj + p1 : Sql.Stuff(obj, p0 + 1, 0, p1))) },
{ M(() => "".Remove (0) ), N(() => L<String,Int32,String> ((String obj,Int32 p0) => Sql.Left (obj, p0))) },
{ M(() => "".Remove (0,0) ), N(() => L<String,Int32,Int32,String> ((String obj,Int32 p0,Int32 p1) => Sql.Stuff (obj, p0 + 1, p1, ""))) },
{ M(() => "".PadLeft (0) ), N(() => L<String,Int32,String> ((String obj,Int32 p0) => Sql.PadLeft (obj, p0, ' '))) },
{ M(() => "".PadLeft (0,' ') ), N(() => L<String,Int32,Char,String> ((String obj,Int32 p0,Char p1) => Sql.PadLeft (obj, p0, p1))) },
{ M(() => "".PadRight (0) ), N(() => L<String,Int32,String> ((String obj,Int32 p0) => Sql.PadRight (obj, p0, ' '))) },
{ M(() => "".PadRight (0,' ') ), N(() => L<String,Int32,Char,String> ((String obj,Int32 p0,Char p1) => Sql.PadRight (obj, p0, p1))) },
{ M(() => "".Replace ("","") ), N(() => L<String,String,String,String> ((String obj,String p0,String p1) => Sql.Replace (obj, p0, p1))) },
{ M(() => "".Replace (' ',' ') ), N(() => L<String,Char,Char,String> ((String obj,Char p0,Char p1) => Sql.Replace (obj, p0, p1))) },
{ M(() => "".Trim () ), N(() => L<String,String> ((String obj) => Sql.Trim (obj))) },
{ M(() => "".TrimEnd () ), N(() => L<String,Char[],String> ((String obj,Char[] ch) => TrimRight(obj, ch))) },
{ M(() => "".TrimStart () ), N(() => L<String,Char[],String> ((String obj,Char[] ch) => TrimLeft (obj, ch))) },
{ M(() => "".ToLower () ), N(() => L<String,String> ((String obj) => Sql.Lower(obj))) },
{ M(() => "".ToUpper () ), N(() => L<String,String> ((String obj) => Sql.Upper(obj))) },
{ M(() => "".CompareTo ("") ), N(() => L<String,String,Int32> ((String obj,String p0) => ConvertToCaseCompareTo(obj, p0).Value)) },
#if !NETFX_CORE && !NETSTANDARD
{ M(() => "".CompareTo (1) ), N(() => L<String,Object,Int32> ((String obj,Object p0) => ConvertToCaseCompareTo(obj, p0.ToString()).Value)) },
#endif
{ M(() => string.Concat((object)null) ), N(() => L<Object,String> ((Object p0) => p0.ToString())) },
{ M(() => string.Concat((object)null,(object)null) ), N(() => L<Object,Object,String> ((Object p0,Object p1) => p0.ToString() + p1)) },
{ M(() => string.Concat((object)null,(object)null,(object)null) ), N(() => L<Object,Object,Object,String> ((Object p0,Object p1,Object p2) => p0.ToString() + p1 + p2)) },
{ M(() => string.Concat((object[])null) ), N(() => L<Object[],String> ((Object[] ps) => Sql.Concat(ps))) },
{ M(() => string.Concat("","") ), N(() => L<String,String,String> ((String p0,String p1) => p0 + p1)) },
{ M(() => string.Concat("","","") ), N(() => L<String,String,String,String> ((String p0,String p1,String p2) => p0 + p1 + p2)) },
{ M(() => string.Concat("","","","") ), N(() => L<String,String,String,String,String>((String p0,String p1,String p2,String p3) => p0 + p1 + p2 + p3)) },
{ M(() => string.Concat((string[])null) ), N(() => L<String[],String> ((String[] ps) => Sql.Concat(ps))) },
{ M(() => string.IsNullOrEmpty ("") ), N(() => L<String,Boolean> ((String p0) => p0 == null || p0.Length == 0)) },
{ M(() => string.CompareOrdinal("","")), N(() => L<String,String,Int32> ((String s1,String s2) => s1.CompareTo(s2))) },
{ M(() => string.CompareOrdinal("",0,"",0,0)), N(() => L<String,Int32,String,Int32,Int32,Int32> ((String s1,Int32 i1,String s2,Int32 i2,Int32 l) => s1.Substring(i1, l).CompareTo(s2.Substring(i2, l)))) },
{ M(() => string.Compare ("","")), N(() => L<String,String,Int32> ((String s1,String s2) => s1.CompareTo(s2))) },
{ M(() => string.Compare ("",0,"",0,0)), N(() => L<String,Int32,String,Int32,Int32,Int32> ((String s1,Int32 i1,String s2,Int32 i2,Int32 l) => s1.Substring(i1,l).CompareTo(s2.Substring(i2,l)))) },
#if !SILVERLIGHT && !NETFX_CORE
{ M(() => string.Compare ("","",true)), N(() => L<String,String,Boolean,Int32> ((String s1,String s2,Boolean b) => b ? s1.ToLower().CompareTo(s2.ToLower()) : s1.CompareTo(s2))) },
#endif
#if !SILVERLIGHT && !NETFX_CORE && !NETSTANDARD
{ M(() => string.Compare ("",0,"",0,0,true)), N(() => L<String,Int32,String,Int32,Int32,Boolean,Int32> ((String s1,Int32 i1,String s2,Int32 i2,Int32 l,Boolean b) => b ? s1.Substring(i1,l).ToLower().CompareTo(s2.Substring(i2, l).ToLower()) : s1.Substring(i1, l).CompareTo(s2.Substring(i2, l)))) },
#endif
{ M(() => string.Compare ("",0,"",0,0,StringComparison.OrdinalIgnoreCase)), N(() => L<String,Int32,String,Int32,Int32,StringComparison,Int32>((String s1,Int32 i1,String s2,Int32 i2,Int32 l,StringComparison sc) => sc == StringComparison.CurrentCultureIgnoreCase || sc==StringComparison.OrdinalIgnoreCase ? s1.Substring(i1,l).ToLower().CompareTo(s2.Substring(i2, l).ToLower()) : s1.Substring(i1, l).CompareTo(s2.Substring(i2, l)))) },
{ M(() => string.Compare ("","",StringComparison.OrdinalIgnoreCase)), N(() => L<String,String,StringComparison,Int32> ((String s1,String s2,StringComparison sc) => sc == StringComparison.CurrentCultureIgnoreCase || sc==StringComparison.OrdinalIgnoreCase ? s1.ToLower().CompareTo(s2.ToLower()) : s1.CompareTo(s2))) },
{ M(() => AltStuff("",0,0,"")), N(() => L<String,Int32?,Int32?,String,String>((String p0,Int32? p1,Int32 ?p2,String p3) => Sql.Left(p0, p1 - 1) + p3 + Sql.Right(p0, p0.Length - (p1 + p2 - 1)))) },
#endregion
#region Binary
#pragma warning disable 1720
{ M(() => ((Binary)null).Length ), N(() => L<Binary,Int32>((Binary obj) => Sql.Length(obj).Value)) },
#pragma warning restore 1720
#endregion
#region DateTime
{ M(() => Sql.GetDate() ), N(() => L<DateTime> (() => Sql.CurrentTimestamp2)) },
{ M(() => DateTime.Now ), N(() => L<DateTime> (() => Sql.CurrentTimestamp2)) },
{ M(() => DateTime.Now.Year ), N(() => L<DateTime,Int32> ((DateTime obj) => Sql.DatePart(Sql.DateParts.Year, obj).Value )) },
{ M(() => DateTime.Now.Month ), N(() => L<DateTime,Int32> ((DateTime obj) => Sql.DatePart(Sql.DateParts.Month, obj).Value )) },
{ M(() => DateTime.Now.DayOfYear ), N(() => L<DateTime,Int32> ((DateTime obj) => Sql.DatePart(Sql.DateParts.DayOfYear, obj).Value )) },
{ M(() => DateTime.Now.Day ), N(() => L<DateTime,Int32> ((DateTime obj) => Sql.DatePart(Sql.DateParts.Day, obj).Value )) },
{ M(() => DateTime.Now.DayOfWeek ), N(() => L<DateTime,Int32> ((DateTime obj) => Sql.DatePart(Sql.DateParts.WeekDay, obj).Value - 1)) },
{ M(() => DateTime.Now.Hour ), N(() => L<DateTime,Int32> ((DateTime obj) => Sql.DatePart(Sql.DateParts.Hour, obj).Value )) },
{ M(() => DateTime.Now.Minute ), N(() => L<DateTime,Int32> ((DateTime obj) => Sql.DatePart(Sql.DateParts.Minute, obj).Value )) },
{ M(() => DateTime.Now.Second ), N(() => L<DateTime,Int32> ((DateTime obj) => Sql.DatePart(Sql.DateParts.Second, obj).Value )) },
{ M(() => DateTime.Now.Millisecond ), N(() => L<DateTime,Int32> ((DateTime obj) => Sql.DatePart(Sql.DateParts.Millisecond, obj).Value )) },
{ M(() => DateTime.Now.Date ), N(() => L<DateTime,DateTime> ((DateTime obj) => Sql.Convert2(Sql.Date, obj) )) },
{ M(() => DateTime.Now.TimeOfDay ), N(() => L<DateTime,TimeSpan> ((DateTime obj) => Sql.DateToTime(Sql.Convert2(Sql.Time, obj)).Value )) },
{ M(() => DateTime.Now.AddYears (0)), N(() => L<DateTime,Int32,DateTime> ((DateTime obj,Int32 p0) => Sql.DateAdd(Sql.DateParts.Year, p0, obj).Value )) },
{ M(() => DateTime.Now.AddMonths (0)), N(() => L<DateTime,Int32,DateTime> ((DateTime obj,Int32 p0) => Sql.DateAdd(Sql.DateParts.Month, p0, obj).Value )) },
{ M(() => DateTime.Now.AddDays (0)), N(() => L<DateTime,Double,DateTime> ((DateTime obj,Double p0) => Sql.DateAdd(Sql.DateParts.Day, p0, obj).Value )) },
{ M(() => DateTime.Now.AddHours (0)), N(() => L<DateTime,Double,DateTime> ((DateTime obj,Double p0) => Sql.DateAdd(Sql.DateParts.Hour, p0, obj).Value )) },
{ M(() => DateTime.Now.AddMinutes (0)), N(() => L<DateTime,Double,DateTime> ((DateTime obj,Double p0) => Sql.DateAdd(Sql.DateParts.Minute, p0, obj).Value )) },
{ M(() => DateTime.Now.AddSeconds (0)), N(() => L<DateTime,Double,DateTime> ((DateTime obj,Double p0) => Sql.DateAdd(Sql.DateParts.Second, p0, obj).Value )) },
{ M(() => DateTime.Now.AddMilliseconds(0)), N(() => L<DateTime,Double,DateTime> ((DateTime obj,Double p0) => Sql.DateAdd(Sql.DateParts.Millisecond, p0, obj).Value )) },
{ M(() => new DateTime(0, 0, 0) ), N(() => L<Int32,Int32,Int32,DateTime>((Int32 y,Int32 m,Int32 d) => Sql.MakeDateTime(y, m, d).Value )) },
{ M(() => Sql.MakeDateTime(0, 0, 0) ), N(() => L<Int32?,Int32?,Int32?,DateTime?> ((Int32? y,Int32? m,Int32? d) => (DateTime?)Sql.Convert(Sql.Date, y.ToString() + "-" + m.ToString() + "-" + d.ToString()))) },
{ M(() => new DateTime (0, 0, 0, 0, 0, 0) ), N(() => L<Int32,Int32,Int32,Int32,Int32,Int32,DateTime> ((Int32 y,Int32 m,Int32 d,Int32 h,Int32 mm,Int32 s) => Sql.MakeDateTime(y, m, d, h, mm, s).Value )) },
{ M(() => Sql.MakeDateTime(0, 0, 0, 0, 0, 0) ), N(() => L<Int32?,Int32?,Int32?,Int32?,Int32?,Int32?,DateTime?>((Int32? y,Int32? m,Int32? d,Int32? h,Int32? mm,Int32? s) => (DateTime?)Sql.Convert(Sql.DateTime2,
y.ToString() + "-" + m.ToString() + "-" + d.ToString() + " " +
h.ToString() + ":" + mm.ToString() + ":" + s.ToString()))) },
#endregion
#region Parse
{ M(() => Boolean. Parse("")), N(() => L<String,Boolean> ((String p0) => Sql.ConvertTo<Boolean>. From(p0))) },
{ M(() => Byte. Parse("")), N(() => L<String,Byte> ((String p0) => Sql.ConvertTo<Byte>. From(p0))) },
#if !SILVERLIGHT && !NETFX_CORE || NETSTANDARD
{ M(() => Char. Parse("")), N(() => L<String,Char> ((String p0) => Sql.ConvertTo<Char>. From(p0))) },
#endif
{ M(() => DateTime.Parse("")), N(() => L<String,DateTime>((String p0) => Sql.ConvertTo<DateTime>.From(p0))) },
{ M(() => Decimal. Parse("")), N(() => L<String,Decimal> ((String p0) => Sql.ConvertTo<Decimal>. From(p0))) },
{ M(() => Double. Parse("")), N(() => L<String,Double> ((String p0) => Sql.ConvertTo<Double>. From(p0))) },
{ M(() => Int16. Parse("")), N(() => L<String,Int16> ((String p0) => Sql.ConvertTo<Int16>. From(p0))) },
{ M(() => Int32. Parse("")), N(() => L<String,Int32> ((String p0) => Sql.ConvertTo<Int32>. From(p0))) },
{ M(() => Int64. Parse("")), N(() => L<String,Int64> ((String p0) => Sql.ConvertTo<Int64>. From(p0))) },
{ M(() => SByte. Parse("")), N(() => L<String,SByte> ((String p0) => Sql.ConvertTo<SByte>. From(p0))) },
{ M(() => Single. Parse("")), N(() => L<String,Single> ((String p0) => Sql.ConvertTo<Single>. From(p0))) },
{ M(() => UInt16. Parse("")), N(() => L<String,UInt16> ((String p0) => Sql.ConvertTo<UInt16>. From(p0))) },
{ M(() => UInt32. Parse("")), N(() => L<String,UInt32> ((String p0) => Sql.ConvertTo<UInt32>. From(p0))) },
{ M(() => UInt64. Parse("")), N(() => L<String,UInt64> ((String p0) => Sql.ConvertTo<UInt64>. From(p0))) },
#endregion
#region ToString
// { M(() => ((Boolean)true).ToString()), N(() => L<Boolean, String>((Boolean p0) => Sql.ConvertTo<string>.From(p0))) },
// { M(() => ((Byte) 0) .ToString()), N(() => L<Byte, String>((Byte p0) => Sql.ConvertTo<string>.From(p0))) },
// { M(() => ((Char) '0') .ToString()), N(() => L<Char, String>((Char p0) => Sql.ConvertTo<string>.From(p0))) },
// { M(() => ((Decimal) 0) .ToString()), N(() => L<Decimal, String>((Decimal p0) => Sql.ConvertTo<string>.From(p0))) },
// { M(() => ((Double) 0) .ToString()), N(() => L<Double, String>((Double p0) => Sql.ConvertTo<string>.From(p0))) },
// { M(() => ((Int16) 0) .ToString()), N(() => L<Int16, String>((Int16 p0) => Sql.ConvertTo<string>.From(p0))) },
// { M(() => ((Int32) 0) .ToString()), N(() => L<Int32, String>((Int32 p0) => Sql.ConvertTo<string>.From(p0))) },
// { M(() => ((Int64) 0) .ToString()), N(() => L<Int64, String>((Int64 p0) => Sql.ConvertTo<string>.From(p0))) },
// { M(() => ((SByte) 0) .ToString()), N(() => L<SByte, String>((SByte p0) => Sql.ConvertTo<string>.From(p0))) },
// { M(() => ((Single) 0) .ToString()), N(() => L<Single, String>((Single p0) => Sql.ConvertTo<string>.From(p0))) },
{ M(() => ((String) "0") .ToString()), N(() => L<String, String>((String p0) => p0 )) },
// { M(() => ((UInt16) 0) .ToString()), N(() => L<UInt16, String>((UInt16 p0) => Sql.ConvertTo<string>.From(p0))) },
// { M(() => ((UInt32) 0) .ToString()), N(() => L<UInt32, String>((UInt32 p0) => Sql.ConvertTo<string>.From(p0))) },
// { M(() => ((UInt64) 0) .ToString()), N(() => L<UInt64, String>((UInt64 p0) => Sql.ConvertTo<string>.From(p0))) },
#endregion
#region Convert
#region ToBoolean
{ M(() => Convert.ToBoolean((Boolean)true)), N(() => L<Boolean, Boolean>((Boolean p0) => Sql.ConvertTo<Boolean>.From(p0))) },
{ M(() => Convert.ToBoolean((Byte) 0) ), N(() => L<Byte, Boolean>((Byte p0) => Sql.ConvertTo<Boolean>.From(p0))) },
#if !NETSTANDARD
{ M(() => Convert.ToBoolean((Char) '0') ), N(() => L<Char, Boolean>((Char p0) => Sql.ConvertTo<Boolean>.From(p0))) },
#if !SILVERLIGHT
{ M(() => Convert.ToBoolean(DateTime.Now) ), N(() => L<DateTime,Boolean>((DateTime p0) => Sql.ConvertTo<Boolean>.From(p0))) },
#endif
#endif
{ M(() => Convert.ToBoolean((Decimal) 0) ), N(() => L<Decimal, Boolean>((Decimal p0) => Sql.ConvertTo<Boolean>.From(p0))) },
{ M(() => Convert.ToBoolean((Double) 0) ), N(() => L<Double, Boolean>((Double p0) => Sql.ConvertTo<Boolean>.From(p0))) },
{ M(() => Convert.ToBoolean((Int16) 0) ), N(() => L<Int16, Boolean>((Int16 p0) => Sql.ConvertTo<Boolean>.From(p0))) },
{ M(() => Convert.ToBoolean((Int32) 0) ), N(() => L<Int32, Boolean>((Int32 p0) => Sql.ConvertTo<Boolean>.From(p0))) },
{ M(() => Convert.ToBoolean((Int64) 0) ), N(() => L<Int64, Boolean>((Int64 p0) => Sql.ConvertTo<Boolean>.From(p0))) },
{ M(() => Convert.ToBoolean((Object) 0) ), N(() => L<Object, Boolean>((Object p0) => Sql.ConvertTo<Boolean>.From(p0))) },
{ M(() => Convert.ToBoolean((SByte) 0) ), N(() => L<SByte, Boolean>((SByte p0) => Sql.ConvertTo<Boolean>.From(p0))) },
{ M(() => Convert.ToBoolean((Single) 0) ), N(() => L<Single, Boolean>((Single p0) => Sql.ConvertTo<Boolean>.From(p0))) },
{ M(() => Convert.ToBoolean((String) "0") ), N(() => L<String, Boolean>((String p0) => Sql.ConvertTo<Boolean>.From(p0))) },
{ M(() => Convert.ToBoolean((UInt16) 0) ), N(() => L<UInt16, Boolean>((UInt16 p0) => Sql.ConvertTo<Boolean>.From(p0))) },
{ M(() => Convert.ToBoolean((UInt32) 0) ), N(() => L<UInt32, Boolean>((UInt32 p0) => Sql.ConvertTo<Boolean>.From(p0))) },
{ M(() => Convert.ToBoolean((UInt64) 0) ), N(() => L<UInt64, Boolean>((UInt64 p0) => Sql.ConvertTo<Boolean>.From(p0))) },
#endregion
#region ToByte
{ M(() => Convert.ToByte((Boolean)true)), N(() => L<Boolean, Byte>((Boolean p0) => Sql.ConvertTo<Byte>.From(p0))) },
{ M(() => Convert.ToByte((Byte) 0) ), N(() => L<Byte, Byte>((Byte p0) => Sql.ConvertTo<Byte>.From(p0))) },
#if !NETSTANDARD
{ M(() => Convert.ToByte((Char) '0') ), N(() => L<Char, Byte>((Char p0) => Sql.ConvertTo<Byte>.From(p0))) },
#if !SILVERLIGHT
{ M(() => Convert.ToByte(DateTime.Now) ), N(() => L<DateTime,Byte>((DateTime p0) => Sql.ConvertTo<Byte>.From(p0))) },
#endif
#endif
{ M(() => Convert.ToByte((Decimal) 0) ), N(() => L<Decimal, Byte>((Decimal p0) => Sql.ConvertTo<Byte>.From(Sql.RoundToEven(p0)))) },
{ M(() => Convert.ToByte((Double) 0) ), N(() => L<Double, Byte>((Double p0) => Sql.ConvertTo<Byte>.From(Sql.RoundToEven(p0)))) },
{ M(() => Convert.ToByte((Int16) 0) ), N(() => L<Int16, Byte>((Int16 p0) => Sql.ConvertTo<Byte>.From(p0))) },
{ M(() => Convert.ToByte((Int32) 0) ), N(() => L<Int32, Byte>((Int32 p0) => Sql.ConvertTo<Byte>.From(p0))) },
{ M(() => Convert.ToByte((Int64) 0) ), N(() => L<Int64, Byte>((Int64 p0) => Sql.ConvertTo<Byte>.From(p0))) },
{ M(() => Convert.ToByte((Object) 0) ), N(() => L<Object, Byte>((Object p0) => Sql.ConvertTo<Byte>.From(p0))) },
{ M(() => Convert.ToByte((SByte) 0) ), N(() => L<SByte, Byte>((SByte p0) => Sql.ConvertTo<Byte>.From(p0))) },
{ M(() => Convert.ToByte((Single) 0) ), N(() => L<Single, Byte>((Single p0) => Sql.ConvertTo<Byte>.From(Sql.RoundToEven(p0)))) },
{ M(() => Convert.ToByte((String) "0") ), N(() => L<String, Byte>((String p0) => Sql.ConvertTo<Byte>.From(p0))) },
{ M(() => Convert.ToByte((UInt16) 0) ), N(() => L<UInt16, Byte>((UInt16 p0) => Sql.ConvertTo<Byte>.From(p0))) },
{ M(() => Convert.ToByte((UInt32) 0) ), N(() => L<UInt32, Byte>((UInt32 p0) => Sql.ConvertTo<Byte>.From(p0))) },
{ M(() => Convert.ToByte((UInt64) 0) ), N(() => L<UInt64, Byte>((UInt64 p0) => Sql.ConvertTo<Byte>.From(p0))) },
#endregion
#region ToChar
#if !SILVERLIGHT && !NETSTANDARD
{ M(() => Convert.ToChar((Boolean)true)), N(() => L<Boolean, Char>((Boolean p0) => Sql.ConvertTo<Char>.From(p0))) },
#endif
{ M(() => Convert.ToChar((Byte) 0) ), N(() => L<Byte, Char>((Byte p0) => Sql.ConvertTo<Char>.From(p0))) },
#if !NETSTANDARD
{ M(() => Convert.ToChar((Char) '0') ), N(() => L<Char, Char>((Char p0) => p0 )) },
#if !SILVERLIGHT
{ M(() => Convert.ToChar(DateTime.Now) ), N(() => L<DateTime,Char>((DateTime p0) => Sql.ConvertTo<Char>.From(p0))) },
#endif
{ M(() => Convert.ToChar((Decimal) 0) ), N(() => L<Decimal, Char>((Decimal p0) => Sql.ConvertTo<Char>.From(Sql.RoundToEven(p0)))) },
{ M(() => Convert.ToChar((Double) 0) ), N(() => L<Double, Char>((Double p0) => Sql.ConvertTo<Char>.From(Sql.RoundToEven(p0)))) },
#endif
{ M(() => Convert.ToChar((Int16) 0) ), N(() => L<Int16, Char>((Int16 p0) => Sql.ConvertTo<Char>.From(p0))) },
{ M(() => Convert.ToChar((Int32) 0) ), N(() => L<Int32, Char>((Int32 p0) => Sql.ConvertTo<Char>.From(p0))) },
{ M(() => Convert.ToChar((Int64) 0) ), N(() => L<Int64, Char>((Int64 p0) => Sql.ConvertTo<Char>.From(p0))) },
{ M(() => Convert.ToChar((Object) 0) ), N(() => L<Object, Char>((Object p0) => Sql.ConvertTo<Char>.From(p0))) },
{ M(() => Convert.ToChar((SByte) 0) ), N(() => L<SByte, Char>((SByte p0) => Sql.ConvertTo<Char>.From(p0))) },
#if !NETSTANDARD
{ M(() => Convert.ToChar((Single) 0) ), N(() => L<Single, Char>((Single p0) => Sql.ConvertTo<Char>.From(Sql.RoundToEven(p0)))) },
#endif
{ M(() => Convert.ToChar((String) "0") ), N(() => L<String, Char>((String p0) => Sql.ConvertTo<Char>.From(p0))) },
{ M(() => Convert.ToChar((UInt16) 0) ), N(() => L<UInt16, Char>((UInt16 p0) => Sql.ConvertTo<Char>.From(p0))) },
{ M(() => Convert.ToChar((UInt32) 0) ), N(() => L<UInt32, Char>((UInt32 p0) => Sql.ConvertTo<Char>.From(p0))) },
{ M(() => Convert.ToChar((UInt64) 0) ), N(() => L<UInt64, Char>((UInt64 p0) => Sql.ConvertTo<Char>.From(p0))) },
#endregion
#region ToDateTime
{ M(() => Convert.ToDateTime((Object) 0) ), N(() => L<Object, DateTime>(p0 => Sql.ConvertTo<DateTime>.From(p0))) },
{ M(() => Convert.ToDateTime((String) "0") ), N(() => L<String, DateTime>(p0 => Sql.ConvertTo<DateTime>.From(p0))) },
#if !SILVERLIGHT && !NETSTANDARD
{ M(() => Convert.ToDateTime((Boolean)true)), N(() => L<Boolean, DateTime>(p0 => Sql.ConvertTo<DateTime>.From(p0))) },
{ M(() => Convert.ToDateTime((Byte) 0) ), N(() => L<Byte, DateTime>(p0 => Sql.ConvertTo<DateTime>.From(p0))) },
{ M(() => Convert.ToDateTime((Char) '0') ), N(() => L<Char, DateTime>(p0 => Sql.ConvertTo<DateTime>.From(p0))) },
{ M(() => Convert.ToDateTime(DateTime.Now) ), N(() => L<DateTime,DateTime>(p0 => p0 )) },
{ M(() => Convert.ToDateTime((Decimal) 0) ), N(() => L<Decimal, DateTime>(p0 => Sql.ConvertTo<DateTime>.From(p0))) },
{ M(() => Convert.ToDateTime((Double) 0) ), N(() => L<Double, DateTime>(p0 => Sql.ConvertTo<DateTime>.From(p0))) },
{ M(() => Convert.ToDateTime((Int16) 0) ), N(() => L<Int16, DateTime>(p0 => Sql.ConvertTo<DateTime>.From(p0))) },
{ M(() => Convert.ToDateTime((Int32) 0) ), N(() => L<Int32, DateTime>(p0 => Sql.ConvertTo<DateTime>.From(p0))) },
{ M(() => Convert.ToDateTime((Int64) 0) ), N(() => L<Int64, DateTime>(p0 => Sql.ConvertTo<DateTime>.From(p0))) },
{ M(() => Convert.ToDateTime((SByte) 0) ), N(() => L<SByte, DateTime>(p0 => Sql.ConvertTo<DateTime>.From(p0))) },
{ M(() => Convert.ToDateTime((Single) 0) ), N(() => L<Single, DateTime>(p0 => Sql.ConvertTo<DateTime>.From(p0))) },
{ M(() => Convert.ToDateTime((UInt16) 0) ), N(() => L<UInt16, DateTime>(p0 => Sql.ConvertTo<DateTime>.From(p0))) },
{ M(() => Convert.ToDateTime((UInt32) 0) ), N(() => L<UInt32, DateTime>(p0 => Sql.ConvertTo<DateTime>.From(p0))) },
{ M(() => Convert.ToDateTime((UInt64) 0) ), N(() => L<UInt64, DateTime>(p0 => Sql.ConvertTo<DateTime>.From(p0))) },
#endif
#endregion
#region ToDecimal
{ M(() => Convert.ToDecimal((Boolean)true)), N(() => L<Boolean, Decimal>(p0 => Sql.ConvertTo<Decimal>.From(p0))) },
{ M(() => Convert.ToDecimal((Byte) 0) ), N(() => L<Byte, Decimal>(p0 => Sql.ConvertTo<Decimal>.From(p0))) },
#if !NETSTANDARD
{ M(() => Convert.ToDecimal((Char) '0') ), N(() => L<Char, Decimal>(p0 => Sql.ConvertTo<Decimal>.From(p0))) },
{ M(() => Convert.ToDecimal(DateTime.Now) ), N(() => L<DateTime,Decimal>(p0 => Sql.ConvertTo<Decimal>.From(p0))) },
#endif
{ M(() => Convert.ToDecimal((Decimal) 0) ), N(() => L<Decimal, Decimal>(p0 => Sql.ConvertTo<Decimal>.From(p0))) },
{ M(() => Convert.ToDecimal((Double) 0) ), N(() => L<Double, Decimal>(p0 => Sql.ConvertTo<Decimal>.From(p0))) },
{ M(() => Convert.ToDecimal((Int16) 0) ), N(() => L<Int16, Decimal>(p0 => Sql.ConvertTo<Decimal>.From(p0))) },
{ M(() => Convert.ToDecimal((Int32) 0) ), N(() => L<Int32, Decimal>(p0 => Sql.ConvertTo<Decimal>.From(p0))) },
{ M(() => Convert.ToDecimal((Int64) 0) ), N(() => L<Int64, Decimal>(p0 => Sql.ConvertTo<Decimal>.From(p0))) },
{ M(() => Convert.ToDecimal((Object) 0) ), N(() => L<Object, Decimal>(p0 => Sql.ConvertTo<Decimal>.From(p0))) },
{ M(() => Convert.ToDecimal((SByte) 0) ), N(() => L<SByte, Decimal>(p0 => Sql.ConvertTo<Decimal>.From(p0))) },
{ M(() => Convert.ToDecimal((Single) 0) ), N(() => L<Single, Decimal>(p0 => Sql.ConvertTo<Decimal>.From(p0))) },
{ M(() => Convert.ToDecimal((String) "0") ), N(() => L<String, Decimal>(p0 => Sql.ConvertTo<Decimal>.From(p0))) },
{ M(() => Convert.ToDecimal((UInt16) 0) ), N(() => L<UInt16, Decimal>(p0 => Sql.ConvertTo<Decimal>.From(p0))) },
{ M(() => Convert.ToDecimal((UInt32) 0) ), N(() => L<UInt32, Decimal>(p0 => Sql.ConvertTo<Decimal>.From(p0))) },
{ M(() => Convert.ToDecimal((UInt64) 0) ), N(() => L<UInt64, Decimal>(p0 => Sql.ConvertTo<Decimal>.From(p0))) },
#endregion
#region ToDouble
{ M(() => Convert.ToDouble((Boolean)true)), N(() => L<Boolean, Double>(p0 => Sql.ConvertTo<Double>.From(p0))) },
{ M(() => Convert.ToDouble((Byte) 0) ), N(() => L<Byte, Double>(p0 => Sql.ConvertTo<Double>.From(p0))) },
#if !NETSTANDARD
{ M(() => Convert.ToDouble((Char) '0') ), N(() => L<Char, Double>(p0 => Sql.ConvertTo<Double>.From(p0))) },
#if !SILVERLIGHT
{ M(() => Convert.ToDouble(DateTime.Now) ), N(() => L<DateTime,Double>(p0 => Sql.ConvertTo<Double>.From(p0))) },
#endif
#endif
{ M(() => Convert.ToDouble((Decimal) 0) ), N(() => L<Decimal, Double>(p0 => Sql.ConvertTo<Double>.From(p0))) },
{ M(() => Convert.ToDouble((Double) 0) ), N(() => L<Double, Double>(p0 => Sql.ConvertTo<Double>.From(p0))) },
{ M(() => Convert.ToDouble((Int16) 0) ), N(() => L<Int16, Double>(p0 => Sql.ConvertTo<Double>.From(p0))) },
{ M(() => Convert.ToDouble((Int32) 0) ), N(() => L<Int32, Double>(p0 => Sql.ConvertTo<Double>.From(p0))) },
{ M(() => Convert.ToDouble((Int64) 0) ), N(() => L<Int64, Double>(p0 => Sql.ConvertTo<Double>.From(p0))) },
{ M(() => Convert.ToDouble((Object) 0) ), N(() => L<Object, Double>(p0 => Sql.ConvertTo<Double>.From(p0))) },
{ M(() => Convert.ToDouble((SByte) 0) ), N(() => L<SByte, Double>(p0 => Sql.ConvertTo<Double>.From(p0))) },
{ M(() => Convert.ToDouble((Single) 0) ), N(() => L<Single, Double>(p0 => Sql.ConvertTo<Double>.From(p0))) },
{ M(() => Convert.ToDouble((String) "0") ), N(() => L<String, Double>(p0 => Sql.ConvertTo<Double>.From(p0))) },
{ M(() => Convert.ToDouble((UInt16) 0) ), N(() => L<UInt16, Double>(p0 => Sql.ConvertTo<Double>.From(p0))) },
{ M(() => Convert.ToDouble((UInt32) 0) ), N(() => L<UInt32, Double>(p0 => Sql.ConvertTo<Double>.From(p0))) },
{ M(() => Convert.ToDouble((UInt64) 0) ), N(() => L<UInt64, Double>(p0 => Sql.ConvertTo<Double>.From(p0))) },
#endregion
#region ToInt64
{ M(() => Convert.ToInt64((Boolean)true)), N(() => L<Boolean, Int64>(p0 => Sql.ConvertTo<Int64>.From(p0))) },
{ M(() => Convert.ToInt64((Byte) 0) ), N(() => L<Byte, Int64>(p0 => Sql.ConvertTo<Int64>.From(p0))) },
#if !NETSTANDARD
{ M(() => Convert.ToInt64((Char) '0') ), N(() => L<Char, Int64>(p0 => Sql.ConvertTo<Int64>.From(p0))) },
#if !SILVERLIGHT
{ M(() => Convert.ToInt64(DateTime.Now) ), N(() => L<DateTime,Int64>(p0 => Sql.ConvertTo<Int64>.From(p0))) },
#endif
#endif
{ M(() => Convert.ToInt64((Decimal) 0) ), N(() => L<Decimal, Int64>(p0 => Sql.ConvertTo<Int64>.From(Sql.RoundToEven(p0)))) },
{ M(() => Convert.ToInt64((Double) 0) ), N(() => L<Double, Int64>(p0 => Sql.ConvertTo<Int64>.From(Sql.RoundToEven(p0)))) },
{ M(() => Convert.ToInt64((Int16) 0) ), N(() => L<Int16, Int64>(p0 => Sql.ConvertTo<Int64>.From(p0))) },
{ M(() => Convert.ToInt64((Int32) 0) ), N(() => L<Int32, Int64>(p0 => Sql.ConvertTo<Int64>.From(p0))) },
{ M(() => Convert.ToInt64((Int64) 0) ), N(() => L<Int64, Int64>(p0 => Sql.ConvertTo<Int64>.From(p0))) },
{ M(() => Convert.ToInt64((Object) 0) ), N(() => L<Object, Int64>(p0 => Sql.ConvertTo<Int64>.From(p0))) },
{ M(() => Convert.ToInt64((SByte) 0) ), N(() => L<SByte, Int64>(p0 => Sql.ConvertTo<Int64>.From(p0))) },
{ M(() => Convert.ToInt64((Single) 0) ), N(() => L<Single, Int64>(p0 => Sql.ConvertTo<Int64>.From(Sql.RoundToEven(p0)))) },
{ M(() => Convert.ToInt64((String) "0") ), N(() => L<String, Int64>(p0 => Sql.ConvertTo<Int64>.From(p0))) },
{ M(() => Convert.ToInt64((UInt16) 0) ), N(() => L<UInt16, Int64>(p0 => Sql.ConvertTo<Int64>.From(p0))) },
{ M(() => Convert.ToInt64((UInt32) 0) ), N(() => L<UInt32, Int64>(p0 => Sql.ConvertTo<Int64>.From(p0))) },
{ M(() => Convert.ToInt64((UInt64) 0) ), N(() => L<UInt64, Int64>(p0 => Sql.ConvertTo<Int64>.From(p0))) },
#endregion
#region ToInt32
{ M(() => Convert.ToInt32((Boolean)true)), N(() => L<Boolean, Int32>(p0 => Sql.ConvertTo<Int32>.From(p0))) },
{ M(() => Convert.ToInt32((Byte) 0) ), N(() => L<Byte, Int32>(p0 => Sql.ConvertTo<Int32>.From(p0))) },
#if !NETSTANDARD
{ M(() => Convert.ToInt32((Char) '0') ), N(() => L<Char, Int32>(p0 => Sql.ConvertTo<Int32>.From(p0))) },
#if !SILVERLIGHT
{ M(() => Convert.ToInt32(DateTime.Now) ), N(() => L<DateTime,Int32>(p0 => Sql.ConvertTo<Int32>.From(p0))) },
#endif
#endif
{ M(() => Convert.ToInt32((Decimal) 0) ), N(() => L<Decimal, Int32>(p0 => Sql.ConvertTo<Int32>.From(Sql.RoundToEven(p0)))) },
{ M(() => Convert.ToInt32((Double) 0) ), N(() => L<Double, Int32>(p0 => Sql.ConvertTo<Int32>.From(Sql.RoundToEven(p0)))) },
{ M(() => Convert.ToInt32((Int16) 0) ), N(() => L<Int16, Int32>(p0 => Sql.ConvertTo<Int32>.From(p0))) },
{ M(() => Convert.ToInt32((Int32) 0) ), N(() => L<Int32, Int32>(p0 => Sql.ConvertTo<Int32>.From(p0))) },
{ M(() => Convert.ToInt32((Int64) 0) ), N(() => L<Int64, Int32>(p0 => Sql.ConvertTo<Int32>.From(p0))) },
{ M(() => Convert.ToInt32((Object) 0) ), N(() => L<Object, Int32>(p0 => Sql.ConvertTo<Int32>.From(p0))) },
{ M(() => Convert.ToInt32((SByte) 0) ), N(() => L<SByte, Int32>(p0 => Sql.ConvertTo<Int32>.From(p0))) },
{ M(() => Convert.ToInt32((Single) 0) ), N(() => L<Single, Int32>(p0 => Sql.ConvertTo<Int32>.From(Sql.RoundToEven(p0)))) },
{ M(() => Convert.ToInt32((String) "0") ), N(() => L<String, Int32>(p0 => Sql.ConvertTo<Int32>.From(p0))) },
{ M(() => Convert.ToInt32((UInt16) 0) ), N(() => L<UInt16, Int32>(p0 => Sql.ConvertTo<Int32>.From(p0))) },
{ M(() => Convert.ToInt32((UInt32) 0) ), N(() => L<UInt32, Int32>(p0 => Sql.ConvertTo<Int32>.From(p0))) },
{ M(() => Convert.ToInt32((UInt64) 0) ), N(() => L<UInt64, Int32>(p0 => Sql.ConvertTo<Int32>.From(p0))) },
#endregion
#region ToInt16
{ M(() => Convert.ToInt16((Boolean)true)), N(() => L<Boolean, Int16>(p0 => Sql.ConvertTo<Int16>.From(p0))) },
{ M(() => Convert.ToInt16((Byte) 0) ), N(() => L<Byte, Int16>(p0 => Sql.ConvertTo<Int16>.From(p0))) },
#if !NETSTANDARD
{ M(() => Convert.ToInt16((Char) '0') ), N(() => L<Char, Int16>(p0 => Sql.ConvertTo<Int16>.From(p0))) },
#if !SILVERLIGHT
{ M(() => Convert.ToInt16(DateTime.Now) ), N(() => L<DateTime,Int16>(p0 => Sql.ConvertTo<Int16>.From(p0))) },
#endif
#endif
{ M(() => Convert.ToInt16((Decimal) 0) ), N(() => L<Decimal, Int16>(p0 => Sql.ConvertTo<Int16>.From(Sql.RoundToEven(p0)))) },
{ M(() => Convert.ToInt16((Double) 0) ), N(() => L<Double, Int16>(p0 => Sql.ConvertTo<Int16>.From(Sql.RoundToEven(p0)))) },
{ M(() => Convert.ToInt16((Int16) 0) ), N(() => L<Int16, Int16>(p0 => Sql.ConvertTo<Int16>.From(p0))) },
{ M(() => Convert.ToInt16((Int32) 0) ), N(() => L<Int32, Int16>(p0 => Sql.ConvertTo<Int16>.From(p0))) },
{ M(() => Convert.ToInt16((Int64) 0) ), N(() => L<Int64, Int16>(p0 => Sql.ConvertTo<Int16>.From(p0))) },
{ M(() => Convert.ToInt16((Object) 0) ), N(() => L<Object, Int16>(p0 => Sql.ConvertTo<Int16>.From(p0))) },
{ M(() => Convert.ToInt16((SByte) 0) ), N(() => L<SByte, Int16>(p0 => Sql.ConvertTo<Int16>.From(p0))) },
{ M(() => Convert.ToInt16((Single) 0) ), N(() => L<Single, Int16>(p0 => Sql.ConvertTo<Int16>.From(Sql.RoundToEven(p0)))) },
{ M(() => Convert.ToInt16((String) "0") ), N(() => L<String, Int16>(p0 => Sql.ConvertTo<Int16>.From(p0))) },
{ M(() => Convert.ToInt16((UInt16) 0) ), N(() => L<UInt16, Int16>(p0 => Sql.ConvertTo<Int16>.From(p0))) },
{ M(() => Convert.ToInt16((UInt32) 0) ), N(() => L<UInt32, Int16>(p0 => Sql.ConvertTo<Int16>.From(p0))) },
{ M(() => Convert.ToInt16((UInt64) 0) ), N(() => L<UInt64, Int16>(p0 => Sql.ConvertTo<Int16>.From(p0))) },
#endregion
#region ToSByte
{ M(() => Convert.ToSByte((Boolean)true)), N(() => L<Boolean, SByte>(p0 => Sql.ConvertTo<SByte>.From(p0))) },
{ M(() => Convert.ToSByte((Byte) 0) ), N(() => L<Byte, SByte>(p0 => Sql.ConvertTo<SByte>.From(p0))) },
#if !NETSTANDARD
{ M(() => Convert.ToSByte((Char) '0') ), N(() => L<Char, SByte>(p0 => Sql.ConvertTo<SByte>.From(p0))) },
#if !SILVERLIGHT
{ M(() => Convert.ToSByte(DateTime.Now) ), N(() => L<DateTime,SByte>(p0 => Sql.ConvertTo<SByte>.From(p0))) },
#endif
#endif
{ M(() => Convert.ToSByte((Decimal) 0) ), N(() => L<Decimal, SByte>(p0 => Sql.ConvertTo<SByte>.From(Sql.RoundToEven(p0)))) },
{ M(() => Convert.ToSByte((Double) 0) ), N(() => L<Double, SByte>(p0 => Sql.ConvertTo<SByte>.From(Sql.RoundToEven(p0)))) },
{ M(() => Convert.ToSByte((Int16) 0) ), N(() => L<Int16, SByte>(p0 => Sql.ConvertTo<SByte>.From(p0))) },
{ M(() => Convert.ToSByte((Int32) 0) ), N(() => L<Int32, SByte>(p0 => Sql.ConvertTo<SByte>.From(p0))) },
{ M(() => Convert.ToSByte((Int64) 0) ), N(() => L<Int64, SByte>(p0 => Sql.ConvertTo<SByte>.From(p0))) },
{ M(() => Convert.ToSByte((Object) 0) ), N(() => L<Object, SByte>(p0 => Sql.ConvertTo<SByte>.From(p0))) },
{ M(() => Convert.ToSByte((SByte) 0) ), N(() => L<SByte, SByte>(p0 => Sql.ConvertTo<SByte>.From(p0))) },
{ M(() => Convert.ToSByte((Single) 0) ), N(() => L<Single, SByte>(p0 => Sql.ConvertTo<SByte>.From(Sql.RoundToEven(p0)))) },
{ M(() => Convert.ToSByte((String) "0") ), N(() => L<String, SByte>(p0 => Sql.ConvertTo<SByte>.From(p0))) },
{ M(() => Convert.ToSByte((UInt16) 0) ), N(() => L<UInt16, SByte>(p0 => Sql.ConvertTo<SByte>.From(p0))) },
{ M(() => Convert.ToSByte((UInt32) 0) ), N(() => L<UInt32, SByte>(p0 => Sql.ConvertTo<SByte>.From(p0))) },
{ M(() => Convert.ToSByte((UInt64) 0) ), N(() => L<UInt64, SByte>(p0 => Sql.ConvertTo<SByte>.From(p0))) },
#endregion
#region ToSingle
{ M(() => Convert.ToSingle((Boolean)true)), N(() => L<Boolean, Single>(p0 => Sql.ConvertTo<Single>.From(p0))) },
{ M(() => Convert.ToSingle((Byte) 0) ), N(() => L<Byte, Single>(p0 => Sql.ConvertTo<Single>.From(p0))) },
#if !NETSTANDARD
{ M(() => Convert.ToSingle((Char) '0') ), N(() => L<Char, Single>(p0 => Sql.ConvertTo<Single>.From(p0))) },
#if !SILVERLIGHT
{ M(() => Convert.ToSingle(DateTime.Now) ), N(() => L<DateTime,Single>(p0 => Sql.ConvertTo<Single>.From(p0))) },
#endif
#endif
{ M(() => Convert.ToSingle((Decimal) 0) ), N(() => L<Decimal, Single>(p0 => Sql.ConvertTo<Single>.From(p0))) },
{ M(() => Convert.ToSingle((Double) 0) ), N(() => L<Double, Single>(p0 => Sql.ConvertTo<Single>.From(p0))) },
{ M(() => Convert.ToSingle((Int16) 0) ), N(() => L<Int16, Single>(p0 => Sql.ConvertTo<Single>.From(p0))) },
{ M(() => Convert.ToSingle((Int32) 0) ), N(() => L<Int32, Single>(p0 => Sql.ConvertTo<Single>.From(p0))) },
{ M(() => Convert.ToSingle((Int64) 0) ), N(() => L<Int64, Single>(p0 => Sql.ConvertTo<Single>.From(p0))) },
{ M(() => Convert.ToSingle((Object) 0) ), N(() => L<Object, Single>(p0 => Sql.ConvertTo<Single>.From(p0))) },
{ M(() => Convert.ToSingle((SByte) 0) ), N(() => L<SByte, Single>(p0 => Sql.ConvertTo<Single>.From(p0))) },
{ M(() => Convert.ToSingle((Single) 0) ), N(() => L<Single, Single>(p0 => Sql.ConvertTo<Single>.From(p0))) },
{ M(() => Convert.ToSingle((String) "0") ), N(() => L<String, Single>(p0 => Sql.ConvertTo<Single>.From(p0))) },
{ M(() => Convert.ToSingle((UInt16) 0) ), N(() => L<UInt16, Single>(p0 => Sql.ConvertTo<Single>.From(p0))) },
{ M(() => Convert.ToSingle((UInt32) 0) ), N(() => L<UInt32, Single>(p0 => Sql.ConvertTo<Single>.From(p0))) },
{ M(() => Convert.ToSingle((UInt64) 0) ), N(() => L<UInt64, Single>(p0 => Sql.ConvertTo<Single>.From(p0))) },
#endregion
#region ToString
{ M(() => Convert.ToString((Boolean)true)), N(() => L<Boolean, String>(p0 => Sql.ConvertTo<String>.From(p0))) },
{ M(() => Convert.ToString((Byte) 0) ), N(() => L<Byte, String>(p0 => Sql.ConvertTo<String>.From(p0))) },
{ M(() => Convert.ToString((Char) '0') ), N(() => L<Char, String>(p0 => Sql.ConvertTo<String>.From(p0))) },
{ M(() => Convert.ToString(DateTime.Now) ), N(() => L<DateTime,String>(p0 => Sql.ConvertTo<String>.From(p0))) },
{ M(() => Convert.ToString((Decimal) 0) ), N(() => L<Decimal, String>(p0 => Sql.ConvertTo<String>.From(p0))) },
{ M(() => Convert.ToString((Double) 0) ), N(() => L<Double, String>(p0 => Sql.ConvertTo<String>.From(p0))) },
{ M(() => Convert.ToString((Int16) 0) ), N(() => L<Int16, String>(p0 => Sql.ConvertTo<String>.From(p0))) },
{ M(() => Convert.ToString((Int32) 0) ), N(() => L<Int32, String>(p0 => Sql.ConvertTo<String>.From(p0))) },
{ M(() => Convert.ToString((Int64) 0) ), N(() => L<Int64, String>(p0 => Sql.ConvertTo<String>.From(p0))) },
{ M(() => Convert.ToString((Object) 0) ), N(() => L<Object, String>(p0 => Sql.ConvertTo<String>.From(p0))) },
{ M(() => Convert.ToString((SByte) 0) ), N(() => L<SByte, String>(p0 => Sql.ConvertTo<String>.From(p0))) },
{ M(() => Convert.ToString((Single) 0) ), N(() => L<Single, String>(p0 => Sql.ConvertTo<String>.From(p0))) },
#if !SILVERLIGHT && !NETSTANDARD
{ M(() => Convert.ToString((String) "0") ), N(() => L<String, String>(p0 => p0 )) },
#endif
{ M(() => Convert.ToString((UInt16) 0) ), N(() => L<UInt16, String>(p0 => Sql.ConvertTo<String>.From(p0))) },
{ M(() => Convert.ToString((UInt32) 0) ), N(() => L<UInt32, String>(p0 => Sql.ConvertTo<String>.From(p0))) },
{ M(() => Convert.ToString((UInt64) 0) ), N(() => L<UInt64, String>(p0 => Sql.ConvertTo<String>.From(p0))) },
#endregion
#region ToUInt16
{ M(() => Convert.ToUInt16((Boolean)true)), N(() => L<Boolean, UInt16>(p0 => Sql.ConvertTo<UInt16>.From(p0))) },
{ M(() => Convert.ToUInt16((Byte) 0) ), N(() => L<Byte, UInt16>(p0 => Sql.ConvertTo<UInt16>.From(p0))) },
{ M(() => Convert.ToUInt16((Char) '0') ), N(() => L<Char, UInt16>(p0 => Sql.ConvertTo<UInt16>.From(p0))) },
#if !SILVERLIGHT && !NETSTANDARD
{ M(() => Convert.ToUInt16(DateTime.Now) ), N(() => L<DateTime,UInt16>(p0 => Sql.ConvertTo<UInt16>.From(p0))) },
#endif
{ M(() => Convert.ToUInt16((Decimal) 0) ), N(() => L<Decimal, UInt16>(p0 => Sql.ConvertTo<UInt16>.From(Sql.RoundToEven(p0)))) },
{ M(() => Convert.ToUInt16((Double) 0) ), N(() => L<Double, UInt16>(p0 => Sql.ConvertTo<UInt16>.From(Sql.RoundToEven(p0)))) },
{ M(() => Convert.ToUInt16((Int16) 0) ), N(() => L<Int16, UInt16>(p0 => Sql.ConvertTo<UInt16>.From(p0))) },
{ M(() => Convert.ToUInt16((Int32) 0) ), N(() => L<Int32, UInt16>(p0 => Sql.ConvertTo<UInt16>.From(p0))) },
{ M(() => Convert.ToUInt16((Int64) 0) ), N(() => L<Int64, UInt16>(p0 => Sql.ConvertTo<UInt16>.From(p0))) },
{ M(() => Convert.ToUInt16((Object) 0) ), N(() => L<Object, UInt16>(p0 => Sql.ConvertTo<UInt16>.From(p0))) },
{ M(() => Convert.ToUInt16((SByte) 0) ), N(() => L<SByte, UInt16>(p0 => Sql.ConvertTo<UInt16>.From(p0))) },
{ M(() => Convert.ToUInt16((Single) 0) ), N(() => L<Single, UInt16>(p0 => Sql.ConvertTo<UInt16>.From(Sql.RoundToEven(p0)))) },
{ M(() => Convert.ToUInt16((String) "0") ), N(() => L<String, UInt16>(p0 => Sql.ConvertTo<UInt16>.From(p0)) ) },
{ M(() => Convert.ToUInt16((UInt16) 0) ), N(() => L<UInt16, UInt16>(p0 => Sql.ConvertTo<UInt16>.From(p0)) ) },
{ M(() => Convert.ToUInt16((UInt32) 0) ), N(() => L<UInt32, UInt16>(p0 => Sql.ConvertTo<UInt16>.From(p0)) ) },
{ M(() => Convert.ToUInt16((UInt64) 0) ), N(() => L<UInt64, UInt16>(p0 => Sql.ConvertTo<UInt16>.From(p0)) ) },
#endregion
#region ToUInt32
{ M(() => Convert.ToUInt32((Boolean)true)), N(() => L<Boolean, UInt32>(p0 => Sql.ConvertTo<UInt32>.From(p0))) },
{ M(() => Convert.ToUInt32((Byte) 0) ), N(() => L<Byte, UInt32>(p0 => Sql.ConvertTo<UInt32>.From(p0))) },
{ M(() => Convert.ToUInt32((Char) '0') ), N(() => L<Char, UInt32>(p0 => Sql.ConvertTo<UInt32>.From(p0))) },
#if !SILVERLIGHT && !NETSTANDARD
{ M(() => Convert.ToUInt32(DateTime.Now) ), N(() => L<DateTime,UInt32>(p0 => Sql.ConvertTo<UInt32>.From(p0))) },
#endif
{ M(() => Convert.ToUInt32((Decimal) 0) ), N(() => L<Decimal, UInt32>(p0 => Sql.ConvertTo<UInt32>.From(Sql.RoundToEven(p0)))) },
{ M(() => Convert.ToUInt32((Double) 0) ), N(() => L<Double, UInt32>(p0 => Sql.ConvertTo<UInt32>.From(Sql.RoundToEven(p0)))) },
{ M(() => Convert.ToUInt32((Int16) 0) ), N(() => L<Int16, UInt32>(p0 => Sql.ConvertTo<UInt32>.From(p0))) },
{ M(() => Convert.ToUInt32((Int32) 0) ), N(() => L<Int32, UInt32>(p0 => Sql.ConvertTo<UInt32>.From(p0))) },
{ M(() => Convert.ToUInt32((Int64) 0) ), N(() => L<Int64, UInt32>(p0 => Sql.ConvertTo<UInt32>.From(p0))) },
{ M(() => Convert.ToUInt32((Object) 0) ), N(() => L<Object, UInt32>(p0 => Sql.ConvertTo<UInt32>.From(p0))) },
{ M(() => Convert.ToUInt32((SByte) 0) ), N(() => L<SByte, UInt32>(p0 => Sql.ConvertTo<UInt32>.From(p0))) },
{ M(() => Convert.ToUInt32((Single) 0) ), N(() => L<Single, UInt32>(p0 => Sql.ConvertTo<UInt32>.From(Sql.RoundToEven(p0)))) },
{ M(() => Convert.ToUInt32((String) "0") ), N(() => L<String, UInt32>(p0 => Sql.ConvertTo<UInt32>.From(p0))) },
{ M(() => Convert.ToUInt32((UInt16) 0) ), N(() => L<UInt16, UInt32>(p0 => Sql.ConvertTo<UInt32>.From(p0))) },
{ M(() => Convert.ToUInt32((UInt32) 0) ), N(() => L<UInt32, UInt32>(p0 => Sql.ConvertTo<UInt32>.From(p0))) },
{ M(() => Convert.ToUInt32((UInt64) 0) ), N(() => L<UInt64, UInt32>(p0 => Sql.ConvertTo<UInt32>.From(p0))) },
#endregion
#region ToUInt64
{ M(() => Convert.ToUInt64((Boolean)true)), N(() => L<Boolean, UInt64>(p0 => Sql.ConvertTo<UInt64>.From(p0))) },
{ M(() => Convert.ToUInt64((Byte) 0) ), N(() => L<Byte, UInt64>(p0 => Sql.ConvertTo<UInt64>.From(p0))) },
{ M(() => Convert.ToUInt64((Char) '0') ), N(() => L<Char, UInt64>(p0 => Sql.ConvertTo<UInt64>.From(p0))) },
#if !SILVERLIGHT && !NETSTANDARD
{ M(() => Convert.ToUInt64(DateTime.Now) ), N(() => L<DateTime,UInt64>(p0 => Sql.ConvertTo<UInt64>.From(p0))) },
#endif
{ M(() => Convert.ToUInt64((Decimal) 0) ), N(() => L<Decimal, UInt64>(p0 => Sql.ConvertTo<UInt64>.From(Sql.RoundToEven(p0)))) },
{ M(() => Convert.ToUInt64((Double) 0) ), N(() => L<Double, UInt64>(p0 => Sql.ConvertTo<UInt64>.From(Sql.RoundToEven(p0)))) },
{ M(() => Convert.ToUInt64((Int16) 0) ), N(() => L<Int16, UInt64>(p0 => Sql.ConvertTo<UInt64>.From(p0))) },
{ M(() => Convert.ToUInt64((Int32) 0) ), N(() => L<Int32, UInt64>(p0 => Sql.ConvertTo<UInt64>.From(p0))) },
{ M(() => Convert.ToUInt64((Int64) 0) ), N(() => L<Int64, UInt64>(p0 => Sql.ConvertTo<UInt64>.From(p0))) },
{ M(() => Convert.ToUInt64((Object) 0) ), N(() => L<Object, UInt64>(p0 => Sql.ConvertTo<UInt64>.From(p0))) },
{ M(() => Convert.ToUInt64((SByte) 0) ), N(() => L<SByte, UInt64>(p0 => Sql.ConvertTo<UInt64>.From(p0))) },
{ M(() => Convert.ToUInt64((Single) 0) ), N(() => L<Single, UInt64>(p0 => Sql.ConvertTo<UInt64>.From(Sql.RoundToEven(p0)))) },
{ M(() => Convert.ToUInt64((String) "0") ), N(() => L<String, UInt64>(p0 => Sql.ConvertTo<UInt64>.From(p0))) },
{ M(() => Convert.ToUInt64((UInt16) 0) ), N(() => L<UInt16, UInt64>(p0 => Sql.ConvertTo<UInt64>.From(p0))) },
{ M(() => Convert.ToUInt64((UInt32) 0) ), N(() => L<UInt32, UInt64>(p0 => Sql.ConvertTo<UInt64>.From(p0))) },
{ M(() => Convert.ToUInt64((UInt64) 0) ), N(() => L<UInt64, UInt64>(p0 => Sql.ConvertTo<UInt64>.From(p0))) },
#endregion
#endregion
#region Math
{ M(() => Math.Abs ((Decimal)0)), N(() => L<Decimal,Decimal>((Decimal p) => Sql.Abs(p).Value )) },
{ M(() => Math.Abs ((Double) 0)), N(() => L<Double, Double> ((Double p) => Sql.Abs(p).Value )) },
{ M(() => Math.Abs ((Int16) 0)), N(() => L<Int16, Int16> ((Int16 p) => Sql.Abs(p).Value )) },
{ M(() => Math.Abs ((Int32) 0)), N(() => L<Int32, Int32> ((Int32 p) => Sql.Abs(p).Value )) },
{ M(() => Math.Abs ((Int64) 0)), N(() => L<Int64, Int64> ((Int64 p) => Sql.Abs(p).Value )) },
{ M(() => Math.Abs ((SByte) 0)), N(() => L<SByte, SByte> ((SByte p) => Sql.Abs(p).Value )) },
{ M(() => Math.Abs ((Single) 0)), N(() => L<Single, Single> ((Single p) => Sql.Abs(p).Value )) },
{ M(() => Math.Acos (0) ), N(() => L<Double,Double> ((Double p) => Sql.Acos (p) .Value )) },
{ M(() => Math.Asin (0) ), N(() => L<Double,Double> ((Double p) => Sql.Asin (p) .Value )) },
{ M(() => Math.Atan (0) ), N(() => L<Double,Double> ((Double p) => Sql.Atan (p) .Value )) },
{ M(() => Math.Atan2 (0,0) ), N(() => L<Double,Double,Double>((Double x,Double y) => Sql.Atan2 (x, y).Value )) },
#if !SILVERLIGHT
{ M(() => Math.Ceiling((Decimal)0)), N(() => L<Decimal,Decimal> ((Decimal p) => Sql.Ceiling(p) .Value )) },
#endif
{ M(() => Math.Ceiling((Double)0)), N(() => L<Double,Double> ((Double p) => Sql.Ceiling(p) .Value )) },
{ M(() => Math.Cos (0)), N(() => L<Double,Double> ((Double p) => Sql.Cos (p) .Value )) },
{ M(() => Math.Cosh (0)), N(() => L<Double,Double> ((Double p) => Sql.Cosh (p) .Value )) },
{ M(() => Math.Exp (0)), N(() => L<Double,Double> ((Double p) => Sql.Exp (p) .Value )) },
#if !SILVERLIGHT
{ M(() => Math.Floor ((Decimal)0)), N(() => L<Decimal,Decimal>((Decimal p) => Sql.Floor (p) .Value )) },
#endif
{ M(() => Math.Floor ((Double)0)), N(() => L<Double,Double> ((Double p) => Sql.Floor (p) .Value )) },
{ M(() => Math.Log (0)), N(() => L<Double,Double> ((Double p) => Sql.Log (p) .Value )) },
{ M(() => Math.Log (0,0)), N(() => L<Double,Double,Double>((Double m,Double n) => Sql.Log (n, m).Value )) },
{ M(() => Math.Log10 (0)), N(() => L<Double,Double> ((Double p) => Sql.Log10 (p) .Value )) },
{ M(() => Math.Max((Byte) 0, (Byte) 0)), N(() => L<Byte, Byte, Byte> ((v1,v2) => v1 > v2 ? v1 : v2)) },
{ M(() => Math.Max((Decimal)0, (Decimal)0)), N(() => L<Decimal,Decimal,Decimal>((v1,v2) => v1 > v2 ? v1 : v2)) },
{ M(() => Math.Max((Double) 0, (Double) 0)), N(() => L<Double, Double, Double> ((v1,v2) => v1 > v2 ? v1 : v2)) },
{ M(() => Math.Max((Int16) 0, (Int16) 0)), N(() => L<Int16, Int16, Int16> ((v1,v2) => v1 > v2 ? v1 : v2)) },
{ M(() => Math.Max((Int32) 0, (Int32) 0)), N(() => L<Int32, Int32, Int32> ((v1,v2) => v1 > v2 ? v1 : v2)) },
{ M(() => Math.Max((Int64) 0, (Int64) 0)), N(() => L<Int64, Int64, Int64> ((v1,v2) => v1 > v2 ? v1 : v2)) },
{ M(() => Math.Max((SByte) 0, (SByte) 0)), N(() => L<SByte, SByte, SByte> ((v1,v2) => v1 > v2 ? v1 : v2)) },
{ M(() => Math.Max((Single) 0, (Single) 0)), N(() => L<Single, Single, Single> ((v1,v2) => v1 > v2 ? v1 : v2)) },
{ M(() => Math.Max((UInt16) 0, (UInt16) 0)), N(() => L<UInt16, UInt16, UInt16> ((v1,v2) => v1 > v2 ? v1 : v2)) },
{ M(() => Math.Max((UInt32) 0, (UInt32) 0)), N(() => L<UInt32, UInt32, UInt32> ((v1,v2) => v1 > v2 ? v1 : v2)) },
{ M(() => Math.Max((UInt64) 0, (UInt64) 0)), N(() => L<UInt64, UInt64, UInt64> ((v1,v2) => v1 > v2 ? v1 : v2)) },
{ M(() => Math.Min((Byte) 0, (Byte) 0)), N(() => L<Byte, Byte, Byte> ((v1,v2) => v1 < v2 ? v1 : v2)) },
{ M(() => Math.Min((Decimal)0, (Decimal)0)), N(() => L<Decimal,Decimal,Decimal>((v1,v2) => v1 < v2 ? v1 : v2)) },
{ M(() => Math.Min((Double) 0, (Double) 0)), N(() => L<Double, Double, Double> ((v1,v2) => v1 < v2 ? v1 : v2)) },
{ M(() => Math.Min((Int16) 0, (Int16) 0)), N(() => L<Int16, Int16, Int16> ((v1,v2) => v1 < v2 ? v1 : v2)) },
{ M(() => Math.Min((Int32) 0, (Int32) 0)), N(() => L<Int32, Int32, Int32> ((v1,v2) => v1 < v2 ? v1 : v2)) },
{ M(() => Math.Min((Int64) 0, (Int64) 0)), N(() => L<Int64, Int64, Int64> ((v1,v2) => v1 < v2 ? v1 : v2)) },
{ M(() => Math.Min((SByte) 0, (SByte) 0)), N(() => L<SByte, SByte, SByte> ((v1,v2) => v1 < v2 ? v1 : v2)) },
{ M(() => Math.Min((Single) 0, (Single) 0)), N(() => L<Single, Single, Single> ((v1,v2) => v1 < v2 ? v1 : v2)) },
{ M(() => Math.Min((UInt16) 0, (UInt16) 0)), N(() => L<UInt16, UInt16, UInt16> ((v1,v2) => v1 < v2 ? v1 : v2)) },
{ M(() => Math.Min((UInt32) 0, (UInt32) 0)), N(() => L<UInt32, UInt32, UInt32> ((v1,v2) => v1 < v2 ? v1 : v2)) },
{ M(() => Math.Min((UInt64) 0, (UInt64) 0)), N(() => L<UInt64, UInt64, UInt64> ((v1,v2) => v1 < v2 ? v1 : v2)) },
{ M(() => Math.Pow (0,0) ), N(() => L<Double,Double,Double> ((Double x,Double y) => Sql.Power(x, y).Value )) },
{ M(() => Sql.Round (0m) ), N(() => L<Decimal?,Decimal?> ((Decimal? d) => Sql.Round(d, 0))) },
{ M(() => Sql.Round (0.0) ), N(() => L<Double?, Double?> ((Double? d) => Sql.Round(d, 0))) },
{ M(() => Sql.RoundToEven(0m) ), N(() => L<Decimal?,Decimal?> ((Decimal? d) => d - Sql.Floor(d) == 0.5m && Sql.Floor(d) % 2 == 0? Sql.Floor(d) : Sql.Round(d))) },
{ M(() => Sql.RoundToEven(0.0) ), N(() => L<Double?, Double?> ((Double? d) => d - Sql.Floor(d) == 0.5 && Sql.Floor(d) % 2 == 0? Sql.Floor(d) : Sql.Round(d))) },
{ M(() => Sql.RoundToEven(0m, 0)), N(() => L<Decimal?,Int32?,Decimal?>((Decimal? d,Int32? n) => d * 2 == Sql.Round(d * 2, n) && d != Sql.Round(d, n) ? Sql.Round(d / 2, n) * 2 : Sql.Round(d, n))) },
{ M(() => Sql.RoundToEven(0.0,0)), N(() => L<Double?, Int32?,Double?> ((Double? d,Int32? n) => d * 2 == Sql.Round(d * 2, n) && d != Sql.Round(d, n) ? Sql.Round(d / 2, n) * 2 : Sql.Round(d, n))) },
{ M(() => Math.Round (0m) ), N(() => L<Decimal,Decimal> ( d => Sql.RoundToEven(d).Value )) },
{ M(() => Math.Round (0.0) ), N(() => L<Double, Double> ( d => Sql.RoundToEven(d).Value )) },
{ M(() => Math.Round (0m, 0)), N(() => L<Decimal,Int32,Decimal> ((d,n) => Sql.RoundToEven(d, n).Value )) },
{ M(() => Math.Round (0.0,0)), N(() => L<Double, Int32,Double> ((d,n) => Sql.RoundToEven(d, n).Value )) },
#if !SILVERLIGHT
{ M(() => Math.Round (0m, MidpointRounding.ToEven)), N(() => L<Decimal,MidpointRounding,Decimal> ((d, p) => p == MidpointRounding.ToEven ? Sql.RoundToEven(d). Value : Sql.Round(d). Value )) },
{ M(() => Math.Round (0.0, MidpointRounding.ToEven)), N(() => L<Double, MidpointRounding,Double> ((d, p) => p == MidpointRounding.ToEven ? Sql.RoundToEven(d). Value : Sql.Round(d). Value )) },
{ M(() => Math.Round (0m, 0, MidpointRounding.ToEven)), N(() => L<Decimal,Int32,MidpointRounding,Decimal>((d,n,p) => p == MidpointRounding.ToEven ? Sql.RoundToEven(d,n).Value : Sql.Round(d,n).Value )) },
{ M(() => Math.Round (0.0,0, MidpointRounding.ToEven)), N(() => L<Double, Int32,MidpointRounding,Double> ((d,n,p) => p == MidpointRounding.ToEven ? Sql.RoundToEven(d,n).Value : Sql.Round(d,n).Value )) },
#endif
{ M(() => Math.Sign ((Decimal)0)), N(() => L<Decimal,Int32>(p => Sql.Sign(p).Value )) },
{ M(() => Math.Sign ((Double) 0)), N(() => L<Double, Int32>(p => Sql.Sign(p).Value )) },
{ M(() => Math.Sign ((Int16) 0)), N(() => L<Int16, Int32>(p => Sql.Sign(p).Value )) },
{ M(() => Math.Sign ((Int32) 0)), N(() => L<Int32, Int32>(p => Sql.Sign(p).Value )) },
{ M(() => Math.Sign ((Int64) 0)), N(() => L<Int64, Int32>(p => Sql.Sign(p).Value )) },
{ M(() => Math.Sign ((SByte) 0)), N(() => L<SByte, Int32>(p => Sql.Sign(p).Value )) },
{ M(() => Math.Sign ((Single) 0)), N(() => L<Single, Int32>(p => Sql.Sign(p).Value )) },
{ M(() => Math.Sin (0)), N(() => L<Double,Double>((Double p) => Sql.Sin (p).Value )) },
{ M(() => Math.Sinh (0)), N(() => L<Double,Double>((Double p) => Sql.Sinh(p).Value )) },
{ M(() => Math.Sqrt (0)), N(() => L<Double,Double>((Double p) => Sql.Sqrt(p).Value )) },
{ M(() => Math.Tan (0)), N(() => L<Double,Double>((Double p) => Sql.Tan (p).Value )) },
{ M(() => Math.Tanh (0)), N(() => L<Double,Double>((Double p) => Sql.Tanh(p).Value )) },
#if !SILVERLIGHT
{ M(() => Math.Truncate(0m)), N(() => L<Decimal,Decimal>((Decimal p) => Sql.Truncate(p).Value )) },
{ M(() => Math.Truncate(0.0)), N(() => L<Double,Double> ((Double p) => Sql.Truncate(p).Value )) },
#endif
#endregion
#region Visual Basic Compiler Services
//#if !SILVERLIGHT
// { M(() => Operators.CompareString("","",false)), L<S,S,B,I>((s1,s2,b) => b ? string.CompareOrdinal(s1.ToUpper(), s2.ToUpper()) : string.CompareOrdinal(s1, s2)) },
//#endif
#endregion
#region SqlTypes
#if !SILVERLIGHT && !NETFX_CORE
{ M(() => new SqlBoolean().Value), N(() => L<SqlBoolean,bool>((SqlBoolean obj) => (bool)obj)) },
{ M(() => new SqlBoolean().IsFalse), N(() => L<SqlBoolean,bool>((SqlBoolean obj) => (bool)obj == false)) },
{ M(() => new SqlBoolean().IsTrue), N(() => L<SqlBoolean,bool>((SqlBoolean obj) => (bool)obj == true)) },
{ M(() => SqlBoolean.True), N(() => L<bool> (() => true)) },
{ M(() => SqlBoolean.False), N(() => L<bool> (() => false)) },
#endif
#endregion
}},
#region SqlServer
{ ProviderName.SqlServer, new Dictionary<MemberInfo,IExpressionInfo> {
{ M(() => Sql.PadRight("",0,' ') ), N(() => L<String,Int32?,Char,String> ((String p0,Int32? p1,Char p2) => p0.Length > p1 ? p0 : p0 + Replicate(p2, p1 - p0.Length))) },
{ M(() => Sql.PadLeft ("",0,' ') ), N(() => L<String,Int32?,Char,String> ((String p0,Int32? p1,Char p2) => p0.Length > p1 ? p0 : Replicate(p2, p1 - p0.Length) + p0)) },
{ M(() => Sql.Trim ("") ), N(() => L<String,String> ((String p0) => Sql.TrimLeft(Sql.TrimRight(p0)))) },
{ M(() => Sql.MakeDateTime(0,0,0)), N(() => L<Int32?,Int32?,Int32?,DateTime?>((Int32? y,Int32? m,Int32? d) => DateAdd(Sql.DateParts.Month, (y.Value - 1900) * 12 + m.Value - 1, d.Value - 1))) },
{ M(() => Sql.Cosh(0) ), N(() => L<Double?,Double?> ( v => (Sql.Exp(v) + Sql.Exp(-v)) / 2)) },
{ M(() => Sql.Log(0m, 0) ), N(() => L<Decimal?,Decimal?,Decimal?> ((m,n) => Sql.Log(n) / Sql.Log(m))) },
{ M(() => Sql.Log(0.0,0) ), N(() => L<Double?,Double?,Double?> ((m,n) => Sql.Log(n) / Sql.Log(m))) },
{ M(() => Sql.Sinh(0) ), N(() => L<Double?,Double?> ( v => (Sql.Exp(v) - Sql.Exp(-v)) / 2)) },
{ M(() => Sql.Tanh(0) ), N(() => L<Double?,Double?> ( v => (Sql.Exp(v) - Sql.Exp(-v)) / (Sql.Exp(v) + Sql.Exp(-v)))) },
}},
#endregion
#region SqlServer2000
{ ProviderName.SqlServer2000, new Dictionary<MemberInfo,IExpressionInfo> {
{ M(() => Sql.MakeDateTime(0, 0, 0, 0, 0, 0) ), N(() => L<Int32?,Int32?,Int32?,Int32?,Int32?,Int32?,DateTime?>((y,m,d,h,mm,s) => Sql.Convert(Sql.DateTime2,
y.ToString() + "-" + m.ToString() + "-" + d.ToString() + " " +
h.ToString() + ":" + mm.ToString() + ":" + s.ToString(), 120))) },
{ M(() => DateTime.Parse("")), N(() => L<String,DateTime>(p0 => Sql.ConvertTo<DateTime>.From(p0) )) },
{ M(() => Sql.RoundToEven(0m) ), N(() => L<Decimal?,Decimal?>((Decimal? d) => d - Sql.Floor(d) == 0.5m && (long)Sql.Floor(d) % 2 == 0? Sql.Floor(d) : Sql.Round(d))) },
{ M(() => Sql.RoundToEven(0.0)), N(() => L<Double?, Double?> ((Double? d) => d - Sql.Floor(d) == 0.5 && (long)Sql.Floor(d) % 2 == 0? Sql.Floor(d) : Sql.Round(d))) },
}},
#endregion
#region SqlServer2005
{ ProviderName.SqlServer2005, new Dictionary<MemberInfo,IExpressionInfo> {
{ M(() => Sql.MakeDateTime(0, 0, 0, 0, 0, 0) ), N(() => L<Int32?,Int32?,Int32?,Int32?,Int32?,Int32?,DateTime?>((y,m,d,h,mm,s) => Sql.Convert(Sql.DateTime2,
y.ToString() + "-" + m.ToString() + "-" + d.ToString() + " " +
h.ToString() + ":" + mm.ToString() + ":" + s.ToString(), 120))) },
{ M(() => DateTime.Parse("")), N(() => L<String,DateTime>(p0 => Sql.ConvertTo<DateTime>.From(p0) )) },
}},
#endregion
#region SqlCe
{ ProviderName.SqlCe, new Dictionary<MemberInfo,IExpressionInfo> {
{ M(() => Sql.Left ("",0) ), N(() => L<String,Int32?,String> ((String p0,Int32? p1) => Sql.Substring(p0, 1, p1))) },
{ M(() => Sql.Right ("",0) ), N(() => L<String,Int32?,String> ((String p0,Int32? p1) => Sql.Substring(p0, p0.Length - p1 + 1, p1))) },
{ M(() => Sql.PadRight("",0,' ')), N(() => L<String,Int32?,Char?,String>((String p0,Int32? p1,Char? p2) => p0.Length > p1 ? p0 : p0 + Replicate(p2, p1 - p0.Length))) },
{ M(() => Sql.PadLeft ("",0,' ')), N(() => L<String,Int32?,Char?,String>((String p0,Int32? p1,Char? p2) => p0.Length > p1 ? p0 : Replicate(p2, p1 - p0.Length) + p0)) },
{ M(() => Sql.Trim ("") ), N(() => L<String,String> ((String p0) => Sql.TrimLeft(Sql.TrimRight(p0)))) },
{ M(() => Sql.Cosh(0) ), N(() => L<Double?,Double?> ( v => (Sql.Exp(v) + Sql.Exp(-v)) / 2)) },
{ M(() => Sql.Log (0m, 0)), N(() => L<Decimal?,Decimal?,Decimal?>((m,n) => Sql.Log(n) / Sql.Log(m))) },
{ M(() => Sql.Log (0.0,0)), N(() => L<Double?,Double?,Double?>((m,n) => Sql.Log(n) / Sql.Log(m))) },
{ M(() => Sql.Sinh(0) ), N(() => L<Double?,Double?> ( v => (Sql.Exp(v) - Sql.Exp(-v)) / 2)) },
{ M(() => Sql.Tanh(0) ), N(() => L<Double?,Double?> ( v => (Sql.Exp(v) - Sql.Exp(-v)) / (Sql.Exp(v) + Sql.Exp(-v)))) },
}},
#endregion
#region DB2
{ ProviderName.DB2, new Dictionary<MemberInfo,IExpressionInfo> {
{ M(() => Sql.Space (0) ), N(() => L<Int32?,String> ( p0 => Sql.Convert(Sql.VarChar(1000), Replicate(" ", p0)))) },
{ M(() => Sql.Stuff ("",0,0,"")), N(() => L<String,Int32?,Int32?,String,String>((p0,p1,p2,p3) => AltStuff(p0, p1, p2, p3))) },
{ M(() => Sql.PadRight("",0,' ') ), N(() => L<String,Int32?,Char?,String> ((p0,p1,p2) => p0.Length > p1 ? p0 : p0 + VarChar(Replicate(p2, p1 - p0.Length), 1000))) },
{ M(() => Sql.PadLeft ("",0,' ') ), N(() => L<String,Int32?,Char?,String> ((p0,p1,p2) => p0.Length > p1 ? p0 : VarChar(Replicate(p2, p1 - p0.Length), 1000) + p0)) },
{ M(() => Sql.ConvertTo<String>.From((Decimal)0)), N(() => L<Decimal,String>((Decimal p) => Sql.TrimLeft(Sql.Convert<string,Decimal>(p), '0'))) },
{ M(() => Sql.ConvertTo<String>.From(Guid.Empty)), N(() => L<Guid, String>((Guid p) => Sql.Lower(
Sql.Substring(Hex(p), 7, 2) + Sql.Substring(Hex(p), 5, 2) + Sql.Substring(Hex(p), 3, 2) + Sql.Substring(Hex(p), 1, 2) + "-" +
Sql.Substring(Hex(p), 11, 2) + Sql.Substring(Hex(p), 9, 2) + "-" +
Sql.Substring(Hex(p), 15, 2) + Sql.Substring(Hex(p), 13, 2) + "-" +
Sql.Substring(Hex(p), 17, 4) + "-" +
Sql.Substring(Hex(p), 21, 12)))) },
{ M(() => Sql.Log(0m, 0)), N(() => L<Decimal?,Decimal?,Decimal?>((m,n) => Sql.Log(n) / Sql.Log(m))) },
{ M(() => Sql.Log(0.0,0)), N(() => L<Double?,Double?,Double?> ((m,n) => Sql.Log(n) / Sql.Log(m))) },
}},
#endregion
#region Informix
{ ProviderName.Informix, new Dictionary<MemberInfo,IExpressionInfo> {
{ M(() => Sql.Left ("",0) ), N(() => L<String,Int32?,String> ((String p0,Int32? p1) => Sql.Substring(p0, 1, p1))) },
{ M(() => Sql.Right("",0) ), N(() => L<String,Int32?,String> ((String p0,Int32? p1) => Sql.Substring(p0, p0.Length - p1 + 1, p1))) },
{ M(() => Sql.Stuff("",0,0,"")), N(() => L<String,Int32?,Int32?,String,String>((String p0,Int32? p1,Int32? p2,String p3) => AltStuff (p0, p1, p2, p3))) },
{ M(() => Sql.Space(0) ), N(() => L<Int32?,String> ((Int32? p0) => Sql.PadRight (" ", p0, ' '))) },
{ M(() => Sql.MakeDateTime(0,0,0)), N(() => L<Int32?,Int32?,Int32?,DateTime?>((y,m,d) => Mdy(m, d, y))) },
{ M(() => Sql.Cot (0) ), N(() => L<Double?,Double?> ( v => Sql.Cos(v) / Sql.Sin(v) )) },
{ M(() => Sql.Cosh(0) ), N(() => L<Double?,Double?> ( v => (Sql.Exp(v) + Sql.Exp(-v)) / 2 )) },
{ M(() => Sql.Degrees((Decimal?)0)), N(() => L<Decimal?,Decimal?>( v => (Decimal?)(v.Value * (180 / (Decimal)Math.PI)))) },
{ M(() => Sql.Degrees((Double?) 0)), N(() => L<Double?, Double?> ( v => (Double?) (v.Value * (180 / Math.PI)))) },
{ M(() => Sql.Degrees((Int16?) 0)), N(() => L<Int16?, Int16?> ( v => (Int16?) (v.Value * (180 / Math.PI)))) },
{ M(() => Sql.Degrees((Int32?) 0)), N(() => L<Int32?, Int32?> ( v => (Int32?) (v.Value * (180 / Math.PI)))) },
{ M(() => Sql.Degrees((Int64?) 0)), N(() => L<Int64?, Int64?> ( v => (Int64?) (v.Value * (180 / Math.PI)))) },
{ M(() => Sql.Degrees((SByte?) 0)), N(() => L<SByte?, SByte?> ( v => (SByte?) (v.Value * (180 / Math.PI)))) },
{ M(() => Sql.Degrees((Single?) 0)), N(() => L<Single?, Single?> ( v => (Single?) (v.Value * (180 / Math.PI)))) },
{ M(() => Sql.Log(0m, 0)), N(() => L<Decimal?,Decimal?,Decimal?>((m,n) => Sql.Log(n) / Sql.Log(m))) },
{ M(() => Sql.Log(0.0,0)), N(() => L<Double?,Double?,Double?>((m,n) => Sql.Log(n) / Sql.Log(m))) },
{ M(() => Sql.Sign((Decimal?)0)), N(() => L<Decimal?,Int32?>((Decimal? p) => (Int32?)(p > 0 ? 1 : p < 0 ? -1 : 0) )) },
{ M(() => Sql.Sign((Double?) 0)), N(() => L<Double?, Int32?>((Double? p) => (Int32?)(p > 0 ? 1 : p < 0 ? -1 : 0) )) },
{ M(() => Sql.Sign((Int16?) 0)), N(() => L<Int16?, Int32?>((Int16? p) => (Int32?)(p > 0 ? 1 : p < 0 ? -1 : 0) )) },
{ M(() => Sql.Sign((Int32?) 0)), N(() => L<Int32?, Int32?>((Int32? p) => (Int32?)(p > 0 ? 1 : p < 0 ? -1 : 0) )) },
{ M(() => Sql.Sign((Int64?) 0)), N(() => L<Int64?, Int32?>((Int64? p) => (Int32?)(p > 0 ? 1 : p < 0 ? -1 : 0) )) },
{ M(() => Sql.Sign((SByte?) 0)), N(() => L<SByte?, Int32?>((SByte? p) => (Int32?)(p > 0 ? 1 : p < 0 ? -1 : 0) )) },
{ M(() => Sql.Sign((Single?) 0)), N(() => L<Single?, Int32?>((Single? p) => (Int32?)(p > 0 ? 1 : p < 0 ? -1 : 0) )) },
{ M(() => Sql.Sinh(0)), N(() => L<Double?,Double?>( v => (Sql.Exp(v) - Sql.Exp(-v)) / 2)) },
{ M(() => Sql.Tanh(0)), N(() => L<Double?,Double?>( v => (Sql.Exp(v) - Sql.Exp(-v)) / (Sql.Exp(v) +Sql.Exp(-v)))) },
}},
#endregion
#region Oracle
{ ProviderName.Oracle, new Dictionary<MemberInfo,IExpressionInfo> {
{ M(() => Sql.Left ("",0) ), N(() => L<String,Int32?,String> ((String p0,Int32? p1) => Sql.Substring(p0, 1, p1))) },
{ M(() => Sql.Right("",0) ), N(() => L<String,Int32?,String> ((String p0,Int32? p1) => Sql.Substring(p0, p0.Length - p1 + 1, p1))) },
{ M(() => Sql.Stuff("",0,0,"")), N(() => L<String,Int32?,Int32?,String,String>((String p0,Int32? p1,Int32? p2,String p3) => AltStuff(p0, p1, p2, p3))) },
{ M(() => Sql.Space(0) ), N(() => L<Int32?,String> ((Int32? p0) => Sql.PadRight(" ", p0, ' '))) },
{ M(() => Sql.ConvertTo<String>.From(Guid.Empty)), N(() => L<Guid,String>(p => Sql.Lower(
Sql.Substring(Sql.Convert2(Sql.Char(36), p), 7, 2) + Sql.Substring(Sql.Convert2(Sql.Char(36), p), 5, 2) + Sql.Substring(Sql.Convert2(Sql.Char(36), p), 3, 2) + Sql.Substring(Sql.Convert2(Sql.Char(36), p), 1, 2) + "-" +
Sql.Substring(Sql.Convert2(Sql.Char(36), p), 11, 2) + Sql.Substring(Sql.Convert2(Sql.Char(36), p), 9, 2) + "-" +
Sql.Substring(Sql.Convert2(Sql.Char(36), p), 15, 2) + Sql.Substring(Sql.Convert2(Sql.Char(36), p), 13, 2) + "-" +
Sql.Substring(Sql.Convert2(Sql.Char(36), p), 17, 4) + "-" +
Sql.Substring(Sql.Convert2(Sql.Char(36), p), 21, 12)))) },
{ M(() => Sql.Cot (0)), N(() => L<Double?,Double?>(v => Sql.Cos(v) / Sql.Sin(v) )) },
{ M(() => Sql.Log10(0.0)), N(() => L<Double?,Double?>(v => Sql.Log(10, v) )) },
{ M(() => Sql.Degrees((Decimal?)0)), N(() => L<Decimal?,Decimal?>( v => (Decimal?)(v.Value * (180 / (Decimal)Math.PI)))) },
{ M(() => Sql.Degrees((Double?) 0)), N(() => L<Double?, Double?> ( v => (Double?) (v.Value * (180 / Math.PI)))) },
{ M(() => Sql.Degrees((Int16?) 0)), N(() => L<Int16?, Int16?> ( v => (Int16?) (v.Value * (180 / Math.PI)))) },
{ M(() => Sql.Degrees((Int32?) 0)), N(() => L<Int32?, Int32?> ( v => (Int32?) (v.Value * (180 / Math.PI)))) },
{ M(() => Sql.Degrees((Int64?) 0)), N(() => L<Int64?, Int64?> ( v => (Int64?) (v.Value * (180 / Math.PI)))) },
{ M(() => Sql.Degrees((SByte?) 0)), N(() => L<SByte?, SByte?> ( v => (SByte?) (v.Value * (180 / Math.PI)))) },
{ M(() => Sql.Degrees((Single?) 0)), N(() => L<Single?, Single?> ( v => (Single?) (v.Value * (180 / Math.PI)))) },
}},
#endregion
#region Firebird
{ ProviderName.Firebird, new Dictionary<MemberInfo,IExpressionInfo> {
{ M<String>(_ => Sql.Space(0 )), N(() => L<Int32?,String> ( p0 => Sql.PadRight(" ", p0, ' '))) },
{ M<String>(s => Sql.Stuff(s, 0, 0, s)), N(() => L<String,Int32?,Int32?,String,String>((p0,p1,p2,p3) => AltStuff(p0, p1, p2, p3))) },
{ M(() => Sql.Degrees((Decimal?)0)), N(() => L<Decimal?,Decimal?>((Decimal? v) => (Decimal?)(v.Value * 180 / DecimalPI()))) },
{ M(() => Sql.Degrees((Double?) 0)), N(() => L<Double?, Double?> ((Double? v) => (Double?) (v.Value * (180 / Math.PI)))) },
{ M(() => Sql.Degrees((Int16?) 0)), N(() => L<Int16?, Int16?> ((Int16? v) => (Int16?) (v.Value * (180 / Math.PI)))) },
{ M(() => Sql.Degrees((Int32?) 0)), N(() => L<Int32?, Int32?> ((Int32? v) => (Int32?) (v.Value * (180 / Math.PI)))) },
{ M(() => Sql.Degrees((Int64?) 0)), N(() => L<Int64?, Int64?> ((Int64? v) => (Int64?) (v.Value * (180 / Math.PI)))) },
{ M(() => Sql.Degrees((SByte?) 0)), N(() => L<SByte?, SByte?> ((SByte? v) => (SByte?) (v.Value * (180 / Math.PI)))) },
{ M(() => Sql.Degrees((Single?) 0)), N(() => L<Single?, Single?> ((Single? v) => (Single?) (v.Value * (180 / Math.PI)))) },
{ M(() => Sql.RoundToEven(0.0) ), N(() => L<Double?,Double?> ((Double? v) => (double?)Sql.RoundToEven((decimal)v))) },
{ M(() => Sql.RoundToEven(0.0,0)), N(() => L<Double?,Int32?,Double?>((Double? v,Int32? p) => (double?)Sql.RoundToEven((decimal)v, p))) },
}},
#endregion
#region MySql
{ ProviderName.MySql, new Dictionary<MemberInfo,IExpressionInfo> {
{ M<String>(s => Sql.Stuff(s, 0, 0, s)), N(() => L<String,Int32?,Int32?,String,String>((p0,p1,p2,p3) => AltStuff(p0, p1, p2, p3))) },
{ M(() => Sql.Cosh(0)), N(() => L<Double?,Double?>(v => (Sql.Exp(v) + Sql.Exp(-v)) / 2)) },
{ M(() => Sql.Sinh(0)), N(() => L<Double?,Double?>(v => (Sql.Exp(v) - Sql.Exp(-v)) / 2)) },
{ M(() => Sql.Tanh(0)), N(() => L<Double?,Double?>(v => (Sql.Exp(v) - Sql.Exp(-v)) / (Sql.Exp(v) + Sql.Exp(-v)))) },
}},
#endregion
#region PostgreSQL
{ ProviderName.PostgreSQL, new Dictionary<MemberInfo,IExpressionInfo> {
{ M(() => Sql.Left ("",0) ), N(() => L<String,Int32?,String> ((p0,p1) => Sql.Substring(p0, 1, p1))) },
{ M(() => Sql.Right("",0) ), N(() => L<String,Int32?,String> ((String p0,Int32? p1) => Sql.Substring(p0, p0.Length - p1 + 1, p1))) },
{ M(() => Sql.Stuff("",0,0,"")), N(() => L<String,Int32?,Int32?,String,String>((String p0,Int32? p1,Int32? p2,String p3) => AltStuff(p0, p1, p2, p3))) },
{ M(() => Sql.Space(0) ), N(() => L<Int32?,String> ((Int32? p0) => Replicate(" ", p0))) },
{ M(() => Sql.Cosh(0) ), N(() => L<Double?,Double?> ((Double? v) => (Sql.Exp(v) + Sql.Exp(-v)) / 2 )) },
{ M(() => Sql.Round (0.0,0)), N(() => L<Double?,Int32?,Double?>((Double? v,Int32? p) => (double?)Sql.Round ((decimal)v, p))) },
{ M(() => Sql.RoundToEven(0.0) ), N(() => L<Double?,Double?> ((Double? v) => (double?)Sql.RoundToEven((decimal)v))) },
{ M(() => Sql.RoundToEven(0.0,0)), N(() => L<Double?,Int32?,Double?>((Double? v,Int32? p) => (double?)Sql.RoundToEven((decimal)v, p))) },
{ M(() => Sql.Log ((double)0,0)), N(() => L<Double?,Double?,Double?> ((Double? m,Double? n) => (Double?)Sql.Log((Decimal)m,(Decimal)n).Value)) },
{ M(() => Sql.Sinh (0) ), N(() => L<Double?,Double?> ((Double? v) => (Sql.Exp(v) - Sql.Exp(-v)) / 2)) },
{ M(() => Sql.Tanh (0) ), N(() => L<Double?,Double?> ((Double? v) => (Sql.Exp(v) - Sql.Exp(-v)) / (Sql.Exp(v) + Sql.Exp(-v)))) },
{ M(() => Sql.Truncate(0.0) ), N(() => L<Double?,Double?> ((Double? v) => (double?)Sql.Truncate((decimal)v))) },
}},
#endregion
#region SQLite
{ ProviderName.SQLite, new Dictionary<MemberInfo,IExpressionInfo> {
{ M(() => Sql.Stuff ("",0,0,"")), N(() => L<String,Int32?,Int32?,String,String>((p0,p1,p2,p3) => AltStuff(p0, p1, p2, p3))) },
{ M(() => Sql.PadRight("",0,' ') ), N(() => L<String,Int32?,Char?,String> ((p0,p1,p2) => p0.Length > p1 ? p0 : p0 + Replicate(p2, p1 - p0.Length))) },
{ M(() => Sql.PadLeft ("",0,' ') ), N(() => L<String,Int32?,Char?,String> ((p0,p1,p2) => p0.Length > p1 ? p0 : Replicate(p2, p1 - p0.Length) + p0)) },
{ M(() => Sql.MakeDateTime(0, 0, 0)), N(() => L<Int32?,Int32?,Int32?,DateTime?>((y,m,d) => Sql.Convert(Sql.Date,
y.ToString() + "-" +
(m.ToString().Length == 1 ? "0" + m.ToString() : m.ToString()) + "-" +
(d.ToString().Length == 1 ? "0" + d.ToString() : d.ToString())))) },
{ M(() => Sql.MakeDateTime(0, 0, 0, 0, 0, 0)), N(() => L<Int32?,Int32?,Int32?,Int32?,Int32?,Int32?,DateTime?>((y,m,d,h,i,s) => Sql.Convert(Sql.DateTime2,
y.ToString() + "-" +
(m.ToString().Length == 1 ? "0" + m.ToString() : m.ToString()) + "-" +
(d.ToString().Length == 1 ? "0" + d.ToString() : d.ToString()) + " " +
(h.ToString().Length == 1 ? "0" + h.ToString() : h.ToString()) + ":" +
(i.ToString().Length == 1 ? "0" + i.ToString() : i.ToString()) + ":" +
(s.ToString().Length == 1 ? "0" + s.ToString() : s.ToString())))) },
{ M(() => Sql.ConvertTo<String>.From(Guid.Empty)), N(() => L<Guid,String>((Guid p) => Sql.Lower(
Sql.Substring(Hex(p), 7, 2) + Sql.Substring(Hex(p), 5, 2) + Sql.Substring(Hex(p), 3, 2) + Sql.Substring(Hex(p), 1, 2) + "-" +
Sql.Substring(Hex(p), 11, 2) + Sql.Substring(Hex(p), 9, 2) + "-" +
Sql.Substring(Hex(p), 15, 2) + Sql.Substring(Hex(p), 13, 2) + "-" +
Sql.Substring(Hex(p), 17, 4) + "-" +
Sql.Substring(Hex(p), 21, 12)))) },
{ M(() => Sql.Log (0m, 0)), N(() => L<Decimal?,Decimal?,Decimal?>((m,n) => Sql.Log(n) / Sql.Log(m))) },
{ M(() => Sql.Log (0.0,0)), N(() => L<Double?,Double?,Double?> ((m,n) => Sql.Log(n) / Sql.Log(m))) },
{ M(() => Sql.Truncate(0m)), N(() => L<Decimal?,Decimal?>((Decimal? v) => v >= 0 ? Sql.Floor(v) : Sql.Ceiling(v))) },
{ M(() => Sql.Truncate(0.0)), N(() => L<Double?,Double?> ((Double? v) => v >= 0 ? Sql.Floor(v) : Sql.Ceiling(v))) },
}},
#endregion
#region Sybase
{ ProviderName.Sybase, new Dictionary<MemberInfo,IExpressionInfo> {
{ M(() => Sql.PadRight("",0,' ')), N(() => L<String,Int32?,Char?,String>((p0,p1,p2) => p0.Length > p1 ? p0 : p0 + Replicate(p2, p1 - p0.Length))) },
{ M(() => Sql.PadLeft ("",0,' ')), N(() => L<String,Int32?,Char?,String>((p0,p1,p2) => p0.Length > p1 ? p0 : Replicate(p2, p1 - p0.Length) + p0)) },
{ M(() => Sql.Trim ("") ), N(() => L<String,String> ( p0 => Sql.TrimLeft(Sql.TrimRight(p0)))) },
{ M(() => Sql.Cosh(0) ), N(() => L<Double?,Double?> ( v => (Sql.Exp(v) + Sql.Exp(-v)) / 2)) },
{ M(() => Sql.Log (0m, 0)), N(() => L<Decimal?,Decimal?,Decimal?>((m,n) => Sql.Log(n) / Sql.Log(m))) },
{ M(() => Sql.Log (0.0,0)), N(() => L<Double?,Double?,Double?>((m,n) => Sql.Log(n) / Sql.Log(m))) },
{ M(() => Sql.Degrees((Decimal?)0)), N(() => L<Decimal?,Decimal?>( v => (Decimal?)(v.Value * (180 / (Decimal)Math.PI)))) },
{ M(() => Sql.Degrees((Double?) 0)), N(() => L<Double?, Double?> ( v => (Double?) (v.Value * (180 / Math.PI)))) },
{ M(() => Sql.Degrees((Int16?) 0)), N(() => L<Int16?, Int16?> ( v => (Int16?) (v.Value * (180 / Math.PI)))) },
{ M(() => Sql.Degrees((Int32?) 0)), N(() => L<Int32?, Int32?> ( v => (Int32?) (v.Value * (180 / Math.PI)))) },
{ M(() => Sql.Degrees((Int64?) 0)), N(() => L<Int64?, Int64?> ( v => (Int64?) (v.Value * (180 / Math.PI)))) },
{ M(() => Sql.Degrees((SByte?) 0)), N(() => L<SByte?, SByte?> ( v => (SByte?) (v.Value * (180 / Math.PI)))) },
{ M(() => Sql.Degrees((Single?) 0)), N(() => L<Single?, Single?> ( v => (Single?) (v.Value * (180 / Math.PI)))) },
{ M(() => Sql.Sinh(0)), N(() => L<Double?,Double?>((Double? v) => (Sql.Exp(v) - Sql.Exp(-v)) / 2)) },
{ M(() => Sql.Tanh(0)), N(() => L<Double?,Double?>((Double? v) => (Sql.Exp(v) - Sql.Exp(-v)) / (Sql.Exp(v) + Sql.Exp(-v)))) },
{ M(() => Sql.Truncate(0m)), N(() => L<Decimal?,Decimal?>((Decimal? v) => v >= 0 ? Sql.Floor(v) : Sql.Ceiling(v))) },
{ M(() => Sql.Truncate(0.0)), N(() => L<Double?,Double?> ((Double? v) => v >= 0 ? Sql.Floor(v) : Sql.Ceiling(v))) },
}},
#endregion
#region Access
{ ProviderName.Access, new Dictionary<MemberInfo,IExpressionInfo> {
{ M(() => Sql.Stuff ("",0,0,"")), N(() => L<String,Int32?,Int32?,String,String>((p0,p1,p2,p3) => AltStuff(p0, p1, p2, p3))) },
{ M(() => Sql.PadRight("",0,' ') ), N(() => L<String,Int32?,Char?,String> ((p0,p1,p2) => p0.Length > p1 ? p0 : p0 + Replicate(p2, p1 - p0.Length))) },
{ M(() => Sql.PadLeft ("",0,' ') ), N(() => L<String,Int32?,Char?,String> ((p0,p1,p2) => p0.Length > p1 ? p0 : Replicate(p2, p1 - p0.Length) + p0)) },
{ M(() => Sql.MakeDateTime(0,0,0)), N(() => L<Int32?,Int32?,Int32?,DateTime?> ((y,m,d) => MakeDateTime2(y, m, d))) },
{ M(() => Sql.ConvertTo<String>.From(Guid.Empty)), N(() => L<Guid,String>(p => Sql.Lower(Sql.Substring(p.ToString(), 2, 36)))) },
{ M(() => Sql.Ceiling((Decimal)0)), N(() => L<Decimal?,Decimal?>(p => -Sql.Floor(-p) )) },
{ M(() => Sql.Ceiling((Double) 0)), N(() => L<Double?, Double?> (p => -Sql.Floor(-p) )) },
{ M(() => Sql.Cot (0) ), N(() => L<Double?,Double?> ((Double? v) => Sql.Cos(v) / Sql.Sin(v) )) },
{ M(() => Sql.Cosh (0) ), N(() => L<Double?,Double?> ((Double? v) => (Sql.Exp(v) + Sql.Exp(-v)) / 2)) },
{ M(() => Sql.Log (0m, 0)), N(() => L<Decimal?,Decimal?,Decimal?>((Decimal? m,Decimal? n) => Sql.Log(n) / Sql.Log(m) )) },
{ M(() => Sql.Log (0.0,0)), N(() => L<Double?,Double?,Double?> ((Double? m,Double? n) => Sql.Log(n) / Sql.Log(m) )) },
{ M(() => Sql.Log10(0.0) ), N(() => L<Double?,Double?> ((Double? n) => Sql.Log(n) / Sql.Log(10.0) )) },
{ M(() => Sql.Degrees((Decimal?)0)), N(() => L<Decimal?,Decimal?>((Decimal? v) => (Decimal?) ( v.Value * (180 / (Decimal)Math.PI)))) },
{ M(() => Sql.Degrees((Double?) 0)), N(() => L<Double?, Double?> ((Double? v) => (Double?) ( v.Value * (180 / Math.PI)))) },
{ M(() => Sql.Degrees((Int16?) 0)), N(() => L<Int16?, Int16?> ((Int16? v) => (Int16?) AccessInt(AccessInt(v.Value) * (180 / Math.PI)))) },
{ M(() => Sql.Degrees((Int32?) 0)), N(() => L<Int32?, Int32?> ((Int32? v) => (Int32?) AccessInt(AccessInt(v.Value) * (180 / Math.PI)))) },
{ M(() => Sql.Degrees((Int64?) 0)), N(() => L<Int64?, Int64?> ((Int64? v) => (Int64?) AccessInt(AccessInt(v.Value) * (180 / Math.PI)))) },
{ M(() => Sql.Degrees((SByte?) 0)), N(() => L<SByte?, SByte?> ((SByte? v) => (SByte?) AccessInt(AccessInt(v.Value) * (180 / Math.PI)))) },
{ M(() => Sql.Degrees((Single?) 0)), N(() => L<Single?, Single?> ((Single? v) => (Single?) ( v.Value * (180 / Math.PI)))) },
{ M(() => Sql.Round (0m) ), N(() => L<Decimal?,Decimal?> ((Decimal? d) => d - Sql.Floor(d) == 0.5m && Sql.Floor(d) % 2 == 0? Sql.Ceiling(d) : AccessRound(d, 0))) },
{ M(() => Sql.Round (0.0) ), N(() => L<Double?, Double?> ((Double? d) => d - Sql.Floor(d) == 0.5 && Sql.Floor(d) % 2 == 0? Sql.Ceiling(d) : AccessRound(d, 0))) },
{ M(() => Sql.Round (0m, 0)), N(() => L<Decimal?,Int32?,Decimal?>((Decimal? v,Int32? p)=> (Decimal?)(
p == 1 ? Sql.Round(v * 10) / 10 :
p == 2 ? Sql.Round(v * 10) / 10 :
p == 3 ? Sql.Round(v * 10) / 10 :
p == 4 ? Sql.Round(v * 10) / 10 :
p == 5 ? Sql.Round(v * 10) / 10 :
Sql.Round(v * 10) / 10))) },
{ M(() => Sql.Round (0.0,0)), N(() => L<Double?,Int32?,Double?>((Double? v,Int32? p) => (Double?)(
p == 1 ? Sql.Round(v * 10) / 10 :
p == 2 ? Sql.Round(v * 10) / 10 :
p == 3 ? Sql.Round(v * 10) / 10 :
p == 4 ? Sql.Round(v * 10) / 10 :
p == 5 ? Sql.Round(v * 10) / 10 :
Sql.Round(v * 10) / 10))) },
{ M(() => Sql.RoundToEven(0m) ), N(() => L<Decimal?,Decimal?> ( v => AccessRound(v, 0))) },
{ M(() => Sql.RoundToEven(0.0) ), N(() => L<Double?, Double?> ( v => AccessRound(v, 0))) },
{ M(() => Sql.RoundToEven(0m, 0)), N(() => L<Decimal?,Int32?,Decimal?>((v,p)=> AccessRound(v, p))) },
{ M(() => Sql.RoundToEven(0.0,0)), N(() => L<Double?, Int32?,Double?> ((v,p)=> AccessRound(v, p))) },
{ M(() => Sql.Sinh(0)), N(() => L<Double?,Double?>( v => (Sql.Exp(v) - Sql.Exp(-v)) / 2)) },
{ M(() => Sql.Tanh(0)), N(() => L<Double?,Double?>( v => (Sql.Exp(v) - Sql.Exp(-v)) / (Sql.Exp(v) + Sql.Exp(-v)))) },
{ M(() => Sql.Truncate(0m)), N(() => L<Decimal?,Decimal?>((Decimal? v) => v >= 0 ? Sql.Floor(v) : Sql.Ceiling(v))) },
{ M(() => Sql.Truncate(0.0)), N(() => L<Double?,Double?> ((Double? v) => v >= 0 ? Sql.Floor(v) : Sql.Ceiling(v))) },
}},
#endregion
#region SapHana
{ ProviderName.SapHana, new Dictionary<MemberInfo,IExpressionInfo> {
{ M(() => Sql.Degrees((Decimal?)0)), N(() => L<Decimal?,Decimal?>((Decimal? v) => (Decimal?) (v.Value * (180 / (Decimal)Math.PI)))) },
{ M(() => Sql.Degrees((Double?) 0)), N(() => L<Double?, Double?> ((Double? v) => (Double?) (v.Value * (180 / Math.PI)))) },
{ M(() => Sql.Degrees((Int16?) 0)), N(() => L<Int16?, Int16?> ((Int16? v) => (Int16?) (v.Value * (180 / Math.PI)))) },
{ M(() => Sql.Degrees((Int32?) 0)), N(() => L<Int32?, Int32?> ((Int32? v) => (Int32?) (v.Value * (180 / Math.PI)))) },
{ M(() => Sql.Degrees((Int64?) 0)), N(() => L<Int64?, Int64?> ((Int64? v) => (Int64?) (v.Value * (180 / Math.PI)))) },
{ M(() => Sql.Degrees((SByte?) 0)), N(() => L<SByte?, SByte?> ((SByte? v) => (SByte?) (v.Value * (180 / Math.PI)))) },
{ M(() => Sql.Degrees((Single?) 0)), N(() => L<Single?, Single?> ((Single? v) => (Single?) (v.Value * (180 / Math.PI)))) },
{ M(() => Sql.RoundToEven(0.0) ), N(() => L<Double?,Double?> ((Double? v) => (double?)Sql.RoundToEven((decimal)v))) },
{ M(() => Sql.RoundToEven(0.0,0)), N(() => L<Double?,Int32?,Double?>((Double? v,Int32? p) => (double?)Sql.RoundToEven((decimal)v, p))) },
{ M(() => Sql.Stuff("",0,0,"")), N(() => L<String,Int32?,Int32?,String,String>((String p0,Int32? p1,Int32? p2,String p3) => AltStuff (p0, p1, p2, p3))) },
}},
#endregion
};
}
#endregion
class TypeMember
{
public TypeMember(Type type, string member)
{
Type = type;
Member = member;
}
public readonly Type Type;
public readonly string Member;
public override bool Equals(object obj)
{
var other = (TypeMember)obj;
return Type == other.Type && string.Equals(Member, other.Member);
}
public override int GetHashCode()
{
unchecked
{
return (Type.GetHashCode() * 397) ^ Member.GetHashCode();
}
}
}
public static void MapMember(string providerName, Type objectType, MemberInfo memberInfo, LambdaExpression expression)
{
Dictionary<TypeMember,IExpressionInfo> dic;
if (!_typeMembers.TryGetValue(providerName, out dic))
_typeMembers.Add(providerName, dic = new Dictionary<TypeMember,IExpressionInfo>());
var expr = new LazyExpressionInfo();
expr.SetExpression(expression);
dic[new TypeMember(objectType, memberInfo.Name)] = expr;
_checkUserNamespace = false;
}
public static void MapMember(string providerName, Type objectType, MemberInfo memberInfo, IExpressionInfo expressionInfo)
{
Dictionary<TypeMember,IExpressionInfo> dic;
if (!_typeMembers.TryGetValue(providerName, out dic))
_typeMembers.Add(providerName, dic = new Dictionary<TypeMember,IExpressionInfo>());
dic[new TypeMember(objectType, memberInfo.Name)] = expressionInfo;
_checkUserNamespace = false;
}
public static void MapMember<TR> (string providerName, Type objectType, Expression<Func<TR>> memberInfo, Expression<Func<TR>> expression) { MapMember(providerName, objectType, MemberHelper.GetMemberInfo(memberInfo), expression); }
public static void MapMember<TR> ( Type objectType, Expression<Func<TR>> memberInfo, Expression<Func<TR>> expression) { MapMember("", objectType, MemberHelper.GetMemberInfo(memberInfo), expression); }
public static void MapMember<T1,TR> (string providerName, Type objectType, Expression<Func<T1,TR>> memberInfo, Expression<Func<T1,TR>> expression) { MapMember(providerName, objectType, MemberHelper.GetMemberInfo(memberInfo), expression); }
public static void MapMember<T1,TR> ( Type objectType, Expression<Func<T1,TR>> memberInfo, Expression<Func<T1,TR>> expression) { MapMember("", objectType, MemberHelper.GetMemberInfo(memberInfo), expression); }
public static void MapMember<T1,T2,TR> (string providerName, Type objectType, Expression<Func<T1,T2,TR>> memberInfo, Expression<Func<T1,T2,TR>> expression) { MapMember(providerName, objectType, MemberHelper.GetMemberInfo(memberInfo), expression); }
public static void MapMember<T1,T2,TR> ( Type objectType, Expression<Func<T1,T2,TR>> memberInfo, Expression<Func<T1,T2,TR>> expression) { MapMember("", objectType, MemberHelper.GetMemberInfo(memberInfo), expression); }
public static void MapMember<T1,T2,T3,TR> (string providerName, Type objectType, Expression<Func<T1,T2,T3,TR>> memberInfo, Expression<Func<T1,T2,T3,TR>> expression) { MapMember(providerName, objectType, MemberHelper.GetMemberInfo(memberInfo), expression); }
public static void MapMember<T1,T2,T3,TR> ( Type objectType, Expression<Func<T1,T2,T3,TR>> memberInfo, Expression<Func<T1,T2,T3,TR>> expression) { MapMember("", objectType, MemberHelper.GetMemberInfo(memberInfo), expression); }
public static void MapMember<T1,T2,T3,T4,TR> (string providerName, Type objectType, Expression<Func<T1,T2,T3,T4,TR>> memberInfo, Expression<Func<T1,T2,T3,T4,TR>> expression) { MapMember(providerName, objectType, MemberHelper.GetMemberInfo(memberInfo), expression); }
public static void MapMember<T1,T2,T3,T4,TR> ( Type objectType, Expression<Func<T1,T2,T3,T4,TR>> memberInfo, Expression<Func<T1,T2,T3,T4,TR>> expression) { MapMember("", objectType, MemberHelper.GetMemberInfo(memberInfo), expression); }
public static void MapMember<T1,T2,T3,T4,T5,TR>(string providerName, Type objectType, Expression<Func<T1,T2,T3,T4,T5,TR>> memberInfo, Expression<Func<T1,T2,T3,T4,T5,TR>> expression) { MapMember(providerName, objectType, MemberHelper.GetMemberInfo(memberInfo), expression); }
public static void MapMember<T1,T2,T3,T4,T5,TR>( Type objectType, Expression<Func<T1,T2,T3,T4,T5,TR>> memberInfo, Expression<Func<T1,T2,T3,T4,T5,TR>> expression) { MapMember("", objectType, MemberHelper.GetMemberInfo(memberInfo), expression); }
static TypeMember MT<T>(Expression<Func<object>> func)
{
return new TypeMember(typeof(T), MemberHelper.GetMemberInfo(func).Name);
}
static readonly Dictionary<string,Dictionary<TypeMember,IExpressionInfo>> _typeMembers = new Dictionary<string,Dictionary<TypeMember,IExpressionInfo>>
{
{ "", new Dictionary<TypeMember,IExpressionInfo> {
#region ToString
{ MT<Boolean>(() => ((Boolean)true).ToString()), N(() => L<Boolean, String>((Boolean p0) => Sql.ConvertTo<string>.From(p0) )) },
{ MT<Byte >(() => ((Byte) 0) .ToString()), N(() => L<Byte, String>((Byte p0) => Sql.ConvertTo<string>.From(p0) )) },
{ MT<Char >(() => ((Char) '0') .ToString()), N(() => L<Char, String>((Char p0) => Sql.ConvertTo<string>.From(p0) )) },
{ MT<Decimal>(() => ((Decimal) 0) .ToString()), N(() => L<Decimal, String>((Decimal p0) => Sql.ConvertTo<string>.From(p0) )) },
{ MT<Double >(() => ((Double) 0) .ToString()), N(() => L<Double, String>((Double p0) => Sql.ConvertTo<string>.From(p0) )) },
{ MT<Int16 >(() => ((Int16) 0) .ToString()), N(() => L<Int16, String>((Int16 p0) => Sql.ConvertTo<string>.From(p0) )) },
{ MT<Int32 >(() => ((Int32) 0) .ToString()), N(() => L<Int32, String>((Int32 p0) => Sql.ConvertTo<string>.From(p0) )) },
{ MT<Int64 >(() => ((Int64) 0) .ToString()), N(() => L<Int64, String>((Int64 p0) => Sql.ConvertTo<string>.From(p0) )) },
{ MT<SByte >(() => ((SByte) 0) .ToString()), N(() => L<SByte, String>((SByte p0) => Sql.ConvertTo<string>.From(p0) )) },
{ MT<Single >(() => ((Single) 0) .ToString()), N(() => L<Single, String>((Single p0) => Sql.ConvertTo<string>.From(p0) )) },
// { MT<String >(() => ((String) "0") .ToString()), N(() => L<String, String>((String p0) => p0 )) },
{ MT<UInt16 >(() => ((UInt16) 0) .ToString()), N(() => L<UInt16, String>((UInt16 p0) => Sql.ConvertTo<string>.From(p0) )) },
{ MT<UInt32 >(() => ((UInt32) 0) .ToString()), N(() => L<UInt32, String>((UInt32 p0) => Sql.ConvertTo<string>.From(p0) )) },
{ MT<UInt64 >(() => ((UInt64) 0) .ToString()), N(() => L<UInt64, String>((UInt64 p0) => Sql.ConvertTo<string>.From(p0) )) },
#endregion
}},
};
#region Sql specific
[CLSCompliant(false)]
[Sql.Function("RTrim", 0)]
public static string TrimRight(string str, char[] trimChars)
{
return str == null ? null : str.TrimEnd(trimChars);
}
[CLSCompliant(false)]
[Sql.Function("LTrim", 0)]
public static string TrimLeft(string str, char[] trimChars)
{
return str == null ? null : str.TrimStart(trimChars);
}
#endregion
#region Provider specific functions
[Sql.Function]
public static int? ConvertToCaseCompareTo(string str, string value)
{
return str == null || value == null ? (int?)null : str.CompareTo(value);
}
// Access, DB2, Firebird, Informix, MySql, Oracle, PostgreSQL, SQLite
//
[Sql.Function]
public static string AltStuff(string str, int? startLocation, int? length, string value)
{
return Sql.Stuff(str, startLocation, length, value);
}
// DB2
//
[Sql.Function]
public static string VarChar(object obj, int? size)
{
return obj.ToString();
}
// DB2
//
[Sql.Function]
public static string Hex(Guid? guid)
{
return guid == null ? null : guid.ToString();
}
#pragma warning disable 3019
// DB2, PostgreSQL, Access, MS SQL, SqlCe
//
[CLSCompliant(false)]
[Sql.Function]
[Sql.Function(ProviderName.DB2, "Repeat")]
[Sql.Function(ProviderName.PostgreSQL, "Repeat")]
[Sql.Function(ProviderName.Access, "String", 1, 0)]
public static string Replicate(string str, int? count)
{
if (str == null || count == null)
return null;
var sb = new StringBuilder(str.Length * count.Value);
for (var i = 0; i < count; i++)
sb.Append(str);
return sb.ToString();
}
[CLSCompliant(false)]
[Sql.Function]
[Sql.Function(ProviderName.DB2, "Repeat")]
[Sql.Function(ProviderName.PostgreSQL, "Repeat")]
[Sql.Function(ProviderName.Access, "String", 1, 0)]
public static string Replicate(char? ch, int? count)
{
if (ch == null || count == null)
return null;
var sb = new StringBuilder(count.Value);
for (var i = 0; i < count; i++)
sb.Append(ch);
return sb.ToString();
}
// SqlServer
//
[Sql.Function]
public static DateTime? DateAdd(Sql.DateParts part, int? number, int? days)
{
return days == null ? null : Sql.DateAdd(part, number, new DateTime(1900, 1, days.Value + 1));
}
// MSSQL
//
[Sql.Function]
public static Decimal? Round(Decimal? value, int precision, int mode) { return 0; }
[Sql.Function]
public static Double? Round(Double? value, int precision, int mode) { return 0; }
// Access
//
[Sql.Function(ProviderName.Access, "DateSerial")]
public static DateTime? MakeDateTime2(int? year, int? month, int? day)
{
return year == null || month == null || day == null?
(DateTime?)null :
new DateTime(year.Value, month.Value, day.Value);
}
// Access
//
[CLSCompliant(false)]
[Sql.Function("Int", 0)]
public static T AccessInt<T>(T value)
{
return value;
}
// Access
//
[CLSCompliant(false)]
[Sql.Function("Round", 0, 1)]
public static T AccessRound<T>(T value, int? precision) { return value; }
// Firebird
//
[Sql.Function("PI", ServerSideOnly = true)]
public static decimal DecimalPI() { return (decimal)Math.PI; }
[Sql.Function("PI", ServerSideOnly = true)]
public static double DoublePI () { return Math.PI; }
// Informix
//
[Sql.Function]
public static DateTime? Mdy(int? month, int? day, int? year)
{
return year == null || month == null || day == null ?
(DateTime?)null :
new DateTime(year.Value, month.Value, day.Value);
}
#endregion
#endregion
}
}
| 70.1375 | 444 | 0.516993 | [
"MIT"
] | jogibear9988/linq2db | Source/Linq/Expressions.cs | 112,222 | C# |
// Copyright [2014, 2015] [ThoughtWorks Inc.](www.thoughtworks.com)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using System;
using System.IO;
using System.Text;
using FakeItEasy;
using Gauge.VisualStudio.Core.Exceptions;
using NUnit.Framework;
namespace Gauge.VisualStudio.Core.Tests
{
[TestFixture]
public class GaugeServiceTests
{
[Test]
public void ShouldBeCompatibleWithGaugeGreaterThanGaugeMinVersion()
{
var curGaugeMinVersion = GaugeService.MinGaugeVersion;
var testGaugeVersion = new GaugeVersion(string.Format("{0}.{1}.{2}", curGaugeMinVersion.Major,
curGaugeMinVersion.Minor, curGaugeMinVersion.Patch + 1));
var json = "{\"version\": \"" + testGaugeVersion +
"\",\"plugins\": [{\"name\": \"csharp\",\"version\": \"0.9.2\"},{\"name\": \"html-report\",\"version\": \"2.1.0\"}]}";
var outputStream = new MemoryStream(Encoding.UTF8.GetBytes(json));
var errorStream = new MemoryStream(Encoding.UTF8.GetBytes(string.Empty));
var gaugeProcess = A.Fake<IGaugeProcess>();
A.CallTo(() => gaugeProcess.Start()).Returns(true);
A.CallTo(() => gaugeProcess.StandardOutput).Returns(new StreamReader(outputStream));
A.CallTo(() => gaugeProcess.StandardError).Returns(new StreamReader(errorStream));
Assert.DoesNotThrow(() => GaugeService.AssertCompatibility(gaugeProcess));
}
[Test]
public void ShouldBeCompatibleWithGaugeMinVersionForVs()
{
var curGaugeMinVersion = GaugeService.MinGaugeVersion;
var json = "{\"version\": \"" + curGaugeMinVersion +
"\",\"plugins\": [{\"name\": \"csharp\",\"version\": \"0.9.2\"},{\"name\": \"html-report\",\"version\": \"2.1.0\"}]}";
var outputStream = new MemoryStream(Encoding.UTF8.GetBytes(json));
var errorStream = new MemoryStream(Encoding.UTF8.GetBytes(string.Empty));
var gaugeProcess = A.Fake<IGaugeProcess>();
A.CallTo(() => gaugeProcess.Start()).Returns(true);
A.CallTo(() => gaugeProcess.StandardOutput).Returns(new StreamReader(outputStream));
A.CallTo(() => gaugeProcess.StandardError).Returns(new StreamReader(errorStream));
Assert.DoesNotThrow(() => GaugeService.AssertCompatibility(gaugeProcess));
}
[Test]
public void ShouldBeIncompatibleWithOldGaugeVersion()
{
const string json =
"{\"version\": \"0.6.2\",\"plugins\": [{\"name\": \"csharp\",\"version\": \"0.9.2\"},{\"name\": \"html-report\",\"version\": \"2.1.0\"}]}";
var outputStream = new MemoryStream(Encoding.UTF8.GetBytes(json));
var errorStream = new MemoryStream(Encoding.UTF8.GetBytes(string.Empty));
var curGaugeMinVersion = GaugeService.MinGaugeVersion;
var expectedMessage = "This plugin works with Gauge " + curGaugeMinVersion +
" or above. You have Gauge 0.6.2 installed. Please update your Gauge installation.\n" +
" Run 'gauge version' from your command prompt for installation information.";
var gaugeProcess = A.Fake<IGaugeProcess>();
A.CallTo(() => gaugeProcess.Start()).Returns(true);
A.CallTo(() => gaugeProcess.StandardOutput).Returns(new StreamReader(outputStream));
A.CallTo(() => gaugeProcess.StandardError).Returns(new StreamReader(errorStream));
var gaugeVersionIncompatibleException =
Assert.Throws<GaugeVersionIncompatibleException>(() =>
GaugeService.AssertCompatibility(gaugeProcess));
Assert.AreEqual(expectedMessage, gaugeVersionIncompatibleException.Data["GaugeError"]);
}
[Test]
public void ShouldGetGaugeVersion()
{
const string json =
"{\"version\": \"0.4.0\",\"plugins\": [{\"name\": \"csharp\",\"version\": \"0.7.3\"},{\"name\": \"html-report\",\"version\": \"2.1.0\"}]}";
var outputStream = new MemoryStream(Encoding.UTF8.GetBytes(json));
var errorStream = new MemoryStream(Encoding.UTF8.GetBytes(string.Empty));
var gaugeProcess = A.Fake<IGaugeProcess>();
A.CallTo(() => gaugeProcess.Start()).Returns(true);
A.CallTo(() => gaugeProcess.StandardOutput).Returns(new StreamReader(outputStream));
A.CallTo(() => gaugeProcess.StandardError).Returns(new StreamReader(errorStream));
var installedGaugeVersion = GaugeService.GetInstalledGaugeVersion(gaugeProcess);
Assert.AreEqual("0.4.0", installedGaugeVersion.version);
Assert.AreEqual(2, installedGaugeVersion.plugins.Length);
}
[Test]
public void ShouldGetGaugeVersionWhenDeprecated()
{
var json = string.Concat(
"[DEPRECATED] This usage will be removed soon. Run `gauge help --legacy` for more info.",
Environment.NewLine,
"{\"version\": \"0.4.0\",\"plugins\": [{\"name\": \"csharp\",\"version\": \"0.7.3\"},{\"name\": \"html-report\",\"version\": \"2.1.0\"}]}");
var outputStream = new MemoryStream(Encoding.UTF8.GetBytes(json));
var errorStream = new MemoryStream(Encoding.UTF8.GetBytes(string.Empty));
var gaugeProcess = A.Fake<IGaugeProcess>();
A.CallTo(() => gaugeProcess.Start()).Returns(true);
A.CallTo(() => gaugeProcess.StandardOutput).Returns(new StreamReader(outputStream));
A.CallTo(() => gaugeProcess.StandardError).Returns(new StreamReader(errorStream));
var installedGaugeVersion = GaugeService.GetInstalledGaugeVersion(gaugeProcess);
Assert.AreEqual("0.4.0", installedGaugeVersion.version);
Assert.AreEqual(2, installedGaugeVersion.plugins.Length);
}
[Test]
public void ShouldThrowExceptionWhenExitCodeIsNonZero()
{
const string errorMessage = "This is an error message";
var outputStream = new MemoryStream(Encoding.UTF8.GetBytes(string.Empty));
var errorStream = new MemoryStream(Encoding.UTF8.GetBytes(errorMessage));
var gaugeProcess = A.Fake<IGaugeProcess>();
A.CallTo(() => gaugeProcess.Start()).Returns(true);
A.CallTo(() => gaugeProcess.ExitCode).Returns(123);
A.CallTo(() => gaugeProcess.StandardOutput).Returns(new StreamReader(outputStream));
A.CallTo(() => gaugeProcess.StandardError).Returns(new StreamReader(errorStream));
var exception =
Assert.Throws<GaugeVersionNotFoundException>(() =>
GaugeService.GetInstalledGaugeVersion(gaugeProcess));
Assert.NotNull(exception);
Assert.NotNull(exception.Data);
Assert.AreEqual("Unable to read Gauge version", exception.Message);
Assert.AreEqual(errorMessage, exception.Data["GaugeError"]);
}
}
} | 51.621622 | 156 | 0.624476 | [
"Apache-2.0"
] | getgauge/gauge-visualstudio | Gauge.VisualStudio.Core.Tests/GaugeServiceTests.cs | 7,642 | C# |
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using Microsoft.CodeAnalysis;
using Microsoft.Extensions.DependencyModel;
using System.Linq;
using IOPath = System.IO.Path;
namespace Microsoft.EntityFrameworkCore.TestUtilities
{
public class BuildReference
{
private BuildReference(IEnumerable<MetadataReference> references, bool copyLocal = false, string path = null)
{
References = references;
CopyLocal = copyLocal;
Path = path;
}
public IEnumerable<MetadataReference> References { get; }
public bool CopyLocal { get; }
public string Path { get; }
public static BuildReference ByName(string name, bool copyLocal = false)
{
var references = (from l in DependencyContext.Default.CompileLibraries
from r in l.ResolveReferencePaths()
where IOPath.GetFileNameWithoutExtension(r) == name
select MetadataReference.CreateFromFile(r)).ToList();
if (references.Count == 0)
{
throw new InvalidOperationException(
$"Assembly '{name}' not found.");
}
return new BuildReference(
references,
copyLocal);
}
public static BuildReference ByPath(string path)
=> new BuildReference(new[] { MetadataReference.CreateFromFile(path) }, path: path);
}
}
| 34.645833 | 117 | 0.616356 | [
"Apache-2.0"
] | CharlieRoseMarie/EntityFrameworkCore | test/EFCore.Design.Tests/TestUtilities/BuildReference.cs | 1,663 | C# |
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class CheckBoxClick : MonoBehaviour {
public string checkBoxName;
private bool isButtonClick = false;
private int soundStatus;
private int levelStatus;
private SettingSceneController settingSceneController;
void Start () {
soundStatus = PlayerPrefs.GetInt ("sound", 1);
levelStatus = PlayerPrefs.GetInt ("level", 0);
GameObject gameSettingController = GameObject.FindGameObjectWithTag ("GameSettingController");
if (gameSettingController != null) {
settingSceneController = gameSettingController.GetComponent<SettingSceneController> ();
}
if (gameSettingController == null) {
Debug.Log ("Cannnot find 'settingSceneController' script ContactEvent");
}
}
// Update is called once per frame
void Update () {
if (isButtonClick) {
switch (checkBoxName) {
case "chkSound":
soundStatus = PlayerPrefs.GetInt ("sound", 1);
if (soundStatus == 0) {
settingSceneController.changeStateSoundCheckBox (1);
} else if (soundStatus == 1) {
settingSceneController.changeStateSoundCheckBox (0);
}
break;
case "chkLevelEasy":
settingSceneController.changeStateLevelCheckBox (0);
break;
case "chkLevelAverage":
settingSceneController.changeStateLevelCheckBox (1);
break;
case "chkLevelHard":
settingSceneController.changeStateLevelCheckBox (2);
break;
default:
break;
}
isButtonClick = false;
}
}
public void saveSetting() {
Debug.Log (checkBoxName);
isButtonClick = true;
}
}
| 25.725806 | 96 | 0.726646 | [
"Apache-2.0"
] | xuanthinhJB/mini-game-Unity-example | Swinging surfer/Assets/Script/CheckBoxClick.cs | 1,597 | C# |
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using OmniSharp.Extensions.LanguageServer.Protocol.Models;
using OmniSharp.Extensions.LanguageServer.Protocol.Serialization;
namespace Microsoft.AspNetCore.Razor.LanguageServer.CodeActions.Models
{
internal class ExtendedCodeActionContext : CodeActionContext
{
[Optional]
public Range SelectionRange { get; set; }
}
}
| 34.4 | 111 | 0.76938 | [
"Apache-2.0"
] | Chatina73/AspNetCore-Tooling | src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Models/ExtendedCodeActionContext.cs | 518 | C# |
using ProtoBuf;
using Vintagestory.API.Common;
using Vintagestory.API.MathTools;
namespace BuildingOverhaul.Network
{
[ProtoContract(ImplicitFields = ImplicitFields.AllFields)]
public class BuildingMessage
{
private BlockPos _position;
private byte _face;
private Vec3d _hitPosition;
private bool _didOffset;
public string Shape { get; }
public BlockSelection Selection => new BlockSelection {
Position = _position,
Face = BlockFacing.ALLFACES[_face],
HitPosition = _hitPosition,
DidOffset = _didOffset,
};
// This is used by ProtoBuf, so ignore non-nullable warnings.
#pragma warning disable CS8618
private BuildingMessage() { }
#pragma warning restore
public BuildingMessage(BlockSelection selection, string shape)
{
_position = selection.Position;
_face = (byte)selection.Face.Index;
_hitPosition = selection.HitPosition;
_didOffset = selection.DidOffset;
Shape = shape;
}
}
}
| 25.025641 | 64 | 0.724385 | [
"Unlicense"
] | copygirl/BuildingOverhaul | src/network/BuildingMessage.cs | 976 | C# |
using System;
using UnityEngine;
using UnityEngine.UI;
public class UICanvas : MonoBehaviour
{
[SerializeField]
private int maxLapCount = 3;
private int currentLapCount = 1;
private decimal timeElapsed = 0;
[SerializeField]
private Text timeDisplay;
[SerializeField]
private Text winnerDisplay;
public static UICanvas instance;
private void Awake()
{
if (instance == null)
{
instance = this;
}
else if (instance != this)
{
Debug.Log(gameObject.name + " singleton instance was destroyed because a second one was created.");
Destroy(gameObject);
}
}
private void Update()
{
if (GameManager.instance.GameState == eGameState.PlayingGame)
{
UpdateTimeDisplay();
}
}
private void UpdateTimeDisplay()
{
timeElapsed += (decimal)Time.deltaTime;
timeDisplay.text = "Time: " + Math.Round(timeElapsed, 1, MidpointRounding.ToEven);
}
public void winrar() {
winnerDisplay.text = "Player Won!";
GameManager.instance.GameState = eGameState.PostGame;
var cars = GameObject.FindObjectsOfType<CarDrift>();
for (int i = 0; i < cars.Length; i++) {
cars[i].gameObject.SetActive(false);
}
gameObject.AddComponent<LoadMainMenuAfterTime>();
}
}
| 23.466667 | 111 | 0.603693 | [
"MIT"
] | taliesinmillhouse/global-game-jam-2018 | src/Assets/Scripts/UICanvas.cs | 1,410 | C# |
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Runtime.InteropServices;
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("a7922dd8-09f1-43e4-938b-cc523ea08898")]
| 38.888889 | 111 | 0.771429 | [
"Apache-2.0"
] | CalumJEadie/Security | src/Microsoft.Owin.Security.Interop/Properties/AssemblyInfo.cs | 350 | C# |
using System.Collections.Generic;
using System.ComponentModel;
using ESRI.ArcGIS.esriSystem;
using ESRI.ArcGIS.Geometry;
namespace ESRI.ArcGIS.Carto
{
/// <summary>
/// Provides extension methods for the <see cref="IEnumLayer" /> enumeration.
/// </summary>
public static class LayerAsyncExtensions
{
#region Public Methods
/// <summary>
/// Performs an identify operation with the provided geometry.
/// When identifying layers, typically a small envelope is passed in rather than a point to account for differences in
/// the precision of the display and the feature geometry.
/// </summary>
/// <param name="source">The source.</param>
/// <param name="geometry">The geometry.</param>
/// <param name="trackCancel">
/// The cancel tracker object to monitor the Esc key and to terminate processes at the request of
/// the user.
/// </param>
/// <returns>
/// Returns a <see cref="IEnumerable{IFeatureIdentifyObj}" /> representing the features that have been identified.
/// </returns>
/// <exception cref="System.ArgumentNullException">geometry</exception>
/// <remarks>
/// On a FeatureIdentifyObject, you can do a QI to the IIdentifyObj interface to get more information about the
/// identified feature. The IIdentifyvsObj interface returns the window handle, layer, and name of the feature; it has
/// methods to flash the
/// feature in the display and to display a context menu at the Identify location.
/// </remarks>
public static IEnumerable<IFeatureIdentifyObj> IdentifyAsync(this IFeatureLayer source, IGeometry geometry, ITrackCancel trackCancel)
{
return Task.Wait(() => source.Identify(geometry, trackCancel));
}
#endregion
}
} | 44.022727 | 141 | 0.641198 | [
"MIT"
] | Jumpercables/Wave | src/Wave.Extensions.Esri/ESRI/ArcGIS/Carto/Extensions/Async/LayerAsyncExtensions.cs | 1,939 | C# |
namespace HexiTech.Data.Enums
{
using System.ComponentModel.DataAnnotations;
public enum ProductAvailability
{
[Display(Name = "Available.")]
Available = 1,
[Display(Name = "At warehouse.")]
AtWarehouse = 2,
[Display(Name = "Out of stock.")]
OutOfStock = 3
}
} | 23.285714 | 48 | 0.58589 | [
"MIT"
] | Th3D4rkStar/HexiTech | HexiTech/Data/Enums/ProductAvailability.cs | 328 | C# |
using System;
using CoreGraphics;
namespace ImageDiffDemo
{
internal static class CGColorExtensions
{
internal static CGColor CreateCGColor(int alpha, int r, int g, int b)
{
return new CGColor(r / 255.0f, g / 255.0f, b / 255.0f, alpha / 255.0f);
}
}
}
| 21.571429 | 83 | 0.609272 | [
"MIT"
] | danipen/ImageDiffDemo | ImageDiffDemo/CGColorExtensions.cs | 304 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MMDB.Shared
{
public static class DateTimeHelper
{
public const string TimeZoneIdentifier_EasternStandardTime = "Eastern Standard Time";
public const string TimeZoneIdentifier_MountainStandardTime = "Mountain Standard Time";
public const string TimeZoneIdentifier_CentralStandardTime = "Central Standard Time";
public const string TimeZoneIdentifier_PacificStandardTime = "Pacific Standard Time";
public static DateTime FromUtcToTimeZone(DateTime utcTime, string timeZoneIdentifier)
{
DateTime localTime;
TimeZoneInfo tzInfo = TimeZoneInfo.FindSystemTimeZoneById(timeZoneIdentifier);
localTime = TimeZoneInfo.ConvertTimeFromUtc(utcTime, tzInfo);
return localTime;
}
public static DateTime FromTimeZoneToUtc(DateTime localTime, string timeZoneIdentifier)
{
DateTime utcTime;
TimeZoneInfo tzInfo = TimeZoneInfo.FindSystemTimeZoneById(timeZoneIdentifier);
if (localTime.Kind == DateTimeKind.Local)
{
localTime = new DateTime(localTime.Ticks, DateTimeKind.Unspecified);
}
utcTime = TimeZoneInfo.ConvertTimeToUtc(localTime, tzInfo);
return utcTime;
}
public static string FormatDateTime(DateTime? utcDateTime, string timeZoneIdentifier)
{
if (utcDateTime.HasValue)
{
TimeZoneInfo tz = TimeZoneInfo.FindSystemTimeZoneById(timeZoneIdentifier);
DateTime localDateTime = FromUtcToTimeZone(utcDateTime.Value, timeZoneIdentifier);
return string.Format("{0:MM/dd/yy H:mm} {1}", localDateTime, GetAbbreviation(timeZoneIdentifier));
}
else
{
return null;
}
}
public static string GetAbbreviation(string timeZoneIdentifier)
{
var map = new Dictionary<string, string>()
{
{"eastern standard time","est"},
{"mountain standard time","mst"},
{"central standard time","cst"},
{"pacific standard time","pst"}
//etc...
};
string returnValue;
if(!map.TryGetValue(timeZoneIdentifier.ToLower(), out returnValue))
{
returnValue = timeZoneIdentifier;
}
return returnValue;
}
}
}
| 31 | 102 | 0.751423 | [
"Apache-2.0"
] | mmooney/MMDB.Shared | MMDB.Shared.Core/DateTimeHelper.cs | 2,110 | C# |
using System.Numerics;
using Xunit;
using SixLabors.Fonts.Tests.Fakes;
using System.Collections.Immutable;
using SixLabors.Primitives;
using System.Collections.Generic;
namespace SixLabors.Fonts.Tests
{
public class TextLayoutTests
{
[Fact]
public void FakeFontGetGlyph()
{
Font font = CreateFont("hello world");
Glyph glyph = font.GetGlyph('h');
Assert.NotNull(glyph);
}
[Theory]
[InlineData(
VerticalAlignment.Top,
HorizontalAlignment.Left,
10,
10)]
[InlineData(
VerticalAlignment.Top,
HorizontalAlignment.Right,
10,
-320)]
[InlineData(
VerticalAlignment.Top,
HorizontalAlignment.Center,
10,
-155)]
[InlineData(
VerticalAlignment.Bottom,
HorizontalAlignment.Left,
-50,
10)]
[InlineData(
VerticalAlignment.Bottom,
HorizontalAlignment.Right,
-50,
-320)]
[InlineData(
VerticalAlignment.Bottom,
HorizontalAlignment.Center,
-50,
-155)]
[InlineData(
VerticalAlignment.Center,
HorizontalAlignment.Left,
-20,
10)]
[InlineData(
VerticalAlignment.Center,
HorizontalAlignment.Right,
-20,
-320)]
[InlineData(
VerticalAlignment.Center,
HorizontalAlignment.Center,
-20,
-155)]
public void VerticalAlignmentTests(
VerticalAlignment vertical,
HorizontalAlignment horizental,
float top, float left)
{
var text = "hello world\nhello";
Font font = CreateFont(text);
int scaleFactor = 72 * font.EmSize; // 72 * emSize means 1 point = 1px
RendererOptions span = new RendererOptions(font, scaleFactor)
{
HorizontalAlignment = horizental,
VerticalAlignment = vertical
};
ImmutableArray<GlyphLayout> glyphsToRender = new TextLayout().GenerateLayout(text, span);
var fontInst = span.Font.FontInstance;
float lineHeight = (fontInst.LineHeight * span.Font.Size) / (fontInst.EmSize * 72);
lineHeight *= scaleFactor;
RectangleF bound = TextMeasurer.GetBounds(glyphsToRender, new Vector2(span.DpiX, span.DpiY));
Assert.Equal(310, bound.Width, 3);
Assert.Equal(40, bound.Height, 3);
Assert.Equal(left, bound.Left, 3);
Assert.Equal(top, bound.Top, 3);
}
[Theory]
[InlineData("h", 10, 10)]
[InlineData("he", 10, 40)]
[InlineData("hel", 10, 70)]
[InlineData("hello", 10, 130)]
[InlineData("hello world", 10, 310)]
[InlineData("hello world\nhello world", 40, 310)]
[InlineData("hello\nworld", 40, 130)]
public void MeasureText(string text, float height, float width)
{
Font font = CreateFont(text);
int scaleFactor = 72 * font.EmSize; // 72 * emSize means 1 point = 1px
SizeF size = TextMeasurer.MeasureBounds(text, new RendererOptions(font, 72 * font.EmSize)
{
}).Size;
Assert.Equal(height, size.Height, 4);
Assert.Equal(width, size.Width, 4);
}
[Fact]
public void TryMeasureCharacterBounds() {
string text = "a b\nc";
GlyphMetric[] expectedGlyphMetrics = new GlyphMetric[] {
new GlyphMetric('a', new RectangleF(10, 10, 10, 10), false),
new GlyphMetric(' ', new RectangleF(40, 10, 30, 10), false),
new GlyphMetric('b', new RectangleF(70, 10, 10, 10), false),
new GlyphMetric('\n', new RectangleF(100, 10, 0, 10), true),
new GlyphMetric('c', new RectangleF(10, 40, 10, 10), false),
};
Font font = CreateFont(text);
int scaleFactor = 72 * font.EmSize; // 72 * emSize means 1 point = 1px
IReadOnlyList<GlyphMetric> glyphMetrics;
Assert.True(TextMeasurer.TryMeasureCharacterBounds(text, new RendererOptions(font, 72 * font.EmSize), out glyphMetrics));
Assert.Equal(text.Length, glyphMetrics.Count);
int i = 0;
foreach (GlyphMetric glyphMetric in glyphMetrics) {
Assert.Equal(expectedGlyphMetrics[i++], glyphMetric);
}
}
[Theory]
[InlineData("hello world", 10, 310)]
[InlineData("hello world hello world hello world",
70, // 30 actual line height * 2 + 10 actual height
310)]
public void MeasureTextWordWrapping(string text, float height, float width)
{
Font font = CreateFont(text);
int scaleFactor = 72 * font.EmSize; // 72 * emSize means 1 point = 1px
SizeF size = TextMeasurer.MeasureBounds(text, new RendererOptions(font, 72 * font.EmSize)
{
WrappingWidth = 350
}).Size;
Assert.Equal(width, size.Width, 4);
Assert.Equal(height, size.Height, 4);
}
[Theory]
[InlineData("ab", 477, 1081, false)] // no kerning rules defined for lowercase ab so widths should stay the same
[InlineData("ab", 477, 1081, true)]
[InlineData("AB", 465, 1033, false)] // width changes between kerning enabled or not
[InlineData("AB", 465, 654, true)]
public void MeasureTextWithKerning(string text, float height, float width, bool enableKerning)
{
FontCollection c = new FontCollection();
Font font = c.Install(TestFonts.SimpleFontFileData()).CreateFont(12);
int scaleFactor = 72 * font.EmSize; // 72 * emSize means 1 point = 1px
SizeF size = TextMeasurer.MeasureBounds(text, new RendererOptions(new Font(font, 1), 72 * font.EmSize) { ApplyKerning = enableKerning }).Size;
Assert.Equal(height, size.Height, 4);
Assert.Equal(width, size.Width, 4);
}
[Theory]
[InlineData("a", 100, 100, 125, 828)]
public void LayoutWithLocation(string text, float x, float y, float expectedX, float expectedY)
{
FontCollection c = new FontCollection();
Font font = c.Install(TestFonts.SimpleFontFileData()).CreateFont(12);
int scaleFactor = 72 * font.EmSize; // 72 * emSize means 1 point = 1px
var glyphRenderer = new GlyphRenderer();
var renderer = new TextRenderer(glyphRenderer);
renderer.RenderText(text, new RendererOptions(new Font(font, 1), 72 * font.EmSize, new PointF(x, y)));
Assert.Equal(new PointF(expectedX, expectedY), glyphRenderer.GlyphRects[0].Location);
}
public static Font CreateFont(string text)
{
FontCollection fc = new FontCollection();
Font d = fc.Install(new FakeFontInstance(text)).CreateFont(12);
return new Font(d, 1);
}
}
}
| 36.813131 | 154 | 0.564412 | [
"Apache-2.0"
] | Ref12/Fonts | tests/SixLabors.Fonts.Tests/TextLayoutTests.cs | 7,291 | C# |
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
class Solution {
static void Main(String[] args) {
string[] tokens_n = Console.ReadLine().Split(' ');
int n = Convert.ToInt32(tokens_n[0]);
int k = Convert.ToInt32(tokens_n[1]);
string[] a_temp = Console.ReadLine().Split(' ');
int[] a = Array.ConvertAll(a_temp,Int32.Parse);
if (k > n) {//k is not supposed to be greater than n but just to be safe
k = k % n;
}
for (int element = k; element < n; element++) {
Console.Write("{0} ", a[element]);
}
for (int element = 0; element < k; element++) {
Console.Write("{0} ", a[element]);
}
}
}
| 30.6 | 80 | 0.538562 | [
"Apache-2.0"
] | pappes/hr | tutorials/t1 - arrays left rotation/simple.cs | 765 | C# |
/*
* Copyright 2010-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the glue-2017-03-31.normal.json service model.
*/
using System;
using System.Collections.Generic;
using Amazon.Runtime;
using Amazon.Glue.Model;
namespace Amazon.Glue
{
/// <summary>
/// Interface for accessing Glue
///
/// AWS Glue
/// <para>
/// Defines the public endpoint for the AWS Glue service.
/// </para>
/// </summary>
public partial interface IAmazonGlue : IAmazonService, IDisposable
{
#region BatchCreatePartition
/// <summary>
/// Creates one or more partitions in a batch operation.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the BatchCreatePartition service method.</param>
///
/// <returns>The response from the BatchCreatePartition service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.AlreadyExistsException">
/// A resource to be created or added already exists.
/// </exception>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.GlueEncryptionException">
/// An encryption operation failed.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <exception cref="Amazon.Glue.Model.ResourceNumberLimitExceededException">
/// A resource numerical limit was exceeded.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/BatchCreatePartition">REST API Reference for BatchCreatePartition Operation</seealso>
BatchCreatePartitionResponse BatchCreatePartition(BatchCreatePartitionRequest request);
/// <summary>
/// Initiates the asynchronous execution of the BatchCreatePartition operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the BatchCreatePartition operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndBatchCreatePartition
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/BatchCreatePartition">REST API Reference for BatchCreatePartition Operation</seealso>
IAsyncResult BeginBatchCreatePartition(BatchCreatePartitionRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the BatchCreatePartition operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginBatchCreatePartition.</param>
///
/// <returns>Returns a BatchCreatePartitionResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/BatchCreatePartition">REST API Reference for BatchCreatePartition Operation</seealso>
BatchCreatePartitionResponse EndBatchCreatePartition(IAsyncResult asyncResult);
#endregion
#region BatchDeleteConnection
/// <summary>
/// Deletes a list of connection definitions from the Data Catalog.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the BatchDeleteConnection service method.</param>
///
/// <returns>The response from the BatchDeleteConnection service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/BatchDeleteConnection">REST API Reference for BatchDeleteConnection Operation</seealso>
BatchDeleteConnectionResponse BatchDeleteConnection(BatchDeleteConnectionRequest request);
/// <summary>
/// Initiates the asynchronous execution of the BatchDeleteConnection operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the BatchDeleteConnection operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndBatchDeleteConnection
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/BatchDeleteConnection">REST API Reference for BatchDeleteConnection Operation</seealso>
IAsyncResult BeginBatchDeleteConnection(BatchDeleteConnectionRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the BatchDeleteConnection operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginBatchDeleteConnection.</param>
///
/// <returns>Returns a BatchDeleteConnectionResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/BatchDeleteConnection">REST API Reference for BatchDeleteConnection Operation</seealso>
BatchDeleteConnectionResponse EndBatchDeleteConnection(IAsyncResult asyncResult);
#endregion
#region BatchDeletePartition
/// <summary>
/// Deletes one or more partitions in a batch operation.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the BatchDeletePartition service method.</param>
///
/// <returns>The response from the BatchDeletePartition service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/BatchDeletePartition">REST API Reference for BatchDeletePartition Operation</seealso>
BatchDeletePartitionResponse BatchDeletePartition(BatchDeletePartitionRequest request);
/// <summary>
/// Initiates the asynchronous execution of the BatchDeletePartition operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the BatchDeletePartition operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndBatchDeletePartition
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/BatchDeletePartition">REST API Reference for BatchDeletePartition Operation</seealso>
IAsyncResult BeginBatchDeletePartition(BatchDeletePartitionRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the BatchDeletePartition operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginBatchDeletePartition.</param>
///
/// <returns>Returns a BatchDeletePartitionResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/BatchDeletePartition">REST API Reference for BatchDeletePartition Operation</seealso>
BatchDeletePartitionResponse EndBatchDeletePartition(IAsyncResult asyncResult);
#endregion
#region BatchDeleteTable
/// <summary>
/// Deletes multiple tables at once.
///
/// <note>
/// <para>
/// After completing this operation, you will no longer have access to the table versions
/// and partitions that belong to the deleted table. AWS Glue deletes these "orphaned"
/// resources asynchronously in a timely manner, at the discretion of the service.
/// </para>
///
/// <para>
/// To ensure immediate deletion of all related resources, before calling <code>BatchDeleteTable</code>,
/// use <code>DeleteTableVersion</code> or <code>BatchDeleteTableVersion</code>, and <code>DeletePartition</code>
/// or <code>BatchDeletePartition</code>, to delete any resources that belong to the table.
/// </para>
/// </note>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the BatchDeleteTable service method.</param>
///
/// <returns>The response from the BatchDeleteTable service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/BatchDeleteTable">REST API Reference for BatchDeleteTable Operation</seealso>
BatchDeleteTableResponse BatchDeleteTable(BatchDeleteTableRequest request);
/// <summary>
/// Initiates the asynchronous execution of the BatchDeleteTable operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the BatchDeleteTable operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndBatchDeleteTable
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/BatchDeleteTable">REST API Reference for BatchDeleteTable Operation</seealso>
IAsyncResult BeginBatchDeleteTable(BatchDeleteTableRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the BatchDeleteTable operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginBatchDeleteTable.</param>
///
/// <returns>Returns a BatchDeleteTableResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/BatchDeleteTable">REST API Reference for BatchDeleteTable Operation</seealso>
BatchDeleteTableResponse EndBatchDeleteTable(IAsyncResult asyncResult);
#endregion
#region BatchDeleteTableVersion
/// <summary>
/// Deletes a specified batch of versions of a table.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the BatchDeleteTableVersion service method.</param>
///
/// <returns>The response from the BatchDeleteTableVersion service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/BatchDeleteTableVersion">REST API Reference for BatchDeleteTableVersion Operation</seealso>
BatchDeleteTableVersionResponse BatchDeleteTableVersion(BatchDeleteTableVersionRequest request);
/// <summary>
/// Initiates the asynchronous execution of the BatchDeleteTableVersion operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the BatchDeleteTableVersion operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndBatchDeleteTableVersion
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/BatchDeleteTableVersion">REST API Reference for BatchDeleteTableVersion Operation</seealso>
IAsyncResult BeginBatchDeleteTableVersion(BatchDeleteTableVersionRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the BatchDeleteTableVersion operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginBatchDeleteTableVersion.</param>
///
/// <returns>Returns a BatchDeleteTableVersionResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/BatchDeleteTableVersion">REST API Reference for BatchDeleteTableVersion Operation</seealso>
BatchDeleteTableVersionResponse EndBatchDeleteTableVersion(IAsyncResult asyncResult);
#endregion
#region BatchGetCrawlers
/// <summary>
/// Returns a list of resource metadata for a given list of crawler names. After calling
/// the <code>ListCrawlers</code> operation, you can call this operation to access the
/// data to which you have been granted permissions. This operation supports all IAM permissions,
/// including permission conditions that uses tags.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the BatchGetCrawlers service method.</param>
///
/// <returns>The response from the BatchGetCrawlers service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/BatchGetCrawlers">REST API Reference for BatchGetCrawlers Operation</seealso>
BatchGetCrawlersResponse BatchGetCrawlers(BatchGetCrawlersRequest request);
/// <summary>
/// Initiates the asynchronous execution of the BatchGetCrawlers operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the BatchGetCrawlers operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndBatchGetCrawlers
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/BatchGetCrawlers">REST API Reference for BatchGetCrawlers Operation</seealso>
IAsyncResult BeginBatchGetCrawlers(BatchGetCrawlersRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the BatchGetCrawlers operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginBatchGetCrawlers.</param>
///
/// <returns>Returns a BatchGetCrawlersResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/BatchGetCrawlers">REST API Reference for BatchGetCrawlers Operation</seealso>
BatchGetCrawlersResponse EndBatchGetCrawlers(IAsyncResult asyncResult);
#endregion
#region BatchGetDevEndpoints
/// <summary>
/// Returns a list of resource metadata for a given list of DevEndpoint names. After calling
/// the <code>ListDevEndpoints</code> operation, you can call this operation to access
/// the data to which you have been granted permissions. This operation supports all IAM
/// permissions, including permission conditions that uses tags.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the BatchGetDevEndpoints service method.</param>
///
/// <returns>The response from the BatchGetDevEndpoints service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.AccessDeniedException">
/// Access to a resource was denied.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/BatchGetDevEndpoints">REST API Reference for BatchGetDevEndpoints Operation</seealso>
BatchGetDevEndpointsResponse BatchGetDevEndpoints(BatchGetDevEndpointsRequest request);
/// <summary>
/// Initiates the asynchronous execution of the BatchGetDevEndpoints operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the BatchGetDevEndpoints operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndBatchGetDevEndpoints
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/BatchGetDevEndpoints">REST API Reference for BatchGetDevEndpoints Operation</seealso>
IAsyncResult BeginBatchGetDevEndpoints(BatchGetDevEndpointsRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the BatchGetDevEndpoints operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginBatchGetDevEndpoints.</param>
///
/// <returns>Returns a BatchGetDevEndpointsResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/BatchGetDevEndpoints">REST API Reference for BatchGetDevEndpoints Operation</seealso>
BatchGetDevEndpointsResponse EndBatchGetDevEndpoints(IAsyncResult asyncResult);
#endregion
#region BatchGetJobs
/// <summary>
/// Returns a list of resource metadata for a given list of job names. After calling the
/// <code>ListJobs</code> operation, you can call this operation to access the data to
/// which you have been granted permissions. This operation supports all IAM permissions,
/// including permission conditions that uses tags.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the BatchGetJobs service method.</param>
///
/// <returns>The response from the BatchGetJobs service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/BatchGetJobs">REST API Reference for BatchGetJobs Operation</seealso>
BatchGetJobsResponse BatchGetJobs(BatchGetJobsRequest request);
/// <summary>
/// Initiates the asynchronous execution of the BatchGetJobs operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the BatchGetJobs operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndBatchGetJobs
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/BatchGetJobs">REST API Reference for BatchGetJobs Operation</seealso>
IAsyncResult BeginBatchGetJobs(BatchGetJobsRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the BatchGetJobs operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginBatchGetJobs.</param>
///
/// <returns>Returns a BatchGetJobsResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/BatchGetJobs">REST API Reference for BatchGetJobs Operation</seealso>
BatchGetJobsResponse EndBatchGetJobs(IAsyncResult asyncResult);
#endregion
#region BatchGetPartition
/// <summary>
/// Retrieves partitions in a batch request.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the BatchGetPartition service method.</param>
///
/// <returns>The response from the BatchGetPartition service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.GlueEncryptionException">
/// An encryption operation failed.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/BatchGetPartition">REST API Reference for BatchGetPartition Operation</seealso>
BatchGetPartitionResponse BatchGetPartition(BatchGetPartitionRequest request);
/// <summary>
/// Initiates the asynchronous execution of the BatchGetPartition operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the BatchGetPartition operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndBatchGetPartition
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/BatchGetPartition">REST API Reference for BatchGetPartition Operation</seealso>
IAsyncResult BeginBatchGetPartition(BatchGetPartitionRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the BatchGetPartition operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginBatchGetPartition.</param>
///
/// <returns>Returns a BatchGetPartitionResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/BatchGetPartition">REST API Reference for BatchGetPartition Operation</seealso>
BatchGetPartitionResponse EndBatchGetPartition(IAsyncResult asyncResult);
#endregion
#region BatchGetTriggers
/// <summary>
/// Returns a list of resource metadata for a given list of trigger names. After calling
/// the <code>ListTriggers</code> operation, you can call this operation to access the
/// data to which you have been granted permissions. This operation supports all IAM permissions,
/// including permission conditions that uses tags.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the BatchGetTriggers service method.</param>
///
/// <returns>The response from the BatchGetTriggers service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/BatchGetTriggers">REST API Reference for BatchGetTriggers Operation</seealso>
BatchGetTriggersResponse BatchGetTriggers(BatchGetTriggersRequest request);
/// <summary>
/// Initiates the asynchronous execution of the BatchGetTriggers operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the BatchGetTriggers operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndBatchGetTriggers
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/BatchGetTriggers">REST API Reference for BatchGetTriggers Operation</seealso>
IAsyncResult BeginBatchGetTriggers(BatchGetTriggersRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the BatchGetTriggers operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginBatchGetTriggers.</param>
///
/// <returns>Returns a BatchGetTriggersResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/BatchGetTriggers">REST API Reference for BatchGetTriggers Operation</seealso>
BatchGetTriggersResponse EndBatchGetTriggers(IAsyncResult asyncResult);
#endregion
#region BatchStopJobRun
/// <summary>
/// Stops one or more job runs for a specified job definition.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the BatchStopJobRun service method.</param>
///
/// <returns>The response from the BatchStopJobRun service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/BatchStopJobRun">REST API Reference for BatchStopJobRun Operation</seealso>
BatchStopJobRunResponse BatchStopJobRun(BatchStopJobRunRequest request);
/// <summary>
/// Initiates the asynchronous execution of the BatchStopJobRun operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the BatchStopJobRun operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndBatchStopJobRun
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/BatchStopJobRun">REST API Reference for BatchStopJobRun Operation</seealso>
IAsyncResult BeginBatchStopJobRun(BatchStopJobRunRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the BatchStopJobRun operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginBatchStopJobRun.</param>
///
/// <returns>Returns a BatchStopJobRunResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/BatchStopJobRun">REST API Reference for BatchStopJobRun Operation</seealso>
BatchStopJobRunResponse EndBatchStopJobRun(IAsyncResult asyncResult);
#endregion
#region CreateClassifier
/// <summary>
/// Creates a classifier in the user's account. This can be a <code>GrokClassifier</code>,
/// an <code>XMLClassifier</code>, a <code>JsonClassifier</code>, or a <code>CsvClassifier</code>,
/// depending on which field of the request is present.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateClassifier service method.</param>
///
/// <returns>The response from the CreateClassifier service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.AlreadyExistsException">
/// A resource to be created or added already exists.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateClassifier">REST API Reference for CreateClassifier Operation</seealso>
CreateClassifierResponse CreateClassifier(CreateClassifierRequest request);
/// <summary>
/// Initiates the asynchronous execution of the CreateClassifier operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateClassifier operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateClassifier
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateClassifier">REST API Reference for CreateClassifier Operation</seealso>
IAsyncResult BeginCreateClassifier(CreateClassifierRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the CreateClassifier operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateClassifier.</param>
///
/// <returns>Returns a CreateClassifierResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateClassifier">REST API Reference for CreateClassifier Operation</seealso>
CreateClassifierResponse EndCreateClassifier(IAsyncResult asyncResult);
#endregion
#region CreateConnection
/// <summary>
/// Creates a connection definition in the Data Catalog.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateConnection service method.</param>
///
/// <returns>The response from the CreateConnection service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.AlreadyExistsException">
/// A resource to be created or added already exists.
/// </exception>
/// <exception cref="Amazon.Glue.Model.GlueEncryptionException">
/// An encryption operation failed.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <exception cref="Amazon.Glue.Model.ResourceNumberLimitExceededException">
/// A resource numerical limit was exceeded.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateConnection">REST API Reference for CreateConnection Operation</seealso>
CreateConnectionResponse CreateConnection(CreateConnectionRequest request);
/// <summary>
/// Initiates the asynchronous execution of the CreateConnection operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateConnection operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateConnection
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateConnection">REST API Reference for CreateConnection Operation</seealso>
IAsyncResult BeginCreateConnection(CreateConnectionRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the CreateConnection operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateConnection.</param>
///
/// <returns>Returns a CreateConnectionResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateConnection">REST API Reference for CreateConnection Operation</seealso>
CreateConnectionResponse EndCreateConnection(IAsyncResult asyncResult);
#endregion
#region CreateCrawler
/// <summary>
/// Creates a new crawler with specified targets, role, configuration, and optional schedule.
/// At least one crawl target must be specified, in the <code>s3Targets</code> field,
/// the <code>jdbcTargets</code> field, or the <code>DynamoDBTargets</code> field.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateCrawler service method.</param>
///
/// <returns>The response from the CreateCrawler service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.AlreadyExistsException">
/// A resource to be created or added already exists.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <exception cref="Amazon.Glue.Model.ResourceNumberLimitExceededException">
/// A resource numerical limit was exceeded.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateCrawler">REST API Reference for CreateCrawler Operation</seealso>
CreateCrawlerResponse CreateCrawler(CreateCrawlerRequest request);
/// <summary>
/// Initiates the asynchronous execution of the CreateCrawler operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateCrawler operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateCrawler
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateCrawler">REST API Reference for CreateCrawler Operation</seealso>
IAsyncResult BeginCreateCrawler(CreateCrawlerRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the CreateCrawler operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateCrawler.</param>
///
/// <returns>Returns a CreateCrawlerResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateCrawler">REST API Reference for CreateCrawler Operation</seealso>
CreateCrawlerResponse EndCreateCrawler(IAsyncResult asyncResult);
#endregion
#region CreateDatabase
/// <summary>
/// Creates a new database in a Data Catalog.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateDatabase service method.</param>
///
/// <returns>The response from the CreateDatabase service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.AlreadyExistsException">
/// A resource to be created or added already exists.
/// </exception>
/// <exception cref="Amazon.Glue.Model.GlueEncryptionException">
/// An encryption operation failed.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <exception cref="Amazon.Glue.Model.ResourceNumberLimitExceededException">
/// A resource numerical limit was exceeded.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateDatabase">REST API Reference for CreateDatabase Operation</seealso>
CreateDatabaseResponse CreateDatabase(CreateDatabaseRequest request);
/// <summary>
/// Initiates the asynchronous execution of the CreateDatabase operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateDatabase operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateDatabase
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateDatabase">REST API Reference for CreateDatabase Operation</seealso>
IAsyncResult BeginCreateDatabase(CreateDatabaseRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the CreateDatabase operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateDatabase.</param>
///
/// <returns>Returns a CreateDatabaseResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateDatabase">REST API Reference for CreateDatabase Operation</seealso>
CreateDatabaseResponse EndCreateDatabase(IAsyncResult asyncResult);
#endregion
#region CreateDevEndpoint
/// <summary>
/// Creates a new DevEndpoint.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateDevEndpoint service method.</param>
///
/// <returns>The response from the CreateDevEndpoint service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.AccessDeniedException">
/// Access to a resource was denied.
/// </exception>
/// <exception cref="Amazon.Glue.Model.AlreadyExistsException">
/// A resource to be created or added already exists.
/// </exception>
/// <exception cref="Amazon.Glue.Model.IdempotentParameterMismatchException">
/// The same unique identifier was associated with two different records.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <exception cref="Amazon.Glue.Model.ResourceNumberLimitExceededException">
/// A resource numerical limit was exceeded.
/// </exception>
/// <exception cref="Amazon.Glue.Model.ValidationException">
/// A value could not be validated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateDevEndpoint">REST API Reference for CreateDevEndpoint Operation</seealso>
CreateDevEndpointResponse CreateDevEndpoint(CreateDevEndpointRequest request);
/// <summary>
/// Initiates the asynchronous execution of the CreateDevEndpoint operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateDevEndpoint operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateDevEndpoint
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateDevEndpoint">REST API Reference for CreateDevEndpoint Operation</seealso>
IAsyncResult BeginCreateDevEndpoint(CreateDevEndpointRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the CreateDevEndpoint operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateDevEndpoint.</param>
///
/// <returns>Returns a CreateDevEndpointResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateDevEndpoint">REST API Reference for CreateDevEndpoint Operation</seealso>
CreateDevEndpointResponse EndCreateDevEndpoint(IAsyncResult asyncResult);
#endregion
#region CreateJob
/// <summary>
/// Creates a new job definition.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateJob service method.</param>
///
/// <returns>The response from the CreateJob service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.AlreadyExistsException">
/// A resource to be created or added already exists.
/// </exception>
/// <exception cref="Amazon.Glue.Model.ConcurrentModificationException">
/// Two processes are trying to modify a resource simultaneously.
/// </exception>
/// <exception cref="Amazon.Glue.Model.IdempotentParameterMismatchException">
/// The same unique identifier was associated with two different records.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <exception cref="Amazon.Glue.Model.ResourceNumberLimitExceededException">
/// A resource numerical limit was exceeded.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateJob">REST API Reference for CreateJob Operation</seealso>
CreateJobResponse CreateJob(CreateJobRequest request);
/// <summary>
/// Initiates the asynchronous execution of the CreateJob operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateJob operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateJob
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateJob">REST API Reference for CreateJob Operation</seealso>
IAsyncResult BeginCreateJob(CreateJobRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the CreateJob operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateJob.</param>
///
/// <returns>Returns a CreateJobResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateJob">REST API Reference for CreateJob Operation</seealso>
CreateJobResponse EndCreateJob(IAsyncResult asyncResult);
#endregion
#region CreatePartition
/// <summary>
/// Creates a new partition.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreatePartition service method.</param>
///
/// <returns>The response from the CreatePartition service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.AlreadyExistsException">
/// A resource to be created or added already exists.
/// </exception>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.GlueEncryptionException">
/// An encryption operation failed.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <exception cref="Amazon.Glue.Model.ResourceNumberLimitExceededException">
/// A resource numerical limit was exceeded.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreatePartition">REST API Reference for CreatePartition Operation</seealso>
CreatePartitionResponse CreatePartition(CreatePartitionRequest request);
/// <summary>
/// Initiates the asynchronous execution of the CreatePartition operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreatePartition operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreatePartition
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreatePartition">REST API Reference for CreatePartition Operation</seealso>
IAsyncResult BeginCreatePartition(CreatePartitionRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the CreatePartition operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreatePartition.</param>
///
/// <returns>Returns a CreatePartitionResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreatePartition">REST API Reference for CreatePartition Operation</seealso>
CreatePartitionResponse EndCreatePartition(IAsyncResult asyncResult);
#endregion
#region CreateScript
/// <summary>
/// Transforms a directed acyclic graph (DAG) into code.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateScript service method.</param>
///
/// <returns>The response from the CreateScript service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateScript">REST API Reference for CreateScript Operation</seealso>
CreateScriptResponse CreateScript(CreateScriptRequest request);
/// <summary>
/// Initiates the asynchronous execution of the CreateScript operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateScript operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateScript
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateScript">REST API Reference for CreateScript Operation</seealso>
IAsyncResult BeginCreateScript(CreateScriptRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the CreateScript operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateScript.</param>
///
/// <returns>Returns a CreateScriptResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateScript">REST API Reference for CreateScript Operation</seealso>
CreateScriptResponse EndCreateScript(IAsyncResult asyncResult);
#endregion
#region CreateSecurityConfiguration
/// <summary>
/// Creates a new security configuration.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateSecurityConfiguration service method.</param>
///
/// <returns>The response from the CreateSecurityConfiguration service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.AlreadyExistsException">
/// A resource to be created or added already exists.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <exception cref="Amazon.Glue.Model.ResourceNumberLimitExceededException">
/// A resource numerical limit was exceeded.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateSecurityConfiguration">REST API Reference for CreateSecurityConfiguration Operation</seealso>
CreateSecurityConfigurationResponse CreateSecurityConfiguration(CreateSecurityConfigurationRequest request);
/// <summary>
/// Initiates the asynchronous execution of the CreateSecurityConfiguration operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateSecurityConfiguration operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateSecurityConfiguration
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateSecurityConfiguration">REST API Reference for CreateSecurityConfiguration Operation</seealso>
IAsyncResult BeginCreateSecurityConfiguration(CreateSecurityConfigurationRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the CreateSecurityConfiguration operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateSecurityConfiguration.</param>
///
/// <returns>Returns a CreateSecurityConfigurationResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateSecurityConfiguration">REST API Reference for CreateSecurityConfiguration Operation</seealso>
CreateSecurityConfigurationResponse EndCreateSecurityConfiguration(IAsyncResult asyncResult);
#endregion
#region CreateTable
/// <summary>
/// Creates a new table definition in the Data Catalog.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateTable service method.</param>
///
/// <returns>The response from the CreateTable service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.AlreadyExistsException">
/// A resource to be created or added already exists.
/// </exception>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.GlueEncryptionException">
/// An encryption operation failed.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <exception cref="Amazon.Glue.Model.ResourceNumberLimitExceededException">
/// A resource numerical limit was exceeded.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateTable">REST API Reference for CreateTable Operation</seealso>
CreateTableResponse CreateTable(CreateTableRequest request);
/// <summary>
/// Initiates the asynchronous execution of the CreateTable operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateTable operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateTable
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateTable">REST API Reference for CreateTable Operation</seealso>
IAsyncResult BeginCreateTable(CreateTableRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the CreateTable operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateTable.</param>
///
/// <returns>Returns a CreateTableResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateTable">REST API Reference for CreateTable Operation</seealso>
CreateTableResponse EndCreateTable(IAsyncResult asyncResult);
#endregion
#region CreateTrigger
/// <summary>
/// Creates a new trigger.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateTrigger service method.</param>
///
/// <returns>The response from the CreateTrigger service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.AlreadyExistsException">
/// A resource to be created or added already exists.
/// </exception>
/// <exception cref="Amazon.Glue.Model.ConcurrentModificationException">
/// Two processes are trying to modify a resource simultaneously.
/// </exception>
/// <exception cref="Amazon.Glue.Model.IdempotentParameterMismatchException">
/// The same unique identifier was associated with two different records.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <exception cref="Amazon.Glue.Model.ResourceNumberLimitExceededException">
/// A resource numerical limit was exceeded.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateTrigger">REST API Reference for CreateTrigger Operation</seealso>
CreateTriggerResponse CreateTrigger(CreateTriggerRequest request);
/// <summary>
/// Initiates the asynchronous execution of the CreateTrigger operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateTrigger operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateTrigger
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateTrigger">REST API Reference for CreateTrigger Operation</seealso>
IAsyncResult BeginCreateTrigger(CreateTriggerRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the CreateTrigger operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateTrigger.</param>
///
/// <returns>Returns a CreateTriggerResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateTrigger">REST API Reference for CreateTrigger Operation</seealso>
CreateTriggerResponse EndCreateTrigger(IAsyncResult asyncResult);
#endregion
#region CreateUserDefinedFunction
/// <summary>
/// Creates a new function definition in the Data Catalog.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateUserDefinedFunction service method.</param>
///
/// <returns>The response from the CreateUserDefinedFunction service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.AlreadyExistsException">
/// A resource to be created or added already exists.
/// </exception>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.GlueEncryptionException">
/// An encryption operation failed.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <exception cref="Amazon.Glue.Model.ResourceNumberLimitExceededException">
/// A resource numerical limit was exceeded.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateUserDefinedFunction">REST API Reference for CreateUserDefinedFunction Operation</seealso>
CreateUserDefinedFunctionResponse CreateUserDefinedFunction(CreateUserDefinedFunctionRequest request);
/// <summary>
/// Initiates the asynchronous execution of the CreateUserDefinedFunction operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateUserDefinedFunction operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateUserDefinedFunction
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateUserDefinedFunction">REST API Reference for CreateUserDefinedFunction Operation</seealso>
IAsyncResult BeginCreateUserDefinedFunction(CreateUserDefinedFunctionRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the CreateUserDefinedFunction operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateUserDefinedFunction.</param>
///
/// <returns>Returns a CreateUserDefinedFunctionResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateUserDefinedFunction">REST API Reference for CreateUserDefinedFunction Operation</seealso>
CreateUserDefinedFunctionResponse EndCreateUserDefinedFunction(IAsyncResult asyncResult);
#endregion
#region DeleteClassifier
/// <summary>
/// Removes a classifier from the Data Catalog.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteClassifier service method.</param>
///
/// <returns>The response from the DeleteClassifier service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteClassifier">REST API Reference for DeleteClassifier Operation</seealso>
DeleteClassifierResponse DeleteClassifier(DeleteClassifierRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DeleteClassifier operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteClassifier operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteClassifier
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteClassifier">REST API Reference for DeleteClassifier Operation</seealso>
IAsyncResult BeginDeleteClassifier(DeleteClassifierRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DeleteClassifier operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteClassifier.</param>
///
/// <returns>Returns a DeleteClassifierResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteClassifier">REST API Reference for DeleteClassifier Operation</seealso>
DeleteClassifierResponse EndDeleteClassifier(IAsyncResult asyncResult);
#endregion
#region DeleteConnection
/// <summary>
/// Deletes a connection from the Data Catalog.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteConnection service method.</param>
///
/// <returns>The response from the DeleteConnection service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteConnection">REST API Reference for DeleteConnection Operation</seealso>
DeleteConnectionResponse DeleteConnection(DeleteConnectionRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DeleteConnection operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteConnection operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteConnection
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteConnection">REST API Reference for DeleteConnection Operation</seealso>
IAsyncResult BeginDeleteConnection(DeleteConnectionRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DeleteConnection operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteConnection.</param>
///
/// <returns>Returns a DeleteConnectionResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteConnection">REST API Reference for DeleteConnection Operation</seealso>
DeleteConnectionResponse EndDeleteConnection(IAsyncResult asyncResult);
#endregion
#region DeleteCrawler
/// <summary>
/// Removes a specified crawler from the AWS Glue Data Catalog, unless the crawler state
/// is <code>RUNNING</code>.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteCrawler service method.</param>
///
/// <returns>The response from the DeleteCrawler service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.CrawlerRunningException">
/// The operation cannot be performed because the crawler is already running.
/// </exception>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <exception cref="Amazon.Glue.Model.SchedulerTransitioningException">
/// The specified scheduler is transitioning.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteCrawler">REST API Reference for DeleteCrawler Operation</seealso>
DeleteCrawlerResponse DeleteCrawler(DeleteCrawlerRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DeleteCrawler operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteCrawler operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteCrawler
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteCrawler">REST API Reference for DeleteCrawler Operation</seealso>
IAsyncResult BeginDeleteCrawler(DeleteCrawlerRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DeleteCrawler operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteCrawler.</param>
///
/// <returns>Returns a DeleteCrawlerResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteCrawler">REST API Reference for DeleteCrawler Operation</seealso>
DeleteCrawlerResponse EndDeleteCrawler(IAsyncResult asyncResult);
#endregion
#region DeleteDatabase
/// <summary>
/// Removes a specified Database from a Data Catalog.
///
/// <note>
/// <para>
/// After completing this operation, you will no longer have access to the tables (and
/// all table versions and partitions that might belong to the tables) and the user-defined
/// functions in the deleted database. AWS Glue deletes these "orphaned" resources asynchronously
/// in a timely manner, at the discretion of the service.
/// </para>
///
/// <para>
/// To ensure immediate deletion of all related resources, before calling <code>DeleteDatabase</code>,
/// use <code>DeleteTableVersion</code> or <code>BatchDeleteTableVersion</code>, <code>DeletePartition</code>
/// or <code>BatchDeletePartition</code>, <code>DeleteUserDefinedFunction</code>, and
/// <code>DeleteTable</code> or <code>BatchDeleteTable</code>, to delete any resources
/// that belong to the database.
/// </para>
/// </note>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteDatabase service method.</param>
///
/// <returns>The response from the DeleteDatabase service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteDatabase">REST API Reference for DeleteDatabase Operation</seealso>
DeleteDatabaseResponse DeleteDatabase(DeleteDatabaseRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DeleteDatabase operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteDatabase operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteDatabase
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteDatabase">REST API Reference for DeleteDatabase Operation</seealso>
IAsyncResult BeginDeleteDatabase(DeleteDatabaseRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DeleteDatabase operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteDatabase.</param>
///
/// <returns>Returns a DeleteDatabaseResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteDatabase">REST API Reference for DeleteDatabase Operation</seealso>
DeleteDatabaseResponse EndDeleteDatabase(IAsyncResult asyncResult);
#endregion
#region DeleteDevEndpoint
/// <summary>
/// Deletes a specified DevEndpoint.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteDevEndpoint service method.</param>
///
/// <returns>The response from the DeleteDevEndpoint service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteDevEndpoint">REST API Reference for DeleteDevEndpoint Operation</seealso>
DeleteDevEndpointResponse DeleteDevEndpoint(DeleteDevEndpointRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DeleteDevEndpoint operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteDevEndpoint operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteDevEndpoint
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteDevEndpoint">REST API Reference for DeleteDevEndpoint Operation</seealso>
IAsyncResult BeginDeleteDevEndpoint(DeleteDevEndpointRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DeleteDevEndpoint operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteDevEndpoint.</param>
///
/// <returns>Returns a DeleteDevEndpointResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteDevEndpoint">REST API Reference for DeleteDevEndpoint Operation</seealso>
DeleteDevEndpointResponse EndDeleteDevEndpoint(IAsyncResult asyncResult);
#endregion
#region DeleteJob
/// <summary>
/// Deletes a specified job definition. If the job definition is not found, no exception
/// is thrown.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteJob service method.</param>
///
/// <returns>The response from the DeleteJob service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteJob">REST API Reference for DeleteJob Operation</seealso>
DeleteJobResponse DeleteJob(DeleteJobRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DeleteJob operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteJob operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteJob
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteJob">REST API Reference for DeleteJob Operation</seealso>
IAsyncResult BeginDeleteJob(DeleteJobRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DeleteJob operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteJob.</param>
///
/// <returns>Returns a DeleteJobResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteJob">REST API Reference for DeleteJob Operation</seealso>
DeleteJobResponse EndDeleteJob(IAsyncResult asyncResult);
#endregion
#region DeletePartition
/// <summary>
/// Deletes a specified partition.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeletePartition service method.</param>
///
/// <returns>The response from the DeletePartition service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeletePartition">REST API Reference for DeletePartition Operation</seealso>
DeletePartitionResponse DeletePartition(DeletePartitionRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DeletePartition operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeletePartition operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeletePartition
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeletePartition">REST API Reference for DeletePartition Operation</seealso>
IAsyncResult BeginDeletePartition(DeletePartitionRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DeletePartition operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeletePartition.</param>
///
/// <returns>Returns a DeletePartitionResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeletePartition">REST API Reference for DeletePartition Operation</seealso>
DeletePartitionResponse EndDeletePartition(IAsyncResult asyncResult);
#endregion
#region DeleteResourcePolicy
/// <summary>
/// Deletes a specified policy.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteResourcePolicy service method.</param>
///
/// <returns>The response from the DeleteResourcePolicy service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.ConditionCheckFailureException">
/// A specified condition was not satisfied.
/// </exception>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteResourcePolicy">REST API Reference for DeleteResourcePolicy Operation</seealso>
DeleteResourcePolicyResponse DeleteResourcePolicy(DeleteResourcePolicyRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DeleteResourcePolicy operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteResourcePolicy operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteResourcePolicy
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteResourcePolicy">REST API Reference for DeleteResourcePolicy Operation</seealso>
IAsyncResult BeginDeleteResourcePolicy(DeleteResourcePolicyRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DeleteResourcePolicy operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteResourcePolicy.</param>
///
/// <returns>Returns a DeleteResourcePolicyResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteResourcePolicy">REST API Reference for DeleteResourcePolicy Operation</seealso>
DeleteResourcePolicyResponse EndDeleteResourcePolicy(IAsyncResult asyncResult);
#endregion
#region DeleteSecurityConfiguration
/// <summary>
/// Deletes a specified security configuration.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteSecurityConfiguration service method.</param>
///
/// <returns>The response from the DeleteSecurityConfiguration service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteSecurityConfiguration">REST API Reference for DeleteSecurityConfiguration Operation</seealso>
DeleteSecurityConfigurationResponse DeleteSecurityConfiguration(DeleteSecurityConfigurationRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DeleteSecurityConfiguration operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteSecurityConfiguration operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteSecurityConfiguration
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteSecurityConfiguration">REST API Reference for DeleteSecurityConfiguration Operation</seealso>
IAsyncResult BeginDeleteSecurityConfiguration(DeleteSecurityConfigurationRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DeleteSecurityConfiguration operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteSecurityConfiguration.</param>
///
/// <returns>Returns a DeleteSecurityConfigurationResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteSecurityConfiguration">REST API Reference for DeleteSecurityConfiguration Operation</seealso>
DeleteSecurityConfigurationResponse EndDeleteSecurityConfiguration(IAsyncResult asyncResult);
#endregion
#region DeleteTable
/// <summary>
/// Removes a table definition from the Data Catalog.
///
/// <note>
/// <para>
/// After completing this operation, you will no longer have access to the table versions
/// and partitions that belong to the deleted table. AWS Glue deletes these "orphaned"
/// resources asynchronously in a timely manner, at the discretion of the service.
/// </para>
///
/// <para>
/// To ensure immediate deletion of all related resources, before calling <code>DeleteTable</code>,
/// use <code>DeleteTableVersion</code> or <code>BatchDeleteTableVersion</code>, and <code>DeletePartition</code>
/// or <code>BatchDeletePartition</code>, to delete any resources that belong to the table.
/// </para>
/// </note>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteTable service method.</param>
///
/// <returns>The response from the DeleteTable service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteTable">REST API Reference for DeleteTable Operation</seealso>
DeleteTableResponse DeleteTable(DeleteTableRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DeleteTable operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteTable operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteTable
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteTable">REST API Reference for DeleteTable Operation</seealso>
IAsyncResult BeginDeleteTable(DeleteTableRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DeleteTable operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteTable.</param>
///
/// <returns>Returns a DeleteTableResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteTable">REST API Reference for DeleteTable Operation</seealso>
DeleteTableResponse EndDeleteTable(IAsyncResult asyncResult);
#endregion
#region DeleteTableVersion
/// <summary>
/// Deletes a specified version of a table.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteTableVersion service method.</param>
///
/// <returns>The response from the DeleteTableVersion service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteTableVersion">REST API Reference for DeleteTableVersion Operation</seealso>
DeleteTableVersionResponse DeleteTableVersion(DeleteTableVersionRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DeleteTableVersion operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteTableVersion operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteTableVersion
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteTableVersion">REST API Reference for DeleteTableVersion Operation</seealso>
IAsyncResult BeginDeleteTableVersion(DeleteTableVersionRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DeleteTableVersion operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteTableVersion.</param>
///
/// <returns>Returns a DeleteTableVersionResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteTableVersion">REST API Reference for DeleteTableVersion Operation</seealso>
DeleteTableVersionResponse EndDeleteTableVersion(IAsyncResult asyncResult);
#endregion
#region DeleteTrigger
/// <summary>
/// Deletes a specified trigger. If the trigger is not found, no exception is thrown.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteTrigger service method.</param>
///
/// <returns>The response from the DeleteTrigger service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.ConcurrentModificationException">
/// Two processes are trying to modify a resource simultaneously.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteTrigger">REST API Reference for DeleteTrigger Operation</seealso>
DeleteTriggerResponse DeleteTrigger(DeleteTriggerRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DeleteTrigger operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteTrigger operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteTrigger
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteTrigger">REST API Reference for DeleteTrigger Operation</seealso>
IAsyncResult BeginDeleteTrigger(DeleteTriggerRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DeleteTrigger operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteTrigger.</param>
///
/// <returns>Returns a DeleteTriggerResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteTrigger">REST API Reference for DeleteTrigger Operation</seealso>
DeleteTriggerResponse EndDeleteTrigger(IAsyncResult asyncResult);
#endregion
#region DeleteUserDefinedFunction
/// <summary>
/// Deletes an existing function definition from the Data Catalog.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteUserDefinedFunction service method.</param>
///
/// <returns>The response from the DeleteUserDefinedFunction service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteUserDefinedFunction">REST API Reference for DeleteUserDefinedFunction Operation</seealso>
DeleteUserDefinedFunctionResponse DeleteUserDefinedFunction(DeleteUserDefinedFunctionRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DeleteUserDefinedFunction operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteUserDefinedFunction operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteUserDefinedFunction
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteUserDefinedFunction">REST API Reference for DeleteUserDefinedFunction Operation</seealso>
IAsyncResult BeginDeleteUserDefinedFunction(DeleteUserDefinedFunctionRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DeleteUserDefinedFunction operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteUserDefinedFunction.</param>
///
/// <returns>Returns a DeleteUserDefinedFunctionResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteUserDefinedFunction">REST API Reference for DeleteUserDefinedFunction Operation</seealso>
DeleteUserDefinedFunctionResponse EndDeleteUserDefinedFunction(IAsyncResult asyncResult);
#endregion
#region GetCatalogImportStatus
/// <summary>
/// Retrieves the status of a migration operation.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetCatalogImportStatus service method.</param>
///
/// <returns>The response from the GetCatalogImportStatus service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetCatalogImportStatus">REST API Reference for GetCatalogImportStatus Operation</seealso>
GetCatalogImportStatusResponse GetCatalogImportStatus(GetCatalogImportStatusRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetCatalogImportStatus operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetCatalogImportStatus operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetCatalogImportStatus
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetCatalogImportStatus">REST API Reference for GetCatalogImportStatus Operation</seealso>
IAsyncResult BeginGetCatalogImportStatus(GetCatalogImportStatusRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetCatalogImportStatus operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetCatalogImportStatus.</param>
///
/// <returns>Returns a GetCatalogImportStatusResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetCatalogImportStatus">REST API Reference for GetCatalogImportStatus Operation</seealso>
GetCatalogImportStatusResponse EndGetCatalogImportStatus(IAsyncResult asyncResult);
#endregion
#region GetClassifier
/// <summary>
/// Retrieve a classifier by name.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetClassifier service method.</param>
///
/// <returns>The response from the GetClassifier service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetClassifier">REST API Reference for GetClassifier Operation</seealso>
GetClassifierResponse GetClassifier(GetClassifierRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetClassifier operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetClassifier operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetClassifier
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetClassifier">REST API Reference for GetClassifier Operation</seealso>
IAsyncResult BeginGetClassifier(GetClassifierRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetClassifier operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetClassifier.</param>
///
/// <returns>Returns a GetClassifierResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetClassifier">REST API Reference for GetClassifier Operation</seealso>
GetClassifierResponse EndGetClassifier(IAsyncResult asyncResult);
#endregion
#region GetClassifiers
/// <summary>
/// Lists all classifier objects in the Data Catalog.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetClassifiers service method.</param>
///
/// <returns>The response from the GetClassifiers service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetClassifiers">REST API Reference for GetClassifiers Operation</seealso>
GetClassifiersResponse GetClassifiers(GetClassifiersRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetClassifiers operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetClassifiers operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetClassifiers
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetClassifiers">REST API Reference for GetClassifiers Operation</seealso>
IAsyncResult BeginGetClassifiers(GetClassifiersRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetClassifiers operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetClassifiers.</param>
///
/// <returns>Returns a GetClassifiersResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetClassifiers">REST API Reference for GetClassifiers Operation</seealso>
GetClassifiersResponse EndGetClassifiers(IAsyncResult asyncResult);
#endregion
#region GetConnection
/// <summary>
/// Retrieves a connection definition from the Data Catalog.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetConnection service method.</param>
///
/// <returns>The response from the GetConnection service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.GlueEncryptionException">
/// An encryption operation failed.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetConnection">REST API Reference for GetConnection Operation</seealso>
GetConnectionResponse GetConnection(GetConnectionRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetConnection operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetConnection operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetConnection
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetConnection">REST API Reference for GetConnection Operation</seealso>
IAsyncResult BeginGetConnection(GetConnectionRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetConnection operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetConnection.</param>
///
/// <returns>Returns a GetConnectionResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetConnection">REST API Reference for GetConnection Operation</seealso>
GetConnectionResponse EndGetConnection(IAsyncResult asyncResult);
#endregion
#region GetConnections
/// <summary>
/// Retrieves a list of connection definitions from the Data Catalog.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetConnections service method.</param>
///
/// <returns>The response from the GetConnections service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.GlueEncryptionException">
/// An encryption operation failed.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetConnections">REST API Reference for GetConnections Operation</seealso>
GetConnectionsResponse GetConnections(GetConnectionsRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetConnections operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetConnections operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetConnections
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetConnections">REST API Reference for GetConnections Operation</seealso>
IAsyncResult BeginGetConnections(GetConnectionsRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetConnections operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetConnections.</param>
///
/// <returns>Returns a GetConnectionsResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetConnections">REST API Reference for GetConnections Operation</seealso>
GetConnectionsResponse EndGetConnections(IAsyncResult asyncResult);
#endregion
#region GetCrawler
/// <summary>
/// Retrieves metadata for a specified crawler.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetCrawler service method.</param>
///
/// <returns>The response from the GetCrawler service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetCrawler">REST API Reference for GetCrawler Operation</seealso>
GetCrawlerResponse GetCrawler(GetCrawlerRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetCrawler operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetCrawler operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetCrawler
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetCrawler">REST API Reference for GetCrawler Operation</seealso>
IAsyncResult BeginGetCrawler(GetCrawlerRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetCrawler operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetCrawler.</param>
///
/// <returns>Returns a GetCrawlerResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetCrawler">REST API Reference for GetCrawler Operation</seealso>
GetCrawlerResponse EndGetCrawler(IAsyncResult asyncResult);
#endregion
#region GetCrawlerMetrics
/// <summary>
/// Retrieves metrics about specified crawlers.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetCrawlerMetrics service method.</param>
///
/// <returns>The response from the GetCrawlerMetrics service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetCrawlerMetrics">REST API Reference for GetCrawlerMetrics Operation</seealso>
GetCrawlerMetricsResponse GetCrawlerMetrics(GetCrawlerMetricsRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetCrawlerMetrics operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetCrawlerMetrics operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetCrawlerMetrics
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetCrawlerMetrics">REST API Reference for GetCrawlerMetrics Operation</seealso>
IAsyncResult BeginGetCrawlerMetrics(GetCrawlerMetricsRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetCrawlerMetrics operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetCrawlerMetrics.</param>
///
/// <returns>Returns a GetCrawlerMetricsResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetCrawlerMetrics">REST API Reference for GetCrawlerMetrics Operation</seealso>
GetCrawlerMetricsResponse EndGetCrawlerMetrics(IAsyncResult asyncResult);
#endregion
#region GetCrawlers
/// <summary>
/// Retrieves metadata for all crawlers defined in the customer account.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetCrawlers service method.</param>
///
/// <returns>The response from the GetCrawlers service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetCrawlers">REST API Reference for GetCrawlers Operation</seealso>
GetCrawlersResponse GetCrawlers(GetCrawlersRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetCrawlers operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetCrawlers operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetCrawlers
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetCrawlers">REST API Reference for GetCrawlers Operation</seealso>
IAsyncResult BeginGetCrawlers(GetCrawlersRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetCrawlers operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetCrawlers.</param>
///
/// <returns>Returns a GetCrawlersResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetCrawlers">REST API Reference for GetCrawlers Operation</seealso>
GetCrawlersResponse EndGetCrawlers(IAsyncResult asyncResult);
#endregion
#region GetDatabase
/// <summary>
/// Retrieves the definition of a specified database.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetDatabase service method.</param>
///
/// <returns>The response from the GetDatabase service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.GlueEncryptionException">
/// An encryption operation failed.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetDatabase">REST API Reference for GetDatabase Operation</seealso>
GetDatabaseResponse GetDatabase(GetDatabaseRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetDatabase operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetDatabase operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetDatabase
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetDatabase">REST API Reference for GetDatabase Operation</seealso>
IAsyncResult BeginGetDatabase(GetDatabaseRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetDatabase operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetDatabase.</param>
///
/// <returns>Returns a GetDatabaseResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetDatabase">REST API Reference for GetDatabase Operation</seealso>
GetDatabaseResponse EndGetDatabase(IAsyncResult asyncResult);
#endregion
#region GetDatabases
/// <summary>
/// Retrieves all Databases defined in a given Data Catalog.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetDatabases service method.</param>
///
/// <returns>The response from the GetDatabases service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.GlueEncryptionException">
/// An encryption operation failed.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetDatabases">REST API Reference for GetDatabases Operation</seealso>
GetDatabasesResponse GetDatabases(GetDatabasesRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetDatabases operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetDatabases operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetDatabases
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetDatabases">REST API Reference for GetDatabases Operation</seealso>
IAsyncResult BeginGetDatabases(GetDatabasesRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetDatabases operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetDatabases.</param>
///
/// <returns>Returns a GetDatabasesResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetDatabases">REST API Reference for GetDatabases Operation</seealso>
GetDatabasesResponse EndGetDatabases(IAsyncResult asyncResult);
#endregion
#region GetDataCatalogEncryptionSettings
/// <summary>
/// Retrieves the security configuration for a specified catalog.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetDataCatalogEncryptionSettings service method.</param>
///
/// <returns>The response from the GetDataCatalogEncryptionSettings service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetDataCatalogEncryptionSettings">REST API Reference for GetDataCatalogEncryptionSettings Operation</seealso>
GetDataCatalogEncryptionSettingsResponse GetDataCatalogEncryptionSettings(GetDataCatalogEncryptionSettingsRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetDataCatalogEncryptionSettings operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetDataCatalogEncryptionSettings operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetDataCatalogEncryptionSettings
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetDataCatalogEncryptionSettings">REST API Reference for GetDataCatalogEncryptionSettings Operation</seealso>
IAsyncResult BeginGetDataCatalogEncryptionSettings(GetDataCatalogEncryptionSettingsRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetDataCatalogEncryptionSettings operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetDataCatalogEncryptionSettings.</param>
///
/// <returns>Returns a GetDataCatalogEncryptionSettingsResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetDataCatalogEncryptionSettings">REST API Reference for GetDataCatalogEncryptionSettings Operation</seealso>
GetDataCatalogEncryptionSettingsResponse EndGetDataCatalogEncryptionSettings(IAsyncResult asyncResult);
#endregion
#region GetDataflowGraph
/// <summary>
/// Transforms a Python script into a directed acyclic graph (DAG).
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetDataflowGraph service method.</param>
///
/// <returns>The response from the GetDataflowGraph service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetDataflowGraph">REST API Reference for GetDataflowGraph Operation</seealso>
GetDataflowGraphResponse GetDataflowGraph(GetDataflowGraphRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetDataflowGraph operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetDataflowGraph operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetDataflowGraph
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetDataflowGraph">REST API Reference for GetDataflowGraph Operation</seealso>
IAsyncResult BeginGetDataflowGraph(GetDataflowGraphRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetDataflowGraph operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetDataflowGraph.</param>
///
/// <returns>Returns a GetDataflowGraphResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetDataflowGraph">REST API Reference for GetDataflowGraph Operation</seealso>
GetDataflowGraphResponse EndGetDataflowGraph(IAsyncResult asyncResult);
#endregion
#region GetDevEndpoint
/// <summary>
/// Retrieves information about a specified DevEndpoint.
///
/// <note>
/// <para>
/// When you create a development endpoint in a virtual private cloud (VPC), AWS Glue
/// returns only a private IP address, and the public IP address field is not populated.
/// When you create a non-VPC development endpoint, AWS Glue returns only a public IP
/// address.
/// </para>
/// </note>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetDevEndpoint service method.</param>
///
/// <returns>The response from the GetDevEndpoint service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetDevEndpoint">REST API Reference for GetDevEndpoint Operation</seealso>
GetDevEndpointResponse GetDevEndpoint(GetDevEndpointRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetDevEndpoint operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetDevEndpoint operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetDevEndpoint
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetDevEndpoint">REST API Reference for GetDevEndpoint Operation</seealso>
IAsyncResult BeginGetDevEndpoint(GetDevEndpointRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetDevEndpoint operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetDevEndpoint.</param>
///
/// <returns>Returns a GetDevEndpointResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetDevEndpoint">REST API Reference for GetDevEndpoint Operation</seealso>
GetDevEndpointResponse EndGetDevEndpoint(IAsyncResult asyncResult);
#endregion
#region GetDevEndpoints
/// <summary>
/// Retrieves all the DevEndpoints in this AWS account.
///
/// <note>
/// <para>
/// When you create a development endpoint in a virtual private cloud (VPC), AWS Glue
/// returns only a private IP address and the public IP address field is not populated.
/// When you create a non-VPC development endpoint, AWS Glue returns only a public IP
/// address.
/// </para>
/// </note>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetDevEndpoints service method.</param>
///
/// <returns>The response from the GetDevEndpoints service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetDevEndpoints">REST API Reference for GetDevEndpoints Operation</seealso>
GetDevEndpointsResponse GetDevEndpoints(GetDevEndpointsRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetDevEndpoints operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetDevEndpoints operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetDevEndpoints
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetDevEndpoints">REST API Reference for GetDevEndpoints Operation</seealso>
IAsyncResult BeginGetDevEndpoints(GetDevEndpointsRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetDevEndpoints operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetDevEndpoints.</param>
///
/// <returns>Returns a GetDevEndpointsResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetDevEndpoints">REST API Reference for GetDevEndpoints Operation</seealso>
GetDevEndpointsResponse EndGetDevEndpoints(IAsyncResult asyncResult);
#endregion
#region GetJob
/// <summary>
/// Retrieves an existing job definition.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetJob service method.</param>
///
/// <returns>The response from the GetJob service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetJob">REST API Reference for GetJob Operation</seealso>
GetJobResponse GetJob(GetJobRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetJob operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetJob operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetJob
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetJob">REST API Reference for GetJob Operation</seealso>
IAsyncResult BeginGetJob(GetJobRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetJob operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetJob.</param>
///
/// <returns>Returns a GetJobResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetJob">REST API Reference for GetJob Operation</seealso>
GetJobResponse EndGetJob(IAsyncResult asyncResult);
#endregion
#region GetJobRun
/// <summary>
/// Retrieves the metadata for a given job run.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetJobRun service method.</param>
///
/// <returns>The response from the GetJobRun service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetJobRun">REST API Reference for GetJobRun Operation</seealso>
GetJobRunResponse GetJobRun(GetJobRunRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetJobRun operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetJobRun operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetJobRun
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetJobRun">REST API Reference for GetJobRun Operation</seealso>
IAsyncResult BeginGetJobRun(GetJobRunRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetJobRun operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetJobRun.</param>
///
/// <returns>Returns a GetJobRunResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetJobRun">REST API Reference for GetJobRun Operation</seealso>
GetJobRunResponse EndGetJobRun(IAsyncResult asyncResult);
#endregion
#region GetJobRuns
/// <summary>
/// Retrieves metadata for all runs of a given job definition.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetJobRuns service method.</param>
///
/// <returns>The response from the GetJobRuns service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetJobRuns">REST API Reference for GetJobRuns Operation</seealso>
GetJobRunsResponse GetJobRuns(GetJobRunsRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetJobRuns operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetJobRuns operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetJobRuns
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetJobRuns">REST API Reference for GetJobRuns Operation</seealso>
IAsyncResult BeginGetJobRuns(GetJobRunsRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetJobRuns operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetJobRuns.</param>
///
/// <returns>Returns a GetJobRunsResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetJobRuns">REST API Reference for GetJobRuns Operation</seealso>
GetJobRunsResponse EndGetJobRuns(IAsyncResult asyncResult);
#endregion
#region GetJobs
/// <summary>
/// Retrieves all current job definitions.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetJobs service method.</param>
///
/// <returns>The response from the GetJobs service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetJobs">REST API Reference for GetJobs Operation</seealso>
GetJobsResponse GetJobs(GetJobsRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetJobs operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetJobs operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetJobs
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetJobs">REST API Reference for GetJobs Operation</seealso>
IAsyncResult BeginGetJobs(GetJobsRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetJobs operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetJobs.</param>
///
/// <returns>Returns a GetJobsResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetJobs">REST API Reference for GetJobs Operation</seealso>
GetJobsResponse EndGetJobs(IAsyncResult asyncResult);
#endregion
#region GetMapping
/// <summary>
/// Creates mappings.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetMapping service method.</param>
///
/// <returns>The response from the GetMapping service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetMapping">REST API Reference for GetMapping Operation</seealso>
GetMappingResponse GetMapping(GetMappingRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetMapping operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetMapping operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetMapping
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetMapping">REST API Reference for GetMapping Operation</seealso>
IAsyncResult BeginGetMapping(GetMappingRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetMapping operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetMapping.</param>
///
/// <returns>Returns a GetMappingResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetMapping">REST API Reference for GetMapping Operation</seealso>
GetMappingResponse EndGetMapping(IAsyncResult asyncResult);
#endregion
#region GetPartition
/// <summary>
/// Retrieves information about a specified partition.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetPartition service method.</param>
///
/// <returns>The response from the GetPartition service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.GlueEncryptionException">
/// An encryption operation failed.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetPartition">REST API Reference for GetPartition Operation</seealso>
GetPartitionResponse GetPartition(GetPartitionRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetPartition operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetPartition operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetPartition
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetPartition">REST API Reference for GetPartition Operation</seealso>
IAsyncResult BeginGetPartition(GetPartitionRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetPartition operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetPartition.</param>
///
/// <returns>Returns a GetPartitionResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetPartition">REST API Reference for GetPartition Operation</seealso>
GetPartitionResponse EndGetPartition(IAsyncResult asyncResult);
#endregion
#region GetPartitions
/// <summary>
/// Retrieves information about the partitions in a table.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetPartitions service method.</param>
///
/// <returns>The response from the GetPartitions service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.GlueEncryptionException">
/// An encryption operation failed.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetPartitions">REST API Reference for GetPartitions Operation</seealso>
GetPartitionsResponse GetPartitions(GetPartitionsRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetPartitions operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetPartitions operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetPartitions
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetPartitions">REST API Reference for GetPartitions Operation</seealso>
IAsyncResult BeginGetPartitions(GetPartitionsRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetPartitions operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetPartitions.</param>
///
/// <returns>Returns a GetPartitionsResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetPartitions">REST API Reference for GetPartitions Operation</seealso>
GetPartitionsResponse EndGetPartitions(IAsyncResult asyncResult);
#endregion
#region GetPlan
/// <summary>
/// Gets code to perform a specified mapping.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetPlan service method.</param>
///
/// <returns>The response from the GetPlan service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetPlan">REST API Reference for GetPlan Operation</seealso>
GetPlanResponse GetPlan(GetPlanRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetPlan operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetPlan operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetPlan
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetPlan">REST API Reference for GetPlan Operation</seealso>
IAsyncResult BeginGetPlan(GetPlanRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetPlan operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetPlan.</param>
///
/// <returns>Returns a GetPlanResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetPlan">REST API Reference for GetPlan Operation</seealso>
GetPlanResponse EndGetPlan(IAsyncResult asyncResult);
#endregion
#region GetResourcePolicy
/// <summary>
/// Retrieves a specified resource policy.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetResourcePolicy service method.</param>
///
/// <returns>The response from the GetResourcePolicy service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetResourcePolicy">REST API Reference for GetResourcePolicy Operation</seealso>
GetResourcePolicyResponse GetResourcePolicy(GetResourcePolicyRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetResourcePolicy operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetResourcePolicy operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetResourcePolicy
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetResourcePolicy">REST API Reference for GetResourcePolicy Operation</seealso>
IAsyncResult BeginGetResourcePolicy(GetResourcePolicyRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetResourcePolicy operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetResourcePolicy.</param>
///
/// <returns>Returns a GetResourcePolicyResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetResourcePolicy">REST API Reference for GetResourcePolicy Operation</seealso>
GetResourcePolicyResponse EndGetResourcePolicy(IAsyncResult asyncResult);
#endregion
#region GetSecurityConfiguration
/// <summary>
/// Retrieves a specified security configuration.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetSecurityConfiguration service method.</param>
///
/// <returns>The response from the GetSecurityConfiguration service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetSecurityConfiguration">REST API Reference for GetSecurityConfiguration Operation</seealso>
GetSecurityConfigurationResponse GetSecurityConfiguration(GetSecurityConfigurationRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetSecurityConfiguration operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetSecurityConfiguration operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetSecurityConfiguration
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetSecurityConfiguration">REST API Reference for GetSecurityConfiguration Operation</seealso>
IAsyncResult BeginGetSecurityConfiguration(GetSecurityConfigurationRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetSecurityConfiguration operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetSecurityConfiguration.</param>
///
/// <returns>Returns a GetSecurityConfigurationResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetSecurityConfiguration">REST API Reference for GetSecurityConfiguration Operation</seealso>
GetSecurityConfigurationResponse EndGetSecurityConfiguration(IAsyncResult asyncResult);
#endregion
#region GetSecurityConfigurations
/// <summary>
/// Retrieves a list of all security configurations.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetSecurityConfigurations service method.</param>
///
/// <returns>The response from the GetSecurityConfigurations service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetSecurityConfigurations">REST API Reference for GetSecurityConfigurations Operation</seealso>
GetSecurityConfigurationsResponse GetSecurityConfigurations(GetSecurityConfigurationsRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetSecurityConfigurations operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetSecurityConfigurations operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetSecurityConfigurations
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetSecurityConfigurations">REST API Reference for GetSecurityConfigurations Operation</seealso>
IAsyncResult BeginGetSecurityConfigurations(GetSecurityConfigurationsRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetSecurityConfigurations operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetSecurityConfigurations.</param>
///
/// <returns>Returns a GetSecurityConfigurationsResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetSecurityConfigurations">REST API Reference for GetSecurityConfigurations Operation</seealso>
GetSecurityConfigurationsResponse EndGetSecurityConfigurations(IAsyncResult asyncResult);
#endregion
#region GetTable
/// <summary>
/// Retrieves the <code>Table</code> definition in a Data Catalog for a specified table.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetTable service method.</param>
///
/// <returns>The response from the GetTable service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.GlueEncryptionException">
/// An encryption operation failed.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetTable">REST API Reference for GetTable Operation</seealso>
GetTableResponse GetTable(GetTableRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetTable operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetTable operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetTable
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetTable">REST API Reference for GetTable Operation</seealso>
IAsyncResult BeginGetTable(GetTableRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetTable operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetTable.</param>
///
/// <returns>Returns a GetTableResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetTable">REST API Reference for GetTable Operation</seealso>
GetTableResponse EndGetTable(IAsyncResult asyncResult);
#endregion
#region GetTables
/// <summary>
/// Retrieves the definitions of some or all of the tables in a given <code>Database</code>.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetTables service method.</param>
///
/// <returns>The response from the GetTables service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.GlueEncryptionException">
/// An encryption operation failed.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetTables">REST API Reference for GetTables Operation</seealso>
GetTablesResponse GetTables(GetTablesRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetTables operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetTables operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetTables
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetTables">REST API Reference for GetTables Operation</seealso>
IAsyncResult BeginGetTables(GetTablesRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetTables operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetTables.</param>
///
/// <returns>Returns a GetTablesResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetTables">REST API Reference for GetTables Operation</seealso>
GetTablesResponse EndGetTables(IAsyncResult asyncResult);
#endregion
#region GetTableVersion
/// <summary>
/// Retrieves a specified version of a table.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetTableVersion service method.</param>
///
/// <returns>The response from the GetTableVersion service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.GlueEncryptionException">
/// An encryption operation failed.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetTableVersion">REST API Reference for GetTableVersion Operation</seealso>
GetTableVersionResponse GetTableVersion(GetTableVersionRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetTableVersion operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetTableVersion operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetTableVersion
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetTableVersion">REST API Reference for GetTableVersion Operation</seealso>
IAsyncResult BeginGetTableVersion(GetTableVersionRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetTableVersion operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetTableVersion.</param>
///
/// <returns>Returns a GetTableVersionResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetTableVersion">REST API Reference for GetTableVersion Operation</seealso>
GetTableVersionResponse EndGetTableVersion(IAsyncResult asyncResult);
#endregion
#region GetTableVersions
/// <summary>
/// Retrieves a list of strings that identify available versions of a specified table.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetTableVersions service method.</param>
///
/// <returns>The response from the GetTableVersions service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.GlueEncryptionException">
/// An encryption operation failed.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetTableVersions">REST API Reference for GetTableVersions Operation</seealso>
GetTableVersionsResponse GetTableVersions(GetTableVersionsRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetTableVersions operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetTableVersions operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetTableVersions
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetTableVersions">REST API Reference for GetTableVersions Operation</seealso>
IAsyncResult BeginGetTableVersions(GetTableVersionsRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetTableVersions operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetTableVersions.</param>
///
/// <returns>Returns a GetTableVersionsResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetTableVersions">REST API Reference for GetTableVersions Operation</seealso>
GetTableVersionsResponse EndGetTableVersions(IAsyncResult asyncResult);
#endregion
#region GetTags
/// <summary>
/// Retrieves a list of tags associated with a resource.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetTags service method.</param>
///
/// <returns>The response from the GetTags service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetTags">REST API Reference for GetTags Operation</seealso>
GetTagsResponse GetTags(GetTagsRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetTags operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetTags operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetTags
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetTags">REST API Reference for GetTags Operation</seealso>
IAsyncResult BeginGetTags(GetTagsRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetTags operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetTags.</param>
///
/// <returns>Returns a GetTagsResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetTags">REST API Reference for GetTags Operation</seealso>
GetTagsResponse EndGetTags(IAsyncResult asyncResult);
#endregion
#region GetTrigger
/// <summary>
/// Retrieves the definition of a trigger.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetTrigger service method.</param>
///
/// <returns>The response from the GetTrigger service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetTrigger">REST API Reference for GetTrigger Operation</seealso>
GetTriggerResponse GetTrigger(GetTriggerRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetTrigger operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetTrigger operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetTrigger
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetTrigger">REST API Reference for GetTrigger Operation</seealso>
IAsyncResult BeginGetTrigger(GetTriggerRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetTrigger operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetTrigger.</param>
///
/// <returns>Returns a GetTriggerResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetTrigger">REST API Reference for GetTrigger Operation</seealso>
GetTriggerResponse EndGetTrigger(IAsyncResult asyncResult);
#endregion
#region GetTriggers
/// <summary>
/// Gets all the triggers associated with a job.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetTriggers service method.</param>
///
/// <returns>The response from the GetTriggers service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetTriggers">REST API Reference for GetTriggers Operation</seealso>
GetTriggersResponse GetTriggers(GetTriggersRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetTriggers operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetTriggers operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetTriggers
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetTriggers">REST API Reference for GetTriggers Operation</seealso>
IAsyncResult BeginGetTriggers(GetTriggersRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetTriggers operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetTriggers.</param>
///
/// <returns>Returns a GetTriggersResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetTriggers">REST API Reference for GetTriggers Operation</seealso>
GetTriggersResponse EndGetTriggers(IAsyncResult asyncResult);
#endregion
#region GetUserDefinedFunction
/// <summary>
/// Retrieves a specified function definition from the Data Catalog.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetUserDefinedFunction service method.</param>
///
/// <returns>The response from the GetUserDefinedFunction service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.GlueEncryptionException">
/// An encryption operation failed.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetUserDefinedFunction">REST API Reference for GetUserDefinedFunction Operation</seealso>
GetUserDefinedFunctionResponse GetUserDefinedFunction(GetUserDefinedFunctionRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetUserDefinedFunction operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetUserDefinedFunction operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetUserDefinedFunction
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetUserDefinedFunction">REST API Reference for GetUserDefinedFunction Operation</seealso>
IAsyncResult BeginGetUserDefinedFunction(GetUserDefinedFunctionRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetUserDefinedFunction operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetUserDefinedFunction.</param>
///
/// <returns>Returns a GetUserDefinedFunctionResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetUserDefinedFunction">REST API Reference for GetUserDefinedFunction Operation</seealso>
GetUserDefinedFunctionResponse EndGetUserDefinedFunction(IAsyncResult asyncResult);
#endregion
#region GetUserDefinedFunctions
/// <summary>
/// Retrieves a multiple function definitions from the Data Catalog.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetUserDefinedFunctions service method.</param>
///
/// <returns>The response from the GetUserDefinedFunctions service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.GlueEncryptionException">
/// An encryption operation failed.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetUserDefinedFunctions">REST API Reference for GetUserDefinedFunctions Operation</seealso>
GetUserDefinedFunctionsResponse GetUserDefinedFunctions(GetUserDefinedFunctionsRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetUserDefinedFunctions operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetUserDefinedFunctions operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetUserDefinedFunctions
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetUserDefinedFunctions">REST API Reference for GetUserDefinedFunctions Operation</seealso>
IAsyncResult BeginGetUserDefinedFunctions(GetUserDefinedFunctionsRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetUserDefinedFunctions operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetUserDefinedFunctions.</param>
///
/// <returns>Returns a GetUserDefinedFunctionsResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetUserDefinedFunctions">REST API Reference for GetUserDefinedFunctions Operation</seealso>
GetUserDefinedFunctionsResponse EndGetUserDefinedFunctions(IAsyncResult asyncResult);
#endregion
#region ImportCatalogToGlue
/// <summary>
/// Imports an existing Athena Data Catalog to AWS Glue
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ImportCatalogToGlue service method.</param>
///
/// <returns>The response from the ImportCatalogToGlue service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/ImportCatalogToGlue">REST API Reference for ImportCatalogToGlue Operation</seealso>
ImportCatalogToGlueResponse ImportCatalogToGlue(ImportCatalogToGlueRequest request);
/// <summary>
/// Initiates the asynchronous execution of the ImportCatalogToGlue operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ImportCatalogToGlue operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndImportCatalogToGlue
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/ImportCatalogToGlue">REST API Reference for ImportCatalogToGlue Operation</seealso>
IAsyncResult BeginImportCatalogToGlue(ImportCatalogToGlueRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the ImportCatalogToGlue operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginImportCatalogToGlue.</param>
///
/// <returns>Returns a ImportCatalogToGlueResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/ImportCatalogToGlue">REST API Reference for ImportCatalogToGlue Operation</seealso>
ImportCatalogToGlueResponse EndImportCatalogToGlue(IAsyncResult asyncResult);
#endregion
#region ListCrawlers
/// <summary>
/// Retrieves the names of all crawler resources in this AWS account, or the resources
/// with the specified tag. This operation allows you to see which resources are available
/// in your account, and their names.
///
///
/// <para>
/// This operation takes the optional <code>Tags</code> field, which you can use as a
/// filter on the response so that tagged resources can be retrieved as a group. If you
/// choose to use tags filtering, only resources with the tag are retrieved.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ListCrawlers service method.</param>
///
/// <returns>The response from the ListCrawlers service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/ListCrawlers">REST API Reference for ListCrawlers Operation</seealso>
ListCrawlersResponse ListCrawlers(ListCrawlersRequest request);
/// <summary>
/// Initiates the asynchronous execution of the ListCrawlers operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListCrawlers operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndListCrawlers
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/ListCrawlers">REST API Reference for ListCrawlers Operation</seealso>
IAsyncResult BeginListCrawlers(ListCrawlersRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the ListCrawlers operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginListCrawlers.</param>
///
/// <returns>Returns a ListCrawlersResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/ListCrawlers">REST API Reference for ListCrawlers Operation</seealso>
ListCrawlersResponse EndListCrawlers(IAsyncResult asyncResult);
#endregion
#region ListDevEndpoints
/// <summary>
/// Retrieves the names of all <code>DevEndpoint</code> resources in this AWS account,
/// or the resources with the specified tag. This operation allows you to see which resources
/// are available in your account, and their names.
///
///
/// <para>
/// This operation takes the optional <code>Tags</code> field, which you can use as a
/// filter on the response so that tagged resources can be retrieved as a group. If you
/// choose to use tags filtering, only resources with the tag are retrieved.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ListDevEndpoints service method.</param>
///
/// <returns>The response from the ListDevEndpoints service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/ListDevEndpoints">REST API Reference for ListDevEndpoints Operation</seealso>
ListDevEndpointsResponse ListDevEndpoints(ListDevEndpointsRequest request);
/// <summary>
/// Initiates the asynchronous execution of the ListDevEndpoints operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListDevEndpoints operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndListDevEndpoints
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/ListDevEndpoints">REST API Reference for ListDevEndpoints Operation</seealso>
IAsyncResult BeginListDevEndpoints(ListDevEndpointsRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the ListDevEndpoints operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginListDevEndpoints.</param>
///
/// <returns>Returns a ListDevEndpointsResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/ListDevEndpoints">REST API Reference for ListDevEndpoints Operation</seealso>
ListDevEndpointsResponse EndListDevEndpoints(IAsyncResult asyncResult);
#endregion
#region ListJobs
/// <summary>
/// Retrieves the names of all job resources in this AWS account, or the resources with
/// the specified tag. This operation allows you to see which resources are available
/// in your account, and their names.
///
///
/// <para>
/// This operation takes the optional <code>Tags</code> field, which you can use as a
/// filter on the response so that tagged resources can be retrieved as a group. If you
/// choose to use tags filtering, only resources with the tag are retrieved.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ListJobs service method.</param>
///
/// <returns>The response from the ListJobs service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/ListJobs">REST API Reference for ListJobs Operation</seealso>
ListJobsResponse ListJobs(ListJobsRequest request);
/// <summary>
/// Initiates the asynchronous execution of the ListJobs operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListJobs operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndListJobs
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/ListJobs">REST API Reference for ListJobs Operation</seealso>
IAsyncResult BeginListJobs(ListJobsRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the ListJobs operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginListJobs.</param>
///
/// <returns>Returns a ListJobsResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/ListJobs">REST API Reference for ListJobs Operation</seealso>
ListJobsResponse EndListJobs(IAsyncResult asyncResult);
#endregion
#region ListTriggers
/// <summary>
/// Retrieves the names of all trigger resources in this AWS account, or the resources
/// with the specified tag. This operation allows you to see which resources are available
/// in your account, and their names.
///
///
/// <para>
/// This operation takes the optional <code>Tags</code> field, which you can use as a
/// filter on the response so that tagged resources can be retrieved as a group. If you
/// choose to use tags filtering, only resources with the tag are retrieved.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ListTriggers service method.</param>
///
/// <returns>The response from the ListTriggers service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/ListTriggers">REST API Reference for ListTriggers Operation</seealso>
ListTriggersResponse ListTriggers(ListTriggersRequest request);
/// <summary>
/// Initiates the asynchronous execution of the ListTriggers operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListTriggers operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndListTriggers
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/ListTriggers">REST API Reference for ListTriggers Operation</seealso>
IAsyncResult BeginListTriggers(ListTriggersRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the ListTriggers operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginListTriggers.</param>
///
/// <returns>Returns a ListTriggersResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/ListTriggers">REST API Reference for ListTriggers Operation</seealso>
ListTriggersResponse EndListTriggers(IAsyncResult asyncResult);
#endregion
#region PutDataCatalogEncryptionSettings
/// <summary>
/// Sets the security configuration for a specified catalog. After the configuration has
/// been set, the specified encryption is applied to every catalog write thereafter.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the PutDataCatalogEncryptionSettings service method.</param>
///
/// <returns>The response from the PutDataCatalogEncryptionSettings service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/PutDataCatalogEncryptionSettings">REST API Reference for PutDataCatalogEncryptionSettings Operation</seealso>
PutDataCatalogEncryptionSettingsResponse PutDataCatalogEncryptionSettings(PutDataCatalogEncryptionSettingsRequest request);
/// <summary>
/// Initiates the asynchronous execution of the PutDataCatalogEncryptionSettings operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the PutDataCatalogEncryptionSettings operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndPutDataCatalogEncryptionSettings
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/PutDataCatalogEncryptionSettings">REST API Reference for PutDataCatalogEncryptionSettings Operation</seealso>
IAsyncResult BeginPutDataCatalogEncryptionSettings(PutDataCatalogEncryptionSettingsRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the PutDataCatalogEncryptionSettings operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginPutDataCatalogEncryptionSettings.</param>
///
/// <returns>Returns a PutDataCatalogEncryptionSettingsResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/PutDataCatalogEncryptionSettings">REST API Reference for PutDataCatalogEncryptionSettings Operation</seealso>
PutDataCatalogEncryptionSettingsResponse EndPutDataCatalogEncryptionSettings(IAsyncResult asyncResult);
#endregion
#region PutResourcePolicy
/// <summary>
/// Sets the Data Catalog resource policy for access control.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the PutResourcePolicy service method.</param>
///
/// <returns>The response from the PutResourcePolicy service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.ConditionCheckFailureException">
/// A specified condition was not satisfied.
/// </exception>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/PutResourcePolicy">REST API Reference for PutResourcePolicy Operation</seealso>
PutResourcePolicyResponse PutResourcePolicy(PutResourcePolicyRequest request);
/// <summary>
/// Initiates the asynchronous execution of the PutResourcePolicy operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the PutResourcePolicy operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndPutResourcePolicy
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/PutResourcePolicy">REST API Reference for PutResourcePolicy Operation</seealso>
IAsyncResult BeginPutResourcePolicy(PutResourcePolicyRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the PutResourcePolicy operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginPutResourcePolicy.</param>
///
/// <returns>Returns a PutResourcePolicyResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/PutResourcePolicy">REST API Reference for PutResourcePolicy Operation</seealso>
PutResourcePolicyResponse EndPutResourcePolicy(IAsyncResult asyncResult);
#endregion
#region ResetJobBookmark
/// <summary>
/// Resets a bookmark entry.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ResetJobBookmark service method.</param>
///
/// <returns>The response from the ResetJobBookmark service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/ResetJobBookmark">REST API Reference for ResetJobBookmark Operation</seealso>
ResetJobBookmarkResponse ResetJobBookmark(ResetJobBookmarkRequest request);
/// <summary>
/// Initiates the asynchronous execution of the ResetJobBookmark operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ResetJobBookmark operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndResetJobBookmark
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/ResetJobBookmark">REST API Reference for ResetJobBookmark Operation</seealso>
IAsyncResult BeginResetJobBookmark(ResetJobBookmarkRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the ResetJobBookmark operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginResetJobBookmark.</param>
///
/// <returns>Returns a ResetJobBookmarkResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/ResetJobBookmark">REST API Reference for ResetJobBookmark Operation</seealso>
ResetJobBookmarkResponse EndResetJobBookmark(IAsyncResult asyncResult);
#endregion
#region StartCrawler
/// <summary>
/// Starts a crawl using the specified crawler, regardless of what is scheduled. If the
/// crawler is already running, returns a <a href="https://docs.aws.amazon.com/glue/latest/dg/aws-glue-api-exceptions.html#aws-glue-api-exceptions-CrawlerRunningException">CrawlerRunningException</a>.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the StartCrawler service method.</param>
///
/// <returns>The response from the StartCrawler service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.CrawlerRunningException">
/// The operation cannot be performed because the crawler is already running.
/// </exception>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/StartCrawler">REST API Reference for StartCrawler Operation</seealso>
StartCrawlerResponse StartCrawler(StartCrawlerRequest request);
/// <summary>
/// Initiates the asynchronous execution of the StartCrawler operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the StartCrawler operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndStartCrawler
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/StartCrawler">REST API Reference for StartCrawler Operation</seealso>
IAsyncResult BeginStartCrawler(StartCrawlerRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the StartCrawler operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginStartCrawler.</param>
///
/// <returns>Returns a StartCrawlerResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/StartCrawler">REST API Reference for StartCrawler Operation</seealso>
StartCrawlerResponse EndStartCrawler(IAsyncResult asyncResult);
#endregion
#region StartCrawlerSchedule
/// <summary>
/// Changes the schedule state of the specified crawler to <code>SCHEDULED</code>, unless
/// the crawler is already running or the schedule state is already <code>SCHEDULED</code>.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the StartCrawlerSchedule service method.</param>
///
/// <returns>The response from the StartCrawlerSchedule service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.NoScheduleException">
/// There is no applicable schedule.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <exception cref="Amazon.Glue.Model.SchedulerRunningException">
/// The specified scheduler is already running.
/// </exception>
/// <exception cref="Amazon.Glue.Model.SchedulerTransitioningException">
/// The specified scheduler is transitioning.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/StartCrawlerSchedule">REST API Reference for StartCrawlerSchedule Operation</seealso>
StartCrawlerScheduleResponse StartCrawlerSchedule(StartCrawlerScheduleRequest request);
/// <summary>
/// Initiates the asynchronous execution of the StartCrawlerSchedule operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the StartCrawlerSchedule operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndStartCrawlerSchedule
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/StartCrawlerSchedule">REST API Reference for StartCrawlerSchedule Operation</seealso>
IAsyncResult BeginStartCrawlerSchedule(StartCrawlerScheduleRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the StartCrawlerSchedule operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginStartCrawlerSchedule.</param>
///
/// <returns>Returns a StartCrawlerScheduleResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/StartCrawlerSchedule">REST API Reference for StartCrawlerSchedule Operation</seealso>
StartCrawlerScheduleResponse EndStartCrawlerSchedule(IAsyncResult asyncResult);
#endregion
#region StartJobRun
/// <summary>
/// Starts a job run using a job definition.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the StartJobRun service method.</param>
///
/// <returns>The response from the StartJobRun service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.ConcurrentRunsExceededException">
/// Too many jobs are being run concurrently.
/// </exception>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <exception cref="Amazon.Glue.Model.ResourceNumberLimitExceededException">
/// A resource numerical limit was exceeded.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/StartJobRun">REST API Reference for StartJobRun Operation</seealso>
StartJobRunResponse StartJobRun(StartJobRunRequest request);
/// <summary>
/// Initiates the asynchronous execution of the StartJobRun operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the StartJobRun operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndStartJobRun
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/StartJobRun">REST API Reference for StartJobRun Operation</seealso>
IAsyncResult BeginStartJobRun(StartJobRunRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the StartJobRun operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginStartJobRun.</param>
///
/// <returns>Returns a StartJobRunResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/StartJobRun">REST API Reference for StartJobRun Operation</seealso>
StartJobRunResponse EndStartJobRun(IAsyncResult asyncResult);
#endregion
#region StartTrigger
/// <summary>
/// Starts an existing trigger. See <a href="https://docs.aws.amazon.com/glue/latest/dg/trigger-job.html">Triggering
/// Jobs</a> for information about how different types of trigger are started.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the StartTrigger service method.</param>
///
/// <returns>The response from the StartTrigger service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.ConcurrentRunsExceededException">
/// Too many jobs are being run concurrently.
/// </exception>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <exception cref="Amazon.Glue.Model.ResourceNumberLimitExceededException">
/// A resource numerical limit was exceeded.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/StartTrigger">REST API Reference for StartTrigger Operation</seealso>
StartTriggerResponse StartTrigger(StartTriggerRequest request);
/// <summary>
/// Initiates the asynchronous execution of the StartTrigger operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the StartTrigger operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndStartTrigger
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/StartTrigger">REST API Reference for StartTrigger Operation</seealso>
IAsyncResult BeginStartTrigger(StartTriggerRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the StartTrigger operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginStartTrigger.</param>
///
/// <returns>Returns a StartTriggerResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/StartTrigger">REST API Reference for StartTrigger Operation</seealso>
StartTriggerResponse EndStartTrigger(IAsyncResult asyncResult);
#endregion
#region StopCrawler
/// <summary>
/// If the specified crawler is running, stops the crawl.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the StopCrawler service method.</param>
///
/// <returns>The response from the StopCrawler service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.CrawlerNotRunningException">
/// The specified crawler is not running.
/// </exception>
/// <exception cref="Amazon.Glue.Model.CrawlerStoppingException">
/// The specified crawler is stopping.
/// </exception>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/StopCrawler">REST API Reference for StopCrawler Operation</seealso>
StopCrawlerResponse StopCrawler(StopCrawlerRequest request);
/// <summary>
/// Initiates the asynchronous execution of the StopCrawler operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the StopCrawler operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndStopCrawler
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/StopCrawler">REST API Reference for StopCrawler Operation</seealso>
IAsyncResult BeginStopCrawler(StopCrawlerRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the StopCrawler operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginStopCrawler.</param>
///
/// <returns>Returns a StopCrawlerResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/StopCrawler">REST API Reference for StopCrawler Operation</seealso>
StopCrawlerResponse EndStopCrawler(IAsyncResult asyncResult);
#endregion
#region StopCrawlerSchedule
/// <summary>
/// Sets the schedule state of the specified crawler to <code>NOT_SCHEDULED</code>, but
/// does not stop the crawler if it is already running.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the StopCrawlerSchedule service method.</param>
///
/// <returns>The response from the StopCrawlerSchedule service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <exception cref="Amazon.Glue.Model.SchedulerNotRunningException">
/// The specified scheduler is not running.
/// </exception>
/// <exception cref="Amazon.Glue.Model.SchedulerTransitioningException">
/// The specified scheduler is transitioning.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/StopCrawlerSchedule">REST API Reference for StopCrawlerSchedule Operation</seealso>
StopCrawlerScheduleResponse StopCrawlerSchedule(StopCrawlerScheduleRequest request);
/// <summary>
/// Initiates the asynchronous execution of the StopCrawlerSchedule operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the StopCrawlerSchedule operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndStopCrawlerSchedule
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/StopCrawlerSchedule">REST API Reference for StopCrawlerSchedule Operation</seealso>
IAsyncResult BeginStopCrawlerSchedule(StopCrawlerScheduleRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the StopCrawlerSchedule operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginStopCrawlerSchedule.</param>
///
/// <returns>Returns a StopCrawlerScheduleResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/StopCrawlerSchedule">REST API Reference for StopCrawlerSchedule Operation</seealso>
StopCrawlerScheduleResponse EndStopCrawlerSchedule(IAsyncResult asyncResult);
#endregion
#region StopTrigger
/// <summary>
/// Stops a specified trigger.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the StopTrigger service method.</param>
///
/// <returns>The response from the StopTrigger service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.ConcurrentModificationException">
/// Two processes are trying to modify a resource simultaneously.
/// </exception>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/StopTrigger">REST API Reference for StopTrigger Operation</seealso>
StopTriggerResponse StopTrigger(StopTriggerRequest request);
/// <summary>
/// Initiates the asynchronous execution of the StopTrigger operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the StopTrigger operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndStopTrigger
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/StopTrigger">REST API Reference for StopTrigger Operation</seealso>
IAsyncResult BeginStopTrigger(StopTriggerRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the StopTrigger operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginStopTrigger.</param>
///
/// <returns>Returns a StopTriggerResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/StopTrigger">REST API Reference for StopTrigger Operation</seealso>
StopTriggerResponse EndStopTrigger(IAsyncResult asyncResult);
#endregion
#region TagResource
/// <summary>
/// Adds tags to a resource. A tag is a label you can assign to an AWS resource. In AWS
/// Glue, you can tag only certain resources. For information about what resources you
/// can tag, see <a href="https://docs.aws.amazon.com/glue/latest/dg/monitor-tags.html">AWS
/// Tags in AWS Glue</a>.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the TagResource service method.</param>
///
/// <returns>The response from the TagResource service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/TagResource">REST API Reference for TagResource Operation</seealso>
TagResourceResponse TagResource(TagResourceRequest request);
/// <summary>
/// Initiates the asynchronous execution of the TagResource operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the TagResource operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndTagResource
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/TagResource">REST API Reference for TagResource Operation</seealso>
IAsyncResult BeginTagResource(TagResourceRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the TagResource operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginTagResource.</param>
///
/// <returns>Returns a TagResourceResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/TagResource">REST API Reference for TagResource Operation</seealso>
TagResourceResponse EndTagResource(IAsyncResult asyncResult);
#endregion
#region UntagResource
/// <summary>
/// Removes tags from a resource.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the UntagResource service method.</param>
///
/// <returns>The response from the UntagResource service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UntagResource">REST API Reference for UntagResource Operation</seealso>
UntagResourceResponse UntagResource(UntagResourceRequest request);
/// <summary>
/// Initiates the asynchronous execution of the UntagResource operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UntagResource operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUntagResource
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UntagResource">REST API Reference for UntagResource Operation</seealso>
IAsyncResult BeginUntagResource(UntagResourceRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the UntagResource operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUntagResource.</param>
///
/// <returns>Returns a UntagResourceResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UntagResource">REST API Reference for UntagResource Operation</seealso>
UntagResourceResponse EndUntagResource(IAsyncResult asyncResult);
#endregion
#region UpdateClassifier
/// <summary>
/// Modifies an existing classifier (a <code>GrokClassifier</code>, an <code>XMLClassifier</code>,
/// a <code>JsonClassifier</code>, or a <code>CsvClassifier</code>, depending on which
/// field is present).
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the UpdateClassifier service method.</param>
///
/// <returns>The response from the UpdateClassifier service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <exception cref="Amazon.Glue.Model.VersionMismatchException">
/// There was a version conflict.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UpdateClassifier">REST API Reference for UpdateClassifier Operation</seealso>
UpdateClassifierResponse UpdateClassifier(UpdateClassifierRequest request);
/// <summary>
/// Initiates the asynchronous execution of the UpdateClassifier operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UpdateClassifier operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUpdateClassifier
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UpdateClassifier">REST API Reference for UpdateClassifier Operation</seealso>
IAsyncResult BeginUpdateClassifier(UpdateClassifierRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the UpdateClassifier operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdateClassifier.</param>
///
/// <returns>Returns a UpdateClassifierResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UpdateClassifier">REST API Reference for UpdateClassifier Operation</seealso>
UpdateClassifierResponse EndUpdateClassifier(IAsyncResult asyncResult);
#endregion
#region UpdateConnection
/// <summary>
/// Updates a connection definition in the Data Catalog.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the UpdateConnection service method.</param>
///
/// <returns>The response from the UpdateConnection service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.GlueEncryptionException">
/// An encryption operation failed.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UpdateConnection">REST API Reference for UpdateConnection Operation</seealso>
UpdateConnectionResponse UpdateConnection(UpdateConnectionRequest request);
/// <summary>
/// Initiates the asynchronous execution of the UpdateConnection operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UpdateConnection operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUpdateConnection
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UpdateConnection">REST API Reference for UpdateConnection Operation</seealso>
IAsyncResult BeginUpdateConnection(UpdateConnectionRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the UpdateConnection operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdateConnection.</param>
///
/// <returns>Returns a UpdateConnectionResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UpdateConnection">REST API Reference for UpdateConnection Operation</seealso>
UpdateConnectionResponse EndUpdateConnection(IAsyncResult asyncResult);
#endregion
#region UpdateCrawler
/// <summary>
/// Updates a crawler. If a crawler is running, you must stop it using <code>StopCrawler</code>
/// before updating it.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the UpdateCrawler service method.</param>
///
/// <returns>The response from the UpdateCrawler service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.CrawlerRunningException">
/// The operation cannot be performed because the crawler is already running.
/// </exception>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <exception cref="Amazon.Glue.Model.VersionMismatchException">
/// There was a version conflict.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UpdateCrawler">REST API Reference for UpdateCrawler Operation</seealso>
UpdateCrawlerResponse UpdateCrawler(UpdateCrawlerRequest request);
/// <summary>
/// Initiates the asynchronous execution of the UpdateCrawler operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UpdateCrawler operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUpdateCrawler
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UpdateCrawler">REST API Reference for UpdateCrawler Operation</seealso>
IAsyncResult BeginUpdateCrawler(UpdateCrawlerRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the UpdateCrawler operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdateCrawler.</param>
///
/// <returns>Returns a UpdateCrawlerResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UpdateCrawler">REST API Reference for UpdateCrawler Operation</seealso>
UpdateCrawlerResponse EndUpdateCrawler(IAsyncResult asyncResult);
#endregion
#region UpdateCrawlerSchedule
/// <summary>
/// Updates the schedule of a crawler using a <code>cron</code> expression.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the UpdateCrawlerSchedule service method.</param>
///
/// <returns>The response from the UpdateCrawlerSchedule service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <exception cref="Amazon.Glue.Model.SchedulerTransitioningException">
/// The specified scheduler is transitioning.
/// </exception>
/// <exception cref="Amazon.Glue.Model.VersionMismatchException">
/// There was a version conflict.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UpdateCrawlerSchedule">REST API Reference for UpdateCrawlerSchedule Operation</seealso>
UpdateCrawlerScheduleResponse UpdateCrawlerSchedule(UpdateCrawlerScheduleRequest request);
/// <summary>
/// Initiates the asynchronous execution of the UpdateCrawlerSchedule operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UpdateCrawlerSchedule operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUpdateCrawlerSchedule
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UpdateCrawlerSchedule">REST API Reference for UpdateCrawlerSchedule Operation</seealso>
IAsyncResult BeginUpdateCrawlerSchedule(UpdateCrawlerScheduleRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the UpdateCrawlerSchedule operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdateCrawlerSchedule.</param>
///
/// <returns>Returns a UpdateCrawlerScheduleResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UpdateCrawlerSchedule">REST API Reference for UpdateCrawlerSchedule Operation</seealso>
UpdateCrawlerScheduleResponse EndUpdateCrawlerSchedule(IAsyncResult asyncResult);
#endregion
#region UpdateDatabase
/// <summary>
/// Updates an existing database definition in a Data Catalog.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the UpdateDatabase service method.</param>
///
/// <returns>The response from the UpdateDatabase service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.GlueEncryptionException">
/// An encryption operation failed.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UpdateDatabase">REST API Reference for UpdateDatabase Operation</seealso>
UpdateDatabaseResponse UpdateDatabase(UpdateDatabaseRequest request);
/// <summary>
/// Initiates the asynchronous execution of the UpdateDatabase operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UpdateDatabase operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUpdateDatabase
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UpdateDatabase">REST API Reference for UpdateDatabase Operation</seealso>
IAsyncResult BeginUpdateDatabase(UpdateDatabaseRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the UpdateDatabase operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdateDatabase.</param>
///
/// <returns>Returns a UpdateDatabaseResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UpdateDatabase">REST API Reference for UpdateDatabase Operation</seealso>
UpdateDatabaseResponse EndUpdateDatabase(IAsyncResult asyncResult);
#endregion
#region UpdateDevEndpoint
/// <summary>
/// Updates a specified DevEndpoint.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the UpdateDevEndpoint service method.</param>
///
/// <returns>The response from the UpdateDevEndpoint service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <exception cref="Amazon.Glue.Model.ValidationException">
/// A value could not be validated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UpdateDevEndpoint">REST API Reference for UpdateDevEndpoint Operation</seealso>
UpdateDevEndpointResponse UpdateDevEndpoint(UpdateDevEndpointRequest request);
/// <summary>
/// Initiates the asynchronous execution of the UpdateDevEndpoint operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UpdateDevEndpoint operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUpdateDevEndpoint
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UpdateDevEndpoint">REST API Reference for UpdateDevEndpoint Operation</seealso>
IAsyncResult BeginUpdateDevEndpoint(UpdateDevEndpointRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the UpdateDevEndpoint operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdateDevEndpoint.</param>
///
/// <returns>Returns a UpdateDevEndpointResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UpdateDevEndpoint">REST API Reference for UpdateDevEndpoint Operation</seealso>
UpdateDevEndpointResponse EndUpdateDevEndpoint(IAsyncResult asyncResult);
#endregion
#region UpdateJob
/// <summary>
/// Updates an existing job definition.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the UpdateJob service method.</param>
///
/// <returns>The response from the UpdateJob service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.ConcurrentModificationException">
/// Two processes are trying to modify a resource simultaneously.
/// </exception>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UpdateJob">REST API Reference for UpdateJob Operation</seealso>
UpdateJobResponse UpdateJob(UpdateJobRequest request);
/// <summary>
/// Initiates the asynchronous execution of the UpdateJob operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UpdateJob operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUpdateJob
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UpdateJob">REST API Reference for UpdateJob Operation</seealso>
IAsyncResult BeginUpdateJob(UpdateJobRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the UpdateJob operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdateJob.</param>
///
/// <returns>Returns a UpdateJobResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UpdateJob">REST API Reference for UpdateJob Operation</seealso>
UpdateJobResponse EndUpdateJob(IAsyncResult asyncResult);
#endregion
#region UpdatePartition
/// <summary>
/// Updates a partition.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the UpdatePartition service method.</param>
///
/// <returns>The response from the UpdatePartition service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.GlueEncryptionException">
/// An encryption operation failed.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UpdatePartition">REST API Reference for UpdatePartition Operation</seealso>
UpdatePartitionResponse UpdatePartition(UpdatePartitionRequest request);
/// <summary>
/// Initiates the asynchronous execution of the UpdatePartition operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UpdatePartition operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUpdatePartition
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UpdatePartition">REST API Reference for UpdatePartition Operation</seealso>
IAsyncResult BeginUpdatePartition(UpdatePartitionRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the UpdatePartition operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdatePartition.</param>
///
/// <returns>Returns a UpdatePartitionResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UpdatePartition">REST API Reference for UpdatePartition Operation</seealso>
UpdatePartitionResponse EndUpdatePartition(IAsyncResult asyncResult);
#endregion
#region UpdateTable
/// <summary>
/// Updates a metadata table in the Data Catalog.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the UpdateTable service method.</param>
///
/// <returns>The response from the UpdateTable service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.ConcurrentModificationException">
/// Two processes are trying to modify a resource simultaneously.
/// </exception>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.GlueEncryptionException">
/// An encryption operation failed.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <exception cref="Amazon.Glue.Model.ResourceNumberLimitExceededException">
/// A resource numerical limit was exceeded.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UpdateTable">REST API Reference for UpdateTable Operation</seealso>
UpdateTableResponse UpdateTable(UpdateTableRequest request);
/// <summary>
/// Initiates the asynchronous execution of the UpdateTable operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UpdateTable operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUpdateTable
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UpdateTable">REST API Reference for UpdateTable Operation</seealso>
IAsyncResult BeginUpdateTable(UpdateTableRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the UpdateTable operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdateTable.</param>
///
/// <returns>Returns a UpdateTableResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UpdateTable">REST API Reference for UpdateTable Operation</seealso>
UpdateTableResponse EndUpdateTable(IAsyncResult asyncResult);
#endregion
#region UpdateTrigger
/// <summary>
/// Updates a trigger definition.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the UpdateTrigger service method.</param>
///
/// <returns>The response from the UpdateTrigger service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.ConcurrentModificationException">
/// Two processes are trying to modify a resource simultaneously.
/// </exception>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UpdateTrigger">REST API Reference for UpdateTrigger Operation</seealso>
UpdateTriggerResponse UpdateTrigger(UpdateTriggerRequest request);
/// <summary>
/// Initiates the asynchronous execution of the UpdateTrigger operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UpdateTrigger operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUpdateTrigger
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UpdateTrigger">REST API Reference for UpdateTrigger Operation</seealso>
IAsyncResult BeginUpdateTrigger(UpdateTriggerRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the UpdateTrigger operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdateTrigger.</param>
///
/// <returns>Returns a UpdateTriggerResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UpdateTrigger">REST API Reference for UpdateTrigger Operation</seealso>
UpdateTriggerResponse EndUpdateTrigger(IAsyncResult asyncResult);
#endregion
#region UpdateUserDefinedFunction
/// <summary>
/// Updates an existing function definition in the Data Catalog.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the UpdateUserDefinedFunction service method.</param>
///
/// <returns>The response from the UpdateUserDefinedFunction service method, as returned by Glue.</returns>
/// <exception cref="Amazon.Glue.Model.EntityNotFoundException">
/// A specified entity does not exist
/// </exception>
/// <exception cref="Amazon.Glue.Model.GlueEncryptionException">
/// An encryption operation failed.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InternalServiceException">
/// An internal service error occurred.
/// </exception>
/// <exception cref="Amazon.Glue.Model.InvalidInputException">
/// The input provided was not valid.
/// </exception>
/// <exception cref="Amazon.Glue.Model.OperationTimeoutException">
/// The operation timed out.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UpdateUserDefinedFunction">REST API Reference for UpdateUserDefinedFunction Operation</seealso>
UpdateUserDefinedFunctionResponse UpdateUserDefinedFunction(UpdateUserDefinedFunctionRequest request);
/// <summary>
/// Initiates the asynchronous execution of the UpdateUserDefinedFunction operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UpdateUserDefinedFunction operation on AmazonGlueClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUpdateUserDefinedFunction
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UpdateUserDefinedFunction">REST API Reference for UpdateUserDefinedFunction Operation</seealso>
IAsyncResult BeginUpdateUserDefinedFunction(UpdateUserDefinedFunctionRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the UpdateUserDefinedFunction operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdateUserDefinedFunction.</param>
///
/// <returns>Returns a UpdateUserDefinedFunctionResult from Glue.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UpdateUserDefinedFunction">REST API Reference for UpdateUserDefinedFunction Operation</seealso>
UpdateUserDefinedFunctionResponse EndUpdateUserDefinedFunction(IAsyncResult asyncResult);
#endregion
}
} | 55.929095 | 208 | 0.666936 | [
"Apache-2.0"
] | icanread/aws-sdk-net | sdk/src/Services/Glue/Generated/_bcl35/IAmazonGlue.cs | 297,375 | C# |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
namespace Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Support
{
/// <summary>Type of description.</summary>
public partial struct DescriptionType :
System.IEquatable<DescriptionType>
{
/// <summary>Base description.</summary>
public static Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Support.DescriptionType Base = @"Base";
/// <summary>the value for an instance of the <see cref="DescriptionType" /> Enum.</summary>
private string _value { get; set; }
/// <summary>Conversion from arbitrary object to DescriptionType</summary>
/// <param name="value">the value to convert to an instance of <see cref="DescriptionType" />.</param>
internal static object CreateFrom(object value)
{
return new DescriptionType(global::System.Convert.ToString(value));
}
/// <summary>Creates an instance of the <see cref="DescriptionType" Enum class./></summary>
/// <param name="underlyingValue">the value to create an instance for.</param>
private DescriptionType(string underlyingValue)
{
this._value = underlyingValue;
}
/// <summary>Compares values of enum type DescriptionType</summary>
/// <param name="e">the value to compare against this instance.</param>
/// <returns><c>true</c> if the two instances are equal to the same value</returns>
public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Support.DescriptionType e)
{
return _value.Equals(e._value);
}
/// <summary>Compares values of enum type DescriptionType (override for Object)</summary>
/// <param name="obj">the value to compare against this instance.</param>
/// <returns><c>true</c> if the two instances are equal to the same value</returns>
public override bool Equals(object obj)
{
return obj is DescriptionType && Equals((DescriptionType)obj);
}
/// <summary>Returns hashCode for enum DescriptionType</summary>
/// <returns>The hashCode of the value</returns>
public override int GetHashCode()
{
return this._value.GetHashCode();
}
/// <summary>Returns string representation for DescriptionType</summary>
/// <returns>A string for this value.</returns>
public override string ToString()
{
return this._value;
}
/// <summary>Implicit operator to convert string to DescriptionType</summary>
/// <param name="value">the value to convert to an instance of <see cref="DescriptionType" />.</param>
public static implicit operator DescriptionType(string value)
{
return new DescriptionType(value);
}
/// <summary>Implicit operator to convert DescriptionType to string</summary>
/// <param name="e">the value to convert to an instance of <see cref="DescriptionType" />.</param>
public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Support.DescriptionType e)
{
return e._value;
}
/// <summary>Overriding != operator for enum DescriptionType</summary>
/// <param name="e1">the value to compare against <see cref="e2" /></param>
/// <param name="e2">the value to compare against <see cref="e1" /></param>
/// <returns><c>true</c> if the two instances are not equal to the same value</returns>
public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Support.DescriptionType e1, Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Support.DescriptionType e2)
{
return !e2.Equals(e1);
}
/// <summary>Overriding == operator for enum DescriptionType</summary>
/// <param name="e1">the value to compare against <see cref="e2" /></param>
/// <param name="e2">the value to compare against <see cref="e1" /></param>
/// <returns><c>true</c> if the two instances are equal to the same value</returns>
public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Support.DescriptionType e1, Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Support.DescriptionType e2)
{
return e2.Equals(e1);
}
}
} | 48.804124 | 185 | 0.641952 | [
"MIT"
] | Agazoth/azure-powershell | src/EdgeOrder/generated/api/Support/DescriptionType.cs | 4,638 | C# |
using System;
using System.IO;
using System.Net;
using System.Text;
using System.Net.Sockets;
using System.Security.Authentication;
using System.Security.Cryptography.X509Certificates;
namespace Bytewizer.TinyCLR.Sockets.Channel
{
/// <summary>
/// Represents a socket channel between two end points.
/// </summary>
public class SocketChannel
{
private bool _cleared = true;
/// <summary>
/// Gets socket for the connected endpoint.
/// </summary>
public Socket Client { get; internal set; }
/// <summary>
/// Gets socket information for the connected endpoint.
/// </summary>
public ConnectionInfo Connection { get; internal set; } = new ConnectionInfo();
/// <summary>
/// Gets or sets a byte array that can be used to share data within the scope of this channel.
/// </summary>
public byte[] Data { get; set; }
/// <summary>
/// Gets a <see cref="Stream"/> object representing the contents of the socket channel.
/// </summary>
public Stream InputStream { get; internal set; }
/// <summary>
/// Gets a <see cref="Stream"/> object representing the contents of the socket channel.
/// </summary>
public Stream OutputStream { get; internal set; }
/// <summary>
/// Assign a socket to this channel.
/// </summary>
/// <param name="socket">The connected socket for channel.</param>
public void Assign(Socket socket)
{
if (socket == null)
throw new ArgumentNullException(nameof(socket));
Client = socket;
InputStream = new NetworkStream(socket, false);
OutputStream = new NetworkStream(socket, false);
Connection.Assign(socket);
_cleared = false;
}
/// <summary>
/// Assign a socket to this channel.
/// </summary>
/// <param name="socket">The connected socket for channel.</param>
/// <param name="buffer">The connected socket buffer for channel.</param>
/// <param name="endpoint">The remote endpoint of the connected socket. </param>
public void Assign(Socket socket, byte [] buffer, EndPoint endpoint)
{
if (socket == null)
throw new ArgumentNullException(nameof(socket));
Client = socket;
InputStream = new MemoryStream(buffer, false);
OutputStream = null;
Connection.Assign(socket, endpoint);
_cleared = false;
}
/// <summary>
/// Assign a socket to this channel.
/// </summary>
/// <param name="socket">The connected socket for channel.</param>
/// <param name="certificate">The X.509 certificate for channel.</param>
/// <param name="allowedProtocols">The possible versions of ssl protocols channel allows.</param>
public void Assign(Socket socket, X509Certificate certificate, SslProtocols allowedProtocols)
{
if (socket == null)
throw new ArgumentNullException(nameof(socket));
var streamBuilder = new SslStreamBuilder(certificate, allowedProtocols);
Client = socket;
InputStream = streamBuilder.Build(socket);
OutputStream = new NetworkStream(socket);
Connection.Assign(socket);
_cleared = false;
}
/// <summary>
/// Determine whether the socket channel is cleared.
/// </summary>
public bool IsCleared()
{
return _cleared;
}
/// <summary>
/// Closes and clears the connected socket channel.
/// </summary>
public void Clear()
{
if (InputStream.GetType() == typeof(NetworkStream)) // TODO: This feels like a hack. Better way?
{
Client?.Close();
}
InputStream?.Dispose();
OutputStream?.Dispose();
_cleared = true;
}
/// <summary>
/// Writes a new response to the connected socket channel. UTF-8 encoding will be used.
/// </summary>
/// <param name="text">A <see cref="string"/> that contains data to be UTF8 encoded and sent.</param>
public int Write(string text)
{
return Write(text, Encoding.UTF8);
}
/// <summary>
/// Writes a new response to the connected socket channel.
/// </summary>
/// <param name="text">A <see cref="string"/> that contains data to be sent.</param>
/// <param name="encoding">The encoding to use.</param>
public int Write(string text, Encoding encoding)
{
if (string.IsNullOrEmpty(text))
{
throw new ArgumentNullException(nameof(text));
}
if (encoding == null)
{
throw new ArgumentNullException(nameof(encoding));
}
int bytesSent = 0;
try
{
var bytes = encoding.GetBytes(text);
bytesSent += Write(bytes);
}
catch (Exception ex)
{
OnChannelError(this, ex);
}
return bytesSent;
}
/// <summary>
/// Writes a new response to the connected socket channel.
/// </summary>
/// <param name="bytes">A <see cref="byte"/> array that contains data to be sent.</param>
/// <returns>The number of bytes sent to the <see cref="Socket"/>.</returns>
public int Write(byte[] bytes)
{
if (bytes.Length <= 0)
{
throw new ArgumentNullException(nameof(bytes));
}
int bytesSent = 0;
try
{
OutputStream?.Write(bytes);
OutputStream.Flush();
bytesSent = bytes.Length;
}
catch (Exception ex)
{
OnChannelError(this, ex);
}
return bytesSent;
}
/// <summary>
/// Writes a new response to the connected socket channel.
/// </summary>
/// <param name="stream">A <see cref="Stream"/> that contains data to be sent.</param>
public long Write(Stream stream)
{
if (stream == null)
{
throw new ArgumentNullException(nameof(stream));
}
long bytesSent = 0;
try
{
if (stream.Length > 0)
{
stream?.CopyTo(OutputStream);
OutputStream.Flush();
bytesSent = stream.Length;
}
}
catch (Exception ex)
{
OnChannelError(this, ex);
}
return bytesSent;
}
/// <summary>
/// Send a new message to a connected channel client.
/// </summary>
/// <param name="message">An array of type byte that contains the data to be sent.</param>
/// <param name="offSet">The position in the data buffer at which to begin sending data.</param>
/// <param name="size">The number of bytes to send.</param>
/// <param name="socketFlags">A bitwise combination of the SocketFlags values.</param>
public int Send(byte[] message, int offSet, int size, SocketFlags socketFlags)
{
int bytesSent = 0;
try
{
bytesSent = Client.Send(message, offSet, size, socketFlags);
}
catch (Exception ex)
{
OnChannelError(this, ex);
}
return bytesSent;
}
/// <summary>
/// Send a new message to a connected remote device.
/// </summary>
/// <param name="message">An array of type byte that contains the data to be sent.</param>
/// <param name="offset">The position in the data buffer at which to begin sending data.</param>
/// <param name="size">The number of bytes to send.</param>
/// <param name="socketFlags">A bitwise combination of the SocketFlags values.</param>
/// <param name="endPoint">An EndPoint that represents the remote device. </param>
public int SendTo(byte[] message, int offset, int size, SocketFlags socketFlags, EndPoint endPoint)
{
int bytesSent = 0;
try
{
bytesSent = Client.SendTo(message, offset, size, socketFlags, endPoint);
}
catch (Exception ex)
{
OnChannelError(this, ex);
}
return bytesSent;
}
/// <summary>
/// An internal channel error occured.
/// </summary>
protected virtual void OnChannelError(SocketChannel channel, Exception execption)
{
ChannelError(this, execption);
}
/// <summary>
/// An event that is raised when an interanl channel error occured.
/// </summary>
public event SocketErrorHandler ChannelError = delegate { };
}
} | 33.611511 | 109 | 0.534247 | [
"MIT"
] | microcompiler/microserver | src/Bytewizer.TinyCLR.Sockets/Channel/SocketChannel.cs | 9,346 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using Umbraco.Core.Composing;
using Umbraco.Core.Configuration.UmbracoSettings;
using Umbraco.Core.Events;
using Umbraco.Core.Models;
using Umbraco.Core.Services;
using Umbraco.Core.Services.Implement;
using Umbraco.Web.PublishedCache;
namespace Umbraco.Web.Routing
{
/// Implements an Application Event Handler for managing redirect urls tracking.
/// <para>when content is renamed or moved, we want to create a permanent 301 redirect from it's old url</para>
/// <para>
/// not managing domains because we don't know how to do it - changing domains => must create a higher level
/// strategy using rewriting rules probably
/// </para>
/// <para>recycle bin = moving to and from does nothing: to = the node is gone, where would we redirect? from = same</para>
public sealed class RedirectTrackingComponent : IComponent
{
private const string _eventStateKey = "Umbraco.Web.Redirects.RedirectTrackingEventHandler";
private readonly IUmbracoSettingsSection _umbracoSettings;
private readonly IPublishedSnapshotAccessor _publishedSnapshotAccessor;
private readonly IRedirectUrlService _redirectUrlService;
public RedirectTrackingComponent(IUmbracoSettingsSection umbracoSettings, IPublishedSnapshotAccessor publishedSnapshotAccessor, IRedirectUrlService redirectUrlService)
{
_umbracoSettings = umbracoSettings;
_publishedSnapshotAccessor = publishedSnapshotAccessor;
_redirectUrlService = redirectUrlService;
}
public void Initialize()
{
// don't let the event handlers kick in if Redirect Tracking is turned off in the config
if (_umbracoSettings.WebRouting.DisableRedirectUrlTracking) return;
ContentService.Publishing += ContentService_Publishing;
ContentService.Published += ContentService_Published;
ContentService.Moving += ContentService_Moving;
ContentService.Moved += ContentService_Moved;
// kill all redirects once a content is deleted
//ContentService.Deleted += ContentService_Deleted;
// BUT, doing it here would prevent content deletion due to FK
// so the rows are actually deleted by the ContentRepository (see GetDeleteClauses)
// rolled back items have to be published, so publishing will take care of that
}
public void Terminate()
{
ContentService.Publishing -= ContentService_Publishing;
ContentService.Published -= ContentService_Published;
ContentService.Moving -= ContentService_Moving;
ContentService.Moved -= ContentService_Moved;
}
private void ContentService_Publishing(IContentService sender, PublishEventArgs<IContent> args)
{
var oldRoutes = GetOldRoutes(args.EventState);
foreach (var entity in args.PublishedEntities)
{
StoreOldRoute(entity, oldRoutes);
}
}
private void ContentService_Published(IContentService sender, ContentPublishedEventArgs args)
{
var oldRoutes = GetOldRoutes(args.EventState);
CreateRedirects(oldRoutes);
}
private void ContentService_Moving(IContentService sender, MoveEventArgs<IContent> args)
{
var oldRoutes = GetOldRoutes(args.EventState);
foreach (var info in args.MoveInfoCollection)
{
StoreOldRoute(info.Entity, oldRoutes);
}
}
private void ContentService_Moved(IContentService sender, MoveEventArgs<IContent> args)
{
var oldRoutes = GetOldRoutes(args.EventState);
CreateRedirects(oldRoutes);
}
private OldRoutesDictionary GetOldRoutes(IDictionary<string, object> eventState)
{
if (! eventState.ContainsKey(_eventStateKey))
{
eventState[_eventStateKey] = new OldRoutesDictionary();
}
return eventState[_eventStateKey] as OldRoutesDictionary;
}
private void StoreOldRoute(IContent entity, OldRoutesDictionary oldRoutes)
{
var contentCache = _publishedSnapshotAccessor.PublishedSnapshot.Content;
var entityContent = contentCache.GetById(entity.Id);
if (entityContent == null) return;
// get the default affected cultures by going up the tree until we find the first culture variant entity (default to no cultures)
var defaultCultures = entityContent.AncestorsOrSelf()?.FirstOrDefault(a => a.Cultures.Any())?.Cultures.Keys.ToArray()
?? new[] { (string)null };
foreach (var x in entityContent.DescendantsOrSelf())
{
// if this entity defines specific cultures, use those instead of the default ones
var cultures = x.Cultures.Any() ? x.Cultures.Keys : defaultCultures;
foreach (var culture in cultures)
{
var route = contentCache.GetRouteById(x.Id, culture);
if (IsNotRoute(route)) continue;
oldRoutes[new ContentIdAndCulture(x.Id, culture)] = new ContentKeyAndOldRoute(x.Key, route);
}
}
}
private void CreateRedirects(OldRoutesDictionary oldRoutes)
{
var contentCache = _publishedSnapshotAccessor.PublishedSnapshot.Content;
foreach (var oldRoute in oldRoutes)
{
var newRoute = contentCache.GetRouteById(oldRoute.Key.ContentId, oldRoute.Key.Culture);
if (IsNotRoute(newRoute) || oldRoute.Value.OldRoute == newRoute) continue;
_redirectUrlService.Register(oldRoute.Value.OldRoute, oldRoute.Value.ContentKey, oldRoute.Key.Culture);
}
}
private static bool IsNotRoute(string route)
{
// null if content not found
// err/- if collision or anomaly or ...
return route == null || route.StartsWith("err/");
}
private class ContentIdAndCulture : Tuple<int, string>
{
public ContentIdAndCulture(int contentId, string culture) : base(contentId, culture)
{
}
public int ContentId => Item1;
public string Culture => Item2;
}
private class ContentKeyAndOldRoute : Tuple<Guid, string>
{
public ContentKeyAndOldRoute(Guid contentKey, string oldRoute) : base(contentKey, oldRoute)
{
}
public Guid ContentKey => Item1;
public string OldRoute => Item2;
}
private class OldRoutesDictionary : Dictionary<ContentIdAndCulture, ContentKeyAndOldRoute>
{ }
}
}
| 41.488095 | 175 | 0.646055 | [
"MIT"
] | AesisGit/Umbraco-CMS | src/Umbraco.Web/Routing/RedirectTrackingComponent.cs | 6,972 | C# |
using System.Collections.Generic;
namespace SandBeige.MediaBox.StyleChecker.Models {
internal class Century {
public int Number {
get;
}
public IEnumerable<string> EraList {
get;
}
public Century(int number, params string[] eraList) {
this.Number = number;
this.EraList = eraList;
}
}
}
| 15.142857 | 55 | 0.688679 | [
"MIT"
] | southernwind/MediaBox | MediaBox.StyleChecker/Models/Century.cs | 318 | C# |
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Text;
using Deviser.Admin.Data;
namespace Deviser.Admin.Extensions
{
public static class SortExtensions
{
/// <summary>
/// Adds OrderBy or OrderByDescending chain for provided properties in comma separated
/// </summary>
/// <typeparam name="TSource"></typeparam>
/// <param name="baseQuery"></param>
/// <param name="orderByProperties">Comma separated property string. Hyphen (-) prefix to order by descending. E.g. PropertyName to sort by ascending -PropertyName to sort by descending.</param>
/// <returns></returns>
public static IQueryable<TSource> SortBy<TSource>(this IQueryable<TSource> baseQuery, string orderByProperties)
{
if (string.IsNullOrEmpty(orderByProperties))
{
return baseQuery;
}
var sourceType = typeof(TSource);
//var queryableSourceType = typeof(IQueryable<TSource>);
var props = orderByProperties.Split(',');
foreach (var prop in props)
{
var orderByProp = prop.Replace("-", "");
var parameterExpression = Expression.Parameter(sourceType);
var memberExpression = Expression.Property(parameterExpression, orderByProp);
var memberType = (memberExpression.Member as PropertyInfo)?.PropertyType;
baseQuery = CallGenericMethod<IQueryable<TSource>>(nameof(BuildSortExpressionForQueryable), new Type[] { sourceType, memberType }, new object[] { baseQuery, parameterExpression, memberExpression, !prop.StartsWith("-") });
}
return baseQuery;
}
/// <summary>
/// Adds OrderBy or OrderByDescending chain for provided properties in comma separated
/// </summary>
/// <typeparam name="TSource"></typeparam>
/// <param name="baseQuery"></param>
/// <param name="orderByProperties">Comma separated property string. Hyphen (-) prefix to order by descending. E.g. PropertyName to sort by ascending -PropertyName to sort by descending.</param>
/// <returns></returns>
public static IEnumerable<TSource> SortBy<TSource>(this IEnumerable<TSource> baseQuery, string orderByProperties)
{
if (string.IsNullOrEmpty(orderByProperties))
{
return baseQuery;
}
var sourceType = typeof(TSource);
//var enumerableSourceType = typeof(IEnumerable<TSource>);
var props = orderByProperties.Split(',');
foreach (var prop in props)
{
var orderByProp = prop.Replace("-", "");
var parameterExpression = Expression.Parameter(sourceType);
var memberExpression = Expression.Property(parameterExpression, orderByProp);
var memberType = (memberExpression.Member as PropertyInfo)?.PropertyType;
baseQuery = CallGenericMethod<IEnumerable<TSource>>(nameof(BuildSortExpressionForEnumerable), new Type[] { sourceType, memberType }, new object[] { baseQuery, parameterExpression, memberExpression, !prop.StartsWith("-") });
//baseQuery = BuildSortExpressionForEnumerable<TSource>(baseQuery, parameterExpression, memberExpression, !prop.StartsWith("-"));
}
return baseQuery;
}
private static IQueryable<TSource> BuildSortExpressionForQueryable<TSource, TKey>(IQueryable<TSource> baseQuery,
ParameterExpression parameterExpression,
MemberExpression memberExpression,
bool isAscendingOrder)
{
var propertyExpression = GetPropertyExpression<TSource, TKey>(parameterExpression, memberExpression);
if (baseQuery is IOrderedQueryable<TSource> baseOrderedQuery)
{
baseQuery = isAscendingOrder ? baseOrderedQuery.ThenByDescending(propertyExpression) : baseOrderedQuery.ThenBy(propertyExpression);
}
else
{
baseQuery = isAscendingOrder ? baseQuery.OrderByDescending(propertyExpression) : baseQuery.OrderBy(propertyExpression);
}
return baseQuery;
}
private static IEnumerable<TSource> BuildSortExpressionForEnumerable<TSource, TKey>(IEnumerable<TSource> baseQuery,
ParameterExpression parameterExpression,
MemberExpression memberExpression,
bool isAscendingOrder)
{
var propertyExpression = GetPropertyExpression<TSource, TKey>(parameterExpression, memberExpression);
var del = propertyExpression.Compile();
if (baseQuery is IOrderedEnumerable<TSource> baseOrderedQuery)
{
baseQuery = isAscendingOrder ? baseOrderedQuery.ThenByDescending(del) : baseOrderedQuery.ThenBy(del);
}
else
{
baseQuery = isAscendingOrder ? baseQuery.OrderByDescending(del) : baseQuery.OrderBy(del);
}
return baseQuery;
}
private static Expression<Func<TSource, TKey>> GetPropertyExpression<TSource, TKey>(ParameterExpression parameterExpression, MemberExpression memberExpression)
{
//var objectMemberExpr = Expression.Convert(memberExpression, typeof(object)); //Convert Value/Reference type to object using boxing/lifting
//var propertyExpression = Expression.Lambda<Func<TSource, object>>(objectMemberExpr, parameterExpression);
var propertyExpression = Expression.Lambda<Func<TSource, TKey>>(memberExpression, parameterExpression);
return propertyExpression;
}
private static TResult CallGenericMethod<TResult>(string methodName, Type[] genericTypes, object[] parmeters)
where TResult : class
{
var getItemMethodInfo = typeof(SortExtensions).GetMethod(methodName, BindingFlags.NonPublic | BindingFlags.Static);
var getItemMethod = getItemMethodInfo.MakeGenericMethod(genericTypes);
var result = getItemMethod.Invoke(null, parmeters);
return result as TResult;
}
}
}
| 46.764706 | 239 | 0.653774 | [
"MIT"
] | deviserplatform/deviserplatform | src/Deviser.Core/Deviser.Admin/Extensions/SortExtensions.cs | 6,362 | C# |
// <auto-generated />
using DutchTreat.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage;
using Microsoft.EntityFrameworkCore.Storage.Internal;
using System;
namespace DutchTreat.Migrations
{
[DbContext(typeof(DutchContext))]
[Migration("20180211173346_InitialDb")]
partial class InitialDb
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.0.0-rtm-26452")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("DutchTreat.Data.Entities.Order", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<DateTime>("OrderDate");
b.Property<string>("OrderNumber");
b.HasKey("Id");
b.ToTable("Orders");
});
modelBuilder.Entity("DutchTreat.Data.Entities.OrderItem", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<int?>("OrderId");
b.Property<int?>("ProductId");
b.Property<int>("Quantity");
b.Property<decimal>("UnitPrice");
b.HasKey("Id");
b.HasIndex("OrderId");
b.HasIndex("ProductId");
b.ToTable("OrderItem");
});
modelBuilder.Entity("DutchTreat.Data.Entities.Product", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ArtDating");
b.Property<string>("ArtDescription");
b.Property<string>("ArtId");
b.Property<string>("Artist");
b.Property<DateTime>("ArtistBirthDate");
b.Property<DateTime>("ArtistDeathDate");
b.Property<string>("ArtistNationality");
b.Property<string>("Category");
b.Property<decimal>("Price");
b.Property<string>("Size");
b.Property<string>("Title");
b.HasKey("Id");
b.ToTable("Products");
});
modelBuilder.Entity("DutchTreat.Data.Entities.OrderItem", b =>
{
b.HasOne("DutchTreat.Data.Entities.Order", "Order")
.WithMany("Items")
.HasForeignKey("OrderId");
b.HasOne("DutchTreat.Data.Entities.Product", "Product")
.WithMany()
.HasForeignKey("ProductId");
});
#pragma warning restore 612, 618
}
}
}
| 30 | 117 | 0.507862 | [
"MIT"
] | Thalandor/DutchTreat | DutchTreat/Data/Migrations/20180211173346_InitialDb.Designer.cs | 3,182 | C# |
// <copyright>
// Copyright 2021 Max Ieremenko
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Net;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Text;
using Grpc.AspNetCore.Server;
using Grpc.Core;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc.ApiExplorer;
using Microsoft.AspNetCore.Mvc.ModelBinding;
using Microsoft.AspNetCore.Routing;
using ServiceModel.Grpc.Internal;
#if NET6_0
using RouteValuesType = System.Collections.Generic.Dictionary<string, string?>;
#else
using RouteValuesType = System.Collections.Generic.Dictionary<string, string>;
#endif
namespace ServiceModel.Grpc.AspNetCore.Internal.ApiExplorer
{
internal sealed class ApiDescriptionGenerator
{
private readonly ContractDescriptionCache _contractCache;
public ApiDescriptionGenerator()
{
_contractCache = new ContractDescriptionCache();
}
public ApiDescription? TryCreateApiDescription(RouteEndpoint endpoint)
{
var metadata = endpoint.Metadata.GetMetadata<GrpcMethodMetadata>();
if (metadata == null
|| !ContainsServiceModelGrpcMarker(endpoint.Metadata)
|| !_contractCache.TryFindOperation(metadata.ServiceType, metadata.Method.ServiceName, metadata.Method.Name, out var operation))
{
return null;
}
return CreateApiDescription(endpoint, metadata, operation);
}
internal static IEnumerable<ParameterInfo> GetRequestHeaderParameters(MessageAssembler message)
{
for (var i = 0; i < message.HeaderRequestTypeInput.Length; i++)
{
yield return message.Parameters[message.HeaderRequestTypeInput[i]];
}
}
internal static IEnumerable<ParameterInfo> GetRequestParameters(MessageAssembler message)
{
for (var i = 0; i < message.RequestTypeInput.Length; i++)
{
yield return message.Parameters[message.RequestTypeInput[i]];
}
}
internal static (Type? Type, ParameterInfo Parameter) GetResponseType(MessageAssembler message)
{
// do not return typeof(void) => Swashbuckle schema generation error
var arguments = message.ResponseType.GetGenericArguments();
var responseType = arguments.Length == 0 ? null : arguments[0];
if (message.OperationType == MethodType.ServerStreaming || message.OperationType == MethodType.DuplexStreaming)
{
responseType = typeof(IAsyncEnumerable<>).MakeGenericType(responseType!);
}
return (responseType, message.Operation.ReturnParameter);
}
internal static (Type Type, string Name)[] GetResponseHeaderParameters(MessageAssembler message)
{
var result = new (Type Type, string Name)[message.HeaderResponseTypeInput.Length];
if (result.Length > 0)
{
var types = message.HeaderResponseType!.GetGenericArguments();
var names = message.Operation.ReturnParameter.GetCustomAttribute<TupleElementNamesAttribute>()?.TransformNames;
for (var i = 0; i < result.Length; i++)
{
var index = message.HeaderResponseTypeInput[i];
string? name = null;
if (names != null)
{
name = names[index];
}
if (string.IsNullOrEmpty(name))
{
name = "Item{0}".FormatWith((i + 1).ToString(CultureInfo.InvariantCulture));
}
result[i] = (types[i]!, name!);
}
}
return result;
}
private static ApiDescription CreateApiDescription(
RouteEndpoint endpoint,
GrpcMethodMetadata metadata,
OperationDescription operation)
{
var serviceInstanceMethod = ReflectionTools.ImplementationOfMethod(
metadata.ServiceType,
operation.Message.Operation.DeclaringType!,
operation.Message.Operation);
var descriptor = new GrpcActionDescriptor
{
MethodInfo = serviceInstanceMethod,
ControllerTypeInfo = metadata.ServiceType.GetTypeInfo(),
ActionName = metadata.Method.Name,
ControllerName = metadata.Method.ServiceName,
RouteValues = new RouteValuesType
{
["controller"] = metadata.Method.ServiceName
},
MethodType = metadata.Method.Type,
MethodSignature = GetSignature(operation.Message, metadata.Method.Name)
};
var description = new ApiDescription
{
HttpMethod = HttpMethods.Post,
ActionDescriptor = descriptor,
RelativePath = ProtocolConstants.NormalizeRelativePath(endpoint.RoutePattern.RawText!)
};
AddRequest(description, operation.Message);
AddResponse(description, operation.Message);
return description;
}
private static void AddRequest(ApiDescription description, MessageAssembler message)
{
description.SupportedRequestFormats.Add(new ApiRequestFormat
{
MediaType = ProtocolConstants.MediaTypeNameSwaggerRequest
});
foreach (var parameter in GetRequestHeaderParameters(message))
{
description.ParameterDescriptions.Add(new ApiParameterDescription
{
Name = parameter.Name!,
ModelMetadata = ApiModelMetadata.ForParameter(parameter),
Source = BindingSource.Header,
Type = parameter.ParameterType
});
}
foreach (var parameter in GetRequestParameters(message))
{
description.ParameterDescriptions.Add(new ApiParameterDescription
{
Name = parameter.Name!,
ModelMetadata = ApiModelMetadata.ForParameter(parameter),
Source = BindingSource.Form,
Type = parameter.ParameterType
});
}
}
private static void AddResponse(ApiDescription description, MessageAssembler message)
{
var (responseType, parameter) = GetResponseType(message);
ApiModelMetadata? model = null;
if (responseType != null)
{
model = ApiModelMetadata.ForParameter(parameter, responseType);
model.Headers = GetResponseHeaderParameters(message);
}
description.SupportedResponseTypes.Add(new ApiResponseType
{
ApiResponseFormats =
{
new ApiResponseFormat { MediaType = ProtocolConstants.MediaTypeNameSwaggerResponse }
},
ModelMetadata = model,
Type = responseType,
StatusCode = (int)HttpStatusCode.OK
});
}
private static bool ContainsServiceModelGrpcMarker(IReadOnlyList<object> metadata)
{
for (var i = 0; i < metadata.Count; i++)
{
if (ReferenceEquals(ServiceModelGrpcMarker.Instance, metadata[i]))
{
return true;
}
}
return false;
}
private static string GetSignature(MessageAssembler message, string actionName)
{
var result = new StringBuilder();
var response = GetResponseType(message);
var responseHeader = GetResponseHeaderParameters(message);
if (response.Type == null)
{
result.Append("void ");
}
else
{
if (responseHeader.Length > 0)
{
result.Append("(");
}
result.Append(response.Type.GetUserFriendlyName());
if (responseHeader.Length > 0)
{
for (var i = 0; i < responseHeader.Length; i++)
{
var header = responseHeader[i];
result
.Append(", ")
.Append(header.Type.GetUserFriendlyName())
.Append(" ")
.Append(header.Name);
}
result.Append(")");
}
}
result
.Append(" ")
.Append(actionName)
.Append("(");
var index = 0;
foreach (var parameter in GetRequestParameters(message).Concat(GetRequestHeaderParameters(message)))
{
if (index > 0)
{
result.Append(", ");
}
index++;
result
.Append(parameter.ParameterType.GetUserFriendlyName())
.Append(" ")
.Append(parameter.Name);
}
result.Append(")");
return result.ToString();
}
}
}
| 35.943463 | 144 | 0.562033 | [
"Apache-2.0"
] | max-ieremenko/ServiceModel.Grpc | Sources/ServiceModel.Grpc.AspNetCore/Internal/ApiExplorer/ApiDescriptionGenerator.cs | 10,174 | C# |
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Runtime.CompilerServices;
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")]
[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Antiforgery.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
| 125.375 | 403 | 0.927218 | [
"Apache-2.0"
] | 06b/AspNetCore | src/Antiforgery/src/Properties/AssemblyInfo.cs | 1,003 | C# |
using System.Diagnostics;
using TheMaths;
using WDE.MpqReader.Readers;
namespace WDE.MpqReader.Structures
{
[Flags]
public enum WdtFlags : ushort
{
WdtUsesGlobalMapObj = 1,
AdtHasMccv = 2,
AdtHasBigAlpha = 4,
AdtHasDoodadRefsSortedBySizeCat = 8,
FlagLightingVertices = 16,
AdtHasUpsideDownGround = 32
// TODO : MOP+ flags
}
public class WDTChunk
{
private static float BlockSize = 533.33333f;
public uint X { get; }
public uint Y { get; }
public Vector3 MiddlePosition => ChunkToWoWPosition(X, Y);
public uint chunkFlags { get; }
public bool HasAdt => (chunkFlags & 1) == 1;
private static Vector3 ChunkToWoWPosition(uint x, uint y)
{
return new Vector3((-(int)y + 32) * BlockSize, (-(int)x + 32) * BlockSize, 0);
}
public WDTChunk(IBinaryReader reader, uint x, uint y)
{
chunkFlags = reader.ReadUInt32();
reader.ReadUInt32();
X = x;
Y = y;
}
}
public class WDT
{
public uint Version { get; }
public WDTHeader Header { get; }
public WDTChunk[,] Chunks { get; }
public string? Mwmo { get; }
public MODF? WorldMapObject { get; }
public WDT(IBinaryReader reader)
{
Dictionary<int, string>? mwmosNameOffsets = null;
while (!reader.IsFinished())
{
var chunkName = reader.ReadChunkName();
var size = reader.ReadInt32();
var offset = reader.Offset;
var partialReader = new LimitedReader(reader, size);
if (chunkName == "MVER")
Version = reader.ReadUInt32();
else if (chunkName == "MPHD")
Header = WDTHeader.Read(partialReader);
else if (chunkName == "MAIN")
Chunks = ReadWdtChunks(partialReader);
else if (chunkName == "MWMO")
Mwmo = ChunkedUtils.ReadZeroTerminatedStringArrays(partialReader, true, out mwmosNameOffsets).FirstOrDefault();
else if (chunkName == "MODF")
WorldMapObject = MODF.Read(partialReader);
reader.Offset = offset + size;
}
}
private WDTChunk[,] ReadWdtChunks(IBinaryReader reader)
{
WDTChunk[,] chunks = new WDTChunk[64, 64];
for (uint y = 0; y < 64; ++y)
{
for (uint x = 0; x < 64; ++x)
{
chunks[y, x] = new WDTChunk(reader, x, y);
}
}
return chunks;
}
}
public class WDTHeader
{
public WdtFlags flags { get; init; }
public uint unknown { get; init; }
public uint[] unused { get; init; }
private WDTHeader() { }
public static WDTHeader Read(IBinaryReader reader)
{
return new WDTHeader()
{
flags = (WdtFlags)reader.ReadUInt32(),
unknown = reader.ReadUInt32(),
unused = new uint[6]
{
reader.ReadUInt32(),
reader.ReadUInt32(),
reader.ReadUInt32(),
reader.ReadUInt32(),
reader.ReadUInt32(),
reader.ReadUInt32()
}
};
}
}
public class MODF
{
public uint uniqueId { get; init; }
public Vector3 pos { get; init; }
public Vector3 rot { get; init; }
public CAaBox extents { get; init; }
public uint flags { get; init; } // TODO
public uint doodadSet { get; init; }
public uint nameSet { get; init; }
public uint pad { get; init; }
private MODF() { }
public static MODF Read(IBinaryReader reader)
{
reader.ReadUInt32();
return new MODF()
{
uniqueId = reader.ReadUInt32(),
pos = reader.ReadVector3(),
rot = reader.ReadVector3(),
extents = CAaBox.Read(reader),
flags = reader.ReadUInt16(),
doodadSet = reader.ReadUInt16(),
nameSet = reader.ReadUInt16(),
pad = reader.ReadUInt16()
};
}
}
}
| 30.425676 | 131 | 0.492561 | [
"Unlicense"
] | T1ti/WoWDatabaseEditor | WDE.MpqReader/Structures/WDT.cs | 4,505 | C# |
namespace RedStar.Amounts.StandardUnits
{
public static class LuminousIntensityUnits
{
public static readonly Unit Candela = new Unit("candela", "cd", SIUnitTypes.LuminousIntensity);
}
} | 29.571429 | 103 | 0.724638 | [
"MIT"
] | petermorlion/RedStar.Amounts | RedStar.Amounts.StandardUnits/LuminousIntensityUnits.cs | 209 | C# |
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace QuicDataServer.Models
{
public class TestPublishResult : IAuthorizable
{
[Required]
public string PlatformName { get; set; } = null!;
[Required]
public string TestName { get; set; } = null!;
[Required]
public string CommitHash { get; set; } = null!;
[Required]
public string AuthKey { get; set; } = null!;
[Required]
public IEnumerable<double> IndividualRunResults { get; set; } = null!;
}
}
| 28.304348 | 78 | 0.634409 | [
"MIT"
] | Bhaskers-Blu-Org2/msquic | src/perf/dbserver/Models/TestPublishResult.cs | 653 | C# |
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SharpDX.MediaFoundation;
namespace Daramkun.Misty.Contents.Decoders.Audios
{
public class MFDecoder : IDecoder<AudioInfo>
{
public bool Decode ( Stream stream, out AudioInfo to, params object [] args )
{
try
{
AudioDecoder dec = new AudioDecoder ( stream );
to = new AudioInfo ( dec.WaveFormat.Channels, dec.WaveFormat.SampleRate, dec.WaveFormat.BitsPerSample,
dec.Duration, stream, new object [] { dec, null }, ( AudioInfo audioInfo, object raws, TimeSpan? timeSpan ) =>
{
object [] datas = (object [] )(object)raws;
if ( timeSpan != null ) datas [ 1 ] = ( datas [ 0 ] as AudioDecoder ).GetSamples ( timeSpan.Value ).GetEnumerator ();
if ( datas [ 1 ] == null ) datas [ 1 ] = ( datas [ 0 ] as AudioDecoder ).GetSamples ().GetEnumerator ();
if ( !( datas [ 1 ] as IEnumerator<SharpDX.DataPointer> ).MoveNext () ) return null;
SharpDX.DataPointer pt = ( datas [ 1 ] as IEnumerator<SharpDX.DataPointer> ).Current;
SharpDX.DataBuffer dataBuffer = new SharpDX.DataBuffer ( pt.Pointer, pt.Size );
byte [] data = dataBuffer.GetRange<byte> ( 0, pt.Size );
dataBuffer.Dispose ();
return data;
} );
return true;
}
catch { to = null; return false; }
}
}
}
| 37.243243 | 122 | 0.665457 | [
"Apache-2.0"
] | Daramkun/Misty | Daramkun.Misty.Platform.Windows.MediaFoundation/Contents/Decoders/Audios/MFDecoder.cs | 1,380 | C# |
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the license-manager-2018-08-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.LicenseManager.Model
{
/// <summary>
/// Details of the license configuration that this generator reports on.
/// </summary>
public partial class ReportContext
{
private List<string> _licenseConfigurationArns = new List<string>();
/// <summary>
/// Gets and sets the property LicenseConfigurationArns.
/// <para>
/// Amazon Resource Number (ARN) of the license configuration that this generator reports
/// on.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public List<string> LicenseConfigurationArns
{
get { return this._licenseConfigurationArns; }
set { this._licenseConfigurationArns = value; }
}
// Check to see if LicenseConfigurationArns property is set
internal bool IsSetLicenseConfigurationArns()
{
return this._licenseConfigurationArns != null && this._licenseConfigurationArns.Count > 0;
}
}
} | 32.440678 | 113 | 0.678683 | [
"Apache-2.0"
] | ChristopherButtars/aws-sdk-net | sdk/src/Services/LicenseManager/Generated/Model/ReportContext.cs | 1,914 | C# |
using AElf.Contracts.MultiToken.Messages;
using AElf.Sdk.CSharp;
using AElf.Types;
using Google.Protobuf.WellKnownTypes;
namespace AElf.Contracts.TestContract.BasicFunction
{
/// <summary>
/// Action methods
/// </summary>
public partial class BasicFunctionContract : BasicFunctionContractContainer.BasicFunctionContractBase
{
public override Empty InitialBasicFunctionContract(InitialBasicContractInput input)
{
Assert(!State.Initialized.Value, "Already initialized.");
Assert(input.MinValue >0 && input.MaxValue >0 && input.MaxValue >= input.MinValue, "Invalid min/max value input setting.");
State.Initialized.Value = true;
State.ContractName.Value = input.ContractName;
State.ContractManager.Value = input.Manager;
State.MinBet.Value = input.MinValue;
State.MaxBet.Value = input.MaxValue;
State.MortgageBalance.Value = input.MortgageValue;
return new Empty();
}
public override Empty UpdateBetLimit(BetLimitInput input)
{
Assert(Context.Sender == State.ContractManager.Value, "Only manager can perform this action.");
Assert(input.MinValue >0 && input.MaxValue >0 && input.MaxValue >= input.MinValue, "Invalid min/max value input setting.");
State.MinBet.Value = input.MinValue;
State.MaxBet.Value = input.MaxValue;
return new Empty();
}
public override Empty UserPlayBet(BetInput input)
{
Assert(input.Int64Value >= State.MinBet.Value && input.Int64Value <=State.MaxBet.Value, $"Input balance not in boundary({State.MinBet.Value}, {State.MaxBet.Value}).");
Assert(input.Int64Value > State.WinerHistory[Context.Sender], "Should bet bigger than your reward money.");
State.TotalBetBalance.Value = State.TotalBetBalance.Value.Add(input.Int64Value);
var result = WinOrLose(input.Int64Value);
if (result == 0)
{
State.LoserHistory[Context.Sender] = State.LoserHistory[Context.Sender].Add(input.Int64Value);
}
else
{
State.RewardBalance.Value = State.RewardBalance.Value.Add(result);
State.WinerHistory[Context.Sender] = State.WinerHistory[Context.Sender].Add(result);
}
return new Empty();
}
public override Empty LockToken(LockTokenInput input)
{
State.TokenContract.Value =
Context.GetContractAddressByName(SmartContractConstants.TokenContractSystemName);
State.TokenContract.Lock.Send(new LockInput
{
Symbol = input.Symbol,
Address = input.Address,
Amount = input.Amount,
LockId = input.LockId,
Usage = input.Usage
});
return new Empty();
}
public override Empty UnlockToken(UnlockTokenInput input)
{
State.TokenContract.Value =
Context.GetContractAddressByName(SmartContractConstants.TokenContractSystemName);
State.TokenContract.Unlock.Send(new UnlockInput
{
Symbol = input.Symbol,
Address = input.Address,
Amount = input.Amount,
LockId = input.LockId,
Usage = input.Usage
});
return new Empty();
}
public override Empty ValidateOrigin(Address address)
{
Assert(address == Context.Origin, "Validation failed, origin is not expected.");
return new Empty();
}
private long WinOrLose(long betAmount)
{
var data = State.TotalBetBalance.Value.Sub(State.RewardBalance.Value);
if(data < 0)
data = data *(-1);
if (data % 100 == 1)
return betAmount * 1000;
if (data % 50 == 5)
return betAmount * 50;
return 0;
}
}
} | 37.625 | 179 | 0.577361 | [
"MIT"
] | tomatopunk/AElf | test/AElf.Contracts.TestContract.BasicFunction/BasicContract_Action.cs | 4,214 | C# |
namespace OJS.Web.Areas.Contests.ViewModels.Submissions
{
using System;
using System.Linq.Expressions;
using OJS.Common.Models;
using OJS.Data.Models;
public class TestRunDetailsViewModel
{
public static Expression<Func<TestRun, TestRunDetailsViewModel>> FromTestRun
{
get
{
return test => new TestRunDetailsViewModel
{
IsTrialTest = test.Test.IsTrialTest,
CheckerComment = test.CheckerComment,
ExecutionComment = test.ExecutionComment,
Order = test.Test.OrderBy,
ResultType = test.ResultType,
TimeUsed = test.TimeUsed,
MemoryUsed = test.MemoryUsed,
Id = test.Id,
TestId = test.TestId,
};
}
}
public bool IsTrialTest { get; set; }
public int Order { get; set; }
public TestRunResultType ResultType { get; set; }
public string ExecutionComment { get; set; }
public string CheckerComment { get; set; }
public int TimeUsed { get; set; }
public long MemoryUsed { get; set; }
public int Id { get; set; }
public int TestId { get; set; }
}
} | 37.5 | 103 | 0.396111 | [
"MIT"
] | SveGeorgiev/OpenJudgeSystem | Open Judge System/Web/OJS.Web/Areas/Contests/ViewModels/Submissions/TestRunDetailsViewModel.cs | 1,802 | C# |
/*
Copyright (c) 2014, Lars Brubaker
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The views and conclusions contained in the software and documentation are those
of the authors and should not be interpreted as representing official policies,
either expressed or implied, of the FreeBSD Project.
*/
using MatterHackers.Csg;
using MatterHackers.Csg.Operations;
using MatterHackers.Csg.Solids;
using MatterHackers.Csg.Transform;
using MatterHackers.PolygonMesh;
using MatterHackers.VectorMath;
using System;
using System.Collections.Generic;
using System.Threading;
namespace MatterHackers.RenderOpenGl
{
public class CsgToMesh
{
public static PolygonMesh.Mesh Convert(CsgObject objectToProcess, bool cleanMeshAfterConvert = false)
{
CsgToMesh visitor = new CsgToMesh();
var mesh = visitor.CsgToMeshRecursive((dynamic)objectToProcess);
if(cleanMeshAfterConvert)
{
mesh.CleanAndMergMesh(CancellationToken.None);
}
return mesh;
}
public CsgToMesh()
{
}
#region Visitor Pattern Functions
public PolygonMesh.Mesh CsgToMeshRecursive(CsgObject objectToProcess)
{
throw new Exception("You must write the specialized function for this type.");
}
#region PrimitiveWrapper
public PolygonMesh.Mesh CsgToMeshRecursive(CsgObjectWrapper objectToProcess)
{
return CsgToMeshRecursive((dynamic)objectToProcess.Root);
}
#endregion PrimitiveWrapper
#region Box
public static PolygonMesh.Mesh CreateBox(AxisAlignedBoundingBox aabb)
{
PolygonMesh.Mesh cube = new PolygonMesh.Mesh();
IVertex[] verts = new Vertex[8];
//verts[0] = cube.CreateVertex(new Vector3(-1, -1, 1));
//verts[1] = cube.CreateVertex(new Vector3(1, -1, 1));
//verts[2] = cube.CreateVertex(new Vector3(1, 1, 1));
//verts[3] = cube.CreateVertex(new Vector3(-1, 1, 1));
//verts[4] = cube.CreateVertex(new Vector3(-1, -1, -1));
//verts[5] = cube.CreateVertex(new Vector3(1, -1, -1));
//verts[6] = cube.CreateVertex(new Vector3(1, 1, -1));
//verts[7] = cube.CreateVertex(new Vector3(-1, 1, -1));
verts[0] = cube.CreateVertex(new Vector3(aabb.minXYZ.X, aabb.minXYZ.Y, aabb.maxXYZ.Z));
verts[1] = cube.CreateVertex(new Vector3(aabb.maxXYZ.X, aabb.minXYZ.Y, aabb.maxXYZ.Z));
verts[2] = cube.CreateVertex(new Vector3(aabb.maxXYZ.X, aabb.maxXYZ.Y, aabb.maxXYZ.Z));
verts[3] = cube.CreateVertex(new Vector3(aabb.minXYZ.X, aabb.maxXYZ.Y, aabb.maxXYZ.Z));
verts[4] = cube.CreateVertex(new Vector3(aabb.minXYZ.X, aabb.minXYZ.Y, aabb.minXYZ.Z));
verts[5] = cube.CreateVertex(new Vector3(aabb.maxXYZ.X, aabb.minXYZ.Y, aabb.minXYZ.Z));
verts[6] = cube.CreateVertex(new Vector3(aabb.maxXYZ.X, aabb.maxXYZ.Y, aabb.minXYZ.Z));
verts[7] = cube.CreateVertex(new Vector3(aabb.minXYZ.X, aabb.maxXYZ.Y, aabb.minXYZ.Z));
// front
cube.CreateFace(new IVertex[] { verts[0], verts[1], verts[2], verts[3] });
// left
cube.CreateFace(new IVertex[] { verts[4], verts[0], verts[3], verts[7] });
// right
cube.CreateFace(new IVertex[] { verts[1], verts[5], verts[6], verts[2] });
// back
cube.CreateFace(new IVertex[] { verts[4], verts[7], verts[6], verts[5] });
// top
cube.CreateFace(new IVertex[] { verts[3], verts[2], verts[6], verts[7] });
// bottom
cube.CreateFace(new IVertex[] { verts[4], verts[5], verts[1], verts[0] });
return cube;
}
public PolygonMesh.Mesh CsgToMeshRecursive(Csg.Solids.MeshContainer objectToPrecess)
{
return objectToPrecess.GetMesh();
}
public PolygonMesh.Mesh CsgToMeshRecursive(BoxPrimitive objectToProcess)
{
if (objectToProcess.CreateCentered)
{
//objectToProcess.Size;
}
else
{
}
return PlatonicSolids.CreateCube(objectToProcess.Size);
}
#endregion Box
#region Cylinder
public static PolygonMesh.Mesh CreateCylinder(Cylinder.CylinderPrimitive cylinderToMeasure)
{
PolygonMesh.Mesh cylinder = new PolygonMesh.Mesh();
List<IVertex> bottomVerts = new List<IVertex>();
List<IVertex> topVerts = new List<IVertex>();
int sides = cylinderToMeasure.Sides;
for (int i = 0; i < sides; i++)
{
Vector2 bottomRadialPos = Vector2.Rotate(new Vector2(cylinderToMeasure.Radius1, 0), MathHelper.Tau * i / sides);
IVertex bottomVertex = cylinder.CreateVertex(new Vector3(bottomRadialPos.X, bottomRadialPos.Y, -cylinderToMeasure.Height / 2));
bottomVerts.Add(bottomVertex);
Vector2 topRadialPos = Vector2.Rotate(new Vector2(cylinderToMeasure.Radius1, 0), MathHelper.Tau * i / sides);
IVertex topVertex = cylinder.CreateVertex(new Vector3(topRadialPos.X, topRadialPos.Y, cylinderToMeasure.Height / 2));
topVerts.Add(topVertex);
}
cylinder.ReverseFaceEdges(cylinder.CreateFace(bottomVerts.ToArray()));
cylinder.CreateFace(topVerts.ToArray());
for (int i = 0; i < sides - 1; i++)
{
cylinder.CreateFace(new IVertex[] { topVerts[i], bottomVerts[i], bottomVerts[i + 1], topVerts[i + 1] });
}
cylinder.CreateFace(new IVertex[] { topVerts[sides - 1], bottomVerts[sides - 1], bottomVerts[0], topVerts[0] });
return cylinder;
}
public PolygonMesh.Mesh CsgToMeshRecursive(Cylinder.CylinderPrimitive objectToProcess)
{
return CreateCylinder(objectToProcess);
}
#endregion Cylinder
#region NGonExtrusion
public PolygonMesh.Mesh CsgToMeshRecursive(NGonExtrusion.NGonExtrusionPrimitive objectToProcess)
{
throw new NotImplementedException();
#if false
info += "cylinder(r1=" + objectToProcess.Radius1.ToString() + ", r2=" + objectToProcess.Radius1.ToString() + ", h=" + objectToProcess.Height.ToString() + ", center=true, $fn=" + objectToProcess.NumSides.ToString() + ");";
return ApplyIndent(info);
#endif
}
#endregion NGonExtrusion
#region Sphere
public PolygonMesh.Mesh CsgToMeshRecursive(Sphere objectToProcess)
{
throw new NotImplementedException();
#if false
info += "sphere(" + objectToProcess.Radius.ToString() + ", $fn=40);" ;
return ApplyIndent(info);
#endif
}
#endregion Sphere
#region Transform
public PolygonMesh.Mesh CsgToMeshRecursive(TransformBase objectToProcess)
{
PolygonMesh.Mesh mesh = CsgToMeshRecursive((dynamic)objectToProcess.ObjectToTransform);
mesh.Transform(objectToProcess.ActiveTransform);
return mesh;
}
#endregion Transform
#region Union
public PolygonMesh.Mesh CsgToMeshRecursive(Union objectToProcess)
{
PolygonMesh.Mesh primary = CsgToMeshRecursive((dynamic)objectToProcess.AllObjects[0]);
for (int i = 1; i < objectToProcess.AllObjects.Count; i++)
{
PolygonMesh.Mesh add = CsgToMeshRecursive((dynamic)objectToProcess.AllObjects[i]);
primary = PolygonMesh.Csg.CsgOperations.Union(primary, add);
}
return primary;
}
#endregion Union
#region Difference
public PolygonMesh.Mesh CsgToMeshRecursive(Difference objectToProcess)
{
PolygonMesh.Mesh primary = CsgToMeshRecursive((dynamic)objectToProcess.Primary);
foreach (CsgObject objectToOutput in objectToProcess.AllSubtracts)
{
PolygonMesh.Mesh remove = CsgToMeshRecursive((dynamic)objectToOutput);
primary = PolygonMesh.Csg.CsgOperations.Subtract(primary, remove);
}
return primary;
}
#endregion Difference
#region Intersection
public PolygonMesh.Mesh CsgToMeshRecursive(Intersection objectToProcess)
{
throw new NotImplementedException();
#if false
return ApplyIndent("intersection()" + "\n{\n" + CsgToMeshRecursive((dynamic)objectToProcess.a, level + 1) + "\n" + CsgToMeshRecursive((dynamic)objectToProcess.b, level + 1) + "\n}");
#endif
}
#endregion Intersection
#endregion Visitor Patern Functions
}
} | 34.294574 | 233 | 0.7309 | [
"BSD-2-Clause"
] | krolco/agg-sharp | Csg/Processors/CsgToMesh.cs | 8,850 | C# |
/*
Copyright (c) 2009-2011 250bpm s.r.o.
Copyright (c) 2007-2009 iMatix Corporation
Copyright (c) 2007-2015 Other contributors as noted in the AUTHORS file
This file is part of 0MQ.
0MQ is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
0MQ is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Sockets;
using AsyncIO;
using JetBrains.Annotations;
namespace NetMQ.Core.Transports
{
internal sealed class StreamEngine : IEngine, IProactorEvents, IMsgSink
{
private class StateMachineAction
{
public StateMachineAction(Action action, SocketError socketError, int bytesTransferred)
{
Action = action;
SocketError = socketError;
BytesTransferred = bytesTransferred;
}
public Action Action { get; }
public SocketError SocketError { get; }
public int BytesTransferred { get; }
}
/// <summary>
/// This enum-type denotes the operational state of this StreamEngine - whether Closed, doing Handshaking, Active, or Stalled.
/// </summary>
private enum State
{
Closed,
Handshaking,
Active,
Stalled,
}
private enum HandshakeState
{
Closed,
SendingGreeting,
ReceivingGreeting,
SendingRestOfGreeting,
ReceivingRestOfGreeting
}
private enum ReceiveState
{
Idle,
Active,
Stuck,
}
private enum SendState
{
Idle,
Active,
Error
}
private enum Action
{
Start,
InCompleted,
OutCompleted,
ActivateOut,
ActivateIn
}
// Size of the greeting message:
// Preamble (10 bytes) + version (1 byte) + socket type (1 byte).
private const int GreetingSize = 12;
private const int PreambleSize = 10;
// Position of the version field in the greeting.
private const int VersionPos = 10;
//private IOObject io_object;
private AsyncSocket m_handle;
private ByteArraySegment m_inpos;
private int m_insize;
private DecoderBase m_decoder;
private bool m_ioEnabled;
private ByteArraySegment m_outpos;
private int m_outsize;
private EncoderBase m_encoder;
// The receive buffer holding the greeting message
// that we are receiving from the peer.
private readonly byte[] m_greeting = new byte[12];
// The number of bytes of the greeting message that
// we have already received.
private int m_greetingBytesRead;
// The send buffer holding the greeting message
// that we are sending to the peer.
private readonly ByteArraySegment m_greetingOutputBuffer = new byte[12];
// The session this engine is attached to.
private SessionBase m_session;
// Detached transient session.
//private SessionBase leftover_session;
private readonly Options m_options;
// string representation of endpoint
private readonly string m_endpoint;
private bool m_plugged;
// Socket
private SocketBase m_socket;
private IOObject m_ioObject;
private SendState m_sendingState;
private ReceiveState m_receivingState;
private State m_state;
private HandshakeState m_handshakeState;
// queue for actions that happen during the state machine
private readonly Queue<StateMachineAction> m_actionsQueue;
public StreamEngine(AsyncSocket handle, Options options, string endpoint)
{
m_handle = handle;
m_insize = 0;
m_ioEnabled = false;
m_sendingState = SendState.Idle;
m_receivingState = ReceiveState.Idle;
m_outsize = 0;
m_session = null;
m_options = options;
m_plugged = false;
m_endpoint = endpoint;
m_socket = null;
m_encoder = null;
m_decoder = null;
m_actionsQueue = new Queue<StateMachineAction>();
// Set the socket buffer limits for the underlying socket.
if (m_options.SendBuffer != 0)
{
m_handle.SendBufferSize = m_options.SendBuffer;
}
if (m_options.ReceiveBuffer != 0)
{
m_handle.ReceiveBufferSize = m_options.ReceiveBuffer;
}
}
public void Destroy()
{
Debug.Assert(!m_plugged);
if (m_handle != null)
{
try
{
m_handle.Dispose();
}
catch (SocketException)
{}
m_handle = null;
}
}
public void Plug(IOThread ioThread, SessionBase session)
{
Debug.Assert(!m_plugged);
m_plugged = true;
// Connect to session object.
Debug.Assert(m_session == null);
Debug.Assert(session != null);
m_session = session;
m_socket = m_session.Socket;
m_ioObject = new IOObject(null);
m_ioObject.SetHandler(this);
// Connect to I/O threads poller object.
m_ioObject.Plug(ioThread);
m_ioObject.AddSocket(m_handle);
m_ioEnabled = true;
FeedAction(Action.Start, SocketError.Success, 0);
}
public void Terminate()
{
Unplug();
Destroy();
}
private void Unplug()
{
Debug.Assert(m_plugged);
m_plugged = false;
// remove handle from proactor.
if (m_ioEnabled)
{
m_ioObject.RemoveSocket(m_handle);
m_ioEnabled = false;
}
// Disconnect from I/O threads poller object.
m_ioObject.Unplug();
m_state = State.Closed;
// Disconnect from session object.
m_encoder?.SetMsgSource(null);
m_decoder?.SetMsgSink(null);
m_session = null;
}
private void Error()
{
Debug.Assert(m_session != null);
m_socket.EventDisconnected(m_endpoint, m_handle);
m_session.Detach();
Unplug();
Destroy();
}
private void FeedAction(Action action, SocketError socketError, int bytesTransferred)
{
Handle(action, socketError, bytesTransferred);
while (m_actionsQueue.Count > 0)
{
var stateMachineAction = m_actionsQueue.Dequeue();
Handle(stateMachineAction.Action, stateMachineAction.SocketError, stateMachineAction.BytesTransferred);
}
}
private void EnqueueAction(Action action, SocketError socketError, int bytesTransferred)
{
m_actionsQueue.Enqueue(new StateMachineAction(action, socketError, bytesTransferred));
}
private void Handle(Action action, SocketError socketError, int bytesTransferred)
{
switch (m_state)
{
case State.Closed:
switch (action)
{
case Action.Start:
if (m_options.RawSocket)
{
m_encoder = new RawEncoder(Config.OutBatchSize, m_session, m_options.Endian);
m_decoder = new RawDecoder(Config.InBatchSize, m_options.MaxMessageSize, m_session, m_options.Endian);
Activate();
}
else
{
m_state = State.Handshaking;
m_handshakeState = HandshakeState.Closed;
HandleHandshake(action, socketError, bytesTransferred);
}
break;
}
break;
case State.Handshaking:
HandleHandshake(action, socketError, bytesTransferred);
break;
case State.Active:
switch (action)
{
case Action.InCompleted:
m_insize = EndRead(socketError, bytesTransferred);
ProcessInput();
break;
case Action.ActivateIn:
// if we stuck let's continue, other than that nothing to do
if (m_receivingState == ReceiveState.Stuck)
{
m_receivingState = ReceiveState.Active;
ProcessInput();
}
break;
case Action.OutCompleted:
int bytesSent = EndWrite(socketError, bytesTransferred);
// IO error has occurred. We stop waiting for output events.
// The engine is not terminated until we detect input error;
// this is necessary to prevent losing incoming messages.
if (bytesSent == -1)
{
m_sendingState = SendState.Error;
}
else
{
m_outpos.AdvanceOffset(bytesSent);
m_outsize -= bytesSent;
BeginSending();
}
break;
case Action.ActivateOut:
// if we idle we start sending, other than do nothing
if (m_sendingState == SendState.Idle)
{
m_sendingState = SendState.Active;
BeginSending();
}
break;
default:
Debug.Assert(false);
break;
}
break;
case State.Stalled:
switch (action)
{
case Action.ActivateIn:
// There was an input error but the engine could not
// be terminated (due to the stalled decoder).
// Flush the pending message and terminate the engine now.
m_decoder.ProcessBuffer(m_inpos, 0);
Debug.Assert(!m_decoder.Stalled());
m_session.Flush();
Error();
break;
case Action.ActivateOut:
break;
}
break;
}
}
private void BeginSending()
{
if (m_outsize == 0)
{
m_outpos = null;
m_encoder.GetData(ref m_outpos, ref m_outsize);
if (m_outsize == 0)
{
m_sendingState = SendState.Idle;
}
else
{
BeginWrite(m_outpos, m_outsize);
}
}
else
{
BeginWrite(m_outpos, m_outsize);
}
}
private void HandleHandshake(Action action, SocketError socketError, int bytesTransferred)
{
int bytesSent;
int bytesReceived;
switch (m_handshakeState)
{
case HandshakeState.Closed:
switch (action)
{
case Action.Start:
// Send the 'length' and 'flags' fields of the identity message.
// The 'length' field is encoded in the long format.
m_greetingOutputBuffer[m_outsize++] = 0xff;
m_greetingOutputBuffer.PutLong(m_options.Endian, (long)m_options.IdentitySize + 1, 1);
m_outsize += 8;
m_greetingOutputBuffer[m_outsize++] = 0x7f;
m_outpos = new ByteArraySegment(m_greetingOutputBuffer);
m_handshakeState = HandshakeState.SendingGreeting;
BeginWrite(m_outpos, m_outsize);
break;
default:
Debug.Assert(false);
break;
}
break;
case HandshakeState.SendingGreeting:
switch (action)
{
case Action.OutCompleted:
bytesSent = EndWrite(socketError, bytesTransferred);
if (bytesSent == -1)
{
Error();
}
else
{
m_outpos.AdvanceOffset(bytesSent);
m_outsize -= bytesSent;
if (m_outsize > 0)
{
BeginWrite(m_outpos, m_outsize);
}
else
{
m_greetingBytesRead = 0;
var greetingSegment = new ByteArraySegment(m_greeting, m_greetingBytesRead);
m_handshakeState = HandshakeState.ReceivingGreeting;
BeginRead(greetingSegment, PreambleSize);
}
}
break;
case Action.ActivateIn:
case Action.ActivateOut:
// nothing to do
break;
default:
Debug.Assert(false);
break;
}
break;
case HandshakeState.ReceivingGreeting:
switch (action)
{
case Action.InCompleted:
bytesReceived = EndRead(socketError, bytesTransferred);
if (bytesReceived == -1)
{
Error();
}
else
{
m_greetingBytesRead += bytesReceived;
// check if it is an unversioned protocol
if (m_greeting[0] != 0xff || (m_greetingBytesRead == 10 && (m_greeting[9] & 0x01) == 0))
{
m_encoder = new V1Encoder(Config.OutBatchSize, m_options.Endian);
m_encoder.SetMsgSource(m_session);
m_decoder = new V1Decoder(Config.InBatchSize, m_options.MaxMessageSize, m_options.Endian);
m_decoder.SetMsgSink(m_session);
// We have already sent the message header.
// Since there is no way to tell the encoder to
// skip the message header, we simply throw that
// header data away.
int headerSize = m_options.IdentitySize + 1 >= 255 ? 10 : 2;
var tmp = new byte[10];
var bufferp = new ByteArraySegment(tmp);
int bufferSize = headerSize;
m_encoder.GetData(ref bufferp, ref bufferSize);
Debug.Assert(bufferSize == headerSize);
// Make sure the decoder sees the data we have already received.
m_inpos = new ByteArraySegment(m_greeting);
m_insize = m_greetingBytesRead;
// To allow for interoperability with peers that do not forward
// their subscriptions, we inject a phony subscription
// message into the incoming message stream. To put this
// message right after the identity message, we temporarily
// divert the message stream from session to ourselves.
if (m_options.SocketType == ZmqSocketType.Pub || m_options.SocketType == ZmqSocketType.Xpub)
m_decoder.SetMsgSink(this);
// handshake is done
Activate();
}
else if (m_greetingBytesRead < 10)
{
var greetingSegment = new ByteArraySegment(m_greeting, m_greetingBytesRead);
BeginRead(greetingSegment, PreambleSize - m_greetingBytesRead);
}
else
{
// The peer is using versioned protocol.
// Send the rest of the greeting.
m_outpos[m_outsize++] = 1; // Protocol version
m_outpos[m_outsize++] = (byte)m_options.SocketType;
m_handshakeState = HandshakeState.SendingRestOfGreeting;
BeginWrite(m_outpos, m_outsize);
}
}
break;
case Action.ActivateIn:
case Action.ActivateOut:
// nothing to do
break;
default:
Debug.Assert(false);
break;
}
break;
case HandshakeState.SendingRestOfGreeting:
switch (action)
{
case Action.OutCompleted:
bytesSent = EndWrite(socketError, bytesTransferred);
if (bytesSent == -1)
{
Error();
}
else
{
m_outpos.AdvanceOffset(bytesSent);
m_outsize -= bytesSent;
if (m_outsize > 0)
{
BeginWrite(m_outpos, m_outsize);
}
else
{
var greetingSegment = new ByteArraySegment(m_greeting, m_greetingBytesRead);
m_handshakeState = HandshakeState.ReceivingRestOfGreeting;
BeginRead(greetingSegment, GreetingSize - m_greetingBytesRead);
}
}
break;
case Action.ActivateIn:
case Action.ActivateOut:
// nothing to do
break;
default:
Debug.Assert(false);
break;
}
break;
case HandshakeState.ReceivingRestOfGreeting:
switch (action)
{
case Action.InCompleted:
bytesReceived = EndRead(socketError, bytesTransferred);
if (bytesReceived == -1)
{
Error();
}
else
{
m_greetingBytesRead += bytesReceived;
if (m_greetingBytesRead < GreetingSize)
{
var greetingSegment = new ByteArraySegment(m_greeting, m_greetingBytesRead);
BeginRead(greetingSegment, GreetingSize - m_greetingBytesRead);
}
else
{
if (m_greeting[VersionPos] == 0)
{
// ZMTP/1.0 framing.
m_encoder = new V1Encoder(Config.OutBatchSize, m_options.Endian);
m_encoder.SetMsgSource(m_session);
m_decoder = new V1Decoder(Config.InBatchSize, m_options.MaxMessageSize, m_options.Endian);
m_decoder.SetMsgSink(m_session);
}
else
{
// v1 framing protocol.
m_encoder = new V2Encoder(Config.OutBatchSize, m_session, m_options.Endian);
m_decoder = new V2Decoder(Config.InBatchSize, m_options.MaxMessageSize, m_session, m_options.Endian);
}
// handshake is done
Activate();
}
}
break;
case Action.ActivateIn:
case Action.ActivateOut:
// nothing to do
break;
default:
Debug.Assert(false);
break;
}
break;
default:
Debug.Assert(false);
break;
}
}
private void Activate()
{
// Handshaking was successful.
// Switch into the normal message flow.
m_state = State.Active;
m_outsize = 0;
m_sendingState = SendState.Active;
BeginSending();
m_receivingState = ReceiveState.Active;
if (m_insize == 0)
{
m_decoder.GetBuffer(out m_inpos, out m_insize);
BeginRead(m_inpos, m_insize);
}
else
{
ProcessInput();
}
}
private void ProcessInput()
{
bool disconnection = false;
int processed;
if (m_insize == -1)
{
m_insize = 0;
disconnection = true;
}
if (m_options.RawSocket)
{
if (m_insize == 0 || !m_decoder.MessageReadySize(m_insize))
{
processed = 0;
}
else
{
processed = m_decoder.ProcessBuffer(m_inpos, m_insize);
}
}
else
{
// Push the data to the decoder.
processed = m_decoder.ProcessBuffer(m_inpos, m_insize);
}
if (processed == -1)
{
disconnection = true;
}
else
{
// Stop polling for input if we got stuck.
if (processed < m_insize)
{
m_receivingState = ReceiveState.Stuck;
m_inpos.AdvanceOffset(processed);
m_insize -= processed;
}
else
{
m_inpos = null;
m_insize = 0;
}
}
// Flush all messages the decoder may have produced.
m_session.Flush();
// An input error has occurred. If the last decoded message
// has already been accepted, we terminate the engine immediately.
// Otherwise, we stop waiting for socket events and postpone
// the termination until after the message is accepted.
if (disconnection)
{
if (m_decoder.Stalled())
{
m_ioObject.RemoveSocket(m_handle);
m_ioEnabled = false;
m_state = State.Stalled;
}
else
{
Error();
}
}
else if (m_receivingState != ReceiveState.Stuck)
{
m_decoder.GetBuffer(out m_inpos, out m_insize);
BeginRead(m_inpos, m_insize);
}
}
/// <summary>
/// This method is be called when a message receive operation has been completed.
/// </summary>
/// <param name="socketError">a SocketError value that indicates whether Success or an error occurred</param>
/// <param name="bytesTransferred">the number of bytes that were transferred</param>
public void InCompleted(SocketError socketError, int bytesTransferred)
{
FeedAction(Action.InCompleted, socketError, bytesTransferred);
}
public void ActivateIn()
{
FeedAction(Action.ActivateIn, SocketError.Success, 0);
}
/// <summary>
/// This method is called when a message Send operation has been completed.
/// </summary>
/// <param name="socketError">a SocketError value that indicates whether Success or an error occurred</param>
/// <param name="bytesTransferred">the number of bytes that were transferred</param>
public void OutCompleted(SocketError socketError, int bytesTransferred)
{
FeedAction(Action.OutCompleted, socketError, bytesTransferred);
}
public void ActivateOut()
{
FeedAction(Action.ActivateOut, SocketError.Success, 0);
}
public bool PushMsg(ref Msg msg)
{
Debug.Assert(m_options.SocketType == ZmqSocketType.Pub || m_options.SocketType == ZmqSocketType.Xpub);
// The first message is identity.
// Let the session process it.
m_session.PushMsg(ref msg);
// Inject the subscription message so that the ZMQ 2.x peer
// receives our messages.
msg.InitPool(1);
msg.Put((byte)1);
bool isMessagePushed = m_session.PushMsg(ref msg);
m_session.Flush();
// Once we have injected the subscription message, we can
// Divert the message flow back to the session.
Debug.Assert(m_decoder != null);
m_decoder.SetMsgSink(m_session);
return isMessagePushed;
}
/// <param name="socketError">the SocketError that resulted from the write - which could be Success (no error at all)</param>
/// <param name="bytesTransferred">this indicates the number of bytes that were transferred in the write</param>
/// <returns>the number of bytes transferred if successful, -1 otherwise</returns>
/// <exception cref="NetMQException">If the socketError is not Success then it must be a valid recoverable error or the number of bytes transferred must be zero.</exception>
/// <remarks>
/// If socketError is SocketError.Success and bytesTransferred is > 0, then this returns bytesTransferred.
/// If bytes is zero, or the socketError is one of NetworkDown, NetworkReset, HostUn, Connection Aborted, TimedOut, or ConnectionReset, - then -1 is returned.
/// Otherwise, a NetMQException is thrown.
/// </remarks>
private static int EndWrite(SocketError socketError, int bytesTransferred)
{
if (socketError == SocketError.Success && bytesTransferred > 0)
return bytesTransferred;
if (bytesTransferred == 0 ||
socketError == SocketError.NetworkDown ||
socketError == SocketError.NetworkReset ||
socketError == SocketError.HostUnreachable ||
socketError == SocketError.ConnectionAborted ||
socketError == SocketError.TimedOut ||
socketError == SocketError.ConnectionReset ||
socketError == SocketError.AccessDenied)
return -1;
throw NetMQException.Create(socketError);
}
private void BeginWrite([NotNull] ByteArraySegment data, int size)
{
try
{
m_handle.Send((byte[])data, data.Offset, size, SocketFlags.None);
}
catch (SocketException ex)
{
EnqueueAction(Action.OutCompleted, ex.SocketErrorCode, 0);
}
}
/// <param name="socketError">the SocketError that resulted from the read - which could be Success (no error at all)</param>
/// <param name="bytesTransferred">this indicates the number of bytes that were transferred in the read</param>
/// <returns>the number of bytes transferred if successful, -1 otherwise</returns>
/// <exception cref="NetMQException">If the socketError is not Success then it must be a valid recoverable error or the number of bytes transferred must be zero.</exception>
/// <remarks>
/// If socketError is SocketError.Success and bytesTransferred is > 0, then this returns bytesTransferred.
/// If bytes is zero, or the socketError is one of NetworkDown, NetworkReset, HostUn, Connection Aborted, TimedOut, or ConnectionReset, - then -1 is returned.
/// Otherwise, a NetMQException is thrown.
/// </remarks>
private static int EndRead(SocketError socketError, int bytesTransferred)
{
if (socketError == SocketError.Success && bytesTransferred > 0)
return bytesTransferred;
if (bytesTransferred == 0 ||
socketError == SocketError.NetworkDown ||
socketError == SocketError.NetworkReset ||
socketError == SocketError.HostUnreachable ||
socketError == SocketError.ConnectionAborted ||
socketError == SocketError.TimedOut ||
socketError == SocketError.ConnectionReset ||
socketError == SocketError.AccessDenied)
return -1;
throw NetMQException.Create(socketError);
}
private void BeginRead([NotNull] ByteArraySegment data, int size)
{
try
{
m_handle.Receive((byte[])data, data.Offset, size, SocketFlags.None);
}
catch (SocketException ex)
{
EnqueueAction(Action.InCompleted, ex.SocketErrorCode, 0);
}
}
/// <summary>
/// This would be called when a timer expires, although here it only throws NotSupportedException.
/// </summary>
/// <param name="id">an integer used to identify the timer (not used here)</param>
/// <exception cref="NotSupportedException">TimerEvent is not supported on StreamEngine.</exception>
public void TimerEvent(int id)
{
throw new NotSupportedException();
}
}
} | 38.391553 | 181 | 0.465255 | [
"BSD-3-Clause"
] | stefanmarks/SentienceLab_UnityFramework | Runtime/Scripts/ThirdParty/NetMQ/Core/Transports/StreamEngine.cs | 33,631 | C# |
namespace movies.Interfaces
{
public interface IRepositorio
{
List<T> Lista();
T RetornaPorId(int id);
void Insere(T entidade);
void Exclui(int id);
void Atualiza(int id, T entidade);
int ProximoId();
}
} | 24.75 | 42 | 0.511785 | [
"MIT"
] | schiblich/upgradeCadastroMedia | movies/Interfaces/IRepositorio.cs | 297 | C# |
using TeamBuilder.App.Core.Commands.Contracts;
using TeamBuilder.App.Utilities;
using TeamBuilder.Data;
using TeamBuilder.Models;
namespace TeamBuilder.App.Core.Commands
{
public class DeleteUserCommand : ICommand
{
public string Execute(string[] inputArgs)
{
Check.CheckLength(0, inputArgs);
AuthenticationManager.Authorize();
User currentUser = AuthenticationManager.GetCurrentUser();
using (var context = new TeamBuilderContext())
{
currentUser.IsDeleted = true;
context.Users.Update(currentUser);
context.SaveChanges();
AuthenticationManager.Logout();
}
return $"User {currentUser.Username} was deleted successfully!";
}
}
}
| 24.909091 | 76 | 0.615572 | [
"MIT"
] | ViktorAleksandrov/SoftUni--CSharp-DB-Fundamentals | Databases Advanced - Entity Framework/12. Workshop - Team Builder/TeamBuilder.App/Core/Commands/DeleteUserCommand.cs | 824 | C# |
/****************************************************************************
*Copyright (c) 2018 yswenli All Rights Reserved.
*CLR版本: 2.1.4
*机器名称:WENLI-PC
*公司名称:wenli
*命名空间:SAEA.NatSocket
*文件名: Class1
*版本号: v4.5.1.2
*唯一标识:ef84e44b-6fa2-432e-90a2-003ebd059303
*当前的用户域:WENLI-PC
*创建人: yswenli
*电子邮箱:wenguoli_520@qq.com
*创建时间:2018/3/1 15:54:21
*描述:
*
*=====================================================================
*修改标记
*修改时间:2018/3/1 15:54:21
*修改人: yswenli
*版本号: v4.5.1.2
*描述:
*
*****************************************************************************/
using System;
using System.Collections.Generic;
using System.Linq;
namespace SAEA.NatSocket.Upnp
{
class DiscoveryResponseMessage
{
private readonly IDictionary<string, string> _headers;
public DiscoveryResponseMessage(string message)
{
var lines = message.Split(new[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
var headers = from h in lines.Skip(1)
let c = h.Split(':')
let key = c[0]
let value = c.Length > 1
? string.Join(":", c.Skip(1).ToArray())
: string.Empty
select new { Key = key, Value = value.Trim() };
_headers = headers.ToDictionary(x => x.Key.ToUpperInvariant(), x => x.Value);
}
public string this[string key]
{
get { return _headers[key.ToUpperInvariant()]; }
}
}
}
| 29.037736 | 95 | 0.479532 | [
"Apache-2.0"
] | heheheheheri/SAEA-1 | Src/SAEA.NatSocket/Upnp/DiscoveryResponseMessage.cs | 1,691 | C# |
using System;
namespace Spectre.Console.Cli.Internal
{
internal sealed class CommandValueBinder
{
private readonly CommandValueLookup _lookup;
public CommandValueBinder(CommandValueLookup lookup)
{
_lookup = lookup;
}
public void Bind(CommandParameter parameter, ITypeResolver resolver, object? value)
{
if (parameter.ParameterKind == ParameterKind.Pair)
{
value = GetLookup(parameter, resolver, value);
}
else if (parameter.ParameterKind == ParameterKind.Vector)
{
value = GetArray(parameter, value);
}
else if (parameter.ParameterKind == ParameterKind.FlagWithValue)
{
value = GetFlag(parameter, value);
}
_lookup.SetValue(parameter, value);
}
private object GetLookup(CommandParameter parameter, ITypeResolver resolver, object? value)
{
var genericTypes = parameter.Property.PropertyType.GetGenericArguments();
var multimap = (IMultiMap?)_lookup.GetValue(parameter);
if (multimap == null)
{
multimap = Activator.CreateInstance(typeof(MultiMap<,>).MakeGenericType(genericTypes[0], genericTypes[1])) as IMultiMap;
if (multimap == null)
{
throw new InvalidOperationException("Could not create multimap");
}
}
// Create deconstructor.
var deconstructorType = parameter.PairDeconstructor?.Type ?? typeof(DefaultPairDeconstructor);
if (!(resolver.Resolve(deconstructorType) is IPairDeconstructor deconstructor))
{
if (!(Activator.CreateInstance(deconstructorType) is IPairDeconstructor activatedDeconstructor))
{
throw new InvalidOperationException($"Could not create pair deconstructor.");
}
deconstructor = activatedDeconstructor;
}
// Deconstruct and add to multimap.
var pair = deconstructor.Deconstruct(resolver, genericTypes[0], genericTypes[1], value as string);
if (pair.Key != null)
{
multimap.Add(pair);
}
return multimap;
}
private object GetArray(CommandParameter parameter, object? value)
{
// Add a new item to the array
var array = (Array?)_lookup.GetValue(parameter);
Array newArray;
var elementType = parameter.Property.PropertyType.GetElementType();
if (elementType == null)
{
throw new InvalidOperationException("Could not get property type.");
}
if (array == null)
{
newArray = Array.CreateInstance(elementType, 1);
}
else
{
newArray = Array.CreateInstance(elementType, array.Length + 1);
array.CopyTo(newArray, 0);
}
newArray.SetValue(value, newArray.Length - 1);
return newArray;
}
private object GetFlag(CommandParameter parameter, object? value)
{
var flagValue = (IFlagValue?)_lookup.GetValue(parameter);
if (flagValue == null)
{
flagValue = (IFlagValue?)Activator.CreateInstance(parameter.ParameterType);
if (flagValue == null)
{
throw new InvalidOperationException("Could not create flag value.");
}
}
if (value != null)
{
// Null means set, but not with a valid value.
flagValue.Value = value;
}
// If the parameter was mapped, then it's set.
flagValue.IsSet = true;
return flagValue;
}
}
}
| 33.697479 | 136 | 0.545885 | [
"MIT"
] | NickWingate/spectre.console | src/Spectre.Console/Cli/Internal/Binding/CommandValueBinder.cs | 4,010 | C# |
// This file is auto-generated, don't edit it. Thanks.
using System;
using System.Collections.Generic;
using System.IO;
using Tea;
namespace AlibabaCloud.SDK.Dingtalkcontact_1_0.Models
{
public class GetTranslateFileJobResultResponse : TeaModel {
[NameInMap("headers")]
[Validation(Required=true)]
public Dictionary<string, string> Headers { get; set; }
[NameInMap("body")]
[Validation(Required=true)]
public GetTranslateFileJobResultResponseBody Body { get; set; }
}
}
| 23.130435 | 71 | 0.691729 | [
"Apache-2.0"
] | aliyun/dingtalk-sdk | dingtalk/csharp/core/contact_1_0/Models/GetTranslateFileJobResultResponse.cs | 532 | C# |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.