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 System.Web.Mvc;
using Twilio.OwlFinance.Domain.Interfaces.Settings;
namespace Twilio.OwlFinance.Web.Mvc
{
public abstract class OwlFinanceViewPage : WebViewPage
{
public IAppSettingsProvider Settings { get; set; }
}
}
| 22.363636 | 58 | 0.735772 | [
"MIT"
] | jonedavis/OwlFinanceDemo | web/website/Mvc/OwlFinanceViewPage.cs | 248 | C# |
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MessagesManager : MonoBehaviour
{
MessagesDispatcher[] messages;
class MessagesDispatcher
{
public string name;
public List<ReceiveEvent> receiveEvents = new List<ReceiveEvent>();
}
public static MessagesManager instance;
void Awake()
{
if (!instance)
{
instance = this;
}
else
{
Destroy(this.gameObject);
}
}
private void OnDestroy()
{
if (instance == this)
{
instance = null;
}
}
public void InitMessages(string[] messagesString)
{
messages = new MessagesDispatcher[messagesString.Length];
for (int i = 0; i < messagesString.Length; i++)
{
messages[i] = new MessagesDispatcher() { name = messagesString[i] };
}
}
public void AddMessageReceiver(ReceiveEvent receiveEvent)
{
foreach (var message in messages)
{
if (message.name == receiveEvent.messageName)
{
message.receiveEvents.Add(receiveEvent);
break;
}
}
}
public void TriggerMessage(string messageName)
{
foreach (var message in messages)
{
if (message.name == messageName)
{
foreach (var receiveEvents in message.receiveEvents)
{
receiveEvents.Trigger();
}
break;
}
}
}
}
| 21.837838 | 80 | 0.525371 | [
"BSD-3-Clause"
] | InstytutXR/ScioXR | Assets/Scripts/Blocks/MessagesManager.cs | 1,618 | C# |
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Azure.WebJobs.Host.Executors;
using Microsoft.Azure.WebJobs.Host.Indexers;
using Microsoft.Azure.WebJobs.Host.Loggers;
using Microsoft.Azure.WebJobs.Host.TestCommon;
using Newtonsoft.Json;
using Xunit;
namespace Microsoft.Azure.WebJobs.Host.UnitTests
{
public class JobHostConfigurationTests
{
[Fact]
public void ConstructorDefaults()
{
JobHostConfiguration config = new JobHostConfiguration();
Assert.NotNull(config.Singleton);
Assert.NotNull(config.Tracing);
Assert.Equal(TraceLevel.Info, config.Tracing.ConsoleLevel);
Assert.Equal(0, config.Tracing.Tracers.Count);
Assert.False(config.Blobs.CentralizedPoisonQueue);
StorageClientFactory clientFactory = config.GetService<StorageClientFactory>();
Assert.NotNull(clientFactory);
}
[Fact]
public void HostId_IfNull_DoesNotThrow()
{
// Arrange
JobHostConfiguration configuration = new JobHostConfiguration();
string hostId = null;
// Act & Assert
configuration.HostId = hostId;
}
[Fact]
public void HostId_IfValid_DoesNotThrow()
{
// Arrange
JobHostConfiguration configuration = new JobHostConfiguration();
string hostId = "abc";
// Act & Assert
configuration.HostId = hostId;
}
[Fact]
public void HostId_IfMinimumLength_DoesNotThrow()
{
// Arrange
JobHostConfiguration configuration = new JobHostConfiguration();
string hostId = "a";
// Act & Assert
configuration.HostId = hostId;
}
[Fact]
public void HostId_IfMaximumLength_DoesNotThrow()
{
// Arrange
JobHostConfiguration configuration = new JobHostConfiguration();
const int maximumValidCharacters = 32;
string hostId = new string('a', maximumValidCharacters);
// Act & Assert
configuration.HostId = hostId;
}
[Fact]
public void HostId_IfContainsEveryValidLetter_DoesNotThrow()
{
// Arrange
JobHostConfiguration configuration = new JobHostConfiguration();
string hostId = "abcdefghijklmnopqrstuvwxyz";
// Act & Assert
configuration.HostId = hostId;
}
[Fact]
public void HostId_IfContainsEveryValidOtherCharacter_DoesNotThrow()
{
// Arrange
JobHostConfiguration configuration = new JobHostConfiguration();
string hostId = "0-123456789";
// Act & Assert
configuration.HostId = hostId;
}
[Fact]
public void HostId_IfEmpty_Throws()
{
TestHostIdThrows(String.Empty);
}
[Fact]
public void HostId_IfTooLong_Throws()
{
const int maximumValidCharacters = 32;
string hostId = new string('a', maximumValidCharacters + 1);
TestHostIdThrows(hostId);
}
[Fact]
public void HostId_IfContainsInvalidCharacter_Throws()
{
// Uppercase character are not allowed.
TestHostIdThrows("aBc");
}
[Fact]
public void HostId_IfStartsWithDash_Throws()
{
TestHostIdThrows("-abc");
}
[Fact]
public void HostId_IfEndsWithDash_Throws()
{
TestHostIdThrows("abc-");
}
[Fact]
public void HostId_IfContainsConsecutiveDashes_Throws()
{
TestHostIdThrows("a--bc");
}
[Fact]
public void JobActivator_IfNull_Throws()
{
JobHostConfiguration configuration = new JobHostConfiguration();
ExceptionAssert.ThrowsArgumentNull(() => configuration.JobActivator = null, "value");
}
[Fact]
public void GetService_IExtensionRegistry_ReturnsDefaultRegistry()
{
JobHostConfiguration configuration = new JobHostConfiguration();
IExtensionRegistry extensionRegistry = configuration.GetService<IExtensionRegistry>();
extensionRegistry.RegisterExtension<IComparable>("test1");
extensionRegistry.RegisterExtension<IComparable>("test2");
extensionRegistry.RegisterExtension<IComparable>("test3");
Assert.NotNull(extensionRegistry);
IComparable[] results = extensionRegistry.GetExtensions<IComparable>().ToArray();
Assert.Equal(3, results.Length);
}
[Theory]
[InlineData(typeof(IJobHostContextFactory), typeof(JobHostContextFactory))]
[InlineData(typeof(IExtensionRegistry), typeof(DefaultExtensionRegistry))]
[InlineData(typeof(ITypeLocator), typeof(DefaultTypeLocator))]
[InlineData(typeof(StorageClientFactory), typeof(StorageClientFactory))]
[InlineData(typeof(INameResolver), typeof(DefaultNameResolver))]
[InlineData(typeof(IJobActivator), typeof(DefaultJobActivator))]
[InlineData(typeof(IConverterManager), typeof(ConverterManager))]
public void GetService_ReturnsExpectedDefaultServices(Type serviceType, Type expectedInstanceType)
{
JobHostConfiguration configuration = new JobHostConfiguration();
var service = configuration.GetService(serviceType);
Assert.Equal(expectedInstanceType, service.GetType());
}
[Fact]
public void GetService_ThrowsArgumentNull_WhenServiceTypeIsNull()
{
JobHostConfiguration configuration = new JobHostConfiguration();
ArgumentNullException exception = Assert.Throws<ArgumentNullException>(
() => configuration.GetService(null)
);
Assert.Equal("serviceType", exception.ParamName);
}
[Fact]
public void GetService_ReturnsNull_WhenServiceTypeNotFound()
{
JobHostConfiguration configuration = new JobHostConfiguration();
object result = configuration.GetService(typeof(IComparable));
Assert.Null(result);
}
[Fact]
public void AddService_AddsNewService()
{
JobHostConfiguration configuration = new JobHostConfiguration();
IComparable service = "test1";
configuration.AddService<IComparable>(service);
IComparable result = configuration.GetService<IComparable>();
Assert.Same(service, result);
}
[Fact]
public void AddService_ReplacesExistingService()
{
JobHostConfiguration configuration = new JobHostConfiguration();
IComparable service = "test1";
configuration.AddService<IComparable>(service);
IComparable result = configuration.GetService<IComparable>();
Assert.Same(service, result);
IComparable service2 = "test2";
configuration.AddService<IComparable>(service2);
result = configuration.GetService<IComparable>();
Assert.Same(service2, result);
}
[Fact]
public void AddService_ThrowsArgumentNull_WhenServiceTypeIsNull()
{
JobHostConfiguration configuration = new JobHostConfiguration();
ArgumentNullException exception = Assert.Throws<ArgumentNullException>(
() => configuration.AddService(null, "test1")
);
Assert.Equal("serviceType", exception.ParamName);
}
[Fact]
public void AddService_ThrowsArgumentOutOfRange_WhenInstanceNotInstanceOfType()
{
JobHostConfiguration configuration = new JobHostConfiguration();
ArgumentOutOfRangeException exception = Assert.Throws<ArgumentOutOfRangeException>(
() => configuration.AddService(typeof(IComparable), new object())
);
Assert.Equal("serviceInstance", exception.ParamName);
}
[Fact]
public void StorageClientFactory_GetterSetter()
{
JobHostConfiguration configuration = new JobHostConfiguration();
StorageClientFactory clientFactory = configuration.StorageClientFactory;
Assert.NotNull(clientFactory);
Assert.Same(clientFactory, configuration.GetService<StorageClientFactory>());
CustomStorageClientFactory customFactory = new CustomStorageClientFactory();
configuration.StorageClientFactory = customFactory;
Assert.Same(customFactory, configuration.StorageClientFactory);
Assert.Same(customFactory, configuration.GetService<StorageClientFactory>());
}
[Fact]
public void ConverterManager_Getter()
{
JobHostConfiguration configuration = new JobHostConfiguration();
IConverterManager converterManager = configuration.ConverterManager;
Assert.NotNull(converterManager);
Assert.Same(converterManager, configuration.GetService<IConverterManager>());
var property = configuration.GetType().GetProperty("ConverterManager");
Assert.True(property.CanRead);
Assert.False(property.CanWrite); // CM is read-only, although the collection itself can be mutated.
}
[Theory]
[InlineData(null, false)]
[InlineData("Blah", false)]
[InlineData("Development", true)]
[InlineData("development", true)]
public void IsDevelopment_ReturnsCorrectValue(string settingValue, bool expected)
{
string prev = Environment.GetEnvironmentVariable(Constants.EnvironmentSettingName);
Environment.SetEnvironmentVariable(Constants.EnvironmentSettingName, settingValue);
JobHostConfiguration config = new JobHostConfiguration();
Assert.Equal(config.IsDevelopment, expected);
Environment.SetEnvironmentVariable(Constants.EnvironmentSettingName, prev);
}
[Fact]
public void UseDevelopmentSettings_ConfiguresCorrectValues()
{
string prev = Environment.GetEnvironmentVariable(Constants.EnvironmentSettingName);
Environment.SetEnvironmentVariable(Constants.EnvironmentSettingName, "Development");
JobHostConfiguration config = new JobHostConfiguration();
Assert.False(config.UsingDevelopmentSettings);
if (config.IsDevelopment)
{
config.UseDevelopmentSettings();
}
Assert.True(config.UsingDevelopmentSettings);
Assert.Equal(TraceLevel.Verbose, config.Tracing.ConsoleLevel);
Assert.Equal(TimeSpan.FromSeconds(2), config.Queues.MaxPollingInterval);
Assert.Equal(TimeSpan.FromSeconds(15), config.Singleton.ListenerLockPeriod);
Environment.SetEnvironmentVariable(Constants.EnvironmentSettingName, prev);
}
private static void TestHostIdThrows(string hostId)
{
// Arrange
JobHostConfiguration configuration = new JobHostConfiguration();
// Act & Assert
ExceptionAssert.ThrowsArgument(() => { configuration.HostId = hostId; }, "value",
"A host ID must be between 1 and 32 characters, contain only lowercase letters, numbers, and " +
"dashes, not start or end with a dash, and not contain consecutive dashes.");
}
private class CustomStorageClientFactory : StorageClientFactory
{
}
private class FastLogger : IAsyncCollector<FunctionInstanceLogEntry>
{
public List<FunctionInstanceLogEntry> List = new List<FunctionInstanceLogEntry>();
public static FunctionInstanceLogEntry FlushEntry = new FunctionInstanceLogEntry(); // marker for flushes
public Task AddAsync(FunctionInstanceLogEntry item, CancellationToken cancellationToken = default(CancellationToken))
{
var clone = JsonConvert.DeserializeObject<FunctionInstanceLogEntry>(JsonConvert.SerializeObject(item));
List.Add(clone);
return Task.FromResult(0);
}
public Task FlushAsync(CancellationToken cancellationToken = default(CancellationToken))
{
List.Add(FlushEntry);
return Task.FromResult(0);
}
}
// Test that we can explicitly disable storage and call through a function
// And enable the fast table logger and ensure that's getting events.
[Fact]
public void JobHost_NoStorage_Succeeds()
{
string prevStorage = Environment.GetEnvironmentVariable("AzureWebJobsStorage");
string prevDashboard = Environment.GetEnvironmentVariable("AzureWebJobsDashboard");
try
{
Environment.SetEnvironmentVariable("AzureWebJobsStorage", null);
Environment.SetEnvironmentVariable("AzureWebJobsDashboard", null);
JobHostConfiguration config = new JobHostConfiguration()
{
TypeLocator = new FakeTypeLocator(typeof(BasicTest))
};
// Explicitly disalbe storage.
config.HostId = Guid.NewGuid().ToString("n");
config.DashboardConnectionString = null;
config.StorageConnectionString = null;
var randomValue = Guid.NewGuid().ToString();
StringBuilder sbLoggingCallbacks = new StringBuilder();
var fastLogger = new FastLogger();
config.AddService<IAsyncCollector<FunctionInstanceLogEntry>>(fastLogger);
JobHost host = new JobHost(config);
// Manually invoked.
var method = typeof(BasicTest).GetMethod("Method", BindingFlags.Public | BindingFlags.Static);
host.Call(method, new { value = randomValue });
Assert.True(BasicTest.Called);
Assert.Equal(2, fastLogger.List.Count); // We should be batching, so flush not called yet.
host.Start(); // required to call stop()
host.Stop(); // will ensure flush is called.
// Verify fast logs
Assert.Equal(3, fastLogger.List.Count);
var startMsg = fastLogger.List[0];
Assert.Equal("BasicTest.Method", startMsg.FunctionName);
Assert.Equal(null, startMsg.EndTime);
Assert.NotNull(startMsg.StartTime);
var endMsg = fastLogger.List[1];
Assert.Equal(startMsg.FunctionName, endMsg.FunctionName);
Assert.Equal(startMsg.StartTime, endMsg.StartTime);
Assert.Equal(startMsg.FunctionInstanceId, endMsg.FunctionInstanceId);
Assert.NotNull(endMsg.EndTime); // signal completed
Assert.True(endMsg.StartTime <= endMsg.EndTime);
Assert.Null(endMsg.ErrorDetails);
Assert.Null(endMsg.ParentId);
Assert.Equal(2, endMsg.Arguments.Count);
Assert.True(endMsg.Arguments.ContainsKey("log"));
Assert.Equal(randomValue, endMsg.Arguments["value"]);
Assert.Equal("val=" + randomValue, endMsg.LogOutput.Trim());
Assert.Same(FastLogger.FlushEntry, fastLogger.List[2]);
}
finally
{
Environment.SetEnvironmentVariable("AzureWebJobsStorage", prevStorage);
Environment.SetEnvironmentVariable("AzureWebJobsDashboard", prevDashboard);
}
}
public class BasicTest
{
public static bool Called = false;
[NoAutomaticTrigger]
public static void Method(TextWriter log, string value)
{
log.Write("val={0}", value);
Called = true;
}
}
}
} | 37.519274 | 129 | 0.626375 | [
"MIT"
] | StoneFinch/azure-webjobs-sdk | test/Microsoft.Azure.WebJobs.Host.UnitTests/JobHostConfigurationTests.cs | 16,548 | C# |
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using testclient1.smarteboka.com.Models;
namespace testclient1.smarteboka.com.Controllers
{
public class HomeController : Controller
{
public IActionResult Index()
{
return View();
}
[Authorize]
public IActionResult About()
{
ViewData["Message"] = "Your application description page.";
return View();
}
public IActionResult Contact()
{
ViewData["Message"] = "Your contact page.";
return View();
}
public IActionResult Error()
{
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
}
}
}
| 22.634146 | 112 | 0.615302 | [
"MIT"
] | smarteboka/TestClient1 | source/testclient1.smarteboka.com/Controllers/HomeController.cs | 930 | C# |
using System;
namespace gExploreFTP.FTP.General
{
public interface ILoaded
{
bool Loaded { get; }
}
public class LoadedClass : ILoaded
{
protected bool m_fLoaded = false;
public LoadedClass()
{
}
public bool Loaded
{
get
{
return m_fLoaded;
}
}
}
}
| 10.666667 | 35 | 0.635417 | [
"Apache-2.0"
] | jzonthemtn/gexploreftp | gExploreFTP.FTP/General/LoadedClass.cs | 288 | C# |
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Formatting;
using System.Net.Http.Headers;
using System.Web.Http.Description;
using System.Xml.Linq;
using Newtonsoft.Json;
namespace RiskTracker.Areas.HelpPage
{
/// <summary>
/// This class will generate the samples for the help page.
/// </summary>
public class HelpPageSampleGenerator
{
/// <summary>
/// Initializes a new instance of the <see cref="HelpPageSampleGenerator"/> class.
/// </summary>
public HelpPageSampleGenerator()
{
ActualHttpMessageTypes = new Dictionary<HelpPageSampleKey, Type>();
ActionSamples = new Dictionary<HelpPageSampleKey, object>();
SampleObjects = new Dictionary<Type, object>();
SampleObjectFactories = new List<Func<HelpPageSampleGenerator, Type, object>>
{
DefaultSampleObjectFactory,
};
}
/// <summary>
/// Gets CLR types that are used as the content of <see cref="HttpRequestMessage"/> or <see cref="HttpResponseMessage"/>.
/// </summary>
public IDictionary<HelpPageSampleKey, Type> ActualHttpMessageTypes { get; internal set; }
/// <summary>
/// Gets the objects that are used directly as samples for certain actions.
/// </summary>
public IDictionary<HelpPageSampleKey, object> ActionSamples { get; internal set; }
/// <summary>
/// Gets the objects that are serialized as samples by the supported formatters.
/// </summary>
public IDictionary<Type, object> SampleObjects { get; internal set; }
/// <summary>
/// Gets factories for the objects that the supported formatters will serialize as samples. Processed in order,
/// stopping when the factory successfully returns a non-<see langref="null"/> object.
/// </summary>
/// <remarks>
/// Collection includes just <see cref="ObjectGenerator.GenerateObject(Type)"/> initially. Use
/// <code>SampleObjectFactories.Insert(0, func)</code> to provide an override and
/// <code>SampleObjectFactories.Add(func)</code> to provide a fallback.</remarks>
[SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures",
Justification = "This is an appropriate nesting of generic types")]
public IList<Func<HelpPageSampleGenerator, Type, object>> SampleObjectFactories { get; private set; }
/// <summary>
/// Gets the request body samples for a given <see cref="ApiDescription"/>.
/// </summary>
/// <param name="api">The <see cref="ApiDescription"/>.</param>
/// <returns>The samples keyed by media type.</returns>
public IDictionary<MediaTypeHeaderValue, object> GetSampleRequests(ApiDescription api)
{
return GetSample(api, SampleDirection.Request);
}
/// <summary>
/// Gets the response body samples for a given <see cref="ApiDescription"/>.
/// </summary>
/// <param name="api">The <see cref="ApiDescription"/>.</param>
/// <returns>The samples keyed by media type.</returns>
public IDictionary<MediaTypeHeaderValue, object> GetSampleResponses(ApiDescription api)
{
return GetSample(api, SampleDirection.Response);
}
/// <summary>
/// Gets the request or response body samples.
/// </summary>
/// <param name="api">The <see cref="ApiDescription"/>.</param>
/// <param name="sampleDirection">The value indicating whether the sample is for a request or for a response.</param>
/// <returns>The samples keyed by media type.</returns>
public virtual IDictionary<MediaTypeHeaderValue, object> GetSample(ApiDescription api, SampleDirection sampleDirection)
{
if (api == null)
{
throw new ArgumentNullException("api");
}
string controllerName = api.ActionDescriptor.ControllerDescriptor.ControllerName;
string actionName = api.ActionDescriptor.ActionName;
IEnumerable<string> parameterNames = api.ParameterDescriptions.Select(p => p.Name);
Collection<MediaTypeFormatter> formatters;
Type type = ResolveType(api, controllerName, actionName, parameterNames, sampleDirection, out formatters);
var samples = new Dictionary<MediaTypeHeaderValue, object>();
// Use the samples provided directly for actions
var actionSamples = GetAllActionSamples(controllerName, actionName, parameterNames, sampleDirection);
foreach (var actionSample in actionSamples)
{
samples.Add(actionSample.Key.MediaType, WrapSampleIfString(actionSample.Value));
}
// Do the sample generation based on formatters only if an action doesn't return an HttpResponseMessage.
// Here we cannot rely on formatters because we don't know what's in the HttpResponseMessage, it might not even use formatters.
if (type != null && !typeof(HttpResponseMessage).IsAssignableFrom(type))
{
object sampleObject = GetSampleObject(type);
foreach (var formatter in formatters)
{
foreach (MediaTypeHeaderValue mediaType in formatter.SupportedMediaTypes)
{
if (!samples.ContainsKey(mediaType))
{
object sample = GetActionSample(controllerName, actionName, parameterNames, type, formatter, mediaType, sampleDirection);
// If no sample found, try generate sample using formatter and sample object
if (sample == null && sampleObject != null)
{
sample = WriteSampleObjectUsingFormatter(formatter, sampleObject, type, mediaType);
}
samples.Add(mediaType, WrapSampleIfString(sample));
}
}
}
}
return samples;
}
/// <summary>
/// Search for samples that are provided directly through <see cref="ActionSamples"/>.
/// </summary>
/// <param name="controllerName">Name of the controller.</param>
/// <param name="actionName">Name of the action.</param>
/// <param name="parameterNames">The parameter names.</param>
/// <param name="type">The CLR type.</param>
/// <param name="formatter">The formatter.</param>
/// <param name="mediaType">The media type.</param>
/// <param name="sampleDirection">The value indicating whether the sample is for a request or for a response.</param>
/// <returns>The sample that matches the parameters.</returns>
public virtual object GetActionSample(string controllerName, string actionName, IEnumerable<string> parameterNames, Type type, MediaTypeFormatter formatter, MediaTypeHeaderValue mediaType, SampleDirection sampleDirection)
{
object sample;
// First, try to get the sample provided for the specified mediaType, sampleDirection, controllerName, actionName and parameterNames.
// If not found, try to get the sample provided for the specified mediaType, sampleDirection, controllerName and actionName regardless of the parameterNames.
// If still not found, try to get the sample provided for the specified mediaType and type.
// Finally, try to get the sample provided for the specified mediaType.
if (ActionSamples.TryGetValue(new HelpPageSampleKey(mediaType, sampleDirection, controllerName, actionName, parameterNames), out sample) ||
ActionSamples.TryGetValue(new HelpPageSampleKey(mediaType, sampleDirection, controllerName, actionName, new[] { "*" }), out sample) ||
ActionSamples.TryGetValue(new HelpPageSampleKey(mediaType, type), out sample) ||
ActionSamples.TryGetValue(new HelpPageSampleKey(mediaType), out sample))
{
return sample;
}
return null;
}
/// <summary>
/// Gets the sample object that will be serialized by the formatters.
/// First, it will look at the <see cref="SampleObjects"/>. If no sample object is found, it will try to create
/// one using <see cref="DefaultSampleObjectFactory"/> (which wraps an <see cref="ObjectGenerator"/>) and other
/// factories in <see cref="SampleObjectFactories"/>.
/// </summary>
/// <param name="type">The type.</param>
/// <returns>The sample object.</returns>
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes",
Justification = "Even if all items in SampleObjectFactories throw, problem will be visible as missing sample.")]
public virtual object GetSampleObject(Type type)
{
object sampleObject;
if (!SampleObjects.TryGetValue(type, out sampleObject))
{
// No specific object available, try our factories.
foreach (Func<HelpPageSampleGenerator, Type, object> factory in SampleObjectFactories)
{
if (factory == null)
{
continue;
}
try
{
sampleObject = factory(this, type);
if (sampleObject != null)
{
break;
}
}
catch
{
// Ignore any problems encountered in the factory; go on to the next one (if any).
}
}
}
return sampleObject;
}
/// <summary>
/// Resolves the actual type of <see cref="System.Net.Http.ObjectContent{T}"/> passed to the <see cref="System.Net.Http.HttpRequestMessage"/> in an action.
/// </summary>
/// <param name="api">The <see cref="ApiDescription"/>.</param>
/// <returns>The type.</returns>
public virtual Type ResolveHttpRequestMessageType(ApiDescription api)
{
string controllerName = api.ActionDescriptor.ControllerDescriptor.ControllerName;
string actionName = api.ActionDescriptor.ActionName;
IEnumerable<string> parameterNames = api.ParameterDescriptions.Select(p => p.Name);
Collection<MediaTypeFormatter> formatters;
return ResolveType(api, controllerName, actionName, parameterNames, SampleDirection.Request, out formatters);
}
/// <summary>
/// Resolves the type of the action parameter or return value when <see cref="HttpRequestMessage"/> or <see cref="HttpResponseMessage"/> is used.
/// </summary>
/// <param name="api">The <see cref="ApiDescription"/>.</param>
/// <param name="controllerName">Name of the controller.</param>
/// <param name="actionName">Name of the action.</param>
/// <param name="parameterNames">The parameter names.</param>
/// <param name="sampleDirection">The value indicating whether the sample is for a request or a response.</param>
/// <param name="formatters">The formatters.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", Justification = "This is only used in advanced scenarios.")]
public virtual Type ResolveType(ApiDescription api, string controllerName, string actionName, IEnumerable<string> parameterNames, SampleDirection sampleDirection, out Collection<MediaTypeFormatter> formatters)
{
if (!Enum.IsDefined(typeof(SampleDirection), sampleDirection))
{
throw new InvalidEnumArgumentException("sampleDirection", (int)sampleDirection, typeof(SampleDirection));
}
if (api == null)
{
throw new ArgumentNullException("api");
}
Type type;
if (ActualHttpMessageTypes.TryGetValue(new HelpPageSampleKey(sampleDirection, controllerName, actionName, parameterNames), out type) ||
ActualHttpMessageTypes.TryGetValue(new HelpPageSampleKey(sampleDirection, controllerName, actionName, new[] { "*" }), out type))
{
// Re-compute the supported formatters based on type
Collection<MediaTypeFormatter> newFormatters = new Collection<MediaTypeFormatter>();
foreach (var formatter in api.ActionDescriptor.Configuration.Formatters)
{
if (IsFormatSupported(sampleDirection, formatter, type))
{
newFormatters.Add(formatter);
}
}
formatters = newFormatters;
}
else
{
switch (sampleDirection)
{
case SampleDirection.Request:
ApiParameterDescription requestBodyParameter = api.ParameterDescriptions.FirstOrDefault(p => p.Source == ApiParameterSource.FromBody);
type = requestBodyParameter == null ? null : requestBodyParameter.ParameterDescriptor.ParameterType;
formatters = api.SupportedRequestBodyFormatters;
break;
case SampleDirection.Response:
default:
type = api.ResponseDescription.ResponseType ?? api.ResponseDescription.DeclaredType;
formatters = api.SupportedResponseFormatters;
break;
}
}
return type;
}
/// <summary>
/// Writes the sample object using formatter.
/// </summary>
/// <param name="formatter">The formatter.</param>
/// <param name="value">The value.</param>
/// <param name="type">The type.</param>
/// <param name="mediaType">Type of the media.</param>
/// <returns></returns>
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "The exception is recorded as InvalidSample.")]
public virtual object WriteSampleObjectUsingFormatter(MediaTypeFormatter formatter, object value, Type type, MediaTypeHeaderValue mediaType)
{
if (formatter == null)
{
throw new ArgumentNullException("formatter");
}
if (mediaType == null)
{
throw new ArgumentNullException("mediaType");
}
object sample = String.Empty;
MemoryStream ms = null;
HttpContent content = null;
try
{
if (formatter.CanWriteType(type))
{
ms = new MemoryStream();
content = new ObjectContent(type, value, formatter, mediaType);
formatter.WriteToStreamAsync(type, value, ms, content, null).Wait();
ms.Position = 0;
StreamReader reader = new StreamReader(ms);
string serializedSampleString = reader.ReadToEnd();
if (mediaType.MediaType.ToUpperInvariant().Contains("XML"))
{
serializedSampleString = TryFormatXml(serializedSampleString);
}
else if (mediaType.MediaType.ToUpperInvariant().Contains("JSON"))
{
serializedSampleString = TryFormatJson(serializedSampleString);
}
sample = new TextSample(serializedSampleString);
}
else
{
sample = new InvalidSample(String.Format(
CultureInfo.CurrentCulture,
"Failed to generate the sample for media type '{0}'. Cannot use formatter '{1}' to write type '{2}'.",
mediaType,
formatter.GetType().Name,
type.Name));
}
}
catch (Exception e)
{
sample = new InvalidSample(String.Format(
CultureInfo.CurrentCulture,
"An exception has occurred while using the formatter '{0}' to generate sample for media type '{1}'. Exception message: {2}",
formatter.GetType().Name,
mediaType.MediaType,
UnwrapException(e).Message));
}
finally
{
if (ms != null)
{
ms.Dispose();
}
if (content != null)
{
content.Dispose();
}
}
return sample;
}
internal static Exception UnwrapException(Exception exception)
{
AggregateException aggregateException = exception as AggregateException;
if (aggregateException != null)
{
return aggregateException.Flatten().InnerException;
}
return exception;
}
// Default factory for sample objects
private static object DefaultSampleObjectFactory(HelpPageSampleGenerator sampleGenerator, Type type)
{
// Try to create a default sample object
ObjectGenerator objectGenerator = new ObjectGenerator();
return objectGenerator.GenerateObject(type);
}
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Handling the failure by returning the original string.")]
private static string TryFormatJson(string str)
{
try
{
object parsedJson = JsonConvert.DeserializeObject(str);
return JsonConvert.SerializeObject(parsedJson, Formatting.Indented);
}
catch
{
// can't parse JSON, return the original string
return str;
}
}
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Handling the failure by returning the original string.")]
private static string TryFormatXml(string str)
{
try
{
XDocument xml = XDocument.Parse(str);
return xml.ToString();
}
catch
{
// can't parse XML, return the original string
return str;
}
}
private static bool IsFormatSupported(SampleDirection sampleDirection, MediaTypeFormatter formatter, Type type)
{
switch (sampleDirection)
{
case SampleDirection.Request:
return formatter.CanReadType(type);
case SampleDirection.Response:
return formatter.CanWriteType(type);
}
return false;
}
private IEnumerable<KeyValuePair<HelpPageSampleKey, object>> GetAllActionSamples(string controllerName, string actionName, IEnumerable<string> parameterNames, SampleDirection sampleDirection)
{
HashSet<string> parameterNamesSet = new HashSet<string>(parameterNames, StringComparer.OrdinalIgnoreCase);
foreach (var sample in ActionSamples)
{
HelpPageSampleKey sampleKey = sample.Key;
if (String.Equals(controllerName, sampleKey.ControllerName, StringComparison.OrdinalIgnoreCase) &&
String.Equals(actionName, sampleKey.ActionName, StringComparison.OrdinalIgnoreCase) &&
(sampleKey.ParameterNames.SetEquals(new[] { "*" }) || parameterNamesSet.SetEquals(sampleKey.ParameterNames)) &&
sampleDirection == sampleKey.SampleDirection)
{
yield return sample;
}
}
}
private static object WrapSampleIfString(object sample)
{
string stringSample = sample as string;
if (stringSample != null)
{
return new TextSample(stringSample);
}
return sample;
}
}
} | 47.209459 | 229 | 0.58647 | [
"MIT"
] | Inside-Outcomes/Risk-Tracker | RiskTracker/Areas/HelpPage/SampleGeneration/HelpPageSampleGenerator.cs | 20,961 | C# |
using System;
using Aeon.Emulator.Memory;
namespace Aeon.Emulator
{
/// <summary>
/// Contains information about expanded memory usage.
/// </summary>
public sealed class ExpandedMemoryInfo
{
/// <summary>
/// Size of expanded memory in pages.
/// </summary>
public const int TotalPages = ExpandedMemoryManager.MaximumLogicalPages;
/// <summary>
/// Size of expanded memory in bytes.
/// </summary>
public const int TotalBytes = TotalPages * ExpandedMemoryManager.PageSize;
internal ExpandedMemoryInfo(int allocatedPages) => this.PagesAllocated = allocatedPages;
/// <summary>
/// Gets the number of pages allocated.
/// </summary>
public int PagesAllocated { get; }
/// <summary>
/// Gets the number of bytes allocated.
/// </summary>
public int BytesAllocated => this.PagesAllocated * ExpandedMemoryManager.PageSize;
/// <summary>
/// Gets the number of free pages.
/// </summary>
public int PagesFree => Math.Max(TotalPages - this.PagesAllocated, 0);
/// <summary>
/// Gets the number of free bytes.
/// </summary>
public int BytesFree => Math.Max(TotalBytes - this.BytesAllocated, 0);
}
}
| 33.025 | 96 | 0.603331 | [
"Apache-2.0"
] | gregdivis/Aeon | src/Aeon.Emulator/Memory/ExpandedMemoryInfo.cs | 1,323 | C# |
using System;
using System.Collections.Generic;
namespace Appeaser.Interception
{
public interface IRequestInterceptionContext : IContext
{
Type RequestType { get; }
Type HandlerType { get; }
object Request { get; }
}
}
| 19.846154 | 59 | 0.662791 | [
"MIT"
] | carl-berg/appeaser | src/Appeaser/Interception/IRequestInterceptionContext.cs | 260 | C# |
namespace agileBall_proc.Messages
{
public class GameResult
{
public string Team { get; set; }
public bool IsAWin { get; set; }
}
} | 19.875 | 40 | 0.603774 | [
"MIT"
] | DavidHoerster/agileball | Messages/GameResult.cs | 159 | C# |
namespace Gorgon.UI
{
partial class GorgonWaitMessagePanel
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(GorgonWaitMessagePanel));
this.PanelWait = new System.Windows.Forms.TableLayoutPanel();
this.LabelWaitMessage = new System.Windows.Forms.Label();
this.ImageWait = new System.Windows.Forms.PictureBox();
this.LabelWaitTitle = new System.Windows.Forms.Label();
this.PanelWait.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.ImageWait)).BeginInit();
this.SuspendLayout();
//
// PanelWait
//
resources.ApplyResources(this.PanelWait, "PanelWait");
this.PanelWait.Controls.Add(this.LabelWaitMessage, 1, 1);
this.PanelWait.Controls.Add(this.ImageWait, 0, 0);
this.PanelWait.Controls.Add(this.LabelWaitTitle, 1, 0);
this.PanelWait.Name = "PanelWait";
//
// LabelWaitMessage
//
resources.ApplyResources(this.LabelWaitMessage, "LabelWaitMessage");
this.LabelWaitMessage.ForeColor = System.Drawing.Color.Black;
this.LabelWaitMessage.Name = "LabelWaitMessage";
//
// ImageWait
//
resources.ApplyResources(this.ImageWait, "ImageWait");
this.ImageWait.Image = global::Gorgon.Windows.Properties.Resources.wait_48x48;
this.ImageWait.Name = "ImageWait";
this.PanelWait.SetRowSpan(this.ImageWait, 2);
this.ImageWait.TabStop = false;
//
// LabelWaitTitle
//
resources.ApplyResources(this.LabelWaitTitle, "LabelWaitTitle");
this.LabelWaitTitle.ForeColor = System.Drawing.Color.DimGray;
this.LabelWaitTitle.Name = "LabelWaitTitle";
//
// GorgonWaitMessagePanel
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White;
this.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.Controls.Add(this.PanelWait);
this.DoubleBuffered = true;
this.Name = "GorgonWaitMessagePanel";
this.PanelWait.ResumeLayout(false);
this.PanelWait.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.ImageWait)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TableLayoutPanel PanelWait;
private System.Windows.Forms.Label LabelWaitMessage;
private System.Windows.Forms.PictureBox ImageWait;
private System.Windows.Forms.Label LabelWaitTitle;
}
}
| 41.51087 | 154 | 0.602252 | [
"MIT"
] | Tape-Worm/Gorgon | Gorgon/Gorgon.Windows/UI/_Controls/GorgonWaitMessagePanel.Designer.cs | 3,821 | C# |
// This file is part of Silk.NET.
//
// You may modify and distribute Silk.NET under the terms
// of the MIT license. See the LICENSE file for details.
using System;
#pragma warning disable 1591
namespace Silk.NET.OpenGL
{
public enum SpriteParameterNameSGIX
{
SpriteModeSgix = 0x8149,
}
}
| 17.5 | 57 | 0.698413 | [
"MIT"
] | AzyIsCool/Silk.NET | src/OpenGL/Silk.NET.OpenGL/Enums/SpriteParameterNameSGIX.gen.cs | 315 | C# |
using Dartin.Abstracts;
using System.ComponentModel;
namespace Dartin.Models
{
public class Set : AHasWinner
{
private BindingList<Leg> _legs;
public BindingList<Leg> Legs
{
get => _legs;
set
{
_legs = value;
NotifyPropertyChanged();
}
}
public Set(BindingList<Leg> legs)
{
Legs = legs;
}
}
}
| 17.576923 | 41 | 0.474836 | [
"MIT"
] | RayBarneveldInc/Dartin | Dartin/Dartin.Application/Models/Set.cs | 459 | C# |
using Android.Content;
using Android.Widget;
using WeatherSearch.Droid.CustomRenderer;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;
[assembly: ExportRenderer(typeof(SearchBar), typeof(CustomSearchBarRenderer))]
namespace WeatherSearch.Droid.CustomRenderer
{
class CustomSearchBarRenderer : SearchBarRenderer
{
public CustomSearchBarRenderer(Context context) : base(context)
{
}
protected override void OnElementChanged(ElementChangedEventArgs<SearchBar> e)
{
base.OnElementChanged(e);
if (Control != null)
{
var searchView = base.Control as SearchView;
int searchIconId = Context.Resources.GetIdentifier("android:id/search_mag_icon", null, null);
ImageView searchViewIcon = (ImageView)searchView.FindViewById<ImageView>(searchIconId);
searchViewIcon.SetImageDrawable(null);
}
}
}
} | 32.4 | 109 | 0.67284 | [
"MIT"
] | kvntzn/Weather-Search | WeatherSearch.Android/CustomRenderer/CustomSearchBarRenderer.cs | 974 | C# |
using LagoVista.Core.Attributes;
using LagoVista.Core.Geo;
using LagoVista.UserManagement.Resources;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace LagoVista.UserManagement.Models
{
[EntityDescription(Domains.MiscDomain, UserManagementResources.Names.GeoLocation_Title, UserManagementResources.Names.GeoLocation_Help, UserManagementResources.Names.GeoLocation_Description, EntityDescriptionAttribute.EntityTypes.SimpleModel, typeof(UserManagementResources))]
public class GeoLocation : IGeoLocation
{
public double Altitude { get; set; }
public string LastUpdated { get; set; }
public double Latitude { get; set; }
public double Longitude { get; set; }
}
}
| 34.954545 | 280 | 0.776333 | [
"MIT"
] | LagoVista/Admin | src/LagoVista.UserManagement/Models/GeoLocation.cs | 771 | C# |
using GalvanizedSoftware.Beethoven.Generic;
namespace GalvanizedSoftware.Beethoven.DemoApp.Decorator
{
internal class Factory
{
private readonly BeethovenFactory beethovenFactory = new BeethovenFactory();
public IOrderedItem AddGiftWrapping(IOrderedItem mainItem) =>
beethovenFactory.Generate<IOrderedItem>(
new LinkedObjects(
mainItem,
new GiftWrapping(mainItem)
));
}
}
| 25.352941 | 80 | 0.726218 | [
"Apache-2.0"
] | GalvanizedSoftware/Beethoven | DemoApplication/Decorator/Factory.cs | 433 | C# |
// c:\program files (x86)\windows kits\10\include\10.0.22000.0\um\d3d12umddi.h(1456,9)
using System;
using System.Runtime.InteropServices;
namespace DirectN
{
[StructLayout(LayoutKind.Sequential)]
public partial struct D3D12DDI_RESOURCE_TRANSITION_BARRIER_0003
{
public D3D10DDI_HRESOURCE hResource;
public uint Subresource;
public D3D12DDI_RESOURCE_STATES StateBefore;
public D3D12DDI_RESOURCE_STATES StateAfter;
}
}
| 30.1875 | 88 | 0.724638 | [
"MIT"
] | Steph55/DirectN | DirectN/DirectN/Generated/D3D12DDI_RESOURCE_TRANSITION_BARRIER_0003.cs | 485 | C# |
// Only unused on .NET Core due to KeyValuePair.Deconstruct
// ReSharper disable once RedundantUsingDirective
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection.Metadata.Ecma335;
using Content.Server.GameObjects.Components.Chemistry;
using Content.Server.GameObjects.EntitySystems.Click;
using Content.Server.Interfaces.GameObjects.Components.Interaction;
using Content.Shared.Audio;
using Content.Shared.GameObjects.Components.Interactable;
using Content.Shared.GameObjects.EntitySystems;
using Robust.Server.GameObjects.EntitySystems;
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Systems;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
namespace Content.Server.GameObjects.Components.Interactable
{
public interface IToolComponent
{
ToolQuality Qualities { get; set; }
}
[RegisterComponent]
[ComponentReference(typeof(IToolComponent))]
public class ToolComponent : SharedToolComponent, IToolComponent
{
protected ToolQuality _qualities = ToolQuality.None;
[ViewVariables]
public override ToolQuality Qualities
{
get => _qualities;
set
{
_qualities = value;
Dirty();
}
}
/// <summary>
/// For tool interactions that have a delay before action this will modify the rate, time to wait is divided by this value
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
public float SpeedModifier { get; set; } = 1;
public string UseSound { get; set; }
public string UseSoundCollection { get; set; }
public void AddQuality(ToolQuality quality)
{
_qualities |= quality;
Dirty();
}
public void RemoveQuality(ToolQuality quality)
{
_qualities &= ~quality;
Dirty();
}
public bool HasQuality(ToolQuality quality)
{
return _qualities.HasFlag(quality);
}
public override void ExposeData(ObjectSerializer serializer)
{
base.ExposeData(serializer);
if (serializer.Reading)
{
var qualities = serializer.ReadDataField("qualities", new List<ToolQuality>());
foreach (var quality in qualities)
{
AddQuality(quality);
}
}
serializer.DataField(this, mod => SpeedModifier, "speed", 1);
serializer.DataField(this, use => UseSound, "useSound", string.Empty);
serializer.DataField(this, collection => UseSoundCollection, "useSoundCollection", string.Empty);
}
public virtual bool UseTool(IEntity user, IEntity target, ToolQuality toolQualityNeeded)
{
if (!HasQuality(toolQualityNeeded) || !ActionBlockerSystem.CanInteract(user))
return false;
PlayUseSound();
return true;
}
protected void PlaySoundCollection(string name, float volume=-5f)
{
var file = AudioHelpers.GetRandomFileFromSoundCollection(name);
EntitySystem.Get<AudioSystem>()
.PlayFromEntity(file, Owner, AudioHelpers.WithVariation(0.15f).WithVolume(volume));
}
public void PlayUseSound(float volume=-5f)
{
if(string.IsNullOrEmpty(UseSoundCollection))
EntitySystem.Get<AudioSystem>()
.PlayFromEntity(UseSound, Owner, AudioHelpers.WithVariation(0.15f).WithVolume(volume));
else
PlaySoundCollection(UseSoundCollection, volume);
}
}
}
| 32.706897 | 134 | 0.633896 | [
"MIT"
] | francinum/space-station-14 | Content.Server/GameObjects/Components/Interactable/ToolComponent.cs | 3,796 | C# |
using Buildit.Data.Contracts;
using Buildit.Data.Models;
using Buildit.Services;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Buildit.Services.TestsMsTest
{
[TestClass]
public class UserServiceShould
{
[TestMethod]
public void ThrowExceptioWhenDataIsNull()
{
Assert.ThrowsException<ArgumentNullException>(() => new Buildit.Services.UserService(null, null, null));
}
[TestMethod]
public void NotThrowExceptionIfTheParametersAreCorrect()
{
var mockedData = new Mock<IBuilditData>();
var mockedUnitofWork = new Mock<IUnitOfWork>();
var mockedIEfRepo = new Mock<IEfRepository<User>>();
var userService = new Buildit.Services.UserService(mockedData.Object, mockedIEfRepo.Object, mockedUnitofWork.Object);
Assert.IsNotNull(userService);
}
[TestMethod]
public void ReturnTrueWhenUserIsFound()
{
var username = "pesho3";
var mockedData = new Mock<IBuilditData>();
var mockedUnitofWork = new Mock<IUnitOfWork>();
var mockedIEfRepo = new Mock<IEfRepository<User>>();
var mockedUser1 = new Mock<User>();
var mockedUser2 = new Mock<User>();
var mockedUser3 = new Mock<User>();
mockedUser1.Setup(x => x.UserName).Returns(username);
var users = new List<User>()
{
mockedUser1.Object,
mockedUser2.Object,
mockedUser3.Object,
}.AsQueryable();
mockedData.Setup(x => x.Users.All).Returns(users);
var service = new Buildit.Services.UserService(mockedData.Object, mockedIEfRepo.Object, mockedUnitofWork.Object);
var result = service.CheckIfUserExists(username);
Assert.IsTrue(result);
}
[TestMethod]
public void ReturnNullWhenIdIsNul()
{
var username = "pesho3";
var mockedData = new Mock<IBuilditData>();
var mockedUnitofWork = new Mock<IUnitOfWork>();
var mockedIEfRepo = new Mock<IEfRepository<User>>();
var mockedUser1 = new Mock<User>();
var mockedUser2 = new Mock<User>();
var mockedUser3 = new Mock<User>();
mockedUser1.Setup(x => x.UserName).Returns(username);
var users = new List<User>()
{
mockedUser1.Object,
mockedUser2.Object,
mockedUser3.Object,
}.AsQueryable();
mockedData.Setup(x => x.Users.All).Returns(users);
var service = new Buildit.Services.UserService(mockedData.Object, mockedIEfRepo.Object, mockedUnitofWork.Object);
var result = service.CheckIfUserExists(username);
Assert.IsTrue(result);
Assert.IsNotNull(result);
}
[TestMethod]
public void ReturnUserWhenIdIsPssed()
{
var username = "pesho3";
var testId = "pesho's ID";
var mockedData = new Mock<IBuilditData>();
var mockedUnitofWork = new Mock<IUnitOfWork>();
var mockedUserRepo = new Mock<IEfRepository<User>>();
var mockedUser = new Mock<User>();
var mockedUser1 = new Mock<User>();
mockedUser.Setup(x => x.Id).Returns(testId);
mockedUser.Setup(x => x.UserName).Returns(username);
mockedUserRepo.Setup(x => x.GetById(testId)).Returns(new User() { Id = testId });
var users = new List<User>()
{
mockedUser.Object
}.AsQueryable();
var service = new UserService(mockedData.Object, mockedUserRepo.Object, mockedUnitofWork.Object);
var result = service.GetById(testId);
Assert.IsNotNull(result);
}
[TestMethod]
public void ReturnNullWhenNulIdIsPssed()
{
var username = "pesho3";
var mockedData = new Mock<IBuilditData>();
var mockedUnitofWork = new Mock<IUnitOfWork>();
var mockedUserRepo = new Mock<IEfRepository<User>>();
var mockedUser = new Mock<User>();
mockedUser.Setup(x => x.UserName).Returns(username);
var service = new UserService(mockedData.Object, mockedUserRepo.Object, mockedUnitofWork.Object);
var result = service.GetById(null);
Assert.AreEqual(result, null);
}
[TestMethod]
public void Test()
{
}
}
}
| 34.536765 | 129 | 0.585054 | [
"MIT"
] | Aimanan/BuildItRepo | Buildit/ClassLibrary1/UserServiceShould.cs | 4,699 | C# |
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You 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.Linq;
using Xunit;
namespace Apache.Arrow.Tests
{
public class ArrowBufferBuilderTests
{
[Fact]
public void ThrowsWhenIndexOutOfBounds()
{
Assert.Throws<IndexOutOfRangeException>(() =>
{
var builder = new ArrowBuffer.Builder<int>();
builder.Span[100] = 100;
});
}
public class Append
{
[Fact]
public void DoesNotThrowWithNullParameters()
{
var builder = new ArrowBuffer.Builder<int>();
builder.AppendRange(null);
}
[Fact]
public void CapacityOnlyGrowsWhenLengthWillExceedCapacity()
{
var builder = new ArrowBuffer.Builder<int>(1);
var capacity = builder.Capacity;
builder.Append(1);
Assert.Equal(capacity, builder.Capacity);
}
[Fact]
public void CapacityGrowsAfterAppendWhenLengthExceedsCapacity()
{
var builder = new ArrowBuffer.Builder<int>(1);
var capacity = builder.Capacity;
builder.Append(1);
builder.Append(2);
Assert.True(builder.Capacity > capacity);
}
[Fact]
public void CapacityGrowsAfterAppendSpan()
{
var builder = new ArrowBuffer.Builder<int>(1);
var capacity = builder.Capacity;
var data = Enumerable.Range(0, 10).Select(x => x).ToArray();
builder.Append(data);
Assert.True(builder.Capacity > capacity);
}
[Fact]
public void LengthIncrementsAfterAppend()
{
var builder = new ArrowBuffer.Builder<int>(1);
var length = builder.Length;
builder.Append(1);
Assert.Equal(length + 1, builder.Length);
}
[Fact]
public void LengthGrowsBySpanLength()
{
var builder = new ArrowBuffer.Builder<int>(1);
var data = Enumerable.Range(0, 10).Select(x => x).ToArray();
builder.Append(data);
Assert.Equal(10, builder.Length);
}
[Fact]
public void BufferHasExpectedValues()
{
var builder = new ArrowBuffer.Builder<int>(1);
builder.Append(10);
builder.Append(20);
var buffer = builder.Build();
var span = buffer.Span.CastTo<int>();
Assert.Equal(10, span[0]);
Assert.Equal(20, span[1]);
Assert.Equal(0, span[2]);
}
}
public class AppendRange
{
[Fact]
public void CapacityGrowsAfterAppendEnumerable()
{
var builder = new ArrowBuffer.Builder<int>(1);
var capacity = builder.Capacity;
var data = Enumerable.Range(0, 10).Select(x => x);
builder.AppendRange(data);
Assert.True(builder.Capacity > capacity);
}
[Fact]
public void LengthGrowsByEnumerableCount()
{
var builder = new ArrowBuffer.Builder<int>(1);
var length = builder.Length;
var data = Enumerable.Range(0, 10).Select(x => x).ToArray();
var count = data.Length;
builder.AppendRange(data);
Assert.Equal(length + count, builder.Length);
}
[Fact]
public void BufferHasExpectedValues()
{
var builder = new ArrowBuffer.Builder<int>(1);
var data = Enumerable.Range(0, 10).Select(x => x).ToArray();
builder.AppendRange(data);
var buffer = builder.Build();
var span = buffer.Span.CastTo<int>();
for (var i = 0; i < 10; i++)
{
Assert.Equal(i, span[i]);
}
}
}
public class Clear
{
[Theory]
[InlineData(10)]
[InlineData(100)]
public void SetsAllValuesToDefault(int sizeBeforeClear)
{
var builder = new ArrowBuffer.Builder<int>(1);
var data = Enumerable.Range(0, sizeBeforeClear).Select(x => x).ToArray();
builder.AppendRange(data);
builder.Clear();
builder.Append(0);
var buffer = builder.Build();
// No matter the sizeBeforeClear, we only appended a single 0,
// so the buffer length should be the smallest possible.
Assert.Equal(64, buffer.Length);
// check all 16 int elements are default
var zeros = Enumerable.Range(0, 16).Select(x => 0).ToArray();
var values = buffer.Span.CastTo<int>().Slice(0, 16).ToArray();
Assert.True(zeros.SequenceEqual(values));
}
}
public class Resize
{
[Fact]
public void LengthHasExpectedValueAfterResize()
{
var builder = new ArrowBuffer.Builder<int>();
builder.Resize(8);
Assert.True(builder.Capacity >= 8);
Assert.Equal(8, builder.Length);
}
[Fact]
public void NegativeLengthThrows()
{
// Arrange
var builder = new ArrowBuffer.Builder<int>();
builder.Append(10);
builder.Append(20);
// Act/Assert
Assert.Throws<ArgumentOutOfRangeException>(() => builder.Resize(-1));
}
}
}
}
| 31.21659 | 89 | 0.514467 | [
"Apache-2.0"
] | 18dcb01/arrow | csharp/test/Apache.Arrow.Tests/ArrowBufferBuilderTests.cs | 6,776 | C# |
using Microsoft.Extensions.DependencyInjection;
using Umbraco.Cms.Core.Composing;
namespace Umbraco.Cms.Core.HealthChecks
{
public class HealthCheckCollectionBuilder : LazyCollectionBuilderBase<HealthCheckCollectionBuilder, HealthCheckCollection, HealthCheck>
{
protected override HealthCheckCollectionBuilder This => this;
// note: in v7 they were per-request, not sure why?
// the collection is injected into the controller & there's only 1 controller per request anyways
protected override ServiceLifetime CollectionLifetime => ServiceLifetime.Transient; // transient!
}
}
| 41.533333 | 139 | 0.770465 | [
"MIT"
] | Ambertvu/Umbraco-CMS | src/Umbraco.Core/HealthChecks/HeathCheckCollectionBuilder.cs | 625 | C# |
using LiteDB;
using MediaBrowser.Attributes;
using MediaBrowser.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
namespace MediaBrowser.Services
{
public class LiteDbFiles : IFiles
{
public LiteDbFiles(ILiteDatabase db)
{
BsonCollection = db.GetCollection<BsonDocument>("files");
Collection = db.GetCollection<LiteDbFile>("files");
Database = db;
}
public ILiteCollection<BsonDocument> BsonCollection { get; }
public ILiteCollection<LiteDbFile> Collection { get; }
public ILiteDatabase Database { get; }
public Task<IFile> Get(Guid fileId) =>
Task.FromResult((IFile)Collection.FindById(fileId));
public Task<IFile[]> GetByMd5(Guid md5) =>
Task.FromResult(Collection.Find(Query.EQ(nameof(IFile.Md5), md5)).Cast<IFile>().ToArray());
public Task<IFile> GetByName(string name) =>
Task.FromResult((IFile)Collection.FindOne(Query.EQ(nameof(IFile.Name), name)));
public Task<SearchFilesResponse<IFile>> Search(SearchFilesRequest request, Guid userId, RoleSet userRoles, Guid? playlistId = null)
{
var query = Query.All();
query.Offset = request.Skip;
query.Limit = request.Take;
if (!userRoles.Contains(RequiresAdminRoleAttribute.AdminRole))
{
var accessFilter = new List<BsonExpression>
{
Query.EQ(nameof(IFile.UploadedBy), userId)
};
foreach (var role in userRoles)
{
accessFilter.Add(Query.EQ($"{nameof(IFile.ReadRoles)}[*] ANY", role));
}
query.Where.Add(Query.Or(accessFilter.ToArray()));
}
if (!string.IsNullOrEmpty(request.Keywords))
{
var keywordQuery = new List<BsonExpression>();
foreach (var term in Regex.Split(request.Keywords, @"\s+"))
{
keywordQuery.Add(Query.Contains(nameof(IFile.Description), term));
keywordQuery.Add(Query.Contains(nameof(IFile.Name), term));
}
if (keywordQuery.Count > 0)
{
query.Where.Add(Query.Or(keywordQuery.ToArray()));
}
}
switch (request.Filter)
{
case FileFilterOptions.AudioFiles:
query.Where.Add(Query.EQ(nameof(IFile.Type), FileType.Audio.ToString()));
break;
case FileFilterOptions.Photos:
query.Where.Add(Query.EQ(nameof(IFile.Type), FileType.Photo.ToString()));
break;
case FileFilterOptions.Videos:
query.Where.Add(Query.EQ(nameof(IFile.Type), FileType.Video.ToString()));
break;
}
if (playlistId != null)
{
query.Where.Add(Query.EQ($"{nameof(IFile.PlaylistReferences)}.Ids[*] ANY", playlistId.Value));
query.OrderBy = $"{nameof(IFile.PlaylistReferences)}.Values.PL_{playlistId.Value.ToString().Replace('-', '_')}.{nameof(IPlaylistReference.Index)}";
}
else
{
switch (request.Sort)
{
case FileSortOptions.CreatedOn:
query.OrderBy = nameof(IFile.UploadedOn);
break;
case FileSortOptions.Duration:
query.OrderBy = nameof(IFile.Duration);
break;
case FileSortOptions.Name:
query.OrderBy = nameof(IFile.Name);
break;
case FileSortOptions.Type:
query.OrderBy = nameof(IFile.Type);
break;
}
}
query.Order = request.Ascending ? Query.Ascending : Query.Descending;
var results = Collection.Find(query).ToArray();
var response = new SearchFilesResponse<IFile>(request, 0, results.Cast<IFile>());
if (results.Length < request.Take)
{
response.Count = request.Skip + results.Length;
}
else
{
query.Offset = 0;
query.Limit = int.MaxValue;
response.Count = Collection.Count(query);
}
return Task.FromResult(response);
}
public Task<IFile> SetPlaylistReference(Guid fileId, IPlaylist playlist, int? index = null)
{
var idPath = $"{nameof(IFile.PlaylistReferences)}.Ids[*] ANY";
var successful = true;
void update(int oldIndex, int newIndex)
{
var plFieldName = $"PL_{playlist.Id.ToString().Replace('-', '_')}";
IEnumerable<BsonDocument> transformDocs()
{
var moveUp = newIndex > oldIndex;
using (var reader = Collection
.Query()
.Where(Query.And(
Query.Not("_id", fileId),
Query.EQ(idPath, playlist.Id),
Query.Between($"$.{nameof(IFile.PlaylistReferences)}.Values.{plFieldName}.{nameof(IPlaylistReference.Index)}",
Math.Min(oldIndex, newIndex),
Math.Max(oldIndex, newIndex))))
.ForUpdate()
.ExecuteReader())
{
while (reader.Read())
{
var doc = reader.Current.AsDocument;
var playlistReference = doc[nameof(IFile.PlaylistReferences)]["Values"][plFieldName];
var indexValue = playlistReference["Index"].AsInt32;
if (moveUp)
{
indexValue--;
}
else
{
indexValue++;
}
playlistReference["Index"] = indexValue;
yield return doc;
}
}
};
BsonCollection.Update(transformDocs());
}
Database.BeginTrans();
try
{
var file = Collection.FindById(fileId);
if (file == null)
{
return Task.FromResult((IFile)null);
}
var playlistRefernces = new List<IPlaylistReference>();
if (file.PlaylistReferences != null)
{
playlistRefernces.AddRange(file.PlaylistReferences);
}
var queryForPlaylist = Query.EQ(idPath, playlist.Id);
var reference = (LiteDbPlaylistReference)playlistRefernces.FirstOrDefault(it => it.Id == playlist.Id);
if (index == null)
{
if (reference == null)
{
return Task.FromResult((IFile)file);
}
update(reference.Index, int.MaxValue);
playlistRefernces.Remove(reference);
file.PlaylistReferences = playlistRefernces.ToArray();
}
else
{
var count = Collection.Count(queryForPlaylist);
if (reference == null)
{
count++;
}
if (index < 0 || index > count)
{
index = count - 1;
}
if (reference != null)
{
if (reference.Index == index.Value)
{
return Task.FromResult((IFile)file);
}
update(reference.Index, index.Value);
reference.Index = index.Value;
}
else
{
playlistRefernces.Add(new LiteDbPlaylistReference
{
AddedOn = DateTime.UtcNow,
Id = playlist.Id,
Index = index.Value
});
file.PlaylistReferences = playlistRefernces.ToArray();
}
}
Collection.Update(file);
return Task.FromResult((IFile)file);
}
catch
{
successful = false;
Database.Rollback();
throw;
}
finally
{
if (successful)
{
Database.Commit();
}
}
}
public Task<IFile> Update(Guid fileId, UpdateFileRequest request, IThumbnail[] thumbnails = null)
{
var file = Collection.FindById(fileId);
if (file == null)
{
return Task.FromResult((IFile)null);
}
file.Description = request.Description ?? file.Description;
file.Name = request.Name ?? file.Name;
file.ReadRoles = request.ReadRoles ?? file.ReadRoles;
file.Thumbnails = thumbnails ?? file.Thumbnails;
file.UpdateRoles = request.UpdateRoles ?? file.UpdateRoles;
Collection.Update(file.Id, file);
return Task.FromResult((IFile)file);
}
public Task<IFile> Upload(UploadFileRequest request, UploadedFileInfo file)
{
var liteDbFile = new LiteDbFile
{
AudioStreams = file.AudioStreams,
ContentLength = file.ContentLength,
ContentType = file.ContentType,
Description = request.Description ?? "",
Duration = file.Duration,
Fps = file.Fps,
Height = file.Height,
Id = file.Id,
Name = request.Name ?? "",
Location = file.Location,
Md5 = file.Md5,
ReadRoles = request.ReadRoles ?? new RoleSet(),
Thumbnails = file.Thumbnails?.Select(it => new LiteDbThumbnail(it)).ToArray(),
Type = file.Type,
UpdateRoles = request.UpdateRoles ?? new RoleSet(),
UploadedBy = file.UploadedBy,
UploadedOn = file.UploadedOn,
VideoStreams = file.VideoStreams,
Width = file.Width
};
Collection.Insert(liteDbFile);
return Task.FromResult((IFile)liteDbFile);
}
}
public class LiteDbFile : IFile
{
public DateTime UploadedOn { get; set; }
public FileType Type { get; set; }
[BsonId]
public Guid Id { get; set; }
public Guid Md5 { get; set; }
public Guid UploadedBy { get; set; }
public RoleSet ReadRoles { get; set; }
public RoleSet UpdateRoles { get; set; }
public IPlaylistReference[] PlaylistReferences { get; set; }
public IThumbnail[] Thumbnails { get; set; }
public double? Fps { get; set; }
public int? Height { get; set; }
public int? Width { get; set; }
public long ContentLength { get; set; }
public long? Duration { get; set; }
public string ContentType { get; set; }
public string Description { get; set; }
public string Location { get; set; }
public string Name { get; set; }
public string[] AudioStreams { get; set; }
public string[] VideoStreams { get; set; }
}
public class LiteDbPlaylistReference : IPlaylistReference
{
public LiteDbPlaylistReference()
{
}
public LiteDbPlaylistReference(IPlaylistReference playlistReference)
{
AddedOn = playlistReference.AddedOn;
Id = playlistReference.Id;
Index = playlistReference.Index;
}
public DateTime AddedOn { get; set; }
public Guid Id { get; set; }
public int Index { get; set; }
}
}
| 33.507813 | 163 | 0.479988 | [
"Apache-2.0"
] | CyAScott/MediaBrowser | src/MediaBrowser/Services/LiteDbFiles.cs | 12,867 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace StreetRacing
{
public class Race
{
public Race(string name, string type, int laps, int capacity, int maxHorsePower)
{
this.Name = name;
this.Type = type;
this.Laps = laps;
this.Capacity = capacity;
this.MaxHorsePower = maxHorsePower;
this.Participants = new Dictionary<string, Car>();
}
public string Name { get; private set; }
public string Type { get; private set; }
public int Laps { get; private set; }
public int Capacity { get; private set; }
public int MaxHorsePower { get; private set; }
private Dictionary<string, Car> Participants { get; set; }
public int Count => this.Participants.Count;
public void Add(Car car)
{
if (!this.Participants.ContainsKey(car.LicensePlate)
&& this.Count < this.Capacity
&& car.HorsePower <= this.MaxHorsePower)
{
this.Participants.Add(car.LicensePlate, car);
}
}
public bool Remove(string licensePlate) => this.Participants.Remove(licensePlate);
public Car FindParticipant(string licensePlate) => this.Participants.FirstOrDefault(kvp => kvp.Key == licensePlate).Value;
public Car GetMostPowerfulCar() => this.Participants.OrderByDescending(kvp => kvp.Value.HorsePower).FirstOrDefault().Value;
public string Report()
{
StringBuilder sb = new StringBuilder();
sb.AppendLine($"Race: {this.Name} - Type: {this.Type} (Laps: {this.Laps})");
foreach (var kvp in this.Participants)
{
sb.AppendLine(kvp.Value.ToString());
}
return sb.ToString().TrimEnd();
}
}
}
| 29.507692 | 131 | 0.582899 | [
"MIT"
] | LyubomirRashkov/Software-University-SoftUni | C#Advanced/ExamPreparation/03.RetakeExam-18-Aug-2021/03.StreetRacing/StreetRacing/Race.cs | 1,920 | C# |
#if UNITY_EDITOR
using UnityEngine;
using System.Collections.Generic;
namespace O3DWB
{
public class Triangle3D
{
#region Private Variables
private Vector3[] _points = new Vector3[3];
private Plane _plane;
private float _area;
#endregion
#region Public Properties
public Vector3 Point0 { get { return _points[0]; } }
public Vector3 Point1 { get { return _points[1]; } }
public Vector3 Point2 { get { return _points[2]; } }
public Vector3 Normal { get { return _plane.normal; } }
public Plane Plane { get { return _plane; } }
public float Area { get { return _area; } }
public bool IsDegenerate { get { return _area == 0.0f || float.IsNaN(_area); } }
#endregion
#region Constructors
public Triangle3D(Triangle3D source)
{
_points = new Vector3[3];
_points[0] = source.Point0;
_points[1] = source.Point1;
_points[2] = source.Point2;
_plane = source._plane;
_area = source._area;
}
public Triangle3D(Vector3 point0, Vector3 point1, Vector3 point2)
{
_points = new Vector3[3];
_points[0] = point0;
_points[1] = point1;
_points[2] = point2;
CalculateAreaAndPlane();
}
#endregion
#region Public Methods
public void TransformPoints(TransformMatrix transformMatrix)
{
_points[0] = transformMatrix.MultiplyPoint(_points[0]);
_points[1] = transformMatrix.MultiplyPoint(_points[1]);
_points[2] = transformMatrix.MultiplyPoint(_points[2]);
CalculateAreaAndPlane();
}
public void TransformPoints(Matrix4x4 transformMatrix)
{
_points[0] = transformMatrix.MultiplyPoint(_points[0]);
_points[1] = transformMatrix.MultiplyPoint(_points[1]);
_points[2] = transformMatrix.MultiplyPoint(_points[2]);
CalculateAreaAndPlane();
}
public Box GetEncapsulatingBox()
{
List<Vector3> points = GetPoints();
Vector3 minPoint, maxPoint;
Vector3Extensions.GetMinMaxPoints(points, out minPoint, out maxPoint);
return new Box((minPoint + maxPoint) * 0.5f, maxPoint - minPoint);
}
public bool IntersectsBox(Box box)
{
// Store needed data
Vector3 boxCenter = box.Center;
float eX = box.Extents.x;
float eY = box.Extents.y;
float eZ = box.Extents.z;
// The triangle points expressed relative to the center of the box
Vector3 v0 = _points[0] - boxCenter;
Vector3 v1 = _points[1] - boxCenter;
Vector3 v2 = _points[2] - boxCenter;
// Triangle edges
Vector3 e0 = v1 - v0;
Vector3 e1 = v2 - v1;
Vector3 e2 = v0 - v2;
// Use the separating axis test for all 9 axes which result from crossing the box's local axes
// with the triangle esges.
// Test a00 = <1, 0, 0> X e0 = <0, -e0.z, e0.y>
Vector3 axis = new Vector3(0.0f, -e0.z, e0.y);
float v0Prj = Vector3.Dot(v0, axis);
float v1Prj = Vector3.Dot(v1, axis);
float v2Prj = Vector3.Dot(v2, axis);
float prjEx = Mathf.Abs(eY * axis.y) + Mathf.Abs(eZ * axis.z);
float minPrj = MathfEx.Min(v0Prj, v1Prj, v2Prj);
float maxPrj = MathfEx.Max(v0Prj, v1Prj, v2Prj);
if (Mathf.Max(-maxPrj, minPrj) > prjEx) return false;
// Test a01 = <1, 0, 0> X e1 = <0, -e1.z, e1.y>
axis = new Vector3(0.0f, -e1.z, e1.y);
v0Prj = Vector3.Dot(v0, axis);
v1Prj = Vector3.Dot(v1, axis);
v2Prj = Vector3.Dot(v2, axis);
prjEx = Mathf.Abs(eY * axis.y) + Mathf.Abs(eZ * axis.z);
minPrj = MathfEx.Min(v0Prj, v1Prj, v2Prj);
maxPrj = MathfEx.Max(v0Prj, v1Prj, v2Prj);
if (Mathf.Max(-maxPrj, minPrj) > prjEx) return false;
// Test a02 = <1, 0, 0> X e2 = <0, -e2.z, e2.y>
axis = new Vector3(0.0f, -e2.z, e2.y);
v0Prj = Vector3.Dot(v0, axis);
v1Prj = Vector3.Dot(v1, axis);
v2Prj = Vector3.Dot(v2, axis);
prjEx = Mathf.Abs(eY * axis.y) + Mathf.Abs(eZ * axis.z);
minPrj = MathfEx.Min(v0Prj, v1Prj, v2Prj);
maxPrj = MathfEx.Max(v0Prj, v1Prj, v2Prj);
if (Mathf.Max(-maxPrj, minPrj) > prjEx) return false;
// Test a10 = <0, 1, 0> X e0 = <e0.z, 0, -e0.x>
axis = new Vector3(e0.z, 0.0f, -e0.x);
v0Prj = Vector3.Dot(v0, axis);
v1Prj = Vector3.Dot(v1, axis);
v2Prj = Vector3.Dot(v2, axis);
prjEx = Mathf.Abs(eX * axis.x) + Mathf.Abs(eZ * axis.z);
minPrj = MathfEx.Min(v0Prj, v1Prj, v2Prj);
maxPrj = MathfEx.Max(v0Prj, v1Prj, v2Prj);
if (Mathf.Max(-maxPrj, minPrj) > prjEx) return false;
// Test a11 = <0, 1, 0> X e1 = <e1.z, 0, -e1.x>
axis = new Vector3(e1.z, 0.0f, -e1.x);
v0Prj = Vector3.Dot(v0, axis);
v1Prj = Vector3.Dot(v1, axis);
v2Prj = Vector3.Dot(v2, axis);
prjEx = Mathf.Abs(eX * axis.x) + Mathf.Abs(eZ * axis.z);
minPrj = MathfEx.Min(v0Prj, v1Prj, v2Prj);
maxPrj = MathfEx.Max(v0Prj, v1Prj, v2Prj);
if (Mathf.Max(-maxPrj, minPrj) > prjEx) return false;
// Test a12 = <0, 1, 0> X e2 = <e2.z, 0, -e2.x>
axis = new Vector3(e2.z, 0.0f, -e2.x);
v0Prj = Vector3.Dot(v0, axis);
v1Prj = Vector3.Dot(v1, axis);
v2Prj = Vector3.Dot(v2, axis);
prjEx = Mathf.Abs(eX * axis.x) + Mathf.Abs(eZ * axis.z);
minPrj = MathfEx.Min(v0Prj, v1Prj, v2Prj);
maxPrj = MathfEx.Max(v0Prj, v1Prj, v2Prj);
if (Mathf.Max(-maxPrj, minPrj) > prjEx) return false;
// Test a20 = <0, 0, 1> X e0 = <-e0.y, e0.x, 0>
axis = new Vector3(-e0.y, e0.x, 0.0f);
v0Prj = Vector3.Dot(v0, axis);
v1Prj = Vector3.Dot(v1, axis);
v2Prj = Vector3.Dot(v2, axis);
prjEx = Mathf.Abs(eX * axis.x) + Mathf.Abs(eY * axis.y);
minPrj = MathfEx.Min(v0Prj, v1Prj, v2Prj);
maxPrj = MathfEx.Max(v0Prj, v1Prj, v2Prj);
if (Mathf.Max(-maxPrj, minPrj) > prjEx) return false;
// Test a21 = <0, 0, 1> X e1 = <-e1.y, e1.x, 0>
axis = new Vector3(-e1.y, e1.x, 0.0f);
v0Prj = Vector3.Dot(v0, axis);
v1Prj = Vector3.Dot(v1, axis);
v2Prj = Vector3.Dot(v2, axis);
prjEx = Mathf.Abs(eX * axis.x) + Mathf.Abs(eY * axis.y);
minPrj = MathfEx.Min(v0Prj, v1Prj, v2Prj);
maxPrj = MathfEx.Max(v0Prj, v1Prj, v2Prj);
if (Mathf.Max(-maxPrj, minPrj) > prjEx) return false;
// Test a22 = <0, 0, 1> X e2 = <-e2.y, e2.x, 0>
axis = new Vector3(-e2.y, e2.x, 0.0f);
v0Prj = Vector3.Dot(v0, axis);
v1Prj = Vector3.Dot(v1, axis);
v2Prj = Vector3.Dot(v2, axis);
prjEx = Mathf.Abs(eX * axis.x) + Mathf.Abs(eY * axis.y);
minPrj = MathfEx.Min(v0Prj, v1Prj, v2Prj);
maxPrj = MathfEx.Max(v0Prj, v1Prj, v2Prj);
if (Mathf.Max(-maxPrj, minPrj) > prjEx) return false;
// Check if the triangle's box intersects the box
Box trianlgeBox = GetEncapsulatingBox();
if (trianlgeBox.IntersectsBox(box, true)) return true;
// Check if the box spans the triangle plane
BoxPlaneClassificationResult boxPlaneCalssifyResult = Plane.ClassifyBox(box);
return (boxPlaneCalssifyResult == BoxPlaneClassificationResult.Spanning || boxPlaneCalssifyResult == BoxPlaneClassificationResult.OnPlane);
}
public List<Segment3D> GetSegments()
{
var segments = new List<Segment3D>();
segments.Add(new Segment3D(Point0, Point1));
segments.Add(new Segment3D(Point1, Point2));
segments.Add(new Segment3D(Point2, Point0));
return segments;
}
public Plane GetSegmentPlane(int segmentIndex)
{
Segment3D segment = GetSegment(segmentIndex);
Vector3 segmentPlaneNormal = Vector3.Cross(segment.Direction, _plane.normal);
segmentPlaneNormal.Normalize();
return new Plane(segmentPlaneNormal, segment.StartPoint);
}
public Segment3D GetSegment(int segmentIndex)
{
return new Segment3D(_points[segmentIndex], _points[(segmentIndex + 1) % 3]);
}
public bool Raycast(Ray ray, out float t)
{
if (_plane.Raycast(ray, out t))
{
Vector3 intersectionPoint = ray.GetPoint(t);
return ContainsPoint(intersectionPoint);
}
else return false;
}
public bool Raycast(Ray3D ray, out float t)
{
if(ray.IntersectsPlane(_plane, out t))
{
Vector3 intersectionPoint = ray.GetPoint(t);
return ContainsPoint(intersectionPoint);
}
return false;
}
public bool ContainsPoint(Vector3 point)
{
for(int segmentIndex = 0; segmentIndex < 3; ++segmentIndex)
{
Plane segmentPlane = GetSegmentPlane(segmentIndex);
if (segmentPlane.IsPointInFront(point)) return false;
}
return true;
}
public Sphere GetEncapsulatingSphere()
{
return GetEncapsulatingBox().GetEncpasulatingSphere();
}
public Vector3 GetCenter()
{
Vector3 pointSum = Point0 + Point1 + Point2;
return pointSum / 3.0f;
}
public List<Vector3> GetPoints()
{
return new List<Vector3> { Point0, Point1, Point2 };
}
public Vector3 GetPointClosestToPoint(Vector3 point)
{
return Vector3Extensions.GetClosestPointToPoint(GetPoints(), point);
}
public bool IntersectsTriangle(Triangle3D triangle)
{
if (triangle.Normal.IsAlignedWith(Normal)) return false;
float t;
List<Segment3D> otherTriSegments = triangle.GetSegments();
var firstTriIntersectionPoints = new List<Vector3>();
foreach (var segment in otherTriSegments)
{
Ray3D ray = new Ray3D(segment.StartPoint, segment.EndPoint);
if (Raycast(ray, out t)) firstTriIntersectionPoints.Add(ray.GetPoint(t));
}
List<Segment3D> thisTriSegments = GetSegments();
var secondTriIntersectionPoints = new List<Vector3>();
foreach (var segment in thisTriSegments)
{
Ray3D ray = new Ray3D(segment.StartPoint, segment.EndPoint);
if (triangle.Raycast(ray, out t)) secondTriIntersectionPoints.Add(ray.GetPoint(t));
}
if (firstTriIntersectionPoints.Count != 0 || secondTriIntersectionPoints.Count != 0) return true;
return false;
}
public bool IntersectsTriangle(Triangle3D triangle, out Triangle3DIntersectInfo intersectInfo)
{
intersectInfo = new Triangle3DIntersectInfo();
if (triangle.Normal.IsAlignedWith(Normal)) return false;
float t;
List<Segment3D> otherTriSegments = triangle.GetSegments();
var firstTriIntersectionPoints = new List<Vector3>();
foreach (var segment in otherTriSegments)
{
Ray3D ray = new Ray3D(segment.StartPoint, segment.EndPoint);
if (Raycast(ray, out t)) firstTriIntersectionPoints.Add(ray.GetPoint(t));
}
List<Segment3D> thisTriSegments = GetSegments();
var secondTriIntersectionPoints = new List<Vector3>();
foreach(var segment in thisTriSegments)
{
Ray3D ray = new Ray3D(segment.StartPoint, segment.EndPoint);
if (triangle.Raycast(ray, out t)) secondTriIntersectionPoints.Add(ray.GetPoint(t));
}
if (firstTriIntersectionPoints.Count != 0 || secondTriIntersectionPoints.Count != 0)
{
intersectInfo = new Triangle3DIntersectInfo(this, triangle, firstTriIntersectionPoints, secondTriIntersectionPoints);
return true;
}
return false;
}
#endregion
#region Private Methods
private void CalculateAreaAndPlane()
{
Vector3 edge0 = Point1 - Point0;
Vector3 edge1 = Point2 - Point0;
Vector3 normal = Vector3.Cross(edge0, edge1);
if(normal.magnitude < 1e-5f)
{
_area = 0.0f;
_plane = new Plane(Vector3.zero, Vector3.zero);
}
else
{
_area = normal.magnitude * 0.5f;
normal.Normalize();
_plane = new Plane(normal, Point0);
}
}
#endregion
}
}
#endif | 38.584527 | 151 | 0.549532 | [
"MIT"
] | AestheticalZ/Faithful-SCP-Unity | Assets/Octave3D World Builder/Scripts/Math/Triangle/Triangle3D.cs | 13,468 | C# |
using System;
namespace AutoMapper
{
public class TypeMapCreatedEventArgs : EventArgs
{
public TypeMap TypeMap { get; private set; }
public TypeMapCreatedEventArgs(TypeMap typeMap)
{
TypeMap = typeMap;
}
}
public interface IConfigurationProvider : IProfileConfiguration
{
TypeMap[] GetAllTypeMaps();
TypeMap FindTypeMapFor(object source, object destination, Type sourceType, Type destinationType);
TypeMap FindTypeMapFor(Type sourceType, Type destinationType);
TypeMap FindTypeMapFor(ResolutionResult resolutionResult, Type destinationType);
IFormatterConfiguration GetProfileConfiguration(string profileName);
void AssertConfigurationIsValid();
void AssertConfigurationIsValid(TypeMap typeMap);
void AssertConfigurationIsValid(string profileName);
IObjectMapper[] GetMappers();
TypeMap CreateTypeMap(Type sourceType, Type destinationType);
event EventHandler<TypeMapCreatedEventArgs> TypeMapCreated;
Func<Type, object> ServiceCtor { get; }
}
} | 32 | 100 | 0.774414 | [
"MIT"
] | vcsjones/AutoMapper | src/AutoMapper/IConfigurationProvider.cs | 1,024 | 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.Azure.Network.Outputs
{
[OutputType]
public sealed class SubnetDelegationServiceDelegation
{
/// <summary>
/// A list of Actions which should be delegated. This list is specific to the service to delegate to. Possible values include `Microsoft.Network/networkinterfaces/*`, `Microsoft.Network/virtualNetworks/subnets/action`, `Microsoft.Network/virtualNetworks/subnets/join/action`, `Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action` and `Microsoft.Network/virtualNetworks/subnets/unprepareNetworkPolicies/action`.
/// </summary>
public readonly ImmutableArray<string> Actions;
/// <summary>
/// The name of service to delegate to. Possible values include `Microsoft.BareMetal/AzureVMware`, `Microsoft.BareMetal/CrayServers`, `Microsoft.Batch/batchAccounts`, `Microsoft.ContainerInstance/containerGroups`, `Microsoft.Databricks/workspaces`, `Microsoft.DBforPostgreSQL/serversv2`, `Microsoft.HardwareSecurityModules/dedicatedHSMs`, `Microsoft.Logic/integrationServiceEnvironments`, `Microsoft.Netapp/volumes`, `Microsoft.ServiceFabricMesh/networks`, `Microsoft.Sql/managedInstances`, `Microsoft.Sql/servers`, `Microsoft.StreamAnalytics/streamingJobs`, `Microsoft.Web/hostingEnvironments` and `Microsoft.Web/serverFarms`.
/// </summary>
public readonly string Name;
[OutputConstructor]
private SubnetDelegationServiceDelegation(
ImmutableArray<string> actions,
string name)
{
Actions = actions;
Name = name;
}
}
}
| 53.611111 | 635 | 0.737824 | [
"ECL-2.0",
"Apache-2.0"
] | AdminTurnedDevOps/pulumi-azure | sdk/dotnet/Network/Outputs/SubnetDelegationServiceDelegation.cs | 1,930 | C# |
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using Telegram.Bot.Requests.Abstractions;
using Telegram.Bot.Types;
using Telegram.Bot.Types.ReplyMarkups;
// ReSharper disable once CheckNamespace
namespace Telegram.Bot.Requests
{
/// <summary>
/// Stop updating a live location message sent by the bot
/// </summary>
[JsonObject(MemberSerialization.OptIn, NamingStrategyType = typeof(SnakeCaseNamingStrategy))]
public class StopMessageLiveLocationRequest : RequestBase<Message>,
IInlineReplyMarkupMessage
{
/// <summary>
/// Unique identifier for the target chat or username of the target channel
/// </summary>
[JsonProperty(Required = Required.Always)]
public ChatId ChatId { get; }
/// <summary>
/// Identifier of the sent message
/// </summary>
[JsonProperty(Required = Required.Always)]
public int MessageId { get; }
/// <inheritdoc cref="IInlineReplyMarkupMessage.ReplyMarkup" />
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public InlineKeyboardMarkup ReplyMarkup { get; set; }
/// <summary>
/// Initializes a new request with chatId
/// </summary>
/// <param name="chatId">Unique identifier for the target chat or username of the target channel</param>
/// <param name="messageId">Identifier of the sent message</param>
public StopMessageLiveLocationRequest(ChatId chatId, int messageId)
: base("stopMessageLiveLocation")
{
ChatId = chatId;
MessageId = messageId;
}
}
}
| 36.934783 | 112 | 0.64332 | [
"MIT"
] | 4vz/jovice | Athena/Library/Telegram.Bot/Requests/Available Methods/Location/StopMessageLiveLocationRequest.cs | 1,701 | C# |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using Azure.Core.TestFramework;
using NUnit.Framework;
using System;
using System.Threading.Tasks;
using Azure.Core;
namespace Azure.MixedReality.RemoteRendering.Tests
{
public class RemoteRenderingLiveTests : RecordedTestBase<RemoteRenderingTestEnvironment>
{
public RemoteRenderingLiveTests(bool isAsync) :
base(isAsync/*, RecordedTestMode.Record*/)
{
}
[RecordedTest]
public async Task TestSimpleConversion()
{
var client = GetClient();
Uri storageUri = new Uri($"https://{TestEnvironment.StorageAccountName}.blob.core.windows.net/{TestEnvironment.BlobContainerName}");
AssetConversionInputOptions input = new AssetConversionInputOptions(storageUri, "testBox.fbx")
{
// We use SAS for live testing, as there can be a delay before DRAM-based access is available for new accounts.
StorageContainerReadListSas = TestEnvironment.SasToken,
BlobPrefix = "Input"
};
AssetConversionOutputOptions output = new AssetConversionOutputOptions(storageUri)
{
StorageContainerWriteSas = TestEnvironment.SasToken,
BlobPrefix = "Output"
};
AssetConversionOptions conversionOptions = new AssetConversionOptions(input, output);
string conversionId = Recording.Random.NewGuid().ToString();
AssetConversionOperation conversionOperation = await client.StartConversionAsync(conversionId, conversionOptions);
Assert.AreEqual(conversionId, conversionOperation.Id);
Assert.AreEqual(conversionOptions.InputOptions.RelativeInputAssetPath, conversionOperation.Value.Options.InputOptions.RelativeInputAssetPath);
Assert.AreNotEqual(AssetConversionStatus.Failed, conversionOperation.Value.Status);
AssetConversion conversion = await client.GetConversionAsync(conversionId);
Assert.AreEqual(conversion.ConversionId, conversionId);
Assert.AreNotEqual(AssetConversionStatus.Failed, conversion.Status);
AssetConversion conversion2 = await conversionOperation.WaitForCompletionAsync();
Assert.AreEqual(conversionId, conversion2.ConversionId);
Assert.AreEqual(AssetConversionStatus.Succeeded, conversion2.Status);
Assert.IsTrue(conversionOperation.Value.Output.OutputAssetUri.EndsWith("Output/testBox.arrAsset"));
bool foundConversion = false;
await foreach (var s in client.GetConversionsAync())
{
if (s.ConversionId == conversionId)
{
foundConversion = true;
}
}
Assert.IsTrue(foundConversion);
}
[RecordedTest]
public void TestFailedConversionsNoAccess()
{
var client = GetClient();
Uri storageUri = new Uri($"https://{TestEnvironment.StorageAccountName}.blob.core.windows.net/{TestEnvironment.BlobContainerName}");
AssetConversionInputOptions input = new AssetConversionInputOptions(storageUri, "testBox.fbx")
{
// Do not provide SAS access to the container, and assume the test account is not linked to the storage.
BlobPrefix = "Input"
};
AssetConversionOutputOptions output = new AssetConversionOutputOptions(storageUri)
{
BlobPrefix = "Output"
};
AssetConversionOptions conversionOptions = new AssetConversionOptions(input, output);
string conversionId = Recording.Random.NewGuid().ToString();
RequestFailedException ex = Assert.ThrowsAsync<RequestFailedException>(() => client.StartConversionAsync(conversionId, conversionOptions));
Assert.AreEqual(403, ex.Status);
// Error accessing connected storage account due to insufficient permissions. Check if the Mixed Reality resource has correct permissions assigned
Assert.IsTrue(ex.Message.ToLower().Contains("storage"));
Assert.IsTrue(ex.Message.ToLower().Contains("permissions"));
}
[RecordedTest]
public async Task TestFailedConversionsMissingAsset()
{
var client = GetClient();
Uri storageUri = new Uri($"https://{TestEnvironment.StorageAccountName}.blob.core.windows.net/{TestEnvironment.BlobContainerName}");
AssetConversionInputOptions input = new AssetConversionInputOptions(storageUri, "boxWhichDoesNotExist.fbx")
{
// We use SAS for live testing, as there can be a delay before DRAM-based access is available for new accounts.
StorageContainerReadListSas = TestEnvironment.SasToken,
BlobPrefix = "Input"
};
AssetConversionOutputOptions output = new AssetConversionOutputOptions(storageUri)
{
StorageContainerWriteSas = TestEnvironment.SasToken,
BlobPrefix = "Output"
};
AssetConversionOptions conversionOptions = new AssetConversionOptions(input, output);
string conversionId = Recording.Random.NewGuid().ToString();
AssetConversionOperation conversionOperation = await client.StartConversionAsync(conversionId, conversionOptions);
AssetConversion conversion = await conversionOperation.WaitForCompletionAsync();
Assert.AreEqual(AssetConversionStatus.Failed, conversion.Status);
Assert.IsNotNull(conversion.Error);
// Invalid input provided. Check logs in output container for details.
Assert.IsTrue(conversion.Error.Message.ToLower().Contains("invalid input"));
Assert.IsTrue(conversion.Error.Message.ToLower().Contains("logs"));
}
[RecordedTest]
public async Task TestSimpleSession()
{
var client = GetClient();
RenderingSessionOptions options = new RenderingSessionOptions(TimeSpan.FromMinutes(4), RenderingServerSize.Standard);
string sessionId = Recording.Random.NewGuid().ToString();
StartRenderingSessionOperation startSessionOperation = await client.StartSessionAsync(sessionId, options);
Assert.IsTrue(startSessionOperation.HasValue);
Assert.AreEqual(options.Size, startSessionOperation.Value.Size);
Assert.AreEqual(sessionId, startSessionOperation.Value.SessionId);
RenderingSession sessionProperties = await client.GetSessionAsync(sessionId);
Assert.AreEqual(startSessionOperation.Value.CreatedOn, sessionProperties.CreatedOn);
UpdateSessionOptions updateOptions = new UpdateSessionOptions(TimeSpan.FromMinutes(5));
RenderingSession updatedSession = await client.UpdateSessionAsync(sessionId, updateOptions);
Assert.AreEqual(updatedSession.MaxLeaseTime, TimeSpan.FromMinutes(5));
RenderingSession readyRenderingSession = await startSessionOperation.WaitForCompletionAsync();
Assert.IsTrue((readyRenderingSession.MaxLeaseTime == TimeSpan.FromMinutes(4)) || (readyRenderingSession.MaxLeaseTime == TimeSpan.FromMinutes(5)));
Assert.IsNotNull(readyRenderingSession.Host);
Assert.IsNotNull(readyRenderingSession.ArrInspectorPort);
Assert.IsNotNull(readyRenderingSession.HandshakePort);
Assert.AreEqual(readyRenderingSession.Size, options.Size);
UpdateSessionOptions updateOptions2 = new UpdateSessionOptions(TimeSpan.FromMinutes(6));
Assert.AreEqual(TimeSpan.FromMinutes(6), updateOptions2.MaxLeaseTime);
bool foundSession = false;
await foreach (var s in client.GetSessionsAsync())
{
if (s.SessionId == sessionId)
{
foundSession = true;
}
}
Assert.IsTrue(foundSession);
await client.StopSessionAsync(sessionId);
RenderingSession stoppedRenderingSession = await client.GetSessionAsync(sessionId);
Assert.AreEqual(RenderingSessionStatus.Stopped, stoppedRenderingSession.Status);
}
[RecordedTest]
public void TestFailedSessionRequest()
{
var client = GetClient();
// Make an invalid request (negative lease time).
RenderingSessionOptions options = new RenderingSessionOptions(TimeSpan.FromMinutes(-4), RenderingServerSize.Standard);
string sessionId = Recording.Random.NewGuid().ToString();
RequestFailedException ex = Assert.ThrowsAsync<RequestFailedException>(() => client.StartSessionAsync(sessionId, options));
Assert.AreEqual(400, ex.Status);
// The maxLeaseTimeMinutes value cannot be negative
Assert.IsTrue(ex.Message.ToLower().Contains("lease"));
Assert.IsTrue(ex.Message.ToLower().Contains("negative"));
}
private RemoteRenderingClient GetClient()
{
Guid accountId = new Guid(TestEnvironment.AccountId);
string accountDomain = TestEnvironment.AccountDomain;
Uri serviceEndpoint = new Uri(TestEnvironment.ServiceEndpoint);
var options = InstrumentClientOptions(new RemoteRenderingClientOptions());
// We don't need to test communication with the STS Authentication Library, so in playback
// we use a code-path which does not attempt to contact that service.
RemoteRenderingClient client;
if (Mode != RecordedTestMode.Playback)
{
AzureKeyCredential accountKeyCredential = new AzureKeyCredential(TestEnvironment.AccountKey);
client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, accountKeyCredential, options);
}
else
{
AccessToken artificialToken = new AccessToken("TestToken", DateTimeOffset.MaxValue);
client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, artificialToken, options);
}
return InstrumentClient(client);
}
}
}
| 48.607477 | 158 | 0.670448 | [
"MIT"
] | 93mishra/azure-sdk-for-net | sdk/remoterendering/Azure.MixedReality.RemoteRendering/tests/RemoteRenderingLiveTests.cs | 10,404 | C# |
// <auto-generated>
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// </auto-generated>
namespace Gov.Lclb.Cllb.Interfaces
{
using Microsoft.Rest;
using Models;
using System.Collections;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
/// <summary>
/// Extension methods for Workerinvoicehistories.
/// </summary>
public static partial class WorkerinvoicehistoriesExtensions
{
/// <summary>
/// Get entities from adoxio_workerinvoicehistories
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='top'>
/// </param>
/// <param name='skip'>
/// </param>
/// <param name='search'>
/// </param>
/// <param name='filter'>
/// </param>
/// <param name='count'>
/// </param>
/// <param name='orderby'>
/// Order items by property values
/// </param>
/// <param name='select'>
/// Select properties to be returned
/// </param>
/// <param name='expand'>
/// Expand related entities
/// </param>
public static MicrosoftDynamicsCRMadoxioWorkerinvoicehistoryCollection Get(this IWorkerinvoicehistories operations, int? top = default(int?), int? skip = default(int?), string search = default(string), string filter = default(string), bool? count = default(bool?), IList<string> orderby = default(IList<string>), IList<string> select = default(IList<string>), IList<string> expand = default(IList<string>))
{
return operations.GetAsync(top, skip, search, filter, count, orderby, select, expand).GetAwaiter().GetResult();
}
/// <summary>
/// Get entities from adoxio_workerinvoicehistories
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='top'>
/// </param>
/// <param name='skip'>
/// </param>
/// <param name='search'>
/// </param>
/// <param name='filter'>
/// </param>
/// <param name='count'>
/// </param>
/// <param name='orderby'>
/// Order items by property values
/// </param>
/// <param name='select'>
/// Select properties to be returned
/// </param>
/// <param name='expand'>
/// Expand related entities
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<MicrosoftDynamicsCRMadoxioWorkerinvoicehistoryCollection> GetAsync(this IWorkerinvoicehistories operations, int? top = default(int?), int? skip = default(int?), string search = default(string), string filter = default(string), bool? count = default(bool?), IList<string> orderby = default(IList<string>), IList<string> select = default(IList<string>), IList<string> expand = default(IList<string>), CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.GetWithHttpMessagesAsync(top, skip, search, filter, count, orderby, select, expand, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
/// <summary>
/// Get entities from adoxio_workerinvoicehistories
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='top'>
/// </param>
/// <param name='skip'>
/// </param>
/// <param name='search'>
/// </param>
/// <param name='filter'>
/// </param>
/// <param name='count'>
/// </param>
/// <param name='orderby'>
/// Order items by property values
/// </param>
/// <param name='select'>
/// Select properties to be returned
/// </param>
/// <param name='expand'>
/// Expand related entities
/// </param>
/// <param name='customHeaders'>
/// Headers that will be added to request.
/// </param>
public static HttpOperationResponse<MicrosoftDynamicsCRMadoxioWorkerinvoicehistoryCollection> GetWithHttpMessages(this IWorkerinvoicehistories operations, int? top = default(int?), int? skip = default(int?), string search = default(string), string filter = default(string), bool? count = default(bool?), IList<string> orderby = default(IList<string>), IList<string> select = default(IList<string>), IList<string> expand = default(IList<string>), Dictionary<string, List<string>> customHeaders = null)
{
return operations.GetWithHttpMessagesAsync(top, skip, search, filter, count, orderby, select, expand, customHeaders, CancellationToken.None).ConfigureAwait(false).GetAwaiter().GetResult();
}
/// <summary>
/// Add new entity to adoxio_workerinvoicehistories
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='body'>
/// New entity
/// </param>
/// <param name='prefer'>
/// Required in order for the service to return a JSON representation of the
/// object.
/// </param>
public static MicrosoftDynamicsCRMadoxioWorkerinvoicehistory Create(this IWorkerinvoicehistories operations, MicrosoftDynamicsCRMadoxioWorkerinvoicehistory body, string prefer = "return=representation")
{
return operations.CreateAsync(body, prefer).GetAwaiter().GetResult();
}
/// <summary>
/// Add new entity to adoxio_workerinvoicehistories
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='body'>
/// New entity
/// </param>
/// <param name='prefer'>
/// Required in order for the service to return a JSON representation of the
/// object.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<MicrosoftDynamicsCRMadoxioWorkerinvoicehistory> CreateAsync(this IWorkerinvoicehistories operations, MicrosoftDynamicsCRMadoxioWorkerinvoicehistory body, string prefer = "return=representation", CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.CreateWithHttpMessagesAsync(body, prefer, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
/// <summary>
/// Add new entity to adoxio_workerinvoicehistories
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='body'>
/// New entity
/// </param>
/// <param name='prefer'>
/// Required in order for the service to return a JSON representation of the
/// object.
/// </param>
/// <param name='customHeaders'>
/// Headers that will be added to request.
/// </param>
public static HttpOperationResponse<MicrosoftDynamicsCRMadoxioWorkerinvoicehistory> CreateWithHttpMessages(this IWorkerinvoicehistories operations, MicrosoftDynamicsCRMadoxioWorkerinvoicehistory body, string prefer = "return=representation", Dictionary<string, List<string>> customHeaders = null)
{
return operations.CreateWithHttpMessagesAsync(body, prefer, customHeaders, CancellationToken.None).ConfigureAwait(false).GetAwaiter().GetResult();
}
/// <summary>
/// Get entity from adoxio_workerinvoicehistories by key
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='adoxioWorkerinvoicehistoryid'>
/// key: adoxio_workerinvoicehistoryid of adoxio_workerinvoicehistory
/// </param>
/// <param name='select'>
/// Select properties to be returned
/// </param>
/// <param name='expand'>
/// Expand related entities
/// </param>
public static MicrosoftDynamicsCRMadoxioWorkerinvoicehistory GetByKey(this IWorkerinvoicehistories operations, string adoxioWorkerinvoicehistoryid, IList<string> select = default(IList<string>), IList<string> expand = default(IList<string>))
{
return operations.GetByKeyAsync(adoxioWorkerinvoicehistoryid, select, expand).GetAwaiter().GetResult();
}
/// <summary>
/// Get entity from adoxio_workerinvoicehistories by key
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='adoxioWorkerinvoicehistoryid'>
/// key: adoxio_workerinvoicehistoryid of adoxio_workerinvoicehistory
/// </param>
/// <param name='select'>
/// Select properties to be returned
/// </param>
/// <param name='expand'>
/// Expand related entities
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<MicrosoftDynamicsCRMadoxioWorkerinvoicehistory> GetByKeyAsync(this IWorkerinvoicehistories operations, string adoxioWorkerinvoicehistoryid, IList<string> select = default(IList<string>), IList<string> expand = default(IList<string>), CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.GetByKeyWithHttpMessagesAsync(adoxioWorkerinvoicehistoryid, select, expand, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
/// <summary>
/// Get entity from adoxio_workerinvoicehistories by key
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='adoxioWorkerinvoicehistoryid'>
/// key: adoxio_workerinvoicehistoryid of adoxio_workerinvoicehistory
/// </param>
/// <param name='select'>
/// Select properties to be returned
/// </param>
/// <param name='expand'>
/// Expand related entities
/// </param>
/// <param name='customHeaders'>
/// Headers that will be added to request.
/// </param>
public static HttpOperationResponse<MicrosoftDynamicsCRMadoxioWorkerinvoicehistory> GetByKeyWithHttpMessages(this IWorkerinvoicehistories operations, string adoxioWorkerinvoicehistoryid, IList<string> select = default(IList<string>), IList<string> expand = default(IList<string>), Dictionary<string, List<string>> customHeaders = null)
{
return operations.GetByKeyWithHttpMessagesAsync(adoxioWorkerinvoicehistoryid, select, expand, customHeaders, CancellationToken.None).ConfigureAwait(false).GetAwaiter().GetResult();
}
/// <summary>
/// Update entity in adoxio_workerinvoicehistories
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='adoxioWorkerinvoicehistoryid'>
/// key: adoxio_workerinvoicehistoryid of adoxio_workerinvoicehistory
/// </param>
/// <param name='body'>
/// New property values
/// </param>
public static void Update(this IWorkerinvoicehistories operations, string adoxioWorkerinvoicehistoryid, MicrosoftDynamicsCRMadoxioWorkerinvoicehistory body)
{
operations.UpdateAsync(adoxioWorkerinvoicehistoryid, body).GetAwaiter().GetResult();
}
/// <summary>
/// Update entity in adoxio_workerinvoicehistories
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='adoxioWorkerinvoicehistoryid'>
/// key: adoxio_workerinvoicehistoryid of adoxio_workerinvoicehistory
/// </param>
/// <param name='body'>
/// New property values
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task UpdateAsync(this IWorkerinvoicehistories operations, string adoxioWorkerinvoicehistoryid, MicrosoftDynamicsCRMadoxioWorkerinvoicehistory body, CancellationToken cancellationToken = default(CancellationToken))
{
(await operations.UpdateWithHttpMessagesAsync(adoxioWorkerinvoicehistoryid, body, null, cancellationToken).ConfigureAwait(false)).Dispose();
}
/// <summary>
/// Update entity in adoxio_workerinvoicehistories
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='adoxioWorkerinvoicehistoryid'>
/// key: adoxio_workerinvoicehistoryid of adoxio_workerinvoicehistory
/// </param>
/// <param name='body'>
/// New property values
/// </param>
/// <param name='customHeaders'>
/// Headers that will be added to request.
/// </param>
public static HttpOperationResponse UpdateWithHttpMessages(this IWorkerinvoicehistories operations, string adoxioWorkerinvoicehistoryid, MicrosoftDynamicsCRMadoxioWorkerinvoicehistory body, Dictionary<string, List<string>> customHeaders = null)
{
return operations.UpdateWithHttpMessagesAsync(adoxioWorkerinvoicehistoryid, body, customHeaders, CancellationToken.None).ConfigureAwait(false).GetAwaiter().GetResult();
}
/// <summary>
/// Delete entity from adoxio_workerinvoicehistories
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='adoxioWorkerinvoicehistoryid'>
/// key: adoxio_workerinvoicehistoryid of adoxio_workerinvoicehistory
/// </param>
/// <param name='ifMatch'>
/// ETag
/// </param>
public static void Delete(this IWorkerinvoicehistories operations, string adoxioWorkerinvoicehistoryid, string ifMatch = default(string))
{
operations.DeleteAsync(adoxioWorkerinvoicehistoryid, ifMatch).GetAwaiter().GetResult();
}
/// <summary>
/// Delete entity from adoxio_workerinvoicehistories
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='adoxioWorkerinvoicehistoryid'>
/// key: adoxio_workerinvoicehistoryid of adoxio_workerinvoicehistory
/// </param>
/// <param name='ifMatch'>
/// ETag
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task DeleteAsync(this IWorkerinvoicehistories operations, string adoxioWorkerinvoicehistoryid, string ifMatch = default(string), CancellationToken cancellationToken = default(CancellationToken))
{
(await operations.DeleteWithHttpMessagesAsync(adoxioWorkerinvoicehistoryid, ifMatch, null, cancellationToken).ConfigureAwait(false)).Dispose();
}
/// <summary>
/// Delete entity from adoxio_workerinvoicehistories
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='adoxioWorkerinvoicehistoryid'>
/// key: adoxio_workerinvoicehistoryid of adoxio_workerinvoicehistory
/// </param>
/// <param name='ifMatch'>
/// ETag
/// </param>
/// <param name='customHeaders'>
/// Headers that will be added to request.
/// </param>
public static HttpOperationResponse DeleteWithHttpMessages(this IWorkerinvoicehistories operations, string adoxioWorkerinvoicehistoryid, string ifMatch = default(string), Dictionary<string, List<string>> customHeaders = null)
{
return operations.DeleteWithHttpMessagesAsync(adoxioWorkerinvoicehistoryid, ifMatch, customHeaders, CancellationToken.None).ConfigureAwait(false).GetAwaiter().GetResult();
}
}
}
| 50.842391 | 513 | 0.568145 | [
"Apache-2.0"
] | BrendanBeachBC/jag-lcrb-carla-public | cllc-interfaces/Dynamics-Autorest/WorkerinvoicehistoriesExtensions.cs | 18,710 | C# |
using System;
using Machine.Fakes;
using Machine.Specifications;
using Machine.VSTestAdapter.Configuration;
using Machine.VSTestAdapter.Discovery;
using Machine.VSTestAdapter.Execution;
using Machine.VSTestAdapter.Helpers;
using Microsoft.VisualStudio.TestPlatform.ObjectModel;
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter;
namespace Machine.VSTestAdapter.Specs.Configuration
{
public class When_adapter_runs_tests : WithFakes
{
static string ConfigurationXml = @"<RunSettings>
<RunConfiguration>
<MaxCpuCount>0</MaxCpuCount>
</RunConfiguration>
<MSpec>
<DisableFullTestNameInIDE>true</DisableFullTestNameInIDE>
<DisableFullTestNameInOutput>true</DisableFullTestNameInOutput>
</MSpec>
</RunSettings>";
static MSpecTestAdapterExecutor adapter;
static MSpecTestAdapterDiscoverer discoverer;
Establish establish = () =>
{
The<IRunSettings>()
.WhenToldTo(runSettings => runSettings.SettingsXml)
.Return(ConfigurationXml);
The<IRunContext>()
.WhenToldTo(context => context.RunSettings)
.Return(The<IRunSettings>());
discoverer = new MSpecTestAdapterDiscoverer(An<ISpecificationDiscoverer>());
adapter = new MSpecTestAdapterExecutor(The<ISpecificationExecutor>(), discoverer, An<ISpecificationFilterProvider>());
};
Because of = () => adapter.RunTests(new[] { new TestCase("a", MSpecTestAdapter.Uri, "dll") }, The<IRunContext>(), An<IFrameworkHandle>());
It should_pick_up_DisableFullTestNameInIDE = () =>
The<ISpecificationExecutor>()
.WasToldTo(d => d.RunAssemblySpecifications("dll",
Param<VisualStudioTestIdentifier[]>.IsAnything,
Param<Settings>.Matches(s => s.DisableFullTestNameInIDE),
Param<Uri>.IsAnything,
Param<IFrameworkHandle>.IsAnything));
It should_pick_up_DisableFullTestNameInOutput = () =>
The<ISpecificationExecutor>()
.WasToldTo(d => d.RunAssemblySpecifications("dll",
Param<VisualStudioTestIdentifier[]>.IsAnything,
Param<Settings>.Matches(s => s.DisableFullTestNameInOutput),
Param<Uri>.IsAnything,
Param<IFrameworkHandle>.IsAnything));
}
}
| 38.967742 | 146 | 0.663907 | [
"MIT"
] | mikeblakeuk/machine.specifications.runner.visualstudio | src/Machine.Specifications.Runner.VisualStudio.Specs/Configuration/When_adapter_runs_tests.cs | 2,418 | C# |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Inicial")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Inicial")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("df3d21c3-604a-4f49-ba60-5e7bab8c062c")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| 37.416667 | 84 | 0.746845 | [
"MIT"
] | albertoonezio/Inicial | Inicial/Properties/AssemblyInfo.cs | 1,350 | C# |
namespace EasyTravel.Services.Data
{
using System.Collections.Generic;
public interface ISearchService
{
IEnumerable<T> SearchByCityName<T>(string cityName);
}
}
| 18.8 | 60 | 0.702128 | [
"MIT"
] | AntoniaChavdarova/EasyTravel | Services/EasyTravel.Services.Data/ISearchService.cs | 190 | C# |
using NLog;
using NLog.Config;
using NLog.Layouts;
namespace Sentry.NLog.Tests;
public class ConfigurationExtensionsTest
{
private readonly LoggingConfiguration _sut = new();
[Fact]
public void AddSentry_Parameterless_DefaultTargetName()
{
var actual = _sut.AddSentry();
Assert.Equal(ConfigurationExtensions.DefaultTargetName, actual.AllTargets[0].Name);
}
[Fact]
public void AddSentry_ConfigCallback_CallbackInvoked()
{
var expected = TimeSpan.FromDays(1);
var actual = _sut.AddSentry(o => o.FlushTimeout = expected);
var sentryTarget = Assert.IsType<SentryTarget>(actual.AllTargets[0]);
Assert.Equal(expected.TotalSeconds, sentryTarget.FlushTimeoutSeconds);
}
[Fact]
public void AddSentry_DsnAndConfigCallback_CallbackInvokedAndDsnUsed()
{
var expectedTimeout = TimeSpan.FromDays(1);
var expectedDsn = "https://a@sentry.io/1";
var actual = _sut.AddSentry(expectedDsn, o => o.FlushTimeout = expectedTimeout);
var sentryTarget = Assert.IsType<SentryTarget>(actual.AllTargets[0]);
Assert.Equal(expectedTimeout.TotalSeconds, sentryTarget.FlushTimeoutSeconds);
Assert.Equal(expectedDsn, sentryTarget.Options.Dsn);
}
[Fact]
public void AddTag_SetToTarget()
{
var sut = new SentryNLogOptions();
Layout layout = "b";
sut.AddTag("a", layout);
var tag = Assert.Single(sut.Tags);
Assert.Equal("a", tag.Name);
Assert.Equal(layout, tag.Layout);
}
}
| 30.54902 | 91 | 0.679718 | [
"MIT"
] | TawasalMessenger/sentry-dotnet | test/Sentry.NLog.Tests/ConfigurationExtensionsTest.cs | 1,558 | C# |
// Copyright 2022 dSPACE GmbH, Mark Lechtermann, Matthias Nissen and Contributors
//
// 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.Reflection;
using System.Runtime.InteropServices;
using dSPACE.Runtime.InteropServices.ComTypes;
namespace dSPACE.Runtime.InteropServices.Writer;
internal class ParameterWriter : ElemDescBasedWriter
{
public ParameterWriter(MethodWriter methodWriter, ParameterInfo parameterInfo, WriterContext context, bool isTransformedOutParameter)
: base(parameterInfo.ParameterType, parameterInfo, methodWriter.MethodInfo.ReflectedType!, methodWriter.InterfaceWriter.TypeInfo, context)
{
_isTransformedOutParameter = isTransformedOutParameter;
ParameterInfo = parameterInfo;
TypeProvider = new TypeProvider(context, parameterInfo, true);
}
private readonly bool _isTransformedOutParameter;
private bool ParameterTypeIsComVisible => ParameterInfo.ParameterType.IsComVisible();
private PARAMFLAG _paramFlags = PARAMFLAG.PARAMFLAG_NONE;
public ParameterInfo ParameterInfo { get; }
/// <summary>
/// Gets a value indicating whether this instance of ParameterWriter is valid to generate a PARAMDESC.
/// If this instance is not valid, the owning method should no be created.
/// </summary>
/// <value>true if valid; otherwise false</value>
public bool IsValid
{
get
{
var unrefedType = ParameterInfo.ParameterType.IsByRef ? ParameterInfo.ParameterType.GetElementType()! : ParameterInfo.ParameterType;
// Marshal errors
if ((GetVariantType(unrefedType) == VarEnum.VT_EMPTY)
|| (unrefedType.IsArray && GetVariantType(unrefedType.GetElementType()!, true) == VarEnum.VT_EMPTY))
{
return false;
}
var underlayingType = ParameterInfo.ParameterType.GetUnderlayingType();
if (underlayingType.IsSpecialHandledClass() || underlayingType.IsSpecialHandledValueType())
{
return true;
}
else if (underlayingType.IsEnum)
{
if (GetVariantType(underlayingType) == VarEnum.VT_USERDEFINED)
{
return ParameterTypeIsComVisible && ParameterIsResolvable;
}
else
{
return true;
}
}
else if (!underlayingType.IsGenericType && (ParameterIsResolvable || underlayingType.IsInterface || underlayingType.IsClass))
{
return true;
}
return false;
}
}
public override void ReportEvent()
{
base.ReportEvent();
if (!ParameterIsResolvable && Type.GetUnderlayingType().IsInterface)
{
Context.LogWarning($"Warning: Type library exporter could not find the type library for {Type.GetUnderlayingType().Name}. IUnknown was substituted for the interface.", HRESULT.TLBX_I_USEIUNKNOWN);
}
}
private void CalculateFlags()
{
var hasInAttribute = ParameterInfo.Member != null && ParameterInfo.GetCustomAttribute<InAttribute>() != null;
if (ParameterInfo.IsOut || (ParameterInfo.ParameterType.IsByRef && !hasInAttribute) || _isTransformedOutParameter)
{
IDLFlags |= IDLFLAG.IDLFLAG_FOUT;
_paramFlags |= PARAMFLAG.PARAMFLAG_FOUT;
}
if (ParameterInfo.IsIn || hasInAttribute || (!ParameterInfo.IsRetval && !ParameterInfo.IsOut && !_isTransformedOutParameter))
{
IDLFlags |= IDLFLAG.IDLFLAG_FIN;
_paramFlags |= PARAMFLAG.PARAMFLAG_FIN;
}
if (ParameterInfo.IsRetval || _isTransformedOutParameter)
{
IDLFlags |= IDLFLAG.IDLFLAG_FRETVAL;
_paramFlags |= PARAMFLAG.PARAMFLAG_FRETVAL;
}
if (ParameterInfo.IsOptional)
{
_paramFlags |= PARAMFLAG.PARAMFLAG_FOPT;
if (ParameterInfo.HasDefaultValue)
{
_paramFlags |= PARAMFLAG.PARAMFLAG_FHASDEFAULT;
}
}
if (ParameterInfo.HasDefaultValue && ParameterInfo.DefaultValue != null)
{
_paramFlags |= PARAMFLAG.PARAMFLAG_FHASDEFAULT;
}
}
public override void Create()
{
CalculateFlags();
if (IsValid)
{
base.Create();
}
if (_isTransformedOutParameter || Type.IsByRef)
{
//encapsulate transformed out parameters and reference types
_elementDescription.tdesc = new TYPEDESC()
{
vt = (short)VarEnum.VT_PTR,
lpValue = StructureToPtr(_elementDescription.tdesc)
};
}
else if (TypeProvider.MarshalAsAttribute != null && TypeProvider.MarshalAsAttribute.Value == UnmanagedType.LPStruct &&
(Type == typeof(Guid)))
{
//add out parameter flag in this case, and only this case
IDLFlags |= IDLFLAG.IDLFLAG_FOUT;
_paramFlags |= PARAMFLAG.PARAMFLAG_FOUT;
}
_elementDescription.desc.idldesc.wIDLFlags = IDLFlags;
_elementDescription.desc.paramdesc.wParamFlags = _paramFlags;
if ((ParameterInfo.IsOptional && ParameterInfo.HasDefaultValue) ||
(ParameterInfo.HasDefaultValue && ParameterInfo.DefaultValue != null))
{
_elementDescription.desc.paramdesc.lpVarValue = GetDefaultValuePtr();
}
}
private IntPtr GetDefaultValuePtr()
{
var ptrVariant = ObjectToVariantPtr(ParameterInfo.DefaultValue);
var defValue = new PARAMDESCEX()
{
size = (ulong)Marshal.SizeOf<PARAMDESCEX>(),
varValue = Marshal.PtrToStructure<VARIANT>(ptrVariant)
};
if (ParameterInfo.DefaultValue == null)
{
defValue.varValue.vt = VarEnum.VT_UNKNOWN;
}
return StructureToPtr(defValue);
}
private bool ParameterIsResolvable
{
get
{
try
{
var type = ParameterInfo.ParameterType.GetUnderlayingType();
var notSpecialHandledValueType = !type.IsSpecialHandledValueType();
// If type is interface, enum, class, or struct...
if (type.IsInterface ||
type.IsEnum ||
(type.IsClass && notSpecialHandledValueType) ||
(type.IsValueType && !type.IsPrimitive && TypeProvider.MarshalAsAttribute == null && notSpecialHandledValueType))
{
return Context.TypeInfoResolver.ResolveTypeInfo(type) != null;
}
return true;
}
catch (FileNotFoundException)
{
// Assembly not found, or TypeLib not found...
return false;
}
}
}
public IDLFLAG IDLFlags { get; set; } = IDLFLAG.IDLFLAG_NONE;
}
| 36.129187 | 209 | 0.62005 | [
"Apache-2.0"
] | carstencodes/dscom | src/dscom/writer/ParameterWriter.cs | 7,551 | C# |
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.DotNet.Interactive.Formatting;
namespace Microsoft.DotNet.Interactive
{
public class FormattedValue
{
public FormattedValue(string mimeType, string value)
{
if (string.IsNullOrWhiteSpace(mimeType))
{
throw new ArgumentException("Value cannot be null or whitespace.", nameof(mimeType));
}
MimeType = mimeType;
Value = value;
}
public string MimeType { get; }
public string Value { get; }
public static IReadOnlyCollection<FormattedValue> FromObject(object value)
{
var type = value?.GetType();
var mimeTypes = MimeTypesFor(type).ToArray();
var formattedValues = mimeTypes
.Select(mimeType =>
new FormattedValue(mimeType, value.ToDisplayString(mimeType)))
.ToArray();
return formattedValues;
}
private static IEnumerable<string> MimeTypesFor(Type type)
{
var mimeTypes = new HashSet<string> ();
if (type != null)
{
var preferredMimeType = Formatter.GetPreferredMimeTypeFor(type);
if (preferredMimeType == null)
{
if (type?.IsPrimitive == true)
{
preferredMimeType = PlainTextFormatter.MimeType;
}
else
{
preferredMimeType = Formatter.DefaultMimeType;
}
}
if (!string.IsNullOrWhiteSpace(preferredMimeType))
{
mimeTypes.Add(preferredMimeType);
}
}
return mimeTypes;
}
}
} | 30.225352 | 111 | 0.518639 | [
"MIT"
] | DualBrain/interactive | src/Microsoft.DotNet.Interactive/FormattedValue.cs | 2,148 | C# |
using AbstractFactoryPattern.Cars.Abstracts;
using System;
namespace AbstractFactoryPattern.Cars
{
public class Legacy : SedanAbstract
{
public override void Create()
{
Console.WriteLine("Created: " + this.GetType().Name);
}
}
}
| 18.214286 | 59 | 0.698039 | [
"MIT"
] | arffdev/design-patterns | CreationalDesignPatterns/AbstractFactoryPattern/Cars/Legacy.cs | 257 | C# |
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.EntityFrameworkCore;
using Microsoft.AspNetCore.Mvc;
using Pastry.Models;
using System.Collections.Generic;
using System.Linq;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using System.Threading.Tasks;
using System.Security.Claims;
namespace Pastry.Controllers
{
public class FlavorsController : Controller
{
private readonly PastryContext _db;
private readonly UserManager<ApplicationUser> _userManager;
public FlavorsController(UserManager<ApplicationUser> userManager, PastryContext db)
{
_userManager = userManager;
_db = db;
}
public ActionResult Index()
{
List<Flavor> model = _db.Flavors.OrderBy(flavor => flavor.Name).ToList();
return View(model);
}
[Authorize]
public ActionResult Create()
{
return View();
}
[HttpPost]
public async Task<ActionResult> Create(Flavor flavor, int TreatId)
{
bool exists = _db.Flavors.Any(f => f.Name == flavor.Name);
if (!exists)
{
var userId = this.User.FindFirst(ClaimTypes.NameIdentifier)?.Value;
var currentUser = await _userManager.FindByIdAsync(userId);
flavor.User = currentUser;
_db.Flavors.Add(flavor);
_db.SaveChanges();
}
return RedirectToAction("Index");
}
public ActionResult Details(int id)
{
var thisFlavor = _db.Flavors
.Include(flavor => flavor.JoinEntities)
.ThenInclude(join => join.Treat)
.FirstOrDefault(flavor => flavor.FlavorId == id);
ViewBag.UserId = this.User.FindFirst(ClaimTypes.NameIdentifier)?.Value;
return View(thisFlavor);
}
[Authorize]
public ActionResult Edit(int id)
{
var thisFlavor = _db.Flavors.FirstOrDefault(flavor => flavor.FlavorId == id);
ViewBag.TreatId = new SelectList(_db.Treats, "TreatId", "Name");
return View(thisFlavor);
}
[HttpPost]
public ActionResult Edit(Flavor flavor, int TreatId)
{
if (TreatId != 0)
{
_db.TreatFlavor.Add(new TreatFlavor() { TreatId = TreatId, FlavorId = flavor.FlavorId });
}
_db.Entry(flavor).State = EntityState.Modified;
_db.SaveChanges();
return RedirectToAction("Details", new { id = flavor.FlavorId });
}
[Authorize]
public ActionResult AddTreat(int id)
{
var thisFlavor = _db.Flavors.FirstOrDefault(flavor => flavor.FlavorId == id);
ViewBag.TreatId = new SelectList(_db.Treats, "TreatId", "Name");
return View(thisFlavor);
}
[HttpPost]
public ActionResult AddTreat(Flavor flavor, int TreatId)
{
bool used = _db.TreatFlavor.Where(f => f.FlavorId == flavor.FlavorId).Any(t => t.TreatId == TreatId);
if (TreatId != 0 && !used)
{
_db.TreatFlavor.Add(new TreatFlavor() { TreatId = TreatId, FlavorId = flavor.FlavorId });
}
_db.SaveChanges();
return RedirectToAction("Details", new { id = flavor.FlavorId });
}
[Authorize]
public ActionResult Delete(int id)
{
var thisFlavor = _db.Flavors.FirstOrDefault(flavor => flavor.FlavorId == id);
return View(thisFlavor);
}
[HttpPost, ActionName("Delete")]
public ActionResult DeleteConfirmed(int id)
{
var thisFlavor = _db.Flavors.FirstOrDefault(flavor => flavor.FlavorId == id);
_db.Flavors.Remove(thisFlavor);
_db.SaveChanges();
return RedirectToAction("Index");
}
[Authorize]
[HttpPost]
public ActionResult DeleteTreat(int joinId)
{
var joinEntry = _db.TreatFlavor.FirstOrDefault(entry => entry.TreatFlavorId == joinId);
_db.TreatFlavor.Remove(joinEntry);
_db.SaveChanges();
return RedirectToAction("Details", new { id = joinEntry.FlavorId });
}
}
} | 30.515873 | 107 | 0.657997 | [
"ISC"
] | anastasiia-ria/Pastry.Solution | Pastry/Controllers/FlavorsController.cs | 3,845 | C# |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System;
namespace Azure.Search.Documents.Models
{
/// <summary> Represents a synonym map definition. </summary>
public partial class SynonymMap
{
/// <summary> Initializes a new instance of SynonymMap. </summary>
/// <param name="name"> The name of the synonym map. </param>
/// <param name="format"> The format of the synonym map. Only the 'solr' format is currently supported. </param>
/// <param name="synonyms"> A series of synonym rules in the specified synonym map format. The rules must be separated by newlines. </param>
/// <param name="encryptionKey"> A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your data when you want full assurance that no one, not even Microsoft, can decrypt your data in Azure Cognitive Search. Once you have encrypted your data, it will always remain encrypted. Azure Cognitive Search will ignore attempts to set this property to null. You can change this property as needed if you want to rotate your encryption key; Your data will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. </param>
/// <param name="eTag"> The ETag of the synonym map. </param>
internal SynonymMap(string name, string format, string synonyms, EncryptionKey encryptionKey, string eTag)
{
Name = name;
Format = format;
Synonyms = synonyms;
EncryptionKey = encryptionKey;
ETag = eTag;
}
/// <summary> A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your data when you want full assurance that no one, not even Microsoft, can decrypt your data in Azure Cognitive Search. Once you have encrypted your data, it will always remain encrypted. Azure Cognitive Search will ignore attempts to set this property to null. You can change this property as needed if you want to rotate your encryption key; Your data will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. </summary>
public EncryptionKey EncryptionKey { get; set; }
/// <summary> The ETag of the synonym map. </summary>
public string ETag { get; set; }
}
}
| 74.888889 | 727 | 0.719214 | [
"MIT"
] | NarayanThiru/azure-sdk-for-net | sdk/search/Azure.Search.Documents/src/Generated/Models/SynonymMap.cs | 2,696 | C# |
namespace Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190401
{
using Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.PowerShell;
/// <summary>Management policy action for snapshot.</summary>
[System.ComponentModel.TypeConverter(typeof(ManagementPolicySnapShotTypeConverter))]
public partial class ManagementPolicySnapShot
{
/// <summary>
/// <c>AfterDeserializeDictionary</c> will be called after the deserialization has finished, allowing customization of the
/// object before it is returned. Implement this method in a partial class to enable this behavior
/// </summary>
/// <param name="content">The global::System.Collections.IDictionary content that should be used.</param>
partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content);
/// <summary>
/// <c>AfterDeserializePSObject</c> will be called after the deserialization has finished, allowing customization of the object
/// before it is returned. Implement this method in a partial class to enable this behavior
/// </summary>
/// <param name="content">The global::System.Management.Automation.PSObject content that should be used.</param>
partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content);
/// <summary>
/// <c>BeforeDeserializeDictionary</c> will be called before the deserialization has commenced, allowing complete customization
/// of the object before it is deserialized.
/// If you wish to disable the default deserialization entirely, return <c>true</c> in the <see "returnNow" /> output parameter.
/// Implement this method in a partial class to enable this behavior.
/// </summary>
/// <param name="content">The global::System.Collections.IDictionary content that should be used.</param>
/// <param name="returnNow">Determines if the rest of the serialization should be processed, or if the method should return
/// instantly.</param>
partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow);
/// <summary>
/// <c>BeforeDeserializePSObject</c> will be called before the deserialization has commenced, allowing complete customization
/// of the object before it is deserialized.
/// If you wish to disable the default deserialization entirely, return <c>true</c> in the <see "returnNow" /> output parameter.
/// Implement this method in a partial class to enable this behavior.
/// </summary>
/// <param name="content">The global::System.Management.Automation.PSObject content that should be used.</param>
/// <param name="returnNow">Determines if the rest of the serialization should be processed, or if the method should return
/// instantly.</param>
partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow);
/// <summary>
/// Deserializes a <see cref="global::System.Collections.IDictionary" /> into an instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190401.ManagementPolicySnapShot"
/// />.
/// </summary>
/// <param name="content">The global::System.Collections.IDictionary content that should be used.</param>
/// <returns>
/// an instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190401.IManagementPolicySnapShot" />.
/// </returns>
public static Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190401.IManagementPolicySnapShot DeserializeFromDictionary(global::System.Collections.IDictionary content)
{
return new ManagementPolicySnapShot(content);
}
/// <summary>
/// Deserializes a <see cref="global::System.Management.Automation.PSObject" /> into an instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190401.ManagementPolicySnapShot"
/// />.
/// </summary>
/// <param name="content">The global::System.Management.Automation.PSObject content that should be used.</param>
/// <returns>
/// an instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190401.IManagementPolicySnapShot" />.
/// </returns>
public static Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190401.IManagementPolicySnapShot DeserializeFromPSObject(global::System.Management.Automation.PSObject content)
{
return new ManagementPolicySnapShot(content);
}
/// <summary>
/// Creates a new instance of <see cref="ManagementPolicySnapShot" />, deserializing the content from a json string.
/// </summary>
/// <param name="jsonText">a string containing a JSON serialized instance of this model.</param>
/// <returns>an instance of the <see cref="className" /> model class.</returns>
public static Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190401.IManagementPolicySnapShot FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.Json.JsonNode.Parse(jsonText));
/// <summary>
/// Deserializes a <see cref="global::System.Collections.IDictionary" /> into a new instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190401.ManagementPolicySnapShot"
/// />.
/// </summary>
/// <param name="content">The global::System.Collections.IDictionary content that should be used.</param>
internal ManagementPolicySnapShot(global::System.Collections.IDictionary content)
{
bool returnNow = false;
BeforeDeserializeDictionary(content, ref returnNow);
if (returnNow)
{
return;
}
// actually deserialize
((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190401.IManagementPolicySnapShotInternal)this).Delete = (Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190401.IDateAfterCreation) content.GetValueForProperty("Delete",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190401.IManagementPolicySnapShotInternal)this).Delete, Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190401.DateAfterCreationTypeConverter.ConvertFrom);
((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190401.IManagementPolicySnapShotInternal)this).DeleteDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("DeleteDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190401.IManagementPolicySnapShotInternal)this).DeleteDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float)));
AfterDeserializeDictionary(content);
}
/// <summary>
/// Deserializes a <see cref="global::System.Management.Automation.PSObject" /> into a new instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190401.ManagementPolicySnapShot"
/// />.
/// </summary>
/// <param name="content">The global::System.Management.Automation.PSObject content that should be used.</param>
internal ManagementPolicySnapShot(global::System.Management.Automation.PSObject content)
{
bool returnNow = false;
BeforeDeserializePSObject(content, ref returnNow);
if (returnNow)
{
return;
}
// actually deserialize
((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190401.IManagementPolicySnapShotInternal)this).Delete = (Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190401.IDateAfterCreation) content.GetValueForProperty("Delete",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190401.IManagementPolicySnapShotInternal)this).Delete, Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190401.DateAfterCreationTypeConverter.ConvertFrom);
((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190401.IManagementPolicySnapShotInternal)this).DeleteDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("DeleteDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190401.IManagementPolicySnapShotInternal)this).DeleteDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float)));
AfterDeserializePSObject(content);
}
/// <summary>Serializes this instance to a json string.</summary>
/// <returns>a <see cref="System.String" /> containing this model serialized to JSON text.</returns>
public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.SerializationMode.IncludeAll)?.ToString();
}
/// Management policy action for snapshot.
[System.ComponentModel.TypeConverter(typeof(ManagementPolicySnapShotTypeConverter))]
public partial interface IManagementPolicySnapShot
{
}
} | 70.421053 | 472 | 0.710976 | [
"MIT"
] | 3quanfeng/azure-powershell | src/Functions/generated/api/Models/Api20190401/ManagementPolicySnapShot.PowerShell.cs | 9,234 | C# |
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Globalization;
using Microsoft.EntityFrameworkCore.Internal;
namespace Microsoft.EntityFrameworkCore.Proxies.Internal;
/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public class ProxiesOptionsExtension : IDbContextOptionsExtension
{
private DbContextOptionsExtensionInfo? _info;
private bool _useLazyLoadingProxies;
private bool _useChangeTrackingProxies;
private bool _checkEquality;
/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public ProxiesOptionsExtension()
{
}
/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
protected ProxiesOptionsExtension(ProxiesOptionsExtension copyFrom)
{
_useLazyLoadingProxies = copyFrom._useLazyLoadingProxies;
_useChangeTrackingProxies = copyFrom._useChangeTrackingProxies;
_checkEquality = copyFrom._checkEquality;
}
/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public virtual DbContextOptionsExtensionInfo Info
=> _info ??= new ExtensionInfo(this);
/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
protected virtual ProxiesOptionsExtension Clone()
=> new(this);
/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public virtual bool UseLazyLoadingProxies
=> _useLazyLoadingProxies;
/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public virtual bool UseChangeTrackingProxies
=> _useChangeTrackingProxies;
/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public virtual bool CheckEquality
=> _checkEquality;
/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public virtual bool UseProxies
=> UseLazyLoadingProxies || UseChangeTrackingProxies;
/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public virtual ProxiesOptionsExtension WithLazyLoading(bool useLazyLoadingProxies = true)
{
var clone = Clone();
clone._useLazyLoadingProxies = useLazyLoadingProxies;
return clone;
}
/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public virtual ProxiesOptionsExtension WithChangeTracking(bool useChangeTrackingProxies = true, bool checkEquality = true)
{
var clone = Clone();
clone._useChangeTrackingProxies = useChangeTrackingProxies;
clone._checkEquality = checkEquality;
return clone;
}
/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public virtual void Validate(IDbContextOptions options)
{
if (UseProxies)
{
var internalServiceProvider = options.FindExtension<CoreOptionsExtension>()?.InternalServiceProvider;
if (internalServiceProvider != null)
{
using var scope = internalServiceProvider.CreateScope();
var conventionPlugins = scope.ServiceProvider.GetService<IEnumerable<IConventionSetPlugin>>();
if (conventionPlugins?.Any(s => s is ProxiesConventionSetPlugin) == false)
{
throw new InvalidOperationException(ProxiesStrings.ProxyServicesMissing);
}
}
}
}
/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public virtual void ApplyServices(IServiceCollection services)
=> services.AddEntityFrameworkProxies();
private sealed class ExtensionInfo : DbContextOptionsExtensionInfo
{
private string? _logFragment;
public ExtensionInfo(IDbContextOptionsExtension extension)
: base(extension)
{
}
private new ProxiesOptionsExtension Extension
=> (ProxiesOptionsExtension)base.Extension;
public override bool IsDatabaseProvider
=> false;
public override string LogFragment
=> _logFragment ??= Extension.UseLazyLoadingProxies && Extension.UseChangeTrackingProxies
? "using lazy loading and change tracking proxies "
: Extension.UseLazyLoadingProxies
? "using lazy loading proxies "
: Extension.UseChangeTrackingProxies
? "using change tracking proxies "
: "";
public override int GetServiceProviderHashCode()
{
var hashCode = new HashCode();
hashCode.Add(Extension.UseLazyLoadingProxies);
hashCode.Add(Extension.UseChangeTrackingProxies);
hashCode.Add(Extension.CheckEquality);
return hashCode.ToHashCode();
}
public override bool ShouldUseSameServiceProvider(DbContextOptionsExtensionInfo other)
=> other is ExtensionInfo otherInfo
&& Extension.UseLazyLoadingProxies == otherInfo.Extension.UseLazyLoadingProxies
&& Extension.UseChangeTrackingProxies == otherInfo.Extension.UseChangeTrackingProxies
&& Extension.CheckEquality == otherInfo.Extension.CheckEquality;
public override void PopulateDebugInfo(IDictionary<string, string> debugInfo)
{
debugInfo["Proxies:" + nameof(ProxiesExtensions.UseLazyLoadingProxies)]
= (Extension._useLazyLoadingProxies ? 541 : 0).ToString(CultureInfo.InvariantCulture);
debugInfo["Proxies:" + nameof(ProxiesExtensions.UseChangeTrackingProxies)]
= (Extension._useChangeTrackingProxies ? 541 : 0).ToString(CultureInfo.InvariantCulture);
}
}
}
| 51.938389 | 126 | 0.695775 | [
"MIT"
] | AraHaan/efcore | src/EFCore.Proxies/Proxies/Internal/ProxiesOptionsExtension.cs | 10,959 | C# |
using System;
namespace Framework.Projection
{
/// <summary>
/// Роль проекции
/// </summary>
public enum ProjectionRole
{
/// <summary>
/// Обычная проекция
/// </summary>
Default,
/// <summary>
/// Автоматически достраиваемая проекция (для переходов через ExpandPath)
/// </summary>
AutoNode,
/// <summary>
/// Проекция для безопасности
/// </summary>
SecurityNode
}
}
| 20.307692 | 82 | 0.486742 | [
"MIT"
] | Luxoft/BSSFramework | src/Framework.Projection/ProjectionRoleAttribute.cs | 606 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Bumpy.Core.Config
{
/// <summary>
/// A template is used to provide default parameters for a
/// <see cref="BumpyConfigEntry"/> instance for known file types.
/// </summary>
internal sealed class Template
{
private static readonly Dictionary<string, Template> Templates = new Dictionary<string, Template>()
{
{ ".csproj", new Template(@"<(?<marker>[Vv]ersion)>(?<version>\d+\.\d+\.\d+.*)<\/[Vv]ersion>", new UTF8Encoding(false)) },
{ ".nuspec", new Template(@"<(?<marker>[Vv]ersion)>(?<version>\d+\.\d+\.\d+.*)<\/[Vv]ersion>", new UTF8Encoding(false)) },
{ "AssemblyInfo.cs", new Template(@"(?<marker>Assembly(File)?Version).*(?<version>\d+\.\d+\.\d+\.\d+)", new UTF8Encoding(true)) },
{ ".cs", new Template("(?<tag>(FILEVERSION|PRODUCTVERSION|FileVersion|ProductVersion))[\", ]*(?<version>\\d+[\\.,]\\d+[\\.,]\\d+[\\.,]\\d+)", Encoding.GetEncoding(1200)) }
};
private Template(string regularExpression, Encoding encoding)
{
Regex = regularExpression;
Encoding = encoding;
}
/// <summary>
/// Gets the regular expression.
/// </summary>
public string Regex { get; }
/// <summary>
/// Gets the encoding.
/// </summary>
public Encoding Encoding { get; }
/// <summary>
/// Tries to find a template based on the input text.
/// </summary>
/// <param name="text">The given text</param>
/// <param name="template">A template if one is registered for the given text</param>
/// <returns>True if a template was found, else false</returns>
public static bool TryFindTemplate(string text, out Template template)
{
var matches = Templates.Where(t => text.EndsWith(t.Key, StringComparison.OrdinalIgnoreCase)).ToList();
template = null;
if (matches.Any())
{
template = matches[0].Value;
return true;
}
return false;
}
}
}
| 37.305085 | 183 | 0.558383 | [
"MIT"
] | fwinkelbauer/Bumpy | Source/Bumpy.Core/Config/Template.cs | 2,203 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using ninja.model.Entity;
using ninja.model.Manager;
namespace ninja.test {
[TestClass]
public class TestInvoice {
[TestMethod]
public void InsertNewInvoice() {
InvoiceManager manager = new InvoiceManager();
long id = 1006;
Invoice invoice = new Invoice() {
Id = id,
Type = Invoice.Types.A.ToString()
};
manager.Insert(invoice);
Invoice result = manager.GetById(id);
Assert.AreEqual(invoice, result);
}
[TestMethod]
public void InsertNewDetailInvoice() {
InvoiceManager manager = new InvoiceManager();
long id = 1006;
Invoice invoice = new Invoice() {
Id = id,
Type = Invoice.Types.A.ToString()
};
invoice.AddDetail(new InvoiceDetail() {
Id = id,
InvoiceId = id,
Description = "Venta insumos varios",
Amount = 14,
UnitPrice = 4.33
});
invoice.AddDetail(new InvoiceDetail() {
Id = id,
InvoiceId = 6,
Description = "Venta insumos tóner",
Amount = 5,
UnitPrice = 87
});
manager.Insert(invoice);
Invoice result = manager.GetById(id);
Assert.AreEqual(invoice, result);
}
[TestMethod]
public void DeleteInvoice() {
/*
1- Eliminar la factura con id=4
2- Comprobar de que la factura con id=4 ya no exista
3- La prueba tiene que mostrarse que se ejecuto correctamente
*/
long id = 4;
InvoiceManager manager = new InvoiceManager();
manager.Delete(id);
Assert.IsTrue(manager.Exists(id));
}
[TestMethod]
public void UpdateInvoiceDetail() {
long id = 1003;
InvoiceManager manager = new InvoiceManager();
IList<InvoiceDetail> detail = new List<InvoiceDetail>();
detail.Add(new InvoiceDetail() {
Id = 1,
InvoiceId = id,
Description = "Venta insumos varios",
Amount = 14,
UnitPrice = 4.33
});
detail.Add(new InvoiceDetail() {
Id = 2,
InvoiceId = id,
Description = "Venta insumos tóner",
Amount = 5,
UnitPrice = 87
});
manager.UpdateDetail(id, detail); // UpdateDetail method fixed
Invoice result = manager.GetById(id);
Assert.AreEqual(2, result.GetDetail().Count());
}
[TestMethod]
public void CalculateInvoiceTotalPriceWithTaxes() {
long id = 1005;
InvoiceManager manager = new InvoiceManager();
Invoice invoice = manager.GetById(id);
double sum = 0;
foreach(InvoiceDetail item in invoice.GetDetail())
sum += item.TotalPrice * item.Taxes;
Assert.AreEqual(sum, invoice.CalculateInvoiceTotalPriceWithTaxes());
}
}
} | 26.389313 | 80 | 0.51374 | [
"MIT"
] | nicolasdepaoli/apply-4-net-ninja | ninja.test/TestInvoice.cs | 3,461 | C# |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.Linq;
using System.Collections.Generic;
using Azure.ResourceManager.Resources.Models;
using Azure.ResourceManager.Cdn.Models;
using NUnit.Framework;
using Azure.Core;
namespace Azure.ResourceManager.Cdn.Tests.Helper
{
public static class ResourceDataHelper
{
public static ProfileData CreateProfileData(CdnSkuName skuName) => new ProfileData(AzureLocation.WestUS, new CdnSku { Name = skuName });
public static ProfileData CreateAfdProfileData(CdnSkuName skuName) => new ProfileData("Global", new CdnSku { Name = skuName });
public static CdnEndpointData CreateEndpointData() => new CdnEndpointData(AzureLocation.WestUS)
{
IsHttpAllowed = true,
IsHttpsAllowed = true,
OptimizationType = OptimizationType.GeneralWebDelivery
};
public static AfdEndpointData CreateAfdEndpointData() => new AfdEndpointData(AzureLocation.WestUS)
{
OriginResponseTimeoutSeconds = 60
};
public static DeepCreatedOrigin CreateDeepCreatedOrigin() => new DeepCreatedOrigin("testOrigin")
{
HostName = "testsa4dotnetsdk.blob.core.windows.net",
Priority = 3,
Weight = 100
};
public static DeepCreatedOriginGroup CreateDeepCreatedOriginGroup() => new DeepCreatedOriginGroup("testOriginGroup")
{
HealthProbeSettings = new HealthProbeParameters
{
ProbePath = "/healthz",
ProbeRequestType = HealthProbeRequestType.Head,
ProbeProtocol = ProbeProtocol.Https,
ProbeIntervalInSeconds = 60
}
};
public static CdnOriginData CreateOriginData() => new CdnOriginData
{
HostName = "testsa4dotnetsdk.blob.core.windows.net",
Priority = 1,
Weight = 150
};
public static AfdOriginData CreateAfdOriginData() => new AfdOriginData
{
HostName = "testsa4dotnetsdk.blob.core.windows.net"
};
public static CdnOriginGroupData CreateOriginGroupData() => new CdnOriginGroupData();
public static AfdOriginGroupData CreateAfdOriginGroupData() => new AfdOriginGroupData
{
HealthProbeSettings = new HealthProbeParameters
{
ProbePath = "/healthz",
ProbeRequestType = HealthProbeRequestType.Head,
ProbeProtocol = ProbeProtocol.Https,
ProbeIntervalInSeconds = 60
},
LoadBalancingSettings = new LoadBalancingSettingsParameters
{
SampleSize = 5,
SuccessfulSamplesRequired = 4,
AdditionalLatencyInMilliseconds = 200
}
};
public static CustomDomainOptions CreateCdnCustomDomainData(string hostName) => new CustomDomainOptions
{
HostName = hostName
};
public static AfdCustomDomainData CreateAfdCustomDomainData(string hostName) => new AfdCustomDomainData
{
HostName = hostName,
TlsSettings = new AfdCustomDomainHttpsParameters(AfdCertificateType.ManagedCertificate)
{
MinimumTlsVersion = AfdMinimumTlsVersion.TLS12
},
AzureDnsZone = new WritableSubResource
{
Id = new ResourceIdentifier("/subscriptions/f3d94233-a9aa-4241-ac82-2dfb63ce637a/resourceGroups/cdntest/providers/Microsoft.Network/dnszones/azuretest.net")
}
};
public static AfdRuleData CreateAfdRuleData() => new AfdRuleData
{
Order = 1
};
public static DeliveryRuleCondition CreateDeliveryRuleCondition() => new DeliveryRuleRequestUriCondition(new RequestUriMatchConditionParameters(RequestUriMatchConditionParametersOdataType.MicrosoftAzureCdnModelsDeliveryRuleRequestUriConditionParameters, RequestUriOperator.Any));
public static DeliveryRuleAction CreateDeliveryRuleOperation() => new DeliveryRuleCacheExpirationAction(new CacheExpirationActionParameters(CacheExpirationActionParametersOdataType.MicrosoftAzureCdnModelsDeliveryRuleCacheExpirationActionParameters, CacheBehavior.Override, CacheType.All)
{
CacheDuration = new TimeSpan(0, 0, 20)
});
public static DeliveryRuleAction UpdateDeliveryRuleOperation() => new DeliveryRuleCacheExpirationAction(new CacheExpirationActionParameters(CacheExpirationActionParametersOdataType.MicrosoftAzureCdnModelsDeliveryRuleCacheExpirationActionParameters, CacheBehavior.Override, CacheType.All)
{
CacheDuration = new TimeSpan(0, 0, 30)
});
public static AfdRouteData CreateAfdRouteData(AfdOriginGroup originGroup) => new AfdRouteData
{
OriginGroup = new WritableSubResource
{
Id = originGroup.Id
},
LinkToDefaultDomain = LinkToDefaultDomain.Enabled,
EnabledState = EnabledState.Enabled
};
public static AfdSecurityPolicyData CreateAfdSecurityPolicyData(AfdEndpoint endpoint) => new AfdSecurityPolicyData
{
Parameters = new SecurityPolicyWebApplicationFirewallParameters
{
WafPolicy = new WritableSubResource
{
Id = new ResourceIdentifier("/subscriptions/f3d94233-a9aa-4241-ac82-2dfb63ce637a/resourceGroups/CdnTest/providers/Microsoft.Network/frontdoorWebApplicationFirewallPolicies/testAFDWaf")
}
}
};
public static AfdSecretData CreateAfdSecretData() => new AfdSecretData
{
Parameters = new CustomerCertificateParameters(new WritableSubResource
{
Id = new ResourceIdentifier("/subscriptions/87082bb7-c39f-42d2-83b6-4980444c7397/resourceGroups/CdnTest/providers/Microsoft.KeyVault/vaults/testKV4AFD/certificates/testCert")
})
{
UseLatestVersion = true
}
};
public static CdnWebApplicationFirewallPolicyData CreateCdnWebApplicationFirewallPolicyData() => new CdnWebApplicationFirewallPolicyData("Global", new CdnSku
{
Name = CdnSkuName.StandardMicrosoft
});
public static void AssertValidProfile(Profile model, Profile getResult)
{
Assert.AreEqual(model.Data.Name, getResult.Data.Name);
Assert.AreEqual(model.Data.Id, getResult.Data.Id);
Assert.AreEqual(model.Data.Type, getResult.Data.Type);
Assert.AreEqual(model.Data.Sku.Name, getResult.Data.Sku.Name);
Assert.AreEqual(model.Data.ResourceState, getResult.Data.ResourceState);
Assert.AreEqual(model.Data.ProvisioningState, getResult.Data.ProvisioningState);
Assert.AreEqual(model.Data.FrontdoorId, getResult.Data.FrontdoorId);
}
public static void AssertProfileUpdate(Profile updatedProfile, string key, string value)
{
Assert.GreaterOrEqual(updatedProfile.Data.Tags.Count, 1);
Assert.IsTrue(updatedProfile.Data.Tags.ContainsKey(key));
Assert.AreEqual(updatedProfile.Data.Tags[key], value);
}
public static void AssertValidEndpoint(CdnEndpoint model, CdnEndpoint getResult)
{
Assert.AreEqual(model.Data.Name, getResult.Data.Name);
Assert.AreEqual(model.Data.Id, getResult.Data.Id);
Assert.AreEqual(model.Data.Type, getResult.Data.Type);
Assert.AreEqual(model.Data.OriginPath, getResult.Data.OriginPath);
Assert.AreEqual(model.Data.OriginHostHeader, getResult.Data.OriginHostHeader);
Assert.AreEqual(model.Data.IsCompressionEnabled, getResult.Data.IsCompressionEnabled);
Assert.AreEqual(model.Data.IsHttpAllowed, getResult.Data.IsHttpAllowed);
Assert.AreEqual(model.Data.IsHttpsAllowed, getResult.Data.IsHttpsAllowed);
Assert.AreEqual(model.Data.QueryStringCachingBehavior, getResult.Data.QueryStringCachingBehavior);
Assert.AreEqual(model.Data.OptimizationType, getResult.Data.OptimizationType);
Assert.AreEqual(model.Data.ProbePath, getResult.Data.ProbePath);
Assert.AreEqual(model.Data.HostName, getResult.Data.HostName);
Assert.AreEqual(model.Data.ResourceState, getResult.Data.ResourceState);
Assert.AreEqual(model.Data.ProvisioningState, getResult.Data.ProvisioningState);
//Todo: ContentTypesToCompress, GeoFilters, DefaultOriginGroup, UrlSigningKeys, DeliveryPolicy, WebApplicationFirewallPolicyLink, Origins, OriginGroups
}
public static void AssertEndpointUpdate(CdnEndpoint updatedEndpoint, PatchableCdnEndpointData updateOptions)
{
Assert.AreEqual(updatedEndpoint.Data.IsHttpAllowed, updateOptions.IsHttpAllowed);
Assert.AreEqual(updatedEndpoint.Data.OriginPath, updateOptions.OriginPath);
Assert.AreEqual(updatedEndpoint.Data.OriginHostHeader, updateOptions.OriginHostHeader);
}
public static void AssertValidAfdEndpoint(AfdEndpoint model, AfdEndpoint getResult)
{
Assert.AreEqual(model.Data.Name, getResult.Data.Name);
Assert.AreEqual(model.Data.Id, getResult.Data.Id);
Assert.AreEqual(model.Data.Type, getResult.Data.Type);
Assert.AreEqual(model.Data.OriginResponseTimeoutSeconds, getResult.Data.OriginResponseTimeoutSeconds);
Assert.AreEqual(model.Data.EnabledState, getResult.Data.EnabledState);
Assert.AreEqual(model.Data.ProvisioningState, getResult.Data.ProvisioningState);
Assert.AreEqual(model.Data.DeploymentStatus, getResult.Data.DeploymentStatus);
Assert.AreEqual(model.Data.HostName, getResult.Data.HostName);
}
public static void AssertAfdEndpointUpdate(AfdEndpoint updatedAfdEndpoint, PatchableAfdEndpointData updateOptions)
{
Assert.AreEqual(updatedAfdEndpoint.Data.OriginResponseTimeoutSeconds, updateOptions.OriginResponseTimeoutSeconds);
Assert.AreEqual(updatedAfdEndpoint.Data.Tags.Count, updateOptions.Tags.Count);
foreach (var kv in updatedAfdEndpoint.Data.Tags)
{
Assert.True(updateOptions.Tags.ContainsKey(kv.Key));
Assert.AreEqual(kv.Value, updateOptions.Tags[kv.Key]);
}
}
public static void AssertValidOrigin(CdnOrigin model, CdnOrigin getResult)
{
Assert.AreEqual(model.Data.Name, getResult.Data.Name);
Assert.AreEqual(model.Data.Id, getResult.Data.Id);
Assert.AreEqual(model.Data.Type, getResult.Data.Type);
Assert.AreEqual(model.Data.HostName, getResult.Data.HostName);
Assert.AreEqual(model.Data.HttpPort, getResult.Data.HttpPort);
Assert.AreEqual(model.Data.HttpsPort, getResult.Data.HttpsPort);
Assert.AreEqual(model.Data.OriginHostHeader, getResult.Data.OriginHostHeader);
Assert.AreEqual(model.Data.Priority, getResult.Data.Priority);
Assert.AreEqual(model.Data.Weight, getResult.Data.Weight);
Assert.AreEqual(model.Data.Enabled, getResult.Data.Enabled);
Assert.AreEqual(model.Data.PrivateLinkAlias, getResult.Data.PrivateLinkAlias);
Assert.AreEqual(model.Data.PrivateLinkResourceId, getResult.Data.PrivateLinkResourceId);
Assert.AreEqual(model.Data.PrivateLinkLocation, getResult.Data.PrivateLinkLocation);
Assert.AreEqual(model.Data.PrivateLinkApprovalMessage, getResult.Data.PrivateLinkApprovalMessage);
Assert.AreEqual(model.Data.ResourceState, getResult.Data.ResourceState);
Assert.AreEqual(model.Data.ProvisioningState, getResult.Data.ProvisioningState);
Assert.AreEqual(model.Data.PrivateEndpointStatus, getResult.Data.PrivateEndpointStatus);
}
public static void AssertOriginUpdate(CdnOrigin updatedOrigin, PatchableCdnOriginData updateOptions)
{
Assert.AreEqual(updatedOrigin.Data.HttpPort, updateOptions.HttpPort);
Assert.AreEqual(updatedOrigin.Data.HttpsPort, updateOptions.HttpsPort);
Assert.AreEqual(updatedOrigin.Data.Priority, updateOptions.Priority);
Assert.AreEqual(updatedOrigin.Data.Weight, updateOptions.Weight);
}
public static void AssertValidAfdOrigin(AfdOrigin model, AfdOrigin getResult)
{
Assert.AreEqual(model.Data.Name, getResult.Data.Name);
Assert.AreEqual(model.Data.Id, getResult.Data.Id);
Assert.AreEqual(model.Data.Type, getResult.Data.Type);
if (model.Data.AzureOrigin != null || getResult.Data.AzureOrigin != null)
{
Assert.NotNull(model.Data.AzureOrigin);
Assert.NotNull(getResult.Data.AzureOrigin);
Assert.AreEqual(model.Data.AzureOrigin.Id, getResult.Data.AzureOrigin.Id);
}
Assert.AreEqual(model.Data.HostName, getResult.Data.HostName);
Assert.AreEqual(model.Data.HttpPort, getResult.Data.HttpPort);
Assert.AreEqual(model.Data.HttpsPort, getResult.Data.HttpsPort);
Assert.AreEqual(model.Data.OriginHostHeader, getResult.Data.OriginHostHeader);
Assert.AreEqual(model.Data.Priority, getResult.Data.Priority);
Assert.AreEqual(model.Data.Weight, getResult.Data.Weight);
Assert.AreEqual(model.Data.EnabledState, getResult.Data.EnabledState);
Assert.AreEqual(model.Data.ProvisioningState, getResult.Data.ProvisioningState);
Assert.AreEqual(model.Data.DeploymentStatus, getResult.Data.DeploymentStatus);
//Todo:SharedPrivateLinkResource
}
public static void AssertAfdOriginUpdate(AfdOrigin updatedAfdOrigin, PatchableAfdOriginData updateOptions)
{
Assert.AreEqual(updatedAfdOrigin.Data.Priority, updateOptions.Priority);
Assert.AreEqual(updatedAfdOrigin.Data.Weight, updateOptions.Weight);
}
public static void AssertValidOriginGroup(CdnOriginGroup model, CdnOriginGroup getResult)
{
Assert.AreEqual(model.Data.Name, getResult.Data.Name);
Assert.AreEqual(model.Data.Id, getResult.Data.Id);
Assert.AreEqual(model.Data.Type, getResult.Data.Type);
if (model.Data.HealthProbeSettings != null || getResult.Data.HealthProbeSettings != null)
{
Assert.NotNull(model.Data.HealthProbeSettings);
Assert.NotNull(getResult.Data.HealthProbeSettings);
Assert.AreEqual(model.Data.HealthProbeSettings.ProbeIntervalInSeconds, getResult.Data.HealthProbeSettings.ProbeIntervalInSeconds);
Assert.AreEqual(model.Data.HealthProbeSettings.ProbePath, getResult.Data.HealthProbeSettings.ProbePath);
Assert.AreEqual(model.Data.HealthProbeSettings.ProbeProtocol, getResult.Data.HealthProbeSettings.ProbeProtocol);
Assert.AreEqual(model.Data.HealthProbeSettings.ProbeRequestType, getResult.Data.HealthProbeSettings.ProbeRequestType);
}
Assert.AreEqual(model.Data.Origins.Count, getResult.Data.Origins.Count);
for (int i = 0; i < model.Data.Origins.Count; ++i)
{
Assert.AreEqual(model.Data.Origins[i].Id, getResult.Data.Origins[i].Id);
}
Assert.AreEqual(model.Data.TrafficRestorationTimeToHealedOrNewEndpointsInMinutes, getResult.Data.TrafficRestorationTimeToHealedOrNewEndpointsInMinutes);
Assert.AreEqual(model.Data.ResourceState, getResult.Data.ResourceState);
Assert.AreEqual(model.Data.ProvisioningState, getResult.Data.ProvisioningState);
//Todo: ResponseBasedOriginErrorDetectionSettings
}
public static void AssertOriginGroupUpdate(CdnOriginGroup updatedOriginGroup, PatchableCdnOriginGroupData updateOptions)
{
Assert.AreEqual(updatedOriginGroup.Data.HealthProbeSettings.ProbePath, updateOptions.HealthProbeSettings.ProbePath);
Assert.AreEqual(updatedOriginGroup.Data.HealthProbeSettings.ProbeRequestType, updateOptions.HealthProbeSettings.ProbeRequestType);
Assert.AreEqual(updatedOriginGroup.Data.HealthProbeSettings.ProbeProtocol, updateOptions.HealthProbeSettings.ProbeProtocol);
Assert.AreEqual(updatedOriginGroup.Data.HealthProbeSettings.ProbeIntervalInSeconds, updateOptions.HealthProbeSettings.ProbeIntervalInSeconds);
}
public static void AssertValidAfdOriginGroup(AfdOriginGroup model, AfdOriginGroup getResult)
{
Assert.AreEqual(model.Data.Name, getResult.Data.Name);
Assert.AreEqual(model.Data.Id, getResult.Data.Id);
Assert.AreEqual(model.Data.Type, getResult.Data.Type);
if (model.Data.LoadBalancingSettings != null || getResult.Data.LoadBalancingSettings != null)
{
Assert.NotNull(model.Data.LoadBalancingSettings);
Assert.NotNull(getResult.Data.LoadBalancingSettings);
Assert.AreEqual(model.Data.LoadBalancingSettings.SampleSize, getResult.Data.LoadBalancingSettings.SampleSize);
Assert.AreEqual(model.Data.LoadBalancingSettings.SuccessfulSamplesRequired, getResult.Data.LoadBalancingSettings.SuccessfulSamplesRequired);
Assert.AreEqual(model.Data.LoadBalancingSettings.AdditionalLatencyInMilliseconds, getResult.Data.LoadBalancingSettings.AdditionalLatencyInMilliseconds);
}
if (model.Data.HealthProbeSettings != null || getResult.Data.HealthProbeSettings != null)
{
Assert.NotNull(model.Data.HealthProbeSettings);
Assert.NotNull(getResult.Data.HealthProbeSettings);
Assert.AreEqual(model.Data.HealthProbeSettings.ProbeIntervalInSeconds, getResult.Data.HealthProbeSettings.ProbeIntervalInSeconds);
Assert.AreEqual(model.Data.HealthProbeSettings.ProbePath, getResult.Data.HealthProbeSettings.ProbePath);
Assert.AreEqual(model.Data.HealthProbeSettings.ProbeProtocol, getResult.Data.HealthProbeSettings.ProbeProtocol);
Assert.AreEqual(model.Data.HealthProbeSettings.ProbeRequestType, getResult.Data.HealthProbeSettings.ProbeRequestType);
}
Assert.AreEqual(model.Data.TrafficRestorationTimeToHealedOrNewEndpointsInMinutes, getResult.Data.TrafficRestorationTimeToHealedOrNewEndpointsInMinutes);
Assert.AreEqual(model.Data.SessionAffinityState, getResult.Data.SessionAffinityState);
Assert.AreEqual(model.Data.ProvisioningState, getResult.Data.ProvisioningState);
Assert.AreEqual(model.Data.DeploymentStatus, getResult.Data.DeploymentStatus);
//Todo: ResponseBasedAfdOriginErrorDetectionSettings
}
public static void AssertAfdOriginGroupUpdate(AfdOriginGroup updatedAfdOriginGroup, PatchableAfdOriginGroupData updateOptions)
{
Assert.AreEqual(updatedAfdOriginGroup.Data.LoadBalancingSettings.SampleSize, updateOptions.LoadBalancingSettings.SampleSize);
Assert.AreEqual(updatedAfdOriginGroup.Data.LoadBalancingSettings.SuccessfulSamplesRequired, updateOptions.LoadBalancingSettings.SuccessfulSamplesRequired);
Assert.AreEqual(updatedAfdOriginGroup.Data.LoadBalancingSettings.AdditionalLatencyInMilliseconds, updateOptions.LoadBalancingSettings.AdditionalLatencyInMilliseconds);
}
public static void AssertValidCustomDomain(CdnCustomDomain model, CdnCustomDomain getResult)
{
Assert.AreEqual(model.Data.Name, getResult.Data.Name);
Assert.AreEqual(model.Data.Id, getResult.Data.Id);
Assert.AreEqual(model.Data.Type, getResult.Data.Type);
Assert.AreEqual(model.Data.HostName, getResult.Data.HostName);
Assert.AreEqual(model.Data.ResourceState, getResult.Data.ResourceState);
Assert.AreEqual(model.Data.CustomHttpsProvisioningState, getResult.Data.CustomHttpsProvisioningState);
Assert.AreEqual(model.Data.CustomHttpsProvisioningSubstate, getResult.Data.CustomHttpsProvisioningSubstate);
Assert.AreEqual(model.Data.ValidationData, getResult.Data.ValidationData);
Assert.AreEqual(model.Data.ProvisioningState, getResult.Data.ProvisioningState);
}
public static void AssertValidAfdCustomDomain(AfdCustomDomain model, AfdCustomDomain getResult)
{
Assert.AreEqual(model.Data.Name, getResult.Data.Name);
Assert.AreEqual(model.Data.Id, getResult.Data.Id);
Assert.AreEqual(model.Data.Type, getResult.Data.Type);
Assert.AreEqual(model.Data.TlsSettings.CertificateType, getResult.Data.TlsSettings.CertificateType);
Assert.AreEqual(model.Data.TlsSettings.MinimumTlsVersion, getResult.Data.TlsSettings.MinimumTlsVersion);
if (model.Data.TlsSettings.Secret != null || getResult.Data.TlsSettings.Secret != null)
{
Assert.NotNull(model.Data.TlsSettings.Secret);
Assert.NotNull(getResult.Data.TlsSettings.Secret);
Assert.AreEqual(model.Data.TlsSettings.Secret.Id, getResult.Data.TlsSettings.Secret.Id);
}
if (model.Data.AzureDnsZone != null || getResult.Data.AzureDnsZone != null)
{
Assert.NotNull(model.Data.AzureDnsZone);
Assert.NotNull(getResult.Data.AzureDnsZone);
Assert.AreEqual(model.Data.AzureDnsZone.Id, getResult.Data.AzureDnsZone.Id);
}
Assert.AreEqual(model.Data.ProvisioningState, getResult.Data.ProvisioningState);
Assert.AreEqual(model.Data.DeploymentStatus, getResult.Data.DeploymentStatus);
Assert.AreEqual(model.Data.DomainValidationState, getResult.Data.DomainValidationState);
Assert.AreEqual(model.Data.HostName, getResult.Data.HostName);
if (model.Data.ValidationProperties != null || getResult.Data.ValidationProperties != null)
{
Assert.NotNull(model.Data.ValidationProperties);
Assert.NotNull(getResult.Data.ValidationProperties);
Assert.AreEqual(model.Data.ValidationProperties.ValidationToken, getResult.Data.ValidationProperties.ValidationToken);
Assert.AreEqual(model.Data.ValidationProperties.ExpirationDate, getResult.Data.ValidationProperties.ExpirationDate);
}
}
public static void AssertAfdDomainUpdate(AfdCustomDomain updatedAfdDomain, PatchableAfdCustomDomainData updateOptions)
{
Assert.AreEqual(updatedAfdDomain.Data.TlsSettings.CertificateType, updateOptions.TlsSettings.CertificateType);
Assert.AreEqual(updatedAfdDomain.Data.TlsSettings.MinimumTlsVersion, updateOptions.TlsSettings.MinimumTlsVersion);
}
public static void AssertValidAfdRuleSet(AfdRuleSet model, AfdRuleSet getResult)
{
Assert.AreEqual(model.Data.Name, getResult.Data.Name);
Assert.AreEqual(model.Data.Id, getResult.Data.Id);
Assert.AreEqual(model.Data.Type, getResult.Data.Type);
Assert.AreEqual(model.Data.ProvisioningState, getResult.Data.ProvisioningState);
Assert.AreEqual(model.Data.DeploymentStatus, getResult.Data.DeploymentStatus);
}
public static void AssertValidAfdRule(AfdRule model, AfdRule getResult)
{
Assert.AreEqual(model.Data.Name, getResult.Data.Name);
Assert.AreEqual(model.Data.Id, getResult.Data.Id);
Assert.AreEqual(model.Data.Type, getResult.Data.Type);
Assert.AreEqual(model.Data.Order, getResult.Data.Order);
Assert.AreEqual(model.Data.Conditions.Count, getResult.Data.Conditions.Count);
for (int i = 0; i < model.Data.Conditions.Count; ++i)
{
Assert.AreEqual(model.Data.Conditions[i].Name, getResult.Data.Conditions[i].Name);
}
Assert.AreEqual(model.Data.Actions.Count, getResult.Data.Actions.Count);
for (int i = 0; i < model.Data.Actions.Count; ++i)
{
Assert.AreEqual(model.Data.Actions[i].Name, getResult.Data.Actions[i].Name);
}
Assert.AreEqual(model.Data.MatchProcessingBehavior, getResult.Data.MatchProcessingBehavior);
Assert.AreEqual(model.Data.ProvisioningState, getResult.Data.ProvisioningState);
Assert.AreEqual(model.Data.DeploymentStatus, getResult.Data.DeploymentStatus);
}
public static void AssertAfdRuleUpdate(AfdRule updatedRule, PatchableAfdRuleData updateOptions)
{
Assert.AreEqual(updatedRule.Data.Order, updateOptions.Order);
}
public static void AssertValidAfdRoute(AfdRoute model, AfdRoute getResult)
{
Assert.AreEqual(model.Data.Name, getResult.Data.Name);
Assert.AreEqual(model.Data.Id, getResult.Data.Id);
Assert.AreEqual(model.Data.Type, getResult.Data.Type);
Assert.AreEqual(model.Data.CustomDomains.Count, getResult.Data.CustomDomains.Count);
for (int i = 0; i < model.Data.CustomDomains.Count; ++i)
{
Assert.AreEqual(model.Data.CustomDomains[i].Id, getResult.Data.CustomDomains[i].Id);
}
Assert.AreEqual(model.Data.OriginGroup.Id, getResult.Data.OriginGroup.Id);
Assert.AreEqual(model.Data.OriginPath, getResult.Data.OriginPath);
Assert.AreEqual(model.Data.RuleSets.Count, getResult.Data.RuleSets.Count);
for (int i = 0; i < model.Data.RuleSets.Count; ++i)
{
Assert.AreEqual(model.Data.RuleSets[i].Id, getResult.Data.RuleSets[i].Id);
}
Assert.AreEqual(model.Data.SupportedProtocols.Count, getResult.Data.SupportedProtocols.Count);
for (int i = 0; i < model.Data.SupportedProtocols.Count; ++i)
{
Assert.AreEqual(model.Data.SupportedProtocols[i], getResult.Data.SupportedProtocols[i]);
}
Assert.AreEqual(model.Data.PatternsToMatch.Count, getResult.Data.PatternsToMatch.Count);
for (int i = 0; i < model.Data.PatternsToMatch.Count; ++i)
{
Assert.AreEqual(model.Data.PatternsToMatch[i], getResult.Data.PatternsToMatch[i]);
}
Assert.AreEqual(model.Data.QueryStringCachingBehavior, getResult.Data.QueryStringCachingBehavior);
Assert.AreEqual(model.Data.ForwardingProtocol, getResult.Data.ForwardingProtocol);
Assert.AreEqual(model.Data.LinkToDefaultDomain, getResult.Data.LinkToDefaultDomain);
Assert.AreEqual(model.Data.HttpsRedirect, getResult.Data.HttpsRedirect);
Assert.AreEqual(model.Data.EnabledState, getResult.Data.EnabledState);
Assert.AreEqual(model.Data.ProvisioningState, getResult.Data.ProvisioningState);
Assert.AreEqual(model.Data.DeploymentStatus, getResult.Data.DeploymentStatus);
}
public static void AssertAfdRouteUpdate(AfdRoute updatedRoute, PatchableAfdRouteData updateOptions)
{
Assert.AreEqual(updatedRoute.Data.EnabledState, updateOptions.EnabledState);
}
public static void AssertValidAfdSecurityPolicy(AfdSecurityPolicy model, AfdSecurityPolicy getResult)
{
Assert.AreEqual(model.Data.Name, getResult.Data.Name);
Assert.AreEqual(model.Data.Id, getResult.Data.Id);
Assert.AreEqual(model.Data.Type, getResult.Data.Type);
Assert.AreEqual(model.Data.ProvisioningState, getResult.Data.ProvisioningState);
Assert.AreEqual(model.Data.DeploymentStatus, getResult.Data.DeploymentStatus);
Assert.AreEqual(model.Data.Parameters.Type, getResult.Data.Parameters.Type);
}
public static void AssertAfdSecurityPolicyUpdate(AfdSecurityPolicy updatedSecurityPolicy, PatchableAfdSecurityPolicyData updateOptions)
{
Assert.AreEqual(((SecurityPolicyWebApplicationFirewallParameters)updatedSecurityPolicy.Data.Parameters).Associations.Count, 1);
Assert.AreEqual(((SecurityPolicyWebApplicationFirewallParameters)updatedSecurityPolicy.Data.Parameters).Associations[0].Domains.Count, 2);
}
public static void AssertValidPolicy(CdnWebApplicationFirewallPolicy model, CdnWebApplicationFirewallPolicy getResult)
{
Assert.AreEqual(model.Data.Name, getResult.Data.Name);
Assert.AreEqual(model.Data.Id, getResult.Data.Id);
Assert.AreEqual(model.Data.Type, getResult.Data.Type);
Assert.AreEqual(model.Data.Etag, getResult.Data.Etag);
Assert.AreEqual(model.Data.Sku.Name, getResult.Data.Sku.Name);
Assert.AreEqual(model.Data.ProvisioningState, getResult.Data.ProvisioningState);
Assert.AreEqual(model.Data.ResourceState, getResult.Data.ResourceState);
//Todo: PolicySettings, RateLimitRules, CustomRules, ManagedRules, EndpointLinks
}
public static void AssertPolicyUpdate(CdnWebApplicationFirewallPolicy updatedPolicy, string key, string value)
{
Assert.GreaterOrEqual(updatedPolicy.Data.Tags.Count, 1);
Assert.IsTrue(updatedPolicy.Data.Tags.ContainsKey(key));
Assert.AreEqual(updatedPolicy.Data.Tags[key], value);
}
public static void AssertValidAfdSecret(AfdSecret model, AfdSecret getResult)
{
Assert.AreEqual(model.Data.Name, getResult.Data.Name);
Assert.AreEqual(model.Data.Id, getResult.Data.Id);
Assert.AreEqual(model.Data.Type, getResult.Data.Type);
Assert.AreEqual(model.Data.ProvisioningState, getResult.Data.ProvisioningState);
Assert.AreEqual(model.Data.DeploymentStatus, getResult.Data.DeploymentStatus);
Assert.AreEqual(model.Data.Parameters.Type, getResult.Data.Parameters.Type);
Assert.AreEqual(((CustomerCertificateParameters)model.Data.Parameters).SecretVersion, ((CustomerCertificateParameters)getResult.Data.Parameters).SecretVersion);
Assert.AreEqual(((CustomerCertificateParameters)model.Data.Parameters).CertificateAuthority, ((CustomerCertificateParameters)getResult.Data.Parameters).CertificateAuthority);
Assert.AreEqual(((CustomerCertificateParameters)model.Data.Parameters).UseLatestVersion, ((CustomerCertificateParameters)getResult.Data.Parameters).UseLatestVersion);
Assert.AreEqual(((CustomerCertificateParameters)model.Data.Parameters).SecretSource.Id.ToString().ToLower(), ((CustomerCertificateParameters)getResult.Data.Parameters).SecretSource.Id.ToString().ToLower());
Assert.True(((CustomerCertificateParameters)model.Data.Parameters).SubjectAlternativeNames.SequenceEqual(((CustomerCertificateParameters)getResult.Data.Parameters).SubjectAlternativeNames));
}
}
}
| 59.655238 | 295 | 0.700884 | [
"MIT"
] | KurnakovMaksim/azure-sdk-for-net | sdk/cdn/Azure.ResourceManager.Cdn/tests/Helper/ResourceDataHelper.cs | 31,321 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.Web;
using System.Net.Http;
using System.Web.Http;
using System.Web.Http.Controllers;
using System.Web.Http.Metadata;
namespace DD4T.RestService.WebApi.Helpers
{
[AttributeUsage(AttributeTargets.Parameter, Inherited = false, AllowMultiple = false)]
public class ArrayParamAttribute : ParameterBindingAttribute
{
public override HttpParameterBinding GetBinding(HttpParameterDescriptor paramDesc)
{
return new ArrayParamBinding(paramDesc);
}
}
public class ArrayParamBinding : HttpParameterBinding
{
public ArrayParamBinding(HttpParameterDescriptor paramDesc) : base(paramDesc) { }
public override bool WillReadBody
{
get
{
return false;
}
}
public override Task ExecuteBindingAsync(ModelMetadataProvider metadataProvider, HttpActionContext actionContext,
CancellationToken cancellationToken)
{
//TODO: VALIDATION & ERROR CHECKS
string idsAsString = actionContext.Request.GetRouteData().Values["ids"].ToString();
idsAsString = idsAsString.Trim('[', ']');
IEnumerable<string> ids = idsAsString.Split(',');
ids = ids.Where(str => !string.IsNullOrEmpty(str));
IEnumerable<int> idList = ids.Select(strId =>
{
if (string.IsNullOrEmpty(strId)) return -1;
return Convert.ToInt32(strId);
}).ToArray();
SetValue(actionContext, idList);
TaskCompletionSource<object> tcs = new TaskCompletionSource<object>();
tcs.SetResult(null);
return tcs.Task;
}
}
} | 30.142857 | 121 | 0.620853 | [
"Apache-2.0"
] | dd4t/DD4T.RestService | source/DD4T.RestService.WebApi/Helpers/CustomParamBinder.cs | 1,901 | C# |
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Text.RegularExpressions;
public class CellBiomeTraitPresenceCondition : CellCondition
{
public const float DefaultMinValue = 0.01f;
public const string Regex = @"^\s*cell_biome_trait_presence\s*" +
@":\s*(?<trait>" + ModUtility.IdentifierRegexPart + @")\s*" +
@"(?:,\s*(?<value>" + ModUtility.NumberRegexPart + @")\s*)?$";
public string Trait;
public float MinValue;
public CellBiomeTraitPresenceCondition(Match match)
{
Trait = match.Groups["trait"].Value;
if (!string.IsNullOrEmpty(match.Groups["value"].Value))
{
string valueStr = match.Groups["value"].Value;
if (!MathUtility.TryParseCultureInvariant(valueStr, out MinValue))
{
throw new System.ArgumentException("CellBiomeTraitPresenceCondition: Min value can't be parsed into a valid floating point number: " + valueStr);
}
if (!MinValue.IsInsideRange(DefaultMinValue, CulturalKnowledge.ScaledMaxLimitValue))
{
throw new System.ArgumentException("CellBiomeTraitPresenceCondition: Min value is outside the range of " + DefaultMinValue + " and 1: " + valueStr);
}
}
else
{
MinValue = DefaultMinValue;
}
}
public override bool Evaluate(TerrainCell cell)
{
return cell.GetBiomeTraitPresence(Trait) >= MinValue;
}
public override string GetPropertyValue(string propertyId)
{
return null;
}
public override string ToString()
{
return "'Cell Biome Trait Presence' Condition, Trait: " + Trait + ", Min Value: " + MinValue;
}
}
| 31.535714 | 164 | 0.6359 | [
"MIT"
] | Zematus/Worlds | Assets/Scripts/WorldEngine/Modding/Conditions/CellBiomeTraitPresenceCondition.cs | 1,768 | 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 TimekeeperWPF
{
/// <summary>
/// Interaction logic for DemoView.xaml
/// </summary>
public partial class DemoView : UserControl
{
public DemoView()
{
InitializeComponent();
}
}
}
| 21.862069 | 47 | 0.714511 | [
"MIT"
] | NuCode1497/TimekeeperWPF | TimekeeperWPF/Examples/DemoView.xaml.cs | 636 | C# |
//
// Xamarin.Android SDK
//
// The MIT License (MIT)
//
// Copyright (c) .NET Foundation Contributors
//
// All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Android.OS;
using Android.Runtime;
using Java.IO;
using Java.Net;
using Java.Security;
using Java.Security.Cert;
using Javax.Net.Ssl;
using Xamarin.Android.Net;
namespace Xamarin.PinningAppDemo.Droid.Services.AndroidClientHandler
{
/// <summary>
/// A custom implementation of <see cref="System.Net.Http.HttpClientHandler"/> which internally uses <see cref="Java.Net.HttpURLConnection"/>
/// (or its HTTPS incarnation) to send HTTP requests.
/// </summary>
/// <remarks>
/// <para>Instance of this class is used to configure <see cref="System.Net.Http.HttpClient"/> instance
/// in the following way:
///
/// <example>
/// var handler = new AndroidClientHandler {
/// UseCookies = true,
/// AutomaticDecompression = DecompressionMethods.Deflate | DecompressionMethods.GZip,
/// };
///
/// var httpClient = new HttpClient (handler);
/// var response = httpClient.GetAsync ("http://example.com")?.Result as AndroidHttpResponseMessage;
/// </example></para>
/// <para>
/// The class supports pre-authentication of requests albeit in a slightly "manual" way. Namely, whenever a request to a server requiring authentication
/// is made and no authentication credentials are provided in the <see cref="PreAuthenticationData"/> property (which is usually the case on the first
/// request), the <see cref="RequestNeedsAuthorization"/> property will return <c>true</c> and the <see cref="RequestedAuthentication"/> property will
/// contain all the authentication information gathered from the server. The application must then fill in the blanks (i.e. the credentials) and re-send
/// the request configured to perform pre-authentication. The reason for this manual process is that the underlying Java HTTP client API supports only a
/// single, VM-wide, authentication handler which cannot be configured to handle credentials for several requests. AndroidClientHandler, therefore, implements
/// the authentication in managed .NET code. Message handler supports both Basic and Digest authentication. If an authentication scheme that's not supported
/// by AndroidClientHandler is requested by the server, the application can provide its own authentication module (<see cref="AuthenticationData"/>,
/// <see cref="PreAuthenticationData"/>) to handle the protocol authorization.</para>
/// <para>AndroidClientHandler also supports requests to servers with "invalid" (e.g. self-signed) SSL certificates. Since this process is a bit convoluted using
/// the Java APIs, AndroidClientHandler defines two ways to handle the situation. First, easier, is to store the necessary certificates (either CA or server certificates)
/// in the <see cref="TrustedCerts"/> collection or, after deriving a custom class from AndroidClientHandler, by overriding one or more methods provided for this purpose
/// (<see cref="ConfigureTrustManagerFactory"/>, <see cref="ConfigureKeyManagerFactory"/> and <see cref="ConfigureKeyStore"/>). The former method should be sufficient
/// for most use cases, the latter allows the application to provide fully customized key store, trust manager and key manager, if needed. Note that the instance of
/// AndroidClientHandler configured to accept an "invalid" certificate from the particular server will most likely fail to validate certificates from other servers (even
/// if they use a certificate with a fully validated trust chain) unless you store the CA certificates from your Android system in <see cref="TrustedCerts"/> along with
/// the self-signed certificate(s).</para>
/// </remarks>
public class AndroidClientHandler : HttpClientHandler
{
sealed class RequestRedirectionState
{
public Uri NewUrl;
public int RedirectCounter;
public HttpMethod Method;
public bool MethodChanged;
}
internal const string LOG_APP = "monodroid-net";
const string GZIP_ENCODING = "gzip";
const string DEFLATE_ENCODING = "deflate";
const string IDENTITY_ENCODING = "identity";
static readonly IDictionary<string, string> headerSeparators = new Dictionary<string, string> {
["User-Agent"] = " ",
};
static readonly HashSet <string> known_content_headers = new HashSet <string> (StringComparer.OrdinalIgnoreCase) {
"Allow",
"Content-Disposition",
"Content-Encoding",
"Content-Language",
"Content-Length",
"Content-Location",
"Content-MD5",
"Content-Range",
"Content-Type",
"Expires",
"Last-Modified"
};
static readonly List <IAndroidAuthenticationModule> authModules = new List <IAndroidAuthenticationModule> {
new AuthModuleBasic (),
new AuthModuleDigest ()
};
bool disposed;
// Now all hail Java developers! Get this... HttpURLClient defaults to accepting AND
// uncompressing the gzip content encoding UNLESS you set the Accept-Encoding header to ANY
// value. So if we set it to 'gzip' below we WILL get gzipped stream but HttpURLClient will NOT
// uncompress it any longer, doh. And they don't support 'deflate' so we need to handle it ourselves.
bool decompress_here;
/// <summary>
/// <para>
/// Gets or sets the pre authentication data for the request. This property must be set by the application
/// before the request is made. Generally the value can be taken from <see cref="RequestedAuthentication"/>
/// after the initial request, without any authentication data, receives the authorization request from the
/// server. The application must then store credentials in instance of <see cref="AuthenticationData"/> and
/// assign the instance to this propery before retrying the request.
/// </para>
/// <para>
/// The property is never set by AndroidClientHandler.
/// </para>
/// </summary>
/// <value>The pre authentication data.</value>
public AuthenticationData PreAuthenticationData { get; set; }
/// <summary>
/// If the website requires authentication, this property will contain data about each scheme supported
/// by the server after the response. Note that unauthorized request will return a valid response - you
/// need to check the status code and and (re)configure AndroidClientHandler instance accordingly by providing
/// both the credentials and the authentication scheme by setting the <see cref="PreAuthenticationData"/>
/// property. If AndroidClientHandler is not able to detect the kind of authentication scheme it will store an
/// instance of <see cref="AuthenticationData"/> with its <see cref="AuthenticationData.Scheme"/> property
/// set to <c>AuthenticationScheme.Unsupported</c> and the application will be responsible for providing an
/// instance of <see cref="IAndroidAuthenticationModule"/> which handles this kind of authorization scheme
/// (<see cref="AuthenticationData.AuthModule"/>
/// </summary>
public IList <AuthenticationData> RequestedAuthentication { get; private set; }
/// <summary>
/// Server authentication response indicates that the request to authorize comes from a proxy if this property is <c>true</c>.
/// All the instances of <see cref="AuthenticationData"/> stored in the <see cref="RequestedAuthentication"/> property will
/// have their <see cref="AuthenticationData.UseProxyAuthentication"/> preset to the same value as this property.
/// </summary>
public bool ProxyAuthenticationRequested { get; private set; }
/// <summary>
/// If <c>true</c> then the server requested authorization and the application must use information
/// found in <see cref="RequestedAuthentication"/> to set the value of <see cref="PreAuthenticationData"/>
/// </summary>
public bool RequestNeedsAuthorization {
get { return RequestedAuthentication?.Count > 0; }
}
/// <summary>
/// <para>
/// If the request is to the server protected with a self-signed (or otherwise untrusted) SSL certificate, the request will
/// fail security chain verification unless the application provides either the CA certificate of the entity which issued the
/// server's certificate or, alternatively, provides the server public key. Whichever the case, the certificate(s) must be stored
/// in this property in order for AndroidClientHandler to configure the request to accept the server certificate.</para>
/// <para>AndroidClientHandler uses a custom <see cref="KeyStore"/> and <see cref="TrustManagerFactory"/> to configure the connection.
/// If, however, the application requires finer control over the SSL configuration (e.g. it implements its own TrustManager) then
/// it should leave this property empty and instead derive a custom class from AndroidClientHandler and override, as needed, the
/// <see cref="ConfigureTrustManagerFactory"/>, <see cref="ConfigureKeyManagerFactory"/> and <see cref="ConfigureKeyStore"/> methods
/// instead</para>
/// </summary>
/// <value>The trusted certs.</value>
public IList <Certificate> TrustedCerts { get; set; }
/// <summary>
/// <para>
/// Specifies the connection read timeout.
/// </para>
/// <para>
/// Since there's no way for the handler to access <see cref="t:System.Net.Http.HttpClient.Timeout"/>
/// directly, this property should be set by the calling party to the same desired value. Value of this
/// property will be passed to the native Java HTTP client, unless it is set to <see
/// cref="t:System.TimeSpan.Zero"/>
/// </para>
/// <para>
/// The default value is <c>100</c> seconds, the same as the documented value of <see
/// cref="t:System.Net.Http.HttpClient.Timeout"/>
/// </para>
/// </summary>
public TimeSpan ReadTimeout { get; set; } = TimeSpan.FromSeconds (100);
/// <summary>
/// <para>
/// Specifies the connect timeout
/// </para>
/// <para>
/// The native Java client supports two separate timeouts - one for reading from the connection (<see
/// cref="ReadTimeout"/>) and another for establishing the connection. This property sets the value of
/// the latter timeout, unless it is set to <see cref="t:System.TimeSpan.Zero"/> in which case the
/// native Java client defaults are used.
/// </para>
/// <para>
/// The default value is <c>120</c> seconds.
/// </para>
/// </summary>
public TimeSpan ConnectTimeout { get; set; } = TimeSpan.FromSeconds (120);
protected override void Dispose (bool disposing)
{
disposed = true;
base.Dispose (disposing);
}
protected void AssertSelf ()
{
if (!disposed)
return;
throw new ObjectDisposedException (nameof (AndroidClientHandler));
}
string EncodeUrl (Uri url)
{
if (url == null)
return String.Empty;
// UriBuilder takes care of encoding everything properly
var bldr = new UriBuilder (url);
if (url.IsDefaultPort)
bldr.Port = -1; // Avoids adding :80 or :443 to the host name in the result
// bldr.Uri.ToString () would ruin the good job UriBuilder did
return bldr.ToString ();
}
/// <summary>
/// Returns a custom host name verifier for a HTTPS connection. By default it returns <c>null</c> and
/// thus the connection uses whatever host name verification mechanism the operating system defaults to.
/// Override in your class to define custom host name verification behavior. The overriding class should
/// not set the <see cref="m:HttpsURLConnection.HostnameVerifier"/> property directly on the passed
/// <paramref name="connection"/>
/// </summary>
/// <returns>Instance of IHostnameVerifier to be used for this HTTPS connection</returns>
/// <param name="connection">HTTPS connection object.</param>
protected virtual IHostnameVerifier GetSSLHostnameVerifier (HttpsURLConnection connection)
{
return null;
}
/// <summary>
/// Creates, configures and processes an asynchronous request to the indicated resource.
/// </summary>
/// <returns>Task in which the request is executed</returns>
/// <param name="request">Request provided by <see cref="System.Net.Http.HttpClient"/></param>
/// <param name="cancellationToken">Cancellation token.</param>
protected override async Task <HttpResponseMessage> SendAsync (HttpRequestMessage request, CancellationToken cancellationToken)
{
AssertSelf ();
if (request == null)
throw new ArgumentNullException (nameof (request));
if (!request.RequestUri.IsAbsoluteUri)
throw new ArgumentException ("Must represent an absolute URI", "request");
var redirectState = new RequestRedirectionState {
NewUrl = request.RequestUri,
RedirectCounter = 0,
Method = request.Method
};
while (true) {
URL java_url = new URL (EncodeUrl (redirectState.NewUrl));
URLConnection java_connection;
if (UseProxy)
java_connection = java_url.OpenConnection (await GetJavaProxy (redirectState.NewUrl, cancellationToken));
else
java_connection = java_url.OpenConnection (Java.Net.Proxy.NoProxy);
var httpsConnection = java_connection as HttpsURLConnection;
if (httpsConnection != null) {
IHostnameVerifier hnv = GetSSLHostnameVerifier (httpsConnection);
if (hnv != null)
httpsConnection.HostnameVerifier = hnv;
}
if (ConnectTimeout != TimeSpan.Zero)
java_connection.ConnectTimeout = checked ((int)ConnectTimeout.TotalMilliseconds);
if (ReadTimeout != TimeSpan.Zero)
java_connection.ReadTimeout = checked ((int)ReadTimeout.TotalMilliseconds);
HttpURLConnection httpConnection = await SetupRequestInternal (request, java_connection).ConfigureAwait (continueOnCapturedContext: false);;
HttpResponseMessage response = await ProcessRequest (request, java_url, httpConnection, cancellationToken, redirectState).ConfigureAwait (continueOnCapturedContext: false);;
if (response != null)
return response;
if (redirectState.NewUrl == null)
throw new InvalidOperationException ("Request redirected but no new URI specified");
request.Method = redirectState.Method;
}
}
protected virtual async Task <Java.Net.Proxy> GetJavaProxy (Uri destination, CancellationToken cancellationToken)
{
Java.Net.Proxy proxy = Java.Net.Proxy.NoProxy;
if (destination == null || Proxy == null) {
goto done;
}
Uri puri = Proxy.GetProxy (destination);
if (puri == null) {
goto done;
}
proxy = await Task <Java.Net.Proxy>.Run (() => {
// Let the Java code resolve the address, if necessary
var addr = new Java.Net.InetSocketAddress (puri.Host, puri.Port);
return new Java.Net.Proxy (Java.Net.Proxy.Type.Http, addr);
}, cancellationToken);
done:
return proxy;
}
Task <HttpResponseMessage> ProcessRequest (HttpRequestMessage request, URL javaUrl, HttpURLConnection httpConnection, CancellationToken cancellationToken, RequestRedirectionState redirectState)
{
cancellationToken.ThrowIfCancellationRequested ();
httpConnection.InstanceFollowRedirects = false; // We handle it ourselves
RequestedAuthentication = null;
ProxyAuthenticationRequested = false;
return DoProcessRequest (request, javaUrl, httpConnection, cancellationToken, redirectState);
}
Task DisconnectAsync (HttpURLConnection httpConnection)
{
return Task.Run (() => httpConnection?.Disconnect ());
}
Task ConnectAsync (HttpURLConnection httpConnection, CancellationToken ct)
{
return Task.Run (async () => {
try {
using (ct.Register(() =>
DisconnectAsync(httpConnection).ContinueWith(t => { }, TaskScheduler.Default)))
{
httpConnection?.Connect();
// <MODIFICATION FROM ORIGINAL>
// add a callback to allow pinning validation to happen immediately after the HttpURLConnection.Connect()
await OnAfterConnectAsync(httpConnection, ct);
// </MODIFICATION FROM ORIGINAL>
}
} catch {
ct.ThrowIfCancellationRequested ();
throw;
}
}, ct);
}
// <MODIFICATION FROM ORIGINAL>
// add a callback to allow pinning validation to happen immediately after the HttpURLConnection.Connect()
protected virtual Task OnAfterConnectAsync(HttpURLConnection httpConnection, CancellationToken ct)
{
return Task.CompletedTask;
}
// </MODIFICATION FROM ORIGINAL>
protected virtual async Task WriteRequestContentToOutput (HttpRequestMessage request, HttpURLConnection httpConnection, CancellationToken cancellationToken)
{
using (var stream = await request.Content.ReadAsStreamAsync ().ConfigureAwait (false)) {
await stream.CopyToAsync(httpConnection.OutputStream, 4096, cancellationToken).ConfigureAwait(false);
//
// Rewind the stream to beginning in case the HttpContent implementation
// will be accessed again (e.g. after redirect) and it keeps its stream
// open behind the scenes instead of recreating it on the next call to
// ReadAsStreamAsync. If we don't rewind it, the ReadAsStreamAsync
// call above will throw an exception as we'd be attempting to read an
// already "closed" stream (that is one whose Position is set to its
// end).
//
// This is not a perfect solution since the HttpContent may do weird
// things in its implementation, but it's better than copying the
// content into a buffer since we have no way of knowing how the data is
// read or generated and also we don't want to keep potentially large
// amounts of data in memory (which would happen if we read the content
// into a byte[] buffer and kept it cached for re-use on redirect).
//
// See https://bugzilla.xamarin.com/show_bug.cgi?id=55477
//
if (stream.CanSeek)
stream.Seek (0, SeekOrigin.Begin);
}
}
async Task <HttpResponseMessage> DoProcessRequest (HttpRequestMessage request, URL javaUrl, HttpURLConnection httpConnection, CancellationToken cancellationToken, RequestRedirectionState redirectState)
{
if (cancellationToken.IsCancellationRequested) {
cancellationToken.ThrowIfCancellationRequested ();
}
try {
await ConnectAsync (httpConnection, cancellationToken).ConfigureAwait (continueOnCapturedContext: false);
} catch (Java.Net.ConnectException ex) {
// Wrap it nicely in a "standard" exception so that it's compatible with HttpClientHandler
throw new WebException (ex.Message, ex, WebExceptionStatus.ConnectFailure, null);
}
if (cancellationToken.IsCancellationRequested) {
await DisconnectAsync (httpConnection).ConfigureAwait (continueOnCapturedContext: false);
cancellationToken.ThrowIfCancellationRequested ();
}
CancellationTokenRegistration cancelRegistration = default (CancellationTokenRegistration);
HttpStatusCode statusCode = HttpStatusCode.OK;
Uri connectionUri = null;
try {
cancelRegistration = cancellationToken.Register (() => {
DisconnectAsync (httpConnection).ContinueWith (t => {
}, TaskScheduler.Default);
}, useSynchronizationContext: false);
if (httpConnection.DoOutput)
await WriteRequestContentToOutput (request, httpConnection, cancellationToken);
statusCode = await Task.Run (() => (HttpStatusCode)httpConnection.ResponseCode).ConfigureAwait (false);
connectionUri = new Uri (httpConnection.URL.ToString ());
} finally {
cancelRegistration.Dispose ();
}
if (cancellationToken.IsCancellationRequested) {
await DisconnectAsync (httpConnection).ConfigureAwait (continueOnCapturedContext: false);
cancellationToken.ThrowIfCancellationRequested();
}
// If the request was redirected we need to put the new URL in the request
request.RequestUri = connectionUri;
var ret = new AndroidHttpResponseMessageEx (javaUrl, httpConnection) {
RequestMessage = request,
ReasonPhrase = httpConnection.ResponseMessage,
StatusCode = statusCode,
};
if (!IsErrorStatusCode (statusCode)) {
ret.Content = GetContent (httpConnection, httpConnection.InputStream);
}
else {
// For 400 >= response code <= 599 the Java client throws the FileNotFound exception when attempting to read from the input stream.
// Instead we try to read the error stream and return an empty string if the error stream isn't readable.
ret.Content = GetErrorContent (httpConnection, new StringContent (String.Empty, Encoding.ASCII));
}
bool disposeRet;
if (HandleRedirect (statusCode, httpConnection, redirectState, out disposeRet)) {
if (redirectState.MethodChanged) {
// If a redirect uses GET but the original request used POST with content, then the redirected
// request will fail with an exception.
// There's also no way to send content using GET (except in the URL, of course), so discarding
// request.Content is what we should do.
//
// See https://github.com/xamarin/xamarin-android/issues/1282
if (redirectState.Method == HttpMethod.Get) {
request.Content = null;
}
}
if (disposeRet) {
ret.Dispose ();
ret = null;
} else {
CopyHeaders (httpConnection, ret);
ParseCookies (ret, connectionUri);
}
// We don't want to pass the authorization header onto the next location
request.Headers.Authorization = null;
return ret;
}
switch (statusCode) {
case HttpStatusCode.Unauthorized:
case HttpStatusCode.ProxyAuthenticationRequired:
// We don't resend the request since that would require new set of credentials if the
// ones provided in Credentials are invalid (or null) and that, in turn, may require asking the
// user which is not something that should be taken care of by us and in this
// context. The application should be responsible for this.
// HttpClientHandler throws an exception in this instance, but I think it's not a good
// idea. We'll return the response message with all the information required by the
// application to fill in the blanks and provide the requested credentials instead.
//
// We return the body of the response too, but the Java client will throw
// a FileNotFound exception if we attempt to access the input stream.
// Instead we try to read the error stream and return an default message if the error stream isn't readable.
ret.Content = GetErrorContent (httpConnection, new StringContent ("Unauthorized", Encoding.ASCII));
CopyHeaders (httpConnection, ret);
if (ret.Headers.WwwAuthenticate != null) {
ProxyAuthenticationRequested = false;
CollectAuthInfo (ret.Headers.WwwAuthenticate);
} else if (ret.Headers.ProxyAuthenticate != null) {
ProxyAuthenticationRequested = true;
CollectAuthInfo (ret.Headers.ProxyAuthenticate);
}
ret.RequestedAuthentication = RequestedAuthentication;
return ret;
}
CopyHeaders (httpConnection, ret);
ParseCookies (ret, connectionUri);
return ret;
}
HttpContent GetErrorContent (HttpURLConnection httpConnection, HttpContent fallbackContent)
{
var contentStream = httpConnection.ErrorStream;
if (contentStream != null) {
return GetContent (httpConnection, contentStream);
}
return fallbackContent;
}
HttpContent GetContent (URLConnection httpConnection, Stream contentStream)
{
Stream inputStream = new BufferedStream (contentStream);
if (decompress_here) {
string[] encodings = httpConnection.ContentEncoding?.Split (',');
if (encodings != null) {
if (encodings.Contains (GZIP_ENCODING, StringComparer.OrdinalIgnoreCase))
inputStream = new GZipStream (inputStream, CompressionMode.Decompress);
else if (encodings.Contains (DEFLATE_ENCODING, StringComparer.OrdinalIgnoreCase))
inputStream = new DeflateStream (inputStream, CompressionMode.Decompress);
}
}
return new StreamContent (inputStream);
}
bool HandleRedirect (HttpStatusCode redirectCode, HttpURLConnection httpConnection, RequestRedirectionState redirectState, out bool disposeRet)
{
if (!AllowAutoRedirect) {
disposeRet = false;
return true; // We shouldn't follow and there's no data to fetch, just return
}
disposeRet = true;
redirectState.NewUrl = null;
redirectState.MethodChanged = false;
switch (redirectCode) {
case HttpStatusCode.MultipleChoices: // 300
break;
case HttpStatusCode.Moved: // 301
case HttpStatusCode.Redirect: // 302
case HttpStatusCode.SeeOther: // 303
redirectState.MethodChanged = redirectState.Method != HttpMethod.Get;
redirectState.Method = HttpMethod.Get;
break;
case HttpStatusCode.NotModified: // 304
disposeRet = false;
return true; // Not much happening here, just return and let the client decide
// what to do with the response
case HttpStatusCode.TemporaryRedirect: // 307
break;
default:
if ((int)redirectCode >= 300 && (int)redirectCode < 400)
throw new InvalidOperationException ($"HTTP Redirection status code {redirectCode} ({(int)redirectCode}) not supported");
return false;
}
IDictionary <string, IList <string>> headers = httpConnection.HeaderFields;
IList <string> locationHeader;
string location = null;
if (headers.TryGetValue ("Location", out locationHeader) && locationHeader != null && locationHeader.Count > 0) {
if (locationHeader.Count == 1) {
location = locationHeader [0]?.Trim ();
} else {
foreach (string l in locationHeader) {
location = l?.Trim ();
if (!String.IsNullOrEmpty (location))
break;
}
}
}
if (String.IsNullOrEmpty (location)) {
// As per https://tools.ietf.org/html/rfc7231#section-6.4.1 the reponse isn't required to contain the Location header and the
// client should act accordingly. Since it is not documented what the action in this case should be, we're following what
// Xamarin.iOS does and simply return the content of the request as if it wasn't a redirect.
// It is not clear what to do if there is a Location header but its value is empty, so
// we assume the same action here.
disposeRet = false;
return true;
}
redirectState.RedirectCounter++;
if (redirectState.RedirectCounter >= MaxAutomaticRedirections)
throw new WebException ($"Maximum automatic redirections exceeded (allowed {MaxAutomaticRedirections}, redirected {redirectState.RedirectCounter} times)");
Uri redirectUrl;
try {
var baseUrl = new Uri (httpConnection.URL.ToString ());
if (location [0] == '/') {
// Shortcut for the '/' and '//' cases, simplifies logic since URI won't treat
// such URLs as relative and we'd have to work around it in the `else` block
// below.
redirectUrl = new Uri (baseUrl, location);
} else {
// Special case (from https://tools.ietf.org/html/rfc3986#section-5.4.1) not
// handled by the Uri class: scheme:host
//
// This is a valid URI (should be treated as `scheme://host`) but URI throws an
// exception about DOS path being malformed IF the part before colon is just one
// character long... We could replace the scheme with the original request's one, but
// that would NOT be the right thing to do since it is not what the redirecting server
// meant. The fix doesn't belong here, but rather in the Uri class. So we'll throw...
redirectUrl = new Uri (location, UriKind.RelativeOrAbsolute);
if (!redirectUrl.IsAbsoluteUri)
redirectUrl = new Uri (baseUrl, location);
}
} catch (Exception ex) {
throw new WebException ($"Invalid redirect URI received: {location}", ex);
}
UriBuilder builder = null;
if (!String.IsNullOrEmpty (httpConnection.URL.Ref) && String.IsNullOrEmpty (redirectUrl.Fragment)) {
builder = new UriBuilder (redirectUrl) {
Fragment = httpConnection.URL.Ref
};
}
redirectState.NewUrl = builder == null ? redirectUrl : builder.Uri;
return true;
}
bool IsErrorStatusCode (HttpStatusCode statusCode)
{
return (int)statusCode >= 400 && (int)statusCode <= 599;
}
void CollectAuthInfo (HttpHeaderValueCollection <AuthenticationHeaderValue> headers)
{
var authData = new List <AuthenticationData> (headers.Count);
foreach (AuthenticationHeaderValue ahv in headers)
{
var data = new AuthenticationData {
Scheme = GetAuthScheme (ahv.Scheme),
Challenge = $"{ahv.Scheme} {ahv.Parameter}",
UseProxyAuthentication = ProxyAuthenticationRequested
};
authData.Add (data);
}
RequestedAuthentication = authData.AsReadOnly ();
}
AuthenticationScheme GetAuthScheme (string scheme)
{
if (String.Compare ("basic", scheme, StringComparison.OrdinalIgnoreCase) == 0)
return AuthenticationScheme.Basic;
if (String.Compare ("digest", scheme, StringComparison.OrdinalIgnoreCase) == 0)
return AuthenticationScheme.Digest;
return AuthenticationScheme.Unsupported;
}
void ParseCookies (AndroidHttpResponseMessageEx ret, Uri connectionUri)
{
IEnumerable <string> cookieHeaderValue;
if (!UseCookies || CookieContainer == null || !ret.Headers.TryGetValues ("Set-Cookie", out cookieHeaderValue) || cookieHeaderValue == null) {
return;
}
try {
CookieContainer.SetCookies (connectionUri, String.Join (",", cookieHeaderValue));
} catch (Exception) {
// We don't want to terminate the response because of a bad cookie, hence just reporting
// the issue. We might consider adding a virtual method to let the user handle the
// issue, but not sure if it's really needed. Set-Cookie header will be part of the
// header collection so the user can always examine it if they spot an error.
}
}
void CopyHeaders (HttpURLConnection httpConnection, HttpResponseMessage response)
{
IDictionary <string, IList <string>> headers = httpConnection.HeaderFields;
foreach (string key in headers.Keys) {
if (key == null) // First header entry has null key, it corresponds to the response message
continue;
HttpHeaders item_headers;
string kind;
if (known_content_headers.Contains (key)) {
kind = "content";
item_headers = response.Content.Headers;
} else {
kind = "response";
item_headers = response.Headers;
}
item_headers.TryAddWithoutValidation (key, headers [key]);
}
}
/// <summary>
/// Configure the <see cref="HttpURLConnection"/> before the request is sent. This method is meant to be overriden
/// by applications which need to perform some extra configuration steps on the connection. It is called with all
/// the request headers set, pre-authentication performed (if applicable) but before the request body is set
/// (e.g. for POST requests). The default implementation in AndroidClientHandler does nothing.
/// </summary>
/// <param name="request">Request data</param>
/// <param name="conn">Pre-configured connection instance</param>
protected virtual Task SetupRequest (HttpRequestMessage request, HttpURLConnection conn)
{
Action a = AssertSelf;
return Task.Run (a);
}
/// <summary>
/// Configures the key store. The <paramref name="keyStore"/> parameter is set to instance of <see cref="KeyStore"/>
/// created using the <see cref="KeyStore.DefaultType"/> type and with populated with certificates provided in the <see cref="TrustedCerts"/>
/// property. AndroidClientHandler implementation simply returns the instance passed in the <paramref name="keyStore"/> parameter
/// </summary>
/// <returns>The key store.</returns>
/// <param name="keyStore">Key store to configure.</param>
protected virtual KeyStore ConfigureKeyStore (KeyStore keyStore)
{
AssertSelf ();
return keyStore;
}
/// <summary>
/// Create and configure an instance of <see cref="KeyManagerFactory"/>. The <paramref name="keyStore"/> parameter is set to the
/// return value of the <see cref="ConfigureKeyStore"/> method, so it might be null if the application overrode the method and provided
/// no key store. It will not be <c>null</c> when the default implementation is used. The application can return <c>null</c> here since
/// KeyManagerFactory is not required for the custom SSL configuration, but it might be used by the application to implement a more advanced
/// mechanism of key management.
/// </summary>
/// <returns>The key manager factory or <c>null</c>.</returns>
/// <param name="keyStore">Key store.</param>
protected virtual KeyManagerFactory ConfigureKeyManagerFactory (KeyStore keyStore)
{
AssertSelf ();
return null;
}
/// <summary>
/// Create and configure an instance of <see cref="TrustManagerFactory"/>. The <paramref name="keyStore"/> parameter is set to the
/// return value of the <see cref="ConfigureKeyStore"/> method, so it might be null if the application overrode the method and provided
/// no key store. It will not be <c>null</c> when the default implementation is used. The application can return <c>null</c> from this
/// method in which case AndroidClientHandler will create its own instance of the trust manager factory provided that the <see cref="TrustCerts"/>
/// list contains at least one valid certificate. If there are no valid certificates and this method returns <c>null</c>, no custom
/// trust manager will be created since that would make all the HTTPS requests fail.
/// </summary>
/// <returns>The trust manager factory.</returns>
/// <param name="keyStore">Key store.</param>
protected virtual TrustManagerFactory ConfigureTrustManagerFactory (KeyStore keyStore)
{
AssertSelf ();
return null;
}
void AppendEncoding (string encoding, ref List <string> list)
{
if (list == null)
list = new List <string> ();
if (list.Contains (encoding))
return;
list.Add (encoding);
}
async Task <HttpURLConnection> SetupRequestInternal (HttpRequestMessage request, URLConnection conn)
{
if (conn == null)
throw new ArgumentNullException (nameof (conn));
var httpConnection = conn.JavaCast <HttpURLConnection> ();
if (httpConnection == null)
throw new InvalidOperationException ($"Unsupported URL scheme {conn.URL.Protocol}");
httpConnection.RequestMethod = request.Method.ToString ();
// SSL context must be set up as soon as possible, before adding any content or
// headers. Otherwise Java won't use the socket factory
SetupSSL (httpConnection as HttpsURLConnection);
if (request.Content != null)
AddHeaders (httpConnection, request.Content.Headers);
AddHeaders (httpConnection, request.Headers);
List <string> accept_encoding = null;
decompress_here = false;
if ((AutomaticDecompression & DecompressionMethods.GZip) != 0) {
AppendEncoding (GZIP_ENCODING, ref accept_encoding);
decompress_here = true;
}
if ((AutomaticDecompression & DecompressionMethods.Deflate) != 0) {
AppendEncoding (DEFLATE_ENCODING, ref accept_encoding);
decompress_here = true;
}
if (AutomaticDecompression == DecompressionMethods.None) {
accept_encoding?.Clear ();
AppendEncoding (IDENTITY_ENCODING, ref accept_encoding); // Turns off compression for the Java client
}
if (accept_encoding?.Count > 0)
httpConnection.SetRequestProperty ("Accept-Encoding", String.Join (",", accept_encoding));
if (UseCookies && CookieContainer != null) {
string cookieHeaderValue = CookieContainer.GetCookieHeader (request.RequestUri);
if (!String.IsNullOrEmpty (cookieHeaderValue))
httpConnection.SetRequestProperty ("Cookie", cookieHeaderValue);
}
HandlePreAuthentication (httpConnection);
await SetupRequest (request, httpConnection).ConfigureAwait (continueOnCapturedContext: false);;
SetupRequestBody (httpConnection, request);
return httpConnection;
}
/// <summary>
/// Configure and return a custom <see cref="t:SSLSocketFactory"/> for the passed HTTPS <paramref
/// name="connection"/>. If the class overriding the method returns anything but the default
/// <c>null</c>, the SSL setup code will not call the <see cref="ConfigureKeyManagerFactory"/> nor the
/// <see cref="ConfigureTrustManagerFactory"/> methods used to configure a custom trust manager which is
/// then used to create a default socket factory.
/// Deriving class must perform all the key manager and trust manager configuration to ensure proper
/// operation of the returned socket factory.
/// </summary>
/// <returns>Instance of SSLSocketFactory ready to use with the HTTPS connection.</returns>
/// <param name="connection">HTTPS connection to return socket factory for</param>
protected virtual SSLSocketFactory ConfigureCustomSSLSocketFactory (HttpsURLConnection connection)
{
return null;
}
void SetupSSL (HttpsURLConnection httpsConnection)
{
if (httpsConnection == null)
return;
SSLSocketFactory socketFactory = ConfigureCustomSSLSocketFactory (httpsConnection);
if (socketFactory != null) {
httpsConnection.SSLSocketFactory = socketFactory;
return;
}
// Context: https://github.com/xamarin/xamarin-android/issues/1615
int apiLevel = (int)Build.VERSION.SdkInt;
if (apiLevel >= 16 && apiLevel <= 20) {
httpsConnection.SSLSocketFactory = new OldAndroidSSLSocketFactory ();
return;
}
KeyStore keyStore = KeyStore.GetInstance (KeyStore.DefaultType);
keyStore.Load (null, null);
bool gotCerts = TrustedCerts?.Count > 0;
if (gotCerts) {
for (int i = 0; i < TrustedCerts.Count; i++) {
Certificate cert = TrustedCerts [i];
if (cert == null)
continue;
keyStore.SetCertificateEntry ($"ca{i}", cert);
}
}
keyStore = ConfigureKeyStore (keyStore);
KeyManagerFactory kmf = ConfigureKeyManagerFactory (keyStore);
TrustManagerFactory tmf = ConfigureTrustManagerFactory (keyStore);
if (tmf == null) {
// If there are no certs and no trust manager factory, we can't use a custom manager
// because it will cause all the HTTPS requests to fail because of unverified trust
// chain
if (!gotCerts)
return;
tmf = TrustManagerFactory.GetInstance (TrustManagerFactory.DefaultAlgorithm);
tmf.Init (keyStore);
}
SSLContext context = SSLContext.GetInstance ("TLS");
context.Init (kmf?.GetKeyManagers (), tmf.GetTrustManagers (), null);
httpsConnection.SSLSocketFactory = context.SocketFactory;
}
void HandlePreAuthentication (HttpURLConnection httpConnection)
{
AuthenticationData data = PreAuthenticationData;
if (!PreAuthenticate || data == null)
return;
ICredentials creds = data.UseProxyAuthentication ? Proxy?.Credentials : Credentials;
if (creds == null) {
return;
}
IAndroidAuthenticationModule auth = data.Scheme == AuthenticationScheme.Unsupported ? data.AuthModule : authModules.Find (m => m?.Scheme == data.Scheme);
if (auth == null) {
return;
}
Authorization authorization = auth.Authenticate (data.Challenge, httpConnection, creds);
if (authorization == null) {
return;
}
httpConnection.SetRequestProperty (data.UseProxyAuthentication ? "Proxy-Authorization" : "Authorization", authorization.Message);
}
static string GetHeaderSeparator (string name) => headerSeparators.TryGetValue (name, out var value) ? value : ",";
void AddHeaders (HttpURLConnection conn, HttpHeaders headers)
{
if (headers == null)
return;
foreach (KeyValuePair<string, IEnumerable<string>> header in headers) {
conn.SetRequestProperty (header.Key, header.Value != null ? String.Join (GetHeaderSeparator (header.Key), header.Value) : String.Empty);
}
}
void SetupRequestBody (HttpURLConnection httpConnection, HttpRequestMessage request)
{
if (request.Content == null) {
// Pilfered from System.Net.Http.HttpClientHandler:SendAync
if (HttpMethod.Post.Equals (request.Method) || HttpMethod.Put.Equals (request.Method) || HttpMethod.Delete.Equals (request.Method)) {
// Explicitly set this to make sure we're sending a "Content-Length: 0" header.
// This fixes the issue that's been reported on the forums:
// http://forums.xamarin.com/discussion/17770/length-required-error-in-http-post-since-latest-release
httpConnection.SetRequestProperty ("Content-Length", "0");
}
return;
}
httpConnection.DoOutput = true;
long? contentLength = request.Content.Headers.ContentLength;
if (contentLength != null)
httpConnection.SetFixedLengthStreamingMode ((int)contentLength);
else
httpConnection.SetChunkedStreamingMode (0);
}
}
} | 42.604082 | 203 | 0.723079 | [
"MIT"
] | Orbital8/PinningAppDemo | Xamarin.PinningAppDemo.Android/Services/AndroidClientHandler/AndroidClientHandler.cs | 41,752 | 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 JetBrains.Annotations;
using Microsoft.EntityFrameworkCore.Utilities;
using Microsoft.Extensions.DependencyInjection;
#nullable enable
namespace Microsoft.EntityFrameworkCore.Query
{
/// <summary>
/// <para>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </para>
/// <para>
/// The service lifetime is <see cref="ServiceLifetime.Singleton" />. This means a single instance
/// is used by many <see cref="DbContext" /> instances. The implementation must be thread-safe.
/// This service cannot depend on services registered as <see cref="ServiceLifetime.Scoped" />.
/// </para>
/// </summary>
public class RelationalSqlTranslatingExpressionVisitorFactory : IRelationalSqlTranslatingExpressionVisitorFactory
{
private readonly RelationalSqlTranslatingExpressionVisitorDependencies _dependencies;
/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public RelationalSqlTranslatingExpressionVisitorFactory(
[NotNull] RelationalSqlTranslatingExpressionVisitorDependencies dependencies)
{
_dependencies = dependencies;
}
/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public virtual RelationalSqlTranslatingExpressionVisitor Create(
QueryCompilationContext queryCompilationContext,
QueryableMethodTranslatingExpressionVisitor queryableMethodTranslatingExpressionVisitor)
{
Check.NotNull(queryCompilationContext, nameof(queryCompilationContext));
Check.NotNull(queryableMethodTranslatingExpressionVisitor, nameof(queryableMethodTranslatingExpressionVisitor));
return new RelationalSqlTranslatingExpressionVisitor(
_dependencies,
queryCompilationContext,
queryableMethodTranslatingExpressionVisitor);
}
}
}
| 55.04918 | 124 | 0.702501 | [
"Apache-2.0"
] | Ali-YousefiTelori/EntityFrameworkCore | src/EFCore.Relational/Query/Internal/RelationalSqlTranslatingExpressionVisitorFactory.cs | 3,358 | C# |
// <copyright file="TestRunCustomArgumentServiceClient.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 Meissa.Server.Models;
namespace Meissa.Server.Client.Clients
{
public class TestRunCustomArgumentServiceClient : RestClientRepository<TestRunCustomArgumentDto>
{
public TestRunCustomArgumentServiceClient(string ip, int port)
: base(ip, port, "testruncustomarguments")
{
}
}
} | 44.24 | 100 | 0.743219 | [
"Apache-2.0"
] | AutomateThePlanet/Meissa | Meissa.Server.Client/Clients/TestRunCustomArgumentServiceClient.cs | 1,108 | C# |
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
abstract public class ObjectFactory : MonoBehaviour
{
public abstract void createObject(Vector3 position, Transform cube, Sprite sprite);
}
public class PumpkinObject : ObjectFactory
{
static List<Transform> pumpkins;
public override void createObject(Vector3 position, Transform cube, Sprite sprite)
{
Transform newpumpkin = Instantiate(cube, position, Quaternion.identity);
newpumpkin.gameObject.AddComponent<CircleCollider2D>();
newpumpkin.gameObject.AddComponent<SpriteRenderer>().sprite = sprite;
newpumpkin.gameObject.AddComponent<Rigidbody2D>();
if (pumpkins == null)
{
pumpkins = new List<Transform>();
}
pumpkins.Add(newpumpkin);
}
}
public class SkullObject : ObjectFactory
{
static List<Transform> skulls;
public override void createObject(Vector3 position, Transform cube, Sprite sprite)
{
Transform newSkull = Instantiate(cube, position, Quaternion.identity);
newSkull.gameObject.AddComponent<CircleCollider2D>();
newSkull.gameObject.AddComponent<SpriteRenderer>().sprite = sprite;
newSkull.gameObject.AddComponent<Rigidbody2D>();
if (skulls == null)
{
skulls = new List<Transform>();
}
skulls.Add(newSkull);
}
}
| 27.529412 | 87 | 0.688034 | [
"MIT"
] | FardeenF/Assignment-1 | Assets/Scripts/Factory Scripts/ObjectFactory.cs | 1,404 | C# |
#pragma warning disable CS1591
using System;
using System.Runtime.InteropServices;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.ComponentModel;
namespace Efl {
/// <summary>No description supplied.</summary>
[Efl.Exe.NativeMethods]
public class Exe : Efl.Task, Efl.Eo.IWrapper,Efl.Core.ICommandLine,Efl.Io.ICloser,Efl.Io.IReader,Efl.Io.IWriter
{
///<summary>Pointer to the native class description.</summary>
public override System.IntPtr NativeClass
{
get
{
if (((object)this).GetType() == typeof(Exe))
{
return GetEflClassStatic();
}
else
{
return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
}
}
}
[System.Runtime.InteropServices.DllImport(efl.Libs.Ecore)] internal static extern System.IntPtr
efl_exe_class_get();
/// <summary>Initializes a new instance of the <see cref="Exe"/> class.</summary>
/// <param name="parent">Parent instance.</param>
public Exe(Efl.Object parent= null
) : base(efl_exe_class_get(), typeof(Exe), parent)
{
FinishInstantiation();
}
/// <summary>Initializes a new instance of the <see cref="Exe"/> class.
/// Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>
/// <param name="raw">The native pointer to be wrapped.</param>
protected Exe(System.IntPtr raw) : base(raw)
{
}
/// <summary>Initializes a new instance of the <see cref="Exe"/> class.
/// Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
/// <param name="baseKlass">The pointer to the base native Eo class.</param>
/// <param name="managedType">The managed type of the public constructor that originated this call.</param>
/// <param name="parent">The Efl.Object parent of this instance.</param>
protected Exe(IntPtr baseKlass, System.Type managedType, Efl.Object parent) : base(baseKlass, managedType, parent)
{
}
/// <summary>Verifies if the given object is equal to this one.</summary>
/// <param name="instance">The object to compare to.</param>
/// <returns>True if both objects point to the same native object.</returns>
public override bool Equals(object instance)
{
var other = instance as Efl.Object;
if (other == null)
{
return false;
}
return this.NativeHandle == other.NativeHandle;
}
/// <summary>Gets the hash code for this object based on the native pointer it points to.</summary>
/// <returns>The value of the pointer, to be used as the hash code of this object.</returns>
public override int GetHashCode()
{
return this.NativeHandle.ToInt32();
}
/// <summary>Turns the native pointer into a string representation.</summary>
/// <returns>A string with the type and the native pointer for this object.</returns>
public override String ToString()
{
return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
}
/// <summary>Notifies closed, when property is marked as true
/// (Since EFL 1.22)</summary>
public event EventHandler ClosedEvt
{
add
{
lock (eventLock)
{
var wRef = new WeakReference(this);
Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
{
var obj = wRef.Target as Efl.Eo.IWrapper;
if (obj != null)
{
EventArgs args = EventArgs.Empty;
try
{
value?.Invoke(obj, args);
}
catch (Exception e)
{
Eina.Log.Error(e.ToString());
Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
}
}
};
string key = "_EFL_IO_CLOSER_EVENT_CLOSED";
AddNativeEventHandler(efl.Libs.Efl, key, callerCb, value);
}
}
remove
{
lock (eventLock)
{
string key = "_EFL_IO_CLOSER_EVENT_CLOSED";
RemoveNativeEventHandler(efl.Libs.Efl, key, value);
}
}
}
///<summary>Method to raise event ClosedEvt.</summary>
public void OnClosedEvt(EventArgs e)
{
var key = "_EFL_IO_CLOSER_EVENT_CLOSED";
IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
if (desc == IntPtr.Zero)
{
Eina.Log.Error($"Failed to get native event {key}");
return;
}
Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, IntPtr.Zero);
}
/// <summary>Notifies can_read property changed.
/// If <see cref="Efl.Io.IReader.CanRead"/> is <c>true</c> there is data to <see cref="Efl.Io.IReader.Read"/> without blocking/error. If <see cref="Efl.Io.IReader.CanRead"/> is <c>false</c>, <see cref="Efl.Io.IReader.Read"/> would either block or fail.
///
/// Note that usually this event is dispatched from inside <see cref="Efl.Io.IReader.Read"/>, thus before it returns.
/// (Since EFL 1.22)</summary>
public event EventHandler<Efl.Io.IReaderCanReadChangedEvt_Args> CanReadChangedEvt
{
add
{
lock (eventLock)
{
var wRef = new WeakReference(this);
Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
{
var obj = wRef.Target as Efl.Eo.IWrapper;
if (obj != null)
{
Efl.Io.IReaderCanReadChangedEvt_Args args = new Efl.Io.IReaderCanReadChangedEvt_Args();
args.arg = evt.Info != IntPtr.Zero;
try
{
value?.Invoke(obj, args);
}
catch (Exception e)
{
Eina.Log.Error(e.ToString());
Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
}
}
};
string key = "_EFL_IO_READER_EVENT_CAN_READ_CHANGED";
AddNativeEventHandler(efl.Libs.Efl, key, callerCb, value);
}
}
remove
{
lock (eventLock)
{
string key = "_EFL_IO_READER_EVENT_CAN_READ_CHANGED";
RemoveNativeEventHandler(efl.Libs.Efl, key, value);
}
}
}
///<summary>Method to raise event CanReadChangedEvt.</summary>
public void OnCanReadChangedEvt(Efl.Io.IReaderCanReadChangedEvt_Args e)
{
var key = "_EFL_IO_READER_EVENT_CAN_READ_CHANGED";
IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
if (desc == IntPtr.Zero)
{
Eina.Log.Error($"Failed to get native event {key}");
return;
}
IntPtr info = Eina.PrimitiveConversion.ManagedToPointerAlloc(e.arg ? (byte) 1 : (byte) 0);
try
{
Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
}
finally
{
Marshal.FreeHGlobal(info);
}
}
/// <summary>Notifies end of stream, when property is marked as true.
/// If this is used alongside with an <see cref="Efl.Io.ICloser"/>, then it should be emitted before that call.
///
/// It should be emitted only once for an object unless it implements <see cref="Efl.Io.IPositioner.Seek"/>.
///
/// The property <see cref="Efl.Io.IReader.CanRead"/> should change to <c>false</c> before this event is dispatched.
/// (Since EFL 1.22)</summary>
public event EventHandler EosEvt
{
add
{
lock (eventLock)
{
var wRef = new WeakReference(this);
Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
{
var obj = wRef.Target as Efl.Eo.IWrapper;
if (obj != null)
{
EventArgs args = EventArgs.Empty;
try
{
value?.Invoke(obj, args);
}
catch (Exception e)
{
Eina.Log.Error(e.ToString());
Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
}
}
};
string key = "_EFL_IO_READER_EVENT_EOS";
AddNativeEventHandler(efl.Libs.Efl, key, callerCb, value);
}
}
remove
{
lock (eventLock)
{
string key = "_EFL_IO_READER_EVENT_EOS";
RemoveNativeEventHandler(efl.Libs.Efl, key, value);
}
}
}
///<summary>Method to raise event EosEvt.</summary>
public void OnEosEvt(EventArgs e)
{
var key = "_EFL_IO_READER_EVENT_EOS";
IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
if (desc == IntPtr.Zero)
{
Eina.Log.Error($"Failed to get native event {key}");
return;
}
Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, IntPtr.Zero);
}
/// <summary>Notifies can_write property changed.
/// If <see cref="Efl.Io.IWriter.CanWrite"/> is <c>true</c> there is data to <see cref="Efl.Io.IWriter.Write"/> without blocking/error. If <see cref="Efl.Io.IWriter.CanWrite"/> is <c>false</c>, <see cref="Efl.Io.IWriter.Write"/> would either block or fail.
///
/// Note that usually this event is dispatched from inside <see cref="Efl.Io.IWriter.Write"/>, thus before it returns.
/// (Since EFL 1.22)</summary>
public event EventHandler<Efl.Io.IWriterCanWriteChangedEvt_Args> CanWriteChangedEvt
{
add
{
lock (eventLock)
{
var wRef = new WeakReference(this);
Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
{
var obj = wRef.Target as Efl.Eo.IWrapper;
if (obj != null)
{
Efl.Io.IWriterCanWriteChangedEvt_Args args = new Efl.Io.IWriterCanWriteChangedEvt_Args();
args.arg = evt.Info != IntPtr.Zero;
try
{
value?.Invoke(obj, args);
}
catch (Exception e)
{
Eina.Log.Error(e.ToString());
Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
}
}
};
string key = "_EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED";
AddNativeEventHandler(efl.Libs.Efl, key, callerCb, value);
}
}
remove
{
lock (eventLock)
{
string key = "_EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED";
RemoveNativeEventHandler(efl.Libs.Efl, key, value);
}
}
}
///<summary>Method to raise event CanWriteChangedEvt.</summary>
public void OnCanWriteChangedEvt(Efl.Io.IWriterCanWriteChangedEvt_Args e)
{
var key = "_EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED";
IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
if (desc == IntPtr.Zero)
{
Eina.Log.Error($"Failed to get native event {key}");
return;
}
IntPtr info = Eina.PrimitiveConversion.ManagedToPointerAlloc(e.arg ? (byte) 1 : (byte) 0);
try
{
Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
}
finally
{
Marshal.FreeHGlobal(info);
}
}
/// <returns>No description supplied.</returns>
virtual public Efl.ExeFlags GetExeFlags() {
var _ret_var = Efl.Exe.NativeMethods.efl_exe_flags_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
Eina.Error.RaiseIfUnhandledException();
return _ret_var;
}
/// <param name="flags">No description supplied.</param>
virtual public void SetExeFlags(Efl.ExeFlags flags) {
Efl.Exe.NativeMethods.efl_exe_flags_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),flags);
Eina.Error.RaiseIfUnhandledException();
}
/// <summary>The final exit signal of this task.</summary>
/// <returns>The exit signal, or -1 if no exit signal happened</returns>
virtual public int GetExitSignal() {
var _ret_var = Efl.Exe.NativeMethods.efl_exe_exit_signal_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
Eina.Error.RaiseIfUnhandledException();
return _ret_var;
}
/// <summary>Get the object assosiated with this object</summary>
/// <returns><c>env</c> will be referenced until this object does not need it anymore.</returns>
virtual public Efl.Core.Env GetEnv() {
var _ret_var = Efl.Exe.NativeMethods.efl_exe_env_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
Eina.Error.RaiseIfUnhandledException();
return _ret_var;
}
/// <summary>Set the object assosiated with this object</summary>
/// <param name="env"><c>env</c> will be referenced until this object does not need it anymore.</param>
virtual public void SetEnv(Efl.Core.Env env) {
Efl.Exe.NativeMethods.efl_exe_env_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),env);
Eina.Error.RaiseIfUnhandledException();
}
/// <param name="sig">Send this signal to the task</param>
virtual public void Signal(Efl.ExeSignal sig) {
Efl.Exe.NativeMethods.efl_exe_signal_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),sig);
Eina.Error.RaiseIfUnhandledException();
}
/// <summary>A commandline that encodes arguments in a command string. This command is unix shell-style, thus whitespace separates arguments unless escaped. Also a semi-colon ';', ampersand '&', pipe/bar '|', hash '#', bracket, square brace, brace character ('(', ')', '[', ']', '{', '}'), exclamation mark '!', backquote '`', greator or less than ('>' '<') character unless escaped or in quotes would cause args_count/value to not be generated properly, because it would force complex shell interpretation which will not be supported in evaluating the arg_count/value information, but the final shell may interpret this if this is executed via a command-line shell. To not be a complex shell command, it should be simple with paths, options and variable expansions, but nothing more complex involving the above unescaped characters.
/// "cat -option /path/file" "cat 'quoted argument'" "cat ~/path/escaped argument" "/bin/cat escaped argument <c>VARIABLE</c>" etc.
///
/// It should not try and use "complex shell features" if you want the arg_count and arg_value set to be correct after setting the command string. For example none of:
///
/// "VAR=x /bin/command && /bin/othercommand >& /dev/null" "VAR=x /bin/command `/bin/othercommand` | /bin/cmd2 && cmd3 &" etc.
///
/// If you set the command the arg_count/value property contents can change and be completely re-evaluated by parsing the command string into an argument array set along with interpreting escapes back into individual argument strings.</summary>
virtual public System.String GetCommand() {
var _ret_var = Efl.Core.ICommandLineConcrete.NativeMethods.efl_core_command_line_command_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
Eina.Error.RaiseIfUnhandledException();
return _ret_var;
}
/// <summary>Use an array to fill this object
/// Every element of a string is a argument.</summary>
/// <param name="array">An array where every array field is an argument</param>
/// <returns>On success <c>true</c>, <c>false</c> otherwise</returns>
virtual public bool SetCommandArray(Eina.Array<System.String> array) {
var _in_array = array.Handle;
array.Own = false;
array.OwnContent = false;
var _ret_var = Efl.Core.ICommandLineConcrete.NativeMethods.efl_core_command_line_command_array_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),_in_array);
Eina.Error.RaiseIfUnhandledException();
return _ret_var;
}
/// <summary>Use a string to fill this object
/// The string will be split at every unescaped ' ', every resulting substring will be a new argument to the command line.</summary>
/// <param name="str">A command in form of a string</param>
/// <returns>On success <c>true</c>, <c>false</c> otherwise</returns>
virtual public bool SetCommandString(System.String str) {
var _ret_var = Efl.Core.ICommandLineConcrete.NativeMethods.efl_core_command_line_command_string_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),str);
Eina.Error.RaiseIfUnhandledException();
return _ret_var;
}
/// <summary>Get the accessor which enables access to each argument that got passed to this object.</summary>
virtual public Eina.Accessor<System.String> CommandAccess() {
var _ret_var = Efl.Core.ICommandLineConcrete.NativeMethods.efl_core_command_line_command_access_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
Eina.Error.RaiseIfUnhandledException();
return new Eina.Accessor<System.String>(_ret_var, false, false);
}
/// <summary>If true will notify object was closed.
/// (Since EFL 1.22)</summary>
/// <returns><c>true</c> if closed, <c>false</c> otherwise</returns>
virtual public bool GetClosed() {
var _ret_var = Efl.Io.ICloserConcrete.NativeMethods.efl_io_closer_closed_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
Eina.Error.RaiseIfUnhandledException();
return _ret_var;
}
/// <summary>If true will automatically close resources on exec() calls.
/// When using file descriptors this should set FD_CLOEXEC so they are not inherited by the processes (children or self) doing exec().
/// (Since EFL 1.22)</summary>
/// <returns><c>true</c> if close on exec(), <c>false</c> otherwise</returns>
virtual public bool GetCloseOnExec() {
var _ret_var = Efl.Io.ICloserConcrete.NativeMethods.efl_io_closer_close_on_exec_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
Eina.Error.RaiseIfUnhandledException();
return _ret_var;
}
/// <summary>If <c>true</c>, will close on exec() call.
/// (Since EFL 1.22)</summary>
/// <param name="close_on_exec"><c>true</c> if close on exec(), <c>false</c> otherwise</param>
/// <returns><c>true</c> if could set, <c>false</c> if not supported or failed.</returns>
virtual public bool SetCloseOnExec(bool close_on_exec) {
var _ret_var = Efl.Io.ICloserConcrete.NativeMethods.efl_io_closer_close_on_exec_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),close_on_exec);
Eina.Error.RaiseIfUnhandledException();
return _ret_var;
}
/// <summary>If true will automatically close() on object invalidate.
/// If the object was disconnected from its parent (including the main loop) without close, this property will state whenever it should be closed or not.
/// (Since EFL 1.22)</summary>
/// <returns><c>true</c> if close on invalidate, <c>false</c> otherwise</returns>
virtual public bool GetCloseOnInvalidate() {
var _ret_var = Efl.Io.ICloserConcrete.NativeMethods.efl_io_closer_close_on_invalidate_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
Eina.Error.RaiseIfUnhandledException();
return _ret_var;
}
/// <summary>If true will automatically close() on object invalidate.
/// If the object was disconnected from its parent (including the main loop) without close, this property will state whenever it should be closed or not.
/// (Since EFL 1.22)</summary>
/// <param name="close_on_invalidate"><c>true</c> if close on invalidate, <c>false</c> otherwise</param>
virtual public void SetCloseOnInvalidate(bool close_on_invalidate) {
Efl.Io.ICloserConcrete.NativeMethods.efl_io_closer_close_on_invalidate_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),close_on_invalidate);
Eina.Error.RaiseIfUnhandledException();
}
/// <summary>Closes the Input/Output object.
/// This operation will be executed immediately and may or may not block the caller thread for some time. The details of blocking behavior is to be defined by the implementation and may be subject to other parameters such as non-blocking flags, maximum timeout or even retry attempts.
///
/// You can understand this method as close(2) libc function.
/// (Since EFL 1.22)</summary>
/// <returns>0 on succeed, a mapping of errno otherwise</returns>
virtual public Eina.Error Close() {
var _ret_var = Efl.Io.ICloserConcrete.NativeMethods.efl_io_closer_close_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
Eina.Error.RaiseIfUnhandledException();
return _ret_var;
}
/// <summary>If <c>true</c> will notify <see cref="Efl.Io.IReader.Read"/> can be called without blocking or failing.
/// (Since EFL 1.22)</summary>
/// <returns><c>true</c> if it can be read without blocking or failing, <c>false</c> otherwise</returns>
virtual public bool GetCanRead() {
var _ret_var = Efl.Io.IReaderConcrete.NativeMethods.efl_io_reader_can_read_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
Eina.Error.RaiseIfUnhandledException();
return _ret_var;
}
/// <summary>If <c>true</c> will notify <see cref="Efl.Io.IReader.Read"/> can be called without blocking or failing.
/// (Since EFL 1.22)</summary>
/// <param name="can_read"><c>true</c> if it can be read without blocking or failing, <c>false</c> otherwise</param>
virtual public void SetCanRead(bool can_read) {
Efl.Io.IReaderConcrete.NativeMethods.efl_io_reader_can_read_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),can_read);
Eina.Error.RaiseIfUnhandledException();
}
/// <summary>If <c>true</c> will notify end of stream.
/// (Since EFL 1.22)</summary>
/// <returns><c>true</c> if end of stream, <c>false</c> otherwise</returns>
virtual public bool GetEos() {
var _ret_var = Efl.Io.IReaderConcrete.NativeMethods.efl_io_reader_eos_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
Eina.Error.RaiseIfUnhandledException();
return _ret_var;
}
/// <summary>If <c>true</c> will notify end of stream.
/// (Since EFL 1.22)</summary>
/// <param name="is_eos"><c>true</c> if end of stream, <c>false</c> otherwise</param>
virtual public void SetEos(bool is_eos) {
Efl.Io.IReaderConcrete.NativeMethods.efl_io_reader_eos_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),is_eos);
Eina.Error.RaiseIfUnhandledException();
}
/// <summary>Reads data into a pre-allocated buffer.
/// This operation will be executed immediately and may or may not block the caller thread for some time. The details of blocking behavior is to be defined by the implementation and may be subject to other parameters such as non-blocking flags, maximum timeout or even retry attempts.
///
/// You can understand this method as read(2) libc function.
/// (Since EFL 1.22)</summary>
/// <param name="rw_slice">Provides a pre-allocated memory to be filled up to rw_slice.len. It will be populated and the length will be set to the actually used amount of bytes, which can be smaller than the request.</param>
/// <returns>0 on succeed, a mapping of errno otherwise</returns>
virtual public Eina.Error Read(ref Eina.RwSlice rw_slice) {
var _ret_var = Efl.Io.IReaderConcrete.NativeMethods.efl_io_reader_read_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),ref rw_slice);
Eina.Error.RaiseIfUnhandledException();
return _ret_var;
}
/// <summary>If <c>true</c> will notify <see cref="Efl.Io.IWriter.Write"/> can be called without blocking or failing.
/// (Since EFL 1.22)</summary>
/// <returns><c>true</c> if it can be written without blocking or failure, <c>false</c> otherwise</returns>
virtual public bool GetCanWrite() {
var _ret_var = Efl.Io.IWriterConcrete.NativeMethods.efl_io_writer_can_write_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
Eina.Error.RaiseIfUnhandledException();
return _ret_var;
}
/// <summary>If <c>true</c> will notify <see cref="Efl.Io.IWriter.Write"/> can be called without blocking or failing.
/// (Since EFL 1.22)</summary>
/// <param name="can_write"><c>true</c> if it can be written without blocking or failure, <c>false</c> otherwise</param>
virtual public void SetCanWrite(bool can_write) {
Efl.Io.IWriterConcrete.NativeMethods.efl_io_writer_can_write_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),can_write);
Eina.Error.RaiseIfUnhandledException();
}
/// <summary>Writes data from a pre-populated buffer.
/// This operation will be executed immediately and may or may not block the caller thread for some time. The details of blocking behavior is defined by the implementation and may be subject to other parameters such as non-blocking flags, maximum timeout or even retry attempts.
///
/// You can understand this method as write(2) libc function.
/// (Since EFL 1.22)</summary>
/// <param name="slice">Provides a pre-populated memory to be used up to slice.len. The returned slice will be adapted as length will be set to the actually used amount of bytes, which can be smaller than the request.</param>
/// <param name="remaining">Convenience to output the remaining parts of slice that was not written. If the full slice was written, this will be a slice of zero-length.</param>
/// <returns>0 on succeed, a mapping of errno otherwise</returns>
virtual public Eina.Error Write(ref Eina.Slice slice, ref Eina.Slice remaining) {
var _ret_var = Efl.Io.IWriterConcrete.NativeMethods.efl_io_writer_write_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),ref slice, ref remaining);
Eina.Error.RaiseIfUnhandledException();
return _ret_var;
}
/// <value>No description supplied.</value>
public Efl.ExeFlags ExeFlags {
get { return GetExeFlags(); }
set { SetExeFlags(value); }
}
/// <summary>The final exit signal of this task.</summary>
/// <value>The exit signal, or -1 if no exit signal happened</value>
public int ExitSignal {
get { return GetExitSignal(); }
}
/// <summary>If <c>env</c> is <c>null</c> then the process created by this object is going to inherit the environment of this process.
/// In case <c>env</c> is not <c>null</c> then the environment variables declared in this object will represent the environment passed to the new process.</summary>
/// <value><c>env</c> will be referenced until this object does not need it anymore.</value>
public Efl.Core.Env Env {
get { return GetEnv(); }
set { SetEnv(value); }
}
/// <summary>A commandline that encodes arguments in a command string. This command is unix shell-style, thus whitespace separates arguments unless escaped. Also a semi-colon ';', ampersand '&', pipe/bar '|', hash '#', bracket, square brace, brace character ('(', ')', '[', ']', '{', '}'), exclamation mark '!', backquote '`', greator or less than ('>' '<') character unless escaped or in quotes would cause args_count/value to not be generated properly, because it would force complex shell interpretation which will not be supported in evaluating the arg_count/value information, but the final shell may interpret this if this is executed via a command-line shell. To not be a complex shell command, it should be simple with paths, options and variable expansions, but nothing more complex involving the above unescaped characters.
/// "cat -option /path/file" "cat 'quoted argument'" "cat ~/path/escaped argument" "/bin/cat escaped argument <c>VARIABLE</c>" etc.
///
/// It should not try and use "complex shell features" if you want the arg_count and arg_value set to be correct after setting the command string. For example none of:
///
/// "VAR=x /bin/command && /bin/othercommand >& /dev/null" "VAR=x /bin/command `/bin/othercommand` | /bin/cmd2 && cmd3 &" etc.
///
/// If you set the command the arg_count/value property contents can change and be completely re-evaluated by parsing the command string into an argument array set along with interpreting escapes back into individual argument strings.</summary>
public System.String Command {
get { return GetCommand(); }
}
/// <summary>Use an array to fill this object
/// Every element of a string is a argument.</summary>
/// <value>An array where every array field is an argument</value>
public Eina.Array<System.String> CommandArray {
set { SetCommandArray(value); }
}
/// <summary>Use a string to fill this object
/// The string will be split at every unescaped ' ', every resulting substring will be a new argument to the command line.</summary>
/// <value>A command in form of a string</value>
public System.String CommandString {
set { SetCommandString(value); }
}
/// <summary>If true will notify object was closed.
/// (Since EFL 1.22)</summary>
/// <value><c>true</c> if closed, <c>false</c> otherwise</value>
public bool Closed {
get { return GetClosed(); }
}
/// <summary>If true will automatically close resources on exec() calls.
/// When using file descriptors this should set FD_CLOEXEC so they are not inherited by the processes (children or self) doing exec().
/// (Since EFL 1.22)</summary>
/// <value><c>true</c> if close on exec(), <c>false</c> otherwise</value>
public bool CloseOnExec {
get { return GetCloseOnExec(); }
set { SetCloseOnExec(value); }
}
/// <summary>If true will automatically close() on object invalidate.
/// If the object was disconnected from its parent (including the main loop) without close, this property will state whenever it should be closed or not.
/// (Since EFL 1.22)</summary>
/// <value><c>true</c> if close on invalidate, <c>false</c> otherwise</value>
public bool CloseOnInvalidate {
get { return GetCloseOnInvalidate(); }
set { SetCloseOnInvalidate(value); }
}
/// <summary>If <c>true</c> will notify <see cref="Efl.Io.IReader.Read"/> can be called without blocking or failing.
/// (Since EFL 1.22)</summary>
/// <value><c>true</c> if it can be read without blocking or failing, <c>false</c> otherwise</value>
public bool CanRead {
get { return GetCanRead(); }
set { SetCanRead(value); }
}
/// <summary>If <c>true</c> will notify end of stream.
/// (Since EFL 1.22)</summary>
/// <value><c>true</c> if end of stream, <c>false</c> otherwise</value>
public bool Eos {
get { return GetEos(); }
set { SetEos(value); }
}
/// <summary>If <c>true</c> will notify <see cref="Efl.Io.IWriter.Write"/> can be called without blocking or failing.
/// (Since EFL 1.22)</summary>
/// <value><c>true</c> if it can be written without blocking or failure, <c>false</c> otherwise</value>
public bool CanWrite {
get { return GetCanWrite(); }
set { SetCanWrite(value); }
}
private static IntPtr GetEflClassStatic()
{
return Efl.Exe.efl_exe_class_get();
}
/// <summary>Wrapper for native methods and virtual method delegates.
/// For internal use by generated code only.</summary>
public new class NativeMethods : Efl.Task.NativeMethods
{
private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Ecore);
/// <summary>Gets the list of Eo operations to override.</summary>
/// <returns>The list of Eo operations to be overload.</returns>
public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
{
var descs = new System.Collections.Generic.List<Efl_Op_Description>();
var methods = Efl.Eo.Globals.GetUserMethods(type);
if (efl_exe_flags_get_static_delegate == null)
{
efl_exe_flags_get_static_delegate = new efl_exe_flags_get_delegate(exe_flags_get);
}
if (methods.FirstOrDefault(m => m.Name == "GetExeFlags") != null)
{
descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_exe_flags_get"), func = Marshal.GetFunctionPointerForDelegate(efl_exe_flags_get_static_delegate) });
}
if (efl_exe_flags_set_static_delegate == null)
{
efl_exe_flags_set_static_delegate = new efl_exe_flags_set_delegate(exe_flags_set);
}
if (methods.FirstOrDefault(m => m.Name == "SetExeFlags") != null)
{
descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_exe_flags_set"), func = Marshal.GetFunctionPointerForDelegate(efl_exe_flags_set_static_delegate) });
}
if (efl_exe_exit_signal_get_static_delegate == null)
{
efl_exe_exit_signal_get_static_delegate = new efl_exe_exit_signal_get_delegate(exit_signal_get);
}
if (methods.FirstOrDefault(m => m.Name == "GetExitSignal") != null)
{
descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_exe_exit_signal_get"), func = Marshal.GetFunctionPointerForDelegate(efl_exe_exit_signal_get_static_delegate) });
}
if (efl_exe_env_get_static_delegate == null)
{
efl_exe_env_get_static_delegate = new efl_exe_env_get_delegate(env_get);
}
if (methods.FirstOrDefault(m => m.Name == "GetEnv") != null)
{
descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_exe_env_get"), func = Marshal.GetFunctionPointerForDelegate(efl_exe_env_get_static_delegate) });
}
if (efl_exe_env_set_static_delegate == null)
{
efl_exe_env_set_static_delegate = new efl_exe_env_set_delegate(env_set);
}
if (methods.FirstOrDefault(m => m.Name == "SetEnv") != null)
{
descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_exe_env_set"), func = Marshal.GetFunctionPointerForDelegate(efl_exe_env_set_static_delegate) });
}
if (efl_exe_signal_static_delegate == null)
{
efl_exe_signal_static_delegate = new efl_exe_signal_delegate(signal);
}
if (methods.FirstOrDefault(m => m.Name == "Signal") != null)
{
descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_exe_signal"), func = Marshal.GetFunctionPointerForDelegate(efl_exe_signal_static_delegate) });
}
if (efl_core_command_line_command_get_static_delegate == null)
{
efl_core_command_line_command_get_static_delegate = new efl_core_command_line_command_get_delegate(command_get);
}
if (methods.FirstOrDefault(m => m.Name == "GetCommand") != null)
{
descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_core_command_line_command_get"), func = Marshal.GetFunctionPointerForDelegate(efl_core_command_line_command_get_static_delegate) });
}
if (efl_core_command_line_command_array_set_static_delegate == null)
{
efl_core_command_line_command_array_set_static_delegate = new efl_core_command_line_command_array_set_delegate(command_array_set);
}
if (methods.FirstOrDefault(m => m.Name == "SetCommandArray") != null)
{
descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_core_command_line_command_array_set"), func = Marshal.GetFunctionPointerForDelegate(efl_core_command_line_command_array_set_static_delegate) });
}
if (efl_core_command_line_command_string_set_static_delegate == null)
{
efl_core_command_line_command_string_set_static_delegate = new efl_core_command_line_command_string_set_delegate(command_string_set);
}
if (methods.FirstOrDefault(m => m.Name == "SetCommandString") != null)
{
descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_core_command_line_command_string_set"), func = Marshal.GetFunctionPointerForDelegate(efl_core_command_line_command_string_set_static_delegate) });
}
if (efl_core_command_line_command_access_static_delegate == null)
{
efl_core_command_line_command_access_static_delegate = new efl_core_command_line_command_access_delegate(command_access);
}
if (methods.FirstOrDefault(m => m.Name == "CommandAccess") != null)
{
descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_core_command_line_command_access"), func = Marshal.GetFunctionPointerForDelegate(efl_core_command_line_command_access_static_delegate) });
}
if (efl_io_closer_closed_get_static_delegate == null)
{
efl_io_closer_closed_get_static_delegate = new efl_io_closer_closed_get_delegate(closed_get);
}
if (methods.FirstOrDefault(m => m.Name == "GetClosed") != null)
{
descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_io_closer_closed_get"), func = Marshal.GetFunctionPointerForDelegate(efl_io_closer_closed_get_static_delegate) });
}
if (efl_io_closer_close_on_exec_get_static_delegate == null)
{
efl_io_closer_close_on_exec_get_static_delegate = new efl_io_closer_close_on_exec_get_delegate(close_on_exec_get);
}
if (methods.FirstOrDefault(m => m.Name == "GetCloseOnExec") != null)
{
descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_io_closer_close_on_exec_get"), func = Marshal.GetFunctionPointerForDelegate(efl_io_closer_close_on_exec_get_static_delegate) });
}
if (efl_io_closer_close_on_exec_set_static_delegate == null)
{
efl_io_closer_close_on_exec_set_static_delegate = new efl_io_closer_close_on_exec_set_delegate(close_on_exec_set);
}
if (methods.FirstOrDefault(m => m.Name == "SetCloseOnExec") != null)
{
descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_io_closer_close_on_exec_set"), func = Marshal.GetFunctionPointerForDelegate(efl_io_closer_close_on_exec_set_static_delegate) });
}
if (efl_io_closer_close_on_invalidate_get_static_delegate == null)
{
efl_io_closer_close_on_invalidate_get_static_delegate = new efl_io_closer_close_on_invalidate_get_delegate(close_on_invalidate_get);
}
if (methods.FirstOrDefault(m => m.Name == "GetCloseOnInvalidate") != null)
{
descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_io_closer_close_on_invalidate_get"), func = Marshal.GetFunctionPointerForDelegate(efl_io_closer_close_on_invalidate_get_static_delegate) });
}
if (efl_io_closer_close_on_invalidate_set_static_delegate == null)
{
efl_io_closer_close_on_invalidate_set_static_delegate = new efl_io_closer_close_on_invalidate_set_delegate(close_on_invalidate_set);
}
if (methods.FirstOrDefault(m => m.Name == "SetCloseOnInvalidate") != null)
{
descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_io_closer_close_on_invalidate_set"), func = Marshal.GetFunctionPointerForDelegate(efl_io_closer_close_on_invalidate_set_static_delegate) });
}
if (efl_io_closer_close_static_delegate == null)
{
efl_io_closer_close_static_delegate = new efl_io_closer_close_delegate(close);
}
if (methods.FirstOrDefault(m => m.Name == "Close") != null)
{
descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_io_closer_close"), func = Marshal.GetFunctionPointerForDelegate(efl_io_closer_close_static_delegate) });
}
if (efl_io_reader_can_read_get_static_delegate == null)
{
efl_io_reader_can_read_get_static_delegate = new efl_io_reader_can_read_get_delegate(can_read_get);
}
if (methods.FirstOrDefault(m => m.Name == "GetCanRead") != null)
{
descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_io_reader_can_read_get"), func = Marshal.GetFunctionPointerForDelegate(efl_io_reader_can_read_get_static_delegate) });
}
if (efl_io_reader_can_read_set_static_delegate == null)
{
efl_io_reader_can_read_set_static_delegate = new efl_io_reader_can_read_set_delegate(can_read_set);
}
if (methods.FirstOrDefault(m => m.Name == "SetCanRead") != null)
{
descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_io_reader_can_read_set"), func = Marshal.GetFunctionPointerForDelegate(efl_io_reader_can_read_set_static_delegate) });
}
if (efl_io_reader_eos_get_static_delegate == null)
{
efl_io_reader_eos_get_static_delegate = new efl_io_reader_eos_get_delegate(eos_get);
}
if (methods.FirstOrDefault(m => m.Name == "GetEos") != null)
{
descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_io_reader_eos_get"), func = Marshal.GetFunctionPointerForDelegate(efl_io_reader_eos_get_static_delegate) });
}
if (efl_io_reader_eos_set_static_delegate == null)
{
efl_io_reader_eos_set_static_delegate = new efl_io_reader_eos_set_delegate(eos_set);
}
if (methods.FirstOrDefault(m => m.Name == "SetEos") != null)
{
descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_io_reader_eos_set"), func = Marshal.GetFunctionPointerForDelegate(efl_io_reader_eos_set_static_delegate) });
}
if (efl_io_reader_read_static_delegate == null)
{
efl_io_reader_read_static_delegate = new efl_io_reader_read_delegate(read);
}
if (methods.FirstOrDefault(m => m.Name == "Read") != null)
{
descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_io_reader_read"), func = Marshal.GetFunctionPointerForDelegate(efl_io_reader_read_static_delegate) });
}
if (efl_io_writer_can_write_get_static_delegate == null)
{
efl_io_writer_can_write_get_static_delegate = new efl_io_writer_can_write_get_delegate(can_write_get);
}
if (methods.FirstOrDefault(m => m.Name == "GetCanWrite") != null)
{
descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_io_writer_can_write_get"), func = Marshal.GetFunctionPointerForDelegate(efl_io_writer_can_write_get_static_delegate) });
}
if (efl_io_writer_can_write_set_static_delegate == null)
{
efl_io_writer_can_write_set_static_delegate = new efl_io_writer_can_write_set_delegate(can_write_set);
}
if (methods.FirstOrDefault(m => m.Name == "SetCanWrite") != null)
{
descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_io_writer_can_write_set"), func = Marshal.GetFunctionPointerForDelegate(efl_io_writer_can_write_set_static_delegate) });
}
if (efl_io_writer_write_static_delegate == null)
{
efl_io_writer_write_static_delegate = new efl_io_writer_write_delegate(write);
}
if (methods.FirstOrDefault(m => m.Name == "Write") != null)
{
descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_io_writer_write"), func = Marshal.GetFunctionPointerForDelegate(efl_io_writer_write_static_delegate) });
}
descs.AddRange(base.GetEoOps(type));
return descs;
}
/// <summary>Returns the Eo class for the native methods of this class.</summary>
/// <returns>The native class pointer.</returns>
public override IntPtr GetEflClass()
{
return Efl.Exe.efl_exe_class_get();
}
#pragma warning disable CA1707, SA1300, SA1600
private delegate Efl.ExeFlags efl_exe_flags_get_delegate(System.IntPtr obj, System.IntPtr pd);
public delegate Efl.ExeFlags efl_exe_flags_get_api_delegate(System.IntPtr obj);
public static Efl.Eo.FunctionWrapper<efl_exe_flags_get_api_delegate> efl_exe_flags_get_ptr = new Efl.Eo.FunctionWrapper<efl_exe_flags_get_api_delegate>(Module, "efl_exe_flags_get");
private static Efl.ExeFlags exe_flags_get(System.IntPtr obj, System.IntPtr pd)
{
Eina.Log.Debug("function efl_exe_flags_get was called");
Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
if (wrapper != null)
{
Efl.ExeFlags _ret_var = default(Efl.ExeFlags);
try
{
_ret_var = ((Exe)wrapper).GetExeFlags();
}
catch (Exception e)
{
Eina.Log.Warning($"Callback error: {e.ToString()}");
Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
}
return _ret_var;
}
else
{
return efl_exe_flags_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
}
}
private static efl_exe_flags_get_delegate efl_exe_flags_get_static_delegate;
private delegate void efl_exe_flags_set_delegate(System.IntPtr obj, System.IntPtr pd, Efl.ExeFlags flags);
public delegate void efl_exe_flags_set_api_delegate(System.IntPtr obj, Efl.ExeFlags flags);
public static Efl.Eo.FunctionWrapper<efl_exe_flags_set_api_delegate> efl_exe_flags_set_ptr = new Efl.Eo.FunctionWrapper<efl_exe_flags_set_api_delegate>(Module, "efl_exe_flags_set");
private static void exe_flags_set(System.IntPtr obj, System.IntPtr pd, Efl.ExeFlags flags)
{
Eina.Log.Debug("function efl_exe_flags_set was called");
Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
if (wrapper != null)
{
try
{
((Exe)wrapper).SetExeFlags(flags);
}
catch (Exception e)
{
Eina.Log.Warning($"Callback error: {e.ToString()}");
Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
}
}
else
{
efl_exe_flags_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), flags);
}
}
private static efl_exe_flags_set_delegate efl_exe_flags_set_static_delegate;
private delegate int efl_exe_exit_signal_get_delegate(System.IntPtr obj, System.IntPtr pd);
public delegate int efl_exe_exit_signal_get_api_delegate(System.IntPtr obj);
public static Efl.Eo.FunctionWrapper<efl_exe_exit_signal_get_api_delegate> efl_exe_exit_signal_get_ptr = new Efl.Eo.FunctionWrapper<efl_exe_exit_signal_get_api_delegate>(Module, "efl_exe_exit_signal_get");
private static int exit_signal_get(System.IntPtr obj, System.IntPtr pd)
{
Eina.Log.Debug("function efl_exe_exit_signal_get was called");
Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
if (wrapper != null)
{
int _ret_var = default(int);
try
{
_ret_var = ((Exe)wrapper).GetExitSignal();
}
catch (Exception e)
{
Eina.Log.Warning($"Callback error: {e.ToString()}");
Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
}
return _ret_var;
}
else
{
return efl_exe_exit_signal_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
}
}
private static efl_exe_exit_signal_get_delegate efl_exe_exit_signal_get_static_delegate;
[return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))]
private delegate Efl.Core.Env efl_exe_env_get_delegate(System.IntPtr obj, System.IntPtr pd);
[return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))]
public delegate Efl.Core.Env efl_exe_env_get_api_delegate(System.IntPtr obj);
public static Efl.Eo.FunctionWrapper<efl_exe_env_get_api_delegate> efl_exe_env_get_ptr = new Efl.Eo.FunctionWrapper<efl_exe_env_get_api_delegate>(Module, "efl_exe_env_get");
private static Efl.Core.Env env_get(System.IntPtr obj, System.IntPtr pd)
{
Eina.Log.Debug("function efl_exe_env_get was called");
Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
if (wrapper != null)
{
Efl.Core.Env _ret_var = default(Efl.Core.Env);
try
{
_ret_var = ((Exe)wrapper).GetEnv();
}
catch (Exception e)
{
Eina.Log.Warning($"Callback error: {e.ToString()}");
Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
}
return _ret_var;
}
else
{
return efl_exe_env_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
}
}
private static efl_exe_env_get_delegate efl_exe_env_get_static_delegate;
private delegate void efl_exe_env_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Core.Env env);
public delegate void efl_exe_env_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Core.Env env);
public static Efl.Eo.FunctionWrapper<efl_exe_env_set_api_delegate> efl_exe_env_set_ptr = new Efl.Eo.FunctionWrapper<efl_exe_env_set_api_delegate>(Module, "efl_exe_env_set");
private static void env_set(System.IntPtr obj, System.IntPtr pd, Efl.Core.Env env)
{
Eina.Log.Debug("function efl_exe_env_set was called");
Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
if (wrapper != null)
{
try
{
((Exe)wrapper).SetEnv(env);
}
catch (Exception e)
{
Eina.Log.Warning($"Callback error: {e.ToString()}");
Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
}
}
else
{
efl_exe_env_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), env);
}
}
private static efl_exe_env_set_delegate efl_exe_env_set_static_delegate;
private delegate void efl_exe_signal_delegate(System.IntPtr obj, System.IntPtr pd, Efl.ExeSignal sig);
public delegate void efl_exe_signal_api_delegate(System.IntPtr obj, Efl.ExeSignal sig);
public static Efl.Eo.FunctionWrapper<efl_exe_signal_api_delegate> efl_exe_signal_ptr = new Efl.Eo.FunctionWrapper<efl_exe_signal_api_delegate>(Module, "efl_exe_signal");
private static void signal(System.IntPtr obj, System.IntPtr pd, Efl.ExeSignal sig)
{
Eina.Log.Debug("function efl_exe_signal was called");
Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
if (wrapper != null)
{
try
{
((Exe)wrapper).Signal(sig);
}
catch (Exception e)
{
Eina.Log.Warning($"Callback error: {e.ToString()}");
Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
}
}
else
{
efl_exe_signal_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), sig);
}
}
private static efl_exe_signal_delegate efl_exe_signal_static_delegate;
[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]
private delegate System.String efl_core_command_line_command_get_delegate(System.IntPtr obj, System.IntPtr pd);
[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]
public delegate System.String efl_core_command_line_command_get_api_delegate(System.IntPtr obj);
public static Efl.Eo.FunctionWrapper<efl_core_command_line_command_get_api_delegate> efl_core_command_line_command_get_ptr = new Efl.Eo.FunctionWrapper<efl_core_command_line_command_get_api_delegate>(Module, "efl_core_command_line_command_get");
private static System.String command_get(System.IntPtr obj, System.IntPtr pd)
{
Eina.Log.Debug("function efl_core_command_line_command_get was called");
Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
if (wrapper != null)
{
System.String _ret_var = default(System.String);
try
{
_ret_var = ((Exe)wrapper).GetCommand();
}
catch (Exception e)
{
Eina.Log.Warning($"Callback error: {e.ToString()}");
Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
}
return _ret_var;
}
else
{
return efl_core_command_line_command_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
}
}
private static efl_core_command_line_command_get_delegate efl_core_command_line_command_get_static_delegate;
[return: MarshalAs(UnmanagedType.U1)]
private delegate bool efl_core_command_line_command_array_set_delegate(System.IntPtr obj, System.IntPtr pd, System.IntPtr array);
[return: MarshalAs(UnmanagedType.U1)]
public delegate bool efl_core_command_line_command_array_set_api_delegate(System.IntPtr obj, System.IntPtr array);
public static Efl.Eo.FunctionWrapper<efl_core_command_line_command_array_set_api_delegate> efl_core_command_line_command_array_set_ptr = new Efl.Eo.FunctionWrapper<efl_core_command_line_command_array_set_api_delegate>(Module, "efl_core_command_line_command_array_set");
private static bool command_array_set(System.IntPtr obj, System.IntPtr pd, System.IntPtr array)
{
Eina.Log.Debug("function efl_core_command_line_command_array_set was called");
Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
if (wrapper != null)
{
var _in_array = new Eina.Array<System.String>(array, true, true);
bool _ret_var = default(bool);
try
{
_ret_var = ((Exe)wrapper).SetCommandArray(_in_array);
}
catch (Exception e)
{
Eina.Log.Warning($"Callback error: {e.ToString()}");
Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
}
return _ret_var;
}
else
{
return efl_core_command_line_command_array_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), array);
}
}
private static efl_core_command_line_command_array_set_delegate efl_core_command_line_command_array_set_static_delegate;
[return: MarshalAs(UnmanagedType.U1)]
private delegate bool efl_core_command_line_command_string_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String str);
[return: MarshalAs(UnmanagedType.U1)]
public delegate bool efl_core_command_line_command_string_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String str);
public static Efl.Eo.FunctionWrapper<efl_core_command_line_command_string_set_api_delegate> efl_core_command_line_command_string_set_ptr = new Efl.Eo.FunctionWrapper<efl_core_command_line_command_string_set_api_delegate>(Module, "efl_core_command_line_command_string_set");
private static bool command_string_set(System.IntPtr obj, System.IntPtr pd, System.String str)
{
Eina.Log.Debug("function efl_core_command_line_command_string_set was called");
Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
if (wrapper != null)
{
bool _ret_var = default(bool);
try
{
_ret_var = ((Exe)wrapper).SetCommandString(str);
}
catch (Exception e)
{
Eina.Log.Warning($"Callback error: {e.ToString()}");
Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
}
return _ret_var;
}
else
{
return efl_core_command_line_command_string_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), str);
}
}
private static efl_core_command_line_command_string_set_delegate efl_core_command_line_command_string_set_static_delegate;
private delegate System.IntPtr efl_core_command_line_command_access_delegate(System.IntPtr obj, System.IntPtr pd);
public delegate System.IntPtr efl_core_command_line_command_access_api_delegate(System.IntPtr obj);
public static Efl.Eo.FunctionWrapper<efl_core_command_line_command_access_api_delegate> efl_core_command_line_command_access_ptr = new Efl.Eo.FunctionWrapper<efl_core_command_line_command_access_api_delegate>(Module, "efl_core_command_line_command_access");
private static System.IntPtr command_access(System.IntPtr obj, System.IntPtr pd)
{
Eina.Log.Debug("function efl_core_command_line_command_access was called");
Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
if (wrapper != null)
{
Eina.Accessor<System.String> _ret_var = default(Eina.Accessor<System.String>);
try
{
_ret_var = ((Exe)wrapper).CommandAccess();
}
catch (Exception e)
{
Eina.Log.Warning($"Callback error: {e.ToString()}");
Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
}
return _ret_var.Handle;
}
else
{
return efl_core_command_line_command_access_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
}
}
private static efl_core_command_line_command_access_delegate efl_core_command_line_command_access_static_delegate;
[return: MarshalAs(UnmanagedType.U1)]
private delegate bool efl_io_closer_closed_get_delegate(System.IntPtr obj, System.IntPtr pd);
[return: MarshalAs(UnmanagedType.U1)]
public delegate bool efl_io_closer_closed_get_api_delegate(System.IntPtr obj);
public static Efl.Eo.FunctionWrapper<efl_io_closer_closed_get_api_delegate> efl_io_closer_closed_get_ptr = new Efl.Eo.FunctionWrapper<efl_io_closer_closed_get_api_delegate>(Module, "efl_io_closer_closed_get");
private static bool closed_get(System.IntPtr obj, System.IntPtr pd)
{
Eina.Log.Debug("function efl_io_closer_closed_get was called");
Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
if (wrapper != null)
{
bool _ret_var = default(bool);
try
{
_ret_var = ((Exe)wrapper).GetClosed();
}
catch (Exception e)
{
Eina.Log.Warning($"Callback error: {e.ToString()}");
Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
}
return _ret_var;
}
else
{
return efl_io_closer_closed_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
}
}
private static efl_io_closer_closed_get_delegate efl_io_closer_closed_get_static_delegate;
[return: MarshalAs(UnmanagedType.U1)]
private delegate bool efl_io_closer_close_on_exec_get_delegate(System.IntPtr obj, System.IntPtr pd);
[return: MarshalAs(UnmanagedType.U1)]
public delegate bool efl_io_closer_close_on_exec_get_api_delegate(System.IntPtr obj);
public static Efl.Eo.FunctionWrapper<efl_io_closer_close_on_exec_get_api_delegate> efl_io_closer_close_on_exec_get_ptr = new Efl.Eo.FunctionWrapper<efl_io_closer_close_on_exec_get_api_delegate>(Module, "efl_io_closer_close_on_exec_get");
private static bool close_on_exec_get(System.IntPtr obj, System.IntPtr pd)
{
Eina.Log.Debug("function efl_io_closer_close_on_exec_get was called");
Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
if (wrapper != null)
{
bool _ret_var = default(bool);
try
{
_ret_var = ((Exe)wrapper).GetCloseOnExec();
}
catch (Exception e)
{
Eina.Log.Warning($"Callback error: {e.ToString()}");
Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
}
return _ret_var;
}
else
{
return efl_io_closer_close_on_exec_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
}
}
private static efl_io_closer_close_on_exec_get_delegate efl_io_closer_close_on_exec_get_static_delegate;
[return: MarshalAs(UnmanagedType.U1)]
private delegate bool efl_io_closer_close_on_exec_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.U1)] bool close_on_exec);
[return: MarshalAs(UnmanagedType.U1)]
public delegate bool efl_io_closer_close_on_exec_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.U1)] bool close_on_exec);
public static Efl.Eo.FunctionWrapper<efl_io_closer_close_on_exec_set_api_delegate> efl_io_closer_close_on_exec_set_ptr = new Efl.Eo.FunctionWrapper<efl_io_closer_close_on_exec_set_api_delegate>(Module, "efl_io_closer_close_on_exec_set");
private static bool close_on_exec_set(System.IntPtr obj, System.IntPtr pd, bool close_on_exec)
{
Eina.Log.Debug("function efl_io_closer_close_on_exec_set was called");
Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
if (wrapper != null)
{
bool _ret_var = default(bool);
try
{
_ret_var = ((Exe)wrapper).SetCloseOnExec(close_on_exec);
}
catch (Exception e)
{
Eina.Log.Warning($"Callback error: {e.ToString()}");
Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
}
return _ret_var;
}
else
{
return efl_io_closer_close_on_exec_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), close_on_exec);
}
}
private static efl_io_closer_close_on_exec_set_delegate efl_io_closer_close_on_exec_set_static_delegate;
[return: MarshalAs(UnmanagedType.U1)]
private delegate bool efl_io_closer_close_on_invalidate_get_delegate(System.IntPtr obj, System.IntPtr pd);
[return: MarshalAs(UnmanagedType.U1)]
public delegate bool efl_io_closer_close_on_invalidate_get_api_delegate(System.IntPtr obj);
public static Efl.Eo.FunctionWrapper<efl_io_closer_close_on_invalidate_get_api_delegate> efl_io_closer_close_on_invalidate_get_ptr = new Efl.Eo.FunctionWrapper<efl_io_closer_close_on_invalidate_get_api_delegate>(Module, "efl_io_closer_close_on_invalidate_get");
private static bool close_on_invalidate_get(System.IntPtr obj, System.IntPtr pd)
{
Eina.Log.Debug("function efl_io_closer_close_on_invalidate_get was called");
Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
if (wrapper != null)
{
bool _ret_var = default(bool);
try
{
_ret_var = ((Exe)wrapper).GetCloseOnInvalidate();
}
catch (Exception e)
{
Eina.Log.Warning($"Callback error: {e.ToString()}");
Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
}
return _ret_var;
}
else
{
return efl_io_closer_close_on_invalidate_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
}
}
private static efl_io_closer_close_on_invalidate_get_delegate efl_io_closer_close_on_invalidate_get_static_delegate;
private delegate void efl_io_closer_close_on_invalidate_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.U1)] bool close_on_invalidate);
public delegate void efl_io_closer_close_on_invalidate_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.U1)] bool close_on_invalidate);
public static Efl.Eo.FunctionWrapper<efl_io_closer_close_on_invalidate_set_api_delegate> efl_io_closer_close_on_invalidate_set_ptr = new Efl.Eo.FunctionWrapper<efl_io_closer_close_on_invalidate_set_api_delegate>(Module, "efl_io_closer_close_on_invalidate_set");
private static void close_on_invalidate_set(System.IntPtr obj, System.IntPtr pd, bool close_on_invalidate)
{
Eina.Log.Debug("function efl_io_closer_close_on_invalidate_set was called");
Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
if (wrapper != null)
{
try
{
((Exe)wrapper).SetCloseOnInvalidate(close_on_invalidate);
}
catch (Exception e)
{
Eina.Log.Warning($"Callback error: {e.ToString()}");
Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
}
}
else
{
efl_io_closer_close_on_invalidate_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), close_on_invalidate);
}
}
private static efl_io_closer_close_on_invalidate_set_delegate efl_io_closer_close_on_invalidate_set_static_delegate;
private delegate Eina.Error efl_io_closer_close_delegate(System.IntPtr obj, System.IntPtr pd);
public delegate Eina.Error efl_io_closer_close_api_delegate(System.IntPtr obj);
public static Efl.Eo.FunctionWrapper<efl_io_closer_close_api_delegate> efl_io_closer_close_ptr = new Efl.Eo.FunctionWrapper<efl_io_closer_close_api_delegate>(Module, "efl_io_closer_close");
private static Eina.Error close(System.IntPtr obj, System.IntPtr pd)
{
Eina.Log.Debug("function efl_io_closer_close was called");
Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
if (wrapper != null)
{
Eina.Error _ret_var = default(Eina.Error);
try
{
_ret_var = ((Exe)wrapper).Close();
}
catch (Exception e)
{
Eina.Log.Warning($"Callback error: {e.ToString()}");
Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
}
return _ret_var;
}
else
{
return efl_io_closer_close_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
}
}
private static efl_io_closer_close_delegate efl_io_closer_close_static_delegate;
[return: MarshalAs(UnmanagedType.U1)]
private delegate bool efl_io_reader_can_read_get_delegate(System.IntPtr obj, System.IntPtr pd);
[return: MarshalAs(UnmanagedType.U1)]
public delegate bool efl_io_reader_can_read_get_api_delegate(System.IntPtr obj);
public static Efl.Eo.FunctionWrapper<efl_io_reader_can_read_get_api_delegate> efl_io_reader_can_read_get_ptr = new Efl.Eo.FunctionWrapper<efl_io_reader_can_read_get_api_delegate>(Module, "efl_io_reader_can_read_get");
private static bool can_read_get(System.IntPtr obj, System.IntPtr pd)
{
Eina.Log.Debug("function efl_io_reader_can_read_get was called");
Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
if (wrapper != null)
{
bool _ret_var = default(bool);
try
{
_ret_var = ((Exe)wrapper).GetCanRead();
}
catch (Exception e)
{
Eina.Log.Warning($"Callback error: {e.ToString()}");
Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
}
return _ret_var;
}
else
{
return efl_io_reader_can_read_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
}
}
private static efl_io_reader_can_read_get_delegate efl_io_reader_can_read_get_static_delegate;
private delegate void efl_io_reader_can_read_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.U1)] bool can_read);
public delegate void efl_io_reader_can_read_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.U1)] bool can_read);
public static Efl.Eo.FunctionWrapper<efl_io_reader_can_read_set_api_delegate> efl_io_reader_can_read_set_ptr = new Efl.Eo.FunctionWrapper<efl_io_reader_can_read_set_api_delegate>(Module, "efl_io_reader_can_read_set");
private static void can_read_set(System.IntPtr obj, System.IntPtr pd, bool can_read)
{
Eina.Log.Debug("function efl_io_reader_can_read_set was called");
Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
if (wrapper != null)
{
try
{
((Exe)wrapper).SetCanRead(can_read);
}
catch (Exception e)
{
Eina.Log.Warning($"Callback error: {e.ToString()}");
Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
}
}
else
{
efl_io_reader_can_read_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), can_read);
}
}
private static efl_io_reader_can_read_set_delegate efl_io_reader_can_read_set_static_delegate;
[return: MarshalAs(UnmanagedType.U1)]
private delegate bool efl_io_reader_eos_get_delegate(System.IntPtr obj, System.IntPtr pd);
[return: MarshalAs(UnmanagedType.U1)]
public delegate bool efl_io_reader_eos_get_api_delegate(System.IntPtr obj);
public static Efl.Eo.FunctionWrapper<efl_io_reader_eos_get_api_delegate> efl_io_reader_eos_get_ptr = new Efl.Eo.FunctionWrapper<efl_io_reader_eos_get_api_delegate>(Module, "efl_io_reader_eos_get");
private static bool eos_get(System.IntPtr obj, System.IntPtr pd)
{
Eina.Log.Debug("function efl_io_reader_eos_get was called");
Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
if (wrapper != null)
{
bool _ret_var = default(bool);
try
{
_ret_var = ((Exe)wrapper).GetEos();
}
catch (Exception e)
{
Eina.Log.Warning($"Callback error: {e.ToString()}");
Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
}
return _ret_var;
}
else
{
return efl_io_reader_eos_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
}
}
private static efl_io_reader_eos_get_delegate efl_io_reader_eos_get_static_delegate;
private delegate void efl_io_reader_eos_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.U1)] bool is_eos);
public delegate void efl_io_reader_eos_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.U1)] bool is_eos);
public static Efl.Eo.FunctionWrapper<efl_io_reader_eos_set_api_delegate> efl_io_reader_eos_set_ptr = new Efl.Eo.FunctionWrapper<efl_io_reader_eos_set_api_delegate>(Module, "efl_io_reader_eos_set");
private static void eos_set(System.IntPtr obj, System.IntPtr pd, bool is_eos)
{
Eina.Log.Debug("function efl_io_reader_eos_set was called");
Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
if (wrapper != null)
{
try
{
((Exe)wrapper).SetEos(is_eos);
}
catch (Exception e)
{
Eina.Log.Warning($"Callback error: {e.ToString()}");
Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
}
}
else
{
efl_io_reader_eos_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), is_eos);
}
}
private static efl_io_reader_eos_set_delegate efl_io_reader_eos_set_static_delegate;
private delegate Eina.Error efl_io_reader_read_delegate(System.IntPtr obj, System.IntPtr pd, ref Eina.RwSlice rw_slice);
public delegate Eina.Error efl_io_reader_read_api_delegate(System.IntPtr obj, ref Eina.RwSlice rw_slice);
public static Efl.Eo.FunctionWrapper<efl_io_reader_read_api_delegate> efl_io_reader_read_ptr = new Efl.Eo.FunctionWrapper<efl_io_reader_read_api_delegate>(Module, "efl_io_reader_read");
private static Eina.Error read(System.IntPtr obj, System.IntPtr pd, ref Eina.RwSlice rw_slice)
{
Eina.Log.Debug("function efl_io_reader_read was called");
Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
if (wrapper != null)
{
Eina.Error _ret_var = default(Eina.Error);
try
{
_ret_var = ((Exe)wrapper).Read(ref rw_slice);
}
catch (Exception e)
{
Eina.Log.Warning($"Callback error: {e.ToString()}");
Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
}
return _ret_var;
}
else
{
return efl_io_reader_read_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), ref rw_slice);
}
}
private static efl_io_reader_read_delegate efl_io_reader_read_static_delegate;
[return: MarshalAs(UnmanagedType.U1)]
private delegate bool efl_io_writer_can_write_get_delegate(System.IntPtr obj, System.IntPtr pd);
[return: MarshalAs(UnmanagedType.U1)]
public delegate bool efl_io_writer_can_write_get_api_delegate(System.IntPtr obj);
public static Efl.Eo.FunctionWrapper<efl_io_writer_can_write_get_api_delegate> efl_io_writer_can_write_get_ptr = new Efl.Eo.FunctionWrapper<efl_io_writer_can_write_get_api_delegate>(Module, "efl_io_writer_can_write_get");
private static bool can_write_get(System.IntPtr obj, System.IntPtr pd)
{
Eina.Log.Debug("function efl_io_writer_can_write_get was called");
Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
if (wrapper != null)
{
bool _ret_var = default(bool);
try
{
_ret_var = ((Exe)wrapper).GetCanWrite();
}
catch (Exception e)
{
Eina.Log.Warning($"Callback error: {e.ToString()}");
Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
}
return _ret_var;
}
else
{
return efl_io_writer_can_write_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
}
}
private static efl_io_writer_can_write_get_delegate efl_io_writer_can_write_get_static_delegate;
private delegate void efl_io_writer_can_write_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.U1)] bool can_write);
public delegate void efl_io_writer_can_write_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.U1)] bool can_write);
public static Efl.Eo.FunctionWrapper<efl_io_writer_can_write_set_api_delegate> efl_io_writer_can_write_set_ptr = new Efl.Eo.FunctionWrapper<efl_io_writer_can_write_set_api_delegate>(Module, "efl_io_writer_can_write_set");
private static void can_write_set(System.IntPtr obj, System.IntPtr pd, bool can_write)
{
Eina.Log.Debug("function efl_io_writer_can_write_set was called");
Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
if (wrapper != null)
{
try
{
((Exe)wrapper).SetCanWrite(can_write);
}
catch (Exception e)
{
Eina.Log.Warning($"Callback error: {e.ToString()}");
Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
}
}
else
{
efl_io_writer_can_write_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), can_write);
}
}
private static efl_io_writer_can_write_set_delegate efl_io_writer_can_write_set_static_delegate;
private delegate Eina.Error efl_io_writer_write_delegate(System.IntPtr obj, System.IntPtr pd, ref Eina.Slice slice, ref Eina.Slice remaining);
public delegate Eina.Error efl_io_writer_write_api_delegate(System.IntPtr obj, ref Eina.Slice slice, ref Eina.Slice remaining);
public static Efl.Eo.FunctionWrapper<efl_io_writer_write_api_delegate> efl_io_writer_write_ptr = new Efl.Eo.FunctionWrapper<efl_io_writer_write_api_delegate>(Module, "efl_io_writer_write");
private static Eina.Error write(System.IntPtr obj, System.IntPtr pd, ref Eina.Slice slice, ref Eina.Slice remaining)
{
Eina.Log.Debug("function efl_io_writer_write was called");
Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
if (wrapper != null)
{
remaining = default(Eina.Slice); Eina.Error _ret_var = default(Eina.Error);
try
{
_ret_var = ((Exe)wrapper).Write(ref slice, ref remaining);
}
catch (Exception e)
{
Eina.Log.Warning($"Callback error: {e.ToString()}");
Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
}
return _ret_var;
}
else
{
return efl_io_writer_write_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), ref slice, ref remaining);
}
}
private static efl_io_writer_write_delegate efl_io_writer_write_static_delegate;
#pragma warning restore CA1707, SA1300, SA1600
}
}
}
namespace Efl {
/// <summary>No description supplied.</summary>
public enum ExeSignal
{
Int = 0,
Quit = 1,
Term = 2,
Kill = 3,
Cont = 4,
Stop = 5,
Hup = 6,
Usr1 = 7,
Usr2 = 8,
}
}
namespace Efl {
/// <summary>No description supplied.</summary>
public enum ExeFlags
{
None = 0,
GroupLeader = 1,
ExitWithParent = 2,
HideIo = 4,
}
}
| 49.35513 | 988 | 0.63541 | [
"Apache-2.0"
] | dalinui/TizenFX | internals/src/EflSharp/EflSharp/efl/efl_exe.eo.cs | 87,556 | C# |
// Copyright (c) Microsoft Open Technologies, Inc. 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.AspNet.Mvc.OptionDescriptors;
using Microsoft.Framework.OptionsModel;
using Moq;
using Xunit;
namespace Microsoft.AspNet.Mvc.Razor.OptionDescriptors
{
public class DefaultViewLocationExpanderProviderTest
{
[Fact]
public void ViewLocationExpanders_ReturnsActivatedListOfExpanders()
{
// Arrange
var service = Mock.Of<ITestService>();
var expander = Mock.Of<IViewLocationExpander>();
var type = typeof(TestViewLocationExpander);
var serviceProvider = new Mock<IServiceProvider>();
serviceProvider.Setup(p => p.GetService(typeof(ITestService)))
.Returns(service);
var typeActivatorCache = new DefaultTypeActivatorCache();
var options = new RazorViewEngineOptions();
options.ViewLocationExpanders.Add(type);
options.ViewLocationExpanders.Add(expander);
var accessor = new Mock<IOptions<RazorViewEngineOptions>>();
accessor.SetupGet(a => a.Options)
.Returns(options);
var provider = new DefaultViewLocationExpanderProvider(accessor.Object,
typeActivatorCache,
serviceProvider.Object);
// Act
var result = provider.ViewLocationExpanders;
// Assert
Assert.Equal(2, result.Count);
var testExpander = Assert.IsType<TestViewLocationExpander>(result[0]);
Assert.Same(service, testExpander.Service);
Assert.Same(expander, result[1]);
}
private class TestViewLocationExpander : IViewLocationExpander
{
public TestViewLocationExpander(ITestService service)
{
Service = service;
}
public ITestService Service { get; private set; }
public IEnumerable<string> ExpandViewLocations(ViewLocationExpanderContext context,
IEnumerable<string> viewLocations)
{
throw new NotImplementedException();
}
public void PopulateValues(ViewLocationExpanderContext context)
{
throw new NotImplementedException();
}
}
public interface ITestService
{
}
}
}
| 37.763889 | 111 | 0.589923 | [
"Apache-2.0"
] | walkeeperY/ManagementSystem | test/Microsoft.AspNet.Mvc.Razor.Test/OptionDescriptors/DefaultViewLocationExpanderProviderTest.cs | 2,721 | 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.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.
/// </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 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.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 BatchStopJobRun
/// <summary>
/// Stops one or more job runs for a specified Job.
/// </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 may be a <code>GrokClassifier</code>,
/// an <code>XMLClassifier</code>, or abbrev <code>JsonClassifier</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.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 either the <i>s3Targets</i> or the
/// <i>jdbcTargets</i> 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.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.
/// </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.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 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.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.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 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.
/// </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. If the job 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 DeleteTable
/// <summary>
/// Removes a table definition from the Data Catalog.
/// </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.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.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.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.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 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.
/// </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.
/// </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.
/// </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 jobs.
/// </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.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.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 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.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.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.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.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 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.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.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 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, does nothing.
/// </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>
/// Runs a job.
/// </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="http://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 UpdateClassifier
/// <summary>
/// Modifies an existing classifier (a <code>GrokClassifier</code>, <code>XMLClassifier</code>,
/// or <code>JsonClassifier</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.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.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.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.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.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.581787 | 177 | 0.666586 | [
"Apache-2.0"
] | HaiNguyenMediaStep/aws-sdk-net | sdk/src/Services/Glue/Generated/_bcl35/IAmazonGlue.cs | 227,663 | C# |
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
namespace ClickHouse.Ado.Impl.ATG.Insert {
internal class Token {
public int kind; // token kind
public int pos; // token position in bytes in the source text (starting at 0)
public int charPos; // token position in characters in the source text (starting at 0)
public int col; // token column (starting at 1)
public int line; // token line (starting at 1)
public string val; // token value
public Token next; // ML 2005-03-11 Tokens are kept in linked list
}
//-----------------------------------------------------------------------------------
// Buffer
//-----------------------------------------------------------------------------------
internal class Buffer {
// This Buffer supports the following cases:
// 1) seekable stream (file)
// a) whole stream in buffer
// b) part of stream in buffer
// 2) non seekable stream (network, console)
public const int EOF = char.MaxValue + 1;
const int MIN_BUFFER_LENGTH = 1024; // 1KB
const int MAX_BUFFER_LENGTH = MIN_BUFFER_LENGTH * 64; // 64KB
byte[] buf; // input buffer
int bufStart; // position of first byte in buffer relative to input stream
int bufLen; // length of buffer
int fileLen; // length of input stream (may change if the stream is no file)
int bufPos; // current position in buffer
Stream stream; // input stream (seekable)
bool isUserStream; // was the stream opened by the user?
public Buffer (Stream s, bool isUserStream) {
stream = s; this.isUserStream = isUserStream;
if (stream.CanSeek) {
fileLen = (int) stream.Length;
bufLen = Math.Min(fileLen, MAX_BUFFER_LENGTH);
bufStart = Int32.MaxValue; // nothing in the buffer so far
} else {
fileLen = bufLen = bufStart = 0;
}
buf = new byte[(bufLen>0) ? bufLen : MIN_BUFFER_LENGTH];
if (fileLen > 0) Pos = 0; // setup buffer to position 0 (start)
else bufPos = 0; // index 0 is already after the file, thus Pos = 0 is invalid
if (bufLen == fileLen && stream.CanSeek) Close();
}
protected Buffer(Buffer b) { // called in UTF8Buffer constructor
buf = b.buf;
bufStart = b.bufStart;
bufLen = b.bufLen;
fileLen = b.fileLen;
bufPos = b.bufPos;
stream = b.stream;
// keep destructor from closing the stream
b.stream = null;
isUserStream = b.isUserStream;
}
~Buffer() { Close(); }
protected void Close() {
if (!isUserStream && stream != null) {
#if !CLASSIC_FRAMEWORK
stream.Dispose();
#else
stream.Close();
#endif
stream = null;
}
}
public virtual int Read () {
if (bufPos < bufLen) {
return buf[bufPos++];
} else if (Pos < fileLen) {
Pos = Pos; // shift buffer start to Pos
return buf[bufPos++];
} else if (stream != null && !stream.CanSeek && ReadNextStreamChunk() > 0) {
return buf[bufPos++];
} else {
return EOF;
}
}
public int Peek () {
int curPos = Pos;
int ch = Read();
Pos = curPos;
return ch;
}
// beg .. begin, zero-based, inclusive, in byte
// end .. end, zero-based, exclusive, in byte
public string GetString (int beg, int end) {
int len = 0;
char[] buf = new char[end - beg];
int oldPos = Pos;
Pos = beg;
while (Pos < end) buf[len++] = (char) Read();
Pos = oldPos;
return new String(buf, 0, len);
}
public int Pos {
get { return bufPos + bufStart; }
set {
if (value >= fileLen && stream != null && !stream.CanSeek) {
// Wanted position is after buffer and the stream
// is not seek-able e.g. network or console,
// thus we have to read the stream manually till
// the wanted position is in sight.
while (value >= fileLen && ReadNextStreamChunk() > 0);
}
if (value < 0 || value > fileLen) {
throw new FatalError("buffer out of bounds access, position: " + value);
}
if (value >= bufStart && value < bufStart + bufLen) { // already in buffer
bufPos = value - bufStart;
} else if (stream != null) { // must be swapped in
stream.Seek(value, SeekOrigin.Begin);
bufLen = stream.Read(buf, 0, buf.Length);
bufStart = value; bufPos = 0;
} else {
// set the position to the end of the file, Pos will return fileLen.
bufPos = fileLen - bufStart;
}
}
}
// Read the next chunk of bytes from the stream, increases the buffer
// if needed and updates the fields fileLen and bufLen.
// Returns the number of bytes read.
private int ReadNextStreamChunk() {
int free = buf.Length - bufLen;
if (free == 0) {
// in the case of a growing input stream
// we can neither seek in the stream, nor can we
// foresee the maximum length, thus we must adapt
// the buffer size on demand.
byte[] newBuf = new byte[bufLen * 2];
Array.Copy(buf, newBuf, bufLen);
buf = newBuf;
free = bufLen;
}
int read = stream.Read(buf, bufLen, free);
if (read > 0) {
fileLen = bufLen = (bufLen + read);
return read;
}
// end of stream reached
return 0;
}
}
//-----------------------------------------------------------------------------------
// UTF8Buffer
//-----------------------------------------------------------------------------------
internal class UTF8Buffer: Buffer {
public UTF8Buffer(Buffer b): base(b) {}
public override int Read() {
int ch;
do {
ch = base.Read();
// until we find a utf8 start (0xxxxxxx or 11xxxxxx)
} while ((ch >= 128) && ((ch & 0xC0) != 0xC0) && (ch != EOF));
if (ch < 128 || ch == EOF) {
// nothing to do, first 127 chars are the same in ascii and utf8
// 0xxxxxxx or end of file character
} else if ((ch & 0xF0) == 0xF0) {
// 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
int c1 = ch & 0x07; ch = base.Read();
int c2 = ch & 0x3F; ch = base.Read();
int c3 = ch & 0x3F; ch = base.Read();
int c4 = ch & 0x3F;
ch = (((((c1 << 6) | c2) << 6) | c3) << 6) | c4;
} else if ((ch & 0xE0) == 0xE0) {
// 1110xxxx 10xxxxxx 10xxxxxx
int c1 = ch & 0x0F; ch = base.Read();
int c2 = ch & 0x3F; ch = base.Read();
int c3 = ch & 0x3F;
ch = (((c1 << 6) | c2) << 6) | c3;
} else if ((ch & 0xC0) == 0xC0) {
// 110xxxxx 10xxxxxx
int c1 = ch & 0x1F; ch = base.Read();
int c2 = ch & 0x3F;
ch = (c1 << 6) | c2;
}
return ch;
}
}
//-----------------------------------------------------------------------------------
// Scanner
//-----------------------------------------------------------------------------------
internal class Scanner {
const char EOL = '\n';
const int eofSym = 0; /* pdt */
const int maxT = 18;
const int noSym = 18;
char valCh; // current input character (for token.val)
public Buffer buffer; // scanner buffer
Token t; // current token
int ch; // current input character
int pos; // byte position of current character
int charPos; // position by unicode characters starting with 0
int col; // column number of current character
int line; // line number of current character
int oldEols; // EOLs that appeared in a comment;
static readonly Dictionary<int,int> start; // maps first token character to start state
Token tokens; // list of tokens already peeked (first token is a dummy)
Token pt; // current peek token
char[] tval = new char[128]; // text of current token
int tlen; // length of current token
static Scanner() {
start = new Dictionary<int,int>(128);
for (int i = 95; i <= 95; ++i) start[i] = 13;
for (int i = 97; i <= 122; ++i) start[i] = 13;
for (int i = 48; i <= 57; ++i) start[i] = 9;
start[96] = 3;
start[34] = 4;
start[39] = 6;
start[46] = 26;
for (int i = 43; i <= 43; ++i) start[i] = 8;
for (int i = 45; i <= 45; ++i) start[i] = 8;
start[44] = 18;
start[64] = 19;
start[58] = 20;
start[91] = 21;
start[93] = 22;
start[40] = 23;
start[41] = 24;
start[59] = 25;
start[Buffer.EOF] = -1;
}
public Scanner (string fileName) {
try {
Stream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read);
buffer = new Buffer(stream, false);
Init();
} catch (IOException) {
throw new FatalError("Cannot open file " + fileName);
}
}
public Scanner (Stream s) {
buffer = new UTF8Buffer(new Buffer(s, true));
Init();
}
void Init() {
pos = -1; line = 1; col = 0; charPos = -1;
oldEols = 0;
NextCh();
if (ch == 0xEF) { // check optional byte order mark for UTF-8
NextCh(); int ch1 = ch;
NextCh(); int ch2 = ch;
if (ch1 != 0xBB || ch2 != 0xBF) {
throw new FatalError(String.Format("illegal byte order mark: EF {0,2:X} {1,2:X}", ch1, ch2));
}
buffer = new UTF8Buffer(buffer); col = 0; charPos = -1;
NextCh();
}
pt = tokens = new Token(); // first token is a dummy
}
void NextCh() {
if (oldEols > 0) { ch = EOL; oldEols--; }
else {
pos = buffer.Pos;
// buffer reads unicode chars, if UTF8 has been detected
ch = buffer.Read(); col++; charPos++;
// replace isolated '\r' by '\n' in order to make
// eol handling uniform across Windows, Unix and Mac
if (ch == '\r' && buffer.Peek() != '\n') ch = EOL;
if (ch == EOL) { line++; col = 0; }
}
if (ch != Buffer.EOF) {
valCh = (char) ch;
ch = char.ToLower((char) ch);
}
}
void AddCh() {
if (tlen >= tval.Length) {
char[] newBuf = new char[2 * tval.Length];
Array.Copy(tval, 0, newBuf, 0, tval.Length);
tval = newBuf;
}
if (ch != Buffer.EOF) {
tval[tlen++] = valCh;
NextCh();
}
}
void CheckLiteral() {
switch (t.val.ToLower()) {
case "insert": t.kind = 6; break;
case "values": t.kind = 7; break;
case "into": t.kind = 8; break;
default: break;
}
}
Token NextToken() {
while (ch == ' ' ||
ch >= 9 && ch <= 10 || ch == 13
) NextCh();
int recKind = noSym;
int recEnd = pos;
t = new Token();
t.pos = pos; t.col = col; t.line = line; t.charPos = charPos;
int state;
if (start.ContainsKey(ch)) { state = (int) start[ch]; }
else { state = 0; }
tlen = 0; AddCh();
switch (state) {
case -1: { t.kind = eofSym; break; } // NextCh already done
case 0: {
if (recKind != noSym) {
tlen = recEnd - t.pos;
SetScannerBehindT();
}
t.kind = recKind; break;
} // NextCh already done
case 1:
if (ch == '_' || ch >= 'a' && ch <= 'z') {AddCh(); goto case 2;}
else {goto case 0;}
case 2:
recEnd = pos; recKind = 1;
if (ch >= '0' && ch <= '9' || ch == '_' || ch >= 'a' && ch <= 'z') {AddCh(); goto case 2;}
else {t.kind = 1; t.val = new String(tval, 0, tlen); CheckLiteral(); return t;}
case 3:
if (ch <= '!' || ch >= '#' && ch <= '&' || ch >= '(' && ch <= '[' || ch >= ']' && ch <= '_' || ch >= 'a' && ch <= 65535) {AddCh(); goto case 3;}
else if (ch == '`') {AddCh(); goto case 14;}
else if (ch == 92) {AddCh(); goto case 15;}
else {goto case 0;}
case 4:
if (ch <= '!' || ch >= '#' && ch <= '&' || ch >= '(' && ch <= '[' || ch >= ']' && ch <= 65535) {AddCh(); goto case 4;}
else if (ch == '"') {AddCh(); goto case 5;}
else if (ch == 92) {AddCh(); goto case 16;}
else {goto case 0;}
case 5:
{t.kind = 3; break;}
case 6:
if (ch <= '!' || ch >= '#' && ch <= '&' || ch >= '(' && ch <= '[' || ch >= ']' && ch <= 65535) {AddCh(); goto case 6;}
else if (ch == 39) {AddCh(); goto case 7;}
else if (ch == 92) {AddCh(); goto case 17;}
else {goto case 0;}
case 7:
{t.kind = 4; break;}
case 8:
if (ch >= '0' && ch <= '9') {AddCh(); goto case 9;}
else if (ch == '.') {AddCh(); goto case 11;}
else {goto case 0;}
case 9:
recEnd = pos; recKind = 5;
if (ch >= '0' && ch <= '9') {AddCh(); goto case 9;}
else if (ch == '.') {AddCh(); goto case 10;}
else {t.kind = 5; break;}
case 10:
recEnd = pos; recKind = 5;
if (ch >= '0' && ch <= '9') {AddCh(); goto case 10;}
else {t.kind = 5; break;}
case 11:
if (ch >= '0' && ch <= '9') {AddCh(); goto case 12;}
else {goto case 0;}
case 12:
recEnd = pos; recKind = 5;
if (ch >= '0' && ch <= '9') {AddCh(); goto case 12;}
else {t.kind = 5; break;}
case 13:
recEnd = pos; recKind = 1;
if (ch >= '0' && ch <= '9' || ch == '_' || ch >= 'a' && ch <= 'z') {AddCh(); goto case 13;}
else if (ch == '.') {AddCh(); goto case 1;}
else {t.kind = 1; t.val = new String(tval, 0, tlen); CheckLiteral(); return t;}
case 14:
recEnd = pos; recKind = 2;
if (ch <= '!' || ch >= '#' && ch <= '&' || ch >= '(' && ch <= '[' || ch >= ']' && ch <= '_' || ch >= 'a' && ch <= 65535) {AddCh(); goto case 3;}
else if (ch == '`') {AddCh(); goto case 14;}
else if (ch == 92) {AddCh(); goto case 15;}
else {t.kind = 2; break;}
case 15:
if (ch == 39 || ch == 92) {AddCh(); goto case 3;}
else {goto case 0;}
case 16:
if (ch == 39 || ch == 92) {AddCh(); goto case 4;}
else {goto case 0;}
case 17:
if (ch == 39 || ch == 92) {AddCh(); goto case 6;}
else {goto case 0;}
case 18:
{t.kind = 10; break;}
case 19:
{t.kind = 11; break;}
case 20:
{t.kind = 12; break;}
case 21:
{t.kind = 13; break;}
case 22:
{t.kind = 14; break;}
case 23:
{t.kind = 15; break;}
case 24:
{t.kind = 16; break;}
case 25:
{t.kind = 17; break;}
case 26:
recEnd = pos; recKind = 9;
if (ch >= '0' && ch <= '9') {AddCh(); goto case 12;}
else {t.kind = 9; break;}
}
t.val = new String(tval, 0, tlen);
return t;
}
private void SetScannerBehindT() {
buffer.Pos = t.pos;
NextCh();
line = t.line; col = t.col; charPos = t.charPos;
for (int i = 0; i < tlen; i++) NextCh();
}
// get the next token (possibly a token already seen during peeking)
public Token Scan () {
if (tokens.next == null) {
return NextToken();
} else {
pt = tokens = tokens.next;
return tokens;
}
}
// peek for the next token, ignore pragmas
public Token Peek () {
do {
if (pt.next == null) {
pt.next = NextToken();
}
pt = pt.next;
} while (pt.kind > maxT); // skip pragmas
return pt;
}
// make sure that peeking starts at the current scan position
public void ResetPeek () { pt = tokens; }
} // end Scanner
} | 29.722689 | 148 | 0.545943 | [
"MIT"
] | Fabuza/ClickHouse-Net | ClickHouse.Ado/Impl/ATG/Insert/Scanner.cs | 14,148 | C# |
using System.Collections.Generic;
using System.Diagnostics;
namespace Lucene.Net.Search
{
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.
*/
/// <summary>
/// A Scorer for queries with a required part and an optional part.
/// Delays skipTo() on the optional part until a score() is needed.
/// <br>
/// this <code>Scorer</code> implements <seealso cref="Scorer#advance(int)"/>.
/// </summary>
internal class ReqOptSumScorer : Scorer
{
/// <summary>
/// The scorers passed from the constructor.
/// These are set to null as soon as their next() or skipTo() returns false.
/// </summary>
private Scorer ReqScorer;
private Scorer OptScorer;
/// <summary>
/// Construct a <code>ReqOptScorer</code>. </summary>
/// <param name="reqScorer"> The required scorer. this must match. </param>
/// <param name="optScorer"> The optional scorer. this is used for scoring only. </param>
public ReqOptSumScorer(Scorer reqScorer, Scorer optScorer)
: base(reqScorer.weight)
{
Debug.Assert(reqScorer != null);
Debug.Assert(optScorer != null);
this.ReqScorer = reqScorer;
this.OptScorer = optScorer;
}
public override int NextDoc()
{
return ReqScorer.NextDoc();
}
public override int Advance(int target)
{
return ReqScorer.Advance(target);
}
public override int DocID()
{
return ReqScorer.DocID();
}
/// <summary>
/// Returns the score of the current document matching the query.
/// Initially invalid, until <seealso cref="#nextDoc()"/> is called the first time. </summary>
/// <returns> The score of the required scorer, eventually increased by the score
/// of the optional scorer when it also matches the current document. </returns>
public override float Score()
{
// TODO: sum into a double and cast to float if we ever send required clauses to BS1
int curDoc = ReqScorer.DocID();
float reqScore = ReqScorer.Score();
if (OptScorer == null)
{
return reqScore;
}
int optScorerDoc = OptScorer.DocID();
if (optScorerDoc < curDoc && (optScorerDoc = OptScorer.Advance(curDoc)) == NO_MORE_DOCS)
{
OptScorer = null;
return reqScore;
}
return optScorerDoc == curDoc ? reqScore + OptScorer.Score() : reqScore;
}
public override int Freq()
{
// we might have deferred advance()
Score();
return (OptScorer != null && OptScorer.DocID() == ReqScorer.DocID()) ? 2 : 1;
}
public override ICollection<ChildScorer> Children
{
get
{
List<ChildScorer> children = new List<ChildScorer>(2);
children.Add(new ChildScorer(ReqScorer, "MUST"));
children.Add(new ChildScorer(OptScorer, "SHOULD"));
return children;
}
}
public override long Cost()
{
return ReqScorer.Cost();
}
}
} | 35.991304 | 102 | 0.584199 | [
"Apache-2.0"
] | BlueCurve-Team/lucenenet | src/Lucene.Net.Core/Search/ReqOptSumScorer.cs | 4,139 | C# |
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class FriedShrimps : Dish
{
public FriedShrimps() : base()
{
this.reward = 90;
this.successProbability = 0.72f;
this.sessionProbability = this.successProbability;
//Ingredients
GetIngredient get_ingredient = new GetIngredient();
Ingredient ing1 = new Ingredient();
ing1.ingredient = IngredientType.Shrimp;
Ingredient ing2 = new Ingredient();
ing2.ingredient = IngredientType.SoySauce;
get_ingredient.AddIngredient(ing1);
get_ingredient.AddIngredient(ing2);
//Actions
Tasks listOfActions = new Tasks();
listOfActions.AddRequest(get_ingredient);
///////////////////////////////////////////////////////
CutIngredient cut = new CutIngredient();
cut.UpdateTimer(defaultOverallTime * 0.3f);
//Actions
Tasks listOfActions2 = new Tasks();
listOfActions2.AddRequest(cut);
///////////////////////////////////////////////////////
CookIngredients cook = new CookIngredients();
cook.UpdateTimer(defaultOverallTime * 0.4f);
//Actions
Tasks listOfActions3 = new Tasks();
listOfActions3.AddRequest(cook);
///////////////////////////////////////////////////////
AssembleDish assemble = new AssembleDish();
assemble.UpdateTimer(defaultOverallTime * 0.2f);
//Actions
Tasks listOfActions4 = new Tasks();
listOfActions4.AddRequest(assemble);
///////////////////////////////////////////////////////
//Add actions
AddRequest(listOfActions);
AddRequest(listOfActions2);
AddRequest(listOfActions3);
AddRequest(listOfActions4);
Name = "FriedShrimps";
}
}
| 29.121212 | 64 | 0.537461 | [
"MIT"
] | leiapollos/Kitchen-Hell | Assets/Scripts/Dishes/FriedShrimps.cs | 1,924 | C# |
using BenchmarkDotNet.Attributes;
using LibraryTests.Tests.BaseClasses;
using System;
namespace LibraryTests.Tests
{
public class ArrayCopyTests : TestBaseClass
{
private byte[] source, destination;
[Benchmark(Baseline = true, Description = "Copy using Array.Copy()")]
public void CopyArray()
{
Array.Copy(source, destination, Count);
}
[Benchmark(Description = "Copy using Buffer.MemoryCopy<T>")]
public unsafe void CopyUsingBufferMemoryCopy()
{
fixed (byte* pinnedDestination = destination)
fixed (byte* pinnedSource = source)
{
Buffer.MemoryCopy(pinnedSource, pinnedDestination, Count, Count);
}
}
[GlobalSetup]
public void SetUp()
{
source = new byte[Count];
destination = new byte[Count];
}
}
} | 27.470588 | 81 | 0.577088 | [
"Apache-2.0"
] | JaCraig/I-Got-Bored | LibraryTests/Tests/ArrayTests.cs | 936 | C# |
#pragma warning disable 108 // new keyword hiding
#pragma warning disable 114 // new keyword hiding
namespace Windows.Perception.Spatial.Surfaces
{
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __MACOS__
[global::Uno.NotImplemented]
#endif
public partial class SpatialSurfaceInfo
{
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __MACOS__
[global::Uno.NotImplemented]
public global::System.Guid Id
{
get
{
throw new global::System.NotImplementedException("The member Guid SpatialSurfaceInfo.Id is not implemented in Uno.");
}
}
#endif
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __MACOS__
[global::Uno.NotImplemented]
public global::System.DateTimeOffset UpdateTime
{
get
{
throw new global::System.NotImplementedException("The member DateTimeOffset SpatialSurfaceInfo.UpdateTime is not implemented in Uno.");
}
}
#endif
// Forced skipping of method Windows.Perception.Spatial.Surfaces.SpatialSurfaceInfo.Id.get
// Forced skipping of method Windows.Perception.Spatial.Surfaces.SpatialSurfaceInfo.UpdateTime.get
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __MACOS__
[global::Uno.NotImplemented]
public global::Windows.Perception.Spatial.SpatialBoundingOrientedBox? TryGetBounds( global::Windows.Perception.Spatial.SpatialCoordinateSystem coordinateSystem)
{
throw new global::System.NotImplementedException("The member SpatialBoundingOrientedBox? SpatialSurfaceInfo.TryGetBounds(SpatialCoordinateSystem coordinateSystem) is not implemented in Uno.");
}
#endif
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __MACOS__
[global::Uno.NotImplemented]
public global::Windows.Foundation.IAsyncOperation<global::Windows.Perception.Spatial.Surfaces.SpatialSurfaceMesh> TryComputeLatestMeshAsync( double maxTrianglesPerCubicMeter)
{
throw new global::System.NotImplementedException("The member IAsyncOperation<SpatialSurfaceMesh> SpatialSurfaceInfo.TryComputeLatestMeshAsync(double maxTrianglesPerCubicMeter) is not implemented in Uno.");
}
#endif
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __MACOS__
[global::Uno.NotImplemented]
public global::Windows.Foundation.IAsyncOperation<global::Windows.Perception.Spatial.Surfaces.SpatialSurfaceMesh> TryComputeLatestMeshAsync( double maxTrianglesPerCubicMeter, global::Windows.Perception.Spatial.Surfaces.SpatialSurfaceMeshOptions options)
{
throw new global::System.NotImplementedException("The member IAsyncOperation<SpatialSurfaceMesh> SpatialSurfaceInfo.TryComputeLatestMeshAsync(double maxTrianglesPerCubicMeter, SpatialSurfaceMeshOptions options) is not implemented in Uno.");
}
#endif
}
}
| 48.781818 | 257 | 0.787179 | [
"Apache-2.0"
] | 06needhamt/uno | src/Uno.UWP/Generated/3.0.0.0/Windows.Perception.Spatial.Surfaces/SpatialSurfaceInfo.cs | 2,683 | C# |
/*using RefactoringEssentials.CSharp.CodeRefactorings;
using Xunit;
namespace RefactoringEssentials.Tests.CSharp.CodeRefactorings
{
public class LinqFluentToQueryTests : CSharpCodeRefactoringTestBase
{
[Fact(Skip="Not implemented!")]
public void TestBasicCase()
{
Test<LinqFluentToQueryAction>(@"
using System.Linq;
class TestClass
{
void TestMethod ()
{
var x = new int[0].$Select (t => t);
}
}", @"
using System.Linq;
class TestClass
{
void TestMethod ()
{
var x = from t in new int[0]
select t;
}
}");
}
[Fact(Skip="Not implemented!")]
public void TestAddedParenthesis()
{
Test<LinqFluentToQueryAction>(@"
using System.Linq;
class TestClass
{
void TestMethod ()
{
var x = new int[0].$Select (t => t) + 1;
}
}", @"
using System.Linq;
class TestClass
{
void TestMethod ()
{
var x = (from t in new int[0]
select t) + 1;
}
}");
}
[Fact(Skip="Not implemented!")]
public void TestCast()
{
Test<LinqFluentToQueryAction>(@"
using System.Linq;
class TestClass
{
void TestMethod ()
{
var x = new int[0].$Cast<int> ();
}
}", @"
using System.Linq;
class TestClass
{
void TestMethod ()
{
var x = from int _1 in new int[0]
select _1;
}
}");
}
[Fact(Skip="Not implemented!")]
public void TestLet()
{
Test<LinqFluentToQueryAction>(@"
using System.Linq;
class TestClass
{
void TestMethod ()
{
var x = new int[0].Select (w => new { w, two = w * 2 }).$Select (_ => _.two);
}
}", @"
using System.Linq;
class TestClass
{
void TestMethod ()
{
var x = from w in new int[0]
let two = w * 2
select two;
}
}");
}
[Fact(Skip="Not implemented!")]
public void TestLet2()
{
Test<LinqFluentToQueryAction>(@"
using System.Linq;
class TestClass
{
void TestMethod ()
{
var x = new int[0].Select (w => new { two = w * 2, w }).$Select (_ => _.two);
}
}", @"
using System.Linq;
class TestClass
{
void TestMethod ()
{
var x = from w in new int[0]
let two = w * 2
select two;
}
}");
}
[Fact(Skip="Not implemented!")]
public void TestLongLetChain()
{
Test<LinqFluentToQueryAction>(@"
using System.Linq;
class TestClass
{
void TestMethod ()
{
var x = new int[0].Select (w => new { w, two = w * 2 })
.Select (h => new { h, three = h.w * 3 })
.Select (k => new { k, four = k.h.w * 4 })
.$Select (_ => _.k.h.w + _.k.h.two + _.k.three + _.four)
.Select (sum => sum * 2);
}
}", @"
using System.Linq;
class TestClass
{
void TestMethod ()
{
var x = from w in new int[0]
let two = w * 2
let three = w * 3
let four = w * 4
select w + two + three + four into sum
select sum * 2;
}
}");
}
[Fact(Skip="Not implemented!")]
public void TestLongLetChain2()
{
Test<LinqFluentToQueryAction>(@"
using System.Linq;
class TestClass
{
void TestMethod ()
{
var x = new int[0].Select (w => new { two = w * 2, w })
.Select (h => new { three = h.w * 3, h })
.Select (k => new { four = k.h.w * 4, k })
.$Select (_ => _.k.h.w + _.k.h.two + _.k.three + _.four)
.Select (sum => sum * 2);
}
}", @"
using System.Linq;
class TestClass
{
void TestMethod ()
{
var x = from w in new int[0]
let two = w * 2
let three = w * 3
let four = w * 4
select w + two + three + four into sum
select sum * 2;
}
}");
}
[Fact(Skip="Not implemented!")]
public void TestSelectMany()
{
Test<LinqFluentToQueryAction>(@"
using System.Linq;
class TestClass
{
void TestMethod ()
{
var x = new int[0].$SelectMany (elem => new int[0], (elem1, elem2) => elem1 + elem2);
}
}", @"
using System.Linq;
class TestClass
{
void TestMethod ()
{
var x = from elem1 in new int[0]
from elem2 in new int[0]
select elem1 + elem2;
}
}");
}
[Fact(Skip="Not implemented!")]
public void TestSelectManyLet()
{
Test<LinqFluentToQueryAction>(@"
using System.Linq;
class TestClass
{
void TestMethod ()
{
var x = new int[0].$SelectMany (elem => new int[0], (elem1, elem2) => new { elem1, elem2 }).Select(i => new { i, sum = i.elem1 + i.elem2 })
.Select(j => j.i.elem1 + j.i.elem2 + j.sum);
}
}", @"
using System.Linq;
class TestClass
{
void TestMethod ()
{
var x = from elem1 in new int[0]
from elem2 in new int[0]
let sum = elem1 + elem2
select elem1 + elem2 + sum;
}
}");
}
[Fact(Skip="Not implemented!")]
public void TestSelectManyLet2()
{
Test<LinqFluentToQueryAction>(@"
using System.Linq;
class TestClass
{
void TestMethod ()
{
var x = new int[0].$SelectMany (elem => new int[0], (elem1, elem2) => new { elem1, elem2 = elem2 + 1 }).Select(i => new { i, sum = i.elem1 + i.elem2 })
.Select(j => j.i.elem1 + j.i.elem2 + j.sum);
}
}", @"
using System.Linq;
class TestClass
{
void TestMethod ()
{
var x = from elem1 in new int[0]
from elem2 in new int[0]
select new {
elem1,
elem2 = elem2 + 1
} into i
let sum = i.elem1 + i.elem2
select i.elem1 + i.elem2 + sum;
}
}");
}
[Fact(Skip="Not implemented!")]
public void TestCastSelect()
{
Test<LinqFluentToQueryAction>(@"
using System.Linq;
class TestClass
{
void TestMethod ()
{
var x = new int[0].$Cast<int> ().Select (t => t * 2);
}
}", @"
using System.Linq;
class TestClass
{
void TestMethod ()
{
var x = from int t in new int[0]
select t * 2;
}
}");
}
[Fact(Skip="Not implemented!")]
public void TestSelectWhere()
{
Test<LinqFluentToQueryAction>(@"
using System.Linq;
class TestClass
{
void TestMethod ()
{
var x = new int[0].$Where (t => t > 0).Select (t => t * 2);
}
}", @"
using System.Linq;
class TestClass
{
void TestMethod ()
{
var x = from t in new int[0]
where t > 0
select t * 2;
}
}");
}
[Fact(Skip="Not implemented!")]
public void TestSorting()
{
Test<LinqFluentToQueryAction>(@"
using System.Linq;
class TestClass
{
void TestMethod ()
{
var x = new int[0].$OrderBy (t => t).ThenByDescending (t => t);
}
}", @"
using System.Linq;
class TestClass
{
void TestMethod ()
{
var x = from t in new int[0]
orderby t, t descending
select t;
}
}");
}
[Fact(Skip="Not implemented!")]
public void TestDegenerateWhere()
{
Test<LinqFluentToQueryAction>(@"
using System.Linq;
class TestClass
{
void TestMethod ()
{
var x = new int[0].$Where (t => t > 0);
}
}", @"
using System.Linq;
class TestClass
{
void TestMethod ()
{
var x = from t in new int[0]
where t > 0
select t;
}
}");
}
[Fact(Skip="Not implemented!")]
public void TestChain()
{
Test<LinqFluentToQueryAction>(@"
using System.Linq;
class TestClass
{
void TestMethod ()
{
var x = new int[0].Where (t => t > 0).$Where (u => u > 0);
}
}", @"
using System.Linq;
class TestClass
{
void TestMethod ()
{
var x = from t in new int[0]
where t > 0
select t into u
where u > 0
select u;
}
}");
}
[Fact(Skip="Not implemented!")]
public void TestJoin()
{
Test<LinqFluentToQueryAction>(@"
using System.Linq;
class TestClass
{
void TestMethod ()
{
var x = new int[0].Cast<char> ().$Join(new int[0].Cast<float> (), a => a * 2, b => b, (l, r) => l * r);
}
}", @"
using System.Linq;
class TestClass
{
void TestMethod ()
{
var x = from char a in new int[0]
join float b in new int[0] on a * 2 equals b
select a * b;
}
}");
}
[Fact(Skip="Not implemented!")]
public void TestGroupJoin()
{
Test<LinqFluentToQueryAction>(@"
using System.Linq;
class TestClass
{
void TestMethod ()
{
var x = new int[0].Cast<char> ().$GroupJoin(new int[0].Cast<float> (), a => a * 2, b => b, (l, r) => l * r [0]);
}
}", @"
using System.Linq;
class TestClass
{
void TestMethod ()
{
var x = from char a in new int[0]
join float b in new int[0] on a * 2 equals b into r
select a * r [0];
}
}");
}
[Fact(Skip="Not implemented!")]
public void TestNonRecursive()
{
Test<LinqFluentToQueryAction>(@"
using System.Linq;
class TestClass
{
void TestMethod ()
{
var x = Enumerable.Empty<int[]> ().$Select (t => t.Select (v => v));
}
}", @"
using System.Linq;
class TestClass
{
void TestMethod ()
{
var x = from t in Enumerable.Empty<int[]> ()
select t.Select (v => v);
}
}");
}
[Fact(Skip="Not implemented!")]
public void TestNonRecursiveCombineQueries()
{
Test<LinqFluentToQueryAction>(@"
using System.Linq;
class TestClass
{
void TestMethod ()
{
var x = Enumerable.Empty<int[]> ().$Select (t => (from g in t select g));
}
}", @"
using System.Linq;
class TestClass
{
void TestMethod ()
{
var x = from t in Enumerable.Empty<int[]> ()
select (from g in t
select g);
}
}");
}
[Fact(Skip="Not implemented!")]
public void TestGroupBy()
{
Test<LinqFluentToQueryAction>(@"
using System.Linq;
class TestClass
{
void TestMethod ()
{
var x = new int[0].$GroupBy (t => t, t => new int[0]);
}
}", @"
using System.Linq;
class TestClass
{
void TestMethod ()
{
var x = from t in new int[0]
group new int[0] by t;
}
}");
}
[Fact(Skip="Not implemented!")]
public void Test_1AlreadyUsed()
{
Test<LinqFluentToQueryAction>(@"
using System.Linq;
class TestClass
{
void TestMethod ()
{
int _1;
var x = new int[0].$Cast<float> ();
}
}", @"
using System.Linq;
class TestClass
{
void TestMethod ()
{
int _1;
var x = from float _2 in new int[0]
select _2;
}
}");
}
[Fact(Skip="Not implemented!")]
public void TestDoubleCasts()
{
Test<LinqFluentToQueryAction>(@"
using System.Linq;
class TestClass
{
void TestMethod ()
{
var x = new int[0].$Cast<float> ().Cast<int> ();
}
}", @"
using System.Linq;
class TestClass
{
void TestMethod ()
{
var x = from int _1 in
from float _2 in new int[0]
select _2
select _1;
}
}");
}
}
}
*/ | 17.787375 | 153 | 0.540344 | [
"MIT"
] | GrahamTheCoder/RefactoringEssentials | Tests/CSharp/CodeRefactorings/LinqFluentToQueryTests.cs | 10,708 | 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 Microsoft.Extensions.DependencyInjection;
namespace Microsoft.EntityFrameworkCore.Storage.ValueConversion
{
/// <summary>
/// <para>
/// Service dependencies parameter class for <see cref="ValueConverterSelector" />
/// </para>
/// <para>
/// This type is typically used by database providers (and other extensions). It is generally
/// not used in application code.
/// </para>
/// <para>
/// Do not construct instances of this class directly from either provider or application code as the
/// constructor signature may change as new dependencies are added. Instead, use this type in
/// your constructor so that an instance will be created and injected automatically by the
/// dependency injection container. To create an instance with some dependent services replaced,
/// first resolve the object from the dependency injection container, then replace selected
/// services using the 'With...' methods. Do not call the constructor at any point in this process.
/// </para>
/// <para>
/// The service lifetime is <see cref="ServiceLifetime.Singleton"/>.
/// This means a single instance of each service is used by many <see cref="DbContext"/> instances.
/// The implementation must be thread-safe.
/// This service cannot depend on services registered as <see cref="ServiceLifetime.Scoped"/>.
/// </para>
/// </summary>
public sealed class ValueConverterSelectorDependencies
{
/// <summary>
/// <para>
/// Creates the service dependencies parameter object for a <see cref="ValueConverterSelector" />.
/// </para>
/// <para>
/// Do not call this constructor directly from either provider or application code as it may change
/// as new dependencies are added. Instead, use this type in your constructor so that an instance
/// will be created and injected automatically by the dependency injection container. To create
/// an instance with some dependent services replaced, first resolve the object from the dependency
/// injection container, then replace selected services using the 'With...' methods. Do not call
/// the constructor at any point in this process.
/// </para>
/// </summary>
// ReSharper disable once EmptyConstructor
public ValueConverterSelectorDependencies()
{
}
}
}
| 54.115385 | 115 | 0.633973 | [
"Apache-2.0"
] | BionStt/EntityFrameworkCore | src/EFCore/Storage/ValueConversion/DefaultValueConverterRegistryDependencies.cs | 2,814 | C# |
using BetterSongList.UI;
using HarmonyLib;
using System.Diagnostics;
using System.Linq;
namespace BetterSongList.HarmonyPatches {
[HarmonyPatch(typeof(LevelSearchViewController), nameof(LevelSearchViewController.ResetCurrentFilterParams))]
static class HookFilterClear {
[HarmonyPriority(int.MaxValue)]
static void Prefix() {
// GetCallingAssembly isnt good enough because of Harmony patches
var x = new StackTrace().GetFrames().DefaultIfEmpty(null).ElementAtOrDefault(2)?.GetMethod().DeclaringType.Assembly.GetName().Name;
// Compat for stuff like SRM mods so that we clear our filter as well when they request a basegame filter clear
if(x == "Main")
return;
#if DEBUG
Plugin.Log.Debug(string.Format("HookFilterClear(): Filter clear requested from other assembly ({0})", System.Reflection.Assembly.GetCallingAssembly().GetName()));
#endif
FilterUI.SetFilter(null, false, false);
}
//TODO: for some reason basegame clears the input field, but retains the search text
//Reported, remove this when fixed in basegame.
static void Postfix(LevelFilterParams ____currentFilterParams) {
____currentFilterParams.searchText = "";
}
}
}
| 37.870968 | 165 | 0.767462 | [
"MIT"
] | Thoress/BeatSaber_BetterSongList | HarmonyPatches/HookFilterClear.cs | 1,176 | C# |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("DWHSTA.UWP")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DWHSTA.UWP")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: ComVisible(false)] | 35.758621 | 84 | 0.738669 | [
"MIT"
] | Kash0321/DWHSTA | src/DWHSTA.Mobile/DWHSTA.UWP/Properties/AssemblyInfo.cs | 1,040 | 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>
//------------------------------------------------------------------------------
namespace WorkspaceCellModes.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.8.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}
| 39.740741 | 151 | 0.584343 | [
"BSD-3-Clause"
] | BMBH/Krypton | Source/Krypton Workspace Examples/Workspace Cell Modes/Properties/Settings.Designer.cs | 1,075 | C# |
/*****************************************************************************
* Copyright 2016 Aurora Solutions
*
* http://www.aurorasolutions.io
*
* Aurora Solutions is an innovative services and product company at
* the forefront of the software industry, with processes and practices
* involving Domain Driven Design(DDD), Agile methodologies to build
* scalable, secure, reliable and high performance products.
*
* TradeSharp is a C# based data feed and broker neutral Algorithmic
* Trading Platform that lets trading firms or individuals automate
* any rules based trading strategies in stocks, forex and ETFs.
* TradeSharp allows users to connect to providers like Tradier Brokerage,
* IQFeed, FXCM, Blackwood, Forexware, Integral, HotSpot, Currenex,
* Interactive Brokers and more.
* Key features: Place and Manage Orders, Risk Management,
* Generate Customized Reports etc
*
* 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.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using EasyNetQ;
using EasyNetQ.Topology;
using NUnit.Framework;
using Spring.Context.Support;
using TradeHub.Common.Core.DomainModels.OrderDomain;
using TradeHub.NotificationEngine.Client.Service;
using TradeHub.NotificationEngine.Common.Constants;
using TradeHub.NotificationEngine.Common.ValueObject;
using TradeHub.NotificationEngine.CommunicationManager.Service;
namespace TradeHub.NotificationEngine.Client.Tests.Integration
{
[TestFixture]
class NotificationEngineClientTestCases
{
private NotificationEngineMqServer _notificationEngineMqServer;
private NotificationEngineClient _notificationEngineClient;
[SetUp]
public void SetUp()
{
_notificationEngineMqServer = new NotificationEngineMqServer("NotificationEngineMqConfig.xml");
_notificationEngineMqServer.Connect();
_notificationEngineClient = ContextRegistry.GetContext()["NotificationEngineClient"] as NotificationEngineClient;
if (_notificationEngineClient != null) _notificationEngineClient.StartCommunicator();
}
[TearDown]
public void TearDown()
{
if (_notificationEngineClient != null) _notificationEngineClient.StopCommunicator();
_notificationEngineMqServer.Disconnect();
}
[Test]
[Category("Integration")]
public void NewNotification_SendNotificationToServer_NotificationReceivedByServer()
{
Thread.Sleep(5000);
bool notificationReceived = false;
var notificationManualResetEvent = new ManualResetEvent(false);
// Create Order Object
OrderNotification orderNotification = new OrderNotification(NotificationType.Email, OrderNotificationType.Accepted);
MarketOrder marketOrder= new MarketOrder("Test Provider");
orderNotification.SetOrder(marketOrder);
_notificationEngineMqServer.OrderNotificationEvent += delegate(OrderNotification notificationObject)
{
var notificationObjectReceived = notificationObject;
notificationReceived = true;
notificationManualResetEvent.Set();
};
_notificationEngineClient.SendNotification(orderNotification);
notificationManualResetEvent.WaitOne(10000, false);
Assert.AreEqual(true, notificationReceived, "Notification Received");
}
}
}
| 39.447619 | 128 | 0.704973 | [
"Apache-2.0"
] | TradeNexus/tradesharp-core | Backend/NotificationEngine/TradeHub.NotificationEngine.Client.Tests/Integration/NotificationEngineClientTestCases.cs | 4,144 | C# |
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics\Arm\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.Arm;
namespace JIT.HardwareIntrinsics.Arm
{
public static partial class Program
{
private static void LeadingZeroCount_UInt32()
{
var test = new ScalarUnaryOpTest__LeadingZeroCount_UInt32();
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.ReadUnaligned
test.RunBasicScenario_UnsafeRead();
// Validates calling via reflection works, using Unsafe.ReadUnaligned
test.RunReflectionScenario_UnsafeRead();
// Validates passing a static member works
test.RunClsVarScenario();
// Validates passing a local works, using Unsafe.ReadUnaligned
test.RunLclVarScenario_UnsafeRead();
// Validates passing the field of a local class works
test.RunClassLclFldScenario();
// Validates passing an instance member of a class works
test.RunClassFldScenario();
// Validates passing the field of a local struct works
test.RunStructLclFldScenario();
// Validates passing an instance member of a struct works
test.RunStructFldScenario();
}
else
{
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class ScalarUnaryOpTest__LeadingZeroCount_UInt32
{
private struct TestStruct
{
public UInt32 _fld;
public static TestStruct Create()
{
var testStruct = new TestStruct();
testStruct._fld = TestLibrary.Generator.GetUInt32();
return testStruct;
}
public void RunStructFldScenario(ScalarUnaryOpTest__LeadingZeroCount_UInt32 testClass)
{
var result = ArmBase.LeadingZeroCount(_fld);
testClass.ValidateResult(_fld, result);
}
}
private static UInt32 _data;
private static UInt32 _clsVar;
private UInt32 _fld;
static ScalarUnaryOpTest__LeadingZeroCount_UInt32()
{
_clsVar = TestLibrary.Generator.GetUInt32();
}
public ScalarUnaryOpTest__LeadingZeroCount_UInt32()
{
Succeeded = true;
_fld = TestLibrary.Generator.GetUInt32();
_data = TestLibrary.Generator.GetUInt32();
}
public bool IsSupported => ArmBase.IsSupported;
public bool Succeeded { get; set; }
public void RunBasicScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
var result = ArmBase.LeadingZeroCount(
Unsafe.ReadUnaligned<UInt32>(ref Unsafe.As<UInt32, byte>(ref _data))
);
ValidateResult(_data, result);
}
public void RunReflectionScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead));
var result = typeof(ArmBase)
.GetMethod(nameof(ArmBase.LeadingZeroCount), new Type[] { typeof(UInt32) })
.Invoke(
null,
new object[]
{
Unsafe.ReadUnaligned<UInt32>(ref Unsafe.As<UInt32, byte>(ref _data))
}
);
ValidateResult(_data, (Int32)result);
}
public void RunClsVarScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
var result = ArmBase.LeadingZeroCount(_clsVar);
ValidateResult(_clsVar, result);
}
public void RunLclVarScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead));
var data = Unsafe.ReadUnaligned<UInt32>(ref Unsafe.As<UInt32, byte>(ref _data));
var result = ArmBase.LeadingZeroCount(data);
ValidateResult(data, result);
}
public void RunClassLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario));
var test = new ScalarUnaryOpTest__LeadingZeroCount_UInt32();
var result = ArmBase.LeadingZeroCount(test._fld);
ValidateResult(test._fld, result);
}
public void RunClassFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
var result = ArmBase.LeadingZeroCount(_fld);
ValidateResult(_fld, result);
}
public void RunStructLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario));
var test = TestStruct.Create();
var result = ArmBase.LeadingZeroCount(test._fld);
ValidateResult(test._fld, result);
}
public void RunStructFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario));
var test = TestStruct.Create();
test.RunStructFldScenario(this);
}
public void RunUnsupportedScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario));
bool succeeded = false;
try
{
RunBasicScenario_UnsafeRead();
}
catch (PlatformNotSupportedException)
{
succeeded = true;
}
if (!succeeded)
{
Succeeded = false;
}
}
private void ValidateResult(
UInt32 data,
Int32 result,
[CallerMemberName] string method = ""
)
{
var isUnexpectedResult = false;
int expectedResult = 0;
for (int index = 31; ((data >> index) & 1) == 0; index--)
{
expectedResult++;
}
isUnexpectedResult = (expectedResult != result);
if (isUnexpectedResult)
{
TestLibrary.TestFramework.LogInformation(
$"{nameof(ArmBase)}.{nameof(ArmBase.LeadingZeroCount)}<Int32>(UInt32): LeadingZeroCount failed:"
);
TestLibrary.TestFramework.LogInformation($" data: {data}");
TestLibrary.TestFramework.LogInformation($" result: {result}");
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
| 32.107884 | 116 | 0.565909 | [
"MIT"
] | belav/runtime | src/tests/JIT/HardwareIntrinsics/Arm/ArmBase/LeadingZeroCount.UInt32.cs | 7,738 | C# |
using System.Net.Sockets;
namespace Annex.Networking.DotNet
{
public static class Extensions
{
public static SocketType GetSocketType(this TransmissionType protocol) {
switch (protocol) {
case TransmissionType.ReliableOrdered:
return SocketType.Stream;
case TransmissionType.UnreliableUnordered:
return SocketType.Dgram;
default:
return SocketType.Unknown;
}
}
public static ProtocolType GetProtocolType(this TransmissionType protocol) {
switch (protocol) {
case TransmissionType.ReliableOrdered:
return ProtocolType.Tcp;
case TransmissionType.UnreliableUnordered:
return ProtocolType.Udp;
default:
return ProtocolType.Unknown;
}
}
}
}
| 31.566667 | 84 | 0.560718 | [
"MIT"
] | AnnexGameDev/Annex | source/Annex/Networking/DotNet/Extensions.cs | 949 | C# |
//
// GMGridViewController.cs
// GMPhotoPicker.Xamarin
//
// Created by Roy Cornelissen on 23/03/16.
// Based on original GMImagePicker implementation by Guillermo Muntaner Perelló.
// https://github.com/guillermomuntaner/GMImagePicker
//
using System;
using UIKit;
using Photos;
using CoreGraphics;
using System.Linq;
using System.Collections.Generic;
using Foundation;
using CoreFoundation;
using System.Diagnostics;
using System.Runtime.CompilerServices;
namespace GMImagePicker
{
internal class GMGridViewController: UICollectionViewController, IPHPhotoLibraryChangeObserver
{
private const string GMGridViewCellIdentifier = "GMGridViewCellIdentifier";
private readonly GMImagePickerController _picker;
private static CGSize AssetGridThumbnailSize;
private static UICollectionViewFlowLayout _portraitLayout;
private static UICollectionViewFlowLayout _landscapeLayout;
private PHCachingImageManager _imageManager;
public PHFetchResult AssetsFetchResults { get; set; }
public GMGridViewController (IntPtr handle): base(handle)
{
}
public GMGridViewController (GMImagePickerController picker) : base(CollectionViewFlowLayoutForOrientation(UIApplication.SharedApplication.StatusBarOrientation, picker))
{
//Custom init. The picker contains custom information to create the FlowLayout
_picker = picker;
_picker.FinishedPickingAssets += OnCleanup;
_picker.Canceled += OnCleanup;
//Compute the thumbnail pixel size:
var scale = UIScreen.MainScreen.Scale;
var layout = (UICollectionViewFlowLayout)Layout;
AssetGridThumbnailSize = new CGSize (layout.ItemSize.Width * scale, layout.ItemSize.Height * scale);
CollectionView.AllowsMultipleSelection = _picker.AllowsMultipleSelection;
CollectionView.RegisterClassForCell (typeof(GMGridViewCell), GMGridViewCellIdentifier);
PreferredContentSize = GMImagePickerController.PopoverContentSize;
}
void OnCleanup(object sender, EventArgs e)
{
Unregister();
}
public override void ViewDidDisappear(bool animated)
{
if (animated)
{
Unregister();
}
base.ViewDidDisappear(animated);
}
private static UICollectionViewFlowLayout CollectionViewFlowLayoutForOrientation (UIInterfaceOrientation orientation, GMImagePickerController picker)
{
nfloat screenWidth;
nfloat screenHeight;
//Ipad popover is not affected by rotation!
if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad) {
screenWidth = picker.View.Bounds.Width;
screenHeight = picker.View.Bounds.Height;
} else {
var insets = UIEdgeInsets.Zero;
if (picker.View.RespondsToSelector(new ObjCRuntime.Selector("safeAreaInsets"))) {
insets = picker.View.SafeAreaInsets;
}
var horizontalInsets = insets.Right + insets.Left;
var verticalInsets = insets.Bottom + insets.Top;
if (UIApplication.SharedApplication.StatusBarOrientation == UIInterfaceOrientation.LandscapeLeft ||
UIApplication.SharedApplication.StatusBarOrientation == UIInterfaceOrientation.LandscapeRight) {
screenHeight = picker.View.Bounds.Width - horizontalInsets;
screenWidth = picker.View.Bounds.Height - verticalInsets;
} else {
screenWidth = picker.View.Bounds.Width - horizontalInsets;
screenHeight = picker.View.Bounds.Height - verticalInsets;
}
}
if ((UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad) ||
(UIApplication.SharedApplication.StatusBarOrientation == UIInterfaceOrientation.Portrait ||
UIApplication.SharedApplication.StatusBarOrientation == UIInterfaceOrientation.PortraitUpsideDown))
{
if (_portraitLayout == null) {
var cellTotalUsableWidth = screenWidth - (picker.ColsInPortrait - 1) * picker.MinimumInteritemSpacing;
var itemSize = new CGSize (cellTotalUsableWidth / picker.ColsInPortrait, cellTotalUsableWidth / picker.ColsInPortrait);
var cellTotalUsedWidth = (double)itemSize.Width * picker.ColsInPortrait;
var spaceTotalWidth = screenWidth - cellTotalUsedWidth;
var spaceWidth = spaceTotalWidth / (picker.ColsInPortrait - 1);
_portraitLayout = new UICollectionViewFlowLayout {
MinimumInteritemSpacing = picker.MinimumInteritemSpacing,
ItemSize = itemSize,
MinimumLineSpacing = (nfloat) spaceWidth
};
if (_portraitLayout.RespondsToSelector(new ObjCRuntime.Selector("sectionInsetReference"))) {
_portraitLayout.SectionInsetReference = UICollectionViewFlowLayoutSectionInsetReference.SafeArea;
}
}
return _portraitLayout;
} else {
if (_landscapeLayout == null) {
var cellTotalUsableWidth = screenHeight - (picker.ColsInLandscape - 1) * picker.MinimumInteritemSpacing;
var itemSize = new CGSize (cellTotalUsableWidth / picker.ColsInLandscape, cellTotalUsableWidth / picker.ColsInLandscape);
var cellTotalUsedWidth = (double)itemSize.Width * picker.ColsInLandscape;
var spaceTotalWidth = screenHeight - cellTotalUsedWidth;
var spaceWidth = spaceTotalWidth / (picker.ColsInLandscape - 1);
_landscapeLayout = new UICollectionViewFlowLayout {
MinimumInteritemSpacing = picker.MinimumInteritemSpacing,
ItemSize = itemSize,
MinimumLineSpacing = (nfloat) spaceWidth
};
if (_landscapeLayout.RespondsToSelector(new ObjCRuntime.Selector("sectionInsetReference"))) {
_landscapeLayout.SectionInsetReference = UICollectionViewFlowLayoutSectionInsetReference.SafeArea;
}
}
return _landscapeLayout;
}
}
private void SetupViews ()
{
CollectionView.BackgroundColor = UIColor.Clear;
View.BackgroundColor = _picker.PickerBackgroundColor;
}
private void SetupButtons ()
{
if (_picker.AllowsMultipleSelection) {
var doneTitle = _picker.CustomDoneButtonTitle ?? "picker.navigation.done-button".Translate (defaultValue: "Done");
NavigationItem.RightBarButtonItem = new UIBarButtonItem (doneTitle,
UIBarButtonItemStyle.Done,
FinishPickingAssets);
NavigationItem.RightBarButtonItem.Enabled = !_picker.AutoDisableDoneButton || _picker.SelectedAssets.Any ();
} else {
var cancelTitle = _picker.CustomCancelButtonTitle ?? "picker.navigation.cancel-button".Translate (defaultValue: "Cancel");
NavigationItem.RightBarButtonItem = new UIBarButtonItem (cancelTitle,
UIBarButtonItemStyle.Done,
Dismiss);
}
if (_picker.UseCustomFontForNavigationBar) {
var barButtonItemAttributes = new UITextAttributes {
Font = UIFont.FromName(_picker.PickerFontName, _picker.PickerFontHeaderSize)
};
NavigationItem.RightBarButtonItem.SetTitleTextAttributes (barButtonItemAttributes, UIControlState.Normal);
NavigationItem.RightBarButtonItem.SetTitleTextAttributes (barButtonItemAttributes, UIControlState.Highlighted);
}
}
private void SetupToolbar ()
{
ToolbarItems = _picker.GetToolbarItems();
}
private void FinishPickingAssets (object sender, EventArgs args)
{
// Explicitly unregister observer because we cannot predict when the GC cleans up
Unregister ();
_picker.FinishPickingAssets (sender, args);
}
private void Dismiss (object sender, EventArgs args)
{
// Explicitly unregister observer because we cannot predict when the GC cleans up
Unregister ();
_picker.Dismiss (sender, args);
}
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
SetupViews ();
if (!string.IsNullOrEmpty(_picker.CustomNavigationBarPrompt)) {
NavigationItem.Prompt = _picker.CustomNavigationBarPrompt;
}
_imageManager = new PHCachingImageManager ();
ResetCachedAssets ();
// Register for changes
PHPhotoLibrary.SharedPhotoLibrary.RegisterChangeObserver (this);
}
public override void ViewWillAppear(bool animated)
{
base.ViewWillAppear(animated);
SetupButtons();
SetupToolbar();
if (_picker.GridSortOrder == SortOrder.Ascending)
{
// Scroll to bottom (newest images are at the bottom)
CollectionView.SetNeedsLayout();
CollectionView.LayoutIfNeeded();
CollectionView.SetContentOffset(new CGPoint(0, CollectionView.CollectionViewLayout.CollectionViewContentSize.Height), false);
var item = CollectionView.NumberOfItemsInSection(0) - 1;
_newestItemPath = NSIndexPath.FromItemSection(item, 0);
}
}
NSIndexPath _newestItemPath;
public override void ViewDidAppear (bool animated)
{
base.ViewDidAppear (animated);
if (_newestItemPath != null && _newestItemPath.Section >= 0 && _newestItemPath.Row >= 0 && _newestItemPath.Item >= 0 && _picker.GridSortOrder == SortOrder.Ascending)
{
// Scroll to bottom (newest images are at the bottom)
CollectionView.ScrollToItem(_newestItemPath, UICollectionViewScrollPosition.Bottom, false);
}
UpdateCachedAssets();
}
#region Asset Caching
private CGRect _previousPreheatRect;
private void ResetCachedAssets ()
{
_imageManager.StopCaching ();
_previousPreheatRect = CGRect.Empty;
}
private void ComputeDifferenceBetweenRect (CGRect oldRect, CGRect newRect, Action<CGRect> removedHandler, Action<CGRect> addedHandler)
{
if (CGRect.Intersect (newRect, oldRect) != CGRect.Empty) {
var oldMaxY = oldRect.GetMaxY ();
var oldMinY = oldRect.GetMinY ();
var newMaxY = newRect.GetMaxY ();
var newMinY = newRect.GetMinY ();
if (newMaxY > oldMaxY) {
var rectToAdd = new CGRect (newRect.X, oldMaxY, newRect.Size.Width, (newMaxY - oldMaxY));
addedHandler (rectToAdd);
}
if (oldMinY > newMinY) {
var rectToAdd = new CGRect (newRect.X, newMinY, newRect.Size.Width, (oldMinY - newMinY));
addedHandler (rectToAdd);
}
if (newMaxY < oldMaxY) {
var rectToRemove = new CGRect (newRect.X, newMaxY, newRect.Size.Width, (oldMaxY - newMaxY));
removedHandler (rectToRemove);
}
if (oldMinY < newMinY) {
var rectToRemove = new CGRect (newRect.X, oldMinY, newRect.Size.Width, (newMinY - oldMinY));
removedHandler (rectToRemove);
}
} else {
addedHandler (newRect);
removedHandler (oldRect);
}
}
private void UpdateCachedAssets ()
{
var isViewVisible = IsViewLoaded && View.Window != null;
if (!isViewVisible) {
return;
}
// The preheat window is twice the height of the visible rect
var preheatRect = CollectionView.Bounds;
preheatRect = preheatRect.Inset (0.0f, -0.5f * preheatRect.Height);
// If scrolled by a "reasonable" amount...
var delta = Math.Abs(preheatRect.GetMidY() - _previousPreheatRect.GetMidY());
if (delta > CollectionView.Bounds.Height / 3.0f) {
// Compute the assets to start caching and to stop caching.
var addedIndexPaths = new List<NSIndexPath> ();
var removedIndexPaths = new List<NSIndexPath> ();
ComputeDifferenceBetweenRect (_previousPreheatRect,
preheatRect,
(removedRect) => {
removedIndexPaths.AddRange(GetIndexPathsForElementsInRect(removedRect));
},
(addedRect) => {
addedIndexPaths.AddRange(GetIndexPathsForElementsInRect(addedRect));
});
var assetsToStartCaching = GetAssetsAtIndexPaths (addedIndexPaths);
var assetsToStopCaching = GetAssetsAtIndexPaths (removedIndexPaths);
var options = new PHImageRequestOptions
{
Synchronous = false,
NetworkAccessAllowed = true,
DeliveryMode = PHImageRequestOptionsDeliveryMode.Opportunistic,
ResizeMode = PHImageRequestOptionsResizeMode.Fast
};
if (assetsToStartCaching != null) {
_imageManager.StartCaching (assetsToStartCaching,
AssetGridThumbnailSize,
PHImageContentMode.AspectFill,
options);
}
if (assetsToStopCaching != null) {
_imageManager.StopCaching (assetsToStopCaching,
AssetGridThumbnailSize,
PHImageContentMode.AspectFill,
options);
}
_previousPreheatRect = preheatRect;
}
}
private PHAsset[] GetAssetsAtIndexPaths(ICollection<NSIndexPath> indexPaths)
{
if (!indexPaths.Any()) {
return null;
}
var assets = new List<PHAsset> ();
foreach (var indexPath in indexPaths) {
var asset = (PHAsset) AssetsFetchResults [indexPath.Item];
assets.Add (asset);
}
return assets.ToArray ();
}
private NSIndexPath[] GetIndexPathsForElementsInRect (CGRect rect)
{
var indexPaths = new List<NSIndexPath> ();
var allLayoutAttributes = Layout.LayoutAttributesForElementsInRect (rect);
foreach (var layoutAttributes in allLayoutAttributes) {
var indexPath = layoutAttributes.IndexPath;
indexPaths.Add (indexPath);
}
return indexPaths.ToArray ();
}
#endregion
#region Photo Library Changes
public void PhotoLibraryDidChange (PHChange changeInstance)
{
Debug.WriteLine($"{this.GetType().Name}: PhotoLibraryDidChange");
// Call might come on any background queue. Re-dispatch to the main queue to handle it.
DispatchQueue.MainQueue.DispatchAsync (() => {
// check if there are changes to the assets (insertions, deletions, updates)
var collectionChanges = changeInstance.GetFetchResultChangeDetails(AssetsFetchResults);
if (collectionChanges != null) {
var collectionView = CollectionView;
if (CollectionView == null)
{
return;
}
// get the new fetch result
AssetsFetchResults = collectionChanges.FetchResultAfterChanges;
if (!collectionChanges.HasIncrementalChanges || collectionChanges.HasMoves) {
// we need to reload all if the incremental diffs are not available
collectionView.ReloadData();
} else {
// if we have incremental diffs, tell the collection view to animate insertions and deletions
collectionView.PerformBatchUpdates(() =>
{
var removedIndexes = collectionChanges.RemovedIndexes;
if (removedIndexes != null && removedIndexes.Count > 0)
{
collectionView.DeleteItems(GetIndexesWithSection(removedIndexes, 0));
}
if (collectionChanges.InsertedIndexes != null && collectionChanges.InsertedIndexes.Count > 0)
{
collectionView.InsertItems(GetIndexesWithSection(collectionChanges.InsertedIndexes, 0));
var changedIndexes = collectionChanges.ChangedIndexes;
if (changedIndexes != null && changedIndexes.Count > 0)
{
collectionView.ReloadItems(GetIndexesWithSection(changedIndexes, 0));
}
}
}, (x) => {
if (_picker.GridSortOrder == SortOrder.Ascending)
{
var item = collectionView.NumberOfItemsInSection(0) - 1;
if (item >= 0)
{
var path = NSIndexPath.FromItemSection(item, 0);
collectionView.ScrollToItem(path, UICollectionViewScrollPosition.Bottom, true);
}
}
else
{
var path = NSIndexPath.FromItemSection(0, 0);
collectionView.ScrollToItem(path, UICollectionViewScrollPosition.Top, true);
}
});
if (collectionChanges.InsertedIndexes != null && collectionChanges.InsertedIndexes.Count > 0)
{
if (_picker.ShowCameraButton && _picker.AutoSelectCameraImages)
{
foreach (var path in GetIndexesWithSection(collectionChanges.InsertedIndexes, 0))
{
ItemSelected(collectionView, path);
}
}
}
}
ResetCachedAssets();
}
});
}
private NSIndexPath[] GetIndexesWithSection(NSIndexSet indexes, nint section)
{
var indexPaths = new List<NSIndexPath>();
indexes.EnumerateIndexes((nuint idx, ref bool stop) => {
indexPaths.Add(NSIndexPath.FromItemSection((nint) idx, section));
});
return indexPaths.ToArray();
}
protected override void Dispose (bool disposing)
{
Unregister ();
base.Dispose (disposing);
}
private void Unregister([CallerMemberName] string calledBy = "")
{
_picker.FinishedPickingAssets -= OnCleanup;
_picker.Canceled -= OnCleanup;
Debug.WriteLine($"{GetType().Name}: Unregister called by {calledBy}");
ResetCachedAssets ();
PHPhotoLibrary.SharedPhotoLibrary.UnregisterChangeObserver (this);
}
#endregion
public override UIStatusBarStyle PreferredStatusBarStyle ()
{
return _picker.PickerStatusBarStyle;
}
public override void Scrolled (UIScrollView scrollView)
{
UpdateCachedAssets ();
}
#region Rotation
public override void WillAnimateRotation (UIInterfaceOrientation toInterfaceOrientation, double duration)
{
if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad) {
return;
}
var layout = CollectionViewFlowLayoutForOrientation (toInterfaceOrientation, _picker);
//Update the AssetGridThumbnailSize:
var scale = UIScreen.MainScreen.Scale;
AssetGridThumbnailSize = new CGSize (layout.ItemSize.Width * scale, layout.ItemSize.Height * scale);
ResetCachedAssets ();
var options = new PHImageRequestOptions
{
Synchronous = false,
NetworkAccessAllowed = true,
DeliveryMode = PHImageRequestOptionsDeliveryMode.Opportunistic,
ResizeMode = PHImageRequestOptionsResizeMode.Fast
};
//This is optional. Reload visible thumbnails:
foreach (var cell in CollectionView.VisibleCells) {
var typedCell = (GMGridViewCell)cell;
var currentTag = cell.Tag;
_imageManager.RequestImageForAsset (typedCell.Asset,
AssetGridThumbnailSize,
PHImageContentMode.AspectFill,
options,
(image, info) => {
// Only update the thumbnail if the cell tag hasn't changed. Otherwise, the cell has been re-used.
if (cell.Tag == currentTag && typedCell.ImageView != null && image != null) {
typedCell.ImageView.Image = image;
}
});
}
CollectionView.SetCollectionViewLayout (layout, true);
}
public override nint NumberOfSections(UICollectionView collectionView)
{
return 1;
}
public override UICollectionViewCell GetCell(UICollectionView collectionView, NSIndexPath indexPath)
{
var cell = (GMGridViewCell)CollectionView.DequeueReusableCell(GMGridViewCellIdentifier, indexPath);
var asset = (PHAsset)AssetsFetchResults[indexPath.Item];
if (cell != null)
{
// Increment the cell's tag
var currentTag = cell.Tag + 1;
cell.Tag = currentTag;
_imageManager.RequestImageForAsset(asset,
AssetGridThumbnailSize,
PHImageContentMode.AspectFill,
new PHImageRequestOptions { DeliveryMode = PHImageRequestOptionsDeliveryMode.Opportunistic, ResizeMode = PHImageRequestOptionsResizeMode.Fast },
(image, info) => {
// Only update the thumbnail if the cell tag hasn't changed. Otherwise, the cell has been re-used.
if (cell.Tag == currentTag && cell.ImageView != null && image != null)
{
cell.ImageView.Image = image;
}
});
}
cell.Bind(asset);
cell.ShouldShowSelection = _picker.AllowsMultipleSelection;
// Optional protocol to determine if some kind of assets can't be selected (long videos, etc...)
cell.IsEnabled = _picker.VerifyShouldEnableAsset(asset);
if (_picker.SelectedAssets.Contains(asset))
{
cell.Selected = true;
CollectionView.SelectItem(indexPath, false, UICollectionViewScrollPosition.None);
}
else
{
cell.Selected = false;
}
var resources = PHAssetResource.GetAssetResources(asset);
var name = resources != null && resources.Length > 0
? resources[0].OriginalFilename
: string.Empty;
ConfigureSelectCellAccessibilityAttributes(cell, cell.Selected , name);
return cell;
}
public override nint GetItemsCount(UICollectionView collectionView, nint section)
{
var count = AssetsFetchResults.Count;
return count;
}
public override void ItemSelected(UICollectionView collectionView, NSIndexPath indexPath)
{
var asset = (PHAsset)AssetsFetchResults[indexPath.Item];
_picker.SelectAsset(asset);
_picker.NotifyAssetSelected(asset);
}
public override bool ShouldDeselectItem(UICollectionView collectionView, NSIndexPath indexPath)
{
var asset = (PHAsset)AssetsFetchResults[indexPath.Item];
return _picker.VerifyShouldDeselectAsset(asset);
}
public override bool ShouldHighlightItem(UICollectionView collectionView, NSIndexPath indexPath)
{
var asset = (PHAsset)AssetsFetchResults[indexPath.Item];
return _picker.VerifyShouldHighlightAsset(asset);
}
public override void ItemHighlighted(UICollectionView collectionView, NSIndexPath indexPath)
{
var asset = (PHAsset)AssetsFetchResults[indexPath.Item];
_picker.NotifyAssetHighlighted(asset);
}
public override void ItemUnhighlighted(UICollectionView collectionView, NSIndexPath indexPath)
{
var asset = (PHAsset)AssetsFetchResults[indexPath.Item];
_picker.NotifyAssetUnhighlighted(asset);
}
public override bool ShouldSelectItem(UICollectionView collectionView, NSIndexPath indexPath)
{
var asset = (PHAsset)AssetsFetchResults[indexPath.Item];
var cell = (GMGridViewCell)collectionView.CellForItem(indexPath);
ConfigureSelectCellAccessibilityAttributes(cell, true, null);
if (!cell.IsEnabled)
{
return false;
}
else
{
return _picker.VerifyShouldSelectAsset(asset);
}
}
public override void ItemDeselected(UICollectionView collectionView, NSIndexPath indexPath)
{
var asset = (PHAsset)AssetsFetchResults[indexPath.Item];
var cell = (GMGridViewCell)collectionView.CellForItem(indexPath);
_picker.DeselectAsset(asset);
_picker.NotifyAssetDeselected(asset);
ConfigureSelectCellAccessibilityAttributes(cell, false, null);
}
#region Voiceover Accessibility Configuration
private static void ConfigureSelectCellAccessibilityAttributes(GMGridViewCell selectedCell, bool isSelected, string imageName)
{
selectedCell.AccessibilityTraits = UIAccessibilityTrait.Button;
selectedCell.IsAccessibilityElement = true;
if (imageName!=null)
{
selectedCell.AccessibilityLabel = imageName;
}
if (!isSelected)
{
selectedCell.AccessibilityHint = "picker.accessibility.check-to-select".Translate(defaultValue: "Check to select the image");
}
else
{
selectedCell.AccessibilityHint = "picker.accessibility.uncheck-to-deselect".Translate(defaultValue: "Uncheck to deselect the image");;
}
}
#endregion
}
#endregion
}
| 33.618976 | 171 | 0.726067 | [
"MIT"
] | SearaChen/GMImagePicker.Xamarin | src/GMImagePicker/GMGridViewController.cs | 22,326 | C# |
namespace NanoRpcSharp.Messages
{
using System.Collections.Generic;
public class Chain
{
public List<Hex32> Blocks { get; set; }
}
}
| 15.9 | 47 | 0.63522 | [
"MIT"
] | justdmitry/NanoRpcSharp | NanoRpcSharp/Messages/Chain.cs | 161 | C# |
// Compiler options: -r:../class/lib/net_4_5/Mono.Cecil.dll
using System;
using Mono.Cecil;
class Test
{
public static string A
{
get { return ""; }
}
public string B
{
get { return ""; }
}
public static int Main ()
{
var assembly = AssemblyDefinition.ReadAssembly (typeof (Test).Assembly.Location);
var t = assembly.MainModule.GetType ("Test");
foreach (var p in t.Properties)
{
switch (p.Name) {
case "A":
if (!p.HasThis)
break;
return 1;
case "B":
if (p.HasThis)
break;
return 2;
default:
return 3;
}
}
return 0;
}
}
| 13.818182 | 83 | 0.585526 | [
"Apache-2.0"
] | BitExodus/test01 | mcs/tests/test-814.cs | 608 | C# |
using System;
using System.Collections.Generic;
using Localization.Xliff.OM;
using Localization.Xliff.OM.Core;
namespace XliffLib.Model
{
public abstract class ContentElement
{
public ContentElement()
{
Attributes = new AttributeList();
}
public AttributeList Attributes { get; set; }
public bool ShouldSerializeAttributes()
{
return Attributes.Count > 0;
}
public abstract XliffElement ToXliff(IdCounter idCounter);
}
}
| 21.04 | 66 | 0.638783 | [
"MIT"
] | simonech/XliffLib | XliffLib/Model/ContentElement.cs | 528 | C# |
using UnityEngine;
public static class ColorExtensions
{
/// <summary> Changes the alpha value of this color to a given value. </summary>
/// <param name="original"> This color. </param>
/// <param name="alphaValue"> The alpha value this color will receive. </param>
public static void ChangeAlphaTo(this ref Color original, float alphaValue)
{
original.a = alphaValue;
}
/// <summary> Gives the hex code of a color. </summary>
/// <param name="original"> This color. </param>
/// <returns> The hex code of this color. </returns>
public static string ToHex(this Color original)
{
return "#" + ColorUtility.ToHtmlStringRGBA(original);
}
} | 35.2 | 84 | 0.65625 | [
"MIT"
] | Cpt-Jack04/ACTools-Core | Runtime/ExtensionMethods/ColorExtensions.cs | 706 | C# |
////////////////////////////////////////////////////////////////////////////////
//NUnit tests for "EF Core Provider for LCPI OLE DB"
// IBProvider and Contributors. 08.05.2021.
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using Microsoft.EntityFrameworkCore;
using NUnit.Framework;
using xdb=lcpi.data.oledb;
namespace EFCore_LcpiOleDb_Tests.General.Work.DBMS.Firebird.V03_0_0.D1.Query.Operators.SET_001.NotEqual.Complete2__objs.NullableTimeSpan.NullableTimeSpan{
////////////////////////////////////////////////////////////////////////////////
using T_DATA1 =System.Nullable<System.TimeSpan>;
using T_DATA2 =System.Nullable<System.TimeSpan>;
using T_DATA1_U=System.TimeSpan;
using T_DATA2_U=System.TimeSpan;
////////////////////////////////////////////////////////////////////////////////
//class TestSet_001__fields__04__NN
public static class TestSet_001__fields__04__NN
{
private const string c_NameOf__TABLE ="TEST_MODIFY_ROW2";
private const string c_NameOf__COL_DATA1 ="COL_TYPE_TIME";
private const string c_NameOf__COL_DATA2 ="COL2_TYPE_TIME";
private sealed class MyContext:TestBaseDbContext
{
[Table(c_NameOf__TABLE)]
public sealed class TEST_RECORD
{
[Key]
[Column("TEST_ID")]
public System.Int64? TEST_ID { get; set; }
[Column(c_NameOf__COL_DATA1)]
public T_DATA1 COL_DATA1 { get; set; }
[Column(c_NameOf__COL_DATA2)]
public T_DATA2 COL_DATA2 { get; set; }
};//class TEST_RECORD
//----------------------------------------------------------------------
public DbSet<TEST_RECORD> testTable { get; set; }
//----------------------------------------------------------------------
public MyContext(xdb.OleDbTransaction tr)
:base(tr)
{
}//MyContext
};//class MyContext
//-----------------------------------------------------------------------
[Test]
public static void Test_001()
{
using(var cn=LocalCnHelper.CreateCn())
{
cn.Open();
using(var tr=cn.BeginTransaction())
{
//insert new record in external transaction
using(var db=new MyContext(tr))
{
System.Int64? testID=Helper__InsertRow(db,null,null);
var recs=db.testTable.Where(r => (((object)r.COL_DATA1) /*OP{*/ != /*}OP*/ ((object)r.COL_DATA2)) && r.TEST_ID==testID);
foreach(var r in recs)
{
TestServices.ThrowSelectedRow();
}//foreach r
db.CheckTextOfLastExecutedCommand
(new TestSqlTemplate()
.T("SELECT ").N("t","TEST_ID").T(", ").N("t",c_NameOf__COL_DATA1).T(", ").N("t",c_NameOf__COL_DATA2).EOL()
.T("FROM ").N(c_NameOf__TABLE).T(" AS ").N("t").EOL()
.T("WHERE ((").N("t",c_NameOf__COL_DATA1).T(" <> ").N("t",c_NameOf__COL_DATA2).T(") OR (").N("t",c_NameOf__COL_DATA1).IS_NULL().T(") OR (").N("t",c_NameOf__COL_DATA2).IS_NULL().T(")) AND ((").N("t",c_NameOf__COL_DATA1).IS_NOT_NULL().T(") OR (").N("t",c_NameOf__COL_DATA2).IS_NOT_NULL().T(")) AND (").N("t","TEST_ID").T(" = ").P_ID("__testID_0").T(")"));
}//using db
tr.Rollback();
}//using tr
}//using cn
}//Test_001
//-----------------------------------------------------------------------
[Test]
public static void Test_002()
{
using(var cn=LocalCnHelper.CreateCn())
{
cn.Open();
using(var tr=cn.BeginTransaction())
{
//insert new record in external transaction
using(var db=new MyContext(tr))
{
System.Int64? testID=Helper__InsertRow(db,null,null);
var recs=db.testTable.Where(r => !(((object)r.COL_DATA1) /*OP{*/ != /*}OP*/ ((object)r.COL_DATA2)) && r.TEST_ID==testID);
int nRecs=0;
foreach(var r in recs)
{
Assert.AreEqual
(0,
nRecs);
++nRecs;
Assert.IsTrue
(r.TEST_ID.HasValue);
Assert.AreEqual
(testID,
r.TEST_ID.Value);
Assert.AreEqual
(null,
r.COL_DATA1);
Assert.AreEqual
(null,
r.COL_DATA2);
}//foreach r
db.CheckTextOfLastExecutedCommand
(new TestSqlTemplate()
.T("SELECT ").N("t","TEST_ID").T(", ").N("t",c_NameOf__COL_DATA1).T(", ").N("t",c_NameOf__COL_DATA2).EOL()
.T("FROM ").N(c_NameOf__TABLE).T(" AS ").N("t").EOL()
.T("WHERE (((").N("t",c_NameOf__COL_DATA1).T(" = ").N("t",c_NameOf__COL_DATA2).T(") AND (").N("t",c_NameOf__COL_DATA1).IS_NOT_NULL().T(") AND (").N("t",c_NameOf__COL_DATA2).IS_NOT_NULL().T(")) OR ((").N("t",c_NameOf__COL_DATA1).IS_NULL().T(") AND (").N("t",c_NameOf__COL_DATA2).IS_NULL().T("))) AND (").N("t","TEST_ID").T(" = ").P_ID("__testID_0").T(")"));
Assert.AreEqual
(1,
nRecs);
}//using db
tr.Rollback();
}//using tr
}//using cn
}//Test_002
//Helper methods --------------------------------------------------------
private static System.Int64 Helper__InsertRow(MyContext db,
T_DATA1 valueForColData1,
T_DATA2 valueForColData2)
{
var newRecord=new MyContext.TEST_RECORD();
newRecord.COL_DATA1 =valueForColData1;
newRecord.COL_DATA2 =valueForColData2;
db.testTable.Add(newRecord);
db.SaveChanges();
db.CheckTextOfLastExecutedCommand
(new TestSqlTemplate()
.T("INSERT INTO ").N(c_NameOf__TABLE).T(" (").N(c_NameOf__COL_DATA1).T(", ").N(c_NameOf__COL_DATA2).T(")").EOL()
.T("VALUES (").P("p0").T(", ").P("p1").T(")").EOL()
.T("RETURNING ").N("TEST_ID").EOL()
.T("INTO ").P("p2").T(";"));
Assert.IsTrue
(newRecord.TEST_ID.HasValue);
Console.WriteLine("TEST_ID: {0}",newRecord.TEST_ID.Value);
return newRecord.TEST_ID.Value;
}//Helper__InsertRow
};//class TestSet_001__fields__04__NN
////////////////////////////////////////////////////////////////////////////////
}//namespace EFCore_LcpiOleDb_Tests.General.Work.DBMS.Firebird.V03_0_0.D1.Query.Operators.SET_001.NotEqual.Complete2__objs.NullableTimeSpan.NullableTimeSpan
| 32.967033 | 364 | 0.569 | [
"MIT"
] | ibprovider/Lcpi.EFCore.LcpiOleDb | Tests/General/Source/Work/DBMS/Firebird/V03_0_0/D1/Query/Operators/SET_001/NotEqual/Complete2__objs/NullableTimeSpan/NullableTimeSpan/TestSet_001__fields__04__NN.cs | 6,002 | C# |
using System;
namespace MetaTypes {
public class TestClassA {
public int testFieldInt;
public float testFieldFloat;
}
public class TestClassB {
public float floatField;
public int intField;
}
} | 18.769231 | 36 | 0.635246 | [
"MIT"
] | shironecko/project_final | src/CodeGen/MetaTypes/Class1.cs | 246 | C# |
using System;
using MikhailKhalizev.Processor.x86.BinToCSharp;
namespace MikhailKhalizev.Max.Program
{
public partial class RawProgram
{
[MethodInfo("0x1018_f477-13cb4a")]
public void /* sys_mve */ Method_1018_f477()
{
ii(0x1018_f477, 3); mov(memd[ds, edi + 4], eax); /* mov [edi+0x4], eax */
}
}
}
| 25.333333 | 96 | 0.573684 | [
"Apache-2.0"
] | mikhail-khalizev/max | source/MikhailKhalizev.Max/source/Program/Auto/z-1018-f477-sys-mve.cs | 380 | C# |
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Azure.WebJobs.Host.Triggers;
namespace Extensions.Pulsar.Triggers
{
public class PulsarTriggerContext
{
public PulsarTriggerAttribute TriggerAttribute;
public PulsarCoreClient Client;
public PulsarTriggerContext(PulsarTriggerAttribute attribute, PulsarCoreClient client)
{
this.TriggerAttribute = attribute;
this.Client = client;
}
}
}
| 22.727273 | 94 | 0.706 | [
"MIT"
] | rohver87/PulsarTrigger | src/Extensions.Pulsar/Triggers/PulsarTriggerContext.cs | 502 | C# |
#region Using Directives
using System.Linq;
using System.Collections.Generic;
#endregion
namespace Pharmatechnik.Nav.Language.FindReferences {
static class SymbolOrderer {
public static IOrderedEnumerable<T> OrderByLocation<T>(this IEnumerable<T> symbols) where T : ISymbol {
return symbols.OrderBy(s => s.Location.StartLine).ThenBy(s => s.Location.StartCharacter);
}
}
} | 22.842105 | 112 | 0.684332 | [
"MIT"
] | IInspectable/Nav-Language-Extensions | Nav.Language/FindReferences/SymbolOrderer.cs | 418 | C# |
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.Text;
using Roslyn.Test.Utilities;
using Xunit;
namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Recommendations
{
public class RegionKeywordRecommenderTests : KeywordRecommenderTests
{
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
public async Task TestNotAtRoot_Interactive()
{
await VerifyAbsenceAsync(SourceCodeKind.Script,
@"$$");
}
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
public async Task TestNotAfterClass_Interactive()
{
await VerifyAbsenceAsync(SourceCodeKind.Script,
@"class C { }
$$");
}
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
public async Task TestNotAfterGlobalStatement_Interactive()
{
await VerifyAbsenceAsync(SourceCodeKind.Script,
@"System.Console.WriteLine();
$$");
}
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
public async Task TestNotAfterGlobalVariableDeclaration_Interactive()
{
await VerifyAbsenceAsync(SourceCodeKind.Script,
@"int i = 0;
$$");
}
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
public async Task TestNotInUsingAlias()
{
await VerifyAbsenceAsync(
@"using Foo = $$");
}
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
public async Task TestNotInEmptyStatement()
{
await VerifyAbsenceAsync(AddInsideMethod(
@"$$"));
}
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
public async Task TestAfterHash()
{
await VerifyKeywordAsync(
@"#$$");
}
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
public async Task TestAfterHashAndSpace()
{
await VerifyKeywordAsync(
@"# $$");
}
}
}
| 30.388889 | 160 | 0.658135 | [
"Apache-2.0"
] | AArnott/roslyn | src/EditorFeatures/CSharpTest2/Recommendations/RegionKeywordRecommenderTests.cs | 2,188 | C# |
using System.IO;
using System.Linq;
using Bloom.Publish;
using Bloom.web.controllers;
using NUnit.Framework;
namespace BloomTests.Book
{
public class AccessibilityCheckersTests : BookTestsBase
{
[SetUp]
public void SetupFixture()
{
_collectionSettings = CreateDefaultCollectionsSettings();
_bookData = CreateDefaultBookData();
}
[Test]
public void CheckDescriptionsForAllImages_No_Images_NoProblems()
{
var html = @"<html>
<body>
<div class='bloom-page'>
<div class='marginBox'>
<div class='bloom-translationGroup normal-style'>
<div class='bloom-editable normal-style bloom-content1 bloom-contentNational1 bloom-visibility-code-on' lang='en'>
</div>
</div>
</div>
</div>
</body>
</html>";
var testBook = CreateBookWithPhysicalFile(html);
var results = AccessibilityCheckers.CheckDescriptionsForAllImages(testBook);
Assert.AreEqual(0, results.Count(), "No problems were expected.");
}
[Test]
public void CheckDescriptionsForAllImages_DescriptionInWrongLang()
{
var testBook = GetBookWithImage(@"<div class='bloom-translationGroup bloom-imageDescription'>
<div class='bloom-editable normal-style bloom-content1 bloom-contentNational1 bloom-visibility-code-on' lang='a2b'>
<p>A flower.</p>
</div>
</div>
</div>");
var results = AccessibilityCheckers.CheckDescriptionsForAllImages(testBook);
Assert.AreEqual(1, results.Count(), "Should point out missing language description");
}
[Test]
public void CheckDescriptionsForAllImages_DescriptionInCorrectLang()
{
var testBook = GetBookWithImage(
$@"<div class='bloom-translationGroup bloom-imageDescription'>
<div class='bloom-editable' lang='{_bookData.Language1.Iso639Code}'>
<p>A flower.</p>
</div>
</div>");
var results = AccessibilityCheckers.CheckDescriptionsForAllImages(testBook);
Assert.AreEqual(0, results.Count(), "No problems were expected");
}
[Test]
[TestCase("3", "unused")]
[TestCase(null, "Cover Page")]
public void CheckDescriptionsForAllImages_DescriptionEmpty(string pageNumber, string pageLabel)
{
var testBook = GetBookWithImage(
$@"<div class='bloom-translationGroup bloom-imageDescription'>
<div class='bloom-editable' lang='{_bookData.Language1.Iso639Code}'>
<p> </p>
</div>
</div>",
pageNumber, pageLabel);
var results = AccessibilityCheckers.CheckDescriptionsForAllImages(testBook);
Assert.AreEqual(1, results.Count(), "Should point out missing image description");
var expected = pageNumber ?? pageLabel;
Assert.AreEqual($"Missing image description on page {expected}", results.First().message);
}
[Test]
public void CheckDescriptionsForAllImages_MutliplePages()
{
var divWithoutCorrectLangDescription =
$@"<div class='bloom-translationGroup bloom-imageDescription'>
<div class='bloom-editable' lang='{_bookData.Language1.Iso639Code}'>
<p> </p>
</div>
</div>";
var divWithDescription =
$@"<div class='bloom-translationGroup bloom-imageDescription'>
<div class='bloom-editable' lang='{_bookData.Language1.Iso639Code}'>
<p>A nice flower</p>
</div>
</div>";
var html = $@"<html> <body>
{MakeHtmlForPageWithImage(divWithDescription)}
{MakeHtmlForPageWithImage(divWithoutCorrectLangDescription)}
{MakeHtmlForPageWithImage(divWithDescription)}
{MakeHtmlForPageWithImage(divWithoutCorrectLangDescription)}
</body> </html>";
var testBook = CreateBookWithPhysicalFile(html);
var results = AccessibilityCheckers.CheckDescriptionsForAllImages(testBook);
Assert.AreEqual(2, results.Count(), "Should point out missing image description");
}
[Test]
public void CheckDescriptionsForAllImages_AriaHidden()
{
var divWithoutCorrectLangDescription =
$@"<div class='bloom-translationGroup bloom-imageDescription'>
<div class='bloom-editable' lang='{_bookData.Language1.Iso639Code}'>
<p> </p>
</div>
</div>";
var divWithDescription =
$@"<div class='bloom-translationGroup bloom-imageDescription'>
<div class='bloom-editable' lang='{_bookData.Language1.Iso639Code}'>
<p>A nice flower</p>
</div>
</div>";
var html = $@"<html> <body>
{MakeHtmlForPageWithImage(divWithDescription)}
{MakeHtmlForPageWithImage(divWithoutCorrectLangDescription)}
{MakeHtmlForPageWithImageAriaHidden(divWithDescription)}
{MakeHtmlForPageWithImageAriaHidden(divWithoutCorrectLangDescription)}
</body> </html>";
var testBook = CreateBookWithPhysicalFile(html);
var results = AccessibilityCheckers.CheckDescriptionsForAllImages(testBook);
Assert.AreEqual(1, results.Count(), "Should point out missing image description");
}
/* -----------------------------------------------------------------------------------*/
/* ----------------------CheckAudioForAllText-----------------------------------------*/
/* -----------------------------------------------------------------------------------*/
[TestCase("<p><span id='iExist' class='audio-sentence'>A flower.</span></p>")]
[TestCase("<p><div id='iExist' class='audio-sentence'>A flower.</div></p>")]
[TestCase(@"<p><span id='iExist' class='audio-sentence'>A flower.</span>
<span id='iExist' class='audio-sentence'>A dog.</span></p>")]
[TestCase(@"<p><div id='iExist' class='audio-sentence'>A flower.</div>
<div id='iExist' class='audio-sentence'>A dog.</div></p>")]
[TestCase(@"<label>This is bubble text</label>")]
public void CheckAudioForAllText_NoErrors(string content)
{
var testBook = MakeBookWithOneAudioFile($@"<div class='bloom-translationGroup'>
<div class='bloom-editable normal-style bloom-content1 bloom-contentNational1 bloom-visibility-code-on' lang='{
_bookData.Language1.Iso639Code
}'>
{content}
</div>
</div>
</div>");
var results = AccessibilityCheckers.CheckAudioForAllText(testBook);
Assert.AreEqual(0, results.Count(), "No errors were expected");
}
[Test]
public void CheckAudioForAllText_RecordingOnBloomEditable_NoErrors()
{
var testBook = MakeBookWithOneAudioFile($@"<div class='bloom-translationGroup'>
<div class='bloom-editable normal-style bloom-content1 bloom-contentNational1 bloom-visibility-code-on audio-sentence' id='iExist' lang='{
_bookData.Language1.Iso639Code
}'>
<p>This is the text</p>
</div>
</div>
</div>");
var results = AccessibilityCheckers.CheckAudioForAllText(testBook);
Assert.AreEqual(0, results.Count(), "No errors were expected");
}
[TestCase("<p>A flower.</p>")]
[TestCase(@"<p><span id='iExist' class='audio-sentence'>A flower.</span>
A dog.</p>")]
[TestCase(@"<p><div id='iExist' class='audio-sentence'>A flower.</div>
A dog.</p>")]
[TestCase(@"<p><span id='iExist' class='audio-sentence'>A flower.</span></p>
<p>A dog.</p>")]
public void CheckAudioForAllText_TextWithoutSpans(string content)
{
var testBook = MakeBookWithOneAudioFile($@"<div class='bloom-translationGroup'>
<div class='bloom-editable normal-style bloom-content1 bloom-contentNational1 bloom-visibility-code-on' lang='{
_bookData.Language1.Iso639Code
}'>
{content}
</div>
</div>
</div>");
var results = AccessibilityCheckers.CheckAudioForAllText(testBook);
Assert.Greater(results.Count(), 0, "Error should have been reported");
}
[TestCase("<p><span id='bogus123' class='audio-sentence'>A flower.</span></p>")]
[TestCase("<p><div id='bogus123' class='audio-sentence'>A flower.</div></p>")]
[TestCase(@"<p><span id='iExist' class='audio-sentence'>A flower.</span></p>
<p><span id='bogus456' class='audio-sentence'>A dog.</span</p>")]
[TestCase(@"<p><div id='iExist' class='audio-sentence'>A flower.</div></p>
<p><div id='bogus456' class='audio-sentence'>A dog.</div</p>")]
public void CheckAudioForAllText_SpansAudioMissing(string content)
{
var testBook = MakeBookWithOneAudioFile($@"<div class='bloom-translationGroup'>
<div class='bloom-editable normal-style bloom-content1 bloom-contentNational1 bloom-visibility-code-on' lang='{
_bookData.Language1.Iso639Code
}'>
{content}
</div>
</div>
</div>");
var results = AccessibilityCheckers.CheckAudioForAllText(testBook);
Assert.Greater(results.Count(), 0, "Error should have been reported");
}
[Test]
public void CheckAudioForAllText_TextInRandomLangButVisibleAndNotRecorded_GivesError()
{
var testBook = MakeBookWithOneAudioFile($@"<div class='bloom-translationGroup'>
<div class='bloom-editable bloom-visibility-code-on' lang=''>
<p>hello</p>
</div>
</div>
</div>");
var results = AccessibilityCheckers.CheckAudioForAllText(testBook);
Assert.AreEqual(1,results.Count(), "The text has to be recorded because it is visible");
}
[Test]
public void CheckAudioForAllText_TextInNationalLanguageNotVisible_NotRecorded()
{
var testBook = MakeBookWithOneAudioFile($@"<div class='bloom-translationGroup'>
<div class='bloom-editable bloom-visibility-code-off' lang='{
_bookData.MetadataLanguage1IsoCode
}'>
<p>hello</p>
</div>
</div>
</div>");
var results = AccessibilityCheckers.CheckAudioForAllText(testBook);
Assert.AreEqual(0, results.Count(), "Since the text is not visible, should not give error if not recorded");
}
[Test]
public void CheckAudioForAllText_AudioMissingInImageDescriptionOnly_DoesNotReport()
{
var testBook = GetBookWithImage($@"<div class='bloom-translationGroup bloom-imageDescription'>
<div class='bloom-editable normal-style bloom-content1 bloom-contentNational1 bloom-visibility-code-on' lang='{
_bookData.Language1.Iso639Code
}'>
<p>record me!</p>
</div>
</div>
</div>");
var results = AccessibilityCheckers.CheckAudioForAllText(testBook);
Assert.AreEqual(0, results.Count(), "No error should have been reported");
}
/* -----------------------------------------------------------------------------------*/
/* ----------------------CheckAudioForAllImageDescriptions----------------------------*/
/* -----------------------------------------------------------------------------------*/
// Note, we do not retest all the corner cases that were tested for
// CheckAudioForAllText(), because the code is shared beteween them
[TestCase(0, "<p><span id='iExist' class='audio-sentence'>A flower.</span></p>")]
[TestCase(0, "<p><div id='iExist' class='audio-sentence'>A flower.</div></p>")]
[TestCase(1, "<p><span id='bogus123' class='audio-sentence'>A flower.</span></p>")]
[TestCase(1, "<p><div id='bogus123' class='audio-sentence'>A flower.</div></p>")]
public void CheckAudioForAllImageDescriptions_AudioMissing(int numberOfErrorsExpected, string content)
{
var testBook = MakeBookWithOneAudioFile($@"<div class='bloom-translationGroup bloom-imageDescription'>
<div class='bloom-editable normal-style bloom-content1 bloom-contentNational1 bloom-visibility-code-on' lang='{
_bookData.Language1.Iso639Code
}'>
{content}
</div>
</div>
</div>");
var results = AccessibilityCheckers.CheckAudioForAllImageDescriptions(testBook);
Assert.AreEqual(numberOfErrorsExpected, results.Count(), "Number of errors does not match expected");
}
[Test]
public void CheckAudioForAllImageDescriptions_AudioFolderMissing_JustReturnsNormalMissingAudioError()
{
var testBook = MakeBookWithOneAudioFile($@"<div class='bloom-translationGroup bloom-imageDescription'>
<div class='bloom-editable normal-style bloom-content1 bloom-contentNational1 bloom-visibility-code-on' lang='{
_bookData.Language1.Iso639Code
}'>
{"<p><span id='bogus123' class='audio-sentence'>A flower.</span></p>"}
</div>
</div>
</div>");
SIL.IO.RobustIO.DeleteDirectoryAndContents(AudioProcessor.GetAudioFolderPath(testBook.FolderPath));
var results = AccessibilityCheckers.CheckAudioForAllImageDescriptions(testBook);
Assert.AreEqual(1, results.Count(), "Number of errors does not match expected");
}
private Bloom.Book.Book GetBookWithImage(string translationGroupText, string pageNumber = "1",
string pageLabel = "Some page label")
{
var html = $@"<html> <body>
{MakeHtmlForPageWithImage(translationGroupText, pageNumber, pageLabel)}
</body> </html>";
return CreateBookWithPhysicalFile(html);
}
private string MakeHtmlForPageWithImage(string translationGroupText, string pageNumber = "1",
string pageLabel = "Some page label")
{
return $@"<div class='bloom-page' data-page-number='{pageNumber ?? ""}'>
<div class='pageLabel'>{pageLabel}</div>
<div class='marginBox'>
<div class='bloom-imageContainer'>
<img src='flower.png'></img>
{translationGroupText}
</div>
</div>
</div>";
}
private string MakeHtmlForPageWithImageAriaHidden(string translationGroupText, string pageNumber = "1",
string pageLabel = "Some page label")
{
return $@"<div class='bloom-page' data-page-number='{pageNumber ?? ""}'>
<div class='pageLabel'>{pageLabel}</div>
<div class='marginBox'>
<div class='bloom-imageContainer' aria-hidden='true'>
<img src='flower.png'></img>
{translationGroupText}
</div>
</div>
</div>";
}
private Bloom.Book.Book MakeBookWithOneAudioFile(string translationGroupText, string pageNumber = "1",
string pageLabel = "Some page label")
{
var html = $@"<html> <body>
{GetHtmlForPage(translationGroupText, pageNumber, pageLabel)}
</body> </html>";
var book = CreateBookWithPhysicalFile(html);
var audioDir = AudioProcessor.GetAudioFolderPath(book.FolderPath);
Directory.CreateDirectory(audioDir);
File.WriteAllText(Path.Combine(audioDir, "iExist.mp3"), "hello");
return book;
}
private string GetHtmlForPage(string translationGroupText, string pageNumber = "1",
string pageLabel = "Some page label")
{
return $@"<div class='bloom-page' data-page-number='{pageNumber ?? ""}'>
<div class='pageLabel'>{pageLabel}</div>
<div class='marginBox'>
{translationGroupText}
</div>";
}
}
}
| 39.178862 | 148 | 0.666736 | [
"MIT"
] | BloomBooks/BloomDesktop | src/BloomTests/Book/AccessibilityCheckersTests.cs | 14,459 | C# |
namespace foto_select
{
partial class Form1
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.statusLabelOriginFolder = new System.Windows.Forms.ToolStripStatusLabel();
this.statusLabelDestFolder1 = new System.Windows.Forms.ToolStripStatusLabel();
this.statusLabelDestFolder2 = new System.Windows.Forms.ToolStripStatusLabel();
this.statusLabelCurFile = new System.Windows.Forms.ToolStripStatusLabel();
this.statusLabelSpacer = new System.Windows.Forms.ToolStripStatusLabel();
this.statusLabelFileCounter = new System.Windows.Forms.ToolStripStatusLabel();
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.originToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.destination1ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.destination2ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.statusStrip1.SuspendLayout();
this.menuStrip1.SuspendLayout();
this.SuspendLayout();
//
// pictureBox1
//
this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.pictureBox1.Location = new System.Drawing.Point(0, 0);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(800, 450);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBox1.TabIndex = 0;
this.pictureBox1.TabStop = false;
//
// statusStrip1
//
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.statusLabelOriginFolder,
this.statusLabelDestFolder1,
this.statusLabelDestFolder2,
this.statusLabelCurFile,
this.statusLabelSpacer,
this.statusLabelFileCounter});
this.statusStrip1.Location = new System.Drawing.Point(0, 426);
this.statusStrip1.Name = "statusStrip1";
this.statusStrip1.Size = new System.Drawing.Size(800, 24);
this.statusStrip1.TabIndex = 1;
this.statusStrip1.Text = "statusStrip1";
//
// statusLabelOriginFolder
//
this.statusLabelOriginFolder.BorderSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)((((System.Windows.Forms.ToolStripStatusLabelBorderSides.Left | System.Windows.Forms.ToolStripStatusLabelBorderSides.Top)
| System.Windows.Forms.ToolStripStatusLabelBorderSides.Right)
| System.Windows.Forms.ToolStripStatusLabelBorderSides.Bottom)));
this.statusLabelOriginFolder.Name = "statusLabelOriginFolder";
this.statusLabelOriginFolder.Size = new System.Drawing.Size(73, 19);
this.statusLabelOriginFolder.Text = "O:<empty>";
//
// statusLabelDestFolder1
//
this.statusLabelDestFolder1.BorderSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)((((System.Windows.Forms.ToolStripStatusLabelBorderSides.Left | System.Windows.Forms.ToolStripStatusLabelBorderSides.Top)
| System.Windows.Forms.ToolStripStatusLabelBorderSides.Right)
| System.Windows.Forms.ToolStripStatusLabelBorderSides.Bottom)));
this.statusLabelDestFolder1.Name = "statusLabelDestFolder1";
this.statusLabelDestFolder1.Size = new System.Drawing.Size(78, 19);
this.statusLabelDestFolder1.Text = "D1:<empty>";
//
// statusLabelDestFolder2
//
this.statusLabelDestFolder2.BorderSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)((((System.Windows.Forms.ToolStripStatusLabelBorderSides.Left | System.Windows.Forms.ToolStripStatusLabelBorderSides.Top)
| System.Windows.Forms.ToolStripStatusLabelBorderSides.Right)
| System.Windows.Forms.ToolStripStatusLabelBorderSides.Bottom)));
this.statusLabelDestFolder2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.statusLabelDestFolder2.Name = "statusLabelDestFolder2";
this.statusLabelDestFolder2.Size = new System.Drawing.Size(78, 19);
this.statusLabelDestFolder2.Text = "D2:<empty>";
//
// statusLabelCurFile
//
this.statusLabelCurFile.BackColor = System.Drawing.SystemColors.Control;
this.statusLabelCurFile.Name = "statusLabelCurFile";
this.statusLabelCurFile.Size = new System.Drawing.Size(0, 19);
//
// statusLabelSpacer
//
this.statusLabelSpacer.Name = "statusLabelSpacer";
this.statusLabelSpacer.Size = new System.Drawing.Size(556, 19);
this.statusLabelSpacer.Spring = true;
//
// statusLabelFileCounter
//
this.statusLabelFileCounter.Name = "statusLabelFileCounter";
this.statusLabelFileCounter.Size = new System.Drawing.Size(0, 19);
//
// menuStrip1
//
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.originToolStripMenuItem,
this.destination1ToolStripMenuItem,
this.destination2ToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(800, 24);
this.menuStrip1.TabIndex = 2;
this.menuStrip1.Text = "menuStrip1";
//
// originToolStripMenuItem
//
this.originToolStripMenuItem.Name = "originToolStripMenuItem";
this.originToolStripMenuItem.Size = new System.Drawing.Size(52, 20);
this.originToolStripMenuItem.Text = "Origin";
this.originToolStripMenuItem.Click += new System.EventHandler(this.SelectOriginToolStripMenuItem_Click);
//
// destination1ToolStripMenuItem
//
this.destination1ToolStripMenuItem.Name = "destination1ToolStripMenuItem";
this.destination1ToolStripMenuItem.Size = new System.Drawing.Size(85, 20);
this.destination1ToolStripMenuItem.Text = "Destination1";
this.destination1ToolStripMenuItem.Click += new System.EventHandler(this.selectDest1ToolStripMenuItem_Click);
//
// destination2ToolStripMenuItem
//
this.destination2ToolStripMenuItem.Name = "destination2ToolStripMenuItem";
this.destination2ToolStripMenuItem.Size = new System.Drawing.Size(85, 20);
this.destination2ToolStripMenuItem.Text = "Destination2";
this.destination2ToolStripMenuItem.Click += new System.EventHandler(this.selectDest2ToolStripMenuItem_Click);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Controls.Add(this.statusStrip1);
this.Controls.Add(this.menuStrip1);
this.Controls.Add(this.pictureBox1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.KeyPreview = true;
this.MainMenuStrip = this.menuStrip1;
this.Name = "Form1";
this.Text = "Foto Select";
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout();
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.StatusStrip statusStrip1;
private System.Windows.Forms.ToolStripStatusLabel statusLabelOriginFolder;
private System.Windows.Forms.ToolStripStatusLabel statusLabelDestFolder1;
private System.Windows.Forms.ToolStripStatusLabel statusLabelDestFolder2;
private System.Windows.Forms.MenuStrip menuStrip1;
private System.Windows.Forms.ToolStripMenuItem originToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem destination1ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem destination2ToolStripMenuItem;
private System.Windows.Forms.ToolStripStatusLabel statusLabelCurFile;
private System.Windows.Forms.ToolStripStatusLabel statusLabelSpacer;
private System.Windows.Forms.ToolStripStatusLabel statusLabelFileCounter;
}
}
| 53.057292 | 232 | 0.653087 | [
"MIT"
] | berserck/foto-select | foto-select/Form1.Designer.cs | 10,189 | C# |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System;
using System.Text.Json;
using Azure.Core;
namespace Azure.Search.Documents.Models
{
public partial class IndexingSchedule : IUtf8JsonSerializable
{
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
{
writer.WriteStartObject();
writer.WritePropertyName("interval");
writer.WriteStringValue(Interval, "P");
if (StartTime != null)
{
writer.WritePropertyName("startTime");
writer.WriteStringValue(StartTime.Value, "O");
}
writer.WriteEndObject();
}
internal static IndexingSchedule DeserializeIndexingSchedule(JsonElement element)
{
TimeSpan interval = default;
DateTimeOffset? startTime = default;
foreach (var property in element.EnumerateObject())
{
if (property.NameEquals("interval"))
{
interval = property.Value.GetTimeSpan("P");
continue;
}
if (property.NameEquals("startTime"))
{
if (property.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
startTime = property.Value.GetDateTimeOffset("O");
continue;
}
}
return new IndexingSchedule(interval, startTime);
}
}
}
| 30.351852 | 89 | 0.536913 | [
"MIT"
] | Mdlglobal-atlassian-net/azure-sdk-for-net | sdk/search/Azure.Search.Documents/src/Generated/Models/IndexingSchedule.Serialization.cs | 1,639 | C# |
using NSubstitute;
using Xamarin.Forms;
using Xamarin.Platform.Layouts;
using Xunit;
namespace Xamarin.Platform.Handlers.UnitTests.Layouts
{
[Category(TestCategory.Core, TestCategory.Layout)]
public class LayoutExtensionTests
{
[Fact]
public void FrameExcludesMargin()
{
var element = Substitute.For<IFrameworkElement>();
var margin = new Thickness(20);
element.Margin.Returns(margin);
var bounds = new Rectangle(0, 0, 100, 100);
var frame = element.ComputeFrame(bounds);
// With a margin of 20 all the way around, we expect the actual frame
// to be 60x60, with an x,y position of 20,20
Assert.Equal(20, frame.Top);
Assert.Equal(20, frame.Left);
Assert.Equal(60, frame.Width);
Assert.Equal(60, frame.Height);
}
[Fact]
public void FrameSizeGoesToZeroWhenMarginsExceedBounds()
{
var element = Substitute.For<IFrameworkElement>();
var margin = new Thickness(200);
element.Margin.Returns(margin);
var bounds = new Rectangle(0, 0, 100, 100);
var frame = element.ComputeFrame(bounds);
// The margin is simply too large for the bounds; since negative widths/heights on a frame don't make sense,
// we expect them to collapse to zero
Assert.Equal(0, frame.Height);
Assert.Equal(0, frame.Width);
}
[Fact]
public void DesiredSizeIncludesMargin()
{
var widthConstraint = 400;
var heightConstraint = 655;
var handler = Substitute.For<IViewHandler>();
var element = Substitute.For<IFrameworkElement>();
var margin = new Thickness(20);
// Our "native" control will request a size of (100,50) when we call GetDesiredSize
handler.GetDesiredSize(Arg.Any<double>(), Arg.Any<double>()).Returns(new Size(100, 50));
element.Handler.Returns(handler);
element.Margin.Returns(margin);
var desiredSize = element.ComputeDesiredSize(widthConstraint, heightConstraint);
// Because the actual ("native") measurement comes back with (100,50)
// and the margin on the IFrameworkElement is 20, the expected width is (100 + 20 + 20) = 140
// and the expected height is (50 + 20 + 20) = 90
Assert.Equal(140, desiredSize.Width);
Assert.Equal(90, desiredSize.Height);
}
}
}
| 29.958904 | 111 | 0.709191 | [
"MIT"
] | gywerd/CPUI | src/Platform.Handlers/tests/Xamarin.Platform.Handlers.UnitTests/Layouts/LayoutExtensionTests.cs | 2,189 | C# |
using System;
namespace TimeTakenTestServer.Areas.HelpPage.ModelDescriptions
{
/// <summary>
/// Use this attribute to change the name of the <see cref="ModelDescription"/> generated for a type.
/// </summary>
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum, AllowMultiple = false, Inherited = false)]
public sealed class ModelNameAttribute : Attribute
{
public ModelNameAttribute(string name)
{
Name = name;
}
public string Name { get; private set; }
}
} | 31.666667 | 136 | 0.67193 | [
"Apache-2.0"
] | joymon/dotnet-demos | web/iis/time-taken-field-demo/TestServer/Areas/HelpPage/ModelDescriptions/ModelNameAttribute.cs | 570 | C# |
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
using Contoso.FraudProtection.ApplicationCore.Entities.FraudProtectionApiModels;
using Contoso.FraudProtection.ApplicationCore.Entities.FraudProtectionApiModels.Response;
using Microsoft.Dynamics.FraudProtection.Models.BankEventEvent;
using Microsoft.Dynamics.FraudProtection.Models.ChargebackEvent;
using Microsoft.Dynamics.FraudProtection.Models.LabelEvent;
using Microsoft.Dynamics.FraudProtection.Models.PurchaseEvent;
using Microsoft.Dynamics.FraudProtection.Models.PurchaseStatusEvent;
using Microsoft.Dynamics.FraudProtection.Models.RefundEvent;
using Microsoft.Dynamics.FraudProtection.Models.SignupEvent;
using Microsoft.Dynamics.FraudProtection.Models.SignupStatusEvent;
using Microsoft.Dynamics.FraudProtection.Models.UpdateAccountEvent;
using System.Threading.Tasks;
using AccountProtection = Contoso.FraudProtection.ApplicationCore.Entities.FraudProtectionApiModels.AccountProtection;
namespace Contoso.FraudProtection.ApplicationCore.Interfaces
{
#region Fraud Protection Service
public interface IFraudProtectionService
{
string NewCorrelationId { get; }
Task<PurchaseResponse> PostPurchase(Purchase purchase, string correlationId);
Task<SignupResponse> PostSignup(SignUp signup, string correlationId);
Task<AccountProtection.Response> PostSignupAP(AccountProtection.SignUp signup, string correlationId);
Task<FraudProtectionResponse> PostRefund(Refund refund, string correlationId);
Task<FraudProtectionResponse> PostUser(User userAccount, string correlationId);
Task<FraudProtectionResponse> PostBankEvent(BankEvent bankEvent, string correlationId);
Task<FraudProtectionResponse> PostChargeback(Chargeback chargeback, string correlationId);
Task<FraudProtectionResponse> PostPurchaseStatus(PurchaseStatusEvent purchaseStatus, string correlationId);
Task<FraudProtectionResponse> PostSignupStatus(SignupStatusEvent signupStatus, string correlationId);
Task<FraudProtectionResponse> PostLabel(Label label, string correlationId);
Task<SignInResponse> PostSignIn(SignIn request, string correlationId);
Task<AccountProtection.Response> PostSignInAP(AccountProtection.SignIn request, string correlationId);
}
#endregion
}
| 44.301887 | 118 | 0.821124 | [
"MIT"
] | haixie/test | src/ApplicationCore/Interfaces/IFraudPreventionService.cs | 2,348 | C# |
private class Simplifier.VertexDataHash // TypeDefIndex: 9216
{
// Fields
private Vector3 _v3Vertex; // 0x10
private Vector3 _v3Normal; // 0x1C
private Vector2 _v2Mapping1; // 0x28
private Vector2 _v2Mapping2; // 0x30
private Color32 _color; // 0x38
private MeshUniqueVertices.UniqueVertex _uniqueVertex; // 0x40
// Properties
public Vector3 Vertex { get; }
public Vector3 Normal { get; }
public Vector2 UV1 { get; }
public Vector2 UV2 { get; }
public Color32 Color { get; }
// Methods
// RVA: 0x1F5F040 Offset: 0x1F5F141 VA: 0x1F5F040
public Vector3 get_Vertex() { }
// RVA: 0x1F5F050 Offset: 0x1F5F151 VA: 0x1F5F050
public Vector3 get_Normal() { }
// RVA: 0x1F5F060 Offset: 0x1F5F161 VA: 0x1F5F060
public Vector2 get_UV1() { }
// RVA: 0x1F5F070 Offset: 0x1F5F171 VA: 0x1F5F070
public Vector2 get_UV2() { }
// RVA: 0x1F5F080 Offset: 0x1F5F181 VA: 0x1F5F080
public Color32 get_Color() { }
// RVA: 0x1F5DE60 Offset: 0x1F5DF61 VA: 0x1F5DE60
public void .ctor(Vector3 v3Vertex, Vector3 v3Normal, Vector2 v2Mapping1, Vector2 v2Mapping2, Color32 color) { }
// RVA: 0x1F5F090 Offset: 0x1F5F191 VA: 0x1F5F090 Slot: 0
public override bool Equals(object obj) { }
// RVA: 0x1F5F250 Offset: 0x1F5F351 VA: 0x1F5F250 Slot: 2
public override int GetHashCode() { }
// RVA: 0x1F5F270 Offset: 0x1F5F371 VA: 0x1F5F270
public static bool op_Equality(Simplifier.VertexDataHash a, Simplifier.VertexDataHash b) { }
// RVA: 0x1F5F290 Offset: 0x1F5F391 VA: 0x1F5F290
public static bool op_Inequality(Simplifier.VertexDataHash a, Simplifier.VertexDataHash b) { }
}
| 31.117647 | 113 | 0.73913 | [
"MIT"
] | SinsofSloth/RF5-global-metadata | _no_namespace/Simplifier.VertexDataHash.cs | 1,587 | C# |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("01. Numbers from 1 to N")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("01. Numbers from 1 to N")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("803ebac0-1ffd-42b6-8ead-a25f02686f0f")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| 38.351351 | 84 | 0.740662 | [
"MIT"
] | Horwits/Telerik-Academy-2016-2017 | C#/C#-Part-One/06. Loops/01. Numbers from 1 to N/Properties/AssemblyInfo.cs | 1,422 | C# |
using System;
using System.Runtime.Serialization;
namespace EventStore.ClientAPI.Exceptions
{
/// <summary>
/// Exception thrown if cluster discovery fails.
/// </summary>
public class ClusterException : EventStoreConnectionException
{
/// <summary>
/// Constructs a new <see cref="ClusterException" />.
/// </summary>
public ClusterException()
{
}
/// <summary>
/// Constructs a new <see cref="ClusterException" />.
/// </summary>
public ClusterException(string message)
: base(message)
{
}
/// <summary>
/// Constructs a new <see cref="ClusterException" />.
/// </summary>
public ClusterException(string message, Exception innerException)
: base(message, innerException)
{
}
/// <summary>
/// Constructs a new <see cref="ClusterException" />.
/// </summary>
protected ClusterException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
}
} | 27.02381 | 84 | 0.552423 | [
"Apache-2.0",
"CC0-1.0"
] | BertschiAG/EventStore | src/EventStore.ClientAPI/Exceptions/ClusterException.cs | 1,137 | C# |
using UnityEngine.Events;
using UnityEngine.Experimental.Rendering.HDPipeline;
namespace UnityEditor.Experimental.Rendering.HDPipeline
{
using CED = CoreEditorDrawer<ReflectionProxyVolumeComponentUI, SerializedReflectionProxyVolumeComponent>;
class ReflectionProxyVolumeComponentUI : BaseUI<SerializedReflectionProxyVolumeComponent>
{
public static readonly CED.IDrawer Inspector;
static ReflectionProxyVolumeComponentUI()
{
Inspector = CED.Select(
(s, d, o) => s.proxyVolume,
(s, d, o) => d.proxyVolume,
ProxyVolumeUI.SectionShape
);
}
public ProxyVolumeUI proxyVolume = new ProxyVolumeUI();
public ReflectionProxyVolumeComponentUI()
: base(0)
{
}
public override void Reset(SerializedReflectionProxyVolumeComponent data, UnityAction repaint)
{
if (data != null)
proxyVolume.Reset(data.proxyVolume, repaint);
base.Reset(data, repaint);
}
public override void Update()
{
proxyVolume.Update();
base.Update();
}
public static void DrawHandles_EditBase(ReflectionProxyVolumeComponentUI ui, ReflectionProxyVolumeComponent target)
{
ProxyVolumeUI.DrawHandles_EditBase(target.transform, target.proxyVolume, ui.proxyVolume, target);
}
public static void DrawHandles_EditNone(ReflectionProxyVolumeComponentUI ui, ReflectionProxyVolumeComponent target)
{
ProxyVolumeUI.DrawHandles_EditNone(target.transform, target.proxyVolume, ui.proxyVolume, target);
}
public static void DrawGizmos_EditNone(ReflectionProxyVolumeComponentUI ui, ReflectionProxyVolumeComponent target)
{
ProxyVolumeUI.DrawGizmos_EditNone(target.transform, target.proxyVolume, ui.proxyVolume, target);
}
}
}
| 34.736842 | 123 | 0.661616 | [
"MIT"
] | 17cuA/AimRacing11 | AimRacing2019_05_31/AimRacing2019_05_31/Packages/com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/Volume/ReflectionProxyVolumeComponentUI.cs | 1,980 | C# |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Core.Pipeline;
using Azure.ResourceManager.Cdn.Models;
using Azure.ResourceManager.Core;
namespace Azure.ResourceManager.Cdn
{
/// <summary> A class representing collection of AfdCustomDomain and their operations over its parent. </summary>
public partial class AfdCustomDomainCollection : ArmCollection, IEnumerable<AfdCustomDomain>, IAsyncEnumerable<AfdCustomDomain>
{
private readonly ClientDiagnostics _clientDiagnostics;
private readonly AfdCustomDomainsRestOperations _afdCustomDomainsRestClient;
/// <summary> Initializes a new instance of the <see cref="AfdCustomDomainCollection"/> class for mocking. </summary>
protected AfdCustomDomainCollection()
{
}
/// <summary> Initializes a new instance of AfdCustomDomainCollection class. </summary>
/// <param name="parent"> The resource representing the parent resource. </param>
internal AfdCustomDomainCollection(ArmResource parent) : base(parent)
{
_clientDiagnostics = new ClientDiagnostics(ClientOptions);
_afdCustomDomainsRestClient = new AfdCustomDomainsRestOperations(_clientDiagnostics, Pipeline, ClientOptions, BaseUri);
#if DEBUG
ValidateResourceId(Id);
#endif
}
internal static void ValidateResourceId(ResourceIdentifier id)
{
if (id.ResourceType != Profile.ResourceType)
throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, Profile.ResourceType), nameof(id));
}
// Collection level operations.
/// <summary> Creates a new domain within the specified profile. </summary>
/// <param name="customDomainName"> Name of the domain under the profile which is unique globally. </param>
/// <param name="customDomain"> Domain properties. </param>
/// <param name="waitForCompletion"> Waits for the completion of the long running operations. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <exception cref="ArgumentNullException"> <paramref name="customDomainName"/> or <paramref name="customDomain"/> is null. </exception>
public virtual AfdCustomDomainCreateOperation CreateOrUpdate(string customDomainName, AfdCustomDomainData customDomain, bool waitForCompletion = true, CancellationToken cancellationToken = default)
{
if (customDomainName == null)
{
throw new ArgumentNullException(nameof(customDomainName));
}
if (customDomain == null)
{
throw new ArgumentNullException(nameof(customDomain));
}
using var scope = _clientDiagnostics.CreateScope("AfdCustomDomainCollection.CreateOrUpdate");
scope.Start();
try
{
var response = _afdCustomDomainsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, customDomainName, customDomain, cancellationToken);
var operation = new AfdCustomDomainCreateOperation(Parent, _clientDiagnostics, Pipeline, _afdCustomDomainsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, customDomainName, customDomain).Request, response);
if (waitForCompletion)
operation.WaitForCompletion(cancellationToken);
return operation;
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
/// <summary> Creates a new domain within the specified profile. </summary>
/// <param name="customDomainName"> Name of the domain under the profile which is unique globally. </param>
/// <param name="customDomain"> Domain properties. </param>
/// <param name="waitForCompletion"> Waits for the completion of the long running operations. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <exception cref="ArgumentNullException"> <paramref name="customDomainName"/> or <paramref name="customDomain"/> is null. </exception>
public async virtual Task<AfdCustomDomainCreateOperation> CreateOrUpdateAsync(string customDomainName, AfdCustomDomainData customDomain, bool waitForCompletion = true, CancellationToken cancellationToken = default)
{
if (customDomainName == null)
{
throw new ArgumentNullException(nameof(customDomainName));
}
if (customDomain == null)
{
throw new ArgumentNullException(nameof(customDomain));
}
using var scope = _clientDiagnostics.CreateScope("AfdCustomDomainCollection.CreateOrUpdate");
scope.Start();
try
{
var response = await _afdCustomDomainsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, customDomainName, customDomain, cancellationToken).ConfigureAwait(false);
var operation = new AfdCustomDomainCreateOperation(Parent, _clientDiagnostics, Pipeline, _afdCustomDomainsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, customDomainName, customDomain).Request, response);
if (waitForCompletion)
await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
return operation;
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
/// <summary> Gets an existing AzureFrontDoor domain with the specified domain name under the specified subscription, resource group and profile. </summary>
/// <param name="customDomainName"> Name of the domain under the profile which is unique globally. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <exception cref="ArgumentNullException"> <paramref name="customDomainName"/> is null. </exception>
public virtual Response<AfdCustomDomain> Get(string customDomainName, CancellationToken cancellationToken = default)
{
if (customDomainName == null)
{
throw new ArgumentNullException(nameof(customDomainName));
}
using var scope = _clientDiagnostics.CreateScope("AfdCustomDomainCollection.Get");
scope.Start();
try
{
var response = _afdCustomDomainsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, customDomainName, cancellationToken);
if (response.Value == null)
throw _clientDiagnostics.CreateRequestFailedException(response.GetRawResponse());
return Response.FromValue(new AfdCustomDomain(Parent, response.Value), response.GetRawResponse());
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
/// <summary> Gets an existing AzureFrontDoor domain with the specified domain name under the specified subscription, resource group and profile. </summary>
/// <param name="customDomainName"> Name of the domain under the profile which is unique globally. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <exception cref="ArgumentNullException"> <paramref name="customDomainName"/> is null. </exception>
public async virtual Task<Response<AfdCustomDomain>> GetAsync(string customDomainName, CancellationToken cancellationToken = default)
{
if (customDomainName == null)
{
throw new ArgumentNullException(nameof(customDomainName));
}
using var scope = _clientDiagnostics.CreateScope("AfdCustomDomainCollection.Get");
scope.Start();
try
{
var response = await _afdCustomDomainsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, customDomainName, cancellationToken).ConfigureAwait(false);
if (response.Value == null)
throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(response.GetRawResponse()).ConfigureAwait(false);
return Response.FromValue(new AfdCustomDomain(Parent, response.Value), response.GetRawResponse());
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
/// <summary> Tries to get details for this resource from the service. </summary>
/// <param name="customDomainName"> Name of the domain under the profile which is unique globally. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <exception cref="ArgumentNullException"> <paramref name="customDomainName"/> is null. </exception>
public virtual Response<AfdCustomDomain> GetIfExists(string customDomainName, CancellationToken cancellationToken = default)
{
if (customDomainName == null)
{
throw new ArgumentNullException(nameof(customDomainName));
}
using var scope = _clientDiagnostics.CreateScope("AfdCustomDomainCollection.GetIfExists");
scope.Start();
try
{
var response = _afdCustomDomainsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, customDomainName, cancellationToken: cancellationToken);
return response.Value == null
? Response.FromValue<AfdCustomDomain>(null, response.GetRawResponse())
: Response.FromValue(new AfdCustomDomain(this, response.Value), response.GetRawResponse());
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
/// <summary> Tries to get details for this resource from the service. </summary>
/// <param name="customDomainName"> Name of the domain under the profile which is unique globally. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <exception cref="ArgumentNullException"> <paramref name="customDomainName"/> is null. </exception>
public async virtual Task<Response<AfdCustomDomain>> GetIfExistsAsync(string customDomainName, CancellationToken cancellationToken = default)
{
if (customDomainName == null)
{
throw new ArgumentNullException(nameof(customDomainName));
}
using var scope = _clientDiagnostics.CreateScope("AfdCustomDomainCollection.GetIfExistsAsync");
scope.Start();
try
{
var response = await _afdCustomDomainsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, customDomainName, cancellationToken: cancellationToken).ConfigureAwait(false);
return response.Value == null
? Response.FromValue<AfdCustomDomain>(null, response.GetRawResponse())
: Response.FromValue(new AfdCustomDomain(this, response.Value), response.GetRawResponse());
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
/// <summary> Tries to get details for this resource from the service. </summary>
/// <param name="customDomainName"> Name of the domain under the profile which is unique globally. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <exception cref="ArgumentNullException"> <paramref name="customDomainName"/> is null. </exception>
public virtual Response<bool> Exists(string customDomainName, CancellationToken cancellationToken = default)
{
if (customDomainName == null)
{
throw new ArgumentNullException(nameof(customDomainName));
}
using var scope = _clientDiagnostics.CreateScope("AfdCustomDomainCollection.Exists");
scope.Start();
try
{
var response = GetIfExists(customDomainName, cancellationToken: cancellationToken);
return Response.FromValue(response.Value != null, response.GetRawResponse());
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
/// <summary> Tries to get details for this resource from the service. </summary>
/// <param name="customDomainName"> Name of the domain under the profile which is unique globally. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <exception cref="ArgumentNullException"> <paramref name="customDomainName"/> is null. </exception>
public async virtual Task<Response<bool>> ExistsAsync(string customDomainName, CancellationToken cancellationToken = default)
{
if (customDomainName == null)
{
throw new ArgumentNullException(nameof(customDomainName));
}
using var scope = _clientDiagnostics.CreateScope("AfdCustomDomainCollection.ExistsAsync");
scope.Start();
try
{
var response = await GetIfExistsAsync(customDomainName, cancellationToken: cancellationToken).ConfigureAwait(false);
return Response.FromValue(response.Value != null, response.GetRawResponse());
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
/// <summary> Lists existing AzureFrontDoor domains. </summary>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <returns> A collection of <see cref="AfdCustomDomain" /> that may take multiple service requests to iterate over. </returns>
public virtual Pageable<AfdCustomDomain> GetAll(CancellationToken cancellationToken = default)
{
Page<AfdCustomDomain> FirstPageFunc(int? pageSizeHint)
{
using var scope = _clientDiagnostics.CreateScope("AfdCustomDomainCollection.GetAll");
scope.Start();
try
{
var response = _afdCustomDomainsRestClient.ListByProfile(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken);
return Page.FromValues(response.Value.Value.Select(value => new AfdCustomDomain(Parent, value)), response.Value.NextLink, response.GetRawResponse());
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
Page<AfdCustomDomain> NextPageFunc(string nextLink, int? pageSizeHint)
{
using var scope = _clientDiagnostics.CreateScope("AfdCustomDomainCollection.GetAll");
scope.Start();
try
{
var response = _afdCustomDomainsRestClient.ListByProfileNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken);
return Page.FromValues(response.Value.Value.Select(value => new AfdCustomDomain(Parent, value)), response.Value.NextLink, response.GetRawResponse());
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
}
/// <summary> Lists existing AzureFrontDoor domains. </summary>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <returns> An async collection of <see cref="AfdCustomDomain" /> that may take multiple service requests to iterate over. </returns>
public virtual AsyncPageable<AfdCustomDomain> GetAllAsync(CancellationToken cancellationToken = default)
{
async Task<Page<AfdCustomDomain>> FirstPageFunc(int? pageSizeHint)
{
using var scope = _clientDiagnostics.CreateScope("AfdCustomDomainCollection.GetAll");
scope.Start();
try
{
var response = await _afdCustomDomainsRestClient.ListByProfileAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false);
return Page.FromValues(response.Value.Value.Select(value => new AfdCustomDomain(Parent, value)), response.Value.NextLink, response.GetRawResponse());
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
async Task<Page<AfdCustomDomain>> NextPageFunc(string nextLink, int? pageSizeHint)
{
using var scope = _clientDiagnostics.CreateScope("AfdCustomDomainCollection.GetAll");
scope.Start();
try
{
var response = await _afdCustomDomainsRestClient.ListByProfileNextPageAsync(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false);
return Page.FromValues(response.Value.Value.Select(value => new AfdCustomDomain(Parent, value)), response.Value.NextLink, response.GetRawResponse());
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
}
IEnumerator<AfdCustomDomain> IEnumerable<AfdCustomDomain>.GetEnumerator()
{
return GetAll().GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()
{
return GetAll().GetEnumerator();
}
IAsyncEnumerator<AfdCustomDomain> IAsyncEnumerable<AfdCustomDomain>.GetAsyncEnumerator(CancellationToken cancellationToken)
{
return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken);
}
// Builders.
// public ArmBuilder<Azure.Core.ResourceIdentifier, AfdCustomDomain, AfdCustomDomainData> Construct() { }
}
}
| 51.237968 | 254 | 0.633356 | [
"MIT"
] | LGDoor/azure-sdk-for-net | sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/AfdCustomDomainCollection.cs | 19,163 | C# |
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GameSession : MonoBehaviour
{
int score = 0;
private void Awake()
{
SetUpSingleton();
}
private void SetUpSingleton()
{
int numberGameSessions = FindObjectsOfType<GameSession>().Length;
if (numberGameSessions > 1)
{
Destroy(gameObject);
}
else
{
DontDestroyOnLoad(gameObject);
}
}
public int GetScore()
{
return score;
}
public void AddToScore(int scoreValue)
{
score += scoreValue;
}
public void ResetGame()
{
Destroy(gameObject);
}
}
| 16.5 | 73 | 0.568871 | [
"Apache-2.0"
] | gluonn/unity2d | Laser Defender/Assets/Scripts/GameSession.cs | 728 | C# |
using System;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Xml;
using CookComputing.XmlRpc;
namespace ntest
{
public class Utils
{
public static XmlReader Serialize(
string testName,
object obj,
Encoding encoding,
MappingActions actions)
{
Stream stm = new MemoryStream();
XmlWriter xtw = XmlRpcXmlWriter.Create(stm, new XmlRpcFormatSettings());
xtw.WriteStartDocument();
XmlRpcSerializer ser = new XmlRpcSerializer();
ser.Serialize(xtw, obj, actions);
xtw.Flush();
stm.Position = 0;
XmlReader rdr = XmlRpcXmlReader.Create(stm);
return rdr;
}
//----------------------------------------------------------------------//
public static object Parse(
string xml,
Type valueType,
MappingAction action,
out Type parsedType,
out Type parsedArrayType)
{
StringReader sr = new StringReader(xml);
XmlReader rdr = XmlRpcXmlReader.Create(sr);
return Parse(rdr, valueType, action,
out parsedType, out parsedArrayType);
}
public static object Parse(
XmlReader rdr,
Type valueType,
MappingAction action,
out Type parsedType,
out Type parsedArrayType)
{
parsedType = parsedArrayType = null;
rdr.ReadToDescendant("value");
MappingStack mappingStack = new MappingStack("request");
XmlRpcDeserializer ser = new XmlRpcDeserializer();
object obj = ser.ParseValueElement(rdr, valueType, mappingStack, action);
return obj;
}
public static object Parse(
string xml,
Type valueType,
MappingAction action,
XmlRpcDeserializer serializer,
out Type parsedType,
out Type parsedArrayType)
{
StringReader sr = new StringReader(xml);
XmlReader rdr = XmlRpcXmlReader.Create(sr);
return Parse(rdr, valueType, action, serializer,
out parsedType, out parsedArrayType);
}
public static object Parse(
XmlReader rdr,
Type valueType,
MappingAction action,
XmlRpcDeserializer deserializer,
out Type parsedType,
out Type parsedArrayType)
{
parsedType = parsedArrayType = null;
rdr.ReadToDescendant("value");
MappingStack parseStack = new MappingStack("request");
object obj = deserializer.ParseValueElement(rdr, valueType, parseStack, action);
return obj;
}
public static object ParseValue(string xml, Type valueType)
{
MappingAction action = MappingAction.Error;
StringReader sr = new StringReader(xml);
XmlReader rdr = XmlRpcXmlReader.Create(sr);
rdr.MoveToContent();
MappingStack parseStack = new MappingStack("value");
var deser = new XmlRpcDeserializer();
object obj = deser.ParseValueElement(rdr, valueType, parseStack, action);
return obj;
}
public static string SerializeValue(object value, bool indent)
{
var memStm = new MemoryStream();
var writer = XmlRpcXmlWriter.Create(memStm,
new XmlRpcFormatSettings { OmitXmlDeclaration = true, UseIndentation = indent });
var serializer = new XmlRpcSerializer();
serializer.Serialize(writer, value,
new MappingActions { NullMappingAction = NullMappingAction.Error });
writer.Flush();
memStm.Position = 0;
string xml = new StreamReader(memStm).ReadToEnd();
return xml;
}
public static string[] GetLocales()
{
return new string[]
{
"af-ZA",
"sq-AL",
"ar-DZ",
"ar-BH",
"ar-EG",
"ar-IQ",
"ar-JO",
"ar-KW",
"ar-LB",
"ar-LY",
"ar-MA",
"ar-OM",
"ar-QA",
"ar-SA",
"ar-SY",
"ar-TN",
"ar-AE",
"ar-YE",
"hy-AM",
"az-Cyrl-AZ",
"az-Latn-AZ",
"eu-ES",
"be-BY",
"bg-BG",
"ca-ES",
"zh-HK",
"zh-MO",
"zh-CN",
"zh-SG",
"zh-TW",
"hr-HR",
"cs-CZ",
"da-DK",
"dv-MV",
"nl-BE",
"nl-NL",
"en-AU",
"en-BZ",
"en-CA",
"en-029",
"en-IE",
"en-JM",
"en-NZ",
"en-PH",
"en-ZA",
"en-TT",
"en-GB",
"en-US",
"en-ZW",
"et-EE",
"fo-FO",
"fa-IR",
"fi-FI",
"fr-BE",
"fr-CA",
"fr-FR",
"fr-LU",
"fr-MC",
"fr-CH",
"gl-ES",
"ka-GE",
"de-AT",
"de-DE",
"de-LI",
"de-LU",
"de-CH",
"el-GR",
"gu-IN",
"he-IL",
"hi-IN",
"hu-HU",
"is-IS",
"id-ID",
"it-IT",
"it-CH",
"ja-JP",
"kn-IN",
"kk-KZ",
"kok-IN",
"ko-KR",
"lv-LV",
"lt-LT",
"mk-MK",
"ms-BN",
"ms-MY",
"mr-IN",
"mn-MN",
"nb-NO",
"nn-NO",
"pl-PL",
"pt-BR",
"pt-PT",
"pa-IN",
"ro-RO",
"ru-RU",
"sa-IN",
"sr-Cyrl-CS",
"sr-Latn-CS",
"sk-SK",
"sl-SI",
"es-AR",
"es-BO",
"es-CL",
"es-CO",
"es-CR",
"es-DO",
"es-EC",
"es-SV",
"es-GT",
"es-HN",
"es-MX",
"es-NI",
"es-PA",
"es-PY",
"es-PE",
"es-PR",
"es-ES",
"es-UY",
"es-VE",
"sw-KE",
"sv-FI",
"sv-SE",
"syr-SY",
"ta-IN",
"tt-RU",
"te-IN",
"th-TH",
"tr-TR",
"uk-UA",
"ur-PK",
"uz-Cyrl-UZ",
"uz-Latn-UZ",
"vi-VN"
};
}
}
}
| 23.813953 | 90 | 0.464355 | [
"MIT"
] | VQComms/XMLRPC | ntest/utils.cs | 6,144 | C# |
using System.ComponentModel.DataAnnotations;
namespace CommandService.Models
{
public class Platform
{
public Platform()
{
Name = "";
}
[Key]
[Required]
public int Id { get; set; }
[Required]
public int ExternalId { get; set; }
[Required]
public string Name { get; set; }
public ICollection<Command> Commands { get; set; } = new List<Command>();
}
} | 23.9 | 89 | 0.520921 | [
"MIT"
] | leandro-huck/.NET-6-Microservices | command-service/Models/Platform.cs | 478 | C# |
using MyJetWallet.Sdk.Service;
using MyYamlParser;
namespace Service.BonusReferrerStatistic.Settings
{
public class SettingsModel
{
[YamlProperty("BonusReferrerStatistic.SeqServiceUrl")]
public string SeqServiceUrl { get; set; }
[YamlProperty("BonusReferrerStatistic.ZipkinUrl")]
public string ZipkinUrl { get; set; }
[YamlProperty("BonusReferrerStatistic.ElkLogs")]
public LogElkSettings ElkLogs { get; set; }
[YamlProperty("BonusReferrerStatistic.MyNoSqlWriterUrl")]
public string MyNoSqlWriterUrl { get; set; }
[YamlProperty("BonusReferrerStatistic.MyNoSqlReaderHostPort")]
public string MyNoSqlReaderHostPort { get; set; }
[YamlProperty("BonusReferrerStatistic.SpotServiceBusHostPort")]
public string SpotServiceBusHostPort { get; set; }
[YamlProperty("BonusReferrerStatistic.PostgresConnectionString")]
public string PostgresConnectionString { get; set; }
[YamlProperty("BonusReferrerStatistic.MaxCachedEntities")]
public int MaxCachedEntities { get; set; }
[YamlProperty("BonusReferrerStatistic.ClientProfileGrpcServiceUrl")]
public string ClientProfileGrpcServiceUrl { get; set; }
}
}
| 35.324324 | 76 | 0.68707 | [
"MIT"
] | MyJetWallet/Service.Bonus.RefererStatistic | src/Service.BonusReferrerStatistic/Settings/SettingsModel.cs | 1,309 | C# |
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Media;
namespace ICSharpCode.SharpDevelop.Editor
{
/// <summary>
/// Represents a text marker.
/// </summary>
public interface ITextMarker
{
/// <summary>
/// Gets the start offset of the marked text region.
/// </summary>
int StartOffset { get; }
/// <summary>
/// Gets the end offset of the marked text region.
/// </summary>
int EndOffset { get; }
/// <summary>
/// Gets the length of the marked region.
/// </summary>
int Length { get; }
/// <summary>
/// Deletes the text marker.
/// </summary>
void Delete();
/// <summary>
/// Gets whether the text marker was deleted.
/// </summary>
bool IsDeleted { get; }
/// <summary>
/// Event that occurs when the text marker is deleted.
/// </summary>
event EventHandler Deleted;
/// <summary>
/// Gets/Sets the background color.
/// </summary>
Color? BackgroundColor { get; set; }
/// <summary>
/// Gets/Sets the foreground color.
/// </summary>
Color? ForegroundColor { get; set; }
/// <summary>
/// Gets/Sets the font weight.
/// </summary>
FontWeight? FontWeight { get; set; }
/// <summary>
/// Gets/Sets the font style.
/// </summary>
FontStyle? FontStyle { get; set; }
/// <summary>
/// Gets/Sets the type of the marker. Use TextMarkerType.None for normal markers.
/// </summary>
TextMarkerTypes MarkerTypes { get; set; }
/// <summary>
/// Gets/Sets the color of the marker.
/// </summary>
Color MarkerColor { get; set; }
/// <summary>
/// Gets/Sets an object with additional data for this text marker.
/// </summary>
object Tag { get; set; }
/// <summary>
/// Gets/Sets an object that will be displayed as tooltip in the text editor.
/// </summary>
object ToolTip { get; set; }
}
[Flags]
public enum TextMarkerTypes
{
/// <summary>
/// Use no marker
/// </summary>
None = 0x0000,
/// <summary>
/// Use squiggly underline marker
/// </summary>
SquigglyUnderline = 0x001,
/// <summary>
/// Normal underline.
/// </summary>
NormalUnderline = 0x002,
/// <summary>
/// Dotted underline.
/// </summary>
DottedUnderline = 0x004,
/// <summary>
/// Horizontal line in the scroll bar.
/// </summary>
LineInScrollBar = 0x0100,
/// <summary>
/// Small triangle in the scroll bar, pointing to the right.
/// </summary>
ScrollBarRightTriangle = 0x0400,
/// <summary>
/// Small triangle in the scroll bar, pointing to the left.
/// </summary>
ScrollBarLeftTriangle = 0x0800,
/// <summary>
/// Small circle in the scroll bar.
/// </summary>
CircleInScrollBar = 0x1000
}
[DocumentService]
public interface ITextMarkerService
{
/// <summary>
/// Creates a new text marker. The text marker will be invisible at first,
/// you need to set one of the Color properties to make it visible.
/// </summary>
ITextMarker Create(int startOffset, int length);
/// <summary>
/// Gets the list of text markers.
/// </summary>
IEnumerable<ITextMarker> TextMarkers { get; }
/// <summary>
/// Removes the specified text marker.
/// </summary>
void Remove(ITextMarker marker);
/// <summary>
/// Removes all text markers that match the condition.
/// </summary>
void RemoveAll(Predicate<ITextMarker> predicate);
/// <summary>
/// Finds all text markers at the specified offset.
/// </summary>
IEnumerable<ITextMarker> GetMarkersAtOffset(int offset);
}
}
| 27.594118 | 93 | 0.661906 | [
"MIT"
] | TetradogOther/SharpDevelop | src/Main/Base/Project/Editor/ITextMarker.cs | 4,693 | C# |
[VisibleToOtherModulesAttribute] // RVA: 0xC1E30 Offset: 0xC1F31 VA: 0xC1E30
internal class GeneratedByOldBindingsGeneratorAttribute : Attribute // TypeDefIndex: 2779
{
// Methods
// RVA: 0x1BDB3F0 Offset: 0x1BDB4F1 VA: 0x1BDB3F0
public void .ctor() { }
}
| 26.1 | 89 | 0.762452 | [
"MIT"
] | SinsofSloth/RF5-global-metadata | UnityEngine/Scripting/GeneratedByOldBindingsGeneratorAttribute.cs | 261 | C# |
using Ionic.Zlib;
using System.Collections.Generic;
using System.Configuration;
using UCS.Helpers;
namespace UCS.PacketProcessing.Messages.Server
{
// Packet 20103
internal class LoginFailedMessage : Message
{
public LoginFailedMessage(PacketProcessing.Client client) : base(client)
{
SetMessageType(20103);
SetUpdateURL(ConfigurationManager.AppSettings["UpdateUrl"]);
SetMessageVersion(2);
// 8 : Update
// 10 : Maintenance
// 11 : Banned
// 12 : Timeout
// 13 : Locked Account
}
string m_vContentURL;
int m_vErrorCode;
string m_vReason;
string m_vRedirectDomain;
int m_vRemainingTime;
string m_vResourceFingerprintData;
string m_vUpdateURL;
public override void Encode()
{
var pack = new List<byte>();
pack.AddInt32(m_vErrorCode);
pack.AddString(m_vResourceFingerprintData);
pack.AddString(m_vRedirectDomain);
pack.AddString(m_vContentURL);
pack.AddString(m_vUpdateURL);
pack.AddString(m_vReason);
pack.AddInt32(m_vRemainingTime);
pack.AddInt32(-1);
pack.Add(0);
pack.AddInt32(-1);
pack.AddInt32(-1);
pack.AddInt32(-1);
pack.AddInt32(-1);
if (Client.State == PacketProcessing.Client.ClientState.Login)
Encrypt(pack.ToArray());
else
SetData(pack.ToArray());
}
public void RemainingTime(int code) => m_vRemainingTime = code;
public void SetContentURL(string url) => m_vContentURL = url;
public void SetErrorCode(int code) => m_vErrorCode = code;
public void SetReason(string reason) => m_vReason = reason;
public void SetRedirectDomain(string domain) => m_vRedirectDomain = domain;
public void SetResourceFingerprintData(string data) => m_vResourceFingerprintData = data;
public void SetUpdateURL(string url) => m_vUpdateURL = url;
}
}
| 31.086957 | 97 | 0.601399 | [
"Apache-2.0"
] | Dekryptor/UCS | Ultrapowa Clash Server/Packets/Messages/Server/LoginFailedMessage.cs | 2,145 | C# |
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Xml;
using System.Xml.XPath;
using System.Xml.Xsl;
namespace MS.Internal.Xml.XPath
{
internal sealed class SortQuery : Query
{
private List<SortKey> results;
private XPathSortComparer comparer;
private Query qyInput;
public SortQuery(Query qyInput)
{
Debug.Assert(qyInput != null, "Sort Query needs an input query tree to work on");
this.results = new List<SortKey>();
this.comparer = new XPathSortComparer();
this.qyInput = qyInput;
count = 0;
}
private SortQuery(SortQuery other) : base(other)
{
this.results = new List<SortKey>(other.results);
this.comparer = other.comparer.Clone();
this.qyInput = Clone(other.qyInput);
count = 0;
}
public override void Reset() { count = 0; }
public override void SetXsltContext(XsltContext xsltContext)
{
qyInput.SetXsltContext(xsltContext);
if (
qyInput.StaticType != XPathResultType.NodeSet &&
qyInput.StaticType != XPathResultType.Any
)
{
throw XPathException.Create(SR.Xp_NodeSetExpected);
}
}
private void BuildResultsList()
{
Int32 numSorts = this.comparer.NumSorts;
Debug.Assert(numSorts > 0, "Why was the sort query created?");
XPathNavigator eNext;
while ((eNext = qyInput.Advance()) != null)
{
SortKey key = new SortKey(numSorts, /*originalPosition:*/this.results.Count, eNext.Clone());
for (Int32 j = 0; j < numSorts; j++)
{
key[j] = this.comparer.Expression(j).Evaluate(qyInput);
}
results.Add(key);
}
results.Sort(this.comparer);
}
public override object Evaluate(XPathNodeIterator context)
{
qyInput.Evaluate(context);
this.results.Clear();
BuildResultsList();
count = 0;
return this;
}
public override XPathNavigator Advance()
{
Debug.Assert(0 <= count && count <= results.Count);
if (count < this.results.Count)
{
return this.results[count++].Node;
}
return null;
}
public override XPathNavigator Current
{
get
{
Debug.Assert(0 <= count && count <= results.Count);
if (count == 0)
{
return null;
}
return results[count - 1].Node;
}
}
internal void AddSort(Query evalQuery, IComparer comparer)
{
this.comparer.AddSort(evalQuery, comparer);
}
public override XPathNodeIterator Clone() { return new SortQuery(this); }
public override XPathResultType StaticType { get { return XPathResultType.NodeSet; } }
public override int CurrentPosition { get { return count; } }
public override int Count { get { return results.Count; } }
public override QueryProps Properties { get { return QueryProps.Cached | QueryProps.Position | QueryProps.Count; } }
public override void PrintQuery(XmlWriter w)
{
w.WriteStartElement(this.GetType().Name);
qyInput.PrintQuery(w);
w.WriteElementString("XPathSortComparer", "... PrintTree() not implemented ...");
w.WriteEndElement();
}
} // class SortQuery
internal sealed class SortKey
{
private Int32 numKeys;
private object[] keys;
private int originalPosition;
private XPathNavigator node;
public SortKey(int numKeys, int originalPosition, XPathNavigator node)
{
this.numKeys = numKeys;
this.keys = new object[numKeys];
this.originalPosition = originalPosition;
this.node = node;
}
public object this[int index]
{
get { return this.keys[index]; }
set { this.keys[index] = value; }
}
public int NumKeys { get { return this.numKeys; } }
public int OriginalPosition { get { return this.originalPosition; } }
public XPathNavigator Node { get { return this.node; } }
} // class SortKey
internal sealed class XPathSortComparer : IComparer<SortKey>
{
private const int minSize = 3;
private Query[] expressions;
private IComparer[] comparers;
private int numSorts;
public XPathSortComparer(int size)
{
if (size <= 0) size = minSize;
this.expressions = new Query[size];
this.comparers = new IComparer[size];
}
public XPathSortComparer() : this(minSize) { }
public void AddSort(Query evalQuery, IComparer comparer)
{
Debug.Assert(this.expressions.Length == this.comparers.Length);
Debug.Assert(0 < this.expressions.Length);
Debug.Assert(0 <= numSorts && numSorts <= this.expressions.Length);
// Ajust array sizes if needed.
if (numSorts == this.expressions.Length)
{
Query[] newExpressions = new Query[numSorts * 2];
IComparer[] newComparers = new IComparer[numSorts * 2];
for (int i = 0; i < numSorts; i++)
{
newExpressions[i] = this.expressions[i];
newComparers[i] = this.comparers[i];
}
this.expressions = newExpressions;
this.comparers = newComparers;
}
Debug.Assert(numSorts < this.expressions.Length);
// Fixup expression to handle node-set return type:
if (evalQuery.StaticType == XPathResultType.NodeSet || evalQuery.StaticType == XPathResultType.Any)
{
evalQuery = new StringFunctions(Function.FunctionType.FuncString, new Query[] { evalQuery });
}
this.expressions[numSorts] = evalQuery;
this.comparers[numSorts] = comparer;
numSorts++;
}
public int NumSorts { get { return numSorts; } }
public Query Expression(int i)
{
return this.expressions[i];
}
int IComparer<SortKey>.Compare(SortKey x, SortKey y)
{
Debug.Assert(x != null && y != null, "Oops!! what happened?");
int result = 0;
for (int i = 0; i < x.NumKeys; i++)
{
result = this.comparers[i].Compare(x[i], y[i]);
if (result != 0)
{
return result;
}
}
// if after all comparisions, the two sort keys are still equal, preserve the doc order
return x.OriginalPosition - y.OriginalPosition;
}
internal XPathSortComparer Clone()
{
XPathSortComparer clone = new XPathSortComparer(this.numSorts);
for (int i = 0; i < this.numSorts; i++)
{
clone.comparers[i] = this.comparers[i];
clone.expressions[i] = (Query)this.expressions[i].Clone(); // Expressions should be cloned because Query should be cloned
}
clone.numSorts = this.numSorts;
return clone;
}
} // class XPathSortComparer
} // namespace
| 33.722222 | 137 | 0.5486 | [
"MIT"
] | App-vNext/corefx | src/System.Xml.XPath/System/Xml/XPath/Internal/SortQuery.cs | 7,891 | C# |
namespace Veldrid.Graphics
{
/// <summary>
/// A device-specific representation of the resources available to a <see cref="ShaderSet"/>.
/// </summary>
public interface ShaderResourceBindingSlots
{
/// <summary>
/// A device-agnostic description of the constant buffers.
/// </summary>
ShaderResourceDescription[] Resources { get; }
}
}
| 28.142857 | 97 | 0.626904 | [
"MIT"
] | mellinoe/Veldrid-3.0 | src/Veldrid/Graphics/ShaderResourceBindingSlots.cs | 396 | C# |
using System;
using System.Collections.Generic;
using System.Text;
using Portal2.Items;
using Portal2.DataTypes;
namespace Portal2.Connections
{
/// <summary>
/// A connection point that can receive multiple connections.
/// </summary>
public class MultiConnectionPointReceiver : ConnectionPointReceiver
{
#region Fields
List<Connection> connections = new List<Connection>();
internal List<Connection> Connections { get { return connections; } }
#endregion
#region Constructor
internal MultiConnectionPointReceiver(Item owner, string connectionType)
: base(owner, connectionType)
{
}
#endregion
#region Connection API
internal override void Connect(Connection connection)
{
if (!connections.Contains(connection))
connections.Add(connection);
}
internal override void Disconnect(Connection connection)
{
connections.Remove(connection);
}
protected void ConnectTo(ConnectionPointSender sender)
{
// Potentially no work to do
if (connections.Find(c => c.Sender == sender) != null)
return;
Connection.Connect(Owner.Owner, sender, this);
}
/// <summary>
/// Disconnects this receiver from the specified sender.
/// </summary>
protected void Disconnect(ConnectionPointSender sender)
{
for (int i = 0; i < connections.Count; i++)
{
if (connections[i].Sender != sender)
continue;
connections[i].Disconnect();
connections.RemoveAt(i);
i--;
}
}
/// <summary>
/// Disconnects all senders.
/// </summary>
public void DisconnectAll()
{
for (int i = 0; i < connections.Count; i++)
{
connections[i].Disconnect();
}
connections.Clear();
}
#endregion
#region Input / Output
internal P2CProperty GetConnectionCount()
{
return GetConnectionCount("ITEM_PROPERTY_CONNECTION_COUNT");
}
internal P2CProperty GetConnectionCount(string propertyName)
{
return new P2CProperty(propertyName, connections.Count);
}
#endregion
}
}
| 26.030303 | 81 | 0.537059 | [
"MIT"
] | Kyle0654/Portal2.Puzzle | Portal2Puzzle/Connections/MultiConnectionPointReceiver.cs | 2,579 | C# |
// <auto-generated />
using System;
using CommunityAssociationManager.Server.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace CommunityAssociationManager.Server.Data.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
[Migration("20210830035201_initial4")]
partial class initial4
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("ProductVersion", "5.0.9")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("CommunityAssociationManager.Server.Models.ApplicationUser", b =>
{
b.Property<string>("Id")
.HasColumnType("nvarchar(450)");
b.Property<int>("AccessFailedCount")
.HasColumnType("int");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("nvarchar(max)");
b.Property<string>("Email")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<bool>("EmailConfirmed")
.HasColumnType("bit");
b.Property<bool>("LockoutEnabled")
.HasColumnType("bit");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("datetimeoffset");
b.Property<string>("NormalizedEmail")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("NormalizedUserName")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("PasswordHash")
.HasColumnType("nvarchar(max)");
b.Property<string>("PhoneNumber")
.HasColumnType("nvarchar(max)");
b.Property<bool>("PhoneNumberConfirmed")
.HasColumnType("bit");
b.Property<string>("SecurityStamp")
.HasColumnType("nvarchar(max)");
b.Property<bool>("TwoFactorEnabled")
.HasColumnType("bit");
b.Property<string>("UserName")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasDatabaseName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasDatabaseName("UserNameIndex")
.HasFilter("[NormalizedUserName] IS NOT NULL");
b.ToTable("AspNetUsers");
});
modelBuilder.Entity("CommunityAssociationManager.Shared.Models.Community", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None);
b.Property<long?>("CashierId")
.HasColumnType("bigint");
b.Property<long?>("ManagerId")
.HasColumnType("bigint");
b.HasKey("Id");
b.HasIndex("CashierId");
b.HasIndex("ManagerId");
b.ToTable("Communities");
});
modelBuilder.Entity("CommunityAssociationManager.Shared.Models.CommunityMember", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None);
b.Property<string>("Address")
.HasColumnType("nvarchar(max)");
b.Property<string>("City")
.HasColumnType("nvarchar(max)");
b.Property<string>("Country")
.HasColumnType("nvarchar(max)");
b.Property<string>("Email")
.HasColumnType("nvarchar(max)");
b.Property<string>("Name")
.HasColumnType("nvarchar(max)");
b.Property<string>("Phone")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("CommunityMembers");
});
modelBuilder.Entity("CommunityAssociationManager.Shared.Models.CommunityProperty", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<long>("OwnerId")
.HasColumnType("bigint");
b.HasKey("Id");
b.HasIndex("OwnerId");
b.ToTable("CommunityProperties");
});
modelBuilder.Entity("CommunityAssociationManager.Shared.Models.Property", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("Address")
.HasColumnType("nvarchar(max)");
b.Property<long>("CommunityId")
.HasColumnType("bigint");
b.Property<long>("OwnerId")
.HasColumnType("bigint");
b.HasKey("Id");
b.HasIndex("CommunityId");
b.HasIndex("OwnerId");
b.ToTable("Properties");
});
modelBuilder.Entity("CommunityAssociationManager.Shared.Models.RecurringTax", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<long>("CommunityId")
.HasColumnType("bigint");
b.HasKey("Id");
b.HasIndex("CommunityId");
b.ToTable("RecurringTaxes");
});
modelBuilder.Entity("CommunityAssociationManager.Shared.Models.TaxRecurrance", b =>
{
b.Property<decimal>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("decimal(20,0)")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None);
b.Property<double>("Amount")
.HasColumnType("float");
b.Property<long?>("CommunityPropertyId")
.HasColumnType("bigint");
b.Property<long?>("CommunityPropertyId1")
.HasColumnType("bigint");
b.Property<DateTime>("DueDate")
.HasColumnType("datetime2");
b.Property<bool>("IsPaid")
.HasColumnType("bit");
b.Property<long?>("PropertyId")
.HasColumnType("bigint");
b.Property<long?>("PropertyId1")
.HasColumnType("bigint");
b.Property<long>("RecurringTaxId")
.HasColumnType("bigint");
b.Property<long?>("RecurringTaxId1")
.HasColumnType("bigint");
b.HasKey("Id");
b.HasIndex("CommunityPropertyId1");
b.HasIndex("PropertyId1");
b.HasIndex("RecurringTaxId1");
b.ToTable("TaxRecurrances");
});
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.DeviceFlowCodes", b =>
{
b.Property<string>("UserCode")
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<string>("ClientId")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2");
b.Property<string>("Data")
.IsRequired()
.HasMaxLength(50000)
.HasColumnType("nvarchar(max)");
b.Property<string>("Description")
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<string>("DeviceCode")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<DateTime?>("Expiration")
.IsRequired()
.HasColumnType("datetime2");
b.Property<string>("SessionId")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<string>("SubjectId")
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.HasKey("UserCode");
b.HasIndex("DeviceCode")
.IsUnique();
b.HasIndex("Expiration");
b.ToTable("DeviceCodes");
});
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.PersistedGrant", b =>
{
b.Property<string>("Key")
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<string>("ClientId")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<DateTime?>("ConsumedTime")
.HasColumnType("datetime2");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2");
b.Property<string>("Data")
.IsRequired()
.HasMaxLength(50000)
.HasColumnType("nvarchar(max)");
b.Property<string>("Description")
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<DateTime?>("Expiration")
.HasColumnType("datetime2");
b.Property<string>("SessionId")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<string>("SubjectId")
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<string>("Type")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.HasKey("Key");
b.HasIndex("Expiration");
b.HasIndex("SubjectId", "ClientId", "Type");
b.HasIndex("SubjectId", "SessionId", "Type");
b.ToTable("PersistedGrants");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{
b.Property<string>("Id")
.HasColumnType("nvarchar(450)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("nvarchar(max)");
b.Property<string>("Name")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("NormalizedName")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasDatabaseName("RoleNameIndex")
.HasFilter("[NormalizedName] IS NOT NULL");
b.ToTable("AspNetRoles");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("ClaimType")
.HasColumnType("nvarchar(max)");
b.Property<string>("ClaimValue")
.HasColumnType("nvarchar(max)");
b.Property<string>("RoleId")
.IsRequired()
.HasColumnType("nvarchar(450)");
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("ClaimType")
.HasColumnType("nvarchar(max)");
b.Property<string>("ClaimValue")
.HasColumnType("nvarchar(max)");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("nvarchar(450)");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AspNetUserClaims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.Property<string>("LoginProvider")
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<string>("ProviderKey")
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<string>("ProviderDisplayName")
.HasColumnType("nvarchar(max)");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("nvarchar(450)");
b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId");
b.ToTable("AspNetUserLogins");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.Property<string>("UserId")
.HasColumnType("nvarchar(450)");
b.Property<string>("RoleId")
.HasColumnType("nvarchar(450)");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.ToTable("AspNetUserRoles");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.Property<string>("UserId")
.HasColumnType("nvarchar(450)");
b.Property<string>("LoginProvider")
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<string>("Name")
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<string>("Value")
.HasColumnType("nvarchar(max)");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens");
});
modelBuilder.Entity("CommunityAssociationManager.Shared.Models.Community", b =>
{
b.HasOne("CommunityAssociationManager.Shared.Models.CommunityMember", "Cashier")
.WithMany("CashierCommunities")
.HasForeignKey("CashierId");
b.HasOne("CommunityAssociationManager.Shared.Models.CommunityMember", "Manager")
.WithMany("ManagedCommunities")
.HasForeignKey("ManagerId");
b.Navigation("Cashier");
b.Navigation("Manager");
});
modelBuilder.Entity("CommunityAssociationManager.Shared.Models.CommunityProperty", b =>
{
b.HasOne("CommunityAssociationManager.Shared.Models.Community", "Owner")
.WithMany("CommunityProperties")
.HasForeignKey("OwnerId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Owner");
});
modelBuilder.Entity("CommunityAssociationManager.Shared.Models.Property", b =>
{
b.HasOne("CommunityAssociationManager.Shared.Models.Community", "Community")
.WithMany("Properties")
.HasForeignKey("CommunityId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("CommunityAssociationManager.Shared.Models.CommunityMember", "Owner")
.WithMany("Properties")
.HasForeignKey("OwnerId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Community");
b.Navigation("Owner");
});
modelBuilder.Entity("CommunityAssociationManager.Shared.Models.RecurringTax", b =>
{
b.HasOne("CommunityAssociationManager.Shared.Models.Community", "Community")
.WithMany("RecurringTaxes")
.HasForeignKey("CommunityId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Community");
});
modelBuilder.Entity("CommunityAssociationManager.Shared.Models.TaxRecurrance", b =>
{
b.HasOne("CommunityAssociationManager.Shared.Models.CommunityProperty", "CommunityProperty")
.WithMany("TaxRecurrances")
.HasForeignKey("CommunityPropertyId1");
b.HasOne("CommunityAssociationManager.Shared.Models.Property", "Property")
.WithMany("TaxRecurrances")
.HasForeignKey("PropertyId1");
b.HasOne("CommunityAssociationManager.Shared.Models.RecurringTax", "RecurringTax")
.WithMany("TaxRecurrances")
.HasForeignKey("RecurringTaxId1");
b.Navigation("CommunityProperty");
b.Navigation("Property");
b.Navigation("RecurringTax");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.HasOne("CommunityAssociationManager.Server.Models.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.HasOne("CommunityAssociationManager.Server.Models.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("CommunityAssociationManager.Server.Models.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.HasOne("CommunityAssociationManager.Server.Models.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("CommunityAssociationManager.Shared.Models.Community", b =>
{
b.Navigation("CommunityProperties");
b.Navigation("Properties");
b.Navigation("RecurringTaxes");
});
modelBuilder.Entity("CommunityAssociationManager.Shared.Models.CommunityMember", b =>
{
b.Navigation("CashierCommunities");
b.Navigation("ManagedCommunities");
b.Navigation("Properties");
});
modelBuilder.Entity("CommunityAssociationManager.Shared.Models.CommunityProperty", b =>
{
b.Navigation("TaxRecurrances");
});
modelBuilder.Entity("CommunityAssociationManager.Shared.Models.Property", b =>
{
b.Navigation("TaxRecurrances");
});
modelBuilder.Entity("CommunityAssociationManager.Shared.Models.RecurringTax", b =>
{
b.Navigation("TaxRecurrances");
});
#pragma warning restore 612, 618
}
}
}
| 37.763524 | 125 | 0.468628 | [
"MIT"
] | nikolavn/CommunityAssociationManager | src/CommunityAssociationManager/CommunityAssociationManager/Server/Data/Migrations/20210830035201_initial4.Designer.cs | 24,435 | C# |
/*
MIT LICENSE
Copyright 2017 Digital Ruby, LLC - http://www.digitalruby.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json.Linq;
namespace ExchangeSharp
{
public partial class ExchangeAPI
{
protected class ExchangeHistoricalTradeHelper
{
private ExchangeAPI api;
public Func<IEnumerable<ExchangeTrade>, bool> Callback { get; set; }
public string Symbol { get; set; }
public DateTime? StartDate { get; set; }
public DateTime? EndDate { get; set; }
public string Url { get; set; } // url with format [symbol], {0} = start timestamp, {1} = end timestamp
public int DelayMilliseconds { get; set; } = 1000;
public TimeSpan BlockTime { get; set; } = TimeSpan.FromHours(1.0); // how much time to move for each block of data, default 1 hour
public bool MillisecondGranularity { get; set; } = true;
public Func<DateTime, string> TimestampFunction { get; set; } // change date time to a url timestamp, use TimestampFunction or UrlFunction
public Func<ExchangeHistoricalTradeHelper, string> UrlFunction { get; set; } // allows returning a custom url, use TimestampFunction or UrlFunction
public Func<JToken, ExchangeTrade> ParseFunction { get; set; }
public bool DirectionIsBackwards { get; set; } = true; // some exchanges support going from most recent to oldest, but others, like Gemini must go from oldest to newest
public ExchangeHistoricalTradeHelper(ExchangeAPI api)
{
this.api = api;
}
public async Task ProcessHistoricalTrades()
{
if (Callback == null)
{
throw new ArgumentException("Missing required parameter", nameof(Callback));
}
else if (TimestampFunction == null && UrlFunction == null)
{
throw new ArgumentException("Missing required parameters", nameof(TimestampFunction) + "," + nameof(UrlFunction));
}
else if (ParseFunction == null)
{
throw new ArgumentException("Missing required parameter", nameof(ParseFunction));
}
else if (string.IsNullOrWhiteSpace(Url))
{
throw new ArgumentException("Missing required parameter", nameof(Url));
}
Symbol = api.NormalizeSymbol(Symbol);
string url;
Url = Url.Replace("[symbol]", Symbol);
List<ExchangeTrade> trades = new List<ExchangeTrade>();
ExchangeTrade trade;
EndDate = (EndDate ?? CryptoUtility.UtcNow);
StartDate = (StartDate ?? EndDate.Value.Subtract(BlockTime));
string startTimestamp;
string endTimestamp;
HashSet<long> previousTrades = new HashSet<long>();
HashSet<long> tempTradeIds = new HashSet<long>();
HashSet<long> tmpIds;
SetDates(out DateTime startDateMoving, out DateTime endDateMoving);
while (true)
{
// format url and make request
if (TimestampFunction != null)
{
startTimestamp = TimestampFunction(startDateMoving);
endTimestamp = TimestampFunction(endDateMoving);
url = string.Format(Url, startTimestamp, endTimestamp);
}
else if (UrlFunction != null)
{
url = UrlFunction(this);
}
else
{
throw new InvalidOperationException("TimestampFunction or UrlFunction must be specified");
}
JToken obj = await api.MakeJsonRequestAsync<JToken>(url);
// don't add this temp trade as it may be outside of the date/time range
tempTradeIds.Clear();
foreach (JToken token in obj)
{
trade = ParseFunction(token);
if (!previousTrades.Contains(trade.Id) && trade.Timestamp >= StartDate.Value && trade.Timestamp <= EndDate.Value)
{
trades.Add(trade);
}
if (trade.Id != 0)
{
tempTradeIds.Add(trade.Id);
}
}
previousTrades.Clear();
tmpIds = previousTrades;
previousTrades = tempTradeIds;
tempTradeIds = previousTrades;
// set dates to next block
if (trades.Count == 0)
{
if (DirectionIsBackwards)
{
// no trades found, move the whole block back
endDateMoving = startDateMoving.Subtract(BlockTime);
}
else
{
// no trades found, move the whole block forward
startDateMoving = endDateMoving.Add(BlockTime);
}
}
else
{
// sort trades in descending order and callback
if (DirectionIsBackwards)
{
trades.Sort((t1, t2) => t2.Timestamp.CompareTo(t1.Timestamp));
}
else
{
trades.Sort((t1, t2) => t1.Timestamp.CompareTo(t2.Timestamp));
}
if (!Callback(trades))
{
break;
}
trade = trades[trades.Count - 1];
if (DirectionIsBackwards)
{
// set end date to the date of the earliest trade of the block, use for next request
if (MillisecondGranularity)
{
endDateMoving = trade.Timestamp.AddMilliseconds(-1.0);
}
else
{
endDateMoving = trade.Timestamp.AddSeconds(-1.0);
}
startDateMoving = endDateMoving.Subtract(BlockTime);
}
else
{
// set start date to the date of the latest trade of the block, use for next request
if (MillisecondGranularity)
{
startDateMoving = trade.Timestamp.AddMilliseconds(1.0);
}
else
{
startDateMoving = trade.Timestamp.AddSeconds(1.0);
}
endDateMoving = startDateMoving.Add(BlockTime);
}
trades.Clear();
}
// check for exit conditions
if (DirectionIsBackwards)
{
if (endDateMoving < StartDate.Value)
{
break;
}
}
else
{
if (startDateMoving > EndDate.Value)
{
break;
}
}
ClampDates(ref startDateMoving, ref endDateMoving);
await Task.Delay(DelayMilliseconds);
}
}
private void SetDates(out DateTime startDateMoving, out DateTime endDateMoving)
{
if (DirectionIsBackwards)
{
endDateMoving = EndDate.Value;
startDateMoving = endDateMoving.Subtract(BlockTime);
}
else
{
startDateMoving = StartDate.Value;
endDateMoving = startDateMoving.Add(BlockTime);
}
ClampDates(ref startDateMoving, ref endDateMoving);
}
private void ClampDates(ref DateTime startDateMoving, ref DateTime endDateMoving)
{
if (DirectionIsBackwards)
{
if (startDateMoving < StartDate.Value)
{
startDateMoving = StartDate.Value;
}
}
else
{
if (endDateMoving > EndDate.Value)
{
endDateMoving = EndDate.Value;
}
}
}
}
}
}
| 45.489177 | 460 | 0.478493 | [
"MIT"
] | Ashrafnet/ExchangeSharp | ExchangeSharp/API/Exchanges/_Base/ExchangeHistoricalTradeHelper.cs | 10,510 | C# |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.