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 |
|---|---|---|---|---|---|---|---|---|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Buffers.Binary;
using System.Device;
using System.Device.I2c;
using System.Device.Model;
using System.IO;
using System.Net.Http.Headers;
using System.Numerics;
using System.Security.Cryptography.X509Certificates;
using System.Threading;
using Iot.Device.Magnetometer;
using UnitsNet;
namespace Iot.Device.Imu
{
/// <summary>
/// MPU9250 - gyroscope, accelerometer, temperature and magnetometer (thru an embedded AK8963).
/// </summary>
[Interface("MPU9250 - gyroscope, accelerometer, temperature and magnetometer (thru an embedded AK8963)")]
public class Mpu9250 : Mpu6500
{
private Ak8963 _ak8963;
private bool _shouldDispose;
// Use for the first magnetometer read when switch to continuous 100 Hz
private bool _firstContinuousRead = true;
#region Magnetometer
/// <summary>
/// Get the magnetometer bias
/// </summary>
/// <remarks>
/// Vector axes are the following:
/// +Z +Y
/// \ | /
/// \ | /
/// \|/
/// /|\
/// / | \
/// / | \
/// +X
/// </remarks>
[Property]
public Vector3 MagnometerBias => new Vector3(_ak8963.MagnetometerBias.Y, _ak8963.MagnetometerBias.X, -_ak8963.MagnetometerBias.Z);
/// <summary>
/// Calibrate the magnetometer. Make sure your sensor is as far as possible of magnet.
/// Move your sensor in all direction to make sure it will get enough data in all points of space
/// Calculate as well the magnetometer bias
/// </summary>
/// <param name="calibrationCounts">number of points to read during calibration, default is 1000</param>
/// <returns>Returns the factory calibration data</returns>
[Command]
public Vector3 CalibrateMagnetometer(int calibrationCounts = 1000)
{
if (_wakeOnMotion)
{
return Vector3.Zero;
}
// Run the calibration
var calib = _ak8963.CalibrateMagnetometer(calibrationCounts);
// Invert X and Y, don't change Z, this is a multiplication factor only
// it should stay positive
return new Vector3(calib.Y, calib.X, calib.Z);
}
/// <summary>
/// True if there is a data to read
/// </summary>
public bool HasDataToRead => !(_wakeOnMotion && _ak8963.HasDataToRead);
/// <summary>
/// Check if the magnetometer version is the correct one (0x48)
/// </summary>
/// <returns>Returns the Magnetometer version number</returns>
/// <remarks>When the wake on motion is on, you can't read the magnetometer, so this function returns 0</remarks>
[Property("MagnetometerVersion")]
public byte GetMagnetometerVersion() => _wakeOnMotion ? (byte)0 : _ak8963.GetDeviceInfo();
/// <summary>
/// Read the magnetometer without bias correction and can wait for new data to be present
/// </summary>
/// <remarks>
/// Vector axes are the following:
/// +Z +Y
/// \ | /
/// \ | /
/// \|/
/// /|\
/// / | \
/// / | \
/// +X
/// </remarks>
/// <param name="waitForData">true to wait for new data</param>
/// <returns>The data from the magnetometer</returns>
public Vector3 ReadMagnetometerWithoutCorrection(bool waitForData = true)
{
var readMag = _ak8963.ReadMagnetometerWithoutCorrection(waitForData, GetTimeout());
_firstContinuousRead = false;
return _wakeOnMotion ? Vector3.Zero : new Vector3(readMag.Y, readMag.X, -readMag.Z);
}
/// <summary>
/// Read the magnetometer with bias correction and can wait for new data to be present
/// </summary>
/// <remarks>
/// Vector axes are the following:
/// +Z +Y
/// \ | /
/// \ | /
/// \|/
/// /|\
/// / | \
/// / | \
/// +X
/// </remarks>
/// <param name="waitForData">true to wait for new data</param>
/// <returns>The data from the magnetometer</returns>
[Telemetry("MagneticInduction")]
public Vector3 ReadMagnetometer(bool waitForData = true)
{
Vector3 magn = _ak8963.ReadMagnetometer(waitForData, GetTimeout());
return new Vector3(magn.Y, magn.X, -magn.Z);
}
// TODO: find what is the value in the documentation, it should be pretty fast
// But taking the same value as for the slowest one so th 8Hz one
private TimeSpan GetTimeout() => _ak8963.MeasurementMode switch
{
// 8Hz measurement period plus 2 milliseconds
MeasurementMode.SingleMeasurement or MeasurementMode.ExternalTriggedMeasurement or MeasurementMode.SelfTest or MeasurementMode.ContinuousMeasurement8Hz
=> TimeSpan.FromMilliseconds(127),
// 100Hz measurement period plus 2 milliseconds
// When switching to this mode, the first read can be longer than 10 ms. Tests shows up to 100 ms
MeasurementMode.ContinuousMeasurement100Hz => _firstContinuousRead ? TimeSpan.FromMilliseconds(100) : TimeSpan.FromMilliseconds(12),
_ => TimeSpan.Zero,
};
/// <summary>
/// Select the magnetometer measurement mode
/// </summary>
public MeasurementMode MagnetometerMeasurementMode
{
get => _ak8963.MeasurementMode;
set
{
_ak8963.MeasurementMode = value;
if (value == MeasurementMode.ContinuousMeasurement100Hz)
{
_firstContinuousRead = true;
}
}
}
/// <summary>
/// Select the magnetometer output bit rate
/// </summary>
[Property]
public OutputBitMode MagnetometerOutputBitMode
{
get => _ak8963.OutputBitMode;
set => _ak8963.OutputBitMode = value;
}
/// <summary>
/// Get the magnetometer hardware adjustment bias
/// </summary>
[Property]
public Vector3 MagnetometerAdjustment => _ak8963.MagnetometerAdjustment;
#endregion
/// <summary>
/// Initialize the MPU9250
/// </summary>
/// <param name="i2cDevice">The I2C device</param>
/// <param name="shouldDispose">Will automatically dispose the I2C device if true</param>
/// <param name="i2CDeviceAk8963">An I2C Device for the AK8963 when exposed and not behind the MPU9250</param>
public Mpu9250(I2cDevice i2cDevice, bool shouldDispose = true, I2cDevice? i2CDeviceAk8963 = null)
: base(i2cDevice, true)
{
Reset();
PowerOn();
if (!CheckVersion())
{
throw new IOException($"This device does not contain the correct signature 0x71 for a MPU9250");
}
GyroscopeBandwidth = GyroscopeBandwidth.Bandwidth0250Hz;
GyroscopeRange = GyroscopeRange.Range0250Dps;
AccelerometerBandwidth = AccelerometerBandwidth.Bandwidth1130Hz;
AccelerometerRange = AccelerometerRange.Range02G;
// Setup I2C for the AK8963
WriteRegister(Register.USER_CTRL, (byte)UserControls.I2C_MST_EN);
// Speed of 400 kHz
WriteRegister(Register.I2C_MST_CTRL, (byte)I2cBusFrequency.Frequency400kHz);
_shouldDispose = shouldDispose;
// There are 2 options to setup the Ak8963. Either the I2C address is exposed, either not.
// Trying both and pick one of them
if (i2CDeviceAk8963 == null)
{
try
{
_ak8963 = new Ak8963(i2cDevice, new Ak8963Attached(), false);
}
catch (IOException ex)
{
throw new IOException($"Please try to create an I2cDevice for the AK8963, it may be exposed", ex);
}
}
else
{
_ak8963 = new Ak8963(i2CDeviceAk8963);
}
if (!_ak8963.IsVersionCorrect())
{
// Try to reset the device first
_ak8963.Reset();
// Wait a bit
if (!_ak8963.IsVersionCorrect())
{
// Try to reset the I2C Bus
WriteRegister(Register.USER_CTRL, (byte)UserControls.I2C_MST_RST);
Thread.Sleep(100);
// Resetup again
WriteRegister(Register.USER_CTRL, (byte)UserControls.I2C_MST_EN);
WriteRegister(Register.I2C_MST_CTRL, (byte)I2cBusFrequency.Frequency400kHz);
// Poorly documented time to wait after the I2C bus reset
// Found out that waiting a little bit is needed. Exact time may be lower
Thread.Sleep(100);
// Try one more time
if (!_ak8963.IsVersionCorrect())
{
throw new IOException($"This device does not contain the correct signature 0x48 for a AK8963 embedded into the MPU9250");
}
}
}
_ak8963.MeasurementMode = MeasurementMode.SingleMeasurement;
}
/// <summary>
/// Return true if the version of MPU9250 is the correct one
/// </summary>
/// <returns>True if success</returns>
internal new bool CheckVersion()
{
// Check if the version is thee correct one
return ReadByte(Register.WHO_AM_I) == 0x71;
}
/// <summary>
/// Setup the Wake On Motion. This mode generate a rising signal on pin INT
/// You can catch it with a normal GPIO and place an interruption on it if supported
/// Reading the sensor won't give any value until it wakes up periodically
/// Only Accelerator data is available in this mode
/// </summary>
/// <param name="accelerometerThreshold">Threshold of magnetometer x/y/z axes. LSB = 4mg. Range is 0mg to 1020mg</param>
/// <param name="acceleratorLowPower">Frequency used to measure data for the low power consumption mode</param>
public new void SetWakeOnMotion(uint accelerometerThreshold, AccelerometerLowPowerFrequency acceleratorLowPower)
{
// We can't use the magnetometer, only Accelerometer will be measured
_ak8963.MeasurementMode = MeasurementMode.PowerDown;
base.SetWakeOnMotion(accelerometerThreshold, acceleratorLowPower);
}
/// <summary>
/// Cleanup everything
/// </summary>
public new void Dispose()
{
if (_shouldDispose)
{
_i2cDevice?.Dispose();
_i2cDevice = null!;
}
}
}
}
| 40.769231 | 164 | 0.557976 | [
"MIT"
] | gukoff/nanoFramework.IoT.Device | src/devices_generated/Mpu9250/Mpu9250.cs | 11,660 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using TheGamesDBApiWrapper.Domain.ApiClasses;
using TheGamesDBApiWrapper.Domain.Track;
namespace TheGamesDBApiWrapper.Data.ApiClasses
{
/// <summary>
/// Platform Api Class
/// Handles all Requests to the Platforms Endpoint of TheGamesDB
/// </summary>
/// <seealso cref="TheGamesDBApiWrapper.Data.ApiClasses.Base.BaseApiClass" />
/// <seealso cref="TheGamesDBApiWrapper.Domain.ApiClasses.IPlatform" />
public class Platform : Base.BaseApiClass, IPlatform
{
/// <summary>
/// Initializes a new instance of the <see cref="Platform" /> class.
/// </summary>
/// <param name="config">The configuration.</param>
/// <param name="factory">The factory.</param>
/// <param name="allowanceTracker">The allowance tracker.</param>
public Platform(Models.Config.TheGamesDBApiConfigModel config, Domain.ITheGamesDBApiWrapperRestClientFactory factory, IAllowanceTracker allowanceTracker) : base(config, factory, "Platforms", allowanceTracker)
{
}
/// <summary>
/// Gets all Platforms
/// </summary>
/// <param name="fields">
/// The fields (optional) to include in response body.
/// <code>icon, console, controller, developer, manufacturer, media, cpu, memory, graphics, sound, maxcontrollers, display, overview, youtube</code>
/// </param>
/// <exception cref="TheGamesDBApiWrapper.Exceptions.TheGamesDBApiException"></exception>
/// <returns><see cref="TheGamesDBApiWrapper.Models.Responses.Platforms.PlatformsResponseModel"/>
/// </returns>
public async Task<Models.Responses.Platforms.PlatformsResponseModel> All(params Models.Enums.PlatformFields[] fields)
{
Models.Payloads.Platforms.PlatformsPayload payload = new Models.Payloads.Platforms.PlatformsPayload();
payload.Fields = fields != null && fields.Any() ? string.Join(',', fields.Select(x => this.GetEnumValue(x))) : null;
return await this.CallGet<Models.Responses.Platforms.PlatformsResponseModel>(payload: payload);
}
/// <summary>
/// Gets Platform by ID
/// </summary>
/// <param name="platformId">The platform identifier.</param>
/// <param name="fields"> The fields (optional) to include in response body.
/// <code>icon, console, controller, developer, manufacturer, media, cpu, memory, graphics, sound, maxcontrollers, display, overview, youtube</code>
/// </param>
/// <exception cref="TheGamesDBApiWrapper.Exceptions.TheGamesDBApiException"></exception>
/// <returns><see cref="TheGamesDBApiWrapper.Models.Responses.Platforms.PlatformsResponseModel"/>
public async Task<Models.Responses.Platforms.PlatformsResponseModel> ByPlatformID(int platformId, params Models.Enums.PlatformFields[] fields)
{
return await this.ByPlatformID(new int[] { platformId }, fields);
}
//// <summary>
/// Gets Platforms by ID List
/// </summary>
/// <param name="platformIds">The platform identifiers.</param>
/// <param name="fields"> The fields (optional) to include in response body.
/// <code>icon, console, controller, developer, manufacturer, media, cpu, memory, graphics, sound, maxcontrollers, display, overview, youtube</code>
/// </param>
/// <exception cref="TheGamesDBApiWrapper.Exceptions.TheGamesDBApiException"></exception>
/// <returns><see cref="TheGamesDBApiWrapper.Models.Responses.Platforms.PlatformsResponseModel"/>
public async Task<Models.Responses.Platforms.PlatformsResponseModel> ByPlatformID(int[] platformIds, params Models.Enums.PlatformFields[] fields)
{
Models.Payloads.Platforms.ByPlatformIDPayload payload = new Models.Payloads.Platforms.ByPlatformIDPayload();
string ids = string.Join(',', platformIds.Select(x => x.ToString()));
payload.Fields = fields.Length > 0 ? string.Join(',', fields.Select(x => this.GetEnumValue(x))) : null;
payload.Id = ids;
return await this.CallGet<Models.Responses.Platforms.PlatformsResponseModel>("ByPlatformID", payload);
}
/// <summary>
/// Gets Platform Name
/// </summary>
/// <param name="name">The platform name to look for.</param>
/// <param name="fields"> The fields (optional) to include in response body.
/// <code>icon, console, controller, developer, manufacturer, media, cpu, memory, graphics, sound, maxcontrollers, display, overview, youtube</code>
/// </param>
/// <exception cref="TheGamesDBApiWrapper.Exceptions.TheGamesDBApiException"></exception>
/// <returns><see cref="TheGamesDBApiWrapper.Models.Responses.Platforms.PlatformsResponseModel"/>
public async Task<Models.Responses.Platforms.PlatformsResponseModel> ByPlatformName(string name, params Models.Enums.PlatformFields[] fields)
{
Models.Payloads.Platforms.ByPlatformNamePayload payload = new Models.Payloads.Platforms.ByPlatformNamePayload();
payload.Fields = fields.Length > 0 ? string.Join(',', fields.Select(x => this.GetEnumValue(x))) : null;
payload.Name = name;
return await this.CallGet<Models.Responses.Platforms.PlatformsResponseModel>("ByPlatformName", payload);
}
/// <summary>
/// Gets a list of images for given platform ids
/// </summary>
/// <param name="platformIds">The platform ids.</param>
/// <param name="page">The page.</param>
/// <param name="platformImageTypes">The platform image types as params.</param>
/// <exception cref="TheGamesDBApiWrapper.Exceptions.TheGamesDBApiException"></exception>
/// <returns><see cref="TheGamesDBApiWrapper.Models.Responses.Platforms.PlatformImagesResponse"/>
public async Task<Models.Responses.Platforms.PlatformImagesResponse> Images(int[] platformIds, int page = 1, params Models.Enums.PlatformImageType[] platformImageTypes)
{
string[] filterTypes = platformImageTypes.Select(x => this.GetEnumValue(x)).ToArray();
Models.Payloads.Platforms.PlatformImagePayload payload = new Models.Payloads.Platforms.PlatformImagePayload();
payload.PlatformId = string.Join(',', platformIds.Select(x => x.ToString()));
payload.Page = page;
payload.Type = filterTypes.Any() ? string.Join(',', filterTypes) : null;
return await this.CallGet<Models.Responses.Platforms.PlatformImagesResponse>("Images", payload);
}
}
}
| 52.48855 | 216 | 0.672193 | [
"MIT"
] | dionoid/TheGamesDBApiWrapper | src/Data/ApiClasses/Platform.cs | 6,878 | C# |
/*******************************************************************************
* Copyright 2012-2019 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.
* *****************************************************************************
*
* AWS Tools for Windows (TM) PowerShell (TM)
*
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Management.Automation;
using System.Text;
using Amazon.PowerShell.Common;
using Amazon.Runtime;
using Amazon.AppMesh;
using Amazon.AppMesh.Model;
namespace Amazon.PowerShell.Cmdlets.AMSH
{
/// <summary>
/// Creates a virtual router within a service mesh.
///
///
/// <para>
/// Any inbound traffic that your virtual router expects should be specified as a
/// <code>listener</code>.
/// </para><para>
/// Virtual routers handle traffic for one or more virtual services within your mesh.
/// After you create your virtual router, create and associate routes for your
/// virtual router that direct incoming requests to different virtual nodes.
/// </para><para>
/// For more information about virtual routers, see <a href="https://docs.aws.amazon.com/app-mesh/latest/userguide/virtual_routers.html">Virtual
/// Routers</a>.
/// </para>
/// </summary>
[Cmdlet("New", "AMSHVirtualRouter", SupportsShouldProcess = true, ConfirmImpact = ConfirmImpact.Medium)]
[OutputType("Amazon.AppMesh.Model.VirtualRouterData")]
[AWSCmdlet("Calls the AWS App Mesh CreateVirtualRouter API operation.", Operation = new[] {"CreateVirtualRouter"}, SelectReturnType = typeof(Amazon.AppMesh.Model.CreateVirtualRouterResponse))]
[AWSCmdletOutput("Amazon.AppMesh.Model.VirtualRouterData or Amazon.AppMesh.Model.CreateVirtualRouterResponse",
"This cmdlet returns an Amazon.AppMesh.Model.VirtualRouterData object.",
"The service call response (type Amazon.AppMesh.Model.CreateVirtualRouterResponse) can also be referenced from properties attached to the cmdlet entry in the $AWSHistory stack."
)]
public partial class NewAMSHVirtualRouterCmdlet : AmazonAppMeshClientCmdlet, IExecutor
{
#region Parameter Spec_Listener
/// <summary>
/// <para>
/// <para>The listeners that the virtual router is expected to receive inbound traffic from.
/// You can specify one listener.</para>
/// </para>
/// </summary>
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("Spec_Listeners")]
public Amazon.AppMesh.Model.VirtualRouterListener[] Spec_Listener { get; set; }
#endregion
#region Parameter MeshName
/// <summary>
/// <para>
/// <para>The name of the service mesh to create the virtual router in.</para>
/// </para>
/// </summary>
#if !MODULAR
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
#else
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true, Mandatory = true)]
[System.Management.Automation.AllowEmptyString]
[System.Management.Automation.AllowNull]
#endif
[Amazon.PowerShell.Common.AWSRequiredParameter]
public System.String MeshName { get; set; }
#endregion
#region Parameter MeshOwner
/// <summary>
/// <para>
/// <para>The AWS IAM account ID of the service mesh owner. If the account ID is not your own,
/// then the account that you specify must share the mesh with your account
/// before you can create the resource in the service mesh. For more information
/// about mesh sharing, see <a href="https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html">Working
/// with Shared Meshes</a>.</para>
/// </para>
/// </summary>
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.String MeshOwner { get; set; }
#endregion
#region Parameter Tag
/// <summary>
/// <para>
/// <para>Optional metadata that you can apply to the virtual router to assist with categorization
/// and organization. Each tag consists of a key and an optional value, both of
/// which you define. Tag keys can have a maximum character length of 128 characters,
/// and tag values can have a maximum length of 256 characters.</para>
/// </para>
/// </summary>
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("Tags")]
public Amazon.AppMesh.Model.TagRef[] Tag { get; set; }
#endregion
#region Parameter VirtualRouterName
/// <summary>
/// <para>
/// <para>The name to use for the virtual router.</para>
/// </para>
/// </summary>
#if !MODULAR
[System.Management.Automation.Parameter(Position = 0, ValueFromPipelineByPropertyName = true, ValueFromPipeline = true)]
#else
[System.Management.Automation.Parameter(Position = 0, ValueFromPipelineByPropertyName = true, ValueFromPipeline = true, Mandatory = true)]
[System.Management.Automation.AllowEmptyString]
[System.Management.Automation.AllowNull]
#endif
[Amazon.PowerShell.Common.AWSRequiredParameter]
public System.String VirtualRouterName { get; set; }
#endregion
#region Parameter ClientToken
/// <summary>
/// <para>
/// <para>Unique, case-sensitive identifier that you provide to ensure the idempotency of therequest.
/// Up to 36 letters, numbers, hyphens, and underscores are allowed.</para>
/// </para>
/// </summary>
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.String ClientToken { get; set; }
#endregion
#region Parameter Select
/// <summary>
/// Use the -Select parameter to control the cmdlet output. The default value is 'VirtualRouter'.
/// Specifying -Select '*' will result in the cmdlet returning the whole service response (Amazon.AppMesh.Model.CreateVirtualRouterResponse).
/// Specifying the name of a property of type Amazon.AppMesh.Model.CreateVirtualRouterResponse will result in that property being returned.
/// Specifying -Select '^ParameterName' will result in the cmdlet returning the selected cmdlet parameter value.
/// </summary>
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public string Select { get; set; } = "VirtualRouter";
#endregion
#region Parameter PassThru
/// <summary>
/// Changes the cmdlet behavior to return the value passed to the VirtualRouterName parameter.
/// The -PassThru parameter is deprecated, use -Select '^VirtualRouterName' instead. This parameter will be removed in a future version.
/// </summary>
[System.Obsolete("The -PassThru parameter is deprecated, use -Select '^VirtualRouterName' instead. This parameter will be removed in a future version.")]
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public SwitchParameter PassThru { get; set; }
#endregion
#region Parameter Force
/// <summary>
/// This parameter overrides confirmation prompts to force
/// the cmdlet to continue its operation. This parameter should always
/// be used with caution.
/// </summary>
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public SwitchParameter Force { get; set; }
#endregion
protected override void ProcessRecord()
{
base.ProcessRecord();
var resourceIdentifiersText = FormatParameterValuesForConfirmationMsg(nameof(this.VirtualRouterName), MyInvocation.BoundParameters);
if (!ConfirmShouldProceed(this.Force.IsPresent, resourceIdentifiersText, "New-AMSHVirtualRouter (CreateVirtualRouter)"))
{
return;
}
var context = new CmdletContext();
// allow for manipulation of parameters prior to loading into context
PreExecutionContextLoad(context);
#pragma warning disable CS0618, CS0612 //A class member was marked with the Obsolete attribute
if (ParameterWasBound(nameof(this.Select)))
{
context.Select = CreateSelectDelegate<Amazon.AppMesh.Model.CreateVirtualRouterResponse, NewAMSHVirtualRouterCmdlet>(Select) ??
throw new System.ArgumentException("Invalid value for -Select parameter.", nameof(this.Select));
if (this.PassThru.IsPresent)
{
throw new System.ArgumentException("-PassThru cannot be used when -Select is specified.", nameof(this.Select));
}
}
else if (this.PassThru.IsPresent)
{
context.Select = (response, cmdlet) => this.VirtualRouterName;
}
#pragma warning restore CS0618, CS0612 //A class member was marked with the Obsolete attribute
context.ClientToken = this.ClientToken;
context.MeshName = this.MeshName;
#if MODULAR
if (this.MeshName == null && ParameterWasBound(nameof(this.MeshName)))
{
WriteWarning("You are passing $null as a value for parameter MeshName which is marked as required. In case you believe this parameter was incorrectly marked as required, report this by opening an issue at https://github.com/aws/aws-tools-for-powershell/issues.");
}
#endif
context.MeshOwner = this.MeshOwner;
if (this.Spec_Listener != null)
{
context.Spec_Listener = new List<Amazon.AppMesh.Model.VirtualRouterListener>(this.Spec_Listener);
}
if (this.Tag != null)
{
context.Tag = new List<Amazon.AppMesh.Model.TagRef>(this.Tag);
}
context.VirtualRouterName = this.VirtualRouterName;
#if MODULAR
if (this.VirtualRouterName == null && ParameterWasBound(nameof(this.VirtualRouterName)))
{
WriteWarning("You are passing $null as a value for parameter VirtualRouterName which is marked as required. In case you believe this parameter was incorrectly marked as required, report this by opening an issue at https://github.com/aws/aws-tools-for-powershell/issues.");
}
#endif
// allow further manipulation of loaded context prior to processing
PostExecutionContextLoad(context);
var output = Execute(context) as CmdletOutput;
ProcessOutput(output);
}
#region IExecutor Members
public object Execute(ExecutorContext context)
{
var cmdletContext = context as CmdletContext;
// create request
var request = new Amazon.AppMesh.Model.CreateVirtualRouterRequest();
if (cmdletContext.ClientToken != null)
{
request.ClientToken = cmdletContext.ClientToken;
}
if (cmdletContext.MeshName != null)
{
request.MeshName = cmdletContext.MeshName;
}
if (cmdletContext.MeshOwner != null)
{
request.MeshOwner = cmdletContext.MeshOwner;
}
// populate Spec
var requestSpecIsNull = true;
request.Spec = new Amazon.AppMesh.Model.VirtualRouterSpec();
List<Amazon.AppMesh.Model.VirtualRouterListener> requestSpec_spec_Listener = null;
if (cmdletContext.Spec_Listener != null)
{
requestSpec_spec_Listener = cmdletContext.Spec_Listener;
}
if (requestSpec_spec_Listener != null)
{
request.Spec.Listeners = requestSpec_spec_Listener;
requestSpecIsNull = false;
}
// determine if request.Spec should be set to null
if (requestSpecIsNull)
{
request.Spec = null;
}
if (cmdletContext.Tag != null)
{
request.Tags = cmdletContext.Tag;
}
if (cmdletContext.VirtualRouterName != null)
{
request.VirtualRouterName = cmdletContext.VirtualRouterName;
}
CmdletOutput output;
// issue call
var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint);
try
{
var response = CallAWSServiceOperation(client, request);
object pipelineOutput = null;
pipelineOutput = cmdletContext.Select(response, this);
output = new CmdletOutput
{
PipelineOutput = pipelineOutput,
ServiceResponse = response
};
}
catch (Exception e)
{
output = new CmdletOutput { ErrorResponse = e };
}
return output;
}
public ExecutorContext CreateContext()
{
return new CmdletContext();
}
#endregion
#region AWS Service Operation Call
private Amazon.AppMesh.Model.CreateVirtualRouterResponse CallAWSServiceOperation(IAmazonAppMesh client, Amazon.AppMesh.Model.CreateVirtualRouterRequest request)
{
Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS App Mesh", "CreateVirtualRouter");
try
{
#if DESKTOP
return client.CreateVirtualRouter(request);
#elif CORECLR
return client.CreateVirtualRouterAsync(request).GetAwaiter().GetResult();
#else
#error "Unknown build edition"
#endif
}
catch (AmazonServiceException exc)
{
var webException = exc.InnerException as System.Net.WebException;
if (webException != null)
{
throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException);
}
throw;
}
}
#endregion
internal partial class CmdletContext : ExecutorContext
{
public System.String ClientToken { get; set; }
public System.String MeshName { get; set; }
public System.String MeshOwner { get; set; }
public List<Amazon.AppMesh.Model.VirtualRouterListener> Spec_Listener { get; set; }
public List<Amazon.AppMesh.Model.TagRef> Tag { get; set; }
public System.String VirtualRouterName { get; set; }
public System.Func<Amazon.AppMesh.Model.CreateVirtualRouterResponse, NewAMSHVirtualRouterCmdlet, object> Select { get; set; } =
(response, cmdlet) => response.VirtualRouter;
}
}
}
| 46.008475 | 288 | 0.607294 | [
"Apache-2.0"
] | JekzVadaria/aws-tools-for-powershell | modules/AWSPowerShell/Cmdlets/AppMesh/Basic/New-AMSHVirtualRouter-Cmdlet.cs | 16,287 | C# |
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
namespace System.Xml.Xsl.XsltOld
{
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Reflection;
using System.Text;
using System.Xml.XPath;
using System.Xml.Xsl.XsltOld.Debugger;
using MS.Internal.Xml.XPath;
internal sealed class Processor : IXsltProcessor
{
//
// Static constants
//
private const int StackIncrement = 10;
//
// Execution result
//
internal enum ExecResult
{
Continue, // Continues next iteration immediately
Interrupt, // Returns to caller, was processed enough
Done // Execution finished
}
internal enum OutputResult
{
Continue,
Interrupt,
Overflow,
Error,
Ignore
}
private ExecResult _execResult;
//
// Compiled stylesheet
//
private Stylesheet _stylesheet; // Root of import tree of template managers
private RootAction _rootAction;
private Key[] _keyList;
private List<TheQuery> _queryStore;
//
// Document Being transformed
//
private XPathNavigator _document;
//
// Execution action stack
//
private HWStack _actionStack;
private HWStack _debuggerStack;
//
// Register for returning value from calling nested action
//
private StringBuilder _sharedStringBuilder;
//
// Output related member variables
//
private int _ignoreLevel;
private StateMachine _xsm;
private RecordBuilder _builder;
private XsltOutput _output;
private XmlNameTable _nameTable = new NameTable();
private XmlResolver _resolver;
#pragma warning disable 618
private XsltArgumentList _args;
#pragma warning restore 618
private Hashtable _scriptExtensions;
private ArrayList _numberList;
//
// Template lookup action
//
private TemplateLookupAction _templateLookup = new TemplateLookupAction();
private IXsltDebugger _debugger;
private Query[] _queryList;
private ArrayList _sortArray;
private Hashtable _documentCache;
// NOTE: ValueOf() can call Matches() through XsltCompileContext.PreserveWhitespace(),
// that's why we use two different contexts here, valueOfContext and matchesContext
private XsltCompileContext _valueOfContext;
private XsltCompileContext _matchesContext;
internal XPathNavigator Current
{
get
{
ActionFrame frame = (ActionFrame)_actionStack.Peek();
return frame != null ? frame.Node : null;
}
}
internal ExecResult ExecutionResult
{
get { return _execResult; }
set
{
Debug.Assert(_execResult == ExecResult.Continue);
_execResult = value;
}
}
internal Stylesheet Stylesheet
{
get { return _stylesheet; }
}
internal XmlResolver Resolver
{
get
{
Debug.Assert(_resolver != null, "Constructor should create it if null passed");
return _resolver;
}
}
internal ArrayList SortArray
{
get
{
Debug.Assert(_sortArray != null, "InitSortArray() wasn't called");
return _sortArray;
}
}
internal Key[] KeyList
{
get { return _keyList; }
}
internal XPathNavigator GetNavigator(Uri ruri)
{
XPathNavigator result = null;
if (_documentCache != null)
{
result = _documentCache[ruri] as XPathNavigator;
if (result != null)
{
return result.Clone();
}
}
else
{
_documentCache = new Hashtable();
}
object input = _resolver.GetEntity(ruri, null, null);
if (input is Stream)
{
XmlTextReaderImpl tr = new XmlTextReaderImpl(ruri.ToString(), (Stream)input);
{
tr.XmlResolver = _resolver;
}
// reader is closed by Compiler.LoadDocument()
result = ((IXPathNavigable)Compiler.LoadDocument(tr)).CreateNavigator();
}
else if (input is XPathNavigator)
{
result = (XPathNavigator)input;
}
else
{
throw XsltException.Create(SR.Xslt_CantResolve, ruri.ToString());
}
_documentCache[ruri] = result.Clone();
return result;
}
internal void AddSort(Sort sortinfo)
{
Debug.Assert(_sortArray != null, "InitSortArray() wasn't called");
_sortArray.Add(sortinfo);
}
internal void InitSortArray()
{
if (_sortArray == null)
{
_sortArray = new ArrayList();
}
else
{
_sortArray.Clear();
}
}
internal object GetGlobalParameter(XmlQualifiedName qname)
{
object parameter = _args.GetParam(qname.Name, qname.Namespace);
if (parameter == null)
{
return null;
}
if (
parameter is XPathNodeIterator ||
parameter is XPathNavigator ||
parameter is bool ||
parameter is double ||
parameter is string
)
{
// doing nothing
}
else if (
parameter is short || parameter is ushort ||
parameter is int || parameter is uint ||
parameter is long || parameter is ulong ||
parameter is float || parameter is decimal
)
{
parameter = XmlConvert.ToXPathDouble(parameter);
}
else
{
parameter = parameter.ToString();
}
return parameter;
}
internal object GetExtensionObject(string nsUri)
{
return _args.GetExtensionObject(nsUri);
}
internal object GetScriptObject(string nsUri)
{
return _scriptExtensions[nsUri];
}
internal RootAction RootAction
{
get { return _rootAction; }
}
internal XPathNavigator Document
{
get { return _document; }
}
#if DEBUG
private bool _stringBuilderLocked = false;
#endif
internal StringBuilder GetSharedStringBuilder()
{
#if DEBUG
Debug.Assert(!_stringBuilderLocked);
#endif
if (_sharedStringBuilder == null)
{
_sharedStringBuilder = new StringBuilder();
}
else
{
_sharedStringBuilder.Length = 0;
}
#if DEBUG
_stringBuilderLocked = true;
#endif
return _sharedStringBuilder;
}
internal void ReleaseSharedStringBuilder()
{
// don't clean stringBuilderLocked here. ToString() will happen after this call
#if DEBUG
_stringBuilderLocked = false;
#endif
}
internal ArrayList NumberList
{
get
{
if (_numberList == null)
{
_numberList = new ArrayList();
}
return _numberList;
}
}
internal IXsltDebugger Debugger
{
get { return _debugger; }
}
internal HWStack ActionStack
{
get { return _actionStack; }
}
internal XsltOutput Output
{
get { return _output; }
}
//
// Construction
//
public Processor(
XPathNavigator doc, XsltArgumentList args, XmlResolver resolver,
Stylesheet stylesheet, List<TheQuery> queryStore, RootAction rootAction,
IXsltDebugger debugger
)
{
_stylesheet = stylesheet;
_queryStore = queryStore;
_rootAction = rootAction;
_queryList = new Query[queryStore.Count];
{
for (int i = 0; i < queryStore.Count; i++)
{
_queryList[i] = Query.Clone(queryStore[i].CompiledQuery.QueryTree);
}
}
_xsm = new StateMachine();
_document = doc;
_builder = null;
_actionStack = new HWStack(StackIncrement);
_output = _rootAction.Output;
_resolver = resolver ?? XmlNullResolver.Singleton;
_args = args ?? new XsltArgumentList();
_debugger = debugger;
if (_debugger != null)
{
_debuggerStack = new HWStack(StackIncrement, /*limit:*/1000);
_templateLookup = new TemplateLookupActionDbg();
}
// Clone the compile-time KeyList
if (_rootAction.KeyList != null)
{
_keyList = new Key[_rootAction.KeyList.Count];
for (int i = 0; i < _keyList.Length; i++)
{
_keyList[i] = _rootAction.KeyList[i].Clone();
}
}
_scriptExtensions = new Hashtable(_stylesheet.ScriptObjectTypes.Count);
{
foreach (DictionaryEntry entry in _stylesheet.ScriptObjectTypes)
{
string namespaceUri = (string)entry.Key;
if (GetExtensionObject(namespaceUri) != null)
{
throw XsltException.Create(SR.Xslt_ScriptDub, namespaceUri);
}
_scriptExtensions.Add(namespaceUri, Activator.CreateInstance((Type)entry.Value,
BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, null, null));
}
}
this.PushActionFrame(_rootAction, /*nodeSet:*/null);
}
public ReaderOutput StartReader()
{
ReaderOutput output = new ReaderOutput(this);
_builder = new RecordBuilder(output, _nameTable);
return output;
}
public void Execute(Stream stream)
{
RecordOutput recOutput = null;
switch (_output.Method)
{
case XsltOutput.OutputMethod.Text:
recOutput = new TextOnlyOutput(this, stream);
break;
case XsltOutput.OutputMethod.Xml:
case XsltOutput.OutputMethod.Html:
case XsltOutput.OutputMethod.Other:
case XsltOutput.OutputMethod.Unknown:
recOutput = new TextOutput(this, stream);
break;
}
_builder = new RecordBuilder(recOutput, _nameTable);
Execute();
}
public void Execute(TextWriter writer)
{
RecordOutput recOutput = null;
switch (_output.Method)
{
case XsltOutput.OutputMethod.Text:
recOutput = new TextOnlyOutput(this, writer);
break;
case XsltOutput.OutputMethod.Xml:
case XsltOutput.OutputMethod.Html:
case XsltOutput.OutputMethod.Other:
case XsltOutput.OutputMethod.Unknown:
recOutput = new TextOutput(this, writer);
break;
}
_builder = new RecordBuilder(recOutput, _nameTable);
Execute();
}
public void Execute(XmlWriter writer)
{
_builder = new RecordBuilder(new WriterOutput(this, writer), _nameTable);
Execute();
}
//
// Execution part of processor
//
internal void Execute()
{
Debug.Assert(_actionStack != null);
while (_execResult == ExecResult.Continue)
{
ActionFrame frame = (ActionFrame)_actionStack.Peek();
if (frame == null)
{
Debug.Assert(_builder != null);
_builder.TheEnd();
ExecutionResult = ExecResult.Done;
break;
}
// Execute the action which was on the top of the stack
if (frame.Execute(this))
{
_actionStack.Pop();
}
}
if (_execResult == ExecResult.Interrupt)
{
_execResult = ExecResult.Continue;
}
}
//
// Action frame support
//
internal ActionFrame PushNewFrame()
{
ActionFrame prent = (ActionFrame)_actionStack.Peek();
ActionFrame frame = (ActionFrame)_actionStack.Push();
if (frame == null)
{
frame = new ActionFrame();
_actionStack.AddToTop(frame);
}
Debug.Assert(frame != null);
if (prent != null)
{
frame.Inherit(prent);
}
return frame;
}
internal void PushActionFrame(Action action, XPathNodeIterator nodeSet)
{
ActionFrame frame = PushNewFrame();
frame.Init(action, nodeSet);
}
internal void PushActionFrame(ActionFrame container)
{
this.PushActionFrame(container, container.NodeSet);
}
internal void PushActionFrame(ActionFrame container, XPathNodeIterator nodeSet)
{
ActionFrame frame = PushNewFrame();
frame.Init(container, nodeSet);
}
internal void PushTemplateLookup(XPathNodeIterator nodeSet, XmlQualifiedName mode, Stylesheet importsOf)
{
Debug.Assert(_templateLookup != null);
_templateLookup.Initialize(mode, importsOf);
PushActionFrame(_templateLookup, nodeSet);
}
internal string GetQueryExpression(int key)
{
Debug.Assert(key != Compiler.InvalidQueryKey);
return _queryStore[key].CompiledQuery.Expression;
}
internal Query GetCompiledQuery(int key)
{
Debug.Assert(key != Compiler.InvalidQueryKey);
TheQuery theQuery = _queryStore[key];
theQuery.CompiledQuery.CheckErrors();
Query expr = Query.Clone(_queryList[key]);
expr.SetXsltContext(new XsltCompileContext(theQuery._ScopeManager, this));
return expr;
}
internal Query GetValueQuery(int key)
{
return GetValueQuery(key, null);
}
internal Query GetValueQuery(int key, XsltCompileContext context)
{
Debug.Assert(key != Compiler.InvalidQueryKey);
TheQuery theQuery = _queryStore[key];
theQuery.CompiledQuery.CheckErrors();
Query expr = _queryList[key];
if (context == null)
{
context = new XsltCompileContext(theQuery._ScopeManager, this);
}
else
{
context.Reinitialize(theQuery._ScopeManager, this);
}
expr.SetXsltContext(context);
return expr;
}
private XsltCompileContext GetValueOfContext()
{
if (_valueOfContext == null)
{
_valueOfContext = new XsltCompileContext();
}
return _valueOfContext;
}
[Conditional("DEBUG")]
private void RecycleValueOfContext()
{
if (_valueOfContext != null)
{
_valueOfContext.Recycle();
}
}
private XsltCompileContext GetMatchesContext()
{
if (_matchesContext == null)
{
_matchesContext = new XsltCompileContext();
}
return _matchesContext;
}
[Conditional("DEBUG")]
private void RecycleMatchesContext()
{
if (_matchesContext != null)
{
_matchesContext.Recycle();
}
}
internal string ValueOf(ActionFrame context, int key)
{
string result;
Query query = this.GetValueQuery(key, GetValueOfContext());
object value = query.Evaluate(context.NodeSet);
if (value is XPathNodeIterator)
{
XPathNavigator n = query.Advance();
result = n != null ? ValueOf(n) : string.Empty;
}
else
{
result = XmlConvert.ToXPathString(value);
}
RecycleValueOfContext();
return result;
}
internal string ValueOf(XPathNavigator n)
{
if (_stylesheet.Whitespace && n.NodeType == XPathNodeType.Element)
{
StringBuilder builder = this.GetSharedStringBuilder();
ElementValueWithoutWS(n, builder);
this.ReleaseSharedStringBuilder();
return builder.ToString();
}
return n.Value;
}
private void ElementValueWithoutWS(XPathNavigator nav, StringBuilder builder)
{
Debug.Assert(nav.NodeType == XPathNodeType.Element);
bool preserve = this.Stylesheet.PreserveWhiteSpace(this, nav);
if (nav.MoveToFirstChild())
{
do
{
switch (nav.NodeType)
{
case XPathNodeType.Text:
case XPathNodeType.SignificantWhitespace:
builder.Append(nav.Value);
break;
case XPathNodeType.Whitespace:
if (preserve)
{
builder.Append(nav.Value);
}
break;
case XPathNodeType.Element:
ElementValueWithoutWS(nav, builder);
break;
}
} while (nav.MoveToNext());
nav.MoveToParent();
}
}
internal XPathNodeIterator StartQuery(XPathNodeIterator context, int key)
{
Query query = GetCompiledQuery(key);
object result = query.Evaluate(context);
if (result is XPathNodeIterator)
{
return new XPathSelectionIterator(context.Current, query);
}
throw XsltException.Create(SR.XPath_NodeSetExpected);
}
internal object Evaluate(ActionFrame context, int key)
{
return GetValueQuery(key).Evaluate(context.NodeSet);
}
internal object RunQuery(ActionFrame context, int key)
{
Query query = GetCompiledQuery(key);
object value = query.Evaluate(context.NodeSet);
XPathNodeIterator it = value as XPathNodeIterator;
if (it != null)
{
return new XPathArrayIterator(it);
}
return value;
}
internal string EvaluateString(ActionFrame context, int key)
{
object objValue = Evaluate(context, key);
string value = null;
if (objValue != null)
value = XmlConvert.ToXPathString(objValue);
if (value == null)
value = string.Empty;
return value;
}
internal bool EvaluateBoolean(ActionFrame context, int key)
{
object objValue = Evaluate(context, key);
if (objValue != null)
{
XPathNavigator nav = objValue as XPathNavigator;
return nav != null ? Convert.ToBoolean(nav.Value, CultureInfo.InvariantCulture) : Convert.ToBoolean(objValue, CultureInfo.InvariantCulture);
}
else
{
return false;
}
}
internal bool Matches(XPathNavigator context, int key)
{
// We don't use XPathNavigator.Matches() to avoid cloning of Query on each call
Query query = this.GetValueQuery(key, GetMatchesContext());
try
{
bool result = query.MatchNode(context) != null;
RecycleMatchesContext();
return result;
}
catch (XPathException)
{
throw XsltException.Create(SR.Xslt_InvalidPattern, this.GetQueryExpression(key));
}
}
//
// Outputting part of processor
//
internal XmlNameTable NameTable
{
get { return _nameTable; }
}
internal bool CanContinue
{
get { return _execResult == ExecResult.Continue; }
}
internal bool ExecutionDone
{
get { return _execResult == ExecResult.Done; }
}
internal void ResetOutput()
{
Debug.Assert(_builder != null);
_builder.Reset();
}
internal bool BeginEvent(XPathNodeType nodeType, string prefix, string name, string nspace, bool empty)
{
return BeginEvent(nodeType, prefix, name, nspace, empty, null, true);
}
internal bool BeginEvent(XPathNodeType nodeType, string prefix, string name, string nspace, bool empty, object htmlProps, bool search)
{
Debug.Assert(_xsm != null);
int stateOutlook = _xsm.BeginOutlook(nodeType);
if (_ignoreLevel > 0 || stateOutlook == StateMachine.Error)
{
_ignoreLevel++;
return true; // We consumed the event, so pretend it was output.
}
switch (_builder.BeginEvent(stateOutlook, nodeType, prefix, name, nspace, empty, htmlProps, search))
{
case OutputResult.Continue:
_xsm.Begin(nodeType);
Debug.Assert(StateMachine.StateOnly(stateOutlook) == _xsm.State);
Debug.Assert(ExecutionResult == ExecResult.Continue);
return true;
case OutputResult.Interrupt:
_xsm.Begin(nodeType);
Debug.Assert(StateMachine.StateOnly(stateOutlook) == _xsm.State);
ExecutionResult = ExecResult.Interrupt;
return true;
case OutputResult.Overflow:
ExecutionResult = ExecResult.Interrupt;
return false;
case OutputResult.Error:
_ignoreLevel++;
return true;
case OutputResult.Ignore:
return true;
default:
Debug.Fail("Unexpected result of RecordBuilder.BeginEvent()");
return true;
}
}
internal bool TextEvent(string text)
{
return this.TextEvent(text, false);
}
internal bool TextEvent(string text, bool disableOutputEscaping)
{
Debug.Assert(_xsm != null);
if (_ignoreLevel > 0)
{
return true;
}
int stateOutlook = _xsm.BeginOutlook(XPathNodeType.Text);
switch (_builder.TextEvent(stateOutlook, text, disableOutputEscaping))
{
case OutputResult.Continue:
_xsm.Begin(XPathNodeType.Text);
Debug.Assert(StateMachine.StateOnly(stateOutlook) == _xsm.State);
Debug.Assert(ExecutionResult == ExecResult.Continue);
return true;
case OutputResult.Interrupt:
_xsm.Begin(XPathNodeType.Text);
Debug.Assert(StateMachine.StateOnly(stateOutlook) == _xsm.State);
ExecutionResult = ExecResult.Interrupt;
return true;
case OutputResult.Overflow:
ExecutionResult = ExecResult.Interrupt;
return false;
case OutputResult.Error:
case OutputResult.Ignore:
return true;
default:
Debug.Fail("Unexpected result of RecordBuilder.TextEvent()");
return true;
}
}
internal bool EndEvent(XPathNodeType nodeType)
{
Debug.Assert(_xsm != null);
if (_ignoreLevel > 0)
{
_ignoreLevel--;
return true;
}
int stateOutlook = _xsm.EndOutlook(nodeType);
switch (_builder.EndEvent(stateOutlook, nodeType))
{
case OutputResult.Continue:
_xsm.End(nodeType);
Debug.Assert(StateMachine.StateOnly(stateOutlook) == _xsm.State);
return true;
case OutputResult.Interrupt:
_xsm.End(nodeType);
Debug.Assert(StateMachine.StateOnly(stateOutlook) == _xsm.State,
"StateMachine.StateOnly(stateOutlook) == this.xsm.State");
ExecutionResult = ExecResult.Interrupt;
return true;
case OutputResult.Overflow:
ExecutionResult = ExecResult.Interrupt;
return false;
case OutputResult.Error:
case OutputResult.Ignore:
default:
Debug.Fail("Unexpected result of RecordBuilder.TextEvent()");
return true;
}
}
internal bool CopyBeginEvent(XPathNavigator node, bool emptyflag)
{
switch (node.NodeType)
{
case XPathNodeType.Element:
case XPathNodeType.Attribute:
case XPathNodeType.ProcessingInstruction:
case XPathNodeType.Comment:
return BeginEvent(node.NodeType, node.Prefix, node.LocalName, node.NamespaceURI, emptyflag);
case XPathNodeType.Namespace:
// value instead of namespace here!
return BeginEvent(XPathNodeType.Namespace, null, node.LocalName, node.Value, false);
case XPathNodeType.Text:
// Text will be copied in CopyContents();
break;
case XPathNodeType.Root:
case XPathNodeType.Whitespace:
case XPathNodeType.SignificantWhitespace:
case XPathNodeType.All:
break;
default:
Debug.Fail("Invalid XPathNodeType in CopyBeginEvent");
break;
}
return true;
}
internal bool CopyTextEvent(XPathNavigator node)
{
switch (node.NodeType)
{
case XPathNodeType.Element:
case XPathNodeType.Namespace:
break;
case XPathNodeType.Attribute:
case XPathNodeType.ProcessingInstruction:
case XPathNodeType.Comment:
case XPathNodeType.Text:
case XPathNodeType.Whitespace:
case XPathNodeType.SignificantWhitespace:
string text = node.Value;
return TextEvent(text);
case XPathNodeType.Root:
case XPathNodeType.All:
break;
default:
Debug.Fail("Invalid XPathNodeType in CopyTextEvent");
break;
}
return true;
}
internal bool CopyEndEvent(XPathNavigator node)
{
switch (node.NodeType)
{
case XPathNodeType.Element:
case XPathNodeType.Attribute:
case XPathNodeType.ProcessingInstruction:
case XPathNodeType.Comment:
case XPathNodeType.Namespace:
return EndEvent(node.NodeType);
case XPathNodeType.Text:
// Text was copied in CopyContents();
break;
case XPathNodeType.Root:
case XPathNodeType.Whitespace:
case XPathNodeType.SignificantWhitespace:
case XPathNodeType.All:
break;
default:
Debug.Fail("Invalid XPathNodeType in CopyEndEvent");
break;
}
return true;
}
internal static bool IsRoot(XPathNavigator navigator)
{
Debug.Assert(navigator != null);
if (navigator.NodeType == XPathNodeType.Root)
{
return true;
}
else if (navigator.NodeType == XPathNodeType.Element)
{
XPathNavigator clone = navigator.Clone();
clone.MoveToRoot();
return clone.IsSamePosition(navigator);
}
else
{
return false;
}
}
//
// Builder stack
//
internal void PushOutput(RecordOutput output)
{
Debug.Assert(output != null);
_builder.OutputState = _xsm.State;
RecordBuilder lastBuilder = _builder;
_builder = new RecordBuilder(output, _nameTable);
_builder.Next = lastBuilder;
_xsm.Reset();
}
internal RecordOutput PopOutput()
{
Debug.Assert(_builder != null);
RecordBuilder topBuilder = _builder;
_builder = topBuilder.Next;
_xsm.State = _builder.OutputState;
topBuilder.TheEnd();
return topBuilder.Output;
}
internal bool SetDefaultOutput(XsltOutput.OutputMethod method)
{
if (Output.Method != method)
{
_output = _output.CreateDerivedOutput(method);
return true;
}
return false;
}
internal object GetVariableValue(VariableAction variable)
{
int variablekey = variable.VarKey;
if (variable.IsGlobal)
{
ActionFrame rootFrame = (ActionFrame)_actionStack[0];
object result = rootFrame.GetVariable(variablekey);
if (result == VariableAction.BeingComputedMark)
{
throw XsltException.Create(SR.Xslt_CircularReference, variable.NameStr);
}
if (result != null)
{
return result;
}
// Variable wasn't evaluated yet
int saveStackSize = _actionStack.Length;
ActionFrame varFrame = PushNewFrame();
varFrame.Inherit(rootFrame);
varFrame.Init(variable, rootFrame.NodeSet);
do
{
bool endOfFrame = ((ActionFrame)_actionStack.Peek()).Execute(this);
if (endOfFrame)
{
_actionStack.Pop();
}
} while (saveStackSize < _actionStack.Length);
Debug.Assert(saveStackSize == _actionStack.Length);
result = rootFrame.GetVariable(variablekey);
Debug.Assert(result != null, "Variable was just calculated and result can't be null");
return result;
}
else
{
return ((ActionFrame)_actionStack.Peek()).GetVariable(variablekey);
}
}
internal void SetParameter(XmlQualifiedName name, object value)
{
Debug.Assert(1 < _actionStack.Length);
ActionFrame parentFrame = (ActionFrame)_actionStack[_actionStack.Length - 2];
parentFrame.SetParameter(name, value);
}
internal void ResetParams()
{
ActionFrame frame = (ActionFrame)_actionStack[_actionStack.Length - 1];
frame.ResetParams();
}
internal object GetParameter(XmlQualifiedName name)
{
Debug.Assert(2 < _actionStack.Length);
ActionFrame parentFrame = (ActionFrame)_actionStack[_actionStack.Length - 3];
return parentFrame.GetParameter(name);
}
// ---------------------- Debugger stack -----------------------
internal class DebuggerFrame
{
internal ActionFrame actionFrame;
internal XmlQualifiedName currentMode;
}
internal void PushDebuggerStack()
{
Debug.Assert(this.Debugger != null, "We don't generate calls this function if ! debugger");
DebuggerFrame dbgFrame = (DebuggerFrame)_debuggerStack.Push();
if (dbgFrame == null)
{
dbgFrame = new DebuggerFrame();
_debuggerStack.AddToTop(dbgFrame);
}
dbgFrame.actionFrame = (ActionFrame)_actionStack.Peek(); // In a case of next builtIn action.
}
internal void PopDebuggerStack()
{
Debug.Assert(this.Debugger != null, "We don't generate calls this function if ! debugger");
_debuggerStack.Pop();
}
internal void OnInstructionExecute()
{
Debug.Assert(this.Debugger != null, "We don't generate calls this function if ! debugger");
DebuggerFrame dbgFrame = (DebuggerFrame)_debuggerStack.Peek();
Debug.Assert(dbgFrame != null, "PushDebuggerStack() wasn't ever called");
dbgFrame.actionFrame = (ActionFrame)_actionStack.Peek();
this.Debugger.OnInstructionExecute((IXsltProcessor)this);
}
internal XmlQualifiedName GetPrevioseMode()
{
Debug.Assert(this.Debugger != null, "We don't generate calls this function if ! debugger");
Debug.Assert(2 <= _debuggerStack.Length);
return ((DebuggerFrame)_debuggerStack[_debuggerStack.Length - 2]).currentMode;
}
internal void SetCurrentMode(XmlQualifiedName mode)
{
Debug.Assert(this.Debugger != null, "We don't generate calls this function if ! debugger");
((DebuggerFrame)_debuggerStack[_debuggerStack.Length - 1]).currentMode = mode;
}
}
}
| 31.771277 | 156 | 0.516044 | [
"MIT"
] | 2E0PGS/corefx | src/System.Private.Xml/src/System/Xml/Xsl/XsltOld/Processor.cs | 35,838 | C# |
#region Copyright
///////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) Phoenix Contact GmbH & Co KG
// This software is licensed under Apache-2.0
//
///////////////////////////////////////////////////////////////////////////////
#endregion
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;
using PlcNext.Common.CodeModel;
namespace PlcNext.CppParser.CppRipper.CodeModel
{
[Obfuscation(Exclude = true, ApplyToMembers = true)]
internal class CppComment : IComment
{
private CppComment(CodePosition position, string content)
{
Position = position;
Content = content;
}
public static CppComment Parse(ParseNode commentNode)
{
return new CppComment(new CodePosition(commentNode.Position.line, commentNode.Position.column), commentNode.ToString());
}
public CodePosition Position { get; }
public string Content { get; }
}
}
| 29.583333 | 133 | 0.551174 | [
"Apache-2.0"
] | PLCnext/PLCnext_CLI | src/PlcNext.CppParser/CppRipper/CodeModel/CppComment.cs | 1,067 | C# |
using System.Collections.Generic;
using Orchard.ContentManagement;
using Orchard.ContentManagement.Utilities;
namespace NGM.OpenAuthentication.Models {
public interface IUserProviders : IContent {
IList<UserProviderEntry> Providers { get; }
}
public class UserProvidersPart : ContentPart, IUserProviders {
private readonly LazyField<IList<UserProviderEntry>> _providerEntries = new LazyField<IList<UserProviderEntry>>();
public LazyField<IList<UserProviderEntry>> ProviderEntriesField { get { return _providerEntries; } }
public IList<UserProviderEntry> Providers {
get { return ProviderEntriesField.Value; }
set { ProviderEntriesField.Value = value; }
}
}
public class UserProviderEntry {
public int Id { get; set; }
public string ProviderName { get; set; }
public string ProviderUserId { get; set; }
}
} | 35.461538 | 122 | 0.699566 | [
"BSD-3-Clause"
] | sebastienros/msc | src/Orchard.Web/Modules/NGM.OpenAuthentication/Models/UserProvidersPart.cs | 922 | C# |
namespace Hes.Collections.Generic {
using System.Linq;
public interface IMutableGrouping<out TKey, TElement> : IGrouping<TKey, TElement> {
/// <summary>
/// Adds the given element to this grouping.
/// </summary>
/// <param name="element">Element to add.</param>
void Add(TElement element);
/// <summary>
/// Removes the given element from this grouping.
/// </summary>
/// <param name="element">Item to remove.</param>
/// <returns>true if successfully removed.</returns>
bool Remove(TElement element);
/// <summary>
/// Gets a value indicating if this item is contained in this grouping.
/// </summary>
/// <param name="element">Item to check</param>
/// <returns>true if this grouping contains the given item</returns>
bool Contains(TElement element);
}
} | 33.740741 | 87 | 0.596048 | [
"MIT"
] | emrahsungu/Hes.Collections.Generic | Hes.Collections/Generic/IMutableGrouping.cs | 911 | C# |
using FluentAssertions;
using Hilke.KineticConvolution.DoubleAlgebraicNumber;
using NUnit.Framework;
namespace Hilke.KineticConvolution.Tests
{
[TestFixture]
public class DirectionHelpersTests
{
private const double EqualityTolerance = 1.0e-9;
[Test]
public void Direction_Determinant_Should_Have_Expected_Sign()
{
var factory = new ConvolutionFactory();
var d1 = factory.CreateDirection(1.0, 1.0);
var d2 = factory.CreateDirection(-1.0, 1.0);
var determinant1 = d1.Determinant(d2);
var determinant2 = d2.Determinant(d1);
determinant1.Should().BeApproximately(2.0, EqualityTolerance);
determinant1.Should().BeGreaterThan(0.0);
determinant2.Should().BeLessThan(0.0);
}
}
}
| 26.806452 | 74 | 0.646209 | [
"MIT"
] | Admir-H/KineticConvolution | tests/Hilke.KineticConvolution.Tests/DirectionHelpersTests.cs | 831 | C# |
using SPICA.Formats.Common;
using SPICA.Math3D;
using SPICA.PICA;
using SPICA.PICA.Commands;
using SPICA.PICA.Shader;
using System.Collections.Generic;
using System.IO;
using System.Numerics;
namespace SPICA.Formats.GFL2.Shader
{
public class GFShader
{
public string Name;
public readonly PICATexEnvStage[] TexEnvStages;
public RGBA TexEnvBufferColor;
public ShaderProgram VtxShader;
public ShaderProgram GeoShader;
public uint[] Executable;
public ulong[] Swizzles;
public bool HasVertexShader => VtxShader != null;
public Dictionary<uint, Vector4> VtxShaderUniforms { get; private set; }
public Dictionary<uint, Vector4> GeoShaderUniforms { get; private set; }
public GFShader()
{
TexEnvStages = new PICATexEnvStage[6];
for (int Index = 0; Index < TexEnvStages.Length; Index++)
{
TexEnvStages[Index] = new PICATexEnvStage();
}
}
public GFShader(BinaryReader Reader) : this()
{
uint MagicNumber = Reader.ReadUInt32();
uint ShaderCount = Reader.ReadUInt32();
GFSection.SkipPadding(Reader.BaseStream);
GFSection ShaderSection = new GFSection(Reader);
Name = Reader.ReadPaddedString(0x40);
uint Hash = Reader.ReadUInt32();
uint Count = Reader.ReadUInt32();
GFSection.SkipPadding(Reader.BaseStream);
uint CommandsLength = Reader.ReadUInt32();
uint CommandsCount = Reader.ReadUInt32();
uint CommandsHash = Reader.ReadUInt32();
uint Padding = Reader.ReadUInt32();
string FileName = Reader.ReadPaddedString(0x40);
uint[] Commands = new uint[CommandsLength >> 2];
for (int Index = 0; Index < Commands.Length; Index++)
{
Commands[Index] = Reader.ReadUInt32();
}
uint[] OutMap = new uint[7];
List<uint> ShaderExecutable = new List<uint>();
List<ulong> ShaderSwizzles = new List<ulong>();
PICACommandReader CmdReader = new PICACommandReader(Commands);
while (CmdReader.HasCommand)
{
PICACommand Cmd = CmdReader.GetCommand();
uint Param = Cmd.Parameters[0];
int Stage = ((int)Cmd.Register >> 3) & 7;
if (Stage >= 6) Stage -= 2;
switch (Cmd.Register)
{
/* Shader */
case PICARegister.GPUREG_SH_OUTMAP_O0: OutMap[0] = Param; break;
case PICARegister.GPUREG_SH_OUTMAP_O1: OutMap[1] = Param; break;
case PICARegister.GPUREG_SH_OUTMAP_O2: OutMap[2] = Param; break;
case PICARegister.GPUREG_SH_OUTMAP_O3: OutMap[3] = Param; break;
case PICARegister.GPUREG_SH_OUTMAP_O4: OutMap[4] = Param; break;
case PICARegister.GPUREG_SH_OUTMAP_O5: OutMap[5] = Param; break;
case PICARegister.GPUREG_SH_OUTMAP_O6: OutMap[6] = Param; break;
/* Fragment Shader */
case PICARegister.GPUREG_TEXENV0_SOURCE:
case PICARegister.GPUREG_TEXENV1_SOURCE:
case PICARegister.GPUREG_TEXENV2_SOURCE:
case PICARegister.GPUREG_TEXENV3_SOURCE:
case PICARegister.GPUREG_TEXENV4_SOURCE:
case PICARegister.GPUREG_TEXENV5_SOURCE:
TexEnvStages[Stage].Source = new PICATexEnvSource(Param);
break;
case PICARegister.GPUREG_TEXENV0_OPERAND:
case PICARegister.GPUREG_TEXENV1_OPERAND:
case PICARegister.GPUREG_TEXENV2_OPERAND:
case PICARegister.GPUREG_TEXENV3_OPERAND:
case PICARegister.GPUREG_TEXENV4_OPERAND:
case PICARegister.GPUREG_TEXENV5_OPERAND:
TexEnvStages[Stage].Operand = new PICATexEnvOperand(Param);
break;
case PICARegister.GPUREG_TEXENV0_COMBINER:
case PICARegister.GPUREG_TEXENV1_COMBINER:
case PICARegister.GPUREG_TEXENV2_COMBINER:
case PICARegister.GPUREG_TEXENV3_COMBINER:
case PICARegister.GPUREG_TEXENV4_COMBINER:
case PICARegister.GPUREG_TEXENV5_COMBINER:
TexEnvStages[Stage].Combiner = new PICATexEnvCombiner(Param);
break;
case PICARegister.GPUREG_TEXENV0_COLOR:
case PICARegister.GPUREG_TEXENV1_COLOR:
case PICARegister.GPUREG_TEXENV2_COLOR:
case PICARegister.GPUREG_TEXENV3_COLOR:
case PICARegister.GPUREG_TEXENV4_COLOR:
case PICARegister.GPUREG_TEXENV5_COLOR:
TexEnvStages[Stage].Color = new RGBA(Param);
break;
case PICARegister.GPUREG_TEXENV0_SCALE:
case PICARegister.GPUREG_TEXENV1_SCALE:
case PICARegister.GPUREG_TEXENV2_SCALE:
case PICARegister.GPUREG_TEXENV3_SCALE:
case PICARegister.GPUREG_TEXENV4_SCALE:
case PICARegister.GPUREG_TEXENV5_SCALE:
TexEnvStages[Stage].Scale = new PICATexEnvScale(Param);
break;
case PICARegister.GPUREG_TEXENV_UPDATE_BUFFER: PICATexEnvStage.SetUpdateBuffer(TexEnvStages, Param); break;
case PICARegister.GPUREG_TEXENV_BUFFER_COLOR: TexEnvBufferColor = new RGBA(Param); break;
/* Geometry Shader */
case PICARegister.GPUREG_GSH_ENTRYPOINT:
if (GeoShader == null)
GeoShader = new ShaderProgram();
GeoShader.MainOffset = Param & 0xffff;
break;
/* Vertex Shader */
case PICARegister.GPUREG_VSH_CODETRANSFER_DATA0:
case PICARegister.GPUREG_VSH_CODETRANSFER_DATA1:
case PICARegister.GPUREG_VSH_CODETRANSFER_DATA2:
case PICARegister.GPUREG_VSH_CODETRANSFER_DATA3:
case PICARegister.GPUREG_VSH_CODETRANSFER_DATA4:
case PICARegister.GPUREG_VSH_CODETRANSFER_DATA5:
case PICARegister.GPUREG_VSH_CODETRANSFER_DATA6:
case PICARegister.GPUREG_VSH_CODETRANSFER_DATA7:
ShaderExecutable.AddRange(Cmd.Parameters);
break;
case PICARegister.GPUREG_VSH_OPDESCS_DATA0:
case PICARegister.GPUREG_VSH_OPDESCS_DATA1:
case PICARegister.GPUREG_VSH_OPDESCS_DATA2:
case PICARegister.GPUREG_VSH_OPDESCS_DATA3:
case PICARegister.GPUREG_VSH_OPDESCS_DATA4:
case PICARegister.GPUREG_VSH_OPDESCS_DATA5:
case PICARegister.GPUREG_VSH_OPDESCS_DATA6:
case PICARegister.GPUREG_VSH_OPDESCS_DATA7:
for (int i = 0; i < Cmd.Parameters.Length; i++)
{
ShaderSwizzles.Add(Cmd.Parameters[i]);
}
break;
case PICARegister.GPUREG_VSH_ENTRYPOINT:
if (VtxShader == null)
VtxShader = new ShaderProgram();
VtxShader.MainOffset = Param & 0xffff;
break;
}
}
Executable = ShaderExecutable.ToArray();
Swizzles = ShaderSwizzles.ToArray();
for (int i = 0; i < OutMap.Length; i++)
{
if (OutMap[i] == 0) continue;
ShaderOutputReg Reg = new ShaderOutputReg();
for (int j = 0; j < 4; j++)
{
uint Value = (OutMap[i] >> j * 8) & 0x1f;
if (Value != 0x1f)
{
Reg.Mask |= 1u << j;
if (Value < 0x4)
Reg.Name = ShaderOutputRegName.Position;
else if (Value < 0x8)
Reg.Name = ShaderOutputRegName.QuatNormal;
else if (Value < 0xc)
Reg.Name = ShaderOutputRegName.Color;
else if (Value < 0xe)
Reg.Name = ShaderOutputRegName.TexCoord0;
else if (Value < 0x10)
Reg.Name = ShaderOutputRegName.TexCoord1;
else if (Value < 0x11)
Reg.Name = ShaderOutputRegName.TexCoord0W;
else if (Value < 0x12)
Reg.Name = ShaderOutputRegName.Generic;
else if (Value < 0x16)
Reg.Name = ShaderOutputRegName.View;
else if (Value < 0x18)
Reg.Name = ShaderOutputRegName.TexCoord2;
else
Reg.Name = ShaderOutputRegName.Generic;
}
}
if (VtxShader != null)
VtxShader.OutputRegs[i] = Reg;
if (GeoShader != null)
GeoShader.OutputRegs[i] = Reg;
}
HashSet<uint> Dsts = new HashSet<uint>();
uint LblId = 0;
for (uint i = 0; i < Executable.Length; i++)
{
ShaderOpCode OpCode = (ShaderOpCode)(Executable[i] >> 26);
if (OpCode == ShaderOpCode.Call ||
OpCode == ShaderOpCode.CallC ||
OpCode == ShaderOpCode.CallU ||
OpCode == ShaderOpCode.JmpC ||
OpCode == ShaderOpCode.JmpU)
{
uint Dst = (Executable[i] >> 10) & 0xfff;
if (!Dsts.Contains(Dst))
{
Dsts.Add(Dst);
string Name = "label_" + Dst.ToString("x4");
ShaderLabel Label = new ShaderLabel()
{
Id = LblId++,
Offset = Dst,
Length = 0,
Name = Name
};
if (VtxShader != null)
VtxShader.Labels.Add(Label);
if (GeoShader != null)
GeoShader.Labels.Add(Label);
}
}
}
MakeArray(VtxShader?.Vec4Uniforms, "v_c");
MakeArray(GeoShader?.Vec4Uniforms, "g_c");
FindProgramEnd(VtxShader, Executable);
FindProgramEnd(GeoShader, Executable);
VtxShaderUniforms = CmdReader.GetAllVertexShaderUniforms();
GeoShaderUniforms = CmdReader.GetAllGeometryShaderUniforms();
}
private void MakeArray(ShaderUniformVec4[] Uniforms, string Name)
{
//This is necessary because it's almost impossible to know what
//is supposed to be an array without the SHBin information.
//So we just make the entire thing an array to allow indexing.
if (Uniforms != null)
{
for (int i = 0; i < Uniforms.Length; i++)
{
Uniforms[i].Name = Name;
Uniforms[i].IsArray = true;
Uniforms[i].ArrayIndex = i;
Uniforms[i].ArrayLength = Uniforms.Length;
}
}
}
private void FindProgramEnd(ShaderProgram Program, uint[] Executable)
{
if (Program != null)
{
for (uint i = Program.MainOffset; i < Executable.Length; i++)
{
if ((ShaderOpCode)(Executable[i] >> 26) == ShaderOpCode.End)
{
Program.EndMainOffset = i;
break;
}
}
}
}
public ShaderBinary ToShaderBinary()
{
ShaderBinary Output = new ShaderBinary();
Output.Executable = Executable;
Output.Swizzles = Swizzles;
if (VtxShader != null) Output.Programs.Add(VtxShader);
if (GeoShader != null) Output.Programs.Add(GeoShader);
return Output;
}
}
}
| 38.241176 | 127 | 0.506307 | [
"Unlicense"
] | AkelaSnow/SPICA | SPICA/Formats/GFL2/Shader/GFShader.cs | 13,004 | 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 OkulSistemi.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OkulSistemi.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}
| 39.126761 | 177 | 0.603312 | [
"MIT"
] | mehmetacisuu/DesktopSchoolApplication | Properties/Resources.Designer.cs | 2,780 | C# |
namespace ModernTlSharp.TLSharp.Tl.TL
{
public abstract class TLAbsPeer : TLObject
{
}
}
| 14.428571 | 46 | 0.683168 | [
"MIT"
] | immmdreza/ModernTLSharp | ModernTlSharp/TLSharp.Tl/TL/TLAbsPeer.cs | 101 | C# |
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
namespace MicroBootstrap.HTTP
{
public interface IHttpClient
{
Task<HttpResponseMessage> GetAsync(string uri);
Task<T> GetAsync<T>(string uri);
Task<HttpResult<T>> GetResultAsync<T>(string uri);
Task<HttpResponseMessage> PostAsync(string uri, object data = null);
Task<HttpResponseMessage> PostAsync(string uri, HttpContent content);
Task<T> PostAsync<T>(string uri, object data = null);
Task<T> PostAsync<T>(string uri, HttpContent content);
Task<HttpResult<T>> PostResultAsync<T>(string uri, object data = null);
Task<HttpResult<T>> PostResultAsync<T>(string uri, HttpContent content);
Task<HttpResponseMessage> PutAsync(string uri, object data = null);
Task<HttpResponseMessage> PutAsync(string uri, HttpContent content);
Task<T> PutAsync<T>(string uri, object data = null);
Task<T> PutAsync<T>(string uri, HttpContent content);
Task<HttpResult<T>> PutResultAsync<T>(string uri, object data = null);
Task<HttpResult<T>> PutResultAsync<T>(string uri, HttpContent content);
Task<HttpResponseMessage> PatchAsync(string uri, object data = null);
Task<HttpResponseMessage> PatchAsync(string uri, HttpContent content);
Task<T> PatchAsync<T>(string uri, object data = null);
Task<T> PatchAsync<T>(string uri, HttpContent content);
Task<HttpResult<T>> PatchResultAsync<T>(string uri, object data = null);
Task<HttpResult<T>> PatchResultAsync<T>(string uri, HttpContent content);
Task<HttpResponseMessage> DeleteAsync(string uri);
Task<T> DeleteAsync<T>(string uri);
Task<HttpResult<T>> DeleteResultAsync<T>(string uri);
Task<HttpResponseMessage> SendAsync(HttpRequestMessage request);
Task<T> SendAsync<T>(HttpRequestMessage request);
Task<HttpResult<T>> SendResultAsync<T>(HttpRequestMessage request);
void SetHeaders(IDictionary<string, string> headers);
void SetHeaders(Action<HttpRequestHeaders> headers);
}
} | 53.292683 | 81 | 0.702059 | [
"MIT"
] | GhalamborM/MicroBootstrap | src/MicroBootstrap/MicroBootstrap.HTTP/IHttpClient.cs | 2,185 | C# |
using System;
using NServiceBus;
using NServiceBus.Transport.SQLServer;
class ConfigurationSettings
{
ConfigurationSettings(EndpointConfiguration endpointConfiguration)
{
#region sqlserver-TimeToWaitBeforeTriggeringCircuitBreaker
var transport = endpointConfiguration.UseTransport<SqlServerTransport>();
transport.TimeToWaitBeforeTriggeringCircuitBreaker(TimeSpan.FromMinutes(3));
#endregion
}
} | 28.625 | 85 | 0.755459 | [
"Apache-2.0"
] | Cogax/docs.particular.net | Snippets/SqlTransport/SqlTransportLegacySystemClient_4/ConfigurationSettings.cs | 445 | C# |
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using MicroModels.Description;
#if SILVERLIGHT
using PropertyDescriptor = MicroModels.Description.PropertyDescriptor;
#else
using PropertyDescriptor = System.ComponentModel.PropertyDescriptor;
#endif
namespace MicroModels
{
public abstract class MicroModelObject : INotifyPropertyChanged
{
private readonly IEnumerable<PropertyDescriptor> propertyDescriptors;
public event PropertyChangedEventHandler PropertyChanged;
protected MicroModelObject(MicroModelBase microModel)
{
this.propertyDescriptors = ((ISelfDescribing) microModel).GetProperties();
microModel.PropertyChanged += (s, e) => this.OnPropertyChanged(e);
}
protected virtual T GetValue<T>(string propertyName)
{
var propertyDescriptor = this.GetPropertyDescriptor(propertyName);
return (T) propertyDescriptor.GetValue(this);
}
protected virtual void SetValue<T>(string propertyName, T value)
{
var propertyDescriptor = this.GetPropertyDescriptor(propertyName);
propertyDescriptor.SetValue(this, value);
}
protected virtual void OnPropertyChanged(PropertyChangedEventArgs args)
{
var hanlder = this.PropertyChanged;
if (hanlder != null)
{
hanlder(this, args);
}
}
private PropertyDescriptor GetPropertyDescriptor(string propertyName)
{
var propertyDescriptor = this.propertyDescriptors.Where(p => p.Name == propertyName).FirstOrDefault();
if (propertyDescriptor == null)
{
throw new ArgumentException(
string.Format("PropertyDescriptor with name {0} was not found.", propertyName), "propertyName");
}
return propertyDescriptor;
}
}
} | 32.459016 | 116 | 0.658586 | [
"BSD-3-Clause"
] | ligaz/MicroModels | Source/MicroModels/MicroModelObject.cs | 1,982 | C# |
using System;
using System.ComponentModel.Composition;
using System.ComponentModel.DataAnnotations;
using NuPattern.ComponentModel.Design;
using NuPattern.Diagnostics;
using NuPattern.Library.Properties;
using NuPattern.Runtime;
namespace NuPattern.Library.ValueProviders
{
/// <summary>
/// A custom value provider that is used to provide values at runtime for other types of configured automation.
/// </summary>
[DisplayNameResource(@"ExpressionValueProvider_DisplayName", typeof(Resources))]
[DescriptionResource(@"ExpressionValueProvider_Description", typeof(Resources))]
[CategoryResource(@"AutomationCategory_General", typeof(Resources))]
[CLSCompliant(false)]
public class ExpressionValueProvider : ValueProvider
{
private static readonly ITracer tracer = Tracer.Get<ExpressionValueProvider>();
/// <summary>
/// Gets the current element in the pattern model upon which this ValueProvider is configured.
/// </summary>
[Import(AllowDefault = true)]
public IInstanceBase CurrentElement
{
get;
set;
}
/// <summary>
/// Gets or sets the expression to evaluate.
/// </summary>
[Required(AllowEmptyStrings = false)]
[DisplayNameResource(@"ExpressionValueProvider_Expression_DisplayName", typeof(Resources))]
[DescriptionResource(@"ExpressionValueProvider_Expression_Description", typeof(Resources))]
public string Expression
{
get;
set;
}
/// <summary>
/// Returns the result of evaluation of this provider.
/// </summary>
public override object Evaluate()
{
this.ValidateObject();
var productElement = this.CurrentElement as IProductElement;
var elementName = (productElement != null) ? productElement.InstanceName : this.CurrentElement.Info.DisplayName;
tracer.Info(
Resources.ExpressionValueProvider_TraceInitial, this.Expression, elementName);
var result = ExpressionEvaluator.Evaluate(this.CurrentElement, this.Expression);
if (result == null)
{
tracer.Warn(
Resources.ExpressionValueProvider_TraceResolvedNullExpression, this.Expression, elementName);
}
tracer.Info(
Resources.ExpressionValueProvider_TraceEvaluation, this.Expression, elementName, result);
return result;
}
}
}
| 36.513889 | 125 | 0.639787 | [
"Apache-2.0"
] | dbremner/nupattern | Src/Library/Source/ValueProviders/ExpressionValueProvider.cs | 2,631 | C# |
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using EventSourcingCqrsSample.Events;
using EventSourcingCqrsSample.Models.Requests;
namespace EventSourcingCqrsSample.EventHandlers
{
/// <summary>
/// This provides interfaces to the classes inheriting the <see cref="BaseEventHandler{T}" /> class.
/// </summary>
public interface IEventHandler : IDisposable
{
/// <summary>
/// Loads the list of events asynchronously.
/// </summary>
/// <param name="streamId">The stream id.</param>
/// <returns>Returns the list of events.</returns>
Task<IEnumerable<BaseEvent>> LoadAsync(Guid streamId);
/// <summary>
/// Loads the latest event asynchronously.
/// </summary>
/// <param name="streamId">The stream id.</param>
/// <returns>Returns the latest event.</returns>
Task<BaseEvent> LoadLatestAsync(Guid streamId);
/// <summary>
/// Checks whether the given event can be processed or not.
/// </summary>
/// <param name="ev">Event instance.</param>
/// <returns>Returns <c>True</c>, if the given event can be processed; otherwise returns <c>False</c>.</returns>
bool CanProcess(BaseEvent ev);
/// <summary>
/// Processes the event asynchronously.
/// </summary>
/// <param name="ev">Event instance.</param>
/// <returns>Returns <c>True</c>, if the given event has been processed; otherwise returns <c>False</c>.</returns>
Task<bool> ProcessAsync(BaseEvent ev);
/// <summary>
/// Checks whether the given request can be built or not.
/// </summary>
/// <typeparam name="TReq">Type of request.</typeparam>
/// <param name="request">Request instance.</param>
/// <returns>Returns <c>True</c>, if the given request can be built; otherwise returns <c>False</c>.</returns>
bool CanBuild<TReq>(BaseRequest request) where TReq : BaseRequest;
/// <summary>
/// Builds the request using the latest event stored asynchronously.
/// </summary>
/// <param name="request">The request instance.</param>
/// <returns>Returns the <see cref="Task"/>.</returns>
Task BuildRequestAsync(BaseRequest request);
}
} | 40.396552 | 122 | 0.620999 | [
"MIT"
] | devkimchi/EventSourcing-CQRS-Sample | src/EventSourcingCqrsSample.EventHandlers/IEventHandler.cs | 2,345 | C# |
namespace MAPIInspector.Parsers
{
using System;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows.Forms;
using System.Xml;
/// <summary>
/// String encoding enum
/// </summary>
public enum StringEncoding
{
/// <summary>
/// ASCII encoding
/// </summary>
ASCII,
/// <summary>
/// Unicode encoding
/// </summary>
Unicode
}
/// <summary>
/// BaseStructure class
/// </summary>
public abstract class BaseStructure
{
/// <summary>
/// Boolean value, if payload is compressed or obfuscated, value is true. otherwise, value is false.
/// </summary>
public static bool IsCompressedXOR = false;
/// <summary>
/// This field is for rgbOutputBuffer or ExtendedBuffer_Input in MAPIHTTP layer
/// </summary>
private static int compressBufferindex = 0;
/// <summary>
/// The stream to parse
/// </summary>
private Stream stream;
/// <summary>
/// The data type enum
/// </summary>
public enum DataType
{
/// <summary>
/// Binary type
/// </summary>
Binary,
/// <summary>
/// Boolean type
/// </summary>
Boolean,
/// <summary>
/// Byte type
/// </summary>
Byte,
/// <summary>
/// Char type
/// </summary>
Char,
/// <summary>
/// Double type
/// </summary>
Double,
/// <summary>
/// Decimal type
/// </summary>
Decimal,
/// <summary>
/// Single type
/// </summary>
Single,
/// <summary>
/// GUID type
/// </summary>
Guid,
/// <summary>
/// Int16 type
/// </summary>
Int16,
/// <summary>
/// Int32 type
/// </summary>
Int32,
/// <summary>
/// Int64 type
/// </summary>
Int64,
/// <summary>
/// SByte type
/// </summary>
SByte,
/// <summary>
/// String type
/// </summary>
String,
/// <summary>
/// UInt16 type
/// </summary>
UInt16,
/// <summary>
/// UInt32 type
/// </summary>
UInt32,
/// <summary>
/// UInt64 type
/// </summary>
UInt64,
/// <summary>
/// DateTime type
/// </summary>
DateTime
}
/// <summary>
/// Add the object to TreeNode and calculate the byte number it consumed
/// </summary>
/// <param name="obj">The object need to display in TreeView</param>
/// <param name="startIndex">The start position of the object in HexView</param>
/// <param name="offset">The byte number consumed by the object</param>
/// <returns>The TreeNode with object value information</returns>
public static TreeNode AddNodesForTree(object obj, int startIndex, out int offset)
{
Type t = obj.GetType();
int current = startIndex;
TreeNode res = new TreeNode(t.Name);
if (t.Name == "MAPIString")
{
int os = 0;
FieldInfo[] infoString = t.GetFields();
string terminator = (string)infoString[2].GetValue(obj);
TreeNode node = new TreeNode(string.Format("{0}:{1}", infoString[0].Name, infoString[0].GetValue(obj)));
// If the Encoding is Unicode.
if (infoString[1].GetValue(obj).ToString() == "System.Text.UnicodeEncoding")
{
// If the StringLength is not equal 0, the StringLength will be os value.
if (infoString[3].GetValue(obj).ToString() != "0")
{
os = ((int)infoString[3].GetValue(obj)) * 2;
}
else
{
if (infoString[0].GetValue(obj) != null)
{
os = ((string)infoString[0].GetValue(obj)).Length * 2;
}
if (infoString[4].GetValue(obj).ToString() != "False")
{
os -= 1;
}
os += terminator.Length * 2;
}
}
else
{
// If the Encoding is ASCII.
if (infoString[3].GetValue(obj).ToString() != "0")
{
// If the StringLength is not equal 0, the StringLength will be os value
os = (int)infoString[3].GetValue(obj);
}
else
{
if (infoString[0].GetValue(obj) != null)
{
os = ((string)infoString[0].GetValue(obj)).Length;
}
os += terminator.Length;
}
}
offset = os;
Position positionString = new Position(current, os);
node.Tag = positionString;
res.Nodes.Add(node);
return res;
}
else if (t.Name == "MAPIStringAddressBook")
{
FieldInfo[] infoString = t.GetFields();
// MagicByte node
if (infoString[1].GetValue(obj) != null)
{
TreeNode nodeMagic = new TreeNode(string.Format("{0}:{1}", infoString[1].Name, infoString[1].GetValue(obj)));
Position positionStringMagic = new Position(current, 1);
nodeMagic.Tag = positionStringMagic;
res.Nodes.Add(nodeMagic);
current += 1;
}
// value node
string terminator = (string)infoString[3].GetValue(obj);
int os = 0;
TreeNode node = new TreeNode(string.Format("{0}:{1}", infoString[0].Name, infoString[0].GetValue(obj)));
// If the Encoding is Unicode.
if (infoString[2].GetValue(obj).ToString() == "System.Text.UnicodeEncoding")
{
// If the StringLength is not equal 0, the StringLength will be OS value.
if (infoString[4].GetValue(obj).ToString() != "0")
{
os = ((int)infoString[4].GetValue(obj)) * 2;
}
else
{
if (infoString[0].GetValue(obj) != null)
{
os = ((string)infoString[0].GetValue(obj)).Length * 2;
}
if (infoString[5].GetValue(obj).ToString() != "False")
{
os -= 1;
}
os += terminator.Length * 2;
}
}
else
{
// If the Encoding is ASCII.
if (infoString[4].GetValue(obj).ToString() != "0")
{
// If the StringLength is not equal 0, the StringLength will be OS value.
os = (int)infoString[4].GetValue(obj);
}
else
{
if (infoString[0].GetValue(obj) != null)
{
os = ((string)infoString[0].GetValue(obj)).Length;
}
os += terminator.Length;
}
}
Position positionString = new Position(current, os);
node.Tag = positionString;
res.Nodes.Add(node);
if (infoString[1].GetValue(obj) != null)
{
offset = os + 1;
}
else
{
offset = os;
}
return res;
}
// Check whether the data type is simple type
if (Enum.IsDefined(typeof(DataType), t.Name))
{
throw new Exception("The method doesn't support handling simple data type.");
}
else
{
// If the data type is not simple type, we will loop each field, check the data type and then parse the value in different format
FieldInfo[] info = t.GetFields();
int bitLength = 0;
// The is only for FastTransfer stream parse, Polymorphic in PropValue and NamedPropInfo
if (obj is PropValue || obj is NamedPropInfo)
{
info = MoveFirstNFieldsBehind(info, info.Length - 2);
}
for (int i = 0; i < info.Length; i++)
{
int os = 0;
Type type = info[i].FieldType;
// If the field type is object type and its value is not null, set the field data type as details type (such as field A is Object (int/short) type, here setting it as int or short type)
if (type.Name == "Object" && info[i].GetValue(obj) != null)
{
type = info[i].GetValue(obj).GetType();
}
// If the field type is null-able simple data type (such as int?), set the field data type as basic data type (such as int in int?)
if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>))
{
type = type.GetGenericArguments()[0];
}
// Check whether the field data type is simple type:
// Boolean, Byte, Char, Double, Decimal,Single, GUID, Int16, Int32, Int64, SByte, String, UInt16, UInt32, UInt64, DateTime
// calculate each field's offset and length.
if (Enum.IsDefined(typeof(DataType), type.Name))
{
if (info[i].GetValue(obj) != null)
{
Type fieldType = type;
TreeNode tn = new TreeNode(string.Format("{0}:{1}", info[i].Name, info[i].GetValue(obj).ToString()));
res.Nodes.Add(tn);
if (type.Name == "UInt64")
{
if (info[i].GetCustomAttributesData().Count == 0)
{
os = 8;
}
else
{
object[] attributes = info[i].GetCustomAttributes(typeof(BytesAttribute), false);
os = (int)((BytesAttribute)attributes[0]).ByteLength;
}
}
else if (type.Name == "DateTime")
{
os = 8;
}
else if (type.Name == "Byte" && info[i].GetCustomAttributesData().Count != 0 && info[i].GetCustomAttributes(typeof(BitAttribute), false) != null)
{
// Check if it is bit.
BitAttribute attribute = (BitAttribute)info[i].GetCustomAttributes(typeof(BitAttribute), false)[0];
if (bitLength % 8 == 0)
{
os += 1;
}
else
{
current -= 1;
os += 1;
}
bitLength += attribute.BitLength;
}
else if (type.Name != "Boolean")
{
os = Marshal.SizeOf(fieldType);
}
else
{
os = sizeof(bool);
}
Position ps = new Position(current, os);
tn.Tag = ps;
current += os;
}
}
else if ((type.IsEnum && Enum.IsDefined(typeof(DataType), type.GetEnumUnderlyingType().Name)) && info[i].GetValue(obj) != null)
{
// Else if the field data type is enum data type, its underlying type is simple type and its value is not null, calculate each field's offset
// and length. There are two situations: one is string type, we should calculate it's actual length (via getting value); another one is calculating
// the size of underlying type of enum.
Type fieldType = type;
TreeNode tn = new TreeNode(string.Format("{0}:{1}", info[i].Name, EnumToString(info[i].GetValue(obj))));
res.Nodes.Add(tn);
if (type.Name == "String")
{
os = ((string)info[i].GetValue(obj)).Length;
}
else if (info[i].GetCustomAttributesData().Count != 0 && info[i].GetCustomAttributes(typeof(BitAttribute), false) != null)
{
// Modify the bit OS for the NotificationFlagsT in MSOXCNOTIF
BitAttribute attribute = (BitAttribute)info[i].GetCustomAttributes(typeof(BitAttribute), false)[0];
if (bitLength % 8 != 0)
{
current -= 1;
}
if (attribute.BitLength % 8 == 0)
{
os += attribute.BitLength / 8;
}
else
{
os += (attribute.BitLength / 8) + 1;
}
bitLength += attribute.BitLength;
}
else
{
os = Marshal.SizeOf(fieldType.GetEnumUnderlyingType());
}
Position ps = new Position(current, os);
tn.Tag = ps;
current += os;
}
else if (type.IsArray)
{
// If the field type is array, there are two properties need to know: optional or required, array element data type is simple or complex
// Field value considered: empty, null or value type displaying when not null/empty
// Getting the element type for required and optional array value
Type elementType = type.GetElementType();
if (!type.IsValueType && type.GetGenericArguments().Length > 0)
{
elementType = type.GetGenericArguments()[0];
}
// If the element type is simple data type, displaying the array in one line with string format.
if (Enum.IsDefined(typeof(DataType), elementType.Name))
{
Array arr = (Array)info[i].GetValue(obj);
if (arr != null && arr.Length != 0)
{
StringBuilder result = new StringBuilder();
// it the field is 6 bytes, updated the display text.
if (arr.Length == 6 && arr.GetType().ToString() == "System.Byte[]" && info[i].Name == "GlobalCounter")
{
byte[] tempbytes = (byte[])info[i].GetValue(obj);
result.Append("0x");
foreach (byte tempbye in tempbytes)
{
result.Append(tempbye.ToString("X2"));
}
}
else
{
// Array type just display the first 30 values if the array length is more than 30.
int displayLength = 30;
result.Append("[");
foreach (var ar in arr)
{
result.Append(ar.ToString() + ",");
if (displayLength <= 1)
{
result.Insert(result.Length - 1, "...");
break;
}
displayLength--;
}
result.Remove(result.Length - 1, 1);
result.Append("]");
}
TreeNode tn = new TreeNode(string.Format("{0}:{1}", info[i].Name, result.ToString()));
res.Nodes.Add(tn);
for (int j = 0; j < arr.Length; j++)
{
os += Marshal.SizeOf(elementType);
}
Position ps = new Position(current, os);
tn.Tag = ps;
current += os;
}
}
else
{
// Else if the element data type is not simple type, here will consider array type and complex type
Array arr = (Array)info[i].GetValue(obj);
object[] a = (object[])arr;
if (arr != null && arr.Length != 0)
{
string fieldNameForAut = info[i].Name;
TreeNode treeNodeArray = new TreeNode(info[i].Name);
TreeNode tn = new TreeNode();
int arros = 0;
if (fieldNameForAut == "RgbOutputBuffers" || fieldNameForAut == "buffers")
{
compressBufferindex = 0;
}
for (int k = 0; k < arr.Length; k++)
{
if (a[k] != null)
{
// If the item in array contains array (byte or other simple type), display the value in one line and set the offset and length.
if (a[k].GetType().IsArray && a[k].GetType().GetElementType().Name == "Byte")
{
StringBuilder result = new StringBuilder("[");
Position ps;
foreach (var ar in (byte[])a[k])
{
result.Append(ar.ToString() + ",");
}
result.Remove(result.Length - 1, 1);
result.Append("]");
if (arr.Length == 1)
{
tn = new TreeNode(string.Format("{0}:{1}", info[i].Name, result.ToString()));
os = ((byte[])a[k]).Length;
ps = new Position(current, os);
tn.Tag = ps;
}
else
{
tn = new TreeNode(string.Format("{0}:{1}", info[i].Name, result.ToString()));
treeNodeArray.Nodes.Add(tn);
os = ((byte[])a[k]).Length;
ps = new Position(current, os);
tn.Tag = ps;
}
os = ((byte[])a[k]).Length;
ps = new Position(current, os);
treeNodeArray.Tag = ps;
}
else
{
// If the item in array is complex type, loop call the function to add it to tree.
// compressBufferindex is used to recored the rgbOutputBuffer or ExtendedBuffer_Input number here
if (a.GetType().Name == "RgbOutputBuffer[]" || a.GetType().Name == "ExtendedBuffer_Input[]")
{
compressBufferindex += 1;
}
tn = AddNodesForTree(a[k], current, out os);
treeNodeArray.Nodes.Add(tn);
Position ps = new Position(current, os);
tn.Tag = ps;
}
}
current += os;
arros += os;
}
Position pss = new Position(current - arros, arros);
treeNodeArray.Tag = pss;
res.Nodes.Add(treeNodeArray);
}
}
}
else
{
// If the field type is complex type, loop call the function until finding its data type.
if (info[i].GetValue(obj) != null)
{
string fieldName = info[i].Name;
TreeNode node = new TreeNode();
// The below logical is used to check whether the payload is compressed or XOR.
if (fieldName == "RPCHEADEREXT")
{
if (((ushort)((RPC_HEADER_EXT)info[i].GetValue(obj)).Flags & 0x0002) == (ushort)RpcHeaderFlags.XorMagic
|| ((ushort)((RPC_HEADER_EXT)info[i].GetValue(obj)).Flags & 0x0001) == (ushort)RpcHeaderFlags.Compressed)
{
IsCompressedXOR = true;
}
else
{
IsCompressedXOR = false;
}
}
// If the field name is Payload and its compressed, recalculating the offset and length, else directly loop call this function
if (fieldName == "Payload" && IsCompressedXOR)
{
RPC_HEADER_EXT header = (RPC_HEADER_EXT)info[0].GetValue(obj);
node = AddNodesForTree(info[i].GetValue(obj), current, out os);
Position postion = (Position)node.Tag;
postion.Offset = header.Size;
os = postion.Offset;
node.Tag = postion;
fieldName = "Payload(CompressedOrObfuscated)";
node.Text = fieldName;
node = TreeNodeForCompressed(node, current, compressBufferindex - 1);
}
else
{
if (fieldName == "Payload")
{
// minus the Payload is not in compressed
compressBufferindex -= 1;
}
node = AddNodesForTree(info[i].GetValue(obj), current, out os);
}
// Add the specific type(FastTransfer stream type) for TransferBuffer and TransferData fields.
if (fieldName == "TransferBuffer" || fieldName == "TransferData")
{
fieldName = string.Format(fieldName + ": " + info[i].GetValue(obj).GetType().Name);
}
node.Text = fieldName;
res.Nodes.Add(node);
current += os;
}
}
}
}
offset = current - startIndex;
Position position = new Position(startIndex, offset);
res.Tag = position;
return res;
}
/// <summary>
/// Modify the start index for the TreeNode which source data is compressed
/// </summary>
/// <param name="node">The node in compressed buffers</param>
/// <param name="current">Indicates start position of the node</param>
/// <param name="compressBufferindex">Indicates the index of this node in all compressed buffers in same session</param>
/// <param name="isAux">Indicates whether the buffer which this node are in is auxiliary</param>
/// <returns>The tree node with BufferIndex and IsCompressedXOR properties </returns>
public static TreeNode TreeNodeForCompressed(TreeNode node, int current, int compressBufferindex, bool isAux = false)
{
foreach (TreeNode n in node.Nodes)
{
TreeNode nd = n;
if (nd.Tag != null)
{
((Position)nd.Tag).IsCompressedXOR = true;
((Position)nd.Tag).StartIndex -= current;
((Position)nd.Tag).BufferIndex = compressBufferindex;
}
if (nd.Nodes.Count != 0)
{
TreeNodeForCompressed(nd, current, compressBufferindex, isAux);
}
}
return node;
}
/// <summary>
/// Moving the number of fields in FieldInfo from beginning to the end
/// </summary>
/// <param name="field">The parent field</param>
/// <param name="n">The number of fields need moved</param>
/// <returns>FieldInfo value field</returns>
public static FieldInfo[] MoveFirstNFieldsBehind(FieldInfo[] field, int n)
{
FieldInfo[] newField = new FieldInfo[field.Length];
if (n < 0 || n > field.Length)
{
throw new InvalidOperationException(string.Format("Moving Failed because the length ({0}) need to move is exceeded the fields' length ({1}).", n, field.Length));
}
else
{
int i = 0;
for (; i < field.Length - n; i++)
{
newField[i] = field[n + i];
}
for (; i < field.Length; i++)
{
newField[i] = field[i - (field.Length - n)];
}
return newField;
}
}
/// <summary>
/// Parse stream to specific message
/// </summary>
/// <param name="s">Stream to parse</param>
public virtual void Parse(Stream s)
{
this.stream = s;
}
/// <summary>
/// Override the ToString method to return empty.
/// </summary>
/// <returns>Empty string value</returns>
public override string ToString()
{
return string.Empty;
}
/// <summary>
/// Read bits value from byte
/// </summary>
/// <param name="b">The byte.</param>
/// <param name="index">The bit index to read</param>
/// <param name="length">The bit length to read</param>
/// <returns>bits value</returns>
public byte GetBits(byte b, int index, int length)
{
int bit = 0;
int tempBit = 0;
if ((index >= 8) || (length > 8))
{
throw new Exception("The range for index or length should be 0~7.");
}
for (int i = 0; i < length; i++)
{
tempBit = ((b & (1 << (7 - index - i))) > 0) ? 1 : 0;
bit = (bit << 1) | tempBit;
}
return (byte)bit;
}
/// <summary>
/// Convert an array T to array T?
/// </summary>
/// <typeparam name="T">The type used to convert</typeparam>
/// <param name="array">the special type of array value used to convert</param>
/// <returns>A special type null-able list</returns>
public T?[] ConvertArray<T>(T[] array) where T : struct
{
T?[] nullableArray = new T?[array.Length];
for (int i = 0; i < array.Length; i++)
{
nullableArray[i] = array[i];
}
return nullableArray;
}
/// <summary>
/// Convert a value to PropertyDataType
/// </summary>
/// <param name="typeValue">The type value</param>
/// <returns>PropertyDataType type</returns>
public PropertyDataType ConvertToPropType(ushort typeValue)
{
return (PropertyDataType)(typeValue & (ushort)~PropertyDataTypeFlag.MultivalueInstance);
}
/// <summary>
/// Read an Int16 value from stream
/// </summary>
/// <returns>An Int16 value</returns>
protected short ReadINT16()
{
int value;
int b1, b2;
b1 = this.ReadByte();
b2 = this.ReadByte();
value = (b2 << 8) | b1;
return (short)value;
}
/// <summary>
/// Read an Int32 value from stream
/// </summary>
/// <returns>An Int32 value</returns>
protected int ReadINT32()
{
long value;
int b1, b2, b3, b4;
b1 = this.ReadByte();
b2 = this.ReadByte();
b3 = this.ReadByte();
b4 = this.ReadByte();
value = (b4 << 24) | (b3 << 16) | (b2 << 8) | b1;
return (int)value;
}
/// <summary>
/// Read an long value from stream
/// </summary>
/// <returns>An long value</returns>
protected long ReadINT64()
{
long low = this.ReadINT32();
long high = this.ReadINT32();
// 0x100000000 is 2 raised to the 32th power plus 1
return (long)((high << 32) | low);
}
/// <summary>
/// Read an Boolean value from stream
/// </summary>
/// <returns>An Boolean value</returns>
protected bool ReadBoolean()
{
return this.ReadByte() != 0x00;
}
/// <summary>
/// Read a byte value from stream
/// </summary>
/// <returns>A byte</returns>
protected byte ReadByte()
{
int value = this.stream.ReadByte();
if (value == -1)
{
throw new Exception();
}
return (byte)value;
}
/// <summary>
/// Read a GUID value from stream
/// </summary>
/// <returns>A GUID value</returns>
protected Guid ReadGuid()
{
Guid guid = new Guid(this.ReadBytes(16));
if (guid == null)
{
throw new Exception();
}
return guid;
}
/// <summary>
/// Read an UShort value from stream
/// </summary>
/// <returns>An UShort value</returns>
protected ushort ReadUshort()
{
int value;
int b1, b2;
b1 = this.ReadByte();
b2 = this.ReadByte();
value = (b2 << 8) | b1;
return (ushort)value;
}
/// <summary>
/// Read an UInt value from stream
/// </summary>
/// <returns>An UInt value</returns>
protected uint ReadUint()
{
long value;
int b1, b2, b3, b4;
b1 = this.ReadByte();
b2 = this.ReadByte();
b3 = this.ReadByte();
b4 = this.ReadByte();
value = (b4 << 24) | (b3 << 16) | (b2 << 8) | b1;
return (uint)value;
}
/// <summary>
/// Read an uLong value from stream
/// </summary>
/// <returns>An uLong value</returns>
protected ulong ReadUlong()
{
long low = (uint)this.ReadUint();
long high = (uint)this.ReadUint();
return (ulong)(high << 32 | low);
}
/// <summary>
/// Read string value from stream according to string terminator and Encoding method
/// </summary>
/// <param name="encoding">The character Encoding</param>
/// <param name="terminator">The string terminator</param>
/// <param name="stringlength">The string length.</param>
/// <param name="reducedUnicode">True means reduced Unicode character string. The terminating null character is one zero byte.</param>
/// <returns>A string value</returns>
protected string ReadString(Encoding encoding, string terminator = "\0", int stringlength = 0, bool reducedUnicode = false)
{
string result = null;
StringBuilder value = new StringBuilder();
if (stringlength == 0)
{
int length = terminator.Length;
bool terminated = false;
// Read Null-terminated reduced Unicode character string. The terminating null character is one zero byte.
if (encoding == Encoding.Unicode && reducedUnicode)
{
while (!terminated)
{
byte[] tempbytes = new byte[2];
tempbytes[0] = this.ReadByte();
if (Encoding.ASCII.GetChars(tempbytes, 0, 1)[0].ToString() == "\0")
{
terminated = true;
break;
}
tempbytes[1] = this.ReadByte();
char[] chars = Encoding.Unicode.GetChars(tempbytes, 0, 2);
value.Append(chars);
}
result = value.ToString();
}
else
{
while (!terminated)
{
value.Append(this.ReadChar(encoding));
if (value.Length < length)
{
continue;
}
int i;
for (i = length - 1; i >= 0; i--)
{
if (terminator[i] != value[value.Length - length + i])
{
break;
}
}
terminated = i < 0;
}
result = value.Remove(value.Length - length, length).ToString();
}
}
else
{
int size = stringlength;
while (size != 0)
{
value.Append(this.ReadChar(encoding));
size--;
}
result = value.ToString();
}
return result;
}
/// <summary>
/// Read bytes from stream
/// </summary>
/// <param name="length">The byte length to read</param>
/// <returns>Bytes value</returns>
protected byte[] ReadBytes(int length)
{
byte[] bytes = new byte[length];
int count = this.stream.Read(bytes, 0, length);
if (count != length)
{
throw new Exception();
}
return bytes;
}
/// <summary>
/// Read character from stream
/// </summary>
/// <param name="encoding">The text encoding</param>
/// <returns>A char value</returns>
protected char ReadChar(Encoding encoding)
{
int length = encoding.GetMaxByteCount(1);
byte[] bytes = new byte[length];
int count = this.stream.Read(bytes, 0, length);
if (count == -1)
{
throw new Exception();
}
char[] chars = encoding.GetChars(bytes, 0, count);
length = encoding.GetByteCount(chars, 0, 1);
if (length < count)
{
this.stream.Seek(length - count, SeekOrigin.Current);
}
return chars[0];
}
/// <summary>
/// Converts a simple (non-flag) enum to string. If the value is not present in the underlying enum, converts to a hex string.
/// </summary>
/// <param name="obj"></param>
/// <returns></returns>
private static string EnumToString(object obj)
{
if (Enum.IsDefined(obj.GetType(), obj))
{
return obj.ToString();
}
else
{
return $"0x{Convert.ToUInt64(obj):X}";
}
}
/// <summary>
/// Record start position and byte counts consumed
/// </summary>
public class Position
{
/// <summary>
/// Int value specifies field start position
/// </summary>
public int StartIndex;
/// <summary>
/// Int value specifies field length
/// </summary>
public int Offset;
/// <summary>
/// Boolean value specifies if field is in the compressed payload
/// </summary>
public bool IsCompressedXOR;
/// <summary>
/// Boolean value specifies if field is in the auxiliary payload
/// </summary>
public bool IsAuxiliayPayload;
/// <summary>
/// Int value specifies the buffer index of a field
/// </summary>
public int BufferIndex = 0;
/// <summary>
/// Initializes a new instance of the Position class
/// </summary>
/// <param name="startIndex">The start position of field</param>
/// <param name="offset">The Length of field </param>
public Position(int startIndex, int offset)
{
this.StartIndex = startIndex;
this.Offset = offset;
this.IsAuxiliayPayload = false;
}
}
}
/// <summary>
/// Custom attribute for bit length
/// </summary>
[AttributeUsage(AttributeTargets.All)]
public class BitAttribute : System.Attribute
{
/// <summary>
/// Specify the length in bit
/// </summary>
public readonly int BitLength;
/// <summary>
/// Initializes a new instance of the BitAttribute class
/// </summary>
/// <param name="bitLength">Specify the length in bit </param>
public BitAttribute(int bitLength)
{
this.BitLength = bitLength;
}
}
/// <summary>
/// Custom attribute for bytes length
/// </summary>
[AttributeUsage(AttributeTargets.All)]
public class BytesAttribute : System.Attribute
{
/// <summary>
/// Specify the length in byte
/// </summary>
public readonly uint ByteLength;
/// <summary>
/// Initializes a new instance of the BytesAttribute class
/// </summary>
/// <param name="byteLength">Specify the length in byte </param>
public BytesAttribute(uint byteLength)
{
this.ByteLength = byteLength;
}
}
} | 38.680494 | 206 | 0.392242 | [
"MIT"
] | SmarterTools/Office-Inspectors-for-Fiddler | MAPIInspector/Source/Parsers/BaseStructure.cs | 43,827 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using LinqToDB.Mapping;
namespace AddressbookWebTests
{
[Table(Name = "address_in_groups")]
public class GroupContactRelation
{
[Column(Name = "group_id")]
public string GroupId { get; set; }
[Column(Name = "id")]
public string ContactId { get; set; }
}
}
| 21.15 | 45 | 0.666667 | [
"Apache-2.0"
] | Vegard1666/Testcases | addressbook-web-tests/addressbook-web-tests/Model/GroupContactRelation.cs | 425 | C# |
using System;
using Abp;
using Abp.Authorization;
using Abp.Dependency;
using Abp.UI;
namespace Volo.SqliteDemo.Authorization
{
public class AbpLoginResultTypeHelper : AbpServiceBase, ITransientDependency
{
public AbpLoginResultTypeHelper()
{
LocalizationSourceName = SqliteDemoConsts.LocalizationSourceName;
}
public Exception CreateExceptionForFailedLoginAttempt(AbpLoginResultType result, string usernameOrEmailAddress, string tenancyName)
{
switch (result)
{
case AbpLoginResultType.Success:
return new Exception("Don't call this method with a success result!");
case AbpLoginResultType.InvalidUserNameOrEmailAddress:
case AbpLoginResultType.InvalidPassword:
return new UserFriendlyException(L("LoginFailed"), L("InvalidUserNameOrPassword"));
case AbpLoginResultType.InvalidTenancyName:
return new UserFriendlyException(L("LoginFailed"), L("ThereIsNoTenantDefinedWithName{0}", tenancyName));
case AbpLoginResultType.TenantIsNotActive:
return new UserFriendlyException(L("LoginFailed"), L("TenantIsNotActive", tenancyName));
case AbpLoginResultType.UserIsNotActive:
return new UserFriendlyException(L("LoginFailed"), L("UserIsNotActiveAndCanNotLogin", usernameOrEmailAddress));
case AbpLoginResultType.UserEmailIsNotConfirmed:
return new UserFriendlyException(L("LoginFailed"), L("UserEmailIsNotConfirmedAndCanNotLogin"));
case AbpLoginResultType.LockedOut:
return new UserFriendlyException(L("LoginFailed"), L("UserLockedOutMessage"));
default: // Can not fall to default actually. But other result types can be added in the future and we may forget to handle it
Logger.Warn("Unhandled login fail reason: " + result);
return new UserFriendlyException(L("LoginFailed"));
}
}
public string CreateLocalizedMessageForFailedLoginAttempt(AbpLoginResultType result, string usernameOrEmailAddress, string tenancyName)
{
switch (result)
{
case AbpLoginResultType.Success:
throw new Exception("Don't call this method with a success result!");
case AbpLoginResultType.InvalidUserNameOrEmailAddress:
case AbpLoginResultType.InvalidPassword:
return L("InvalidUserNameOrPassword");
case AbpLoginResultType.InvalidTenancyName:
return L("ThereIsNoTenantDefinedWithName{0}", tenancyName);
case AbpLoginResultType.TenantIsNotActive:
return L("TenantIsNotActive", tenancyName);
case AbpLoginResultType.UserIsNotActive:
return L("UserIsNotActiveAndCanNotLogin", usernameOrEmailAddress);
case AbpLoginResultType.UserEmailIsNotConfirmed:
return L("UserEmailIsNotConfirmedAndCanNotLogin");
default: // Can not fall to default actually. But other result types can be added in the future and we may forget to handle it
Logger.Warn("Unhandled login fail reason: " + result);
return L("LoginFailed");
}
}
}
}
| 53.384615 | 143 | 0.645533 | [
"MIT"
] | OzBob/aspnetboilerplate-samples | SqliteDemo/aspnet-core/src/Volo.SqliteDemo.Application/Authorization/AbpLoginResultTypeHelper.cs | 3,472 | C# |
namespace MassTransit.StructureMapIntegration.ScopeProviders
{
using GreenPipes;
using StructureMap;
static class InternalScopeExtensions
{
public static void UpdatePayload(this PipeContext context, IContainer container)
{
context.AddOrUpdatePayload(() => container, existing => container);
}
}
}
| 23.666667 | 88 | 0.687324 | [
"ECL-2.0",
"Apache-2.0"
] | Aerodynamite/MassTrans | src/Containers/MassTransit.StructureMapIntegration/ScopeProviders/InternalScopeExtensions.cs | 355 | C# |
using J2N.Text;
using System;
using System.Runtime.CompilerServices;
namespace YAF.Lucene.Net.Index
{
/*
* 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 DocValuesConsumer = YAF.Lucene.Net.Codecs.DocValuesConsumer;
using Similarity = YAF.Lucene.Net.Search.Similarities.Similarity;
internal sealed class NormsConsumerPerField : InvertedDocEndConsumerPerField, IComparable<NormsConsumerPerField>
{
private readonly FieldInfo fieldInfo;
private readonly DocumentsWriterPerThread.DocState docState;
private readonly Similarity similarity;
private readonly FieldInvertState fieldState;
private NumericDocValuesWriter consumer;
public NormsConsumerPerField(DocInverterPerField docInverterPerField, FieldInfo fieldInfo /*, NormsConsumer parent // LUCENENET: Not referenced */)
{
this.fieldInfo = fieldInfo;
docState = docInverterPerField.docState;
fieldState = docInverterPerField.fieldState;
similarity = docState.similarity;
}
public int CompareTo(NormsConsumerPerField other)
{
return fieldInfo.Name.CompareToOrdinal(other.fieldInfo.Name);
}
internal override void Finish()
{
if (fieldInfo.IsIndexed && !fieldInfo.OmitsNorms)
{
if (consumer == null)
{
fieldInfo.NormType = DocValuesType.NUMERIC;
consumer = new NumericDocValuesWriter(fieldInfo, docState.docWriter.bytesUsed, false);
}
consumer.AddValue(docState.docID, similarity.ComputeNorm(fieldState));
}
}
[MethodImpl(MethodImplOptions.NoInlining)]
internal void Flush(SegmentWriteState state, DocValuesConsumer normsWriter)
{
int docCount = state.SegmentInfo.DocCount;
if (consumer == null)
{
return; // null type - not omitted but not written -
// meaning the only docs that had
// norms hit exceptions (but indexed=true is set...)
}
consumer.Finish(docCount);
consumer.Flush(state, normsWriter);
}
internal bool IsEmpty => consumer == null;
[MethodImpl(MethodImplOptions.NoInlining)]
internal override void Abort()
{
//
}
}
} | 40.084337 | 156 | 0.629696 | [
"Apache-2.0"
] | 10by10pixel/YAFNET | yafsrc/Lucene.Net/Lucene.Net/Index/NormsConsumerPerField.cs | 3,245 | C# |
using System;
namespace Smartling.Api.Exceptions
{
public class MaintenanceModeException : SmartlingApiException
{
public MaintenanceModeException(string message, Exception innerException) : base(message, innerException)
{
}
}
} | 22.454545 | 109 | 0.765182 | [
"Apache-2.0"
] | Smartling/api-sdk-net | Smartling.API/Exceptions/MaintenanceModeException.cs | 247 | C# |
//------------------------------------------------------------------------------
// <auto-generated />
//
// This file was automatically generated by SWIG (http://www.swig.org).
// Version 4.0.2
//
// Do not make changes to this file unless you know what you are doing--modify
// the SWIG interface file instead.
//------------------------------------------------------------------------------
namespace sttp {
public class GuidCollection : global::System.IDisposable, global::System.Collections.IEnumerable, global::System.Collections.Generic.IEnumerable<System.Guid>
{
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
protected bool swigCMemOwn;
internal GuidCollection(global::System.IntPtr cPtr, bool cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
}
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(GuidCollection obj) {
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
}
~GuidCollection() {
Dispose(false);
}
public void Dispose() {
Dispose(true);
global::System.GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing) {
lock(this) {
if (swigCPtr.Handle != global::System.IntPtr.Zero) {
if (swigCMemOwn) {
swigCMemOwn = false;
CommonPINVOKE.delete_GuidCollection(swigCPtr);
}
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
}
}
}
public GuidCollection(global::System.Collections.IEnumerable c) : this() {
if (c == null)
throw new global::System.ArgumentNullException("c");
foreach (System.Guid element in c) {
this.Add(element);
}
}
public GuidCollection(global::System.Collections.Generic.IEnumerable<System.Guid> c) : this() {
if (c == null)
throw new global::System.ArgumentNullException("c");
foreach (System.Guid element in c) {
this.Add(element);
}
}
public bool IsFixedSize {
get {
return false;
}
}
public bool IsReadOnly {
get {
return false;
}
}
public System.Guid this[int index] {
get {
return getitem(index);
}
set {
setitem(index, value);
}
}
public int Capacity {
get {
return (int)capacity();
}
set {
if (value < size())
throw new global::System.ArgumentOutOfRangeException("Capacity");
reserve((uint)value);
}
}
public int Count {
get {
return (int)size();
}
}
public bool IsSynchronized {
get {
return false;
}
}
public void CopyTo(System.Guid[] array)
{
CopyTo(0, array, 0, this.Count);
}
public void CopyTo(System.Guid[] array, int arrayIndex)
{
CopyTo(0, array, arrayIndex, this.Count);
}
public void CopyTo(int index, System.Guid[] array, int arrayIndex, int count)
{
if (array == null)
throw new global::System.ArgumentNullException("array");
if (index < 0)
throw new global::System.ArgumentOutOfRangeException("index", "Value is less than zero");
if (arrayIndex < 0)
throw new global::System.ArgumentOutOfRangeException("arrayIndex", "Value is less than zero");
if (count < 0)
throw new global::System.ArgumentOutOfRangeException("count", "Value is less than zero");
if (array.Rank > 1)
throw new global::System.ArgumentException("Multi dimensional array.", "array");
if (index+count > this.Count || arrayIndex+count > array.Length)
throw new global::System.ArgumentException("Number of elements to copy is too large.");
for (int i=0; i<count; i++)
array.SetValue(getitemcopy(index+i), arrayIndex+i);
}
public System.Guid[] ToArray() {
System.Guid[] array = new System.Guid[this.Count];
this.CopyTo(array);
return array;
}
global::System.Collections.Generic.IEnumerator<System.Guid> global::System.Collections.Generic.IEnumerable<System.Guid>.GetEnumerator() {
return new GuidCollectionEnumerator(this);
}
global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() {
return new GuidCollectionEnumerator(this);
}
public GuidCollectionEnumerator GetEnumerator() {
return new GuidCollectionEnumerator(this);
}
// Type-safe enumerator
/// Note that the IEnumerator documentation requires an InvalidOperationException to be thrown
/// whenever the collection is modified. This has been done for changes in the size of the
/// collection but not when one of the elements of the collection is modified as it is a bit
/// tricky to detect unmanaged code that modifies the collection under our feet.
public sealed class GuidCollectionEnumerator : global::System.Collections.IEnumerator
, global::System.Collections.Generic.IEnumerator<System.Guid>
{
private GuidCollection collectionRef;
private int currentIndex;
private object currentObject;
private int currentSize;
public GuidCollectionEnumerator(GuidCollection collection) {
collectionRef = collection;
currentIndex = -1;
currentObject = null;
currentSize = collectionRef.Count;
}
// Type-safe iterator Current
public System.Guid Current {
get {
if (currentIndex == -1)
throw new global::System.InvalidOperationException("Enumeration not started.");
if (currentIndex > currentSize - 1)
throw new global::System.InvalidOperationException("Enumeration finished.");
if (currentObject == null)
throw new global::System.InvalidOperationException("Collection modified.");
return (System.Guid)currentObject;
}
}
// Type-unsafe IEnumerator.Current
object global::System.Collections.IEnumerator.Current {
get {
return Current;
}
}
public bool MoveNext() {
int size = collectionRef.Count;
bool moveOkay = (currentIndex+1 < size) && (size == currentSize);
if (moveOkay) {
currentIndex++;
currentObject = collectionRef[currentIndex];
} else {
currentObject = null;
}
return moveOkay;
}
public void Reset() {
currentIndex = -1;
currentObject = null;
if (collectionRef.Count != currentSize) {
throw new global::System.InvalidOperationException("Collection modified.");
}
}
public void Dispose() {
currentIndex = -1;
currentObject = null;
}
}
public void Clear() {
CommonPINVOKE.GuidCollection_Clear(swigCPtr);
if (CommonPINVOKE.SWIGPendingException.Pending) throw CommonPINVOKE.SWIGPendingException.Retrieve();
}
public void Add(System.Guid x) {
guid_t tempx = Common.ParseGuid(x.ToByteArray(), true);
{
CommonPINVOKE.GuidCollection_Add(swigCPtr, guid_t.getCPtr(tempx));
if (CommonPINVOKE.SWIGPendingException.Pending) throw CommonPINVOKE.SWIGPendingException.Retrieve();
}
}
private uint size() {
uint ret = CommonPINVOKE.GuidCollection_size(swigCPtr);
if (CommonPINVOKE.SWIGPendingException.Pending) throw CommonPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
private uint capacity() {
uint ret = CommonPINVOKE.GuidCollection_capacity(swigCPtr);
if (CommonPINVOKE.SWIGPendingException.Pending) throw CommonPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
private void reserve(uint n) {
CommonPINVOKE.GuidCollection_reserve(swigCPtr, n);
if (CommonPINVOKE.SWIGPendingException.Pending) throw CommonPINVOKE.SWIGPendingException.Retrieve();
}
public GuidCollection() : this(CommonPINVOKE.new_GuidCollection__SWIG_0(), true) {
if (CommonPINVOKE.SWIGPendingException.Pending) throw CommonPINVOKE.SWIGPendingException.Retrieve();
}
public GuidCollection(GuidCollection other) : this(CommonPINVOKE.new_GuidCollection__SWIG_1(GuidCollection.getCPtr(other)), true) {
if (CommonPINVOKE.SWIGPendingException.Pending) throw CommonPINVOKE.SWIGPendingException.Retrieve();
}
public GuidCollection(int capacity) : this(CommonPINVOKE.new_GuidCollection__SWIG_2(capacity), true) {
if (CommonPINVOKE.SWIGPendingException.Pending) throw CommonPINVOKE.SWIGPendingException.Retrieve();
}
private System.Guid getitemcopy(int index) {
global::System.IntPtr cPtr = CommonPINVOKE.GuidCollection_getitemcopy(swigCPtr, index);
if (CommonPINVOKE.SWIGPendingException.Pending) throw CommonPINVOKE.SWIGPendingException.Retrieve();
using (guid_t tempGuid = (cPtr == global::System.IntPtr.Zero) ? null : new guid_t(cPtr, false)) {
byte[] data = new byte[16];
Common.GetGuidBytes(tempGuid, data);
return new System.Guid(data);
}
}
private System.Guid getitem(int index) {
global::System.IntPtr cPtr = CommonPINVOKE.GuidCollection_getitem(swigCPtr, index);
if (CommonPINVOKE.SWIGPendingException.Pending) throw CommonPINVOKE.SWIGPendingException.Retrieve();
using (guid_t tempGuid = (cPtr == global::System.IntPtr.Zero) ? null : new guid_t(cPtr, false)) {
byte[] data = new byte[16];
Common.GetGuidBytes(tempGuid, data);
return new System.Guid(data);
}
}
private void setitem(int index, System.Guid val) {
guid_t tempval = Common.ParseGuid(val.ToByteArray(), true);
{
CommonPINVOKE.GuidCollection_setitem(swigCPtr, index, guid_t.getCPtr(tempval));
if (CommonPINVOKE.SWIGPendingException.Pending) throw CommonPINVOKE.SWIGPendingException.Retrieve();
}
}
public void AddRange(GuidCollection values) {
CommonPINVOKE.GuidCollection_AddRange(swigCPtr, GuidCollection.getCPtr(values));
if (CommonPINVOKE.SWIGPendingException.Pending) throw CommonPINVOKE.SWIGPendingException.Retrieve();
}
public GuidCollection GetRange(int index, int count) {
global::System.IntPtr cPtr = CommonPINVOKE.GuidCollection_GetRange(swigCPtr, index, count);
GuidCollection ret = (cPtr == global::System.IntPtr.Zero) ? null : new GuidCollection(cPtr, true);
if (CommonPINVOKE.SWIGPendingException.Pending) throw CommonPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
public void Insert(int index, System.Guid x) {
guid_t tempx = Common.ParseGuid(x.ToByteArray(), true);
{
CommonPINVOKE.GuidCollection_Insert(swigCPtr, index, guid_t.getCPtr(tempx));
if (CommonPINVOKE.SWIGPendingException.Pending) throw CommonPINVOKE.SWIGPendingException.Retrieve();
}
}
public void InsertRange(int index, GuidCollection values) {
CommonPINVOKE.GuidCollection_InsertRange(swigCPtr, index, GuidCollection.getCPtr(values));
if (CommonPINVOKE.SWIGPendingException.Pending) throw CommonPINVOKE.SWIGPendingException.Retrieve();
}
public void RemoveAt(int index) {
CommonPINVOKE.GuidCollection_RemoveAt(swigCPtr, index);
if (CommonPINVOKE.SWIGPendingException.Pending) throw CommonPINVOKE.SWIGPendingException.Retrieve();
}
public void RemoveRange(int index, int count) {
CommonPINVOKE.GuidCollection_RemoveRange(swigCPtr, index, count);
if (CommonPINVOKE.SWIGPendingException.Pending) throw CommonPINVOKE.SWIGPendingException.Retrieve();
}
public static GuidCollection Repeat(System.Guid value, int count) {
guid_t tempvalue = Common.ParseGuid(value.ToByteArray(), true);
{
global::System.IntPtr cPtr = CommonPINVOKE.GuidCollection_Repeat(guid_t.getCPtr(tempvalue), count);
GuidCollection ret = (cPtr == global::System.IntPtr.Zero) ? null : new GuidCollection(cPtr, true);
if (CommonPINVOKE.SWIGPendingException.Pending) throw CommonPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
}
public void Reverse() {
CommonPINVOKE.GuidCollection_Reverse__SWIG_0(swigCPtr);
if (CommonPINVOKE.SWIGPendingException.Pending) throw CommonPINVOKE.SWIGPendingException.Retrieve();
}
public void Reverse(int index, int count) {
CommonPINVOKE.GuidCollection_Reverse__SWIG_1(swigCPtr, index, count);
if (CommonPINVOKE.SWIGPendingException.Pending) throw CommonPINVOKE.SWIGPendingException.Retrieve();
}
public void SetRange(int index, GuidCollection values) {
CommonPINVOKE.GuidCollection_SetRange(swigCPtr, index, GuidCollection.getCPtr(values));
if (CommonPINVOKE.SWIGPendingException.Pending) throw CommonPINVOKE.SWIGPendingException.Retrieve();
}
}
}
| 35.342776 | 157 | 0.702148 | [
"MIT"
] | sttp/dotnetcoreapi | src/lib/sttp.net/GuidCollection.cs | 12,476 | C# |
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class WobbleEffect : MonoBehaviour {
public IEnumerator wobble;
private float targetScale;
private float deltaScale;
private float growFactor;
private float maxScale;
private float minScale;
void SetValues()
{
targetScale = Database.constants_faceComponentScale;
deltaScale = Database.constants_wobbleDeltaScale;
growFactor = Database.constants_wobbleGrowFactor;
maxScale = targetScale + deltaScale;
minScale = targetScale - deltaScale;
}
public void StartWobble()
{
SetValues();
wobble = Wobble(maxScale, minScale, targetScale, growFactor);
StartCoroutine(wobble);
}
public void StopWobble()
{
StopCoroutine(wobble);
transform.localScale = new Vector3(targetScale, targetScale);
}
IEnumerator Wobble(float maxScale, float minScale, float targetScale, float growFactor) {
//Unstable effect of option when not selected
while(true) {
while(transform.localScale.x < maxScale)
{
transform.localScale += new Vector3(targetScale,targetScale) * Time.deltaTime * growFactor;
yield return null;
}
while(transform.localScale.x > minScale)
{
transform.localScale -= new Vector3(targetScale, targetScale) * Time.deltaTime * growFactor;
yield return null;
}
}
}
}
| 24.280702 | 108 | 0.716763 | [
"MIT"
] | surbhit21/Autism-Games | Assets/Scripts/FaceGame/WobbleEffect.cs | 1,386 | C# |
using System.Linq;
using System.Threading.Tasks;
using eWAY.Rapid.Enums;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace eWAY.Rapid.Tests.IntegrationTests {
[TestClass]
public class CreateTransactionTests : SdkTestBase {
[TestMethod]
public async Task Transaction_CreateTransactionDirect_ReturnValidData() {
var client = CreateRapidApiClient();
//Arrange
var transaction = TestUtil.CreateTransaction();
//Act
var response = await client.CreateAsync(PaymentMethod.Direct, transaction);
//Assert
TestUtil.AssertNoErrors(response);
Assert.IsNotNull(response.Transaction);
Assert.IsNotNull(response.TransactionStatus);
Assert.IsNotNull(response.TransactionStatus.Status);
Assert.IsTrue(response.TransactionStatus.Status.Value);
Assert.IsTrue(response.TransactionStatus.TransactionID > 0);
TestUtil.AssertReturnedCustomerData_VerifyAddressAreEqual(response.Transaction.Customer,
transaction.Customer);
TestUtil.AssertReturnedCustomerData_VerifyCardDetailsAreEqual(response.Transaction.Customer,
transaction.Customer);
TestUtil.AssertReturnedCustomerData_VerifyAllFieldsAreEqual(response.Transaction.Customer,
transaction.Customer);
}
[TestMethod]
public async Task Transaction_CreateTransactionTransparentRedirect_ReturnValidData() {
var client = CreateRapidApiClient();
//Arrange
var transaction = TestUtil.CreateTransaction();
//Act
var response = await client.CreateAsync(PaymentMethod.TransparentRedirect, transaction);
//Assert
TestUtil.AssertNoErrors(response);
Assert.IsNotNull(response.AccessCode);
Assert.IsNotNull(response.FormActionUrl);
TestUtil.AssertReturnedCustomerData_VerifyAddressAreEqual(response.Transaction.Customer,
transaction.Customer);
TestUtil.AssertReturnedCustomerData_VerifyAllFieldsAreEqual(response.Transaction.Customer,
transaction.Customer);
}
[TestMethod]
public async Task Transaction_CreateTokenTransactionTransparentRedirect_ReturnValidData() {
var client = CreateRapidApiClient();
//Arrange
var transaction = TestUtil.CreateTransaction();
transaction.SaveCustomer = true;
//Act
var response = await client.CreateAsync(PaymentMethod.TransparentRedirect, transaction);
//Assert
TestUtil.AssertNoErrors(response);
Assert.IsNotNull(response.AccessCode);
Assert.IsNotNull(response.FormActionUrl);
TestUtil.AssertReturnedCustomerData_VerifyAddressAreEqual(response.Transaction.Customer,
transaction.Customer);
TestUtil.AssertReturnedCustomerData_VerifyAllFieldsAreEqual(response.Transaction.Customer,
transaction.Customer);
}
[TestMethod]
public async Task Transaction_CreateTransactionResponsiveShared_ReturnValidData() {
var client = CreateRapidApiClient();
//Arrange
var transaction = TestUtil.CreateTransaction();
// Responsive Shared Fields
transaction.LogoUrl = "https://mysite.com/images/logo4eway.jpg";
transaction.HeaderText = "My Site Header Text";
transaction.CustomerReadOnly = true;
transaction.CustomView = "bootstrap";
transaction.VerifyCustomerEmail = false;
transaction.VerifyCustomerPhone = false;
//Act
var response = await client.CreateAsync(PaymentMethod.ResponsiveShared, transaction);
//Assert
TestUtil.AssertNoErrors(response);
Assert.IsNotNull(response.AccessCode);
Assert.IsNotNull(response.FormActionUrl);
Assert.IsNotNull(response.SharedPaymentUrl);
TestUtil.AssertReturnedCustomerData_VerifyAddressAreEqual(response.Transaction.Customer,
transaction.Customer);
TestUtil.AssertReturnedCustomerData_VerifyAllFieldsAreEqual(response.Transaction.Customer,
transaction.Customer);
}
[TestMethod]
public async Task Transaction_CreateTransactionDirect_InvalidInputData_ReturnVariousErrors() {
var client = CreateRapidApiClient();
//Arrange
var transaction = TestUtil.CreateTransaction(true);
transaction.Customer.CardDetails.Number = "-1";
//Act
var response1 = await client.CreateAsync(PaymentMethod.Direct, transaction);
//Assert
Assert.IsNotNull(response1.Errors);
Assert.AreEqual(response1.Errors.FirstOrDefault(), "V6110");
//Arrange
transaction = TestUtil.CreateTransaction(true);
transaction.PaymentDetails.TotalAmount = -1;
//Act
var response2 = await client.CreateAsync(PaymentMethod.Direct, transaction);
//Assert
Assert.IsNotNull(response2.Errors);
Assert.AreEqual(response2.Errors.FirstOrDefault(), "V6011");
}
[TestMethod]
public async Task Transaction_CreateTransactionTransparentRedirect_InvalidInputData_ReturnVariousErrors() {
var client = CreateRapidApiClient();
//Arrange
var transaction = TestUtil.CreateTransaction(true);
transaction.PaymentDetails.TotalAmount = 0;
//Act
var response1 = await client.CreateAsync(PaymentMethod.TransparentRedirect, transaction);
//Assert
Assert.IsNotNull(response1.Errors);
Assert.AreEqual(response1.Errors.FirstOrDefault(), "V6011");
//Arrange
transaction = TestUtil.CreateTransaction(true);
transaction.RedirectURL = "anInvalidRedirectUrl";
//Act
var response2 = await client.CreateAsync(PaymentMethod.TransparentRedirect, transaction);
//Assert
Assert.IsNotNull(response2.Errors);
Assert.AreEqual(response2.Errors.FirstOrDefault(), "V6059");
}
[TestMethod]
public async Task Transaction_CreateTransactionResponsiveShared_InvalidInputData_ReturnVariousErrors() {
var client = CreateRapidApiClient();
//Arrange
var transaction = TestUtil.CreateTransaction(true);
transaction.PaymentDetails.TotalAmount = 0;
//Act
var response1 = await client.CreateAsync(PaymentMethod.TransparentRedirect, transaction);
//Assert
Assert.IsNotNull(response1.Errors);
Assert.AreEqual(response1.Errors.FirstOrDefault(), "V6011");
//Arrange
transaction = TestUtil.CreateTransaction(true);
transaction.RedirectURL = "anInvalidRedirectUrl";
//Act
var response2 = await client.CreateAsync(PaymentMethod.TransparentRedirect, transaction);
//Assert
Assert.IsNotNull(response2.Errors);
Assert.AreEqual(response2.Errors.FirstOrDefault(), "V6059");
}
}
}
| 44.993902 | 115 | 0.65456 | [
"MIT"
] | CareerHub/eway-rapid-net | eWAY.Rapid.Tests/IntegrationTests/CreateTransactionTests.cs | 7,381 | C# |
// ------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
// ------------------------------------------------------------------------------
// **NOTE** This file was generated by a tool and any changes will be overwritten.
// <auto-generated/>
// Template Source: IEntityCollectionRequest.cs.tt
namespace Microsoft.Graph
{
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Threading;
using System.Linq.Expressions;
/// <summary>
/// The interface IIosLobAppProvisioningConfigurationUserStatusesCollectionRequest.
/// </summary>
public partial interface IIosLobAppProvisioningConfigurationUserStatusesCollectionRequest : IBaseRequest
{
/// <summary>
/// Adds the specified ManagedDeviceMobileAppConfigurationUserStatus to the collection via POST.
/// </summary>
/// <param name="managedDeviceMobileAppConfigurationUserStatus">The ManagedDeviceMobileAppConfigurationUserStatus to add.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
/// <returns>The created ManagedDeviceMobileAppConfigurationUserStatus.</returns>
System.Threading.Tasks.Task<ManagedDeviceMobileAppConfigurationUserStatus> AddAsync(ManagedDeviceMobileAppConfigurationUserStatus managedDeviceMobileAppConfigurationUserStatus, CancellationToken cancellationToken = default);
/// <summary>
/// Adds the specified ManagedDeviceMobileAppConfigurationUserStatus to the collection via POST and returns a <see cref="GraphResponse{ManagedDeviceMobileAppConfigurationUserStatus}"/> object of the request.
/// </summary>
/// <param name="managedDeviceMobileAppConfigurationUserStatus">The ManagedDeviceMobileAppConfigurationUserStatus to add.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
/// <returns>The <see cref="GraphResponse{ManagedDeviceMobileAppConfigurationUserStatus}"/> object of the request.</returns>
System.Threading.Tasks.Task<GraphResponse<ManagedDeviceMobileAppConfigurationUserStatus>> AddResponseAsync(ManagedDeviceMobileAppConfigurationUserStatus managedDeviceMobileAppConfigurationUserStatus, CancellationToken cancellationToken = default);
/// <summary>
/// Gets the collection page.
/// </summary>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
/// <returns>The collection page.</returns>
System.Threading.Tasks.Task<IIosLobAppProvisioningConfigurationUserStatusesCollectionPage> GetAsync(CancellationToken cancellationToken = default);
/// <summary>
/// Gets the collection page and returns a <see cref="GraphResponse{IosLobAppProvisioningConfigurationUserStatusesCollectionResponse}"/> object.
/// </summary>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
/// <returns>The <see cref="GraphResponse{IosLobAppProvisioningConfigurationUserStatusesCollectionResponse}"/> object.</returns>
System.Threading.Tasks.Task<GraphResponse<IosLobAppProvisioningConfigurationUserStatusesCollectionResponse>> GetResponseAsync(CancellationToken cancellationToken = default);
/// <summary>
/// Adds the specified expand value to the request.
/// </summary>
/// <param name="value">The expand value.</param>
/// <returns>The request object to send.</returns>
IIosLobAppProvisioningConfigurationUserStatusesCollectionRequest Expand(string value);
/// <summary>
/// Adds the specified expand value to the request.
/// </summary>
/// <param name="expandExpression">The expression from which to calculate the expand value.</param>
/// <returns>The request object to send.</returns>
IIosLobAppProvisioningConfigurationUserStatusesCollectionRequest Expand(Expression<Func<ManagedDeviceMobileAppConfigurationUserStatus, object>> expandExpression);
/// <summary>
/// Adds the specified select value to the request.
/// </summary>
/// <param name="value">The select value.</param>
/// <returns>The request object to send.</returns>
IIosLobAppProvisioningConfigurationUserStatusesCollectionRequest Select(string value);
/// <summary>
/// Adds the specified select value to the request.
/// </summary>
/// <param name="selectExpression">The expression from which to calculate the select value.</param>
/// <returns>The request object to send.</returns>
IIosLobAppProvisioningConfigurationUserStatusesCollectionRequest Select(Expression<Func<ManagedDeviceMobileAppConfigurationUserStatus, object>> selectExpression);
/// <summary>
/// Adds the specified top value to the request.
/// </summary>
/// <param name="value">The top value.</param>
/// <returns>The request object to send.</returns>
IIosLobAppProvisioningConfigurationUserStatusesCollectionRequest Top(int value);
/// <summary>
/// Adds the specified filter value to the request.
/// </summary>
/// <param name="value">The filter value.</param>
/// <returns>The request object to send.</returns>
IIosLobAppProvisioningConfigurationUserStatusesCollectionRequest Filter(string value);
/// <summary>
/// Adds the specified skip value to the request.
/// </summary>
/// <param name="value">The skip value.</param>
/// <returns>The request object to send.</returns>
IIosLobAppProvisioningConfigurationUserStatusesCollectionRequest Skip(int value);
/// <summary>
/// Adds the specified orderby value to the request.
/// </summary>
/// <param name="value">The orderby value.</param>
/// <returns>The request object to send.</returns>
IIosLobAppProvisioningConfigurationUserStatusesCollectionRequest OrderBy(string value);
}
}
| 56.828829 | 255 | 0.695625 | [
"MIT"
] | ScriptBox99/msgraph-beta-sdk-dotnet | src/Microsoft.Graph/Generated/requests/IIosLobAppProvisioningConfigurationUserStatusesCollectionRequest.cs | 6,308 | C# |
//************************************************************************************************
// Copyright © 2020 Steven M Cohn. All rights reserved.
//************************************************************************************************
namespace River.OneMoreAddIn.Commands
{
using System.Diagnostics;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
internal class DiagnosticsCommand : Command
{
public DiagnosticsCommand()
{
// prevent replay
IsCancelled = true;
}
public override async Task Execute(params object[] args)
{
var builder = new StringBuilder();
builder.AppendLine("Diagnostics.Execute()");
builder.AppendLine(new string('-', 80));
var processes = Process.GetProcessesByName("ONENOTE");
var module = processes.Length > 0 ? processes[0].MainModule.FileName : "unknown";
builder.AppendLine($"ONENOTE...: {module}");
builder.AppendLine($"Addin path: {Assembly.GetExecutingAssembly().Location}");
builder.AppendLine($"Data path.: {PathFactory.GetAppDataPath()}");
builder.AppendLine($"Log path..: {logger.LogPath}");
builder.AppendLine();
using (var one = new OneNote())
{
var (backupFolder, defaultFolder, unfiledFolder) = one.GetFolders();
builder.AppendLine($"Default path: {defaultFolder}");
builder.AppendLine($"Backup path: {backupFolder}");
builder.AppendLine($"Unfiled path: {unfiledFolder}");
builder.AppendLine();
var (Name, Path, Link) = one.GetPageInfo();
builder.AppendLine($"Page name: {Name}");
builder.AppendLine($"Page path: {Path}");
builder.AppendLine($"Page link: {Link}");
builder.AppendLine();
one.ReportWindowDiagnostics(builder);
builder.AppendLine();
var page = one.GetPage();
var pageColor = page.GetPageColor(out _, out _);
var pageBrightness = pageColor.GetBrightness();
builder.AppendLine($"Page background: {pageColor.ToRGBHtml()}");
builder.AppendLine($"Page brightness: {pageBrightness}");
builder.AppendLine($"Page is dark...: {pageBrightness < 0.5}");
(float dpiX, float dpiY) = UIHelper.GetDpiValues();
builder.AppendLine($"Screen DPI.....: horizontal/X:{dpiX} vertical/Y:{dpiY}");
(float scalingX, float scalingY) = UIHelper.GetScalingFactors();
builder.AppendLine($"Scaling factors: horizontal/X:{scalingX} vertical/Y:{scalingY}");
builder.AppendLine(new string('-', 80));
logger.WriteLine(builder.ToString());
UIHelper.ShowInfo($"Diagnostics written to {logger.LogPath}");
}
await Task.Yield();
}
}
}
| 32.670886 | 99 | 0.635025 | [
"MIT"
] | awesomedotnetcore/OneMore | OneMore/Commands/Tools/DiagnosticsCommand.cs | 2,584 | C# |
namespace ILG.Codex.Codex2007
{
partial class Configuration
{
/// <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()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Configuration));
Infragistics.Win.UltraWinToolTip.UltraToolTipInfo ultraToolTipInfo8 = new Infragistics.Win.UltraWinToolTip.UltraToolTipInfo("", Infragistics.Win.ToolTipImage.Default, null, Infragistics.Win.DefaultableBoolean.Default);
Infragistics.Win.Appearance appearance21 = new Infragistics.Win.Appearance();
Infragistics.Win.UltraWinToolTip.UltraToolTipInfo ultraToolTipInfo9 = new Infragistics.Win.UltraWinToolTip.UltraToolTipInfo("x", Infragistics.Win.ToolTipImage.Default, null, Infragistics.Win.DefaultableBoolean.Default);
Infragistics.Win.Appearance appearance11 = new Infragistics.Win.Appearance();
Infragistics.Win.UltraWinToolTip.UltraToolTipInfo ultraToolTipInfo10 = new Infragistics.Win.UltraWinToolTip.UltraToolTipInfo("ServerName\\Codex2007", Infragistics.Win.ToolTipImage.Default, "SQL Server Location", Infragistics.Win.DefaultableBoolean.Default);
Infragistics.Win.Appearance appearance15 = new Infragistics.Win.Appearance();
Infragistics.Win.UltraWinToolTip.UltraToolTipInfo ultraToolTipInfo11 = new Infragistics.Win.UltraWinToolTip.UltraToolTipInfo("By Default Port is 1433", Infragistics.Win.ToolTipImage.Default, "SQL Server Port", Infragistics.Win.DefaultableBoolean.Default);
Infragistics.Win.Appearance appearance1 = new Infragistics.Win.Appearance();
Infragistics.Win.Appearance appearance12 = new Infragistics.Win.Appearance();
Infragistics.Win.Appearance appearance17 = new Infragistics.Win.Appearance();
Infragistics.Win.Appearance appearance43 = new Infragistics.Win.Appearance();
Infragistics.Win.Appearance appearance49 = new Infragistics.Win.Appearance();
Infragistics.Win.UltraWinToolTip.UltraToolTipInfo ultraToolTipInfo1 = new Infragistics.Win.UltraWinToolTip.UltraToolTipInfo("", Infragistics.Win.ToolTipImage.Default, null, Infragistics.Win.DefaultableBoolean.Default);
Infragistics.Win.Appearance appearance18 = new Infragistics.Win.Appearance();
Infragistics.Win.Appearance appearance83 = new Infragistics.Win.Appearance();
Infragistics.Win.ValueListItem valueListItem1 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem2 = new Infragistics.Win.ValueListItem();
Infragistics.Win.UltraWinToolTip.UltraToolTipInfo ultraToolTipInfo2 = new Infragistics.Win.UltraWinToolTip.UltraToolTipInfo("", Infragistics.Win.ToolTipImage.Default, null, Infragistics.Win.DefaultableBoolean.Default);
Infragistics.Win.Appearance appearance16 = new Infragistics.Win.Appearance();
Infragistics.Win.Appearance appearance30 = new Infragistics.Win.Appearance();
Infragistics.Win.Appearance appearance2 = new Infragistics.Win.Appearance();
Infragistics.Win.ValueListItem valueListItem3 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem4 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem14 = new Infragistics.Win.ValueListItem();
Infragistics.Win.Appearance appearance50 = new Infragistics.Win.Appearance();
Infragistics.Win.ValueListItem valueListItem15 = new Infragistics.Win.ValueListItem();
Infragistics.Win.Appearance appearance23 = new Infragistics.Win.Appearance();
Infragistics.Win.ValueListItem valueListItem16 = new Infragistics.Win.ValueListItem();
Infragistics.Win.Appearance appearance51 = new Infragistics.Win.Appearance();
Infragistics.Win.ValueListItem valueListItem17 = new Infragistics.Win.ValueListItem();
Infragistics.Win.Appearance appearance10 = new Infragistics.Win.Appearance();
Infragistics.Win.UltraWinToolTip.UltraToolTipInfo ultraToolTipInfo3 = new Infragistics.Win.UltraWinToolTip.UltraToolTipInfo("აირჩიეთ თუ რომელი კლავიატურის განლაგება ჩაიტვირთოს სისტემის გაშვებისთანავე.", Infragistics.Win.ToolTipImage.Default, null, Infragistics.Win.DefaultableBoolean.Default);
Infragistics.Win.Appearance appearance31 = new Infragistics.Win.Appearance();
Infragistics.Win.ValueListItem valueListItem5 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem6 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem7 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem8 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem9 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem10 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem11 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem12 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem13 = new Infragistics.Win.ValueListItem();
Infragistics.Win.UltraWinToolTip.UltraToolTipInfo ultraToolTipInfo4 = new Infragistics.Win.UltraWinToolTip.UltraToolTipInfo("მაშტაბი გაჩუმებით", Infragistics.Win.ToolTipImage.Default, null, Infragistics.Win.DefaultableBoolean.Default);
Infragistics.Win.Appearance appearance14 = new Infragistics.Win.Appearance();
Infragistics.Win.Appearance appearance8 = new Infragistics.Win.Appearance();
Infragistics.Win.UltraWinToolTip.UltraToolTipInfo ultraToolTipInfo5 = new Infragistics.Win.UltraWinToolTip.UltraToolTipInfo("", Infragistics.Win.ToolTipImage.Default, null, Infragistics.Win.DefaultableBoolean.Default);
Infragistics.Win.Appearance appearance13 = new Infragistics.Win.Appearance();
Infragistics.Win.Appearance appearance19 = new Infragistics.Win.Appearance();
Infragistics.Win.UltraWinToolTip.UltraToolTipInfo ultraToolTipInfo6 = new Infragistics.Win.UltraWinToolTip.UltraToolTipInfo("", Infragistics.Win.ToolTipImage.Default, null, Infragistics.Win.DefaultableBoolean.Default);
Infragistics.Win.Appearance appearance44 = new Infragistics.Win.Appearance();
Infragistics.Win.UltraWinToolTip.UltraToolTipInfo ultraToolTipInfo7 = new Infragistics.Win.UltraWinToolTip.UltraToolTipInfo("", Infragistics.Win.ToolTipImage.Default, null, Infragistics.Win.DefaultableBoolean.Default);
Infragistics.Win.Appearance appearance59 = new Infragistics.Win.Appearance();
Infragistics.Win.Appearance appearance28 = new Infragistics.Win.Appearance();
Infragistics.Win.Appearance appearance9 = new Infragistics.Win.Appearance();
Infragistics.Win.Appearance appearance42 = new Infragistics.Win.Appearance();
Infragistics.Win.Appearance appearance71 = new Infragistics.Win.Appearance();
Infragistics.Win.Appearance appearance48 = new Infragistics.Win.Appearance();
Infragistics.Win.UltraWinTabControl.UltraTab ultraTab4 = new Infragistics.Win.UltraWinTabControl.UltraTab();
Infragistics.Win.UltraWinTabControl.UltraTab ultraTab2 = new Infragistics.Win.UltraWinTabControl.UltraTab();
Infragistics.Win.UltraWinToolTip.UltraToolTipInfo ultraToolTipInfo12 = new Infragistics.Win.UltraWinToolTip.UltraToolTipInfo("", Infragistics.Win.ToolTipImage.Default, null, Infragistics.Win.DefaultableBoolean.Default);
Infragistics.Win.Appearance appearance27 = new Infragistics.Win.Appearance();
Infragistics.Win.UltraWinToolTip.UltraToolTipInfo ultraToolTipInfo13 = new Infragistics.Win.UltraWinToolTip.UltraToolTipInfo("", Infragistics.Win.ToolTipImage.Default, null, Infragistics.Win.DefaultableBoolean.Default);
Infragistics.Win.Appearance appearance39 = new Infragistics.Win.Appearance();
Infragistics.Win.ValueListItem valueListItem18 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem19 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem20 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem21 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem22 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem23 = new Infragistics.Win.ValueListItem();
Infragistics.Win.Appearance appearance24 = new Infragistics.Win.Appearance();
Infragistics.Win.Appearance appearance25 = new Infragistics.Win.Appearance();
Infragistics.Win.Appearance appearance26 = new Infragistics.Win.Appearance();
Infragistics.Win.Appearance appearance52 = new Infragistics.Win.Appearance();
Infragistics.Win.ValueListItem valueListItem24 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem25 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem26 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem27 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem28 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem29 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem30 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem31 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem32 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem33 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem34 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem35 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem36 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem37 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem38 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem39 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem40 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem41 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem42 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem43 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem44 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem45 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem46 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem47 = new Infragistics.Win.ValueListItem();
Infragistics.Win.Appearance appearance29 = new Infragistics.Win.Appearance();
Infragistics.Win.ValueListItem valueListItem48 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem49 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem50 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem51 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem52 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem53 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem54 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem55 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem56 = new Infragistics.Win.ValueListItem();
Infragistics.Win.Appearance appearance36 = new Infragistics.Win.Appearance();
Infragistics.Win.Appearance appearance37 = new Infragistics.Win.Appearance();
Infragistics.Win.Appearance appearance38 = new Infragistics.Win.Appearance();
Infragistics.Win.Appearance appearance40 = new Infragistics.Win.Appearance();
Infragistics.Win.UltraWinToolbars.UltraToolbar ultraToolbar1 = new Infragistics.Win.UltraWinToolbars.UltraToolbar("UltraToolbar1");
Infragistics.Win.UltraWinToolbars.PopupMenuTool popupMenuTool2 = new Infragistics.Win.UltraWinToolbars.PopupMenuTool("ConfigurationMenu");
Infragistics.Win.UltraWinToolbars.PopupMenuTool popupMenuTool1 = new Infragistics.Win.UltraWinToolbars.PopupMenuTool("Help");
Infragistics.Win.Appearance appearance45 = new Infragistics.Win.Appearance();
Infragistics.Win.Appearance appearance46 = new Infragistics.Win.Appearance();
Infragistics.Win.UltraWinToolbars.PopupMenuTool popupMenuTool3 = new Infragistics.Win.UltraWinToolbars.PopupMenuTool("Help");
Infragistics.Win.Appearance appearance47 = new Infragistics.Win.Appearance();
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool17 = new Infragistics.Win.UltraWinToolbars.ButtonTool("TechManual");
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool2 = new Infragistics.Win.UltraWinToolbars.ButtonTool("FeedBack");
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool3 = new Infragistics.Win.UltraWinToolbars.ButtonTool("Web");
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool4 = new Infragistics.Win.UltraWinToolbars.ButtonTool("About");
Infragistics.Win.UltraWinToolbars.PopupMenuTool popupMenuTool4 = new Infragistics.Win.UltraWinToolbars.PopupMenuTool("ConfigurationMenu");
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool19 = new Infragistics.Win.UltraWinToolbars.ButtonTool("ჩაწერა");
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool20 = new Infragistics.Win.UltraWinToolbars.ButtonTool("მიღება");
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool16 = new Infragistics.Win.UltraWinToolbars.ButtonTool("დახურვა");
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool7 = new Infragistics.Win.UltraWinToolbars.ButtonTool("About");
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool8 = new Infragistics.Win.UltraWinToolbars.ButtonTool("Manual");
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool9 = new Infragistics.Win.UltraWinToolbars.ButtonTool("FeedBack");
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool10 = new Infragistics.Win.UltraWinToolbars.ButtonTool("Web");
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool11 = new Infragistics.Win.UltraWinToolbars.ButtonTool("Config");
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool12 = new Infragistics.Win.UltraWinToolbars.ButtonTool("TechManual");
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool13 = new Infragistics.Win.UltraWinToolbars.ButtonTool("პროგრამა");
Infragistics.Win.UltraWinToolbars.PopupMenuTool popupMenuTool5 = new Infragistics.Win.UltraWinToolbars.PopupMenuTool("ფაილი");
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool14 = new Infragistics.Win.UltraWinToolbars.ButtonTool("დახურვა");
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool1 = new Infragistics.Win.UltraWinToolbars.ButtonTool("ჩაწერა");
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool18 = new Infragistics.Win.UltraWinToolbars.ButtonTool("მიღება");
Infragistics.Win.Appearance appearance5 = new Infragistics.Win.Appearance();
Infragistics.Win.UltraWinTabControl.UltraTab ultraTab1 = new Infragistics.Win.UltraWinTabControl.UltraTab();
Infragistics.Win.UltraWinTabControl.UltraTab ultraTab3 = new Infragistics.Win.UltraWinTabControl.UltraTab();
Infragistics.Win.Appearance appearance22 = new Infragistics.Win.Appearance();
Infragistics.Win.UltraWinTabControl.UltraTab ultraTab6 = new Infragistics.Win.UltraWinTabControl.UltraTab();
this.ultraTabPageControl1 = new Infragistics.Win.UltraWinTabControl.UltraTabPageControl();
this.ultraPictureBox3 = new Infragistics.Win.UltraWinEditors.UltraPictureBox();
this.ultraPictureBox2 = new Infragistics.Win.UltraWinEditors.UltraPictureBox();
this.checkBox2 = new System.Windows.Forms.CheckBox();
this.ultraLabel2 = new Infragistics.Win.Misc.UltraLabel();
this.ultraTextEditor2 = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
this.DetailLabel = new System.Windows.Forms.LinkLabel();
this.ultraLabel3 = new Infragistics.Win.Misc.UltraLabel();
this.ultraTextEditor3 = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
this.ultraButton5 = new Infragistics.Win.Misc.UltraButton();
this.ultraButton4 = new Infragistics.Win.Misc.UltraButton();
this.ultraTextEditor1 = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
this.ultraLabel1 = new Infragistics.Win.Misc.UltraLabel();
this.ultraGroupBox1 = new Infragistics.Win.Misc.UltraGroupBox();
this.ultraPictureBox15 = new Infragistics.Win.UltraWinEditors.UltraPictureBox();
this.checkBox1 = new System.Windows.Forms.CheckBox();
this.ultraLabel4 = new Infragistics.Win.Misc.UltraLabel();
this.ultraTextEditor4 = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
this.ultraLabel5 = new Infragistics.Win.Misc.UltraLabel();
this.ultraTextEditor5 = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
this.radioButton2 = new System.Windows.Forms.RadioButton();
this.radioButton1 = new System.Windows.Forms.RadioButton();
this.ultraTabPageControl2 = new Infragistics.Win.UltraWinTabControl.UltraTabPageControl();
this.ultraCheckEditor1 = new Infragistics.Win.UltraWinEditors.UltraCheckEditor();
this.ultraPictureBox4 = new Infragistics.Win.UltraWinEditors.UltraPictureBox();
this.ultraPanel1 = new Infragistics.Win.Misc.UltraPanel();
this.DockDS = new Infragistics.Win.UltraWinEditors.UltraComboEditor();
this.ultraPictureBox5 = new Infragistics.Win.UltraWinEditors.UltraPictureBox();
this.ultraLabel9 = new Infragistics.Win.Misc.UltraLabel();
this.ultraPanel3 = new Infragistics.Win.Misc.UltraPanel();
this.ViewDS = new Infragistics.Win.UltraWinEditors.UltraComboEditor();
this.ultraComboEditor1 = new Infragistics.Win.UltraWinEditors.UltraComboEditor();
this.ultraLabel8 = new Infragistics.Win.Misc.UltraLabel();
this.ZoomDS = new Infragistics.Win.UltraWinEditors.UltraComboEditor();
this.ultraLabel10 = new Infragistics.Win.Misc.UltraLabel();
this.ultraLabel26 = new Infragistics.Win.Misc.UltraLabel();
this.ultraPictureBox1 = new Infragistics.Win.UltraWinEditors.UltraPictureBox();
this.ultraTextEditor6 = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
this.linkLabel1 = new System.Windows.Forms.LinkLabel();
this.ultraLabel7 = new Infragistics.Win.Misc.UltraLabel();
this.ultraTabPageControl11 = new Infragistics.Win.UltraWinTabControl.UltraTabPageControl();
this.linkLabel3 = new System.Windows.Forms.LinkLabel();
this.ultraPictureBox12 = new Infragistics.Win.UltraWinEditors.UltraPictureBox();
this.linkLabel2 = new System.Windows.Forms.LinkLabel();
this.ultraPictureBox8 = new Infragistics.Win.UltraWinEditors.UltraPictureBox();
this.ultraLabel33 = new Infragistics.Win.Misc.UltraLabel();
this.ultraLabel34 = new Infragistics.Win.Misc.UltraLabel();
this.ultraTabPageControl5 = new Infragistics.Win.UltraWinTabControl.UltraTabPageControl();
this.ultraButton3 = new Infragistics.Win.Misc.UltraButton();
this.ultraButton1 = new Infragistics.Win.Misc.UltraButton();
this.ultraButton2 = new Infragistics.Win.Misc.UltraButton();
this.ultraTabPageControl6 = new Infragistics.Win.UltraWinTabControl.UltraTabPageControl();
this.ultraPanel9 = new Infragistics.Win.Misc.UltraPanel();
this.ultraPictureBox11 = new Infragistics.Win.UltraWinEditors.UltraPictureBox();
this.ultraLabel12 = new Infragistics.Win.Misc.UltraLabel();
this.ultraTabPageControl3 = new Infragistics.Win.UltraWinTabControl.UltraTabPageControl();
this.ultraTabControl2 = new Infragistics.Win.UltraWinTabControl.UltraTabControl();
this.ultraTabSharedControlsPage2 = new Infragistics.Win.UltraWinTabControl.UltraTabSharedControlsPage();
this.ultraToolTipManager1 = new Infragistics.Win.UltraWinToolTip.UltraToolTipManager(this.components);
this.ultraPictureBox10 = new Infragistics.Win.UltraWinEditors.UltraPictureBox();
this.ultraPictureBox9 = new Infragistics.Win.UltraWinEditors.UltraPictureBox();
this.ultraTabPageControl4 = new Infragistics.Win.UltraWinTabControl.UltraTabPageControl();
this.DockICG = new Infragistics.Win.UltraWinEditors.UltraComboEditor();
this.DockCGL = new Infragistics.Win.UltraWinEditors.UltraComboEditor();
this.DockCodex = new Infragistics.Win.UltraWinEditors.UltraComboEditor();
this.ultraLabel19 = new Infragistics.Win.Misc.UltraLabel();
this.ultraLabel20 = new Infragistics.Win.Misc.UltraLabel();
this.ultraLabel21 = new Infragistics.Win.Misc.UltraLabel();
this.ultraLabel22 = new Infragistics.Win.Misc.UltraLabel();
this.ZoomICG = new Infragistics.Win.UltraWinEditors.UltraComboEditor();
this.ZoomCGL = new Infragistics.Win.UltraWinEditors.UltraComboEditor();
this.ViewICG = new Infragistics.Win.UltraWinEditors.UltraComboEditor();
this.ViewCGL = new Infragistics.Win.UltraWinEditors.UltraComboEditor();
this.ViewCodex = new Infragistics.Win.UltraWinEditors.UltraComboEditor();
this.ultraLabel17 = new Infragistics.Win.Misc.UltraLabel();
this.ZoomCodex = new Infragistics.Win.UltraWinEditors.UltraComboEditor();
this.ultraLabel13 = new Infragistics.Win.Misc.UltraLabel();
this.ultraLabel14 = new Infragistics.Win.Misc.UltraLabel();
this.ultraLabel15 = new Infragistics.Win.Misc.UltraLabel();
this.ultraLabel16 = new Infragistics.Win.Misc.UltraLabel();
this._Form1_Toolbars_Dock_Area_Top = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
this.ultraToolbarsManager1 = new Infragistics.Win.UltraWinToolbars.UltraToolbarsManager(this.components);
this._Form1_Toolbars_Dock_Area_Bottom = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
this._Form1_Toolbars_Dock_Area_Left = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
this._Form1_Toolbars_Dock_Area_Right = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
this.ultraTabControl4 = new Infragistics.Win.UltraWinTabControl.UltraTabControl();
this.ultraTabSharedControlsPage4 = new Infragistics.Win.UltraWinTabControl.UltraTabSharedControlsPage();
this.ultraTabControl1 = new Infragistics.Win.UltraWinTabControl.UltraTabControl();
this.ultraTabSharedControlsPage1 = new Infragistics.Win.UltraWinTabControl.UltraTabSharedControlsPage();
this.ultraTabControl5 = new Infragistics.Win.UltraWinTabControl.UltraTabControl();
this.ultraTabSharedControlsPage5 = new Infragistics.Win.UltraWinTabControl.UltraTabSharedControlsPage();
this.ultraTabPageControl1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.ultraTextEditor2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.ultraTextEditor3)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.ultraTextEditor1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.ultraGroupBox1)).BeginInit();
this.ultraGroupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.ultraTextEditor4)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.ultraTextEditor5)).BeginInit();
this.ultraTabPageControl2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.ultraCheckEditor1)).BeginInit();
this.ultraPanel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.DockDS)).BeginInit();
this.ultraPanel3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.ViewDS)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.ultraComboEditor1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.ZoomDS)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.ultraTextEditor6)).BeginInit();
this.ultraTabPageControl11.SuspendLayout();
this.ultraTabPageControl5.SuspendLayout();
this.ultraTabPageControl6.SuspendLayout();
this.ultraPanel9.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.ultraTabControl2)).BeginInit();
this.ultraTabControl2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.DockICG)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.DockCGL)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.DockCodex)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.ZoomICG)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.ZoomCGL)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.ViewICG)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.ViewCGL)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.ViewCodex)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.ZoomCodex)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.ultraToolbarsManager1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.ultraTabControl4)).BeginInit();
this.ultraTabControl4.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.ultraTabControl1)).BeginInit();
this.ultraTabControl1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.ultraTabControl5)).BeginInit();
this.ultraTabControl5.SuspendLayout();
this.SuspendLayout();
//
// ultraTabPageControl1
//
this.ultraTabPageControl1.Controls.Add(this.ultraPictureBox3);
this.ultraTabPageControl1.Controls.Add(this.ultraPictureBox2);
this.ultraTabPageControl1.Controls.Add(this.checkBox2);
this.ultraTabPageControl1.Controls.Add(this.ultraLabel2);
this.ultraTabPageControl1.Controls.Add(this.ultraTextEditor2);
this.ultraTabPageControl1.Controls.Add(this.DetailLabel);
this.ultraTabPageControl1.Controls.Add(this.ultraLabel3);
this.ultraTabPageControl1.Controls.Add(this.ultraTextEditor3);
this.ultraTabPageControl1.Controls.Add(this.ultraButton5);
this.ultraTabPageControl1.Controls.Add(this.ultraButton4);
this.ultraTabPageControl1.Controls.Add(this.ultraTextEditor1);
this.ultraTabPageControl1.Controls.Add(this.ultraLabel1);
this.ultraTabPageControl1.Controls.Add(this.ultraGroupBox1);
this.ultraTabPageControl1.Location = new System.Drawing.Point(0, 0);
this.ultraTabPageControl1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.ultraTabPageControl1.Name = "ultraTabPageControl1";
this.ultraTabPageControl1.Size = new System.Drawing.Size(510, 405);
//
// ultraPictureBox3
//
this.ultraPictureBox3.AutoSize = true;
this.ultraPictureBox3.BackColor = System.Drawing.Color.Transparent;
this.ultraPictureBox3.BorderShadowColor = System.Drawing.Color.Empty;
this.ultraPictureBox3.Image = ((object)(resources.GetObject("ultraPictureBox3.Image")));
this.ultraPictureBox3.Location = new System.Drawing.Point(8, 250);
this.ultraPictureBox3.Name = "ultraPictureBox3";
this.ultraPictureBox3.Size = new System.Drawing.Size(48, 48);
this.ultraPictureBox3.TabIndex = 31;
this.ultraPictureBox3.UseAppStyling = false;
//
// ultraPictureBox2
//
this.ultraPictureBox2.AutoSize = true;
this.ultraPictureBox2.BackColor = System.Drawing.Color.Transparent;
this.ultraPictureBox2.BorderShadowColor = System.Drawing.Color.Empty;
this.ultraPictureBox2.Image = ((object)(resources.GetObject("ultraPictureBox2.Image")));
this.ultraPictureBox2.ImageTransparentColor = System.Drawing.Color.Transparent;
this.ultraPictureBox2.Location = new System.Drawing.Point(22, 25);
this.ultraPictureBox2.Name = "ultraPictureBox2";
this.ultraPictureBox2.Size = new System.Drawing.Size(48, 48);
this.ultraPictureBox2.TabIndex = 30;
appearance21.BackColor = System.Drawing.Color.Transparent;
ultraToolTipInfo8.Appearance = appearance21;
this.ultraToolTipManager1.SetUltraToolTip(this.ultraPictureBox2, ultraToolTipInfo8);
this.ultraPictureBox2.UseAppStyling = false;
//
// checkBox2
//
this.checkBox2.BackColor = System.Drawing.Color.Transparent;
this.checkBox2.Location = new System.Drawing.Point(19, 332);
this.checkBox2.Name = "checkBox2";
this.checkBox2.Size = new System.Drawing.Size(330, 20);
this.checkBox2.TabIndex = 29;
this.checkBox2.Text = "დამაკავშირებელი სტრიქონი ჩაიწეროს ცალკე ფაილში";
ultraToolTipInfo9.ToolTipText = "x";
this.ultraToolTipManager1.SetUltraToolTip(this.checkBox2, ultraToolTipInfo9);
this.checkBox2.UseVisualStyleBackColor = false;
this.checkBox2.CheckedChanged += new System.EventHandler(this.checkBox2_CheckedChanged);
this.checkBox2.MouseClick += new System.Windows.Forms.MouseEventHandler(this.checkBox2_MouseClick);
//
// ultraLabel2
//
appearance11.BackColor = System.Drawing.Color.Transparent;
this.ultraLabel2.Appearance = appearance11;
this.ultraLabel2.AutoSize = true;
this.ultraLabel2.Location = new System.Drawing.Point(104, 27);
this.ultraLabel2.Name = "ultraLabel2";
this.ultraLabel2.Size = new System.Drawing.Size(124, 18);
this.ultraLabel2.TabIndex = 3;
this.ultraLabel2.Text = "SQL Server ის სახელი";
//
// ultraTextEditor2
//
this.ultraTextEditor2.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.Office2007;
this.ultraTextEditor2.Font = new System.Drawing.Font("MS Reference Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ultraTextEditor2.Location = new System.Drawing.Point(92, 51);
this.ultraTextEditor2.Name = "ultraTextEditor2";
this.ultraTextEditor2.Size = new System.Drawing.Size(277, 22);
this.ultraTextEditor2.TabIndex = 2;
ultraToolTipInfo10.ToolTipText = "ServerName\\Codex2007";
ultraToolTipInfo10.ToolTipTitle = "SQL Server Location";
this.ultraToolTipManager1.SetUltraToolTip(this.ultraTextEditor2, ultraToolTipInfo10);
//
// DetailLabel
//
this.DetailLabel.ActiveLinkColor = System.Drawing.Color.CornflowerBlue;
this.DetailLabel.AutoSize = true;
this.DetailLabel.BackColor = System.Drawing.Color.Transparent;
this.DetailLabel.LinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(64)))));
this.DetailLabel.Location = new System.Drawing.Point(277, 250);
this.DetailLabel.Name = "DetailLabel";
this.DetailLabel.Size = new System.Drawing.Size(223, 16);
this.DetailLabel.TabIndex = 28;
this.DetailLabel.TabStop = true;
this.DetailLabel.Text = "პირველადი პარამეტრების დაბრუნება";
this.DetailLabel.VisitedLinkColor = System.Drawing.Color.CornflowerBlue;
this.DetailLabel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.DetailLabel_LinkClicked);
//
// ultraLabel3
//
appearance15.BackColor = System.Drawing.Color.Transparent;
this.ultraLabel3.Appearance = appearance15;
this.ultraLabel3.AutoSize = true;
this.ultraLabel3.Location = new System.Drawing.Point(386, 27);
this.ultraLabel3.Name = "ultraLabel3";
this.ultraLabel3.Size = new System.Drawing.Size(44, 18);
this.ultraLabel3.TabIndex = 5;
this.ultraLabel3.Text = "პორტი";
//
// ultraTextEditor3
//
this.ultraTextEditor3.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.Office2007;
this.ultraTextEditor3.Font = new System.Drawing.Font("MS Reference Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ultraTextEditor3.Location = new System.Drawing.Point(386, 52);
this.ultraTextEditor3.Name = "ultraTextEditor3";
this.ultraTextEditor3.Size = new System.Drawing.Size(104, 22);
this.ultraTextEditor3.TabIndex = 4;
ultraToolTipInfo11.ToolTipText = "By Default Port is 1433";
ultraToolTipInfo11.ToolTipTitle = "SQL Server Port";
this.ultraToolTipManager1.SetUltraToolTip(this.ultraTextEditor3, ultraToolTipInfo11);
//
// ultraButton5
//
this.ultraButton5.ButtonStyle = Infragistics.Win.UIElementButtonStyle.WindowsVistaButton;
this.ultraButton5.Location = new System.Drawing.Point(404, 275);
this.ultraButton5.Name = "ultraButton5";
this.ultraButton5.Size = new System.Drawing.Size(96, 25);
this.ultraButton5.TabIndex = 12;
this.ultraButton5.Text = "გენერაცია";
this.ultraButton5.UseOsThemes = Infragistics.Win.DefaultableBoolean.False;
this.ultraButton5.Click += new System.EventHandler(this.ultraButton5_Click);
//
// ultraButton4
//
this.ultraButton4.ButtonStyle = Infragistics.Win.UIElementButtonStyle.WindowsVistaButton;
this.ultraButton4.Location = new System.Drawing.Point(404, 306);
this.ultraButton4.Name = "ultraButton4";
this.ultraButton4.Size = new System.Drawing.Size(96, 25);
this.ultraButton4.TabIndex = 11;
this.ultraButton4.Text = "დაკავშირება";
this.ultraButton4.UseOsThemes = Infragistics.Win.DefaultableBoolean.False;
this.ultraButton4.Click += new System.EventHandler(this.ultraButton4_Click);
//
// ultraTextEditor1
//
this.ultraTextEditor1.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.Office2007;
this.ultraTextEditor1.Font = new System.Drawing.Font("MS Reference Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ultraTextEditor1.Location = new System.Drawing.Point(8, 304);
this.ultraTextEditor1.Name = "ultraTextEditor1";
this.ultraTextEditor1.Size = new System.Drawing.Size(378, 22);
this.ultraTextEditor1.TabIndex = 10;
//
// ultraLabel1
//
appearance1.BackColor = System.Drawing.Color.Transparent;
this.ultraLabel1.Appearance = appearance1;
this.ultraLabel1.AutoSize = true;
this.ultraLabel1.Location = new System.Drawing.Point(62, 280);
this.ultraLabel1.Name = "ultraLabel1";
this.ultraLabel1.Size = new System.Drawing.Size(259, 18);
this.ultraLabel1.TabIndex = 9;
this.ultraLabel1.Text = "SQL სერვერთან დასაკავშირებელი სტრიქონი";
//
// ultraGroupBox1
//
appearance12.BackColor = System.Drawing.Color.White;
this.ultraGroupBox1.Appearance = appearance12;
this.ultraGroupBox1.Controls.Add(this.ultraPictureBox15);
this.ultraGroupBox1.Controls.Add(this.checkBox1);
this.ultraGroupBox1.Controls.Add(this.ultraLabel4);
this.ultraGroupBox1.Controls.Add(this.ultraTextEditor4);
this.ultraGroupBox1.Controls.Add(this.ultraLabel5);
this.ultraGroupBox1.Controls.Add(this.ultraTextEditor5);
this.ultraGroupBox1.Controls.Add(this.radioButton2);
this.ultraGroupBox1.Controls.Add(this.radioButton1);
this.ultraGroupBox1.HeaderBorderStyle = Infragistics.Win.UIElementBorderStyle.WindowsVista;
this.ultraGroupBox1.Location = new System.Drawing.Point(8, 92);
this.ultraGroupBox1.Name = "ultraGroupBox1";
this.ultraGroupBox1.Size = new System.Drawing.Size(492, 139);
this.ultraGroupBox1.TabIndex = 7;
this.ultraGroupBox1.Text = " SQL Server–ზე ავტორიზაცია ";
//
// ultraPictureBox15
//
this.ultraPictureBox15.AutoSize = true;
this.ultraPictureBox15.BackColor = System.Drawing.Color.Transparent;
this.ultraPictureBox15.BorderShadowColor = System.Drawing.Color.Empty;
this.ultraPictureBox15.Image = ((object)(resources.GetObject("ultraPictureBox15.Image")));
this.ultraPictureBox15.Location = new System.Drawing.Point(14, 25);
this.ultraPictureBox15.Name = "ultraPictureBox15";
this.ultraPictureBox15.Size = new System.Drawing.Size(48, 48);
this.ultraPictureBox15.TabIndex = 10;
this.ultraPictureBox15.UseAppStyling = false;
//
// checkBox1
//
this.checkBox1.AutoSize = true;
this.checkBox1.Location = new System.Drawing.Point(92, 83);
this.checkBox1.Name = "checkBox1";
this.checkBox1.Size = new System.Drawing.Size(15, 14);
this.checkBox1.TabIndex = 8;
this.checkBox1.UseVisualStyleBackColor = true;
this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
//
// ultraLabel4
//
appearance17.BackColor = System.Drawing.Color.Transparent;
this.ultraLabel4.Appearance = appearance17;
this.ultraLabel4.AutoSize = true;
this.ultraLabel4.Location = new System.Drawing.Point(296, 58);
this.ultraLabel4.Name = "ultraLabel4";
this.ultraLabel4.Size = new System.Drawing.Size(52, 18);
this.ultraLabel4.TabIndex = 7;
this.ultraLabel4.Text = "პაროლი";
//
// ultraTextEditor4
//
this.ultraTextEditor4.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.Office2007;
this.ultraTextEditor4.Enabled = false;
this.ultraTextEditor4.Font = new System.Drawing.Font("MS Reference Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ultraTextEditor4.Location = new System.Drawing.Point(286, 81);
this.ultraTextEditor4.Name = "ultraTextEditor4";
this.ultraTextEditor4.Size = new System.Drawing.Size(160, 22);
this.ultraTextEditor4.TabIndex = 6;
this.ultraTextEditor4.Text = "CodexDS2007";
//
// ultraLabel5
//
appearance43.BackColor = System.Drawing.Color.Transparent;
this.ultraLabel5.Appearance = appearance43;
this.ultraLabel5.AutoSize = true;
this.ultraLabel5.Location = new System.Drawing.Point(137, 58);
this.ultraLabel5.Name = "ultraLabel5";
this.ultraLabel5.Size = new System.Drawing.Size(89, 18);
this.ultraLabel5.TabIndex = 5;
this.ultraLabel5.Text = "მომხმარებელი";
//
// ultraTextEditor5
//
this.ultraTextEditor5.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.Office2007;
this.ultraTextEditor5.Enabled = false;
this.ultraTextEditor5.Font = new System.Drawing.Font("MS Reference Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ultraTextEditor5.Location = new System.Drawing.Point(127, 81);
this.ultraTextEditor5.Name = "ultraTextEditor5";
this.ultraTextEditor5.Size = new System.Drawing.Size(153, 22);
this.ultraTextEditor5.TabIndex = 4;
this.ultraTextEditor5.Text = "CodexDSUser";
//
// radioButton2
//
this.radioButton2.AutoSize = true;
this.radioButton2.BackColor = System.Drawing.Color.Transparent;
this.radioButton2.Location = new System.Drawing.Point(76, 107);
this.radioButton2.Name = "radioButton2";
this.radioButton2.Size = new System.Drawing.Size(200, 17);
this.radioButton2.TabIndex = 1;
this.radioButton2.Text = "Windws ზე აგებული აუდენტიფიკაცია";
this.radioButton2.UseVisualStyleBackColor = false;
this.radioButton2.CheckedChanged += new System.EventHandler(this.radioButton2_CheckedChanged);
//
// radioButton1
//
this.radioButton1.AutoSize = true;
this.radioButton1.BackColor = System.Drawing.Color.Transparent;
this.radioButton1.Checked = true;
this.radioButton1.Location = new System.Drawing.Point(76, 33);
this.radioButton1.Name = "radioButton1";
this.radioButton1.Size = new System.Drawing.Size(308, 17);
this.radioButton1.TabIndex = 0;
this.radioButton1.TabStop = true;
this.radioButton1.Text = "აუდენტიფიკაცია SQL Server ის მომხმარებლით და პაროლით";
this.radioButton1.UseVisualStyleBackColor = false;
this.radioButton1.CheckedChanged += new System.EventHandler(this.radioButton2_CheckedChanged);
//
// ultraTabPageControl2
//
this.ultraTabPageControl2.Controls.Add(this.ultraCheckEditor1);
this.ultraTabPageControl2.Controls.Add(this.ultraPictureBox4);
this.ultraTabPageControl2.Controls.Add(this.ultraPanel1);
this.ultraTabPageControl2.Controls.Add(this.DockDS);
this.ultraTabPageControl2.Controls.Add(this.ultraPictureBox5);
this.ultraTabPageControl2.Controls.Add(this.ultraLabel9);
this.ultraTabPageControl2.Controls.Add(this.ultraPanel3);
this.ultraTabPageControl2.Controls.Add(this.ViewDS);
this.ultraTabPageControl2.Controls.Add(this.ultraComboEditor1);
this.ultraTabPageControl2.Controls.Add(this.ultraLabel8);
this.ultraTabPageControl2.Controls.Add(this.ZoomDS);
this.ultraTabPageControl2.Controls.Add(this.ultraLabel10);
this.ultraTabPageControl2.Controls.Add(this.ultraLabel26);
this.ultraTabPageControl2.Controls.Add(this.ultraPictureBox1);
this.ultraTabPageControl2.Controls.Add(this.ultraTextEditor6);
this.ultraTabPageControl2.Controls.Add(this.linkLabel1);
this.ultraTabPageControl2.Controls.Add(this.ultraLabel7);
this.ultraTabPageControl2.Location = new System.Drawing.Point(-10000, -10000);
this.ultraTabPageControl2.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.ultraTabPageControl2.Name = "ultraTabPageControl2";
this.ultraTabPageControl2.Size = new System.Drawing.Size(510, 405);
//
// ultraCheckEditor1
//
appearance49.BackColor = System.Drawing.Color.Transparent;
this.ultraCheckEditor1.Appearance = appearance49;
this.ultraCheckEditor1.BackColor = System.Drawing.Color.Transparent;
this.ultraCheckEditor1.BackColorInternal = System.Drawing.Color.White;
this.ultraCheckEditor1.ButtonStyle = Infragistics.Win.UIElementButtonStyle.ScenicRibbonButton;
this.ultraCheckEditor1.GlyphInfo = Infragistics.Win.UIElementDrawParams.Office2007CheckBoxGlyphInfo;
this.ultraCheckEditor1.Location = new System.Drawing.Point(85, 249);
this.ultraCheckEditor1.Name = "ultraCheckEditor1";
this.ultraCheckEditor1.Size = new System.Drawing.Size(362, 21);
this.ultraCheckEditor1.TabIndex = 8;
this.ultraCheckEditor1.Text = "სრულტექსტოვანი ძებნის (FullText Search) გამოყენება";
this.ultraCheckEditor1.UseAppStyling = false;
this.ultraCheckEditor1.UseOsThemes = Infragistics.Win.DefaultableBoolean.False;
//
// ultraPictureBox4
//
this.ultraPictureBox4.AutoSize = true;
this.ultraPictureBox4.BackColor = System.Drawing.Color.Transparent;
this.ultraPictureBox4.BorderShadowColor = System.Drawing.Color.Empty;
this.ultraPictureBox4.Image = ((object)(resources.GetObject("ultraPictureBox4.Image")));
this.ultraPictureBox4.ImageTransparentColor = System.Drawing.Color.Transparent;
this.ultraPictureBox4.Location = new System.Drawing.Point(20, 249);
this.ultraPictureBox4.Name = "ultraPictureBox4";
this.ultraPictureBox4.Size = new System.Drawing.Size(48, 48);
this.ultraPictureBox4.TabIndex = 36;
appearance18.BackColor = System.Drawing.Color.Transparent;
ultraToolTipInfo1.Appearance = appearance18;
this.ultraToolTipManager1.SetUltraToolTip(this.ultraPictureBox4, ultraToolTipInfo1);
this.ultraPictureBox4.UseAppStyling = false;
//
// ultraPanel1
//
appearance83.BorderColor = System.Drawing.Color.Gray;
this.ultraPanel1.Appearance = appearance83;
this.ultraPanel1.BorderStyle = Infragistics.Win.UIElementBorderStyle.Solid;
this.ultraPanel1.Location = new System.Drawing.Point(20, 230);
this.ultraPanel1.Name = "ultraPanel1";
this.ultraPanel1.Size = new System.Drawing.Size(470, 1);
this.ultraPanel1.TabIndex = 35;
this.ultraPanel1.UseAppStyling = false;
this.ultraPanel1.UseOsThemes = Infragistics.Win.DefaultableBoolean.False;
//
// DockDS
//
this.DockDS.ButtonStyle = Infragistics.Win.UIElementButtonStyle.WindowsXPCommandButton;
this.DockDS.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.Office2007;
this.DockDS.DropDownStyle = Infragistics.Win.DropDownStyle.DropDownList;
valueListItem1.DataValue = "0";
valueListItem1.DisplayText = "არ შეინახოს";
valueListItem2.DataValue = "1";
valueListItem2.DisplayText = "შეინახოს";
this.DockDS.Items.AddRange(new Infragistics.Win.ValueListItem[] {
valueListItem1,
valueListItem2});
this.DockDS.Location = new System.Drawing.Point(376, 171);
this.DockDS.Name = "DockDS";
this.DockDS.Size = new System.Drawing.Size(116, 25);
this.DockDS.TabIndex = 22;
this.DockDS.UseOsThemes = Infragistics.Win.DefaultableBoolean.False;
//
// ultraPictureBox5
//
this.ultraPictureBox5.AutoSize = true;
this.ultraPictureBox5.BackColor = System.Drawing.Color.Transparent;
this.ultraPictureBox5.BorderShadowColor = System.Drawing.Color.Empty;
this.ultraPictureBox5.Image = ((object)(resources.GetObject("ultraPictureBox5.Image")));
this.ultraPictureBox5.ImageTransparentColor = System.Drawing.Color.Transparent;
this.ultraPictureBox5.Location = new System.Drawing.Point(22, 100);
this.ultraPictureBox5.Name = "ultraPictureBox5";
this.ultraPictureBox5.Size = new System.Drawing.Size(48, 48);
this.ultraPictureBox5.TabIndex = 34;
appearance16.BackColor = System.Drawing.Color.Transparent;
ultraToolTipInfo2.Appearance = appearance16;
this.ultraToolTipManager1.SetUltraToolTip(this.ultraPictureBox5, ultraToolTipInfo2);
this.ultraPictureBox5.UseAppStyling = false;
//
// ultraLabel9
//
appearance30.BackColor = System.Drawing.Color.Transparent;
appearance30.TextHAlignAsString = "Left";
this.ultraLabel9.Appearance = appearance30;
this.ultraLabel9.AutoSize = true;
this.ultraLabel9.Location = new System.Drawing.Point(133, 175);
this.ultraLabel9.Name = "ultraLabel9";
this.ultraLabel9.Size = new System.Drawing.Size(227, 18);
this.ultraLabel9.TabIndex = 21;
this.ultraLabel9.Text = "პანელების ადგილმდებარეობა შინახოს";
//
// ultraPanel3
//
appearance2.BorderColor = System.Drawing.Color.Gray;
this.ultraPanel3.Appearance = appearance2;
this.ultraPanel3.BorderStyle = Infragistics.Win.UIElementBorderStyle.Solid;
this.ultraPanel3.Location = new System.Drawing.Point(20, 74);
this.ultraPanel3.Name = "ultraPanel3";
this.ultraPanel3.Size = new System.Drawing.Size(470, 1);
this.ultraPanel3.TabIndex = 33;
this.ultraPanel3.UseAppStyling = false;
this.ultraPanel3.UseOsThemes = Infragistics.Win.DefaultableBoolean.False;
//
// ViewDS
//
this.ViewDS.ButtonStyle = Infragistics.Win.UIElementButtonStyle.WindowsXPCommandButton;
this.ViewDS.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.Office2007;
this.ViewDS.DropDownStyle = Infragistics.Win.DropDownStyle.DropDownList;
valueListItem3.DataValue = "0";
valueListItem3.DisplayText = "გვერდებით";
valueListItem4.DataValue = "1";
valueListItem4.DisplayText = "უწყვეტი";
this.ViewDS.Items.AddRange(new Infragistics.Win.ValueListItem[] {
valueListItem3,
valueListItem4});
this.ViewDS.Location = new System.Drawing.Point(391, 130);
this.ViewDS.Name = "ViewDS";
this.ViewDS.Size = new System.Drawing.Size(101, 25);
this.ViewDS.TabIndex = 20;
this.ViewDS.UseOsThemes = Infragistics.Win.DefaultableBoolean.False;
//
// ultraComboEditor1
//
this.ultraComboEditor1.ButtonStyle = Infragistics.Win.UIElementButtonStyle.WindowsXPCommandButton;
this.ultraComboEditor1.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.ScenicRibbon;
this.ultraComboEditor1.DropDownStyle = Infragistics.Win.DropDownStyle.DropDownList;
appearance50.Image = ((object)(resources.GetObject("appearance50.Image")));
valueListItem14.Appearance = appearance50;
valueListItem14.DataValue = "0";
valueListItem14.DisplayText = "ინგლისური";
appearance23.Image = ((object)(resources.GetObject("appearance23.Image")));
valueListItem15.Appearance = appearance23;
valueListItem15.DataValue = "1";
valueListItem15.DisplayText = "ქართული (lat)";
appearance51.Image = ((object)(resources.GetObject("appearance51.Image")));
valueListItem16.Appearance = appearance51;
valueListItem16.DataValue = "2";
valueListItem16.DisplayText = "ქართული (rus)";
appearance10.Image = ((object)(resources.GetObject("appearance10.Image")));
valueListItem17.Appearance = appearance10;
valueListItem17.DataValue = "3";
valueListItem17.DisplayText = "რუსული";
this.ultraComboEditor1.Items.AddRange(new Infragistics.Win.ValueListItem[] {
valueListItem14,
valueListItem15,
valueListItem16,
valueListItem17});
this.ultraComboEditor1.Location = new System.Drawing.Point(357, 25);
this.ultraComboEditor1.Name = "ultraComboEditor1";
this.ultraComboEditor1.Size = new System.Drawing.Size(144, 25);
this.ultraComboEditor1.TabIndex = 8;
ultraToolTipInfo3.ToolTipText = "აირჩიეთ თუ რომელი კლავიატურის განლაგება ჩაიტვირთოს სისტემის გაშვებისთანავე.";
this.ultraToolTipManager1.SetUltraToolTip(this.ultraComboEditor1, ultraToolTipInfo3);
this.ultraComboEditor1.UseAppStyling = false;
this.ultraComboEditor1.UseOsThemes = Infragistics.Win.DefaultableBoolean.False;
//
// ultraLabel8
//
appearance31.BackColor = System.Drawing.Color.Transparent;
appearance31.TextHAlignAsString = "Left";
this.ultraLabel8.Appearance = appearance31;
this.ultraLabel8.AutoSize = true;
this.ultraLabel8.Location = new System.Drawing.Point(274, 130);
this.ultraLabel8.Name = "ultraLabel8";
this.ultraLabel8.Size = new System.Drawing.Size(104, 18);
this.ultraLabel8.TabIndex = 19;
this.ultraLabel8.Text = "ხედვა გაჩუმებით";
//
// ZoomDS
//
this.ZoomDS.ButtonStyle = Infragistics.Win.UIElementButtonStyle.WindowsXPCommandButton;
this.ZoomDS.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.ScenicRibbon;
valueListItem5.DataValue = "10";
valueListItem5.DisplayText = "10%";
valueListItem6.DataValue = "20";
valueListItem6.DisplayText = "20%";
valueListItem7.DataValue = "50";
valueListItem7.DisplayText = "50%";
valueListItem8.DataValue = "100";
valueListItem8.DisplayText = "100%";
valueListItem9.DataValue = "150";
valueListItem9.DisplayText = "150%";
valueListItem10.DataValue = "200";
valueListItem10.DisplayText = "200%";
valueListItem11.DataValue = "400";
valueListItem11.DisplayText = "400%";
valueListItem12.DataValue = "–20";
valueListItem12.DisplayText = "გვ.სიგანე";
valueListItem13.DataValue = "–10";
valueListItem13.DisplayText = "გვ.სიმაღლე";
this.ZoomDS.Items.AddRange(new Infragistics.Win.ValueListItem[] {
valueListItem5,
valueListItem6,
valueListItem7,
valueListItem8,
valueListItem9,
valueListItem10,
valueListItem11,
valueListItem12,
valueListItem13});
this.ZoomDS.Location = new System.Drawing.Point(133, 126);
this.ZoomDS.Name = "ZoomDS";
this.ZoomDS.Size = new System.Drawing.Size(135, 25);
this.ZoomDS.TabIndex = 16;
ultraToolTipInfo4.ToolTipText = "მაშტაბი გაჩუმებით";
this.ultraToolTipManager1.SetUltraToolTip(this.ZoomDS, ultraToolTipInfo4);
this.ZoomDS.UseOsThemes = Infragistics.Win.DefaultableBoolean.False;
//
// ultraLabel10
//
appearance14.BackColor = System.Drawing.Color.Transparent;
appearance14.TextHAlignAsString = "Left";
this.ultraLabel10.Appearance = appearance14;
this.ultraLabel10.Location = new System.Drawing.Point(75, 29);
this.ultraLabel10.Name = "ultraLabel10";
this.ultraLabel10.Size = new System.Drawing.Size(266, 39);
this.ultraLabel10.TabIndex = 31;
this.ultraLabel10.Text = "კლავიატურის განლაგება სისტემის გაშვებისას";
//
// ultraLabel26
//
appearance8.BackColor = System.Drawing.Color.Transparent;
appearance8.TextHAlignAsString = "Left";
this.ultraLabel26.Appearance = appearance8;
this.ultraLabel26.AutoSize = true;
this.ultraLabel26.Location = new System.Drawing.Point(76, 130);
this.ultraLabel26.Name = "ultraLabel26";
this.ultraLabel26.Size = new System.Drawing.Size(50, 18);
this.ultraLabel26.TabIndex = 15;
this.ultraLabel26.Text = "მაშტაბი";
//
// ultraPictureBox1
//
this.ultraPictureBox1.AutoSize = true;
this.ultraPictureBox1.BackColor = System.Drawing.Color.Transparent;
this.ultraPictureBox1.BorderShadowColor = System.Drawing.Color.Empty;
this.ultraPictureBox1.Image = ((object)(resources.GetObject("ultraPictureBox1.Image")));
this.ultraPictureBox1.ImageTransparentColor = System.Drawing.Color.Transparent;
this.ultraPictureBox1.Location = new System.Drawing.Point(20, 20);
this.ultraPictureBox1.Name = "ultraPictureBox1";
this.ultraPictureBox1.Size = new System.Drawing.Size(48, 48);
this.ultraPictureBox1.TabIndex = 32;
appearance13.BackColor = System.Drawing.Color.Transparent;
ultraToolTipInfo5.Appearance = appearance13;
this.ultraToolTipManager1.SetUltraToolTip(this.ultraPictureBox1, ultraToolTipInfo5);
this.ultraPictureBox1.UseAppStyling = false;
//
// ultraTextEditor6
//
this.ultraTextEditor6.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.Office2007;
this.ultraTextEditor6.Font = new System.Drawing.Font("MS Reference Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ultraTextEditor6.Location = new System.Drawing.Point(402, 96);
this.ultraTextEditor6.Name = "ultraTextEditor6";
this.ultraTextEditor6.Size = new System.Drawing.Size(90, 22);
this.ultraTextEditor6.TabIndex = 8;
//
// linkLabel1
//
this.linkLabel1.ActiveLinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(64)))));
this.linkLabel1.AutoSize = true;
this.linkLabel1.BackColor = System.Drawing.Color.Transparent;
this.linkLabel1.LinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(64)))));
this.linkLabel1.Location = new System.Drawing.Point(271, 205);
this.linkLabel1.Name = "linkLabel1";
this.linkLabel1.Size = new System.Drawing.Size(223, 16);
this.linkLabel1.TabIndex = 30;
this.linkLabel1.TabStop = true;
this.linkLabel1.Text = "პირველადი პარამეტრების დაბრუნება";
this.linkLabel1.VisitedLinkColor = System.Drawing.Color.CornflowerBlue;
this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
//
// ultraLabel7
//
appearance19.BackColor = System.Drawing.Color.Transparent;
appearance19.TextHAlignAsString = "Left";
this.ultraLabel7.Appearance = appearance19;
this.ultraLabel7.AutoSize = true;
this.ultraLabel7.Location = new System.Drawing.Point(75, 100);
this.ultraLabel7.Name = "ultraLabel7";
this.ultraLabel7.Size = new System.Drawing.Size(281, 18);
this.ultraLabel7.TabIndex = 3;
this.ultraLabel7.Text = "სიაში დოკუმენეტების მაქსიმალური რაოდენობა";
//
// ultraTabPageControl11
//
this.ultraTabPageControl11.Controls.Add(this.linkLabel3);
this.ultraTabPageControl11.Controls.Add(this.ultraPictureBox12);
this.ultraTabPageControl11.Controls.Add(this.linkLabel2);
this.ultraTabPageControl11.Controls.Add(this.ultraPictureBox8);
this.ultraTabPageControl11.Controls.Add(this.ultraLabel33);
this.ultraTabPageControl11.Controls.Add(this.ultraLabel34);
this.ultraTabPageControl11.Location = new System.Drawing.Point(0, 0);
this.ultraTabPageControl11.Name = "ultraTabPageControl11";
this.ultraTabPageControl11.Size = new System.Drawing.Size(160, 499);
//
// linkLabel3
//
this.linkLabel3.ActiveLinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
this.linkLabel3.AutoSize = true;
this.linkLabel3.BackColor = System.Drawing.Color.Transparent;
this.linkLabel3.LinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
this.linkLabel3.Location = new System.Drawing.Point(31, 105);
this.linkLabel3.Name = "linkLabel3";
this.linkLabel3.Size = new System.Drawing.Size(80, 16);
this.linkLabel3.TabIndex = 33;
this.linkLabel3.TabStop = true;
this.linkLabel3.Text = "ინტერფეისი";
this.linkLabel3.VisitedLinkColor = System.Drawing.Color.CornflowerBlue;
this.linkLabel3.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel3_LinkClicked);
//
// ultraPictureBox12
//
this.ultraPictureBox12.AutoSize = true;
this.ultraPictureBox12.BackColor = System.Drawing.Color.Transparent;
this.ultraPictureBox12.BorderShadowColor = System.Drawing.Color.Empty;
this.ultraPictureBox12.Image = ((object)(resources.GetObject("ultraPictureBox12.Image")));
this.ultraPictureBox12.ImageTransparentColor = System.Drawing.Color.Transparent;
this.ultraPictureBox12.Location = new System.Drawing.Point(7, 104);
this.ultraPictureBox12.Name = "ultraPictureBox12";
this.ultraPictureBox12.Size = new System.Drawing.Size(16, 16);
this.ultraPictureBox12.TabIndex = 32;
appearance44.BackColor = System.Drawing.Color.Transparent;
ultraToolTipInfo6.Appearance = appearance44;
this.ultraToolTipManager1.SetUltraToolTip(this.ultraPictureBox12, ultraToolTipInfo6);
this.ultraPictureBox12.UseAppStyling = false;
//
// linkLabel2
//
this.linkLabel2.ActiveLinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
this.linkLabel2.AutoSize = true;
this.linkLabel2.BackColor = System.Drawing.Color.Transparent;
this.linkLabel2.LinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
this.linkLabel2.Location = new System.Drawing.Point(31, 82);
this.linkLabel2.Name = "linkLabel2";
this.linkLabel2.Size = new System.Drawing.Size(33, 16);
this.linkLabel2.TabIndex = 31;
this.linkLabel2.TabStop = true;
this.linkLabel2.Text = "ბაზა";
this.linkLabel2.VisitedLinkColor = System.Drawing.Color.CornflowerBlue;
this.linkLabel2.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel2_LinkClicked);
//
// ultraPictureBox8
//
this.ultraPictureBox8.AutoSize = true;
this.ultraPictureBox8.BackColor = System.Drawing.Color.Transparent;
this.ultraPictureBox8.BorderShadowColor = System.Drawing.Color.Empty;
this.ultraPictureBox8.Image = ((object)(resources.GetObject("ultraPictureBox8.Image")));
this.ultraPictureBox8.ImageTransparentColor = System.Drawing.Color.Transparent;
this.ultraPictureBox8.Location = new System.Drawing.Point(7, 81);
this.ultraPictureBox8.Name = "ultraPictureBox8";
this.ultraPictureBox8.Size = new System.Drawing.Size(16, 16);
this.ultraPictureBox8.TabIndex = 30;
appearance59.BackColor = System.Drawing.Color.Transparent;
ultraToolTipInfo7.Appearance = appearance59;
this.ultraToolTipManager1.SetUltraToolTip(this.ultraPictureBox8, ultraToolTipInfo7);
this.ultraPictureBox8.UseAppStyling = false;
//
// ultraLabel33
//
appearance28.BackColor = System.Drawing.Color.Transparent;
appearance28.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
this.ultraLabel33.Appearance = appearance28;
this.ultraLabel33.AutoSize = true;
this.ultraLabel33.Location = new System.Drawing.Point(7, 12);
this.ultraLabel33.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.ultraLabel33.Name = "ultraLabel33";
this.ultraLabel33.Size = new System.Drawing.Size(62, 16);
this.ultraLabel33.TabIndex = 28;
this.ultraLabel33.Text = "კოდექსის";
this.ultraLabel33.TextRenderingMode = Infragistics.Win.TextRenderingMode.GDI;
this.ultraLabel33.UseAppStyling = false;
this.ultraLabel33.UseOsThemes = Infragistics.Win.DefaultableBoolean.False;
//
// ultraLabel34
//
appearance9.BackColor = System.Drawing.Color.Transparent;
appearance9.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
this.ultraLabel34.Appearance = appearance9;
this.ultraLabel34.AutoSize = true;
this.ultraLabel34.Location = new System.Drawing.Point(7, 36);
this.ultraLabel34.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.ultraLabel34.Name = "ultraLabel34";
this.ultraLabel34.Size = new System.Drawing.Size(148, 16);
this.ultraLabel34.TabIndex = 26;
this.ultraLabel34.Text = "კონფიგურაციის სისტემა";
this.ultraLabel34.TextRenderingMode = Infragistics.Win.TextRenderingMode.GDI;
this.ultraLabel34.UseAppStyling = false;
this.ultraLabel34.UseOsThemes = Infragistics.Win.DefaultableBoolean.False;
//
// ultraTabPageControl5
//
this.ultraTabPageControl5.Controls.Add(this.ultraButton3);
this.ultraTabPageControl5.Controls.Add(this.ultraButton1);
this.ultraTabPageControl5.Controls.Add(this.ultraButton2);
this.ultraTabPageControl5.Location = new System.Drawing.Point(0, 0);
this.ultraTabPageControl5.Name = "ultraTabPageControl5";
this.ultraTabPageControl5.Size = new System.Drawing.Size(510, 47);
//
// ultraButton3
//
this.ultraButton3.ButtonStyle = Infragistics.Win.UIElementButtonStyle.WindowsVistaButton;
this.ultraButton3.Location = new System.Drawing.Point(397, 8);
this.ultraButton3.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.ultraButton3.Name = "ultraButton3";
this.ultraButton3.Size = new System.Drawing.Size(103, 25);
this.ultraButton3.TabIndex = 4;
this.ultraButton3.Text = "დახურვა";
this.ultraButton3.UseOsThemes = Infragistics.Win.DefaultableBoolean.False;
this.ultraButton3.Click += new System.EventHandler(this.ultraButton3_Click);
//
// ultraButton1
//
this.ultraButton1.ButtonStyle = Infragistics.Win.UIElementButtonStyle.WindowsVistaButton;
this.ultraButton1.Location = new System.Drawing.Point(164, 8);
this.ultraButton1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.ultraButton1.Name = "ultraButton1";
this.ultraButton1.Size = new System.Drawing.Size(111, 25);
this.ultraButton1.TabIndex = 2;
this.ultraButton1.Text = "ჩაწერა";
this.ultraButton1.UseOsThemes = Infragistics.Win.DefaultableBoolean.False;
this.ultraButton1.Click += new System.EventHandler(this.ultraButton1_Click);
//
// ultraButton2
//
this.ultraButton2.ButtonStyle = Infragistics.Win.UIElementButtonStyle.WindowsVistaButton;
this.ultraButton2.Location = new System.Drawing.Point(281, 8);
this.ultraButton2.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.ultraButton2.Name = "ultraButton2";
this.ultraButton2.Size = new System.Drawing.Size(111, 25);
this.ultraButton2.TabIndex = 3;
this.ultraButton2.Text = "მიღება";
this.ultraButton2.UseOsThemes = Infragistics.Win.DefaultableBoolean.False;
this.ultraButton2.Click += new System.EventHandler(this.ultraButton2_Click);
//
// ultraTabPageControl6
//
this.ultraTabPageControl6.Controls.Add(this.ultraPanel9);
this.ultraTabPageControl6.Controls.Add(this.ultraPictureBox11);
this.ultraTabPageControl6.Controls.Add(this.ultraLabel12);
this.ultraTabPageControl6.Location = new System.Drawing.Point(0, 4);
this.ultraTabPageControl6.Name = "ultraTabPageControl6";
this.ultraTabPageControl6.Size = new System.Drawing.Size(510, 43);
//
// ultraPanel9
//
appearance42.BorderColor = System.Drawing.Color.Gray;
this.ultraPanel9.Appearance = appearance42;
this.ultraPanel9.BorderStyle = Infragistics.Win.UIElementBorderStyle.Solid;
this.ultraPanel9.Location = new System.Drawing.Point(22, 42);
this.ultraPanel9.Name = "ultraPanel9";
this.ultraPanel9.Size = new System.Drawing.Size(430, 1);
this.ultraPanel9.TabIndex = 24;
this.ultraPanel9.UseAppStyling = false;
this.ultraPanel9.UseOsThemes = Infragistics.Win.DefaultableBoolean.False;
//
// ultraPictureBox11
//
this.ultraPictureBox11.BackColor = System.Drawing.Color.Transparent;
this.ultraPictureBox11.BorderShadowColor = System.Drawing.Color.Empty;
this.ultraPictureBox11.BorderStyle = Infragistics.Win.UIElementBorderStyle.None;
this.ultraPictureBox11.Image = ((object)(resources.GetObject("ultraPictureBox11.Image")));
this.ultraPictureBox11.ImageTransparentColor = System.Drawing.Color.Transparent;
this.ultraPictureBox11.Location = new System.Drawing.Point(451, -4);
this.ultraPictureBox11.Name = "ultraPictureBox11";
this.ultraPictureBox11.Size = new System.Drawing.Size(56, 50);
this.ultraPictureBox11.TabIndex = 23;
this.ultraPictureBox11.UseAppStyling = false;
//
// ultraLabel12
//
appearance71.BackColor = System.Drawing.Color.Transparent;
appearance71.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
this.ultraLabel12.Appearance = appearance71;
this.ultraLabel12.AutoSize = true;
this.ultraLabel12.Font = new System.Drawing.Font("Sylfaen", 14F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ultraLabel12.Location = new System.Drawing.Point(22, 9);
this.ultraLabel12.Name = "ultraLabel12";
this.ultraLabel12.Size = new System.Drawing.Size(348, 27);
this.ultraLabel12.TabIndex = 22;
this.ultraLabel12.Text = "კოდექსი DS კონფიგურაციის სისტემა";
//
// ultraTabPageControl3
//
this.ultraTabPageControl3.Location = new System.Drawing.Point(-10000, -10000);
this.ultraTabPageControl3.Name = "ultraTabPageControl3";
this.ultraTabPageControl3.Size = new System.Drawing.Size(472, 333);
this.ultraTabPageControl3.Paint += new System.Windows.Forms.PaintEventHandler(this.ultraTabPageControl3_Paint);
//
// ultraTabControl2
//
appearance48.BackColor = System.Drawing.Color.White;
this.ultraTabControl2.Appearance = appearance48;
this.ultraTabControl2.Controls.Add(this.ultraTabSharedControlsPage2);
this.ultraTabControl2.Controls.Add(this.ultraTabPageControl1);
this.ultraTabControl2.Controls.Add(this.ultraTabPageControl2);
this.ultraTabControl2.Dock = System.Windows.Forms.DockStyle.Fill;
this.ultraTabControl2.Location = new System.Drawing.Point(160, 71);
this.ultraTabControl2.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.ultraTabControl2.Name = "ultraTabControl2";
this.ultraTabControl2.SharedControlsPage = this.ultraTabSharedControlsPage2;
this.ultraTabControl2.Size = new System.Drawing.Size(510, 405);
this.ultraTabControl2.Style = Infragistics.Win.UltraWinTabControl.UltraTabControlStyle.Wizard;
this.ultraTabControl2.TabIndex = 1;
ultraTab4.FixedWidth = 70;
ultraTab4.TabPage = this.ultraTabPageControl1;
ultraTab4.Text = "ბაზა";
ultraTab2.FixedWidth = 120;
ultraTab2.TabPage = this.ultraTabPageControl2;
ultraTab2.Text = "ინტერფეისი";
this.ultraTabControl2.Tabs.AddRange(new Infragistics.Win.UltraWinTabControl.UltraTab[] {
ultraTab4,
ultraTab2});
this.ultraTabControl2.UseAppStyling = false;
this.ultraTabControl2.UseFlatMode = Infragistics.Win.DefaultableBoolean.False;
this.ultraTabControl2.UseHotTracking = Infragistics.Win.DefaultableBoolean.True;
this.ultraTabControl2.UseMnemonics = Infragistics.Win.DefaultableBoolean.False;
this.ultraTabControl2.UseOsThemes = Infragistics.Win.DefaultableBoolean.False;
//
// ultraTabSharedControlsPage2
//
this.ultraTabSharedControlsPage2.Location = new System.Drawing.Point(-10000, -10000);
this.ultraTabSharedControlsPage2.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.ultraTabSharedControlsPage2.Name = "ultraTabSharedControlsPage2";
this.ultraTabSharedControlsPage2.Size = new System.Drawing.Size(510, 405);
//
// ultraToolTipManager1
//
this.ultraToolTipManager1.ContainingControl = this;
//
// ultraPictureBox10
//
this.ultraPictureBox10.AutoSize = true;
this.ultraPictureBox10.BackColor = System.Drawing.Color.Transparent;
this.ultraPictureBox10.BorderShadowColor = System.Drawing.Color.Empty;
this.ultraPictureBox10.Image = ((object)(resources.GetObject("ultraPictureBox10.Image")));
this.ultraPictureBox10.ImageTransparentColor = System.Drawing.Color.Transparent;
this.ultraPictureBox10.Location = new System.Drawing.Point(11, 31);
this.ultraPictureBox10.Name = "ultraPictureBox10";
this.ultraPictureBox10.Size = new System.Drawing.Size(32, 32);
this.ultraPictureBox10.TabIndex = 7;
appearance27.BackColor = System.Drawing.Color.Transparent;
ultraToolTipInfo12.Appearance = appearance27;
this.ultraToolTipManager1.SetUltraToolTip(this.ultraPictureBox10, ultraToolTipInfo12);
this.ultraPictureBox10.UseAppStyling = false;
//
// ultraPictureBox9
//
this.ultraPictureBox9.AutoSize = true;
this.ultraPictureBox9.BackColor = System.Drawing.Color.Transparent;
this.ultraPictureBox9.BorderShadowColor = System.Drawing.Color.Empty;
this.ultraPictureBox9.Image = ((object)(resources.GetObject("ultraPictureBox9.Image")));
this.ultraPictureBox9.ImageTransparentColor = System.Drawing.Color.Transparent;
this.ultraPictureBox9.Location = new System.Drawing.Point(11, 31);
this.ultraPictureBox9.Name = "ultraPictureBox9";
this.ultraPictureBox9.Size = new System.Drawing.Size(32, 32);
this.ultraPictureBox9.TabIndex = 7;
appearance39.BackColor = System.Drawing.Color.Transparent;
ultraToolTipInfo13.Appearance = appearance39;
this.ultraToolTipManager1.SetUltraToolTip(this.ultraPictureBox9, ultraToolTipInfo13);
this.ultraPictureBox9.UseAppStyling = false;
//
// ultraTabPageControl4
//
this.ultraTabPageControl4.Location = new System.Drawing.Point(-10000, -10000);
this.ultraTabPageControl4.Name = "ultraTabPageControl4";
this.ultraTabPageControl4.Size = new System.Drawing.Size(472, 333);
//
// DockICG
//
this.DockICG.ButtonStyle = Infragistics.Win.UIElementButtonStyle.WindowsXPCommandButton;
this.DockICG.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.Office2007;
this.DockICG.DropDownStyle = Infragistics.Win.DropDownStyle.DropDownList;
valueListItem18.DataValue = "0";
valueListItem18.DisplayText = "არ შეინახოს";
valueListItem19.DataValue = "1";
valueListItem19.DisplayText = "შეინახოს";
this.DockICG.Items.AddRange(new Infragistics.Win.ValueListItem[] {
valueListItem18,
valueListItem19});
this.DockICG.Location = new System.Drawing.Point(141, 119);
this.DockICG.Name = "DockICG";
this.DockICG.Size = new System.Drawing.Size(116, 21);
this.DockICG.TabIndex = 16;
this.DockICG.UseOsThemes = Infragistics.Win.DefaultableBoolean.False;
//
// DockCGL
//
this.DockCGL.ButtonStyle = Infragistics.Win.UIElementButtonStyle.WindowsXPCommandButton;
this.DockCGL.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.Office2007;
this.DockCGL.DropDownStyle = Infragistics.Win.DropDownStyle.DropDownList;
valueListItem20.DataValue = "0";
valueListItem20.DisplayText = "არ შეინახოს";
valueListItem21.DataValue = "1";
valueListItem21.DisplayText = "შეინახოს";
this.DockCGL.Items.AddRange(new Infragistics.Win.ValueListItem[] {
valueListItem20,
valueListItem21});
this.DockCGL.Location = new System.Drawing.Point(141, 91);
this.DockCGL.Name = "DockCGL";
this.DockCGL.Size = new System.Drawing.Size(116, 21);
this.DockCGL.TabIndex = 15;
this.DockCGL.UseOsThemes = Infragistics.Win.DefaultableBoolean.False;
//
// DockCodex
//
this.DockCodex.ButtonStyle = Infragistics.Win.UIElementButtonStyle.WindowsXPCommandButton;
this.DockCodex.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.Office2007;
this.DockCodex.DropDownStyle = Infragistics.Win.DropDownStyle.DropDownList;
valueListItem22.DataValue = "0";
valueListItem22.DisplayText = "არ შეინახოს";
valueListItem23.DataValue = "1";
valueListItem23.DisplayText = "შეინახოს";
this.DockCodex.Items.AddRange(new Infragistics.Win.ValueListItem[] {
valueListItem22,
valueListItem23});
this.DockCodex.Location = new System.Drawing.Point(141, 60);
this.DockCodex.Name = "DockCodex";
this.DockCodex.Size = new System.Drawing.Size(116, 21);
this.DockCodex.TabIndex = 14;
this.DockCodex.UseOsThemes = Infragistics.Win.DefaultableBoolean.False;
//
// ultraLabel19
//
appearance24.BackColor = System.Drawing.Color.Transparent;
appearance24.TextHAlignAsString = "Left";
this.ultraLabel19.Appearance = appearance24;
this.ultraLabel19.Location = new System.Drawing.Point(11, 122);
this.ultraLabel19.Name = "ultraLabel19";
this.ultraLabel19.Size = new System.Drawing.Size(120, 22);
this.ultraLabel19.TabIndex = 13;
this.ultraLabel19.Text = "ხელშეკრულებები";
//
// ultraLabel20
//
appearance25.BackColor = System.Drawing.Color.Transparent;
appearance25.TextHAlignAsString = "Left";
this.ultraLabel20.Appearance = appearance25;
this.ultraLabel20.Location = new System.Drawing.Point(11, 94);
this.ultraLabel20.Name = "ultraLabel20";
this.ultraLabel20.Size = new System.Drawing.Size(120, 22);
this.ultraLabel20.TabIndex = 12;
this.ultraLabel20.Text = "კოდიფიცირებული";
//
// ultraLabel21
//
appearance26.BackColor = System.Drawing.Color.Transparent;
appearance26.TextHAlignAsString = "Left";
this.ultraLabel21.Appearance = appearance26;
this.ultraLabel21.Location = new System.Drawing.Point(11, 69);
this.ultraLabel21.Name = "ultraLabel21";
this.ultraLabel21.Size = new System.Drawing.Size(61, 22);
this.ultraLabel21.TabIndex = 11;
this.ultraLabel21.Text = "კოდექსი";
//
// ultraLabel22
//
appearance52.BackColor = System.Drawing.Color.Transparent;
appearance52.TextHAlignAsString = "Left";
this.ultraLabel22.Appearance = appearance52;
this.ultraLabel22.Location = new System.Drawing.Point(61, 31);
this.ultraLabel22.Name = "ultraLabel22";
this.ultraLabel22.Size = new System.Drawing.Size(290, 24);
this.ultraLabel22.TabIndex = 3;
this.ultraLabel22.Text = "პანელების ადგილმდებარეობა შინახოს";
//
// ZoomICG
//
this.ZoomICG.ButtonStyle = Infragistics.Win.UIElementButtonStyle.WindowsXPCommandButton;
this.ZoomICG.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.Office2007;
valueListItem24.DataValue = "10";
valueListItem24.DisplayText = "10%";
valueListItem25.DataValue = "20";
valueListItem25.DisplayText = "20%";
valueListItem26.DataValue = "50";
valueListItem26.DisplayText = "50%";
valueListItem27.DataValue = "100";
valueListItem27.DisplayText = "100%";
valueListItem28.DataValue = "150";
valueListItem28.DisplayText = "150%";
valueListItem29.DataValue = "200";
valueListItem29.DisplayText = "200%";
valueListItem30.DataValue = "400";
valueListItem30.DisplayText = "400%";
valueListItem31.DataValue = "–20";
valueListItem31.DisplayText = "გვ.სიგანე";
valueListItem32.DataValue = "–10";
valueListItem32.DisplayText = "გვ.სიმაღლე";
this.ZoomICG.Items.AddRange(new Infragistics.Win.ValueListItem[] {
valueListItem24,
valueListItem25,
valueListItem26,
valueListItem27,
valueListItem28,
valueListItem29,
valueListItem30,
valueListItem31,
valueListItem32});
this.ZoomICG.Location = new System.Drawing.Point(141, 121);
this.ZoomICG.Name = "ZoomICG";
this.ZoomICG.Size = new System.Drawing.Size(116, 21);
this.ZoomICG.TabIndex = 22;
this.ZoomICG.UseOsThemes = Infragistics.Win.DefaultableBoolean.False;
//
// ZoomCGL
//
this.ZoomCGL.ButtonStyle = Infragistics.Win.UIElementButtonStyle.WindowsXPCommandButton;
this.ZoomCGL.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.Office2007;
valueListItem33.DataValue = "10";
valueListItem33.DisplayText = "10%";
valueListItem34.DataValue = "20";
valueListItem34.DisplayText = "20%";
valueListItem35.DataValue = "50";
valueListItem35.DisplayText = "50%";
valueListItem36.DataValue = "100";
valueListItem36.DisplayText = "100%";
valueListItem37.DataValue = "150";
valueListItem37.DisplayText = "150%";
valueListItem38.DataValue = "200";
valueListItem38.DisplayText = "200%";
valueListItem39.DataValue = "400";
valueListItem39.DisplayText = "400%";
valueListItem40.DataValue = "–20";
valueListItem40.DisplayText = "გვ.სიგანე";
valueListItem41.DataValue = "–10";
valueListItem41.DisplayText = "გვ.სიმაღლე";
this.ZoomCGL.Items.AddRange(new Infragistics.Win.ValueListItem[] {
valueListItem33,
valueListItem34,
valueListItem35,
valueListItem36,
valueListItem37,
valueListItem38,
valueListItem39,
valueListItem40,
valueListItem41});
this.ZoomCGL.Location = new System.Drawing.Point(141, 89);
this.ZoomCGL.Name = "ZoomCGL";
this.ZoomCGL.Size = new System.Drawing.Size(116, 21);
this.ZoomCGL.TabIndex = 21;
this.ZoomCGL.UseOsThemes = Infragistics.Win.DefaultableBoolean.False;
//
// ViewICG
//
this.ViewICG.ButtonStyle = Infragistics.Win.UIElementButtonStyle.WindowsXPCommandButton;
this.ViewICG.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.Office2007;
this.ViewICG.DropDownStyle = Infragistics.Win.DropDownStyle.DropDownList;
valueListItem42.DataValue = "0";
valueListItem42.DisplayText = "გვერდებით";
valueListItem43.DataValue = "1";
valueListItem43.DisplayText = "უწყვეტი";
this.ViewICG.Items.AddRange(new Infragistics.Win.ValueListItem[] {
valueListItem42,
valueListItem43});
this.ViewICG.Location = new System.Drawing.Point(286, 118);
this.ViewICG.Name = "ViewICG";
this.ViewICG.Size = new System.Drawing.Size(116, 21);
this.ViewICG.TabIndex = 20;
this.ViewICG.UseOsThemes = Infragistics.Win.DefaultableBoolean.False;
//
// ViewCGL
//
this.ViewCGL.ButtonStyle = Infragistics.Win.UIElementButtonStyle.WindowsXPCommandButton;
this.ViewCGL.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.Office2007;
this.ViewCGL.DropDownStyle = Infragistics.Win.DropDownStyle.DropDownList;
valueListItem44.DataValue = "0";
valueListItem44.DisplayText = "გვერდებით";
valueListItem45.DataValue = "1";
valueListItem45.DisplayText = "უწყვეტი";
this.ViewCGL.Items.AddRange(new Infragistics.Win.ValueListItem[] {
valueListItem44,
valueListItem45});
this.ViewCGL.Location = new System.Drawing.Point(286, 89);
this.ViewCGL.Name = "ViewCGL";
this.ViewCGL.Size = new System.Drawing.Size(116, 21);
this.ViewCGL.TabIndex = 19;
this.ViewCGL.UseOsThemes = Infragistics.Win.DefaultableBoolean.False;
//
// ViewCodex
//
this.ViewCodex.ButtonStyle = Infragistics.Win.UIElementButtonStyle.WindowsXPCommandButton;
this.ViewCodex.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.Office2007;
this.ViewCodex.DropDownStyle = Infragistics.Win.DropDownStyle.DropDownList;
valueListItem46.DataValue = "0";
valueListItem46.DisplayText = "გვერდებით";
valueListItem47.DataValue = "1";
valueListItem47.DisplayText = "უწყვეტი";
this.ViewCodex.Items.AddRange(new Infragistics.Win.ValueListItem[] {
valueListItem46,
valueListItem47});
this.ViewCodex.Location = new System.Drawing.Point(286, 60);
this.ViewCodex.Name = "ViewCodex";
this.ViewCodex.Size = new System.Drawing.Size(116, 21);
this.ViewCodex.TabIndex = 18;
this.ViewCodex.UseOsThemes = Infragistics.Win.DefaultableBoolean.False;
//
// ultraLabel17
//
appearance29.BackColor = System.Drawing.Color.Transparent;
appearance29.TextHAlignAsString = "Left";
this.ultraLabel17.Appearance = appearance29;
this.ultraLabel17.Location = new System.Drawing.Point(286, 31);
this.ultraLabel17.Name = "ultraLabel17";
this.ultraLabel17.Size = new System.Drawing.Size(154, 24);
this.ultraLabel17.TabIndex = 17;
this.ultraLabel17.Text = "ხედვა გაჩუმებით";
//
// ZoomCodex
//
this.ZoomCodex.ButtonStyle = Infragistics.Win.UIElementButtonStyle.WindowsXPCommandButton;
this.ZoomCodex.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.Office2007;
valueListItem48.DataValue = "10";
valueListItem48.DisplayText = "10%";
valueListItem49.DataValue = "20";
valueListItem49.DisplayText = "20%";
valueListItem50.DataValue = "50";
valueListItem50.DisplayText = "50%";
valueListItem51.DataValue = "100";
valueListItem51.DisplayText = "100%";
valueListItem52.DataValue = "150";
valueListItem52.DisplayText = "150%";
valueListItem53.DataValue = "200";
valueListItem53.DisplayText = "200%";
valueListItem54.DataValue = "400";
valueListItem54.DisplayText = "400%";
valueListItem55.DataValue = "–20";
valueListItem55.DisplayText = "გვ.სიგანე";
valueListItem56.DataValue = "–10";
valueListItem56.DisplayText = "გვ.სიმაღლე";
this.ZoomCodex.Items.AddRange(new Infragistics.Win.ValueListItem[] {
valueListItem48,
valueListItem49,
valueListItem50,
valueListItem51,
valueListItem52,
valueListItem53,
valueListItem54,
valueListItem55,
valueListItem56});
this.ZoomCodex.Location = new System.Drawing.Point(141, 60);
this.ZoomCodex.Name = "ZoomCodex";
this.ZoomCodex.Size = new System.Drawing.Size(116, 21);
this.ZoomCodex.TabIndex = 14;
this.ZoomCodex.UseOsThemes = Infragistics.Win.DefaultableBoolean.False;
//
// ultraLabel13
//
appearance36.BackColor = System.Drawing.Color.Transparent;
appearance36.TextHAlignAsString = "Left";
this.ultraLabel13.Appearance = appearance36;
this.ultraLabel13.Location = new System.Drawing.Point(11, 121);
this.ultraLabel13.Name = "ultraLabel13";
this.ultraLabel13.Size = new System.Drawing.Size(120, 22);
this.ultraLabel13.TabIndex = 13;
this.ultraLabel13.Text = "ხელშეკრულებები";
//
// ultraLabel14
//
appearance37.BackColor = System.Drawing.Color.Transparent;
appearance37.TextHAlignAsString = "Left";
this.ultraLabel14.Appearance = appearance37;
this.ultraLabel14.Location = new System.Drawing.Point(11, 92);
this.ultraLabel14.Name = "ultraLabel14";
this.ultraLabel14.Size = new System.Drawing.Size(120, 22);
this.ultraLabel14.TabIndex = 12;
this.ultraLabel14.Text = "კოდიფიცირებული";
//
// ultraLabel15
//
appearance38.BackColor = System.Drawing.Color.Transparent;
appearance38.TextHAlignAsString = "Left";
this.ultraLabel15.Appearance = appearance38;
this.ultraLabel15.Location = new System.Drawing.Point(11, 63);
this.ultraLabel15.Name = "ultraLabel15";
this.ultraLabel15.Size = new System.Drawing.Size(61, 22);
this.ultraLabel15.TabIndex = 11;
this.ultraLabel15.Text = "კოდექსი";
//
// ultraLabel16
//
appearance40.BackColor = System.Drawing.Color.Transparent;
appearance40.TextHAlignAsString = "Left";
this.ultraLabel16.Appearance = appearance40;
this.ultraLabel16.Location = new System.Drawing.Point(141, 31);
this.ultraLabel16.Name = "ultraLabel16";
this.ultraLabel16.Size = new System.Drawing.Size(130, 24);
this.ultraLabel16.TabIndex = 3;
this.ultraLabel16.Text = "მაშტაბი გაჩუმებით";
//
// _Form1_Toolbars_Dock_Area_Top
//
this._Form1_Toolbars_Dock_Area_Top.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
this._Form1_Toolbars_Dock_Area_Top.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(223)))), ((int)(((byte)(233)))), ((int)(((byte)(245)))));
this._Form1_Toolbars_Dock_Area_Top.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Top;
this._Form1_Toolbars_Dock_Area_Top.ForeColor = System.Drawing.SystemColors.ControlText;
this._Form1_Toolbars_Dock_Area_Top.Location = new System.Drawing.Point(0, 0);
this._Form1_Toolbars_Dock_Area_Top.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this._Form1_Toolbars_Dock_Area_Top.Name = "_Form1_Toolbars_Dock_Area_Top";
this._Form1_Toolbars_Dock_Area_Top.Size = new System.Drawing.Size(670, 24);
this._Form1_Toolbars_Dock_Area_Top.ToolbarsManager = this.ultraToolbarsManager1;
this._Form1_Toolbars_Dock_Area_Top.UseAppStyling = false;
//
// ultraToolbarsManager1
//
this.ultraToolbarsManager1.DesignerFlags = 1;
this.ultraToolbarsManager1.DockWithinContainer = this;
this.ultraToolbarsManager1.DockWithinContainerBaseType = typeof(System.Windows.Forms.Form);
this.ultraToolbarsManager1.ShowFullMenusDelay = 500;
this.ultraToolbarsManager1.Style = Infragistics.Win.UltraWinToolbars.ToolbarStyle.ScenicRibbon;
ultraToolbar1.DockedColumn = 0;
ultraToolbar1.DockedRow = 0;
ultraToolbar1.NonInheritedTools.AddRange(new Infragistics.Win.UltraWinToolbars.ToolBase[] {
popupMenuTool2,
popupMenuTool1});
ultraToolbar1.Settings.AllowCustomize = Infragistics.Win.DefaultableBoolean.False;
ultraToolbar1.Settings.AllowFloating = Infragistics.Win.DefaultableBoolean.False;
ultraToolbar1.Settings.AllowHiding = Infragistics.Win.DefaultableBoolean.False;
appearance45.FontData.Name = "Sylfaen";
appearance45.FontData.SizeInPoints = 9.25F;
ultraToolbar1.Settings.Appearance = appearance45;
ultraToolbar1.Settings.FillEntireRow = Infragistics.Win.DefaultableBoolean.True;
ultraToolbar1.Settings.GrabHandleStyle = Infragistics.Win.UltraWinToolbars.GrabHandleStyle.None;
appearance46.FontData.Name = "Sylfaen";
appearance46.FontData.SizeInPoints = 9.25F;
ultraToolbar1.Settings.ToolAppearance = appearance46;
ultraToolbar1.Settings.UseLargeImages = Infragistics.Win.DefaultableBoolean.True;
ultraToolbar1.Text = "MainBar";
this.ultraToolbarsManager1.Toolbars.AddRange(new Infragistics.Win.UltraWinToolbars.UltraToolbar[] {
ultraToolbar1});
popupMenuTool3.DropDownArrowStyle = Infragistics.Win.UltraWinToolbars.DropDownArrowStyle.None;
appearance47.Image = global::ILG.Codex.Codex2007.Properties.Resources.help_32x32;
popupMenuTool3.SharedPropsInternal.AppearancesLarge.Appearance = appearance47;
popupMenuTool3.SharedPropsInternal.Caption = "დახმარება";
popupMenuTool3.SharedPropsInternal.Category = "Menu";
popupMenuTool3.SharedPropsInternal.CustomizerCaption = "HelpMenu";
buttonTool17.InstanceProps.IsFirstInGroup = true;
buttonTool2.InstanceProps.IsFirstInGroup = true;
buttonTool4.InstanceProps.IsFirstInGroup = true;
popupMenuTool3.Tools.AddRange(new Infragistics.Win.UltraWinToolbars.ToolBase[] {
buttonTool17,
buttonTool2,
buttonTool3,
buttonTool4});
popupMenuTool4.DropDownArrowStyle = Infragistics.Win.UltraWinToolbars.DropDownArrowStyle.None;
popupMenuTool4.SharedPropsInternal.Caption = "კონფიგურაცია";
popupMenuTool4.SharedPropsInternal.Category = "Menu";
popupMenuTool4.SharedPropsInternal.CustomizerCaption = "ConfigurationMenu";
buttonTool16.InstanceProps.IsFirstInGroup = true;
popupMenuTool4.Tools.AddRange(new Infragistics.Win.UltraWinToolbars.ToolBase[] {
buttonTool19,
buttonTool20,
buttonTool16});
buttonTool7.SharedPropsInternal.Caption = "პროგრამის შესახებ";
buttonTool7.SharedPropsInternal.Category = "Help";
buttonTool7.SharedPropsInternal.CustomizerCaption = "პროგრამის შესახებ";
buttonTool8.SharedPropsInternal.Caption = "დახმარება";
buttonTool8.SharedPropsInternal.Category = "Help";
buttonTool8.SharedPropsInternal.CustomizerCaption = "დახმარება";
buttonTool9.SharedPropsInternal.Caption = "დაგვიკავშირდით";
buttonTool9.SharedPropsInternal.Category = "Help";
buttonTool9.SharedPropsInternal.CustomizerCaption = "დაგვიკავშირდით";
buttonTool10.SharedPropsInternal.Caption = "კოდექსის Web საიტი";
buttonTool10.SharedPropsInternal.Category = "Help";
buttonTool10.SharedPropsInternal.CustomizerCaption = "კოდექსის Web საიტი";
buttonTool11.SharedPropsInternal.Caption = "კონფიგურაცია";
buttonTool11.SharedPropsInternal.Category = "Config";
buttonTool11.SharedPropsInternal.CustomizerCaption = "კონფიგურაცია";
buttonTool12.SharedPropsInternal.Caption = "ტექნიკური დახმარება";
buttonTool12.SharedPropsInternal.Category = "Config";
buttonTool12.SharedPropsInternal.CustomizerCaption = "ტექნიკური დახმარება";
buttonTool13.SharedPropsInternal.Caption = "პროგრამა";
popupMenuTool5.DropDownArrowStyle = Infragistics.Win.UltraWinToolbars.DropDownArrowStyle.None;
popupMenuTool5.SharedPropsInternal.Caption = "ფაილი";
buttonTool14.SharedPropsInternal.Caption = "გამოსვლა";
buttonTool1.SharedPropsInternal.Caption = "ჩაწერა";
buttonTool18.SharedPropsInternal.Caption = "მიღება";
this.ultraToolbarsManager1.Tools.AddRange(new Infragistics.Win.UltraWinToolbars.ToolBase[] {
popupMenuTool3,
popupMenuTool4,
buttonTool7,
buttonTool8,
buttonTool9,
buttonTool10,
buttonTool11,
buttonTool12,
buttonTool13,
popupMenuTool5,
buttonTool14,
buttonTool1,
buttonTool18});
this.ultraToolbarsManager1.UseAppStyling = false;
this.ultraToolbarsManager1.ToolClick += new Infragistics.Win.UltraWinToolbars.ToolClickEventHandler(this.ultraToolbarsManager1_ToolClick);
//
// _Form1_Toolbars_Dock_Area_Bottom
//
this._Form1_Toolbars_Dock_Area_Bottom.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
this._Form1_Toolbars_Dock_Area_Bottom.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(223)))), ((int)(((byte)(233)))), ((int)(((byte)(245)))));
this._Form1_Toolbars_Dock_Area_Bottom.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Bottom;
this._Form1_Toolbars_Dock_Area_Bottom.ForeColor = System.Drawing.SystemColors.ControlText;
this._Form1_Toolbars_Dock_Area_Bottom.Location = new System.Drawing.Point(0, 523);
this._Form1_Toolbars_Dock_Area_Bottom.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this._Form1_Toolbars_Dock_Area_Bottom.Name = "_Form1_Toolbars_Dock_Area_Bottom";
this._Form1_Toolbars_Dock_Area_Bottom.Size = new System.Drawing.Size(670, 0);
this._Form1_Toolbars_Dock_Area_Bottom.ToolbarsManager = this.ultraToolbarsManager1;
this._Form1_Toolbars_Dock_Area_Bottom.UseAppStyling = false;
//
// _Form1_Toolbars_Dock_Area_Left
//
this._Form1_Toolbars_Dock_Area_Left.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
this._Form1_Toolbars_Dock_Area_Left.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(223)))), ((int)(((byte)(233)))), ((int)(((byte)(245)))));
this._Form1_Toolbars_Dock_Area_Left.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Left;
this._Form1_Toolbars_Dock_Area_Left.ForeColor = System.Drawing.SystemColors.ControlText;
this._Form1_Toolbars_Dock_Area_Left.Location = new System.Drawing.Point(0, 24);
this._Form1_Toolbars_Dock_Area_Left.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this._Form1_Toolbars_Dock_Area_Left.Name = "_Form1_Toolbars_Dock_Area_Left";
this._Form1_Toolbars_Dock_Area_Left.Size = new System.Drawing.Size(0, 499);
this._Form1_Toolbars_Dock_Area_Left.ToolbarsManager = this.ultraToolbarsManager1;
this._Form1_Toolbars_Dock_Area_Left.UseAppStyling = false;
//
// _Form1_Toolbars_Dock_Area_Right
//
this._Form1_Toolbars_Dock_Area_Right.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
this._Form1_Toolbars_Dock_Area_Right.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(223)))), ((int)(((byte)(233)))), ((int)(((byte)(245)))));
this._Form1_Toolbars_Dock_Area_Right.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Right;
this._Form1_Toolbars_Dock_Area_Right.ForeColor = System.Drawing.SystemColors.ControlText;
this._Form1_Toolbars_Dock_Area_Right.Location = new System.Drawing.Point(670, 24);
this._Form1_Toolbars_Dock_Area_Right.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this._Form1_Toolbars_Dock_Area_Right.Name = "_Form1_Toolbars_Dock_Area_Right";
this._Form1_Toolbars_Dock_Area_Right.Size = new System.Drawing.Size(0, 499);
this._Form1_Toolbars_Dock_Area_Right.ToolbarsManager = this.ultraToolbarsManager1;
this._Form1_Toolbars_Dock_Area_Right.UseAppStyling = false;
//
// ultraTabControl4
//
appearance5.ImageBackground = global::ILG.Codex.Codex2007.Properties.Resources.LeftL1;
appearance5.ImageBackgroundStyle = Infragistics.Win.ImageBackgroundStyle.Stretched;
this.ultraTabControl4.Appearance = appearance5;
this.ultraTabControl4.Controls.Add(this.ultraTabSharedControlsPage4);
this.ultraTabControl4.Controls.Add(this.ultraTabPageControl11);
this.ultraTabControl4.Dock = System.Windows.Forms.DockStyle.Left;
this.ultraTabControl4.Location = new System.Drawing.Point(0, 24);
this.ultraTabControl4.Name = "ultraTabControl4";
this.ultraTabControl4.SharedControlsPage = this.ultraTabSharedControlsPage4;
this.ultraTabControl4.Size = new System.Drawing.Size(160, 499);
this.ultraTabControl4.Style = Infragistics.Win.UltraWinTabControl.UltraTabControlStyle.Wizard;
this.ultraTabControl4.TabIndex = 13;
ultraTab1.TabPage = this.ultraTabPageControl11;
ultraTab1.Text = "tab1";
this.ultraTabControl4.Tabs.AddRange(new Infragistics.Win.UltraWinTabControl.UltraTab[] {
ultraTab1});
//
// ultraTabSharedControlsPage4
//
this.ultraTabSharedControlsPage4.Location = new System.Drawing.Point(-10000, -10000);
this.ultraTabSharedControlsPage4.Name = "ultraTabSharedControlsPage4";
this.ultraTabSharedControlsPage4.Size = new System.Drawing.Size(160, 499);
//
// ultraTabControl1
//
this.ultraTabControl1.Controls.Add(this.ultraTabSharedControlsPage1);
this.ultraTabControl1.Controls.Add(this.ultraTabPageControl5);
this.ultraTabControl1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.ultraTabControl1.Location = new System.Drawing.Point(160, 476);
this.ultraTabControl1.Name = "ultraTabControl1";
this.ultraTabControl1.SharedControlsPage = this.ultraTabSharedControlsPage1;
this.ultraTabControl1.Size = new System.Drawing.Size(510, 47);
this.ultraTabControl1.Style = Infragistics.Win.UltraWinTabControl.UltraTabControlStyle.Wizard;
this.ultraTabControl1.TabIndex = 14;
ultraTab3.TabPage = this.ultraTabPageControl5;
ultraTab3.Text = "tab1";
this.ultraTabControl1.Tabs.AddRange(new Infragistics.Win.UltraWinTabControl.UltraTab[] {
ultraTab3});
this.ultraTabControl1.ViewStyle = Infragistics.Win.UltraWinTabControl.ViewStyle.Office2007;
//
// ultraTabSharedControlsPage1
//
this.ultraTabSharedControlsPage1.Location = new System.Drawing.Point(-10000, -10000);
this.ultraTabSharedControlsPage1.Name = "ultraTabSharedControlsPage1";
this.ultraTabSharedControlsPage1.Size = new System.Drawing.Size(510, 47);
//
// ultraTabControl5
//
appearance22.BackColor = System.Drawing.Color.White;
this.ultraTabControl5.Appearance = appearance22;
this.ultraTabControl5.Controls.Add(this.ultraTabSharedControlsPage5);
this.ultraTabControl5.Controls.Add(this.ultraTabPageControl6);
this.ultraTabControl5.Dock = System.Windows.Forms.DockStyle.Top;
this.ultraTabControl5.Location = new System.Drawing.Point(160, 24);
this.ultraTabControl5.Name = "ultraTabControl5";
this.ultraTabControl5.SharedControlsPage = this.ultraTabSharedControlsPage5;
this.ultraTabControl5.Size = new System.Drawing.Size(510, 47);
this.ultraTabControl5.Style = Infragistics.Win.UltraWinTabControl.UltraTabControlStyle.Wizard;
this.ultraTabControl5.TabIndex = 15;
this.ultraTabControl5.TabPageMargins.Top = 4;
ultraTab6.TabPage = this.ultraTabPageControl6;
ultraTab6.Text = "tab1";
this.ultraTabControl5.Tabs.AddRange(new Infragistics.Win.UltraWinTabControl.UltraTab[] {
ultraTab6});
//
// ultraTabSharedControlsPage5
//
this.ultraTabSharedControlsPage5.Location = new System.Drawing.Point(-10000, -10000);
this.ultraTabSharedControlsPage5.Name = "ultraTabSharedControlsPage5";
this.ultraTabSharedControlsPage5.Size = new System.Drawing.Size(510, 43);
//
// Configuration
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.WhiteSmoke;
this.ClientSize = new System.Drawing.Size(670, 523);
this.Controls.Add(this.ultraTabControl2);
this.Controls.Add(this.ultraTabControl5);
this.Controls.Add(this.ultraTabControl1);
this.Controls.Add(this.ultraTabControl4);
this.Controls.Add(this._Form1_Toolbars_Dock_Area_Left);
this.Controls.Add(this._Form1_Toolbars_Dock_Area_Right);
this.Controls.Add(this._Form1_Toolbars_Dock_Area_Top);
this.Controls.Add(this._Form1_Toolbars_Dock_Area_Bottom);
this.Font = new System.Drawing.Font("Sylfaen", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "Configuration";
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "კონფიგურაცია";
this.Load += new System.EventHandler(this.Form2_Load);
this.ultraTabPageControl1.ResumeLayout(false);
this.ultraTabPageControl1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.ultraTextEditor2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.ultraTextEditor3)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.ultraTextEditor1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.ultraGroupBox1)).EndInit();
this.ultraGroupBox1.ResumeLayout(false);
this.ultraGroupBox1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.ultraTextEditor4)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.ultraTextEditor5)).EndInit();
this.ultraTabPageControl2.ResumeLayout(false);
this.ultraTabPageControl2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.ultraCheckEditor1)).EndInit();
this.ultraPanel1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.DockDS)).EndInit();
this.ultraPanel3.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.ViewDS)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.ultraComboEditor1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.ZoomDS)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.ultraTextEditor6)).EndInit();
this.ultraTabPageControl11.ResumeLayout(false);
this.ultraTabPageControl11.PerformLayout();
this.ultraTabPageControl5.ResumeLayout(false);
this.ultraTabPageControl6.ResumeLayout(false);
this.ultraTabPageControl6.PerformLayout();
this.ultraPanel9.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.ultraTabControl2)).EndInit();
this.ultraTabControl2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.DockICG)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.DockCGL)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.DockCodex)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.ZoomICG)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.ZoomCGL)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.ViewICG)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.ViewCGL)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.ViewCodex)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.ZoomCodex)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.ultraToolbarsManager1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.ultraTabControl4)).EndInit();
this.ultraTabControl4.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.ultraTabControl1)).EndInit();
this.ultraTabControl1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.ultraTabControl5)).EndInit();
this.ultraTabControl5.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private Infragistics.Win.UltraWinTabControl.UltraTabControl ultraTabControl2;
private Infragistics.Win.UltraWinTabControl.UltraTabSharedControlsPage ultraTabSharedControlsPage2;
private Infragistics.Win.UltraWinTabControl.UltraTabPageControl ultraTabPageControl1;
private Infragistics.Win.UltraWinTabControl.UltraTabPageControl ultraTabPageControl2;
private Infragistics.Win.Misc.UltraButton ultraButton1;
private Infragistics.Win.Misc.UltraButton ultraButton2;
private Infragistics.Win.Misc.UltraButton ultraButton3;
private Infragistics.Win.Misc.UltraLabel ultraLabel3;
private Infragistics.Win.UltraWinEditors.UltraTextEditor ultraTextEditor3;
private Infragistics.Win.Misc.UltraLabel ultraLabel2;
private Infragistics.Win.UltraWinEditors.UltraTextEditor ultraTextEditor2;
private Infragistics.Win.Misc.UltraGroupBox ultraGroupBox1;
private System.Windows.Forms.RadioButton radioButton2;
private System.Windows.Forms.RadioButton radioButton1;
private System.Windows.Forms.CheckBox checkBox1;
private Infragistics.Win.Misc.UltraLabel ultraLabel4;
private Infragistics.Win.UltraWinEditors.UltraTextEditor ultraTextEditor4;
private Infragistics.Win.Misc.UltraLabel ultraLabel5;
private Infragistics.Win.UltraWinEditors.UltraTextEditor ultraTextEditor5;
private Infragistics.Win.Misc.UltraButton ultraButton5;
private Infragistics.Win.Misc.UltraButton ultraButton4;
private Infragistics.Win.UltraWinEditors.UltraTextEditor ultraTextEditor1;
private Infragistics.Win.Misc.UltraLabel ultraLabel1;
private Infragistics.Win.UltraWinToolTip.UltraToolTipManager ultraToolTipManager1;
private Infragistics.Win.UltraWinEditors.UltraComboEditor ultraComboEditor1;
private Infragistics.Win.UltraWinEditors.UltraTextEditor ultraTextEditor6;
private Infragistics.Win.Misc.UltraLabel ultraLabel7;
public System.Windows.Forms.LinkLabel DetailLabel;
private Infragistics.Win.UltraWinTabControl.UltraTabPageControl ultraTabPageControl3;
private Infragistics.Win.UltraWinEditors.UltraCheckEditor ultraCheckEditor1;
private Infragistics.Win.UltraWinTabControl.UltraTabPageControl ultraTabPageControl4;
private Infragistics.Win.UltraWinEditors.UltraComboEditor DockICG;
private Infragistics.Win.UltraWinEditors.UltraComboEditor DockCGL;
private Infragistics.Win.UltraWinEditors.UltraComboEditor DockCodex;
private Infragistics.Win.Misc.UltraLabel ultraLabel19;
private Infragistics.Win.Misc.UltraLabel ultraLabel20;
private Infragistics.Win.Misc.UltraLabel ultraLabel21;
private Infragistics.Win.UltraWinEditors.UltraPictureBox ultraPictureBox10;
private Infragistics.Win.Misc.UltraLabel ultraLabel22;
private Infragistics.Win.UltraWinEditors.UltraComboEditor ZoomICG;
private Infragistics.Win.UltraWinEditors.UltraComboEditor ZoomCGL;
private Infragistics.Win.UltraWinEditors.UltraComboEditor ViewICG;
private Infragistics.Win.UltraWinEditors.UltraComboEditor ViewCGL;
private Infragistics.Win.UltraWinEditors.UltraComboEditor ViewCodex;
private Infragistics.Win.Misc.UltraLabel ultraLabel17;
private Infragistics.Win.UltraWinEditors.UltraComboEditor ZoomCodex;
private Infragistics.Win.Misc.UltraLabel ultraLabel13;
private Infragistics.Win.Misc.UltraLabel ultraLabel14;
private Infragistics.Win.Misc.UltraLabel ultraLabel15;
private Infragistics.Win.UltraWinEditors.UltraPictureBox ultraPictureBox9;
private Infragistics.Win.Misc.UltraLabel ultraLabel16;
private Infragistics.Win.UltraWinEditors.UltraComboEditor ViewDS;
private Infragistics.Win.Misc.UltraLabel ultraLabel8;
private Infragistics.Win.UltraWinEditors.UltraComboEditor ZoomDS;
private Infragistics.Win.Misc.UltraLabel ultraLabel26;
private Infragistics.Win.UltraWinEditors.UltraComboEditor DockDS;
private Infragistics.Win.Misc.UltraLabel ultraLabel9;
public System.Windows.Forms.LinkLabel linkLabel1;
private System.Windows.Forms.CheckBox checkBox2;
private Infragistics.Win.UltraWinTabControl.UltraTabControl ultraTabControl5;
private Infragistics.Win.UltraWinTabControl.UltraTabSharedControlsPage ultraTabSharedControlsPage5;
private Infragistics.Win.UltraWinTabControl.UltraTabPageControl ultraTabPageControl6;
private Infragistics.Win.Misc.UltraPanel ultraPanel9;
private Infragistics.Win.UltraWinEditors.UltraPictureBox ultraPictureBox11;
private Infragistics.Win.Misc.UltraLabel ultraLabel12;
private Infragistics.Win.UltraWinTabControl.UltraTabControl ultraTabControl1;
private Infragistics.Win.UltraWinTabControl.UltraTabSharedControlsPage ultraTabSharedControlsPage1;
private Infragistics.Win.UltraWinTabControl.UltraTabPageControl ultraTabPageControl5;
private Infragistics.Win.UltraWinTabControl.UltraTabControl ultraTabControl4;
private Infragistics.Win.UltraWinTabControl.UltraTabSharedControlsPage ultraTabSharedControlsPage4;
private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _Form1_Toolbars_Dock_Area_Left;
private Infragistics.Win.UltraWinToolbars.UltraToolbarsManager ultraToolbarsManager1;
private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _Form1_Toolbars_Dock_Area_Right;
private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _Form1_Toolbars_Dock_Area_Top;
private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _Form1_Toolbars_Dock_Area_Bottom;
private Infragistics.Win.UltraWinEditors.UltraPictureBox ultraPictureBox3;
private Infragistics.Win.UltraWinEditors.UltraPictureBox ultraPictureBox2;
private Infragistics.Win.UltraWinEditors.UltraPictureBox ultraPictureBox4;
private Infragistics.Win.Misc.UltraPanel ultraPanel1;
private Infragistics.Win.UltraWinEditors.UltraPictureBox ultraPictureBox5;
private Infragistics.Win.Misc.UltraPanel ultraPanel3;
private Infragistics.Win.Misc.UltraLabel ultraLabel10;
private Infragistics.Win.UltraWinEditors.UltraPictureBox ultraPictureBox1;
private Infragistics.Win.UltraWinTabControl.UltraTabPageControl ultraTabPageControl11;
public System.Windows.Forms.LinkLabel linkLabel3;
private Infragistics.Win.UltraWinEditors.UltraPictureBox ultraPictureBox12;
public System.Windows.Forms.LinkLabel linkLabel2;
private Infragistics.Win.UltraWinEditors.UltraPictureBox ultraPictureBox8;
private Infragistics.Win.Misc.UltraLabel ultraLabel33;
private Infragistics.Win.Misc.UltraLabel ultraLabel34;
private Infragistics.Win.UltraWinEditors.UltraPictureBox ultraPictureBox15;
}
} | 65.287007 | 305 | 0.675415 | [
"Unlicense"
] | IrakliLomidze/CodexDS13 | CodexDS14/CodexProgram/Configuration.Designer.cs | 125,287 | C# |
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Threading;
#nullable enable
namespace CommunityToolkit.Mvvm.DependencyInjection
{
/// <summary>
/// A type that facilitates the use of the <see cref="IServiceProvider"/> type.
/// The <see cref="Ioc"/> provides the ability to configure services in a singleton, thread-safe
/// service provider instance, which can then be used to resolve service instances.
/// The first step to use this feature is to declare some services, for instance:
/// <code>
/// public interface ILogger
/// {
/// void Log(string text);
/// }
/// </code>
/// <code>
/// public class ConsoleLogger : ILogger
/// {
/// void Log(string text) => Console.WriteLine(text);
/// }
/// </code>
/// Then the services configuration should then be done at startup, by calling the <see cref="ConfigureServices"/>
/// method and passing an <see cref="IServiceProvider"/> instance with the services to use. That instance can
/// be from any library offering dependency injection functionality, such as Microsoft.Extensions.DependencyInjection.
/// For instance, using that library, <see cref="ConfigureServices"/> can be used as follows in this example:
/// <code>
/// Ioc.Default.ConfigureServices(
/// new ServiceCollection()
/// .AddSingleton<ILogger, Logger>()
/// .BuildServiceProvider());
/// </code>
/// Finally, you can use the <see cref="Ioc"/> instance (which implements <see cref="IServiceProvider"/>)
/// to retrieve the service instances from anywhere in your application, by doing as follows:
/// <code>
/// Ioc.Default.GetService<ILogger>().Log("Hello world!");
/// </code>
/// </summary>
public sealed class Ioc : IServiceProvider
{
/// <summary>
/// Gets the default <see cref="Ioc"/> instance.
/// </summary>
public static Ioc Default { get; } = new();
/// <summary>
/// The <see cref="IServiceProvider"/> instance to use, if initialized.
/// </summary>
private volatile IServiceProvider? serviceProvider;
/// <inheritdoc/>
public object? GetService(Type serviceType)
{
// As per section I.12.6.6 of the official CLI ECMA-335 spec:
// "[...] read and write access to properly aligned memory locations no larger than the native
// word size is atomic when all the write accesses to a location are the same size. Atomic writes
// shall alter no bits other than those written. Unless explicit layout control is used [...],
// data elements no larger than the natural word size [...] shall be properly aligned.
// Object references shall be treated as though they are stored in the native word size."
// The field being accessed here is of native int size (reference type), and is only ever accessed
// directly and atomically by a compare exchange instruction (see below), or here. We can therefore
// assume this read is thread safe with respect to accesses to this property or to invocations to one
// of the available configuration methods. So we can just read the field directly and make the necessary
// check with our local copy, without the need of paying the locking overhead from this get accessor.
IServiceProvider? provider = this.serviceProvider;
if (provider is null)
{
ThrowInvalidOperationExceptionForMissingInitialization();
}
return provider!.GetService(serviceType);
}
/// <summary>
/// Tries to resolve an instance of a specified service type.
/// </summary>
/// <typeparam name="T">The type of service to resolve.</typeparam>
/// <returns>An instance of the specified service, or <see langword="null"/>.</returns>
/// <exception cref="InvalidOperationException">Throw if the current <see cref="Ioc"/> instance has not been initialized.</exception>
public T? GetService<T>()
where T : class
{
IServiceProvider? provider = this.serviceProvider;
if (provider is null)
{
ThrowInvalidOperationExceptionForMissingInitialization();
}
return (T?)provider!.GetService(typeof(T));
}
/// <summary>
/// Resolves an instance of a specified service type.
/// </summary>
/// <typeparam name="T">The type of service to resolve.</typeparam>
/// <returns>An instance of the specified service, or <see langword="null"/>.</returns>
/// <exception cref="InvalidOperationException">
/// Throw if the current <see cref="Ioc"/> instance has not been initialized, or if the
/// requested service type was not registered in the service provider currently in use.
/// </exception>
public T GetRequiredService<T>()
where T : class
{
IServiceProvider? provider = this.serviceProvider;
if (provider is null)
{
ThrowInvalidOperationExceptionForMissingInitialization();
}
T? service = (T?)provider!.GetService(typeof(T));
if (service is null)
{
ThrowInvalidOperationExceptionForUnregisteredType();
}
return service!;
}
/// <summary>
/// Initializes the shared <see cref="IServiceProvider"/> instance.
/// </summary>
/// <param name="serviceProvider">The input <see cref="IServiceProvider"/> instance to use.</param>
public void ConfigureServices(IServiceProvider serviceProvider)
{
IServiceProvider? oldServices = Interlocked.CompareExchange(ref this.serviceProvider, serviceProvider, null);
if (oldServices is not null)
{
ThrowInvalidOperationExceptionForRepeatedConfiguration();
}
}
/// <summary>
/// Throws an <see cref="InvalidOperationException"/> when the <see cref="IServiceProvider"/> property is used before initialization.
/// </summary>
private static void ThrowInvalidOperationExceptionForMissingInitialization()
{
throw new InvalidOperationException("The service provider has not been configured yet");
}
/// <summary>
/// Throws an <see cref="InvalidOperationException"/> when the <see cref="IServiceProvider"/> property is missing a type registration.
/// </summary>
private static void ThrowInvalidOperationExceptionForUnregisteredType()
{
throw new InvalidOperationException("The requested service type was not registered");
}
/// <summary>
/// Throws an <see cref="InvalidOperationException"/> when a configuration is attempted more than once.
/// </summary>
private static void ThrowInvalidOperationExceptionForRepeatedConfiguration()
{
throw new InvalidOperationException("The default service provider has already been configured");
}
}
} | 44.664671 | 142 | 0.630379 | [
"MIT"
] | ehtick/Uno.WindowsCommunityToolkit | CommunityToolkit.Mvvm/DependencyInjection/Ioc.cs | 7,459 | C# |
//
// ReplicationTest.cs
//
// Author:
// Zachary Gramana <zack@xamarin.com>
//
// Copyright (c) 2014 Xamarin Inc
// Copyright (c) 2014 .NET Foundation
//
// 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.
//
//
// Copyright (c) 2014 Couchbase, Inc. 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. 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;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using Couchbase.Lite.Auth;
using Couchbase.Lite.Internal;
using Couchbase.Lite.Replicator;
using Couchbase.Lite.Tests;
using Couchbase.Lite.Util;
using ICSharpCode.SharpZipLib.Zip;
using Newtonsoft.Json.Linq;
using NUnit.Framework;
using System.Net.Sockets;
using Couchbase.Lite.Revisions;
using System.Diagnostics;
using FluentAssertions;
#if NET_3_5
using WebRequest = System.Net.Couchbase.WebRequest;
using HttpWebRequest = System.Net.Couchbase.HttpWebRequest;
using HttpWebResponse = System.Net.Couchbase.HttpWebResponse;
using WebException = System.Net.Couchbase.WebException;
#endif
namespace Couchbase.Lite
{
[TestFixture("ForestDB")]
public class ReplicationTest : LiteTestCase
{
private const string Tag = "ReplicationTest";
private const string TEMP_DB_NAME = "testing_tmp";
private SyncGateway _sg;
private static int _dbCounter = 0;
private HttpClient _httpClient = new HttpClient();
public ReplicationTest(string storageType) : base(storageType) {}
private class ReplicationIdleObserver
{
private readonly CountdownEvent doneSignal;
internal ReplicationIdleObserver(CountdownEvent doneSignal) {
this.doneSignal = doneSignal;
}
public void Changed(object sender, ReplicationChangeEventArgs args) {
var replicator = args.Source;
if (replicator.Status == ReplicationStatus.Idle && doneSignal.CurrentCount > 0) {
doneSignal.Signal();
}
}
}
private class ReplicationErrorObserver
{
private readonly CountdownEvent doneSignal;
internal ReplicationErrorObserver(CountdownEvent doneSignal) {
this.doneSignal = doneSignal;
}
public void Changed(object sender, ReplicationChangeEventArgs args) {
if (args.LastError != null && doneSignal.CurrentCount > 0) {
doneSignal.Signal();
}
}
}
private string TempDbName()
{
return TEMP_DB_NAME + _dbCounter++;
}
private void PutReplicationOffline(Replication replication)
{
var doneEvent = new ManualResetEvent(false);
replication.Changed += (object sender, ReplicationChangeEventArgs e) =>
{
if (e.Source.Status == ReplicationStatus.Offline) {
doneEvent.Set();
}
};
replication.GoOffline();
var success = doneEvent.WaitOne(TimeSpan.FromSeconds(30));
Assert.IsTrue(success);
}
private Boolean IsSyncGateway(Uri remote)
{
return (remote.Port == 4984 || remote.Port == 4985);
}
private IDictionary<string, object> GetRemoteDoc(Uri remote, string checkpointId)
{
var url = new Uri(string.Format("{0}/_local/{1}", remote, checkpointId));
var request = new HttpRequestMessage(HttpMethod.Get, url);
using(var client = new HttpClient()) {
var response = client.SendAsync(request).Result;
var result = response.Content.ReadAsStringAsync().Result;
var json = Manager.GetObjectMapper().ReadValue<JObject>(result);
return json.AsDictionary<string, object>();
}
}
private void CreatePullAndTest(int docCount, RemoteDatabase db, Action<Replication> tester, ReplicationOptions options = null)
{
if(options == null) {
options = new ReplicationOptions();
}
db.AddDocuments(20, false);
var pull = database.CreatePullReplication(db.RemoteUri);
pull.ReplicationOptions = options;
RunReplication(pull);
WriteDebug("Document count at end {0}", database.GetDocumentCount());
tester(pull);
}
private Stream ZipDatabase(Database db, string zipName)
{
var zipPath = Path.Combine(Path.GetTempPath(), zipName);
if (File.Exists(zipPath)) {
File.Delete(zipPath);
}
using (var outStream = new ZipOutputStream(File.OpenWrite(zipPath)) { IsStreamOwner = true }) {
var fileName = Path.GetFileName(db.DbDirectory);
CompressFolder(db.DbDirectory, outStream, db.DbDirectory.Length - fileName.Length);
}
return File.OpenRead(zipPath);
}
private void CompressFolder(string path, ZipOutputStream zipStream, int folderOffset) {
ZipEntry dirEntry = new ZipEntry(ZipEntry.CleanName(Path.GetFileName(path) + "/"));
zipStream.PutNextEntry(dirEntry);
zipStream.CloseEntry();
string[] files = Directory.GetFiles(path);
foreach (string filename in files) {
FileInfo fi = new FileInfo(filename);
string entryName = filename.Substring(folderOffset); // Makes the name in zip based on the folder
entryName = ZipEntry.CleanName(entryName); // Removes drive from name and fixes slash direction
ZipEntry newEntry = new ZipEntry(entryName);
newEntry.DateTime = fi.LastWriteTime; // Note the zip format stores 2 second granularity
newEntry.Size = fi.Length;
zipStream.PutNextEntry(newEntry);
// Zip the file in buffered chunks
// the "using" will close the stream even if an exception occurs
using (FileStream streamReader = File.OpenRead(filename)) {
streamReader.CopyTo(zipStream);
}
zipStream.CloseEntry();
}
string[ ] folders = Directory.GetDirectories(path);
foreach (string folder in folders) {
CompressFolder(folder, zipStream, folderOffset);
}
}
protected override void SetUp()
{
base.SetUp();
_sg = new SyncGateway(GetReplicationProtocol(), GetReplicationServer());
}
[Test]
public void TestRejectedDocument()
{
var push = database.CreatePushReplication(GetReplicationURL());
var wait = new WaitAssert();
push.Changed += (sender, e) => {
var err = e.LastError as HttpResponseException;
if(err != null) {
wait.RunAssert(() => err.StatusCode.Should().Be(HttpStatusCode.Forbidden,
"because the document should be rejected"));
}
var err2 = e.LastError as CouchbaseLiteException;
if(err2 != null) {
wait.RunAssert(() => err2.Code.Should().Be(StatusCode.Forbidden,
"because the document should be rejected"));
}
};
database.CreateDocument().PutProperties(new Dictionary<string, object> {
["reject"] = false
});
database.CreateDocument().PutProperties(new Dictionary<string, object> {
["reject"] = true
});
push.Start();
wait.WaitForResult(TimeSpan.FromSeconds(5));
var docWithAttach = database.CreateDocument();
docWithAttach.Update(rev => {
rev.SetUserProperties(new Dictionary<string, object> {
["reject"] = true
});
rev.SetAttachment("foo", "foo/bar", Enumerable.Repeat<byte>((byte)'a', 100000));
return true;
});
wait = new WaitAssert();
push.Start();
wait.WaitForResult(TimeSpan.FromSeconds(5));
}
[Test]
public void TestUnauthorized()
{
using(var remoteDb = _sg.CreateDatabase(TempDbName())) {
remoteDb.DisableGuestAccess();
var pull = database.CreatePullReplication(remoteDb.RemoteUri);
var wait = new WaitAssert();
pull.Changed += (sender, e) => {
var err = e.LastError as HttpResponseException;
if(err != null) {
wait.RunAssert(() => Assert.AreEqual(HttpStatusCode.Unauthorized, err.StatusCode));
}
};
pull.Start();
wait.WaitForResult(TimeSpan.FromSeconds(5));
wait = new WaitAssert();
var push = database.CreatePushReplication(remoteDb.RemoteUri);
push.Changed += (sender, e) => {
var err = e.LastError as HttpResponseException;
if(err != null) {
wait.RunAssert(() => Assert.AreEqual(HttpStatusCode.Unauthorized, err.StatusCode));
}
};
push.Start();
wait.WaitForResult(TimeSpan.FromSeconds(5));
}
}
[Test]
public void TestUnauthorized()
{
using(var remoteDb = _sg.CreateDatabase(TempDbName())) {
remoteDb.DisableGuestAccess();
var pull = database.CreatePullReplication(remoteDb.RemoteUri);
var wait = new WaitAssert();
pull.Changed += (sender, e) => {
var err = e.LastError as HttpResponseException;
if(err != null) {
wait.RunAssert(() => Assert.AreEqual(HttpStatusCode.Unauthorized, err.StatusCode));
}
};
pull.Start();
wait.WaitForResult(TimeSpan.FromSeconds(5));
wait = new WaitAssert();
var push = database.CreatePushReplication(remoteDb.RemoteUri);
push.Changed += (sender, e) => {
var err = e.LastError as HttpResponseException;
if(err != null) {
wait.RunAssert(() => Assert.AreEqual(HttpStatusCode.Unauthorized, err.StatusCode));
}
};
push.Start();
wait.WaitForResult(TimeSpan.FromSeconds(5));
}
}
[Test]
public void TestDeepRevTree()
{
const int NumRevisions = 200;
using(var remoteDb = _sg.CreateDatabase(TempDbName())) {
var push = database.CreatePushReplication(remoteDb.RemoteUri);
var doc = database.GetDocument("deep");
var numRevisions = 0;
for(numRevisions = 0; numRevisions < NumRevisions;) {
database.RunInTransaction(() =>
{
// Have to push the doc periodically, to make sure the server gets the whole
// history, since CBL will only remember the latest 20 revisions.
var batchSize = Math.Min(database.GetMaxRevTreeDepth(), NumRevisions - numRevisions);
Trace.WriteLine($"Adding revisions {numRevisions + 1} -- {numRevisions + batchSize} ...");
for(int i = 0; i < batchSize; i++) {
doc.Update(rev =>
{
var props = rev.UserProperties;
props["counter"] = ++numRevisions;
rev.SetUserProperties(props);
return true;
});
}
return true;
});
Trace.WriteLine("Pushing ...");
RunReplication(push);
}
Trace.WriteLine($"{Environment.NewLine}{Environment.NewLine}$$$$$$$$$$ PULLING TO DB2 $$$$$$$$$$");
// Now create a second database and pull the remote db into it:
var db2 = EnsureEmptyDatabase("db2");
var pull = db2.CreatePullReplication(remoteDb.RemoteUri);
RunReplication(pull);
var doc2 = db2.GetExistingDocument("deep");
Assert.AreEqual(db2.GetMaxRevTreeDepth(), doc2.RevisionHistory.Count());
Assert.AreEqual(1, doc.ConflictingRevisions.Count());
Trace.WriteLine($"{Environment.NewLine}{Environment.NewLine}$$$$$$$$$$ PUSHING 1 DOC FROM DB $$$$$$$$$$");
// Now add a revision to the doc, push, and pull into db2:
doc.Update(rev =>
{
var props = rev.UserProperties;
props["counter"] = ++numRevisions;
rev.SetUserProperties(props);
return true;
});
RunReplication(push);
Trace.WriteLine($"{Environment.NewLine}{Environment.NewLine}$$$$$$$$$$ PULLING 1 DOC INTO DB2 $$$$$$$$$$");
RunReplication(pull);
Assert.AreEqual(db2.GetMaxRevTreeDepth(), doc2.RevisionHistory.Count());
Assert.AreEqual(1, doc.ConflictingRevisions.Count());
}
}
[Test]
public void TestRapidRestart()
{
var pull = database.CreatePullReplication(GetReplicationURL());
pull.Start();
RunReplication(pull);
var pull2 = database.CreatePullReplication(GetReplicationURL());
pull2.Continuous = true;
pull.Stop();
pull2.Start();
Sleep(2000);
Assert.AreNotEqual(ReplicationStatus.Stopped, pull2.Status);
StopReplication(pull2);
}
[Test]
public void TestRestartSpamming()
{
CreateDocuments(database, 100);
using(var remoteDb = _sg.CreateDatabase(TempDbName())) {
var push = database.CreatePushReplication(remoteDb.RemoteUri);
var pushMRE = new ManualResetEvent(false);
var pullMRE = new ManualResetEvent(false);
push.Changed += (sender, args) =>
{
if(args.Status == ReplicationStatus.Idle && args.CompletedChangesCount == 100) {
pushMRE.Set();
}
};
push.Continuous = true;
var pull = database.CreatePullReplication(remoteDb.RemoteUri);
pull.Changed += (sender, args) =>
{
if(args.Status == ReplicationStatus.Idle && args.CompletedChangesCount == 100) {
pullMRE.Set();
}
};
pull.Continuous = true;
push.Start();
pull.Start();
Sleep(200);
push.Restart();
pull.Restart();
push.Restart();
pull.Restart();
push.Restart();
pull.Restart();
push.Restart();
pull.Restart();
pushMRE.WaitOne(TimeSpan.FromSeconds(10)).Should().BeTrue("because otherwise the pusher never caught up");
pullMRE.WaitOne(TimeSpan.FromSeconds(10)).Should().BeTrue("because otherwise the puller never caught up");
push.Status.Should().Be(ReplicationStatus.Idle, "because the pusher should be idle since it finished its changes");
pull.Status.Should().Be(ReplicationStatus.Idle, "because the puller should be idle since it finished its changes");
StopReplication(push);
StopReplication(pull);
push.Restart();
pull.Restart();
push.Restart();
pull.Restart();
push.Restart();
pull.Restart();
push.Restart();
pull.Restart();
Sleep(1000);
push.Status.Should().Be(ReplicationStatus.Idle, "because the pusher should still be idle");
pull.Status.Should().Be(ReplicationStatus.Idle, "because the puller should still be idle");
StopReplication(push);
StopReplication(pull);
}
}
[Test]
public void TestStartSpamming()
{
Log.Domains.Sync.Level = Log.LogLevel.Debug;
CreateDocuments(database, 100);
using(var remoteDb = _sg.CreateDatabase(TempDbName())) {
var push = database.CreatePushReplication(remoteDb.RemoteUri);
var pushMRE = new ManualResetEvent(false);
var pullMRE = new ManualResetEvent(false);
push.Changed += (sender, args) =>
{
if(args.Status == ReplicationStatus.Idle && args.CompletedChangesCount == 100) {
pushMRE.Set();
}
};
push.Continuous = true;
var pull = database.CreatePullReplication(remoteDb.RemoteUri);
pull.Changed += (sender, args) =>
{
if(args.Status == ReplicationStatus.Idle && args.CompletedChangesCount == 100) {
pullMRE.Set();
}
};
pull.Continuous = true;
push.Start();
pull.Start();
Sleep(200);
push.Start();
pull.Start();
push.Start();
pull.Start();
push.Start();
pull.Start();
push.Start();
pull.Start();
Assert.IsTrue(pushMRE.WaitOne(TimeSpan.FromSeconds(10)));
Assert.IsTrue(pullMRE.WaitOne(TimeSpan.FromSeconds(10)));
Assert.AreEqual(ReplicationStatus.Idle, push.Status);
Assert.AreEqual(ReplicationStatus.Idle, pull.Status);
StopReplication(push);
StopReplication(pull);
}
}
[Test]
public void TestStopSpamming()
{
Log.Domains.Sync.Level = Log.LogLevel.Debug;
CreateDocuments(database, 100);
using(var remoteDb = _sg.CreateDatabase(TempDbName())) {
var push = database.CreatePushReplication(remoteDb.RemoteUri);
push.Continuous = true;
var pull = database.CreatePullReplication(remoteDb.RemoteUri);
pull.Continuous = true;
push.Start();
pull.Start();
Sleep(200);
push.Stop();
pull.Stop();
push.Stop();
pull.Stop();
push.Stop();
pull.Stop();
StopReplication(push);
StopReplication(pull);
Assert.AreEqual(ReplicationStatus.Stopped, push.Status);
Assert.AreEqual(ReplicationStatus.Stopped, pull.Status);
}
}
[Test]
public void TestStartStopSpamming()
{
Log.Domains.Sync.Level = Log.LogLevel.Debug;
CreateDocuments(database, 100);
using(var remoteDb = _sg.CreateDatabase(TempDbName())) {
var push = database.CreatePushReplication(remoteDb.RemoteUri);
push.Continuous = true;
var pull = database.CreatePullReplication(remoteDb.RemoteUri);
pull.Continuous = true;
push.Start();
pull.Start();
Sleep(200);
push.Stop();
pull.Stop();
push.Start();
pull.Start();
push.Stop();
pull.Stop();
push.Start();
pull.Start();
push.Stop();
pull.Stop();
push.Start();
pull.Start();
StopReplication(push);
StopReplication(pull);
Assert.AreEqual(ReplicationStatus.Stopped, push.Status);
Assert.AreEqual(ReplicationStatus.Stopped, pull.Status);
push.Stop();
pull.Stop();
push.Start();
pull.Start();
push.Stop();
pull.Stop();
push.Start();
pull.Start();
push.Stop();
pull.Stop();
push.Start();
pull.Start();
StopReplication(push);
StopReplication(pull);
Assert.AreEqual(ReplicationStatus.Stopped, push.Status);
Assert.AreEqual(ReplicationStatus.Stopped, pull.Status);
}
}
[Test]
public void TestStopRestartFlow()
{
Log.Domains.Sync.Level = Log.LogLevel.Debug;
CreateDocuments(database, 100);
using(var remoteDb = _sg.CreateDatabase(TempDbName())) {
var push = database.CreatePushReplication(remoteDb.RemoteUri);
var pushMRE = new ManualResetEvent(false);
var pullMRE = new ManualResetEvent(false);
push.Changed += (sender, args) =>
{
if(args.Status == ReplicationStatus.Idle && args.CompletedChangesCount == 100) {
pushMRE.Set();
}
};
push.Continuous = true;
var pull = database.CreatePullReplication(remoteDb.RemoteUri);
pull.Changed += (sender, args) =>
{
if(args.Status == ReplicationStatus.Idle && args.CompletedChangesCount == 100) {
pullMRE.Set();
}
};
pull.Continuous = true;
push.Start();
pull.Start();
Sleep(200);
push.Stop();
pull.Stop();
push.Restart();
pull.Restart();
pushMRE.WaitOne(TimeSpan.FromSeconds(10)).Should().BeTrue("because otherwise the pusher never caught up");
pullMRE.WaitOne(TimeSpan.FromSeconds(10)).Should().BeTrue("because otherwise the puller never caught up");
push.Status.Should().Be(ReplicationStatus.Idle, "because the pusher should be idle since it finished its changes");
pull.Status.Should().Be(ReplicationStatus.Idle, "because the puller should be idle since it finished its changes");
StopReplication(push);
StopReplication(pull);
}
}
[Test]
public void TestStartRestartFlow()
{
Log.Domains.Sync.Level = Log.LogLevel.Debug;
CreateDocuments(database, 100);
using(var remoteDb = _sg.CreateDatabase(TempDbName())) {
var push = database.CreatePushReplication(remoteDb.RemoteUri);
var pushMRE = new ManualResetEvent(false);
var pullMRE = new ManualResetEvent(false);
push.Changed += (sender, args) =>
{
if(args.Status == ReplicationStatus.Idle && args.CompletedChangesCount == 100) {
pushMRE.Set();
}
};
push.Continuous = true;
var pull = database.CreatePullReplication(remoteDb.RemoteUri);
pull.Changed += (sender, args) =>
{
if(args.Status == ReplicationStatus.Idle && args.CompletedChangesCount == 100) {
pullMRE.Set();
}
};
pull.Continuous = true;
push.Start();
pull.Start();
Sleep(200);
push.Start();
pull.Start();
push.Restart();
pull.Restart();
pushMRE.WaitOne(TimeSpan.FromSeconds(10)).Should().BeTrue("because otherwise the pusher never caught up");
pullMRE.WaitOne(TimeSpan.FromSeconds(10)).Should().BeTrue("because otherwise the puller never caught up");
push.Status.Should().Be(ReplicationStatus.Idle, "because the pusher should be idle since it finished its changes");
pull.Status.Should().Be(ReplicationStatus.Idle, "because the puller should be idle since it finished its changes");
StopReplication(push);
StopReplication(pull);
}
}
[Test]
public void TestCloseDatabaseWhileReplicating()
{
var signal = new CountdownEvent(1);
var rso = new ReplicationStoppedObserver(signal);
using (var remoteDb = _sg.CreateDatabase(TempDbName())) {
CreateDocuments(database, 1000);
var pusher = database.CreatePushReplication(remoteDb.RemoteUri);
pusher.Changed += rso.Changed;
pusher.Start();
Sleep(500);
database.Close().Wait(15000).Should().BeTrue("because otherwise the database close operation timed out");
database.IsOpen.Should().BeFalse("because the database is now closed");
database.Storage.Should().BeNull("because the database storage is null when a database is closed");
signal.Wait(10000).Should().BeTrue("because otherwise the replication failed to stop");
}
}
[Test]
public void TestRestartReplicator()
{
using (var remoteDb = _sg.CreateDatabase(TempDbName())) {
CreateDocuments(database, 10);
var pusher = database.CreatePushReplication(remoteDb.RemoteUri);
pusher.Start();
Sleep(500);
pusher.Restart();
Sleep(500);
RunReplication(pusher);
Assert.AreEqual(10, pusher.CompletedChangesCount);
Assert.AreEqual(10, pusher.ChangesCount);
Assert.IsNull(pusher.LastError);
CreateDocuments(database, 10);
RunReplication(pusher);
Assert.AreEqual(20, pusher.CompletedChangesCount);
Assert.AreEqual(20, pusher.ChangesCount);
Assert.IsNull(pusher.LastError);
}
}
[Test]
public void TestReplicationWithReplacedDB()
{
using (var remoteDb = _sg.CreateDatabase(TempDbName())) {
const int numPrePopulatedDocs = 100;
Console.WriteLine("Creating {0} pre-populated documents", numPrePopulatedDocs);
var prePopulateDB = EnsureEmptyDatabase("prepobdb");
Assert.IsNotNull(prePopulateDB, "Couldn't create pre-populated DB");
prePopulateDB.RunInTransaction(() =>
{
for(int i = 1; i <= numPrePopulatedDocs; i++) {
var doc = prePopulateDB.GetDocument(String.Format("foo-doc-{0}", i));
Assert.DoesNotThrow(() => doc.PutProperties(new Dictionary<string, object> {
{ "index", i },
{ "foo", true }
}));
}
return true;
});
Console.WriteLine("Pushing pre-populated documents ...");
var pusher = prePopulateDB.CreatePushReplication(remoteDb.RemoteUri);
RunReplication(pusher);
Assert.AreEqual(ReplicationStatus.Stopped, pusher.Status);
Assert.AreEqual(numPrePopulatedDocs, pusher.CompletedChangesCount);
Assert.AreEqual(numPrePopulatedDocs, pusher.ChangesCount);
Console.WriteLine("Pulling pre-populated documents ...");
var puller = prePopulateDB.CreatePullReplication(remoteDb.RemoteUri);
RunReplication(puller);
Assert.AreEqual(ReplicationStatus.Stopped, pusher.Status);
Assert.AreEqual(numPrePopulatedDocs, puller.CompletedChangesCount);
Assert.AreEqual(numPrePopulatedDocs, puller.ChangesCount);
const int numNonPrepopulatedDocs = 100;
var propertiesList = new List<IDictionary<string, object>>();
for (int i = 1; i <= numNonPrepopulatedDocs; i++) {
propertiesList.Add(new Dictionary<string, object> {
{ "_id", String.Format("bar-doc-{0}", i) },
{ "index", i },
{ "bar", true }
});
}
remoteDb.AddDocuments(propertiesList);
prePopulateDB.Close();
using (var zipStream = ZipDatabase(prePopulateDB, "prepopulated.zip")) {
manager.ReplaceDatabase("importdb", zipStream, true);
}
var importDb = manager.GetDatabase("importdb");
pusher = importDb.CreatePushReplication(remoteDb.RemoteUri);
RunReplication(pusher);
Assert.AreEqual(ReplicationStatus.Stopped, pusher.Status);
Assert.AreEqual(0, pusher.CompletedChangesCount);
Assert.AreEqual(0, pusher.ChangesCount);
puller = importDb.CreatePullReplication(remoteDb.RemoteUri);
RunReplication(puller);
Assert.AreEqual(ReplicationStatus.Stopped, pusher.Status);
Assert.AreEqual(numNonPrepopulatedDocs, puller.CompletedChangesCount);
Assert.AreEqual(numNonPrepopulatedDocs, puller.ChangesCount);
}
}
[Test]
public void TestPendingDocumentIDs()
{
using (var remoteDb = _sg.CreateDatabase(TempDbName())) {
var repl = database.CreatePushReplication(remoteDb.RemoteUri);
Assert.IsNotNull(repl.GetPendingDocumentIDs());
Assert.AreEqual(0, repl.GetPendingDocumentIDs().Count);
database.RunInTransaction(() =>
{
for(int i = 1; i <= 10; i++) {
var doc = database.GetDocument(String.Format("doc-{0}", i));
Assert.DoesNotThrow(() => {
doc.PutProperties(new Dictionary<string, object> {
{ "index", i },
{ "bar", false }
});
});
}
return true;
});
Assert.AreEqual(10, repl.GetPendingDocumentIDs().Count);
Assert.IsTrue(repl.IsDocumentPending(database.GetDocument("doc-1")));
repl.Start();
Assert.AreEqual(10, repl.GetPendingDocumentIDs().Count);
Assert.IsTrue(repl.IsDocumentPending(database.GetDocument("doc-1")));
RunReplication(repl);
Assert.IsNotNull(repl.GetPendingDocumentIDs());
Assert.AreEqual(0, repl.GetPendingDocumentIDs().Count);
Assert.IsFalse(repl.IsDocumentPending(database.GetDocument("doc-1")));
database.RunInTransaction(() =>
{
for(int i = 11; i <= 20; i++) {
var doc = database.GetDocument(String.Format("doc-{0}", i));
Assert.DoesNotThrow(() => {
doc.PutProperties(new Dictionary<string, object> {
{ "index", i },
{ "bar", false }
});
});
}
return true;
});
Sleep(1000);
repl = database.CreatePushReplication(remoteDb.RemoteUri);
Assert.AreEqual(10, repl.GetPendingDocumentIDs().Count);
Assert.IsTrue(repl.IsDocumentPending(database.GetDocument("doc-11")));
Assert.IsFalse(repl.IsDocumentPending(database.GetDocument("doc-1")));
repl.Start();
Assert.AreEqual(10, repl.GetPendingDocumentIDs().Count);
Assert.IsTrue(repl.IsDocumentPending(database.GetDocument("doc-11")));
Assert.IsFalse(repl.IsDocumentPending(database.GetDocument("doc-1")));
repl = database.CreatePullReplication(remoteDb.RemoteUri);
Assert.IsNull(repl.GetPendingDocumentIDs());
repl.Start();
Assert.IsNull(repl.GetPendingDocumentIDs());
RunReplication(repl);
Assert.IsNull(repl.GetPendingDocumentIDs());
}
}
[Test]
public void TestRemoteUUID()
{
var r1 = database.CreatePullReplication(new Uri("http://alice.local:55555/db"));
r1.ReplicationOptions = new ReplicationOptions { RemoteUUID = "cafebabe" };
var check1 = r1.RemoteCheckpointDocID();
var r2 = database.CreatePullReplication(new Uri("http://alice.local:44444/db"));
r2.ReplicationOptions = r1.ReplicationOptions;
var check2 = r2.RemoteCheckpointDocID();
Assert.AreEqual(check1, check2);
Assert.IsTrue(r1.HasSameSettingsAs(r2));
var r3 = database.CreatePullReplication(r2.RemoteUrl);
r3.ReplicationOptions = r1.ReplicationOptions;
r3.Filter = "Melitta";
var check3 = r3.RemoteCheckpointDocID();
Assert.AreNotEqual(check2, check3);
Assert.IsFalse(r3.HasSameSettingsAs(r2));
}
[Test]
public void TestConcurrentPullers()
{
using (var remoteDb = _sg.CreateDatabase(TempDbName())) {
remoteDb.AddDocuments(100, false);
var pull1 = database.CreatePullReplication(remoteDb.RemoteUri);
pull1.Continuous = true;
var pull2 = database.CreatePullReplication(remoteDb.RemoteUri);
pull2.Continuous = false;
pull1.Start();
try {
RunReplication(pull2);
Assert.IsNull(pull1.LastError);
Assert.IsNull(pull2.LastError);
Assert.AreEqual(100, database.GetDocumentCount());
} finally {
StopReplication(pull1);
}
}
}
[Test]
public void TestPullerChangedEvent()
{
if (!Boolean.Parse((string)GetProperty("replicationTestsEnabled")))
{
Assert.Inconclusive("Replication tests disabled.");
return;
}
Log.Domains.Sync.Level = Log.LogLevel.Debug;
using (var remoteDb = _sg.CreateDatabase(TempDbName())) {
var docIdTimestamp = Convert.ToString((ulong)DateTime.UtcNow.TimeSinceEpoch().TotalMilliseconds);
var doc1Id = string.Format("doc1-{0}", docIdTimestamp);
var doc2Id = string.Format("doc2-{0}", docIdTimestamp);
remoteDb.AddDocument(doc1Id, "attachment.png");
remoteDb.AddDocument(doc2Id, "attachment2.png");
var pull = database.CreatePullReplication(remoteDb.RemoteUri);
List<ReplicationStatus> statusHistory = new List<ReplicationStatus>();
pull.Changed += (sender, e) =>
{
statusHistory.Add(e.Status);
if (e.ChangesCount > 0 && e.CompletedChangesCount != e.ChangesCount) {
Assert.AreEqual(ReplicationStatus.Active, e.Source.Status);
}
};
RunReplication(pull);
for (int i = 0; i < statusHistory.Count; i++) {
if (i == statusHistory.Count - 1) {
Assert.AreEqual(ReplicationStatus.Stopped, statusHistory[i]);
} else {
Assert.AreEqual(ReplicationStatus.Active, statusHistory[i]);
}
}
doc1Id = string.Format("doc3-{0}", docIdTimestamp);
doc2Id = string.Format("doc4-{0}", docIdTimestamp);
remoteDb.AddDocument(doc1Id, "attachment.png");
remoteDb.AddDocument(doc2Id, "attachment2.png");
pull = database.CreatePullReplication(remoteDb.RemoteUri);
pull.Continuous = true;
statusHistory.Clear();
var doneEvent = new AutoResetEvent(false);
pull.Changed += (sender, e) =>
{
statusHistory.Add(e.Status);
if (e.Status == ReplicationStatus.Idle && e.ChangesCount == e.CompletedChangesCount) {
doneEvent.Set();
}
};
pull.Start();
Assert.IsTrue(doneEvent.WaitOne(TimeSpan.FromSeconds(10)));
Assert.IsNull(pull.LastError);
for (int i = 0; i < statusHistory.Count; i++) {
if (i == statusHistory.Count - 1) {
Assert.AreEqual(ReplicationStatus.Idle, statusHistory[i]);
} else {
Assert.IsTrue(statusHistory[i] == ReplicationStatus.Active || statusHistory[i] == ReplicationStatus.Idle);
}
}
statusHistory.Clear();
doc1Id = string.Format("doc5-{0}", docIdTimestamp);
remoteDb.AddDocument(doc1Id, "attachment.png");
Assert.IsTrue(doneEvent.WaitOne(TimeSpan.FromSeconds(10)));
Assert.IsNull(pull.LastError);
statusHistory.Clear();
StopReplication(pull);
Assert.AreEqual(ReplicationStatus.Active, statusHistory.First());
Assert.AreEqual(ReplicationStatus.Stopped, statusHistory.Last());
}
}
[Test]
public void TestPusherChangedEvent()
{
if (!Boolean.Parse((string)GetProperty("replicationTestsEnabled")))
{
Assert.Inconclusive("Replication tests disabled.");
return;
}
using (var remoteDb = _sg.CreateDatabase(TempDbName())) {
CreateDocuments(database, 2);
var push = database.CreatePushReplication(remoteDb.RemoteUri);
List<ReplicationStatus> statusHistory = new List<ReplicationStatus>();
push.Changed += (sender, e) =>
{
statusHistory.Add(e.Status);
if (e.ChangesCount > 0 && e.CompletedChangesCount != e.ChangesCount) {
Assert.AreEqual(ReplicationStatus.Active, e.Status);
}
if (e.Status == ReplicationStatus.Stopped) {
Assert.AreNotEqual(0, e.CompletedChangesCount);
Assert.AreEqual(e.ChangesCount, e.CompletedChangesCount);
}
};
RunReplication(push);
Sleep(1000);
Assert.IsNull(push.LastError);
foreach (var status in statusHistory.Take(statusHistory.Count - 1)) {
Assert.AreEqual(ReplicationStatus.Active, status);
}
Assert.AreEqual(ReplicationStatus.Stopped, statusHistory[statusHistory.Count - 1]);
CreateDocuments(database, 2);
push = database.CreatePushReplication(remoteDb.RemoteUri);
push.Continuous = true;
statusHistory.Clear();
var doneEvent = new ManualResetEventSlim();
push.Changed += (sender, e) =>
{
statusHistory.Add(e.Status);
if(e.Status == ReplicationStatus.Idle && e.ChangesCount == e.CompletedChangesCount) {
doneEvent.Set();
}
};
push.Start();
Assert.IsTrue(doneEvent.Wait(TimeSpan.FromSeconds(60)));
Assert.IsNull(push.LastError);
foreach (var status in statusHistory.Take(statusHistory.Count - 1)) {
Assert.AreEqual(ReplicationStatus.Active, status);
}
Assert.AreEqual(ReplicationStatus.Idle, statusHistory[statusHistory.Count - 1]);
doneEvent.Reset();
statusHistory.Clear();
CreateDocuments(database, 1);
Assert.IsTrue(doneEvent.Wait(TimeSpan.FromSeconds(60)));
Assert.IsNull(push.LastError);
foreach (var status in statusHistory.Take(statusHistory.Count - 1)) {
Assert.IsTrue(status == ReplicationStatus.Active || status == ReplicationStatus.Idle);
}
Assert.AreEqual(ReplicationStatus.Idle, statusHistory[statusHistory.Count - 1]);
doneEvent.Reset();
statusHistory.Clear();
StopReplication(push);
Assert.AreEqual(2, statusHistory.Count);
Assert.AreEqual(ReplicationStatus.Active, statusHistory.First());
Assert.AreEqual(ReplicationStatus.Stopped, statusHistory[1]);
}
}
[Test] // Issue #449
public void TestPushAttachmentToCouchDB()
{
var couchDb = new CouchDB(GetReplicationProtocol(), GetReplicationServer());
using (var remoteDb = couchDb.CreateDatabase(TempDbName())) {
var push = database.CreatePushReplication(remoteDb.RemoteUri);
CreateDocuments(database, 2);
var attachDoc = database.CreateDocument();
var newRev = attachDoc.CreateRevision();
var newProps = newRev.UserProperties;
newProps["foo"] = "bar";
newRev.SetUserProperties(newProps);
var attachmentStream = GetAsset("attachment.png");
newRev.SetAttachment("attachment.png", "image/png", attachmentStream);
newRev.Save();
RunReplication(push);
Assert.AreEqual(3, push.ChangesCount);
Assert.AreEqual(3, push.CompletedChangesCount);
attachDoc = database.GetExistingDocument(attachDoc.Id);
attachDoc.Update(rev =>
{
var props = rev.UserProperties;
props["extraminutes"] = "5";
rev.SetUserProperties(props);
return true;
});
push = database.CreatePushReplication(push.RemoteUrl);
RunReplication(push);
database.Close();
database = EnsureEmptyDatabase(database.Name);
var pull = database.CreatePullReplication(push.RemoteUrl);
RunReplication(pull);
Assert.AreEqual(3, database.GetDocumentCount());
attachDoc = database.GetExistingDocument(attachDoc.Id);
Assert.IsNotNull(attachDoc, "Failed to retrieve doc with attachment");
Assert.IsNotNull(attachDoc.CurrentRevision.Attachments, "Failed to retrieve attachments on attachment doc");
attachDoc.Update(rev =>
{
var props = rev.UserProperties;
props["extraminutes"] = "10";
rev.SetUserProperties(props);
return true;
});
push = database.CreatePushReplication(pull.RemoteUrl);
RunReplication(push);
Assert.IsNull(push.LastError);
Assert.AreEqual(1, push.ChangesCount);
Assert.AreEqual(1, push.CompletedChangesCount);
Assert.AreEqual(3, database.GetDocumentCount());
}
}
// Reproduces issue #167
// https://github.com/couchbase/couchbase-lite-android/issues/167
/// <exception cref="System.Exception"></exception>
[Test]
public void TestPushPurgedDoc()
{
if (!Boolean.Parse((string)GetProperty("replicationTestsEnabled")))
{
Assert.Inconclusive("Replication tests disabled.");
return;
}
var numBulkDocRequests = 0;
HttpRequestMessage lastBulkDocsRequest = null;
var doc = CreateDocumentWithProperties(
database,
new Dictionary<string, object>
{
{"testName", "testPurgeDocument"}
}
);
Assert.IsNotNull(doc);
using (var remoteDb = _sg.CreateDatabase(TempDbName())) {
var remote = remoteDb.RemoteUri;
var factory = new MockHttpClientFactory();
factory.HttpHandler.ClearResponders();
factory.HttpHandler.AddResponderRevDiffsAllMissing();
factory.HttpHandler.AddResponderFakeLocalDocumentUpdate404();
factory.HttpHandler.AddResponderFakeBulkDocs();
manager.DefaultHttpClientFactory = factory;
var pusher = database.CreatePushReplication(remote);
var replicationCaughtUpSignal = new CountdownEvent(1);
pusher.Changed += (sender, e) =>
{
var changesCount = e.Source.ChangesCount;
var completedChangesCount = e.Source.CompletedChangesCount;
var msg = String.Format("changes: {0} completed changes: {1}", changesCount, completedChangesCount);
WriteDebug(msg);
if (changesCount > 0 && changesCount == completedChangesCount
&& replicationCaughtUpSignal.CurrentCount > 0) {
replicationCaughtUpSignal.Signal();
}
};
pusher.Start();
// wait until that doc is pushed
var didNotTimeOut = replicationCaughtUpSignal.Wait(TimeSpan.FromSeconds(15));
Assert.IsTrue(didNotTimeOut);
// at this point, we should have captured exactly 1 bulk docs request
numBulkDocRequests = 0;
var handler = factory.HttpHandler;
foreach (var capturedRequest in handler.CapturedRequests) {
if (capturedRequest.Method == HttpMethod.Post && capturedRequest.RequestUri.AbsoluteUri.EndsWith("_bulk_docs", StringComparison.Ordinal)) {
lastBulkDocsRequest = capturedRequest;
numBulkDocRequests++;
}
}
Assert.AreEqual(1, numBulkDocRequests);
// that bulk docs request should have the "start" key under its _revisions
var jsonMap = MockHttpRequestHandler.GetJsonMapFromRequest(lastBulkDocsRequest);
var docs = (jsonMap.Get("docs")).AsList<IDictionary<string,object>>();
var onlyDoc = docs[0];
var revisions = onlyDoc.Get("_revisions").AsDictionary<string,object>();
Assert.IsTrue(revisions.ContainsKey("start"));
// Reset for the next attempt.
handler.ClearCapturedRequests();
// now add a new revision, which will trigger the pusher to try to push it
var properties = new Dictionary<string, object>();
properties["testName2"] = "update doc";
var unsavedRevision = doc.CreateRevision();
unsavedRevision.SetUserProperties(properties);
unsavedRevision.Save();
// but then immediately purge it
doc.Purge();
pusher.Start();
// wait for a while to give the replicator a chance to push it
// (it should not actually push anything)
Sleep(5 * 1000);
// we should not have gotten any more _bulk_docs requests, because
// the replicator should not have pushed anything else.
// (in the case of the bug, it was trying to push the purged revision)
numBulkDocRequests = 0;
foreach (var capturedRequest in handler.CapturedRequests) {
if (capturedRequest.Method == HttpMethod.Post && capturedRequest.RequestUri.AbsoluteUri.EndsWith("_bulk_docs", StringComparison.Ordinal)) {
numBulkDocRequests++;
}
}
Assert.AreEqual(0, numBulkDocRequests);
pusher.Stop();
}
}
[Test]
public void TestUpdateToServerSavesAttachment()
{
var couchDb = new CouchDB(GetReplicationProtocol(), GetReplicationServer());
using (var remoteDb = couchDb.CreateDatabase(TempDbName())) {
var pull = database.CreatePullReplication(remoteDb.RemoteUri);
pull.Continuous = true;
pull.Start();
var docName = "doc" + Convert.ToString((ulong)DateTime.UtcNow.TimeSinceEpoch().TotalMilliseconds);
var endpoint = remoteDb.RemoteUri.AppendPath(docName);
var docContent = Encoding.UTF8.GetBytes("{\"foo\":false}");
var putRequest = new HttpRequestMessage(HttpMethod.Put, endpoint);
putRequest.Content = new StringContent("{\"foo\":false}");
putRequest.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
var response = _httpClient.SendAsync(putRequest).Result;
Assert.AreEqual(HttpStatusCode.Created, response.StatusCode);
var attachmentStream = GetAsset("attachment.png");
var baos = new MemoryStream();
attachmentStream.CopyTo(baos);
attachmentStream.Dispose();
endpoint = endpoint.AppendPath("attachment?rev=1-1153b140e4c8674e2e6425c94de860a0");
docContent = baos.ToArray();
baos.Dispose();
putRequest = new HttpRequestMessage(HttpMethod.Put, endpoint);
putRequest.Content = new ByteArrayContent(docContent);
putRequest.Content.Headers.ContentType = new MediaTypeHeaderValue("image/png");
response = _httpClient.SendAsync(putRequest).Result;
Assert.AreEqual(HttpStatusCode.Created, response.StatusCode);
endpoint = remoteDb.RemoteUri.AppendPath(docName + "?rev=2-bb71ce0da1de19f848177525c4ae5a8b");
const string docContentStr = "{\"foo\":true,\"_attachments\":{\"attachment\":{\"content_type\":\"image/png\",\"revpos\":2,\"digest\":\"md5-ks1IBwCXbuY7VWAO9CkEjA==\",\"length\":519173,\"stub\":true}}}";
putRequest = new HttpRequestMessage(HttpMethod.Put, endpoint);
putRequest.Content = new StringContent(docContentStr);
putRequest.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
response = _httpClient.SendAsync(putRequest).Result;
Assert.AreEqual(HttpStatusCode.Created, response.StatusCode);
Sleep(1000);
while (pull.Status == ReplicationStatus.Active) {
Sleep(500);
}
Assert.IsNull(pull.LastError);
Assert.AreEqual(ReplicationStatus.Idle, pull.Status);
var doc = database.GetExistingDocument(docName);
Assert.IsNotNull(doc);
Assert.IsNotNull(doc.CurrentRevision.Attachments);
StopReplication(pull);
}
}
/// <exception cref="System.Exception"></exception>
[Test]
public void TestPullerWithLiveQuery()
{
if (!Boolean.Parse((string)GetProperty("replicationTestsEnabled")))
{
Assert.Inconclusive("Replication tests disabled.");
return;
}
// Even though this test is passed, there is a runtime exception
// thrown regarding the replication's number of changes count versus
// number of completed changes count. Investigation is required.
string docIdTimestamp = System.Convert.ToString((ulong)DateTime.UtcNow.TimeSinceEpoch().TotalMilliseconds);
string doc1Id = string.Format("doc1-{0}", docIdTimestamp);
string doc2Id = string.Format("doc2-{0}", docIdTimestamp);
using (var remoteDb = _sg.CreateDatabase(TempDbName())) {
remoteDb.AddDocument(doc1Id, "attachment2.png");
remoteDb.AddDocument(doc2Id, "attachment2.png");
View view = database.GetView("testPullerWithLiveQueryView");
view.SetMapReduce((document, emitter) =>
{
if (document.CblID() != null) {
emitter(document.CblID(), null);
}
}, null, "1");
LiveQuery allDocsLiveQuery = view.CreateQuery().ToLiveQuery();
allDocsLiveQuery.Changed += (sender, e) =>
{
int numTimesCalled = 0;
if (e.Error != null) {
throw new ApplicationException("Fail", e.Error);
}
if (numTimesCalled++ > 0) {
Assert.IsTrue(e.Rows.Count > 0);
}
WriteDebug("rows " + e.Rows);
};
// the first time this is called back, the rows will be empty.
// but on subsequent times we should expect to get a non empty
// row set.
allDocsLiveQuery.Start();
var remote = remoteDb.RemoteUri;
var repl = database.CreatePullReplication(remote);
repl.Continuous = false;
RunReplication(repl);
Assert.IsNull(repl.LastError);
allDocsLiveQuery.Stop();
Sleep(2000);
}
Sleep(1000);
}
/// <exception cref="System.IO.IOException"></exception>
private Dictionary<string,object> GetDocWithId(string docId, string attachmentName)
{
Dictionary<string,object> docBody;
if (attachmentName != null)
{
// add attachment to document
var attachmentStream = GetAsset(attachmentName);
var baos = new MemoryStream();
attachmentStream.CopyTo(baos);
var attachmentBase64 = Convert.ToBase64String(baos.ToArray());
docBody = new Dictionary<string,object>
{
{"foo", 1},
{"bar", false},
{
"_attachments",
new Dictionary<string,object>
{
{
"i_use_couchdb.png" , new Dictionary<string,object>
{
{"content_type", "image/png"},
{"data", attachmentBase64 }
}
}
}
}
};
attachmentStream.Dispose();
baos.Dispose();
}
else
{
docBody = new Dictionary<string,object>
{
{"foo", 1},
{"bar", false}
};
}
return docBody;
}
/// <exception cref="System.Exception"></exception>
[Test]
public void TestGetReplicator()
{
if (!Boolean.Parse((string)GetProperty("replicationTestsEnabled")))
{
Assert.Inconclusive("Replication tests disabled.");
return;
}
using (var remoteDb = _sg.CreateDatabase(TempDbName())) {
var replicationUrl = remoteDb.RemoteUri;
var replicator = database.CreatePullReplication(replicationUrl);
Assert.IsNotNull(replicator);
Assert.IsTrue(replicator.IsPull);
Assert.IsFalse(replicator.Continuous);
Assert.IsFalse(replicator.IsRunning);
ReplicationStatus lastStatus = replicator.Status;
var mre = new ManualResetEventSlim();
replicator.Changed += (sender, e) =>
{
if (lastStatus != e.Source.Status) {
lastStatus = e.Source.Status;
mre.Set();
}
};
replicator.Start();
Assert.IsTrue(mre.Wait(TimeSpan.FromSeconds(10)), "Timed out waiting for replicator to start");
Assert.IsTrue(replicator.IsRunning);
var activeReplicators = default(IList<Replication>);
var got = database.ActiveReplicators.AcquireTemp(out activeReplicators);
Assert.IsTrue(got);
Assert.AreEqual(1, activeReplicators.Count);
Assert.AreEqual(replicator, activeReplicators[0]);
replicator.Stop();
mre.Reset();
Assert.IsTrue(mre.Wait(TimeSpan.FromSeconds(10)), "Timed out waiting for replicator to stop");
Assert.IsFalse(replicator.IsRunning);
Sleep(500);
got = database.ActiveReplicators.AcquireTemp(out activeReplicators);
Assert.IsTrue(got);
Assert.AreEqual(0, activeReplicators.Count);
}
}
/// <exception cref="System.Exception"></exception>
[Test]
public void TestGetReplicatorWithAuth()
{
if (!Boolean.Parse((string)GetProperty("replicationTestsEnabled")))
{
Assert.Inconclusive("Replication tests disabled.");
return;
}
const string email = "jchris@couchbase.com";
const string accessToken = "fake_access_token";
using (var remoteDb = _sg.CreateDatabase(TempDbName())) {
var remoteUrl = remoteDb.RemoteUri;
FacebookAuthorizer.RegisterAccessToken(accessToken, email, remoteUrl);
Replication replicator = database.CreatePushReplication(remoteDb.RemoteUri);
replicator.Authenticator = AuthenticatorFactory.CreateFacebookAuthenticator(accessToken);
Assert.IsNotNull(replicator);
Assert.IsNotNull(replicator.Authenticator);
Assert.IsTrue(replicator.Authenticator is TokenAuthenticator);
}
}
/// <exception cref="System.Exception"></exception>
[Test]
public void TestRunReplicationWithError()
{
if (!Boolean.Parse((string)GetProperty("replicationTestsEnabled")))
{
Assert.Inconclusive("Replication tests disabled.");
return;
}
var mockHttpClientFactory = new MockHttpClientFactory();
manager.DefaultHttpClientFactory = mockHttpClientFactory;
var mockHttpHandler = mockHttpClientFactory.HttpHandler;
mockHttpHandler.AddResponderFailAllRequests(HttpStatusCode.InternalServerError);
var dbUrlString = "http://fake.test-url.com:4984/fake/";
var remote = new Uri(dbUrlString);
var continuous = false;
var r1 = new Pusher(database, remote, continuous, mockHttpClientFactory, new TaskFactory(new SingleTaskThreadpoolScheduler()));
Assert.IsFalse(r1.Continuous);
RunReplication(r1);
Assert.AreEqual(ReplicationStatus.Stopped, r1.Status);
Assert.AreEqual(0, r1.CompletedChangesCount);
Assert.AreEqual(0, r1.ChangesCount);
Assert.IsNotNull(r1.LastError);
}
/// <exception cref="System.Exception"></exception>
[Test]
public void TestReplicatorErrorStatus()
{
if (!Boolean.Parse((string)GetProperty("replicationTestsEnabled")))
{
Assert.Inconclusive("Replication tests disabled.");
return;
}
const string email = "jchris@couchbase.com";
const string accessToken = "fake_access_token";
using (var remoteDb = _sg.CreateDatabase(TempDbName())) {
var remoteUrl = remoteDb.RemoteUri;
FacebookAuthorizer.RegisterAccessToken(accessToken, email, remoteUrl);
var replicator = database.CreatePullReplication(remoteDb.RemoteUri);
replicator.Authenticator = AuthenticatorFactory.CreateFacebookAuthenticator(accessToken);
RunReplication(replicator);
Assert.IsNotNull(replicator.LastError);
}
}
/// <exception cref="System.Exception"></exception>
[Test]
public void TestGoOffline()
{
if (!Boolean.Parse((string)GetProperty("replicationTestsEnabled")))
{
Assert.Inconclusive("Replication tests disabled.");
return;
}
using (var remoteDb = _sg.CreateDatabase(TempDbName())) {
var remote = remoteDb.RemoteUri;
var repl = database.CreatePullReplication(remote);
repl.Continuous = true;
repl.Start();
//Some platforms will fire an intial GoOnline event because of network status
//change registration, so get that out of the way first
Sleep(1000);
PutReplicationOffline(repl);
Assert.IsTrue(repl.Status == ReplicationStatus.Offline);
StopReplication(repl);
}
}
/// <exception cref="System.Exception"></exception>
[Test]
public virtual void TestAppendPathURLString([Values("http://10.0.0.3:4984/connect-2014", "http://10.0.0.3:4984/connect-2014/")] String baseUri, [Values("/_bulk_get?revs=true&attachments=true", "_bulk_get?revs=true&attachments=true")] String newPath)
{
if (!Boolean.Parse((string)GetProperty("replicationTestsEnabled")))
{
Assert.Inconclusive("Replication tests disabled.");
return;
}
var dbUrlString = new Uri(baseUri);
var relativeUrlString = dbUrlString.AppendPath(newPath).AbsoluteUri;
var expected = "http://10.0.0.3:4984/connect-2014/_bulk_get?revs=true&attachments=true";
Assert.AreEqual(expected, relativeUrlString);
}
/// <exception cref="System.Exception"></exception>
[Test]
public void TestChannels()
{
if (!Boolean.Parse((string)GetProperty("replicationTestsEnabled")))
{
Assert.Inconclusive("Replication tests disabled.");
return;
}
var remote = new Uri("http://couchbase.com/no_such_db");
var replicator = database.CreatePullReplication(remote);
var channels = new List<string>();
channels.Add("chan1");
channels.Add("chan2");
replicator.Channels = channels;
Assert.AreEqual(channels, replicator.Channels);
replicator.Channels = null;
Assert.IsTrue(replicator.Channels.ToList().Count == 0);
}
/// <exception cref="System.UriFormatException"></exception>
[Test]
public virtual void TestChannelsMore()
{
if (!Boolean.Parse((string)GetProperty("replicationTestsEnabled")))
{
Assert.Inconclusive("Replication tests disabled.");
return;
}
var fakeRemoteURL = new Uri("http://couchbase.com/no_such_db");
var r1 = database.CreatePullReplication(fakeRemoteURL);
Assert.IsTrue(!r1.Channels.Any());
r1.Filter = "foo/bar";
Assert.IsTrue(!r1.Channels.Any());
var filterParams = new Dictionary<string, object>();
filterParams["a"] = "b";
r1.FilterParams = filterParams;
Assert.IsTrue(!r1.Channels.Any());
r1.Channels = null;
Assert.AreEqual("foo/bar", r1.Filter);
Assert.AreEqual(filterParams, r1.FilterParams);
var channels = new List<string>();
channels.Add("NBC");
channels.Add("MTV");
r1.Channels = channels;
Assert.AreEqual(channels, r1.Channels);
Assert.AreEqual("sync_gateway/bychannel", r1.Filter);
filterParams = new Dictionary<string, object>();
filterParams["channels"] = "NBC,MTV";
Assert.AreEqual(filterParams, r1.FilterParams);
r1.Channels = null;
Assert.AreEqual(r1.Filter, null);
Assert.AreEqual(null, r1.FilterParams);
}
/// <exception cref="System.Exception"></exception>
[Test]
public void TestHeaders()
{
if(!Boolean.Parse((string)GetProperty("replicationTestsEnabled"))) {
Assert.Inconclusive("Replication tests disabled.");
return;
}
database.GetDocument("doc1").PutProperties(new Dictionary<string, object> {
["jim"] = "borden"
});
database.GetDocument("doc2").PutProperties(new Dictionary<string, object> {
["foo"] = "bar"
});
using(var remoteDb = _sg.CreateDatabase(TempDbName())) {
var remote = remoteDb.RemoteUri;
var puller = database.CreatePullReplication(remote);
var mockHttpClientFactory = new MockHttpClientFactory(false);
var mockHttpHandler = mockHttpClientFactory.HttpHandler;
var pusher = database.CreatePushReplication(remote);
pusher.ClientFactory = mockHttpClientFactory;
pusher.Headers.Add("foo", "bar");
pusher.Start();
Sleep(2000);
pusher.Stop();
ValidateHttpHeaders(mockHttpHandler);
mockHttpHandler.ClearCapturedRequests();
mockHttpClientFactory = new MockHttpClientFactory(false);
mockHttpHandler = mockHttpClientFactory.HttpHandler;
puller.ClientFactory = mockHttpClientFactory;
puller.Headers.Add("foo", "bar");
puller.Start();
Sleep(2000);
puller.Stop();
ValidateHttpHeaders(mockHttpHandler);
mockHttpHandler.ClearCapturedRequests();
mockHttpClientFactory = new MockHttpClientFactory(false);
mockHttpHandler = mockHttpClientFactory.HttpHandler;
pusher = database.CreatePushReplication(remote);
pusher.ClientFactory = mockHttpClientFactory;
pusher.Continuous = true;
pusher.Headers.Add("foo", "bar");
pusher.Start();
Sleep(2000);
pusher.Stop();
ValidateHttpHeaders(mockHttpHandler);
mockHttpHandler.ClearCapturedRequests();
mockHttpClientFactory = new MockHttpClientFactory(false);
mockHttpHandler = mockHttpClientFactory.HttpHandler;
puller = database.CreatePullReplication(remote);
puller.ClientFactory = mockHttpClientFactory;
puller.Continuous = true;
puller.Headers.Add("foo", "bar");
puller.Start();
Sleep(2000);
puller.Stop();
ValidateHttpHeaders(mockHttpHandler);
}
}
private void ValidateHttpHeaders (MockHttpRequestHandler mockHttpHandler)
{
var fooheaderCount = 0;
var requests = mockHttpHandler.CapturedRequests;
requests.Should().NotBeEmpty("because there should be at least one request");
foreach (var request in requests) {
try {
var requestHeaders = request.Headers.GetValues("foo");
foreach(var requestHeader in requestHeaders) {
fooheaderCount++;
requestHeader.Should().Be("bar", "because otherwise the custom header is incorrect");
}
} catch(InvalidOperationException) {
Assert.Fail("No custom header found");
}
}
fooheaderCount.Should().Be(requests.Count, "because every request should have the custom header");
}
[Test]
// Note that this should not happen anymore but this test will remain just to verify
// the correct behavior if it does
public void TestBulkGet404()
{
var factory = new MockHttpClientFactory(false);
factory.HttpHandler.SetResponder("_changes", req =>
{
var response = new HttpResponseMessage(HttpStatusCode.OK);
response.Content = new StringContent(@"{""results"":[{""seq"":3,""id"":""somedoc"",""changes"":
[{""rev"":""2-cafebabe""}]},{""seq"":4,""id"":""otherdoc"",""changes"":[{""rev"":""5-bedbedbe""}]},
{""seq"":5,""id"":""realdoc"",""changes"":[{""rev"":""1-12345abc""}]}]}");
return response;
});
factory.HttpHandler.SetResponder("_bulk_get", req =>
{
var response = new HttpResponseMessage(HttpStatusCode.OK);
response.Content = new StringContent("--67aac1bcad803590b9a9e1999fc539438b3363fab35a24c17990188b222f\r\n" +
"Content-Type: application/json; error=\"true\"\r\n\r\n" +
"{\"error\":\"not_found\",\"id\":\"somedoc\",\"reason\":\"missing\",\"rev\":\"2-cafebabe\",\"status\":404}\r\n" +
"--67aac1bcad803590b9a9e1999fc539438b3363fab35a24c17990188b222f\r\n" +
"Content-Type: application/json; error=\"true\"\r\n\r\n" +
"{\"error\":\"not_found\",\"id\":\"otherdoc\",\"reason\":\"missing\",\"rev\":\"5-bedbedbe\",\"status\":404}\r\n" +
"--67aac1bcad803590b9a9e1999fc539438b3363fab35a24c17990188b222f\r\n" +
"Content-Type: application/json\r\n\r\n" +
"{\"_id\":\"realdoc\",\"_rev\":\"1-12345abc\",\"channels\":[\"unit_test\"],\"foo\":\"bar\"}\r\n" +
"--67aac1bcad803590b9a9e1999fc539438b3363fab35a24c17990188b222f--");
response.Content.Headers.Remove("Content-Type");
response.Content.Headers.TryAddWithoutValidation("Content-Type", "multipart/mixed; boundary=\"67aac1bcad803590b9a9e1999fc539438b3363fab35a24c17990188b222f\"");
return response;
});
manager.DefaultHttpClientFactory = factory;
using (var remoteDb = _sg.CreateDatabase(TempDbName())) {
var puller = database.CreatePullReplication(remoteDb.RemoteUri);
RunReplication(puller);
Assert.IsNotNull(puller.LastError);
Assert.AreEqual(3, puller.ChangesCount);
Assert.AreEqual(3, puller.CompletedChangesCount);
Assert.AreEqual("5", puller.LastSequence);
}
}
#if false
[Test] // This test takes nearly 5 minutes to run, so only run when needed
#endif
public void TestLongRemovedChangesFeed()
{
var random = new Random();
var changesFeed = new StringBuilder("{\"results\":[");
const int limit = 100000;
HashSet<string> removedIDSet = new HashSet<string>();
for (var i = 1; i < limit; i++) {
var removed = random.NextDouble() >= 0.5;
if (removed) {
var removedID = Misc.CreateGUID();
changesFeed.AppendFormat("{{\"seq\":\"{0}\",\"id\":\"{1}\",\"removed\":[\"fake\"]," +
"\"changes\":[{{\"rev\":\"1-deadbeef\"}}]}},",
i, removedID);
removedIDSet.Add(removedID);
} else {
changesFeed.AppendFormat("{{\"seq\":\"{0}\",\"id\":\"{1}\",\"changes\":[{{\"rev\":\"1-deadbeef\"}}]}},",
i, Misc.CreateGUID());
}
}
changesFeed.AppendFormat("{{\"seq\":\"{0}\",\"id\":\"{1}\",\"changes\":[{{\"rev\":\"1-deadbeef\"}}]}}]," +
"last_seq: \"{0}\"}}",
limit, Misc.CreateGUID());
var factory = new MockHttpClientFactory(false);
factory.HttpHandler.SetResponder("_changes", req =>
{
var response = new HttpResponseMessage(HttpStatusCode.OK);
var changesString = changesFeed.ToString();
response.Content = new StringContent(changesString);
return response;
});
factory.HttpHandler.SetResponder("_bulk_get", req =>
{
var contentStream = req.Content.ReadAsStreamAsync().Result;
var content = Manager.GetObjectMapper().ReadValue<IDictionary<string, object>>(contentStream);
var responseBody = new StringBuilder("--67aac1bcad803590b9a9e1999fc539438b3363fab35a24c17990188b222f\r\n");
foreach(var obj in content["docs"] as IEnumerable) {
var dict = obj.AsDictionary<string, object>();
var nonexistent = removedIDSet.Contains(dict.GetCast<string>("id"));
if(nonexistent) {
return new HttpResponseMessage(HttpStatusCode.InternalServerError); // Just so we can know
} else {
responseBody.Append("Content-Type: application/json\r\n\r\n");
responseBody.AppendFormat("{{\"_id\":\"{0}\",\"_rev\":\"1-deadbeef\",\"foo\":\"bar\"}}\r\n", dict["id"]);
}
responseBody.Append("--67aac1bcad803590b9a9e1999fc539438b3363fab35a24c17990188b222f\r\n");
}
responseBody.Remove(responseBody.Length - 2, 2);
responseBody.Append("--");
var retVal = new HttpResponseMessage(HttpStatusCode.OK);
var responseString = responseBody.ToString();
retVal.Content = new StringContent(responseString);
retVal.Content.Headers.Remove("Content-Type");
retVal.Content.Headers.TryAddWithoutValidation("Content-Type", "multipart/mixed; boundary=\"67aac1bcad803590b9a9e1999fc539438b3363fab35a24c17990188b222f\"");
return retVal;
});
manager.DefaultHttpClientFactory = factory;
using (var remoteDb = _sg.CreateDatabase(TempDbName())) {
var puller = database.CreatePullReplication(remoteDb.RemoteUri);
RunReplication(puller);
Assert.AreEqual(ReplicationStatus.Stopped, puller.Status);
Assert.AreNotEqual(limit, puller.ChangesCount);
Assert.AreNotEqual(limit, puller.CompletedChangesCount);
Assert.AreEqual(limit.ToString(), puller.LastSequence);
}
Sleep(1000);
}
[Test]
public void TestSetAndDeleteCookies()
{
if (!Boolean.Parse((string)GetProperty("replicationTestsEnabled")))
{
Assert.Inconclusive("Replication tests disabled.");
return;
}
using (var remoteDb = _sg.CreateDatabase(TempDbName())) {
var replicationUrl = remoteDb.RemoteUri;
var puller = database.CreatePullReplication(replicationUrl);
var cookieContainer = puller.CookieContainer;
// Set
var name = "foo";
var value = "bar";
var isSecure = false;
var httpOnly = false;
var domain = replicationUrl.Host;
var path = replicationUrl.PathAndQuery;
var expires = DateTime.Now.Add(TimeSpan.FromDays(1));
puller.SetCookie(name, value, path, expires, isSecure, httpOnly);
var cookies = cookieContainer.GetCookies(replicationUrl);
Assert.AreEqual(1, cookies.Count);
var cookie = cookies[0];
Assert.AreEqual(name, cookie.Name);
Assert.AreEqual(value, cookie.Value);
Assert.AreEqual(domain, cookie.Domain);
Assert.AreEqual(path, cookie.Path);
Assert.AreEqual(expires, cookie.Expires);
Assert.AreEqual(isSecure, cookie.Secure);
Assert.AreEqual(httpOnly, cookie.HttpOnly);
puller = database.CreatePullReplication(replicationUrl);
cookieContainer = puller.CookieContainer;
var name2 = "foo2";
puller.SetCookie(name2, value, path, expires, isSecure, httpOnly);
cookies = cookieContainer.GetCookies(replicationUrl);
Assert.AreEqual(2, cookies.Count);
// Delete
puller.DeleteCookie(name2);
Assert.AreEqual(1, cookieContainer.GetCookies(replicationUrl).Count);
Assert.AreEqual(name, cookieContainer.GetCookies(replicationUrl)[0].Name);
}
}
[Test]
public void TestCheckServerCompatVersion()
{
if (!Boolean.Parse((string)GetProperty("replicationTestsEnabled")))
{
Assert.Inconclusive("Replication tests disabled.");
return;
}
var replicator = database.CreatePushReplication(new Uri("http://fake.test-url.com:4984/fake/"));
Assert.IsFalse(replicator.CheckServerCompatVersion("0.01"));
replicator.ServerType = new RemoteServerVersion("Couchbase Sync Gateway/1.1.0");
Assert.IsTrue(replicator.CheckServerCompatVersion("1.00"));
Assert.IsFalse(replicator.CheckServerCompatVersion("2.00"));
}
[Test]
public void TestPusherFindCommonAncestor()
{
if (!Boolean.Parse((string)GetProperty("replicationTestsEnabled")))
{
Assert.Inconclusive("Replication tests disabled.");
return;
}
var ids = new List<string>();
ids.Add("second");
ids.Add("first");
var revDict = new Dictionary<string, object>();
revDict["ids"] = ids;
revDict["start"] = 2;
var properties = new Dictionary<string, object>();
properties["_revisions"] = revDict;
var rev = new RevisionInternal(properties);
Assert.AreEqual(0, Pusher.FindCommonAncestor(rev, new List<RevisionID>()));
Assert.AreEqual(0, Pusher.FindCommonAncestor(rev, (new [] {"3-noway".AsRevID(), "1-nope".AsRevID() }).ToList()));
Assert.AreEqual(1, Pusher.FindCommonAncestor(rev, (new [] {"3-noway".AsRevID(), "1-first".AsRevID() }).ToList()));
Assert.AreEqual(2, Pusher.FindCommonAncestor(rev, (new [] {"3-noway".AsRevID(), "2-second".AsRevID(), "1-first".AsRevID() }).ToList()));
}
[Test]
public void TestPushFilteredByDocId()
{
if (!Boolean.Parse((string)GetProperty("replicationTestsEnabled")))
{
Assert.Inconclusive("Replication tests disabled.");
return;
}
var countdown = new CountdownEvent(1);
using (var remoteDb = _sg.CreateDatabase(TempDbName())) {
var pusher = database.CreatePushReplication(remoteDb.RemoteUri);
int changesCount = 0;
pusher.Changed += (sender, e) =>
{
if (e.Source.ChangesCount > 0 && countdown.CurrentCount > 0) {
changesCount = e.Source.ChangesCount;
countdown.Signal();
}
};
var doc1 = database.CreateDocument();
doc1.PutProperties(new Dictionary<string, object> {
{ "doc1", "Foo" }
});
pusher.DocIds = new List<string> { doc1.GetProperty<string>("_id") };
var doc2 = database.CreateDocument();
doc2.PutProperties(new Dictionary<string, object> {
{ "doc2", "Foo" }
});
pusher.Start();
Assert.IsTrue(countdown.Wait(TimeSpan.FromSeconds(10)), "Replication timed out");
Assert.AreEqual(1, changesCount);
}
}
/**
* Verify that running a continuous push replication will emit a change while
* in an error state when run against a mock server that returns 500 Internal Server
* errors on every request.
*/
[Test]
public void TestContinuousReplicationErrorNotification() {
if (!Boolean.Parse((string)GetProperty("replicationTestsEnabled")))
{
Assert.Inconclusive("Replication tests disabled.");
return;
}
var httpClientFactory = new MockHttpClientFactory();
manager.DefaultHttpClientFactory = httpClientFactory;
var httpHandler = httpClientFactory.HttpHandler;
httpHandler.AddResponderThrowExceptionAllRequests();
using (var remoteDb = _sg.CreateDatabase(TempDbName())) {
var pusher = database.CreatePushReplication(remoteDb.RemoteUri);
pusher.Continuous = true;
var signal = new CountdownEvent(1);
var observer = new ReplicationErrorObserver(signal);
pusher.Changed += observer.Changed;
pusher.Start();
CreateDocuments(database, 10);
var success = signal.Wait(TimeSpan.FromSeconds(30));
Assert.IsTrue(success);
StopReplication(pusher);
}
}
/// <exception cref="System.Exception"></exception>
[Test]
public void TestContinuousPusherWithAttachment()
{
if (!Boolean.Parse((string)GetProperty("replicationTestsEnabled")))
{
Assert.Inconclusive("Replication tests disabled.");
return;
}
using (var remoteDb = _sg.CreateDatabase(TempDbName())) {
var remote = remoteDb.RemoteUri;
var pusher = database.CreatePushReplication(remote);
pusher.Continuous = true;
pusher.Start();
var docIdTimestamp = Convert.ToString((ulong)DateTime.UtcNow.TimeSinceEpoch().TotalMilliseconds);
var doc1Id = string.Format("doc1-{0}", docIdTimestamp);
var document = database.GetDocument(doc1Id);
var values = new Dictionary<string,object> {
{ "type" , "attachment_test" },
};
document.PutProperties(values);
Sleep(5000);
long expectedLength = 0;
document.Update((r) =>
{
var attachmentStream = GetAsset("attachment2.png");
var memoryStream = new MemoryStream();
attachmentStream.CopyTo(memoryStream);
expectedLength = memoryStream.Length;
r.SetAttachment("content", "application/octet-stream", memoryStream.ToArray());
return true;
});
// Make sure it has time to push the document
Sleep(5000);
// make sure the doc has been added
remoteDb.VerifyDocumentExists(doc1Id);
Sleep(2000);
var json = GetRemoteDocById(remote, doc1Id);
try {
var attachments = json["_attachments"].AsDictionary<string,object>();
var content = attachments["content"].AsDictionary<string,object>();
var lengthAsStr = content["length"];
var length = Convert.ToInt64(lengthAsStr);
Assert.AreEqual(expectedLength, length);
WriteDebug("TestContinuousPusherWithAttachment() finished");
} finally {
StopReplication(pusher);
}
}
}
private IDictionary<string, object> GetRemoteDocById(Uri remote, string docId)
{
var replicationUrlTrailing = new Uri(string.Format("{0}/", remote));
var pathToDoc = new Uri(replicationUrlTrailing, docId);
var request = new HttpRequestMessage(HttpMethod.Get, pathToDoc);
using(var client = new HttpClient()) {
var response = client.SendAsync(request).Result;
var result = response.Content.ReadAsStringAsync().Result;
var json = Manager.GetObjectMapper().ReadValue<JObject>(result);
return json.AsDictionary<string, object>();
}
}
[Test]
public void TestDifferentCheckpointsFilteredReplication() {
if (!Boolean.Parse((string)GetProperty("replicationTestsEnabled")))
{
Assert.Inconclusive("Replication tests disabled.");
return;
}
var pullerNoFilter = database.CreatePullReplication(new Uri("http://fake.test-url.com:4984/fake/"));
var noFilterCheckpointDocId = pullerNoFilter.RemoteCheckpointDocID();
var pullerWithFilter1 = database.CreatePullReplication(new Uri("http://fake.test-url.com:4984/fake/"));
pullerWithFilter1.Filter = "foo/bar";
pullerWithFilter1.DocIds = new List<string>()
{
"doc3", "doc1", "doc2"
};
pullerWithFilter1.FilterParams = new Dictionary<string, object>()
{
{ "a", "aval" },
{ "b", "bval" }
};
var withFilterCheckpointDocId = pullerWithFilter1.RemoteCheckpointDocID();
Assert.IsFalse(withFilterCheckpointDocId.Equals(noFilterCheckpointDocId));
var pullerWithFilter2 = database.CreatePullReplication(new Uri("http://fake.test-url.com:4984/fake/"));
pullerWithFilter2.Filter = "foo/bar";
pullerWithFilter2.DocIds = new List<string>()
{
"doc2", "doc3", "doc1"
};
pullerWithFilter2.FilterParams = new Dictionary<string, object>()
{
{ "b", "bval" },
{ "a", "aval" }
};
var withFilterCheckpointDocId2 = pullerWithFilter2.RemoteCheckpointDocID();
Assert.IsTrue(withFilterCheckpointDocId.Equals(withFilterCheckpointDocId2));
}
[Test]
public void TestPusherBatching()
{
if (!Boolean.Parse((string)GetProperty("replicationTestsEnabled")))
{
Assert.Inconclusive("Replication tests disabled.");
return;
}
// Create a bunch (InboxCapacity * 2) local documents
var numDocsToSend = Replication.InboxCapacity * 2;
for (var i = 0; i < numDocsToSend; i++)
{
var properties = new Dictionary<string, object>();
properties["testPusherBatching"] = i;
var doc = database.CreateDocument();
var rev = doc.PutProperties(properties);
Assert.IsNotNull(rev);
}
// Kick off a one time push replication to a mock
var httpClientFactory = new MockHttpClientFactory();
var httpHandler = httpClientFactory.HttpHandler;
httpHandler.AddResponderFakeLocalDocumentUpdate404();
manager.DefaultHttpClientFactory = httpClientFactory;
using (var remoteDb = _sg.CreateDatabase(TempDbName())) {
var pusher = database.CreatePushReplication(remoteDb.RemoteUri);
RunReplication(pusher);
Assert.IsNull(pusher.LastError);
var numDocsSent = 0;
// Verify that only INBOX_SIZE documents are included in any given bulk post request
var capturedRequests = httpHandler.CapturedRequests;
foreach (var request in capturedRequests) {
if (request.Method == HttpMethod.Post &&
request.RequestUri.AbsoluteUri.EndsWith("_bulk_docs", StringComparison.Ordinal)) {
var bytes = request.Content.ReadAsByteArrayAsync().Result;
var body = Manager.GetObjectMapper().ReadValue<IDictionary<string, object>>(bytes.AsEnumerable());
var docs = (JArray)body["docs"];
numDocsSent += docs.Count;
}
}
Assert.AreEqual(numDocsToSend, numDocsSent);
}
}
private void RunPushReplicationWithTransientError(Int32 errorCode, string statusMessage, Boolean expectError)
{
var properties1 = new Dictionary<string, object>()
{
{"doc1", "testPushReplicationTransientError"}
};
CreateDocumentWithProperties(database, properties1);
var httpClientFactory = new MockHttpClientFactory(false);
var httpHandler = httpClientFactory.HttpHandler;
manager.DefaultHttpClientFactory = httpClientFactory;
MockHttpRequestHandler.HttpResponseDelegate sentinal = MockHttpRequestHandler.FakeBulkDocs;
var responders = new List<MockHttpRequestHandler.HttpResponseDelegate>();
responders.Add(MockHttpRequestHandler.TransientErrorResponder(errorCode, statusMessage));
MockHttpRequestHandler.HttpResponseDelegate chainResponder = (request) =>
{
if (responders.Count > 0) {
var responder = responders[0];
responders.RemoveAt(0);
return responder(request);
}
return sentinal(request);
};
httpHandler.SetResponder("_bulk_docs", chainResponder);
// Create a replication observer to wait until replication finishes
var replicationDoneSignal = new CountdownEvent(1);
var replicationFinishedObserver = new ReplicationObserver(replicationDoneSignal);
using (var remoteDb = _sg.CreateDatabase(TempDbName())) {
var pusher = database.CreatePushReplication(remoteDb.RemoteUri);
pusher.Changed += replicationFinishedObserver.Changed;
// save the checkpoint id for later usage
var checkpointId = pusher.RemoteCheckpointDocID();
// kick off the replication
pusher.Start();
// wait for it to finish
var success = replicationDoneSignal.Wait(TimeSpan.FromSeconds(30));
Assert.IsTrue(success);
if (expectError) {
Assert.IsNotNull(pusher.LastError);
}
else {
Assert.IsNull(pusher.LastError);
}
// workaround for the fact that the replicationDoneSignal.Await() call could unblock before all
// the statements in Replication.Stopped() have even had a chance to execute.
Sleep(500);
var localLastSequence = database.LastSequenceWithCheckpointId(checkpointId);
if (expectError) {
Assert.Null(localLastSequence);
}
else {
Assert.IsNotNull(localLastSequence);
}
}
}
[Test]
public void TestPushReplicationRecoverableError()
{
var statusCode = 503;
var statusMessage = "Transient Error";
var expectError = false;
RunPushReplicationWithTransientError(statusCode, statusMessage, expectError);
}
[Test]
public void TestPushReplicationRecoverableIOException() {
var statusCode = -1; // code to tell it to throw an IOException
string statusMessage = null;
var expectError = false;
RunPushReplicationWithTransientError(statusCode, statusMessage, expectError);
}
[Test]
public void TestPushReplicationNonRecoverableError()
{
var statusCode = 404;
var statusMessage = "NOT FOUND";
var expectError = true;
RunPushReplicationWithTransientError(statusCode, statusMessage, expectError);
}
[Test]
public void TestPushUpdatedDocWithoutReSendingAttachments()
{
if (!Boolean.Parse((string)GetProperty("replicationTestsEnabled")))
{
Assert.Inconclusive("Replication tests disabled.");
return;
}
Assert.AreEqual(0, database.GetLastSequenceNumber());
var properties1 = new Dictionary<string, object>() {
{ "dynamic", 1 }
};
var doc = CreateDocumentWithProperties(database, properties1);
var rev1 = doc.CurrentRevision;
var unsavedRev2 = doc.CreateRevision();
var attachmentStream = GetAsset("attachment.png");
unsavedRev2.SetAttachment("attachment.png", "image/png", attachmentStream);
var rev2 = unsavedRev2.Save();
// Kick off a one time push replication to a mock
var httpClientFactory = new MockHttpClientFactory();
var httpHandler = httpClientFactory.HttpHandler;
httpHandler.AddResponderFakeLocalDocumentUpdate404();
httpHandler.SetResponder(doc.Id, (request) =>
{
var content = new Dictionary<string, object>()
{
{"id", doc.Id},
{"ok", true},
{"rev", doc.CurrentRevisionId}
};
return MockHttpRequestHandler.GenerateHttpResponseMessage(content);
});
manager.DefaultHttpClientFactory = httpClientFactory;
using (var remoteDb = _sg.CreateDatabase(TempDbName())) {
var pusher = database.CreatePushReplication(remoteDb.RemoteUri);
RunReplication(pusher);
httpHandler.ClearCapturedRequests();
var oldDoc = database.GetDocument(doc.Id);
var unsavedRev = oldDoc.CreateRevision();
var props = new Dictionary<string, object>(oldDoc.UserProperties);
props["dynamic"] = Convert.ToInt64(oldDoc.Properties["dynamic"]) + 1;
unsavedRev.SetProperties(props);
var savedRev = unsavedRev.Save();
httpHandler.SetResponder(doc.Id, (request) =>
{
var content = new Dictionary<string, object>() {
{ "id", doc.Id },
{ "ok", true },
{ "rev", savedRev.Id }
};
return MockHttpRequestHandler.GenerateHttpResponseMessage(content);
});
httpHandler.SetResponder("_revs_diff", (request) =>
{
var json = String.Format("{{\"{0}\":{{\"missing\":[\"{1}\"],\"possible_ancestors\":[\"{2},{3}\"]}}}}", doc.Id, savedRev.Id, rev1.Id, rev2.Id);
return MockHttpRequestHandler.GenerateHttpResponseMessage(HttpStatusCode.OK, "OK", json);
});
pusher = database.CreatePushReplication(remoteDb.RemoteUri);
RunReplication(pusher);
foreach (var request in httpHandler.CapturedRequests) {
if (request.Method == HttpMethod.Put) {
var isMultipartContent = (request.Content is MultipartContent);
Assert.IsFalse(isMultipartContent);
}
}
}
}
[Test]
public void TestServerDoesNotSupportMultipart() {
if (!Boolean.Parse((string)GetProperty("replicationTestsEnabled")))
{
Assert.Inconclusive("Replication tests disabled.");
return;
}
database.GetLastSequenceNumber().Should().Be(0, "because the database is empty");
var properties1 = new Dictionary<string, object>() {
{ "dynamic", 1 }
};
var doc = CreateDocumentWithProperties(database, properties1);
var rev1 = doc.CurrentRevision;
var unsavedRev2 = doc.CreateRevision();
var attachmentStream = GetAsset("attachment.png");
unsavedRev2.SetAttachment("attachment.png", "image/png", attachmentStream);
var rev2 = unsavedRev2.Save();
attachmentStream.Dispose();
rev2.Should().NotBeNull("because otherwise the revision failed to save");
unsavedRev2.Dispose();
var httpClientFactory = new MockHttpClientFactory();
var httpHandler = httpClientFactory.HttpHandler;
httpHandler.AddResponderFakeLocalDocumentUpdate404();
var responders = new List<MockHttpRequestHandler.HttpResponseDelegate>();
responders.Add((request) =>
{
var json = "{\"error\":\"Unsupported Media Type\",\"reason\":\"missing\"}";
return MockHttpRequestHandler.GenerateHttpResponseMessage(HttpStatusCode.UnsupportedMediaType,
"Unsupported Media Type", json);
});
responders.Add((request) =>
{
var props = new Dictionary<string, object>()
{
{"id", doc.Id},
{"ok", true},
{"rev", doc.CurrentRevisionId}
};
return MockHttpRequestHandler.GenerateHttpResponseMessage(props);
});
MockHttpRequestHandler.HttpResponseDelegate chainResponder = (request) =>
{
if (responders.Count > 0) {
var responder = responders[0];
responders.RemoveAt(0);
return responder(request);
}
return null;
};
httpHandler.SetResponder(doc.Id, chainResponder);
manager.DefaultHttpClientFactory = httpClientFactory;
using (var remoteDb = _sg.CreateDatabase(TempDbName())) {
var pusher = database.CreatePushReplication(remoteDb.RemoteUri);
RunReplication(pusher);
var count = 0;
foreach (var request in httpHandler.CapturedRequests) {
if (request.Method == HttpMethod.Put && request.RequestUri.PathAndQuery.Contains(doc.Id)) {
var isMultipartContent = (request.Content is MultipartContent);
if (count == 0) {
isMultipartContent.Should().BeTrue("because the first attempt will try multipart");
}
else {
isMultipartContent.Should().BeFalse("because the second attempt will fall back to non-multipart");
}
count++;
}
}
}
}
[Test]
public void TestPushPullDocumentWithAttachment()
{
if (!Boolean.Parse((string)GetProperty("replicationTestsEnabled")))
{
Assert.Inconclusive("Replication tests disabled.");
return;
}
var props = new Dictionary<string, object>()
{
{"type", "post"},
{"title", "This is a post."}
};
var doc = database.CreateDocument();
doc.PutProperties(props);
var docId = doc.Id;
var unsavedRev = doc.CreateRevision();
var attachmentStream = GetAsset("attachment.png");
unsavedRev.SetAttachment("photo", "image/png", attachmentStream);
var rev = unsavedRev.Save();
var attachment = rev.GetAttachment("photo");
var attachmentLength = attachment.Length;
using (var remoteDb = _sg.CreateDatabase(TempDbName())) {
var pusher = database.CreatePushReplication(remoteDb.RemoteUri);
RunReplication(pusher);
//In release mode this actually goes so fast that sync gateway doesn't
//have time to store the document before we try to pull it
Sleep(500);
var db = manager.GetDatabase("tmp");
var puller = db.CreatePullReplication(remoteDb.RemoteUri);
RunReplication(puller);
doc = db.GetExistingDocument(docId);
Assert.IsNotNull(doc);
attachment = doc.CurrentRevision.GetAttachment("photo");
Assert.IsNotNull(attachment);
Assert.AreEqual(attachmentLength, attachment.Length);
Assert.IsNotNull(attachment.Content);
db.Close();
}
}
[Test, Category("issue348")]
public void TestConcurrentPushPullAndLiveQueryWithFilledDatabase()
{
if (!Boolean.Parse((string)GetProperty("replicationTestsEnabled")))
{
Assert.Inconclusive("Replication tests disabled.");
return;
}
// Create remote docs.
const int docsToCreate = 100;
using (var remoteDb = _sg.CreateDatabase(TempDbName())) {
var docList = remoteDb.AddDocuments(docsToCreate, true);
// Create local docs
for (int i = 0; i < docsToCreate; i++) {
var docIdTimestamp = Convert.ToString((ulong)DateTime.UtcNow.TimeSinceEpoch().TotalMilliseconds);
var docId = string.Format("doc{0}-{1}", i, docIdTimestamp);
var docBody = GetDocWithId(docId, "attachment.png");
var doc = database.CreateDocument();
doc.PutProperties(docBody);
docList.Add(doc.Id);
}
var mre = new CountdownEvent(docsToCreate * 2);
var puller = database.CreatePullReplication(remoteDb.RemoteUri);
puller.Changed += (sender, e) =>
{
WriteDebug("Puller Changed: {0}/{1}/{2}", puller.Status, puller.ChangesCount, puller.CompletedChangesCount);
if (puller.Status != ReplicationStatus.Stopped)
return;
WriteDebug("Puller Completed Changes after stopped: {0}", puller.CompletedChangesCount);
};
int numDocsBeforePull = database.GetDocumentCount();
View view = database.GetView("testPullerWithLiveQueryView");
view.SetMapReduce((document, emitter) =>
{
if (document.CblID() != null) {
emitter(document.CblID(), null);
}
}, null, "1");
LiveQuery allDocsLiveQuery = view.CreateQuery().ToLiveQuery();
int numTimesCalled = 0;
allDocsLiveQuery.Changed += (sender, e) =>
{
if (e.Error != null) {
throw new ApplicationException("Fail", e.Error);
}
if (numTimesCalled++ > 0 && e.Rows.Count > 0) {
Assert.IsTrue(e.Rows.Count > numDocsBeforePull, String.Format("e.Rows.Count ({0}) <= numDocsBeforePull ({1})", e.Rows.Count, numDocsBeforePull));
}
WriteDebug("rows {0} / times called {1}", e.Rows.Count, numTimesCalled);
foreach (var row in e.Rows) {
if (docList.Contains(row.DocumentId)) {
mre.Signal();
docList.Remove(row.DocumentId);
}
}
WriteDebug("Remaining docs to be found: {0}", mre.CurrentCount);
};
var pusher = database.CreatePushReplication(remoteDb.RemoteUri);
pusher.Start();
// the first time this is called back, the rows will be empty.
// but on subsequent times we should expect to get a non empty
// row set.
allDocsLiveQuery.Start();
puller.Start();
Assert.IsTrue(mre.Wait(TimeSpan.FromSeconds(180)), "Replication Timeout");
StopReplication(pusher);
StopReplication(puller);
allDocsLiveQuery.Stop();
}
}
[Test]
public void TestPullReplicationWithUsername()
{
using(var remoteDb = _sg.CreateDatabase(TempDbName())) {
remoteDb.DisableGuestAccess();
var docIdTimestamp = Convert.ToString((ulong)DateTime.UtcNow.TimeSinceEpoch().TotalMilliseconds);
var doc1Id = string.Format("doc1-{0}", docIdTimestamp);
var doc2Id = string.Format("doc2-{0}", docIdTimestamp);
remoteDb.AddDocument(doc1Id, "attachment.png");
remoteDb.AddDocument(doc2Id, "attachment2.png");
var repl = database.CreatePullReplication(remoteDb.RemoteUri);
repl.Authenticator = new BasicAuthenticator("jim", "borden");
var wait = new CountdownEvent(1);
repl.Changed += (sender, e) =>
{
if(wait.CurrentCount == 0) {
return;
}
WriteDebug("New replication status {0}", e.Source.Status);
if((e.Source.Status == ReplicationStatus.Idle || e.Source.Status == ReplicationStatus.Stopped) &&
e.Source.ChangesCount > 0 && e.Source.CompletedChangesCount == e.Source.ChangesCount) {
wait.Signal();
}
};
repl.Start();
Assert.IsTrue(wait.Wait(TimeSpan.FromSeconds(60)), "Pull replication timed out");
Assert.IsNotNull(database.GetExistingDocument(doc1Id), "Didn't get doc1 from puller");
Assert.IsNotNull(database.GetExistingDocument(doc2Id), "Didn't get doc2 from puller");
Assert.IsNull(repl.LastError);
repl.Stop();
docIdTimestamp = Convert.ToString((ulong)DateTime.UtcNow.TimeSinceEpoch().TotalMilliseconds);
doc1Id = string.Format("doc1-{0}", docIdTimestamp);
doc2Id = string.Format("doc2-{0}", docIdTimestamp);
remoteDb.AddDocument(doc1Id, "attachment.png");
remoteDb.AddDocument(doc2Id, "attachment2.png");
repl = database.CreatePullReplication(remoteDb.RemoteUri);
repl.Changed += (sender, e) =>
{
if(wait.CurrentCount == 0) {
return;
}
WriteDebug("New replication status {0}", e.Source.Status);
if((e.Source.Status == ReplicationStatus.Idle || e.Source.Status == ReplicationStatus.Stopped) &&
e.Source.CompletedChangesCount == e.Source.ChangesCount) {
wait.Signal();
}
};
repl.Authenticator = new BasicAuthenticator("jim", "bogus");
wait.Reset(1);
repl.Start();
Assert.IsTrue(wait.Wait(TimeSpan.FromSeconds(60)), "Pull replication timed out");
Assert.IsNull(database.GetExistingDocument(doc1Id), "Got rogue doc1 from puller");
Assert.IsNull(database.GetExistingDocument(doc2Id), "Got rogue doc2 from puller");
repl.Stop();
}
}
[Test]
public void TestReplicationCheckpointUniqueness()
{
var repl1 = database.CreatePullReplication(new Uri("http://fake.test-url.com:4984/fake/"));
var repl2 = database.CreatePullReplication(new Uri("http://fake.test-url.com:4984/fake/"));
Assert.AreEqual(repl1.RemoteCheckpointDocID(), repl2.RemoteCheckpointDocID());
repl1 = database.CreatePullReplication(new Uri("http://fake.test-url.com:4984/fake/"));
repl2 = database.CreatePullReplication(new Uri("http://fake.test-url.com:4984/fake/"));
repl1.Channels = new List<string> { "A" };
repl2.Channels = new List<string> { "A", "B" };
Assert.AreNotEqual(repl1.RemoteCheckpointDocID(), repl2.RemoteCheckpointDocID());
}
[Test]
[Category("issue_398")]
public void TestPusherUsesFilterParams()
{
var docIdTimestamp = Convert.ToString((ulong)DateTime.UtcNow.TimeSinceEpoch().TotalMilliseconds);
var doc1Id = string.Format("doc1-{0}", docIdTimestamp);
var doc2Id = string.Format("doc2-{0}", docIdTimestamp);
var doc1 = database.GetDocument(doc1Id);
doc1.PutProperties(new Dictionary<string, object> { { "foo", "bar" } });
var doc2 = database.GetDocument(doc2Id);
doc2.PutProperties(new Dictionary<string, object> { { "bar", "foo" } });
var mre = new ManualResetEventSlim();
IDictionary<string, object> gotParams = null;
database.SetFilter("issue-398", (rev, parameters) =>
{
gotParams = parameters;
if(!mre.IsSet) {
mre.Set();
}
return true;
});
using (var remoteDb = _sg.CreateDatabase(TempDbName())) {
var push = database.CreatePushReplication(remoteDb.RemoteUri);
push.Filter = "issue-398";
push.FilterParams = new Dictionary<string, object> { { "issue-398", "finished" } };
push.Start();
mre.Wait();
Assert.AreEqual(push.FilterParams, gotParams);
}
}
[Test]
public void TestBulkPullTransientExceptionRecovery() {
if (!Boolean.Parse((string)GetProperty("replicationTestsEnabled")))
{
Assert.Inconclusive("Replication tests disabled.");
return;
}
var fakeFactory = new MockHttpClientFactory(false);
FlowControl flow = new FlowControl(new FlowItem[]
{
new FunctionRunner<HttpResponseMessage>(() => {
Sleep(7000);
return new RequestCorrectHttpMessage();
}) { ExecutionCount = 2 },
new FunctionRunner<HttpResponseMessage>(() => {
fakeFactory.HttpHandler.ClearResponders();
return new RequestCorrectHttpMessage();
}) { ExecutionCount = 1 }
});
fakeFactory.HttpHandler.SetResponder("_bulk_get", (request) =>
flow.ExecuteNext<HttpResponseMessage>());
manager.DefaultHttpClientFactory = fakeFactory;
#pragma warning disable 618
ManagerOptions.Default.RequestTimeout = TimeSpan.FromSeconds(5);
#pragma warning restore 618
using (var remoteDb = _sg.CreateDatabase(TempDbName())) {
CreatePullAndTest(20, remoteDb, (repl) => Assert.AreEqual(20, database.GetDocumentCount(), "Didn't recover from the error"));
}
Thread.Sleep(1000);
}
[Test]
public void TestBulkPullPermanentExceptionSurrender() {
if (!Boolean.Parse((string)GetProperty("replicationTestsEnabled")))
{
Assert.Inconclusive("Replication tests disabled.");
return;
}
Log.Domains.Sync.Level = Log.LogLevel.Debug;
var fakeFactory = new MockHttpClientFactory(false);
FlowControl flow = new FlowControl(new FlowItem[]
{
new ExceptionThrower(new SocketException()) { ExecutionCount = -1 },
});
fakeFactory.HttpHandler.SetResponder("_bulk_get", (request) =>
flow.ExecuteNext<HttpResponseMessage>());
manager.DefaultHttpClientFactory = fakeFactory;
using (var remoteDb = _sg.CreateDatabase(TempDbName())) {
CreatePullAndTest(20, remoteDb, repl => Assert.IsTrue(database.GetDocumentCount() < 20, "Somehow got all the docs"));
}
}
[Test]
public void TestFailedBulkGetDoesntChangeLastSequence()
{
if (!Boolean.Parse((string)GetProperty("replicationTestsEnabled")))
{
Assert.Inconclusive("Replication tests disabled.");
return;
}
string firstBulkGet = null;
using(var remoteDb = _sg.CreateDatabase(TempDbName())) {
var fakeFactory = new MockHttpClientFactory(false);
fakeFactory.HttpHandler.SetResponder("_bulk_get", (request) =>
{
var str = default(string);
if(request.Content is CompressedContent) {
var stream = request.Content.ReadAsStreamAsync().Result;
str = Encoding.UTF8.GetString(stream.ReadAllBytes());
} else {
str = request.Content.ReadAsStringAsync().Result;
}
if (firstBulkGet == null || firstBulkGet.Equals(str)) {
WriteDebug("Rejecting this bulk get because it looks like the first batch");
firstBulkGet = str;
throw new OperationCanceledException();
}
WriteDebug("Letting this bulk get through");
return new RequestCorrectHttpMessage();
});
int gotSequence = 0;
fakeFactory.HttpHandler.SetResponder("doc", request =>
{
Regex r = new Regex("doc[0-9]+");
var m = r.Match(request.RequestUri.PathAndQuery);
if(m.Success) {
var str = m.Captures[0].Value;
var converted = Int32.Parse(str.Substring(3)) + 4;
if(gotSequence == 0 || converted - gotSequence == 1) {
gotSequence = converted;
}
}
return new RequestCorrectHttpMessage();
});
manager.DefaultHttpClientFactory = fakeFactory;
#pragma warning disable 618
Manager.DefaultOptions.MaxRevsToGetInBulk = 10;
Manager.DefaultOptions.MaxOpenHttpConnections = 8;
Manager.DefaultOptions.RequestTimeout = TimeSpan.FromSeconds(5);
CreatePullAndTest((int)(Manager.DefaultOptions.MaxRevsToGetInBulk * 1.5), remoteDb, repl =>
{
WriteDebug("Document count increased to {0} with last sequence '{1}'", database.GetDocumentCount(), repl.LastSequence);
Assert.IsTrue(database.GetDocumentCount() > 0, "Didn't get docs from second bulk get batch");
Assert.AreEqual(gotSequence, Int32.Parse(repl.LastSequence), "LastSequence was advanced");
});
#pragma warning restore 618
Sleep(500);
fakeFactory.HttpHandler.ClearResponders();
var pull = database.CreatePullReplication(remoteDb.RemoteUri);
RunReplication(pull);
Assert.AreEqual(pull.ChangesCount, pull.CompletedChangesCount);
Assert.AreNotEqual(pull.LastSequence, "0");
}
}
[Test]
public void TestRemovedRevision()
{
if (!Boolean.Parse((string)GetProperty("replicationTestsEnabled")))
{
Assert.Inconclusive("Replication tests disabled.");
return;
}
using (var remoteDb = _sg.CreateDatabase(TempDbName())) {
var doc = database.GetDocument("doc1");
var unsaved = doc.CreateRevision();
unsaved.SetUserProperties(new Dictionary<string, object> {
{ "_removed", true }
});
Assert.DoesNotThrow(() => unsaved.Save());
var pusher = database.CreatePushReplication(remoteDb.RemoteUri);
pusher.Start();
Assert.IsTrue(pusher.IsDocumentPending(doc));
RunReplication(pusher);
Assert.IsNull(pusher.LastError);
Assert.AreEqual(0, pusher.ChangesCount);
Assert.AreEqual(0, pusher.CompletedChangesCount);
Assert.IsFalse(pusher.IsDocumentPending(doc));
}
}
//Note: requires manual intervention (unplugging network cable, etc)
public void TestReactToNetworkChange()
{
CreateDocuments(database, 10);
var offlineEvent = new ManualResetEvent(false);
var resumedEvent = new ManualResetEvent(false);
var finishedEvent = new ManualResetEvent(false);
using (var remoteDb = _sg.CreateDatabase(TempDbName())) {
var push = database.CreatePushReplication(remoteDb.RemoteUri);
push.Continuous = true;
push.Changed += (sender, args) =>
{
if (args.Status == ReplicationStatus.Offline) {
Console.WriteLine("Replication went offline");
offlineEvent.Set();
} else if (args.Status == ReplicationStatus.Active) {
Console.WriteLine("Replication resumed");
resumedEvent.Set();
} else if (args.Status == ReplicationStatus.Idle) {
Console.WriteLine("Replication finished");
finishedEvent.Set();
}
};
push.Start();
// ***** PULL OUT NETWORK CABLE OR SOMETHING HERE ***** //
Task.Delay(1000).ContinueWith(t => Console.WriteLine("***** Test will continue when network connectivity is lost... *****"));
Assert.True(offlineEvent.WaitOne(TimeSpan.FromSeconds(60)));
CreateDocuments(database, 10);
// ***** UNDO THE ABOVE CHANGES AND RESTORE CONNECTIVITY ***** //
Console.WriteLine("***** Test will continue when network connectivity is restored... *****");
resumedEvent.Reset();
Assert.True(resumedEvent.WaitOne(TimeSpan.FromSeconds(60)));
finishedEvent.Reset();
Assert.True(finishedEvent.WaitOne(TimeSpan.FromSeconds(15)));
Assert.AreEqual(20, push.ChangesCount);
Assert.AreEqual(20, push.CompletedChangesCount);
push.Stop();
}
using (var remoteDb = _sg.CreateDatabase(TempDbName())) {
remoteDb.AddDocuments(10, false);
var secondDb = manager.GetDatabase("foo");
var pull = secondDb.CreatePullReplication(remoteDb.RemoteUri);
pull.Continuous = true;
pull.Changed += (sender, args) =>
{
if (args.Status == ReplicationStatus.Offline) {
Console.WriteLine("Replication went offline");
offlineEvent.Set();
} else if (args.Status == ReplicationStatus.Active) {
Console.WriteLine("Replication resumed");
resumedEvent.Set();
} else if (args.Status == ReplicationStatus.Idle) {
Console.WriteLine("Replication finished");
finishedEvent.Set();
}
};
offlineEvent.Reset();
pull.Start();
// ***** PULL OUT NETWORK CABLE OR SOMETHING HERE ***** //
Task.Delay(2000).ContinueWith(t => Console.WriteLine("***** Test will continue when network connectivity is lost... *****"));
Assert.True(offlineEvent.WaitOne(TimeSpan.FromSeconds(60)));
remoteDb.AddDocuments(10, false);
// ***** UNDO THE ABOVE CHANGES AND RESTORE CONNECTIVITY ***** //
Console.WriteLine("***** Test will continue when network connectivity is restored... *****");
resumedEvent.Reset();
Assert.True(resumedEvent.WaitOne(TimeSpan.FromSeconds(60)));
finishedEvent.Reset();
Assert.True(finishedEvent.WaitOne(TimeSpan.FromSeconds(15)));
Assert.AreEqual(20, secondDb.GetDocumentCount());
Assert.AreEqual(20, pull.ChangesCount);
Assert.AreEqual(20, pull.CompletedChangesCount);
pull.Stop();
}
}
[Test]
public void TestRemovedChangesFeed()
{
if (!Boolean.Parse((string)GetProperty("replicationTestsEnabled")))
{
Assert.Inconclusive("Replication tests disabled.");
return;
}
using (var remoteDb = _sg.CreateDatabase(TempDbName(), "test_user", "1234")) {
var doc = database.GetDocument("channel_walker");
doc.PutProperties(new Dictionary<string, object> {
{ "foo", "bar" },
{ "channels", new List<object> { "unit_test" } }
});
var pusher = database.CreatePushReplication(remoteDb.RemoteUri);
RunReplication(pusher);
doc.Update(rev =>
{
var props = rev.UserProperties;
props["channels"] = new List<object> { "no_mans_land" };
props.Remove("foo");
rev.SetUserProperties(props);
return true;
});
pusher = database.CreatePushReplication(remoteDb.RemoteUri);
RunReplication(pusher);
doc.Update(rev =>
{
var props = rev.UserProperties;
props["magic"] = true;
rev.SetUserProperties(props);
return true;
});
pusher = database.CreatePushReplication(remoteDb.RemoteUri);
RunReplication(pusher);
database.Delete();
database = manager.GetDatabase(database.Name);
remoteDb.DisableGuestAccess();
var puller = database.CreatePullReplication(remoteDb.RemoteUri);
puller.Authenticator = new BasicAuthenticator("test_user", "1234");
RunReplication(puller);
Assert.IsNull(puller.LastError);
Assert.AreEqual(0, database.GetDocumentCount());
Assert.DoesNotThrow(() => doc = database.GetExistingDocument("channel_walker"));
Assert.IsNull(doc);
}
}
[Test]
public void TestReplicatorSeparateCookies()
{
using (var secondDb = manager.GetDatabase("cblitetest2"))
using (var remoteDb = _sg.CreateDatabase(TempDbName())) {
var puller1 = database.CreatePullReplication(remoteDb.RemoteUri);
puller1.SetCookie("whitechoco", "sweet", "/", DateTime.Now.AddSeconds(60), false, false);
Assert.AreEqual(1, puller1.CookieContainer.Count);
var pusher1 = database.CreatePushReplication(remoteDb.RemoteUri);
Assert.AreEqual(1, pusher1.CookieContainer.Count);
var puller2 = secondDb.CreatePullReplication(remoteDb.RemoteUri);
Assert.AreEqual(0, puller2.CookieContainer.Count);
puller1.SetCookie("whitechoco", "bitter sweet", "/", DateTime.Now.AddSeconds(60), false, false);
Assert.AreEqual(1, puller1.CookieContainer.Count);
Assert.AreEqual(1, pusher1.CookieContainer.Count);
Assert.AreEqual(0, puller2.CookieContainer.Count);
}
}
[Test]
public void TestGatewayTemporarilyGoesOffline()
{
CreateDocuments(database, 10);
using (var remoteDb = _sg.CreateDatabase(TempDbName())) {
var pusher = database.CreatePushReplication(remoteDb.RemoteUri);
pusher.Continuous = true;
pusher.Start();
_sg.SetOffline(remoteDb.Name);
Sleep(15000);
_sg.SetOnline(remoteDb.Name);
while (pusher.Status == ReplicationStatus.Active) {
Thread.Sleep(100);
}
Assert.AreEqual(ReplicationStatus.Idle, pusher.Status);
Assert.AreEqual("0", pusher.LastSequence);
pusher.Stop();
}
}
[Test]
public void TestStopDoesntWait()
{
if (!Boolean.Parse((string)GetProperty("replicationTestsEnabled"))) {
Assert.Inconclusive("Replication tests disabled.");
return;
}
using(var remoteDb = _sg.CreateDatabase(TempDbName())) {
remoteDb.AddDocuments(1000, false);
var puller = database.CreatePullReplication(remoteDb.RemoteUri);
var mre = new ManualResetEventSlim();
puller.Changed += (sender, e) =>
{
if(e.CompletedChangesCount > 0 && !mre.IsSet) {
mre.Set();
}
};
puller.Start();
mre.Wait();
puller.Stop();
while (puller.Status != ReplicationStatus.Stopped) {
Sleep(200);
}
Assert.AreNotEqual(1000, puller.CompletedChangesCount);
Assert.Greater(Int64.Parse(puller.LastSequence), 0);
Assert.IsNull(puller.LastError);
}
}
[Category("issue/606")]
public void TestPushAndPurge()
{
if (!Boolean.Parse((string)GetProperty("replicationTestsEnabled")))
{
Assert.Inconclusive("Replication tests disabled.");
return;
}
const int numDocs = 100;
using(var remoteDb = _sg.CreateDatabase(TempDbName())) {
for (int pass = 1; pass <= 2; ++pass) {
Console.WriteLine("Pass #{0}: Creating {1} documents", pass, numDocs);
database.RunInTransaction(() =>
{
for(int i = 1; i <= numDocs; i++) {
var doc = database.GetDocument(String.Format("doc-{0}", i));
Assert.DoesNotThrow(() => doc.PutProperties(new Dictionary<string, object> {
{ "index", i },
{ "bar", false }
}));
}
return true;
});
var repl = database.CreatePushReplication(remoteDb.RemoteUri);
repl.ReplicationOptions.AllNew = true;
repl.ReplicationOptions.PurgePushed = true;
RunReplication(repl);
Assert.IsNull(repl.LastError);
Assert.AreEqual(numDocs, repl.ChangesCount);
Assert.AreEqual(numDocs, repl.CompletedChangesCount);
Assert.AreEqual(0, database.GetDocumentCount());
}
}
}
}
}
| 42.714332 | 257 | 0.53828 | [
"Apache-2.0"
] | brettharrisonzya/couchbase-lite-net | src/Couchbase.Lite.Tests.Shared/ReplicationTest.cs | 132,628 | C# |
//Released under the MIT License.
//
//Copyright (c) 2018 Ntreev Soft co., Ltd.
//
//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 Ntreev.Crema.ServiceModel;
using Ntreev.Crema.Services;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.Composition;
using System.Text;
namespace Ntreev.Crema.Javascript.Methods.TypeTemplate
{
[Export(typeof(IScriptMethod))]
[PartCreationPolicy(CreationPolicy.NonShared)]
[Category(nameof(TypeTemplate))]
class BeginTypeCreateMethod : DataBaseScriptMethodBase
{
[ImportingConstructor]
public BeginTypeCreateMethod(ICremaHost cremaHost)
: base(cremaHost)
{
}
protected override Delegate CreateDelegate()
{
return new Func<string, string, string>(this.BeginTypeCreate);
}
[ReturnParameterName("domainID")]
private string BeginTypeCreate(string dataBaseName, string categoryPath)
{
if (categoryPath == null)
throw new ArgumentNullException(nameof(categoryPath));
var dataBase = this.GetDataBase(dataBaseName);
return dataBase.Dispatcher.Invoke(() =>
{
var category = dataBase.TypeContext.Categories[categoryPath];
if (category == null)
throw new CategoryNotFoundException(categoryPath);
var authentication = this.Context.GetAuthentication(this);
var template = category.NewType(authentication);
return $"{template.Domain.ID}";
});
}
}
}
| 42.095238 | 121 | 0.699095 | [
"MIT"
] | NtreevSoft/Crema | common/Ntreev.Crema.Javascript.Sharing/Methods/TypeTemplate/BeginTypeCreateMethod.cs | 2,654 | C# |
namespace MediaLibrary
{
partial class MainForm
{
/// <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()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
this.mainMenu = new System.Windows.Forms.MenuStrip();
this.optionsMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.addIndexedFolderMainMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.aboutMainMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolsMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.findDuplicatesMainMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.editPeopleMainMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.editTagRulesMainMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.mergePeopleToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.editMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.favoriteMainMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.editTagsMainMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.addPeopleMainMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator();
this.copyMainMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.statusStrip = new System.Windows.Forms.StatusStrip();
this.mainProgressBar = new System.Windows.Forms.ToolStripProgressBar();
this.toolStrip = new System.Windows.Forms.ToolStrip();
this.playButton = new System.Windows.Forms.ToolStripButton();
this.playAllButton = new System.Windows.Forms.ToolStripButton();
this.shuffleAllButton = new System.Windows.Forms.ToolStripButton();
this.rateAllButton = new System.Windows.Forms.ToolStripSplitButton();
this.defaultRatingMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator10 = new System.Windows.Forms.ToolStripSeparator();
this.newCategoryMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.homeButton = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.favoriteFilesDropDown = new System.Windows.Forms.ToolStripSplitButton();
this.favoriteFilesMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
this.favoriteAudioMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.favoriteImagesMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.favoriteVideoMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.starredDropDown = new System.Windows.Forms.ToolStripSplitButton();
this.starredFilesMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
this.starredAudioMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.starredImagesMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.starredVideoMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.audioDropDown = new System.Windows.Forms.ToolStripSplitButton();
this.allAudioMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
this.audioFavoritesMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.audioStarsMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.imagesDropDown = new System.Windows.Forms.ToolStripSplitButton();
this.allImagesMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator();
this.imageFavoritesMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.imageStarsMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.videoDropDown = new System.Windows.Forms.ToolStripSplitButton();
this.allVideoMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator();
this.videoFavoritesMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.videoStarsMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.searchBox = new System.Windows.Forms.ToolStripTextBox();
this.viewButton = new System.Windows.Forms.ToolStripDropDownButton();
this.refreshMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator11 = new System.Windows.Forms.ToolStripSeparator();
this.showPreviewMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator();
this.detailsMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.thumbnailsMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator();
this.savedSearchesMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveThisSearchMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.savedSearchesSeparator = new System.Windows.Forms.ToolStripSeparator();
this.fileTypeImages = new System.Windows.Forms.ImageList(this.components);
this.itemContextMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
this.favoriteContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.editTagsContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.addPeopleContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripActionSeparator = new System.Windows.Forms.ToolStripSeparator();
this.openContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.copyContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.splitContainer = new System.Windows.Forms.SplitContainer();
this.mainMenu.SuspendLayout();
this.statusStrip.SuspendLayout();
this.toolStrip.SuspendLayout();
this.itemContextMenu.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
this.splitContainer.SuspendLayout();
this.SuspendLayout();
//
// mainMenu
//
this.mainMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.optionsMenuItem,
this.toolsMenuItem,
this.editMenuItem});
this.mainMenu.Location = new System.Drawing.Point(0, 0);
this.mainMenu.Name = "mainMenu";
this.mainMenu.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional;
this.mainMenu.Size = new System.Drawing.Size(800, 24);
this.mainMenu.TabIndex = 0;
this.mainMenu.Text = "menuStrip";
//
// optionsMenuItem
//
this.optionsMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.addIndexedFolderMainMenuItem,
this.aboutMainMenuItem});
this.optionsMenuItem.Name = "optionsMenuItem";
this.optionsMenuItem.Size = new System.Drawing.Size(61, 20);
this.optionsMenuItem.Text = "&Options";
//
// addIndexedFolderMainMenuItem
//
this.addIndexedFolderMainMenuItem.Image = global::MediaLibrary.Properties.Resources.folder_add;
this.addIndexedFolderMainMenuItem.Name = "addIndexedFolderMainMenuItem";
this.addIndexedFolderMainMenuItem.Size = new System.Drawing.Size(186, 22);
this.addIndexedFolderMainMenuItem.Text = "Add &Indexed Folder...";
this.addIndexedFolderMainMenuItem.Click += new System.EventHandler(this.AddIndexedFolderToolStripMenuItem_Click);
//
// aboutMainMenuItem
//
this.aboutMainMenuItem.Image = global::MediaLibrary.Properties.Resources.information_circle;
this.aboutMainMenuItem.Name = "aboutMainMenuItem";
this.aboutMainMenuItem.Size = new System.Drawing.Size(186, 22);
this.aboutMainMenuItem.Text = "Ab&out...";
this.aboutMainMenuItem.Click += new System.EventHandler(this.AboutToolStripMenuItem_Click);
//
// toolsMenuItem
//
this.toolsMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.findDuplicatesMainMenuItem,
this.editPeopleMainMenuItem,
this.editTagRulesMainMenuItem,
this.mergePeopleToolStripMenuItem});
this.toolsMenuItem.Name = "toolsMenuItem";
this.toolsMenuItem.Size = new System.Drawing.Size(46, 20);
this.toolsMenuItem.Text = "Tools";
//
// findDuplicatesMainMenuItem
//
this.findDuplicatesMainMenuItem.Image = global::MediaLibrary.Properties.Resources.common_file_stack;
this.findDuplicatesMainMenuItem.Name = "findDuplicatesMainMenuItem";
this.findDuplicatesMainMenuItem.Size = new System.Drawing.Size(164, 22);
this.findDuplicatesMainMenuItem.Text = "Find &Duplicates...";
this.findDuplicatesMainMenuItem.Click += new System.EventHandler(this.FindDuplicatesMenuItem_Click);
//
// editPeopleMainMenuItem
//
this.editPeopleMainMenuItem.Image = global::MediaLibrary.Properties.Resources.multiple_actions_edit_1;
this.editPeopleMainMenuItem.Name = "editPeopleMainMenuItem";
this.editPeopleMainMenuItem.Size = new System.Drawing.Size(164, 22);
this.editPeopleMainMenuItem.Text = "Edit &People...";
this.editPeopleMainMenuItem.Click += new System.EventHandler(this.EditPeopleMenuItem_Click);
//
// editTagRulesMainMenuItem
//
this.editTagRulesMainMenuItem.Image = global::MediaLibrary.Properties.Resources.tags_settings;
this.editTagRulesMainMenuItem.Name = "editTagRulesMainMenuItem";
this.editTagRulesMainMenuItem.Size = new System.Drawing.Size(164, 22);
this.editTagRulesMainMenuItem.Text = "Edit &Tag Rules...";
this.editTagRulesMainMenuItem.Click += new System.EventHandler(this.EditTagRulesMenuItem_Click);
//
// mergePeopleToolStripMenuItem
//
this.mergePeopleToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("mergePeopleToolStripMenuItem.Image")));
this.mergePeopleToolStripMenuItem.Name = "mergePeopleToolStripMenuItem";
this.mergePeopleToolStripMenuItem.Size = new System.Drawing.Size(164, 22);
this.mergePeopleToolStripMenuItem.Text = "Mer&ge People...";
this.mergePeopleToolStripMenuItem.Click += new System.EventHandler(this.MergePeopleMenuItem_Click);
//
// editMenuItem
//
this.editMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.favoriteMainMenuItem,
this.editTagsMainMenuItem,
this.addPeopleMainMenuItem,
this.toolStripMenuItem1,
this.copyMainMenuItem});
this.editMenuItem.Name = "editMenuItem";
this.editMenuItem.Size = new System.Drawing.Size(39, 20);
this.editMenuItem.Text = "&Edit";
this.editMenuItem.DropDownOpened += new System.EventHandler(this.EditToolStripMenuItem_DropDownOpened);
//
// favoriteMainMenuItem
//
this.favoriteMainMenuItem.Image = global::MediaLibrary.Properties.Resources.love_it;
this.favoriteMainMenuItem.Name = "favoriteMainMenuItem";
this.favoriteMainMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F)));
this.favoriteMainMenuItem.Size = new System.Drawing.Size(185, 22);
this.favoriteMainMenuItem.Text = "&Favorite";
this.favoriteMainMenuItem.Click += new System.EventHandler(this.FavoriteToolStripMenuItem_Click);
//
// editTagsMainMenuItem
//
this.editTagsMainMenuItem.Image = global::MediaLibrary.Properties.Resources.tags_edit;
this.editTagsMainMenuItem.Name = "editTagsMainMenuItem";
this.editTagsMainMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.T)));
this.editTagsMainMenuItem.Size = new System.Drawing.Size(185, 22);
this.editTagsMainMenuItem.Text = "Edit &Tags...";
this.editTagsMainMenuItem.Click += new System.EventHandler(this.AddTagsToolStripMenuItem_Click);
//
// addPeopleMainMenuItem
//
this.addPeopleMainMenuItem.Image = global::MediaLibrary.Properties.Resources.single_neutral;
this.addPeopleMainMenuItem.Name = "addPeopleMainMenuItem";
this.addPeopleMainMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.P)));
this.addPeopleMainMenuItem.Size = new System.Drawing.Size(185, 22);
this.addPeopleMainMenuItem.Text = "Add &People...";
this.addPeopleMainMenuItem.Click += new System.EventHandler(this.AddPeopleMenuItem_Click);
//
// toolStripMenuItem1
//
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
this.toolStripMenuItem1.Size = new System.Drawing.Size(182, 6);
//
// copyMainMenuItem
//
this.copyMainMenuItem.Image = global::MediaLibrary.Properties.Resources.common_file_double;
this.copyMainMenuItem.Name = "copyMainMenuItem";
this.copyMainMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C)));
this.copyMainMenuItem.Size = new System.Drawing.Size(185, 22);
this.copyMainMenuItem.Text = "&Copy";
this.copyMainMenuItem.Click += new System.EventHandler(this.CopyMenuItem_Click);
//
// statusStrip
//
this.statusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.mainProgressBar});
this.statusStrip.Location = new System.Drawing.Point(0, 428);
this.statusStrip.Name = "statusStrip";
this.statusStrip.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional;
this.statusStrip.ShowItemToolTips = true;
this.statusStrip.Size = new System.Drawing.Size(800, 22);
this.statusStrip.TabIndex = 1;
this.statusStrip.Text = "statusStrip";
//
// mainProgressBar
//
this.mainProgressBar.Maximum = 1000;
this.mainProgressBar.Name = "mainProgressBar";
this.mainProgressBar.Size = new System.Drawing.Size(100, 16);
//
// toolStrip
//
this.toolStrip.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
this.toolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.playButton,
this.playAllButton,
this.shuffleAllButton,
this.rateAllButton,
this.toolStripSeparator1,
this.homeButton,
this.toolStripSeparator2,
this.favoriteFilesDropDown,
this.starredDropDown,
this.audioDropDown,
this.imagesDropDown,
this.videoDropDown,
this.searchBox,
this.viewButton});
this.toolStrip.Location = new System.Drawing.Point(0, 24);
this.toolStrip.Name = "toolStrip";
this.toolStrip.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional;
this.toolStrip.Size = new System.Drawing.Size(800, 25);
this.toolStrip.TabIndex = 2;
this.toolStrip.Text = "toolStrip";
//
// playButton
//
this.playButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.playButton.Image = global::MediaLibrary.Properties.Resources.controls_play;
this.playButton.ImageTransparentColor = System.Drawing.Color.Magenta;
this.playButton.Name = "playButton";
this.playButton.Size = new System.Drawing.Size(23, 22);
this.playButton.Text = "Play";
this.playButton.Click += new System.EventHandler(this.PlayButton_Click);
//
// playAllButton
//
this.playAllButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.playAllButton.Image = global::MediaLibrary.Properties.Resources.controls_forward;
this.playAllButton.ImageTransparentColor = System.Drawing.Color.Magenta;
this.playAllButton.Name = "playAllButton";
this.playAllButton.Size = new System.Drawing.Size(23, 22);
this.playAllButton.Text = "Play all";
this.playAllButton.Click += new System.EventHandler(this.PlayAllButton_Click);
//
// shuffleAllButton
//
this.shuffleAllButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.shuffleAllButton.Image = global::MediaLibrary.Properties.Resources.button_shuffle;
this.shuffleAllButton.ImageTransparentColor = System.Drawing.Color.Magenta;
this.shuffleAllButton.Name = "shuffleAllButton";
this.shuffleAllButton.Size = new System.Drawing.Size(23, 22);
this.shuffleAllButton.Text = "Shuffle all";
this.shuffleAllButton.Click += new System.EventHandler(this.ShuffleAllButton_Click);
//
// rateAllButton
//
this.rateAllButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.rateAllButton.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.defaultRatingMenuItem,
this.toolStripSeparator10,
this.newCategoryMenuItem});
this.rateAllButton.Image = global::MediaLibrary.Properties.Resources.antique_swords;
this.rateAllButton.ImageTransparentColor = System.Drawing.Color.Magenta;
this.rateAllButton.Name = "rateAllButton";
this.rateAllButton.Size = new System.Drawing.Size(32, 22);
this.rateAllButton.Text = "Rate all";
this.rateAllButton.ButtonClick += new System.EventHandler(this.RatingCategoryMenuItem_Click);
//
// defaultRatingMenuItem
//
this.defaultRatingMenuItem.Image = global::MediaLibrary.Properties.Resources.antique_axe;
this.defaultRatingMenuItem.Name = "defaultRatingMenuItem";
this.defaultRatingMenuItem.Size = new System.Drawing.Size(112, 22);
this.defaultRatingMenuItem.Text = "Default";
this.defaultRatingMenuItem.Click += new System.EventHandler(this.RatingCategoryMenuItem_Click);
//
// toolStripSeparator10
//
this.toolStripSeparator10.Name = "toolStripSeparator10";
this.toolStripSeparator10.Size = new System.Drawing.Size(109, 6);
//
// newCategoryMenuItem
//
this.newCategoryMenuItem.Image = global::MediaLibrary.Properties.Resources.antique_axe;
this.newCategoryMenuItem.Name = "newCategoryMenuItem";
this.newCategoryMenuItem.Size = new System.Drawing.Size(112, 22);
this.newCategoryMenuItem.Text = "New...";
this.newCategoryMenuItem.Click += new System.EventHandler(this.NewCategoryMenuItem_Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);
//
// homeButton
//
this.homeButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.homeButton.Image = global::MediaLibrary.Properties.Resources.house_2;
this.homeButton.ImageTransparentColor = System.Drawing.Color.Magenta;
this.homeButton.Name = "homeButton";
this.homeButton.Size = new System.Drawing.Size(23, 22);
this.homeButton.Text = "Home";
this.homeButton.Click += new System.EventHandler(this.SearchBookmark_Click);
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(6, 25);
//
// favoriteFilesDropDown
//
this.favoriteFilesDropDown.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.favoriteFilesDropDown.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.favoriteFilesMenuItem,
this.toolStripSeparator4,
this.favoriteAudioMenuItem,
this.favoriteImagesMenuItem,
this.favoriteVideoMenuItem});
this.favoriteFilesDropDown.Image = global::MediaLibrary.Properties.Resources.love_it;
this.favoriteFilesDropDown.ImageTransparentColor = System.Drawing.Color.Magenta;
this.favoriteFilesDropDown.Name = "favoriteFilesDropDown";
this.favoriteFilesDropDown.Size = new System.Drawing.Size(32, 22);
this.favoriteFilesDropDown.Tag = "#favorite";
this.favoriteFilesDropDown.Text = "Favorites";
this.favoriteFilesDropDown.ButtonClick += new System.EventHandler(this.SearchBookmark_Click);
//
// favoriteFilesMenuItem
//
this.favoriteFilesMenuItem.Image = global::MediaLibrary.Properties.Resources.common_file_heart;
this.favoriteFilesMenuItem.Name = "favoriteFilesMenuItem";
this.favoriteFilesMenuItem.Size = new System.Drawing.Size(112, 22);
this.favoriteFilesMenuItem.Tag = "#favorite";
this.favoriteFilesMenuItem.Text = "Files";
this.favoriteFilesMenuItem.Click += new System.EventHandler(this.SearchBookmark_Click);
//
// toolStripSeparator4
//
this.toolStripSeparator4.Name = "toolStripSeparator4";
this.toolStripSeparator4.Size = new System.Drawing.Size(109, 6);
//
// favoriteAudioMenuItem
//
this.favoriteAudioMenuItem.Image = global::MediaLibrary.Properties.Resources.audio_file_heart;
this.favoriteAudioMenuItem.Name = "favoriteAudioMenuItem";
this.favoriteAudioMenuItem.Size = new System.Drawing.Size(112, 22);
this.favoriteAudioMenuItem.Tag = "#favorite type:audio";
this.favoriteAudioMenuItem.Text = "Audio";
this.favoriteAudioMenuItem.Click += new System.EventHandler(this.SearchBookmark_Click);
//
// favoriteImagesMenuItem
//
this.favoriteImagesMenuItem.Image = global::MediaLibrary.Properties.Resources.image_file_heart;
this.favoriteImagesMenuItem.Name = "favoriteImagesMenuItem";
this.favoriteImagesMenuItem.Size = new System.Drawing.Size(112, 22);
this.favoriteImagesMenuItem.Tag = "#favorite type:image";
this.favoriteImagesMenuItem.Text = "Images";
this.favoriteImagesMenuItem.Click += new System.EventHandler(this.SearchBookmark_Click);
//
// favoriteVideoMenuItem
//
this.favoriteVideoMenuItem.Image = global::MediaLibrary.Properties.Resources.video_file_heart;
this.favoriteVideoMenuItem.Name = "favoriteVideoMenuItem";
this.favoriteVideoMenuItem.Size = new System.Drawing.Size(112, 22);
this.favoriteVideoMenuItem.Tag = "#favorite type:video";
this.favoriteVideoMenuItem.Text = "Video";
this.favoriteVideoMenuItem.Click += new System.EventHandler(this.SearchBookmark_Click);
//
// starredDropDown
//
this.starredDropDown.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.starredDropDown.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.starredFilesMenuItem,
this.toolStripSeparator3,
this.starredAudioMenuItem,
this.starredImagesMenuItem,
this.starredVideoMenuItem});
this.starredDropDown.Image = global::MediaLibrary.Properties.Resources.rating_star;
this.starredDropDown.ImageTransparentColor = System.Drawing.Color.Magenta;
this.starredDropDown.Name = "starredDropDown";
this.starredDropDown.Size = new System.Drawing.Size(32, 22);
this.starredDropDown.Tag = "stars:>=3";
this.starredDropDown.Text = "Starred";
this.starredDropDown.Visible = false;
this.starredDropDown.ButtonClick += new System.EventHandler(this.SearchBookmark_Click);
//
// starredFilesMenuItem
//
this.starredFilesMenuItem.Image = global::MediaLibrary.Properties.Resources.common_file_star;
this.starredFilesMenuItem.Name = "starredFilesMenuItem";
this.starredFilesMenuItem.Size = new System.Drawing.Size(112, 22);
this.starredFilesMenuItem.Tag = "stars:>=3";
this.starredFilesMenuItem.Text = "Files";
this.starredFilesMenuItem.Click += new System.EventHandler(this.SearchBookmark_Click);
//
// toolStripSeparator3
//
this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(109, 6);
//
// starredAudioMenuItem
//
this.starredAudioMenuItem.Image = global::MediaLibrary.Properties.Resources.audio_file_star;
this.starredAudioMenuItem.Name = "starredAudioMenuItem";
this.starredAudioMenuItem.Size = new System.Drawing.Size(112, 22);
this.starredAudioMenuItem.Tag = "stars:>=3 type:audio";
this.starredAudioMenuItem.Text = "Audio";
this.starredAudioMenuItem.Click += new System.EventHandler(this.SearchBookmark_Click);
//
// starredImagesMenuItem
//
this.starredImagesMenuItem.Image = global::MediaLibrary.Properties.Resources.image_file_star;
this.starredImagesMenuItem.Name = "starredImagesMenuItem";
this.starredImagesMenuItem.Size = new System.Drawing.Size(112, 22);
this.starredImagesMenuItem.Tag = "stars:>=3 type:image";
this.starredImagesMenuItem.Text = "Images";
this.starredImagesMenuItem.Click += new System.EventHandler(this.SearchBookmark_Click);
//
// starredVideoMenuItem
//
this.starredVideoMenuItem.Image = global::MediaLibrary.Properties.Resources.video_file_star;
this.starredVideoMenuItem.Name = "starredVideoMenuItem";
this.starredVideoMenuItem.Size = new System.Drawing.Size(112, 22);
this.starredVideoMenuItem.Tag = "stars:>=3 type:video";
this.starredVideoMenuItem.Text = "Video";
this.starredVideoMenuItem.Click += new System.EventHandler(this.SearchBookmark_Click);
//
// audioDropDown
//
this.audioDropDown.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.audioDropDown.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.allAudioMenuItem,
this.toolStripSeparator5,
this.audioFavoritesMenuItem,
this.audioStarsMenuItem});
this.audioDropDown.Image = global::MediaLibrary.Properties.Resources.music_note_1;
this.audioDropDown.ImageTransparentColor = System.Drawing.Color.Magenta;
this.audioDropDown.Name = "audioDropDown";
this.audioDropDown.Size = new System.Drawing.Size(32, 22);
this.audioDropDown.Tag = "type:audio";
this.audioDropDown.Text = "Audio";
this.audioDropDown.ButtonClick += new System.EventHandler(this.SearchBookmark_Click);
//
// allAudioMenuItem
//
this.allAudioMenuItem.Image = global::MediaLibrary.Properties.Resources.audio_file_home;
this.allAudioMenuItem.Name = "allAudioMenuItem";
this.allAudioMenuItem.Size = new System.Drawing.Size(151, 22);
this.allAudioMenuItem.Tag = "type:audio";
this.allAudioMenuItem.Text = "All Audio";
this.allAudioMenuItem.Click += new System.EventHandler(this.SearchBookmark_Click);
//
// toolStripSeparator5
//
this.toolStripSeparator5.Name = "toolStripSeparator5";
this.toolStripSeparator5.Size = new System.Drawing.Size(148, 6);
//
// audioFavoritesMenuItem
//
this.audioFavoritesMenuItem.Image = global::MediaLibrary.Properties.Resources.audio_file_heart;
this.audioFavoritesMenuItem.Name = "audioFavoritesMenuItem";
this.audioFavoritesMenuItem.Size = new System.Drawing.Size(151, 22);
this.audioFavoritesMenuItem.Tag = "type:audio #favorite";
this.audioFavoritesMenuItem.Text = "Favorite Audio";
this.audioFavoritesMenuItem.Click += new System.EventHandler(this.SearchBookmark_Click);
//
// audioStarsMenuItem
//
this.audioStarsMenuItem.Image = global::MediaLibrary.Properties.Resources.audio_file_star;
this.audioStarsMenuItem.Name = "audioStarsMenuItem";
this.audioStarsMenuItem.Size = new System.Drawing.Size(151, 22);
this.audioStarsMenuItem.Tag = "type:audio stars:>=3";
this.audioStarsMenuItem.Text = "Starred Audio";
this.audioStarsMenuItem.Click += new System.EventHandler(this.SearchBookmark_Click);
//
// imagesDropDown
//
this.imagesDropDown.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.imagesDropDown.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.allImagesMenuItem,
this.toolStripSeparator6,
this.imageFavoritesMenuItem,
this.imageStarsMenuItem});
this.imagesDropDown.Image = global::MediaLibrary.Properties.Resources.picture_landscape;
this.imagesDropDown.ImageTransparentColor = System.Drawing.Color.Magenta;
this.imagesDropDown.Name = "imagesDropDown";
this.imagesDropDown.Size = new System.Drawing.Size(32, 22);
this.imagesDropDown.Tag = "type:image";
this.imagesDropDown.Text = "Images";
this.imagesDropDown.ButtonClick += new System.EventHandler(this.SearchBookmark_Click);
//
// allImagesMenuItem
//
this.allImagesMenuItem.Image = global::MediaLibrary.Properties.Resources.image_file_home;
this.allImagesMenuItem.Name = "allImagesMenuItem";
this.allImagesMenuItem.Size = new System.Drawing.Size(157, 22);
this.allImagesMenuItem.Tag = "type:image";
this.allImagesMenuItem.Text = "All Images";
this.allImagesMenuItem.Click += new System.EventHandler(this.SearchBookmark_Click);
//
// toolStripSeparator6
//
this.toolStripSeparator6.Name = "toolStripSeparator6";
this.toolStripSeparator6.Size = new System.Drawing.Size(154, 6);
//
// imageFavoritesMenuItem
//
this.imageFavoritesMenuItem.Image = global::MediaLibrary.Properties.Resources.image_file_heart;
this.imageFavoritesMenuItem.Name = "imageFavoritesMenuItem";
this.imageFavoritesMenuItem.Size = new System.Drawing.Size(157, 22);
this.imageFavoritesMenuItem.Tag = "type:image #favorite";
this.imageFavoritesMenuItem.Text = "Favorite Images";
this.imageFavoritesMenuItem.Click += new System.EventHandler(this.SearchBookmark_Click);
//
// imageStarsMenuItem
//
this.imageStarsMenuItem.Image = global::MediaLibrary.Properties.Resources.image_file_star;
this.imageStarsMenuItem.Name = "imageStarsMenuItem";
this.imageStarsMenuItem.Size = new System.Drawing.Size(157, 22);
this.imageStarsMenuItem.Tag = "type:image stars:>=3";
this.imageStarsMenuItem.Text = "Starred Images";
this.imageStarsMenuItem.Click += new System.EventHandler(this.SearchBookmark_Click);
//
// videoDropDown
//
this.videoDropDown.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.videoDropDown.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.allVideoMenuItem,
this.toolStripSeparator7,
this.videoFavoritesMenuItem,
this.videoStarsMenuItem});
this.videoDropDown.Image = global::MediaLibrary.Properties.Resources.video_player_movie;
this.videoDropDown.ImageTransparentColor = System.Drawing.Color.Magenta;
this.videoDropDown.Name = "videoDropDown";
this.videoDropDown.Size = new System.Drawing.Size(32, 22);
this.videoDropDown.Tag = "type:video";
this.videoDropDown.Text = "Videos";
this.videoDropDown.ButtonClick += new System.EventHandler(this.SearchBookmark_Click);
//
// allVideoMenuItem
//
this.allVideoMenuItem.Image = global::MediaLibrary.Properties.Resources.video_file_home;
this.allVideoMenuItem.Name = "allVideoMenuItem";
this.allVideoMenuItem.Size = new System.Drawing.Size(149, 22);
this.allVideoMenuItem.Tag = "type:video";
this.allVideoMenuItem.Text = "All Video";
this.allVideoMenuItem.Click += new System.EventHandler(this.SearchBookmark_Click);
//
// toolStripSeparator7
//
this.toolStripSeparator7.Name = "toolStripSeparator7";
this.toolStripSeparator7.Size = new System.Drawing.Size(146, 6);
//
// videoFavoritesMenuItem
//
this.videoFavoritesMenuItem.Image = global::MediaLibrary.Properties.Resources.video_file_heart;
this.videoFavoritesMenuItem.Name = "videoFavoritesMenuItem";
this.videoFavoritesMenuItem.Size = new System.Drawing.Size(149, 22);
this.videoFavoritesMenuItem.Tag = "type:video #favorite";
this.videoFavoritesMenuItem.Text = "Favorite Video";
this.videoFavoritesMenuItem.Click += new System.EventHandler(this.SearchBookmark_Click);
//
// videoStarsMenuItem
//
this.videoStarsMenuItem.Image = global::MediaLibrary.Properties.Resources.video_file_star;
this.videoStarsMenuItem.Name = "videoStarsMenuItem";
this.videoStarsMenuItem.Size = new System.Drawing.Size(149, 22);
this.videoStarsMenuItem.Tag = "type:video stars:>=3";
this.videoStarsMenuItem.Text = "Starred Video";
this.videoStarsMenuItem.Click += new System.EventHandler(this.SearchBookmark_Click);
//
// searchBox
//
this.searchBox.Font = new System.Drawing.Font("Segoe UI", 9F);
this.searchBox.Name = "searchBox";
this.searchBox.Size = new System.Drawing.Size(200, 25);
this.searchBox.TextChanged += new System.EventHandler(this.SearchBox_TextChangedAsync);
//
// viewButton
//
this.viewButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.viewButton.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.refreshMenuItem,
this.toolStripSeparator11,
this.showPreviewMenuItem,
this.toolStripSeparator8,
this.detailsMenuItem,
this.thumbnailsMenuItem,
this.toolStripSeparator9,
this.savedSearchesMenuItem});
this.viewButton.Image = global::MediaLibrary.Properties.Resources.view_1;
this.viewButton.ImageTransparentColor = System.Drawing.Color.Magenta;
this.viewButton.Name = "viewButton";
this.viewButton.Size = new System.Drawing.Size(29, 22);
this.viewButton.Text = "toolStripDropDownButton1";
//
// refreshMenuItem
//
this.refreshMenuItem.Image = global::MediaLibrary.Properties.Resources.button_refresh_arrow;
this.refreshMenuItem.Name = "refreshMenuItem";
this.refreshMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F5;
this.refreshMenuItem.Size = new System.Drawing.Size(180, 22);
this.refreshMenuItem.Text = "&Refresh";
this.refreshMenuItem.Click += new System.EventHandler(this.RefreshMenuItem_Click);
//
// toolStripSeparator11
//
this.toolStripSeparator11.Name = "toolStripSeparator11";
this.toolStripSeparator11.Size = new System.Drawing.Size(177, 6);
//
// showPreviewMenuItem
//
this.showPreviewMenuItem.Checked = true;
this.showPreviewMenuItem.CheckOnClick = true;
this.showPreviewMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
this.showPreviewMenuItem.Image = global::MediaLibrary.Properties.Resources.view_square;
this.showPreviewMenuItem.Name = "showPreviewMenuItem";
this.showPreviewMenuItem.Size = new System.Drawing.Size(180, 22);
this.showPreviewMenuItem.Text = "Show Preview";
this.showPreviewMenuItem.CheckedChanged += new System.EventHandler(this.ShowPreviewMenuItem_CheckedChanged);
//
// toolStripSeparator8
//
this.toolStripSeparator8.Name = "toolStripSeparator8";
this.toolStripSeparator8.Size = new System.Drawing.Size(177, 6);
//
// detailsMenuItem
//
this.detailsMenuItem.Checked = true;
this.detailsMenuItem.CheckOnClick = true;
this.detailsMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
this.detailsMenuItem.Image = global::MediaLibrary.Properties.Resources.list_bullets_1;
this.detailsMenuItem.Name = "detailsMenuItem";
this.detailsMenuItem.Size = new System.Drawing.Size(180, 22);
this.detailsMenuItem.Text = "Details";
this.detailsMenuItem.Click += new System.EventHandler(this.DetailsMenuItem_Click);
//
// thumbnailsMenuItem
//
this.thumbnailsMenuItem.CheckOnClick = true;
this.thumbnailsMenuItem.Image = global::MediaLibrary.Properties.Resources.picture_landscape;
this.thumbnailsMenuItem.Name = "thumbnailsMenuItem";
this.thumbnailsMenuItem.Size = new System.Drawing.Size(180, 22);
this.thumbnailsMenuItem.Text = "Thumbnails";
this.thumbnailsMenuItem.Click += new System.EventHandler(this.ThumbnailsMenuItem_Click);
//
// toolStripSeparator9
//
this.toolStripSeparator9.Name = "toolStripSeparator9";
this.toolStripSeparator9.Size = new System.Drawing.Size(177, 6);
//
// savedSearchesMenuItem
//
this.savedSearchesMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.saveThisSearchMenuItem,
this.savedSearchesSeparator});
this.savedSearchesMenuItem.Name = "savedSearchesMenuItem";
this.savedSearchesMenuItem.Size = new System.Drawing.Size(180, 22);
this.savedSearchesMenuItem.Text = "&Saved Searches";
//
// saveThisSearchMenuItem
//
this.saveThisSearchMenuItem.Name = "saveThisSearchMenuItem";
this.saveThisSearchMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S)));
this.saveThisSearchMenuItem.Size = new System.Drawing.Size(206, 22);
this.saveThisSearchMenuItem.Text = "Save this search...";
this.saveThisSearchMenuItem.Click += new System.EventHandler(this.SaveThisSearchMenuItem_Click);
//
// savedSearchesSeparator
//
this.savedSearchesSeparator.Name = "savedSearchesSeparator";
this.savedSearchesSeparator.Size = new System.Drawing.Size(203, 6);
this.savedSearchesSeparator.Visible = false;
//
// fileTypeImages
//
this.fileTypeImages.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("fileTypeImages.ImageStream")));
this.fileTypeImages.TransparentColor = System.Drawing.Color.Transparent;
this.fileTypeImages.Images.SetKeyName(0, "common-file");
this.fileTypeImages.Images.SetKeyName(1, "audio-file");
this.fileTypeImages.Images.SetKeyName(2, "image-file");
this.fileTypeImages.Images.SetKeyName(3, "video-file");
this.fileTypeImages.Images.SetKeyName(4, "audio-file-aac");
this.fileTypeImages.Images.SetKeyName(5, "audio-file-aif");
this.fileTypeImages.Images.SetKeyName(6, "audio-file-mid");
this.fileTypeImages.Images.SetKeyName(7, "audio-file-mp3");
this.fileTypeImages.Images.SetKeyName(8, "audio-file-wav");
this.fileTypeImages.Images.SetKeyName(9, "image-file-bmp");
this.fileTypeImages.Images.SetKeyName(10, "image-file-eps");
this.fileTypeImages.Images.SetKeyName(11, "image-file-gif");
this.fileTypeImages.Images.SetKeyName(12, "image-file-jpg");
this.fileTypeImages.Images.SetKeyName(13, "image-file-png");
this.fileTypeImages.Images.SetKeyName(14, "image-file-svg");
this.fileTypeImages.Images.SetKeyName(15, "image-file-tiff");
this.fileTypeImages.Images.SetKeyName(16, "video-file-avi");
this.fileTypeImages.Images.SetKeyName(17, "video-file-flv");
this.fileTypeImages.Images.SetKeyName(18, "video-file-m4v");
this.fileTypeImages.Images.SetKeyName(19, "video-file-mov");
this.fileTypeImages.Images.SetKeyName(20, "video-file-mp4");
this.fileTypeImages.Images.SetKeyName(21, "video-file-mpg");
this.fileTypeImages.Images.SetKeyName(22, "video-file-qt");
this.fileTypeImages.Images.SetKeyName(23, "modern-tv-3d-glasses");
this.fileTypeImages.Images.SetKeyName(24, "modern-tv-4k");
this.fileTypeImages.Images.SetKeyName(25, "modern-tv-8k");
this.fileTypeImages.Images.SetKeyName(26, "modern-tv-flat");
this.fileTypeImages.Images.SetKeyName(27, "modern-tv-hd");
this.fileTypeImages.Images.SetKeyName(28, "modern-tv-uhd");
//
// itemContextMenu
//
this.itemContextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.favoriteContextMenuItem,
this.editTagsContextMenuItem,
this.addPeopleContextMenuItem,
this.toolStripActionSeparator,
this.openContextMenuItem,
this.copyContextMenuItem});
this.itemContextMenu.Name = "itemContextMenu";
this.itemContextMenu.Size = new System.Drawing.Size(145, 120);
//
// favoriteContextMenuItem
//
this.favoriteContextMenuItem.Image = global::MediaLibrary.Properties.Resources.love_it;
this.favoriteContextMenuItem.Name = "favoriteContextMenuItem";
this.favoriteContextMenuItem.Size = new System.Drawing.Size(144, 22);
this.favoriteContextMenuItem.Text = "&Favorite";
this.favoriteContextMenuItem.Click += new System.EventHandler(this.FavoriteToolStripMenuItem_Click);
//
// editTagsContextMenuItem
//
this.editTagsContextMenuItem.Image = global::MediaLibrary.Properties.Resources.tags_edit;
this.editTagsContextMenuItem.Name = "editTagsContextMenuItem";
this.editTagsContextMenuItem.Size = new System.Drawing.Size(144, 22);
this.editTagsContextMenuItem.Text = "Edit &Tags...";
this.editTagsContextMenuItem.Click += new System.EventHandler(this.AddTagsToolStripMenuItem_Click);
//
// addPeopleContextMenuItem
//
this.addPeopleContextMenuItem.Image = global::MediaLibrary.Properties.Resources.single_neutral;
this.addPeopleContextMenuItem.Name = "addPeopleContextMenuItem";
this.addPeopleContextMenuItem.Size = new System.Drawing.Size(144, 22);
this.addPeopleContextMenuItem.Text = "Add &People...";
this.addPeopleContextMenuItem.Click += new System.EventHandler(this.AddPeopleMenuItem_Click);
//
// toolStripActionSeparator
//
this.toolStripActionSeparator.Name = "toolStripActionSeparator";
this.toolStripActionSeparator.Size = new System.Drawing.Size(141, 6);
//
// openContextMenuItem
//
this.openContextMenuItem.Name = "openContextMenuItem";
this.openContextMenuItem.Size = new System.Drawing.Size(144, 22);
this.openContextMenuItem.Text = "&Open...";
this.openContextMenuItem.Click += new System.EventHandler(this.OpenMenuItem_Click);
//
// copyContextMenuItem
//
this.copyContextMenuItem.Image = global::MediaLibrary.Properties.Resources.common_file_double;
this.copyContextMenuItem.Name = "copyContextMenuItem";
this.copyContextMenuItem.Size = new System.Drawing.Size(144, 22);
this.copyContextMenuItem.Text = "&Copy";
this.copyContextMenuItem.Click += new System.EventHandler(this.CopyMenuItem_Click);
//
// splitContainer
//
this.splitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer.Location = new System.Drawing.Point(0, 49);
this.splitContainer.Name = "splitContainer";
this.splitContainer.Size = new System.Drawing.Size(800, 379);
this.splitContainer.SplitterDistance = 462;
this.splitContainer.TabIndex = 6;
//
// MainForm
//
this.AllowDrop = true;
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.splitContainer);
this.Controls.Add(this.toolStrip);
this.Controls.Add(this.statusStrip);
this.Controls.Add(this.mainMenu);
this.MainMenuStrip = this.mainMenu;
this.Name = "MainForm";
this.Text = "MainForm";
this.Load += new System.EventHandler(this.MainForm_Load);
this.DragDrop += new System.Windows.Forms.DragEventHandler(this.MainForm_DragDrop);
this.DragEnter += new System.Windows.Forms.DragEventHandler(this.MainForm_DragEnter);
this.mainMenu.ResumeLayout(false);
this.mainMenu.PerformLayout();
this.statusStrip.ResumeLayout(false);
this.statusStrip.PerformLayout();
this.toolStrip.ResumeLayout(false);
this.toolStrip.PerformLayout();
this.itemContextMenu.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit();
this.splitContainer.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.MenuStrip mainMenu;
private System.Windows.Forms.ToolStripMenuItem optionsMenuItem;
private System.Windows.Forms.ToolStripMenuItem addIndexedFolderMainMenuItem;
private System.Windows.Forms.StatusStrip statusStrip;
private System.Windows.Forms.ToolStripProgressBar mainProgressBar;
private System.Windows.Forms.ToolStrip toolStrip;
private System.Windows.Forms.ToolStripButton playButton;
private System.Windows.Forms.ToolStripButton playAllButton;
private System.Windows.Forms.ToolStripButton shuffleAllButton;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripButton homeButton;
private System.Windows.Forms.ToolStripMenuItem aboutMainMenuItem;
private System.Windows.Forms.ImageList fileTypeImages;
private System.Windows.Forms.ToolStripSplitButton favoriteFilesDropDown;
private System.Windows.Forms.ToolStripMenuItem favoriteFilesMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
private System.Windows.Forms.ToolStripMenuItem favoriteAudioMenuItem;
private System.Windows.Forms.ToolStripMenuItem favoriteImagesMenuItem;
private System.Windows.Forms.ToolStripMenuItem favoriteVideoMenuItem;
private System.Windows.Forms.ToolStripSplitButton starredDropDown;
private System.Windows.Forms.ToolStripMenuItem starredFilesMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
private System.Windows.Forms.ToolStripMenuItem starredAudioMenuItem;
private System.Windows.Forms.ToolStripMenuItem starredImagesMenuItem;
private System.Windows.Forms.ToolStripMenuItem starredVideoMenuItem;
private System.Windows.Forms.ToolStripSplitButton audioDropDown;
private System.Windows.Forms.ToolStripMenuItem allAudioMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator5;
private System.Windows.Forms.ToolStripMenuItem audioFavoritesMenuItem;
private System.Windows.Forms.ToolStripMenuItem audioStarsMenuItem;
private System.Windows.Forms.ToolStripSplitButton imagesDropDown;
private System.Windows.Forms.ToolStripMenuItem allImagesMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator6;
private System.Windows.Forms.ToolStripMenuItem imageFavoritesMenuItem;
private System.Windows.Forms.ToolStripMenuItem imageStarsMenuItem;
private System.Windows.Forms.ToolStripSplitButton videoDropDown;
private System.Windows.Forms.ToolStripMenuItem allVideoMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator7;
private System.Windows.Forms.ToolStripMenuItem videoFavoritesMenuItem;
private System.Windows.Forms.ToolStripMenuItem videoStarsMenuItem;
private System.Windows.Forms.ToolStripDropDownButton viewButton;
private System.Windows.Forms.ToolStripMenuItem detailsMenuItem;
private System.Windows.Forms.ToolStripMenuItem thumbnailsMenuItem;
private System.Windows.Forms.ContextMenuStrip itemContextMenu;
private System.Windows.Forms.ToolStripMenuItem favoriteContextMenuItem;
private System.Windows.Forms.ToolStripMenuItem editTagsContextMenuItem;
private System.Windows.Forms.ToolStripMenuItem toolsMenuItem;
private System.Windows.Forms.ToolStripMenuItem findDuplicatesMainMenuItem;
private System.Windows.Forms.ToolStripMenuItem addPeopleContextMenuItem;
private System.Windows.Forms.ToolStripMenuItem showPreviewMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator8;
private System.Windows.Forms.ToolStripMenuItem editMenuItem;
private System.Windows.Forms.ToolStripMenuItem favoriteMainMenuItem;
private System.Windows.Forms.ToolStripMenuItem editTagsMainMenuItem;
private System.Windows.Forms.ToolStripMenuItem addPeopleMainMenuItem;
private System.Windows.Forms.SplitContainer splitContainer;
private System.Windows.Forms.ToolStripMenuItem editPeopleMainMenuItem;
private System.Windows.Forms.ToolStripMenuItem editTagRulesMainMenuItem;
private System.Windows.Forms.ToolStripTextBox searchBox;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator9;
private System.Windows.Forms.ToolStripMenuItem savedSearchesMenuItem;
private System.Windows.Forms.ToolStripMenuItem saveThisSearchMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
private System.Windows.Forms.ToolStripSeparator savedSearchesSeparator;
private System.Windows.Forms.ToolStripMenuItem copyContextMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripActionSeparator;
private System.Windows.Forms.ToolStripMenuItem openContextMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem copyMainMenuItem;
private System.Windows.Forms.ToolStripMenuItem mergePeopleToolStripMenuItem;
private System.Windows.Forms.ToolStripSplitButton rateAllButton;
private System.Windows.Forms.ToolStripMenuItem defaultRatingMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator10;
private System.Windows.Forms.ToolStripMenuItem newCategoryMenuItem;
private System.Windows.Forms.ToolStripMenuItem refreshMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator11;
}
}
| 59.295908 | 152 | 0.662514 | [
"MIT"
] | GoddessArtemis/MediaLibrary | MediaLibrary/MainForm.Designer.cs | 56,509 | C# |
using System.IO;
using System.Runtime.Serialization;
using GameEstate.Red.Formats.Red.CR2W.Reflection;
using FastMember;
using static GameEstate.Red.Formats.Red.Records.Enums;
namespace GameEstate.Red.Formats.Red.Types
{
[DataContract(Namespace = "")]
[REDMeta]
public class CAIHarpyDefaults : CAIFlyingMonsterDefaults
{
public CAIHarpyDefaults(CR2WFile cr2w, CVariable parent, string name) : base(cr2w, parent, name){ }
public static new CVariable Create(CR2WFile cr2w, CVariable parent, string name) => new CAIHarpyDefaults(cr2w, parent, name);
public override void Read(BinaryReader file, uint size) => base.Read(file, size);
public override void Write(BinaryWriter file) => base.Write(file);
}
} | 32.173913 | 128 | 0.748649 | [
"MIT"
] | bclnet/GameEstate | src/Estates/Red/GameEstate.Red.Format/Red/W3/RTTIConvert/CAIHarpyDefaults.cs | 740 | C# |
//////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2019, National Instruments Corp.
// 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.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using NationalInstruments.Vision.WindowsForms;
namespace NationalInstruments.Vision.WindowsForms.Internal
{
internal partial class PictureBoxChildWindow : System.Windows.Forms.PictureBox
{
FakeNativeWindow _nativeWindow = null;
public PictureBoxChildWindow()
{
InitializeComponent();
}
internal void SetOwningViewer(ImageViewer viewer)
{
_nativeWindow = new FakeNativeWindow(viewer);
}
internal void AssignHandle(IntPtr handle)
{
_nativeWindow.AssignHandle(handle);
}
}
internal class FakeNativeWindow : NativeWindow
{
ImageViewer _viewer = null;
// These are the minimum and maximum message numbers we're interested in
Int32 _minMessage, _maxMessage;
internal FakeNativeWindow(ImageViewer viewer)
{
_viewer = viewer;
int[] values = (int[]) Enum.GetValues(typeof(ViewerMessage));
// Enum.GetValues() returns the values in order.
_minMessage = values[0];
_maxMessage = values[values.Length - 1];
}
protected override void WndProc(ref Message m)
{
if (m.Msg >= _minMessage && m.Msg <= _maxMessage)
{
_viewer.OnViewerMessage(m);
}
base.WndProc(ref m);
}
}
}
| 36.037975 | 82 | 0.643133 | [
"MIT"
] | ni/vdm-dotnet | src/dotNet/Viewer/PictureBoxChildWindow.cs | 2,847 | C# |
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using System.Runtime.Serialization.Formatters.Binary;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace Plotly.Models.Traces.Scatters
{
/// <summary>
/// The TextFont class.
/// </summary>
[JsonConverter(typeof(PlotlyConverter))]
[Serializable]
public class TextFont : IEquatable<TextFont>
{
/// <summary>
/// HTML font family - the typeface that will be applied by the web browser.
/// The web browser will only be able to apply a font if it is available on
/// the system which it operates. Provide multiple font families, separated
/// by commas, to indicate the preference in which to apply fonts if they aren't
/// available on the system. The Chart Studio Cloud (at https://chart-studio.plotly.com
/// or on-premise) generates images on a server, where only a select number
/// of fonts are installed and supported. These include <c>Arial</c>, <c>Balto</c>,
/// 'Courier New', 'Droid Sans',, 'Droid Serif', 'Droid
/// Sans Mono', 'Gravitas One', 'Old Standard TT', 'Open
/// Sans', <c>Overpass</c>, 'PT Sans Narrow', <c>Raleway</c>, 'Times
/// New Roman'.
/// </summary>
[JsonPropertyName(@"family")]
public string Family { get; set; }
/// <summary>
/// HTML font family - the typeface that will be applied by the web browser.
/// The web browser will only be able to apply a font if it is available on
/// the system which it operates. Provide multiple font families, separated
/// by commas, to indicate the preference in which to apply fonts if they aren't
/// available on the system. The Chart Studio Cloud (at https://chart-studio.plotly.com
/// or on-premise) generates images on a server, where only a select number
/// of fonts are installed and supported. These include <c>Arial</c>, <c>Balto</c>,
/// 'Courier New', 'Droid Sans',, 'Droid Serif', 'Droid
/// Sans Mono', 'Gravitas One', 'Old Standard TT', 'Open
/// Sans', <c>Overpass</c>, 'PT Sans Narrow', <c>Raleway</c>, 'Times
/// New Roman'.
/// </summary>
[JsonPropertyName(@"family")]
[Array]
public List<string> FamilyArray { get; set; }
/// <summary>
/// Gets or sets the Size.
/// </summary>
[JsonPropertyName(@"size")]
public JsNumber? Size { get; set; }
/// <summary>
/// Gets or sets the Size.
/// </summary>
[JsonPropertyName(@"size")]
[Array]
public List<JsNumber?> SizeArray { get; set; }
/// <summary>
/// Gets or sets the Color.
/// </summary>
[JsonPropertyName(@"color")]
public object Color { get; set; }
/// <summary>
/// Gets or sets the Color.
/// </summary>
[JsonPropertyName(@"color")]
[Array]
public List<object> ColorArray { get; set; }
/// <summary>
/// Sets the source reference on Chart Studio Cloud for family .
/// </summary>
[JsonPropertyName(@"familysrc")]
public string FamilySrc { get; set; }
/// <summary>
/// Sets the source reference on Chart Studio Cloud for size .
/// </summary>
[JsonPropertyName(@"sizesrc")]
public string SizeSrc { get; set; }
/// <summary>
/// Sets the source reference on Chart Studio Cloud for color .
/// </summary>
[JsonPropertyName(@"colorsrc")]
public string ColorSrc { get; set; }
public override bool Equals(object obj)
{
if(!(obj is TextFont other))
return false;
return ReferenceEquals(this, obj) || Equals(other);
}
public bool Equals([AllowNull] TextFont other)
{
if(other == null)
return false;
if(ReferenceEquals(this, other))
return true;
return (Family == other.Family && Family != null && other.Family != null && Family.Equals(other.Family)) &&
(Equals(FamilyArray, other.FamilyArray) || FamilyArray != null && other.FamilyArray != null && FamilyArray.SequenceEqual(other.FamilyArray)) &&
(Size == other.Size && Size != null && other.Size != null && Size.Equals(other.Size)) &&
(Equals(SizeArray, other.SizeArray) || SizeArray != null && other.SizeArray != null && SizeArray.SequenceEqual(other.SizeArray)) &&
(Color == other.Color && Color != null && other.Color != null && Color.Equals(other.Color)) &&
(Equals(ColorArray, other.ColorArray) || ColorArray != null && other.ColorArray != null && ColorArray.SequenceEqual(other.ColorArray)) &&
(FamilySrc == other.FamilySrc && FamilySrc != null && other.FamilySrc != null && FamilySrc.Equals(other.FamilySrc)) &&
(SizeSrc == other.SizeSrc && SizeSrc != null && other.SizeSrc != null && SizeSrc.Equals(other.SizeSrc)) &&
(ColorSrc == other.ColorSrc && ColorSrc != null && other.ColorSrc != null && ColorSrc.Equals(other.ColorSrc));
}
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if(Family != null)
hashCode = hashCode * 59 + Family.GetHashCode();
if(FamilyArray != null)
hashCode = hashCode * 59 + FamilyArray.GetHashCode();
if(Size != null)
hashCode = hashCode * 59 + Size.GetHashCode();
if(SizeArray != null)
hashCode = hashCode * 59 + SizeArray.GetHashCode();
if(Color != null)
hashCode = hashCode * 59 + Color.GetHashCode();
if(ColorArray != null)
hashCode = hashCode * 59 + ColorArray.GetHashCode();
if(FamilySrc != null)
hashCode = hashCode * 59 + FamilySrc.GetHashCode();
if(SizeSrc != null)
hashCode = hashCode * 59 + SizeSrc.GetHashCode();
if(ColorSrc != null)
hashCode = hashCode * 59 + ColorSrc.GetHashCode();
return hashCode;
}
}
/// <summary>
/// Checks for equality of the left TextFont and the right TextFont.
/// </summary>
/// <param name="left">Left TextFont.</param>
/// <param name="right">Right TextFont.</param>
/// <returns>Boolean</returns>
public static bool operator ==(TextFont left,
TextFont right)
{
return Equals(left, right);
}
/// <summary>
/// Checks for inequality of the left TextFont and the right TextFont.
/// </summary>
/// <param name="left">Left TextFont.</param>
/// <param name="right">Right TextFont.</param>
/// <returns>Boolean</returns>
public static bool operator !=(TextFont left,
TextFont right)
{
return !Equals(left, right);
}
/// <summary>
/// Gets a deep copy of this instance.
/// </summary>
/// <returns>TextFont</returns>
public TextFont DeepClone()
{
using MemoryStream ms = new();
JsonSerializer.SerializeAsync(ms, this);
ms.Position = 0;
return JsonSerializer.DeserializeAsync<TextFont>(ms).Result;
}
}
}
| 41.974874 | 162 | 0.525919 | [
"MIT"
] | trmcnealy/Plotly.WPF | Plotly/Models/Traces/Scatters/TextFont.cs | 8,353 | 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.ServiceModel.Diagnostics;
using System.Xml;
namespace System.ServiceModel.Channels
{
/// <summary>
/// Base class for non-SOAP messages
/// </summary>
internal abstract class ContentOnlyMessage : Message
{
private MessageHeaders _headers;
private MessageProperties _properties;
protected ContentOnlyMessage()
{
_headers = new MessageHeaders(MessageVersion.None);
}
public override MessageHeaders Headers
{
get
{
if (IsDisposed)
{
throw TraceUtility.ThrowHelperError(CreateMessageDisposedException(), this);
}
return _headers;
}
}
public override MessageProperties Properties
{
get
{
if (IsDisposed)
{
throw TraceUtility.ThrowHelperError(CreateMessageDisposedException(), this);
}
if (_properties == null)
{
_properties = new MessageProperties();
}
return _properties;
}
}
public override MessageVersion Version
{
get
{
return _headers.MessageVersion;
}
}
protected override void OnBodyToString(XmlDictionaryWriter writer)
{
OnWriteBodyContents(writer);
}
}
internal class StringMessage : ContentOnlyMessage
{
private string _data;
public StringMessage(string data)
: base()
{
_data = data;
}
public override bool IsEmpty
{
get
{
return String.IsNullOrEmpty(_data);
}
}
protected override void OnWriteBodyContents(XmlDictionaryWriter writer)
{
if (_data != null && _data.Length > 0)
{
writer.WriteElementString("BODY", _data);
}
}
}
internal class NullMessage : StringMessage
{
public NullMessage()
: base(string.Empty)
{
}
}
}
| 23.705882 | 101 | 0.514061 | [
"MIT"
] | 777Eternal777/wcf | src/System.Private.ServiceModel/src/System/ServiceModel/Channels/ContentOnlyMessage.cs | 2,418 | C# |
using SIS.HTTP.Session.Contracts;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Text;
namespace SIS.HTTP.Session
{
public class HttpSessionStorage
{
public const string SessionKey = "SIS_ID";
private static readonly ConcurrentDictionary<string, HttpSession> sessions = new ConcurrentDictionary<string, HttpSession>();
public static IHttpSession GetSession(string id)
{
return sessions.GetOrAdd(id, _ => new HttpSession(id));
}
}
}
| 26.238095 | 133 | 0.705989 | [
"MIT"
] | RosenBobchev/CSharp-Web | Web-Basic/IRunesWebApp/SIS.HTTP/Session/HttpSessionStorage.cs | 553 | C# |
//===================================================================================
// Microsoft patterns & practices
// Composite Application Guidance for Windows Presentation Foundation and Silverlight
//===================================================================================
// Copyright (c) Microsoft Corporation. All rights reserved.
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS FOR A PARTICULAR PURPOSE.
//===================================================================================
// The example companies, organizations, products, domain names,
// e-mail addresses, logos, people, places, and events depicted
// herein are fictitious. No association with any real company,
// organization, product, domain name, email address, logo, person,
// places, or events is intended or should be inferred.
//===================================================================================
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Security.Policy;
using Microsoft.Practices.Prism.Properties;
namespace Microsoft.Practices.Prism.Modularity
{
/// <summary>
/// Represets a catalog created from a directory on disk.
/// </summary>
/// <remarks>
/// The directory catalog will scan the contents of a directory, locating classes that implement
/// <see cref="IModule"/> and add them to the catalog based on contents in their associated <see cref="ModuleAttribute"/>.
/// Assemblies are loaded into a new application domain with ReflectionOnlyLoad. The application domain is destroyed
/// once the assemblies have been discovered.
///
/// The diretory catalog does not continue to monitor the directory after it has created the initialze catalog.
/// </remarks>
public class DirectoryModuleCatalog : ModuleCatalog
{
/// <summary>
/// Directory containing modules to search for.
/// </summary>
public string ModulePath { get; set; }
/// <summary>
/// Drives the main logic of building the child domain and searching for the assemblies.
/// </summary>
protected override void InnerLoad()
{
if (string.IsNullOrEmpty(this.ModulePath))
throw new InvalidOperationException(Resources.ModulePathCannotBeNullOrEmpty);
if (!Directory.Exists(this.ModulePath))
throw new InvalidOperationException(
string.Format(CultureInfo.CurrentCulture, Resources.DirectoryNotFound, this.ModulePath));
AppDomain childDomain = this.BuildChildDomain(AppDomain.CurrentDomain);
try
{
List<string> loadedAssemblies = new List<string>();
var assemblies = (
from Assembly assembly in AppDomain.CurrentDomain.GetAssemblies()
where !(assembly is System.Reflection.Emit.AssemblyBuilder)
&& assembly.GetType().FullName != "System.Reflection.Emit.InternalAssemblyBuilder"
&& !String.IsNullOrEmpty(assembly.Location)
select assembly.Location
);
loadedAssemblies.AddRange(assemblies);
Type loaderType = typeof(InnerModuleInfoLoader);
if (loaderType.Assembly != null)
{
var loader =
(InnerModuleInfoLoader)
childDomain.CreateInstanceFrom(loaderType.Assembly.Location, loaderType.FullName).Unwrap();
loader.LoadAssemblies(loadedAssemblies);
this.Items.AddRange(loader.GetModuleInfos(this.ModulePath));
}
}
finally
{
AppDomain.Unload(childDomain);
}
}
/// <summary>
/// Creates a new child domain and copies the evidence from a parent domain.
/// </summary>
/// <param name="parentDomain">The parent domain.</param>
/// <returns>The new child domain.</returns>
/// <remarks>
/// Grabs the <paramref name="parentDomain"/> evidence and uses it to construct the new
/// <see cref="AppDomain"/> because in a ClickOnce execution environment, creating an
/// <see cref="AppDomain"/> will by default pick up the partial trust environment of
/// the AppLaunch.exe, which was the root executable. The AppLaunch.exe does a
/// create domain and applies the evidence from the ClickOnce manifests to
/// create the domain that the application is actually executing in. This will
/// need to be Full Trust for Composite Application Library applications.
/// </remarks>
/// <exception cref="ArgumentNullException">An <see cref="ArgumentNullException"/> is thrown if <paramref name="parentDomain"/> is null.</exception>
protected virtual AppDomain BuildChildDomain(AppDomain parentDomain)
{
if (parentDomain == null) throw new System.ArgumentNullException("parentDomain");
Evidence evidence = new Evidence(parentDomain.Evidence);
AppDomainSetup setup = parentDomain.SetupInformation;
return AppDomain.CreateDomain("DiscoveryRegion", evidence, setup);
}
private class InnerModuleInfoLoader : MarshalByRefObject
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")]
internal ModuleInfo[] GetModuleInfos(string path)
{
DirectoryInfo directory = new DirectoryInfo(path);
ResolveEventHandler resolveEventHandler =
delegate(object sender, ResolveEventArgs args) { return OnReflectionOnlyResolve(args, directory); };
AppDomain.CurrentDomain.ReflectionOnlyAssemblyResolve += resolveEventHandler;
Assembly moduleReflectionOnlyAssembly =
AppDomain.CurrentDomain.ReflectionOnlyGetAssemblies().First(
asm => asm.FullName == typeof(IModule).Assembly.FullName);
Type IModuleType = moduleReflectionOnlyAssembly.GetType(typeof(IModule).FullName);
IEnumerable<ModuleInfo> modules = GetNotAllreadyLoadedModuleInfos(directory, IModuleType);
var array = modules.ToArray();
AppDomain.CurrentDomain.ReflectionOnlyAssemblyResolve -= resolveEventHandler;
return array;
}
private static IEnumerable<ModuleInfo> GetNotAllreadyLoadedModuleInfos(DirectoryInfo directory, Type IModuleType)
{
List<FileInfo> validAssemblies = new List<FileInfo>();
Assembly[] alreadyLoadedAssemblies = AppDomain.CurrentDomain.ReflectionOnlyGetAssemblies();
var fileInfos = directory.GetFiles("*.dll")
.Where(file => alreadyLoadedAssemblies
.FirstOrDefault(
assembly =>
String.Compare(Path.GetFileName(assembly.Location), file.Name,
StringComparison.OrdinalIgnoreCase) == 0) == null);
foreach (FileInfo fileInfo in fileInfos)
{
try
{
Assembly.ReflectionOnlyLoadFrom(fileInfo.FullName);
validAssemblies.Add(fileInfo);
}
catch (BadImageFormatException)
{
// skip non-.NET Dlls
}
}
return validAssemblies.SelectMany(file => Assembly.ReflectionOnlyLoadFrom(file.FullName)
.GetExportedTypes()
.Where(IModuleType.IsAssignableFrom)
.Where(t => t != IModuleType)
.Where(t => !t.IsAbstract)
.Select(type => CreateModuleInfo(type)));
}
private static Assembly OnReflectionOnlyResolve(ResolveEventArgs args, DirectoryInfo directory)
{
Assembly loadedAssembly = AppDomain.CurrentDomain.ReflectionOnlyGetAssemblies().FirstOrDefault(
asm => string.Equals(asm.FullName, args.Name, StringComparison.OrdinalIgnoreCase));
if (loadedAssembly != null)
{
return loadedAssembly;
}
AssemblyName assemblyName = new AssemblyName(args.Name);
string dependentAssemblyFilename = Path.Combine(directory.FullName, assemblyName.Name + ".dll");
if (File.Exists(dependentAssemblyFilename))
{
return Assembly.ReflectionOnlyLoadFrom(dependentAssemblyFilename);
}
return Assembly.ReflectionOnlyLoad(args.Name);
}
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")]
internal void LoadAssemblies(IEnumerable<string> assemblies)
{
foreach (string assemblyPath in assemblies)
{
try
{
Assembly.ReflectionOnlyLoadFrom(assemblyPath);
}
catch (FileNotFoundException)
{
// Continue loading assemblies even if an assembly can not be loaded in the new AppDomain
}
}
}
private static ModuleInfo CreateModuleInfo(Type type)
{
string moduleName = type.Name;
List<string> dependsOn = new List<string>();
bool onDemand = false;
var moduleAttribute =
CustomAttributeData.GetCustomAttributes(type).FirstOrDefault(
cad => cad.Constructor.DeclaringType.FullName == typeof(ModuleAttribute).FullName);
if (moduleAttribute != null)
{
foreach (CustomAttributeNamedArgument argument in moduleAttribute.NamedArguments)
{
string argumentName = argument.MemberInfo.Name;
switch (argumentName)
{
case "ModuleName":
moduleName = (string) argument.TypedValue.Value;
break;
case "OnDemand":
onDemand = (bool) argument.TypedValue.Value;
break;
case "StartupLoaded":
onDemand = !((bool) argument.TypedValue.Value);
break;
}
}
}
var moduleDependencyAttributes =
CustomAttributeData.GetCustomAttributes(type).Where(
cad => cad.Constructor.DeclaringType.FullName == typeof(ModuleDependencyAttribute).FullName);
foreach (CustomAttributeData cad in moduleDependencyAttributes)
{
dependsOn.Add((string) cad.ConstructorArguments[0].Value);
}
ModuleInfo moduleInfo = new ModuleInfo(moduleName, type.AssemblyQualifiedName)
{
InitializationMode =
onDemand
? InitializationMode.OnDemand
: InitializationMode.WhenAvailable,
Ref = type.Assembly.CodeBase,
};
moduleInfo.DependsOn.AddRange(dependsOn);
return moduleInfo;
}
}
}
} | 49.733591 | 157 | 0.532334 | [
"MIT"
] | cointoss1973/Prism4.1-WPF | PrismLibrary/Desktop/Prism/Modularity/DirectoryModuleCatalog.Desktop.cs | 12,881 | C# |
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Generic;
using System.Linq;
using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore.Metadata.Internal;
using Microsoft.EntityFrameworkCore.Utilities;
namespace Microsoft.EntityFrameworkCore.Metadata
{
/// <summary>
/// Represents a table in the database.
/// </summary>
public interface ITable : ITableBase
{
/// <summary>
/// Gets the entity type mappings.
/// </summary>
new IEnumerable<ITableMapping> EntityTypeMappings { get; }
/// <summary>
/// Gets the columns defined for this table.
/// </summary>
new IEnumerable<IColumn> Columns { get; }
/// <summary>
/// Gets the value indicating whether the table should be managed by migrations
/// </summary>
bool IsMigratable { get; }
/// <summary>
/// Gets the foreing key constraints for this table.
/// </summary>
IEnumerable<IForeignKeyConstraint> ForeignKeyConstraints { get; }
/// <summary>
/// Gets the unique constraints including the primary key for this table.
/// </summary>
IEnumerable<IUniqueConstraint> UniqueConstraints { get; }
/// <summary>
/// Gets the primary key for this table.
/// </summary>
IUniqueConstraint PrimaryKey { get; }
/// <summary>
/// Gets the indexes for this table.
/// </summary>
IEnumerable<ITableIndex> Indexes { get; }
/// <summary>
/// Gets the check constraints for this table.
/// </summary>
IEnumerable<ICheckConstraint> CheckConstraints
=> EntityTypeMappings.SelectMany(m => CheckConstraint.GetCheckConstraints(m.EntityType))
.Distinct((x, y) => x.Name == y.Name);
/// <summary>
/// Gets the comment for this table.
/// </summary>
public virtual string Comment
=> EntityTypeMappings.Select(e => e.EntityType.GetComment()).FirstOrDefault(c => c != null);
/// <summary>
/// Gets the column with a given name. Returns <see langword="null" /> if no column with the given name is defined.
/// </summary>
new IColumn FindColumn([NotNull] string name);
}
}
| 35 | 127 | 0.602414 | [
"Apache-2.0"
] | PingmanTools/efcore | src/EFCore.Relational/Metadata/ITable.cs | 2,485 | C# |
using System;
using EIP.Common.Entities.Dtos;
namespace EIP.System.Models.Dtos.Config
{
/// <summary>
/// 根据父级查询
/// </summary>
public class SystemDictionaryGetByParentIdInput : SearchDto
{
public Guid? Id { get; set; }
}
} | 19.769231 | 63 | 0.634241 | [
"MIT"
] | edwinhuish/eipcore2 | Api/Service/System/EIP.System.Models/Dtos/Config/SystemDictionaryGetByParentIdInput.cs | 271 | C# |
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
namespace Zip.Database
{
public class DesignTimeSqlServerDbContextFactory : IDesignTimeDbContextFactory<ZipDbContext>
{
public ZipDbContext CreateDbContext(string[] args)
{
var builder = new DbContextOptionsBuilder<ZipDbContext>();
builder.UseSqlite(@"Data Source=zip.db;Version=3;");
return new ZipDbContext(builder.Options);
}
}
public class DesignTimeSqliteDbContextFactory : IDesignTimeDbContextFactory<ZipDbContext>
{
public ZipDbContext CreateDbContext(string[] args)
{
var builder = new DbContextOptionsBuilder<ZipDbContext>();
builder.UseSqlite(@"Data Source=zip.db;Version=3;");
return new ZipDbContext(builder.Options);
}
}
} | 30.862069 | 97 | 0.658101 | [
"MIT"
] | parameshg/tryzip | Zip.Database/DesignTimeDbContextFactory.cs | 897 | C# |
namespace cloudscribe.SimpleContent.ContentTemplates.Configuration
{
public class GalleryOptions
{
/// <summary>
/// must be a folder starting with /media
/// </summary>
public string NewImagePath { get; set; } = "/media/gallery";
/// <summary>
/// thumbnails are not needed for the gallery and just use extra disk space.
/// The gallery uses the same images for both thumbnail and full view
/// </summary>
public bool CreateThumbnails { get; set; } = false;
/// <summary>
/// the default value 1500 is recommended, even if the image is rendered smaller this ensures it looks good on retina displays
/// The resisizing still makes the image file sizes significantly smaller.
/// </summary>
public int ResizeMaxWidth { get; set; } = 1500;
/// <summary>
/// the default value 1500 is recommended, even if the image is rendered smaller this ensures it looks good on retina displays
/// The resisizing still makes the image file sizes significantly smaller.
/// </summary>
public int ResizeMaxHeight { get; set; } = 1500;
/// <summary>
/// original size images from modern cameras are quite large and not useful on the web so this defaults to false
/// </summary>
public bool KeepOriginalSizeImages { get; set; } = false;
/// <summary>
/// ability to browse files on the server is still subject to permissions of the user and file browse policy
/// this just controls visibility of the button for browsing the server
/// </summary>
public bool EnableBrowseServer { get; set; } = true;
/// <summary>
/// allow the user to crop newly dropped/uploaded images
/// </summary>
public bool EnableCropping { get; set; } = true;
/// <summary>
/// in pixels
/// </summary>
public int CropAreaWidth { get; set; } = 690;
/// <summary>
/// in pixels
/// </summary>
public int CropAreaHeight { get; set; } = 517;
/// <summary>
/// the image shown before user uploads or selects a file from the server
/// </summary>
public string PlaceholderImageUrl { get; set; } = "/cr/images/690x517-placeholder.png";
}
}
| 38.770492 | 134 | 0.605074 | [
"Apache-2.0"
] | cloudscribe/cloudscribe.SimpleContent | src/cloudscribe.SimpleContent.ContentTemplates.Bootstrap4/Configuration/Gallery/GalleryOptions.cs | 2,367 | C# |
using System;
using System.Collections.Generic;
using System.Text;
namespace DemoApplication
{
public abstract class AbstractPerson : IPerson
{
protected AbstractPerson(string firstName, string lastName)
{
FirstName = firstName;
LastName = lastName;
}
public string FirstName { get; set; }
public string LastName { get; set; }
}
}
| 20.55 | 67 | 0.627737 | [
"MIT"
] | JohanSmarius/SimpleJavaToCSharpComparison | DemoApplication/DemoApplication/AbstractPerson.cs | 413 | C# |
namespace Endurance.Web.Trial.Controllers.ResponseModels
{
public class VetGateAttemptResponseModel
{
public VetGateAttemptResponseModel(
bool disqualified = false,
bool passedStatus = false,
string nextPerformanceStartsAt = null)
{
Disqualified = disqualified;
PassedStatus = passedStatus;
NextPerformanceStartAt = nextPerformanceStartsAt;
}
public bool Disqualified { get; }
public bool PassedStatus { get; }
public string NextPerformanceStartAt { get; }
}
}
| 27.227273 | 61 | 0.629382 | [
"MIT"
] | HorseSport-achobanov/Endurance | Source/Web/Endurance.Web.Trial.Controllers/ResponseModels/VetGateAttemptResponseModel.cs | 601 | C# |
// Uncomment the following to provide samples for PageResult<T>. Must also add the Microsoft.AspNet.WebApi.OData
// package to your project.
////#define Handle_PageResultOfT
using System.Diagnostics.CodeAnalysis;
using System.Net.Http.Headers;
using System.Web;
using System.Web.Http;
#if Handle_PageResultOfT
using System.Web.Http.OData;
#endif
namespace GitPulseAnalytics.Areas.HelpPage
{
/// <summary>
/// Use this class to customize the Help Page.
/// For example you can set a custom <see cref="System.Web.Http.Description.IDocumentationProvider"/> to supply the documentation
/// or you can provide the samples for the requests/responses.
/// </summary>
public static class HelpPageConfig
{
[SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters",
MessageId = "GitPulseAnalytics.Areas.HelpPage.TextSample.#ctor(System.String)",
Justification = "End users may choose to merge this string with existing localized resources.")]
[SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly",
MessageId = "bsonspec",
Justification = "Part of a URI.")]
public static void Register(HttpConfiguration config)
{
//// Uncomment the following to use the documentation from XML documentation file.
config.SetDocumentationProvider(new XmlDocumentationProvider(HttpContext.Current.Server.MapPath("~/App_Data/XmlDocument.xml")));
//// Uncomment the following to use "sample string" as the sample for all actions that have string as the body parameter or return type.
//// Also, the string arrays will be used for IEnumerable<string>. The sample objects will be serialized into different media type
//// formats by the available formatters.
//config.SetSampleObjects(new Dictionary<Type, object>
//{
// {typeof(string), "sample string"},
// {typeof(IEnumerable<string>), new string[]{"sample 1", "sample 2"}}
//});
// Extend the following to provide factories for types not handled automatically (those lacking parameterless
// constructors) or for which you prefer to use non-default property values. Line below provides a fallback
// since automatic handling will fail and GeneratePageResult handles only a single type.
#if Handle_PageResultOfT
config.GetHelpPageSampleGenerator().SampleObjectFactories.Add(GeneratePageResult);
#endif
// Extend the following to use a preset object directly as the sample for all actions that support a media
// type, regardless of the body parameter or return type. The lines below avoid display of binary content.
// The BsonMediaTypeFormatter (if available) is not used to serialize the TextSample object.
config.SetSampleForMediaType(
new TextSample("Binary JSON content. See http://bsonspec.org for details."),
new MediaTypeHeaderValue("application/bson"));
//// Uncomment the following to use "[0]=foo&[1]=bar" directly as the sample for all actions that support form URL encoded format
//// and have IEnumerable<string> as the body parameter or return type.
//config.SetSampleForType("[0]=foo&[1]=bar", new MediaTypeHeaderValue("application/x-www-form-urlencoded"), typeof(IEnumerable<string>));
//// Uncomment the following to use "1234" directly as the request sample for media type "text/plain" on the controller named "Values"
//// and action named "Put".
//config.SetSampleRequest("1234", new MediaTypeHeaderValue("text/plain"), "Values", "Put");
//// Uncomment the following to use the image on "../images/aspNetHome.png" directly as the response sample for media type "image/png"
//// on the controller named "Values" and action named "PullRequest" with parameter "id".
//config.SetSampleResponse(new ImageSample("../images/aspNetHome.png"), new MediaTypeHeaderValue("image/png"), "Values", "PullRequest", "id");
//// Uncomment the following to correct the sample request when the action expects an HttpRequestMessage with ObjectContent<string>.
//// The sample will be generated as if the controller named "Values" and action named "PullRequest" were having string as the body parameter.
//config.SetActualRequestType(typeof(string), "Values", "PullRequest");
//// Uncomment the following to correct the sample response when the action returns an HttpResponseMessage with ObjectContent<string>.
//// The sample will be generated as if the controller named "Values" and action named "Post" were returning a string.
//config.SetActualResponseType(typeof(string), "Values", "Post");
}
#if Handle_PageResultOfT
private static object GeneratePageResult(HelpPageSampleGenerator sampleGenerator, Type type)
{
if (type.IsGenericType)
{
Type openGenericType = type.GetGenericTypeDefinition();
if (openGenericType == typeof(PageResult<>))
{
// PullRequest the T in PageResult<T>
Type[] typeParameters = type.GetGenericArguments();
Debug.Assert(typeParameters.Length == 1);
// Create an enumeration to pass as the first parameter to the PageResult<T> constuctor
Type itemsType = typeof(List<>).MakeGenericType(typeParameters);
object items = sampleGenerator.GetSampleObject(itemsType);
// Fill in the other information needed to invoke the PageResult<T> constuctor
Type[] parameterTypes = new Type[] { itemsType, typeof(Uri), typeof(long?), };
object[] parameters = new object[] { items, null, (long)ObjectGenerator.DefaultCollectionSize, };
// Call PageResult(IEnumerable<T> items, Uri nextPageLink, long? count) constructor
ConstructorInfo constructor = type.GetConstructor(parameterTypes);
return constructor.Invoke(parameters);
}
}
return null;
}
#endif
}
} | 52.833333 | 145 | 0.745882 | [
"MIT"
] | quanyincoder/GitPulseAnalytics | GitPulseAnalytics/Areas/HelpPage/App_Start/HelpPageConfig.cs | 5,706 | C# |
namespace EveEchoesPlanetaryProductionApi.Data.Migrations
{
using Microsoft.EntityFrameworkCore.Migrations;
public partial class StoredProceduresForQueryingGraph : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
// --EXECUTE [graph].[GetAllNeighbours] N'KDV-DE';
var getAllNeighbours = @"
DROP PROCEDURE IF EXISTS [graph].[GetAllNeighbours]
GO
CREATE PROCEDURE [graph].[GetAllNeighbours]
@SystemName nvarchar(100)
AS
SELECT DestinationSystem.[Id], DestinationSystem.[Name]
FROM [graph].[Systems] AS SourceSystem,
[graph].[Jumps] AS Jumps,
[graph].[Systems] AS DestinationSystem
WHERE MATCH (SourceSystem-(Jumps)->DestinationSystem)
AND SourceSystem.[Name] = @SystemName;
GO";
migrationBuilder.Sql(getAllNeighbours);
//--EXECUTE [graph].[AllNeighboursWithinGivenDistance] N'KDV-DE', N'5';
var getAllNeighboursWithinGivenDistance = @"
DROP PROCEDURE IF EXISTS [graph].[AllNeighboursWithinGivenDistance]
GO
CREATE PROCEDURE [graph].[AllNeighboursWithinGivenDistance]
@SystemName nvarchar(100),
@distance nvarchar(4)
AS
DECLARE @sql nvarchar(4000)
SET @sql = N'
SELECT
STRING_AGG(DestinationSystem.[Id], ''->'') WITHIN GROUP(GRAPH PATH) AS Jumps
FROM [graph].[Systems] AS SourceSystem,
[graph].[Jumps] FOR PATH AS Jump,
[graph].[Systems] FOR PATH AS DestinationSystem
WHERE MATCH (SHORTEST_PATH(SourceSystem(-(Jump)->DestinationSystem){1,' + @distance + '}))
AND SourceSystem.[Name] = @SystemName;'
EXEC sp_executesql @sql, N'@SystemName nvarchar(100), @distance nvarchar(4)', @SystemName, @distance
GO ";
migrationBuilder.Sql(getAllNeighboursWithinGivenDistance);
//--EXECUTE [graph].[FindShortestPath] N'Jita', N'KDV-DE';
var findShortestPathBetweenTwoSystems = @"
DROP PROCEDURE IF EXISTS [graph].[FindShortestPath]
GO
CREATE PROCEDURE [graph].[FindShortestPath]
@SourceSystem nvarchar(100),
@DestinationSystem nvarchar(100)
AS
SELECT SourceSystemName, Jumps
FROM ( SELECT
SourceSystem.[Name] AS SourceSystemName,
STRING_AGG(DestinationSystem.[Name], '->') WITHIN GROUP (GRAPH PATH) AS Jumps,
LAST_VALUE(DestinationSystem.[Name]) WITHIN GROUP (GRAPH PATH) AS LastNode
FROM
[graph].[Systems] AS SourceSystem,
[graph].[Jumps] FOR PATH AS Jump,
[graph].[Systems] FOR PATH AS DestinationSystem
WHERE MATCH (SHORTEST_PATH(SourceSystem(-(Jump)->DestinationSystem)+))
AND SourceSystem.[Name] = @SourceSystem
) AS [Path]
WHERE [Path].LastNode = @DestinationSystem;
GO";
migrationBuilder.Sql(findShortestPathBetweenTwoSystems);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
var sql = @"
DROP PROCEDURE IF EXISTS [graph].[GetAllNeighbours]
GO
DROP PROCEDURE IF EXISTS [graph].[AllNeighboursWithinGivenDistance]
GO
DROP PROCEDURE IF EXISTS [graph].[FindShortestPath]
GO";
migrationBuilder.Sql(sql);
}
}
}
| 44.212766 | 120 | 0.518527 | [
"MIT"
] | pirocorp/Eve-Echoes-Industries | src/Data/EveEchoesPlanetaryProductionApi.Data/Migrations/20201126110820_StoredProceduresForQueryingGraph.cs | 4,158 | C# |
using System;
using Amazon.Common.DotNetCli.Tools.CLi;
using Amazon.Common.DotNetCli.Tools.Commands;
using System.Collections.Generic;
using Amazon.ElasticBeanstalk.Tools.Commands;
namespace Amazon.ElasticBeanstalk.Tools
{
class Program
{
static void Main(string[] args)
{
var application = new Application("eb", "Amazon Elastic Beanstalk Tools for .NET Core applications", "https://github.com/aws/aws-extensions-for-dotnet-cli",
new List<ICommandInfo>()
{
new GroupHeaderInfo("Commands to deploy to Amazon Elastic Beanstalk:"),
new CommandInfo<DeployEnvironmentCommand>(DeployEnvironmentCommand.COMMAND_NAME, DeployEnvironmentCommand.COMMAND_DESCRIPTION, DeployEnvironmentCommand.CommandOptions),
new CommandInfo<ListEnvironmentsCommand>(ListEnvironmentsCommand.COMMAND_NAME, ListEnvironmentsCommand.COMMAND_DESCRIPTION, ListEnvironmentsCommand.CommandOptions),
new CommandInfo<DeleteEnvironmentCommand>(DeleteEnvironmentCommand.COMMAND_NAME, DeleteEnvironmentCommand.COMMAND_DESCRIPTION, DeleteEnvironmentCommand.CommandOptions),
});
var exitCode = application.Execute(args);
if (exitCode != 0)
{
Environment.Exit(-1);
}
}
}
}
| 42.9375 | 188 | 0.687045 | [
"Apache-2.0"
] | bartoszsiekanski/aws-extensions-for-dotnet-cli | src/Amazon.ElasticBeanstalk.Tools/Program.cs | 1,376 | C# |
using Jerrycurl.Mvc.Test.Project.Accessors;
using Shouldly;
namespace Jerrycurl.Mvc.Test
{
public class TemplateTests
{
public void Test_Procedure_Template()
{
var misc = new MiscAccessor();
var result = misc.TemplatedQuery();
result.ShouldBe(new[] { 1, 2, 3 });
}
public void Test_Partial_Template()
{
var misc = new MiscAccessor();
var result = misc.PartialedQuery();
result.ShouldBe(new[] { 1, 2, 3 });
}
}
}
| 21.96 | 47 | 0.54827 | [
"MIT"
] | rhodosaur/jerrycurl | test/unit/src/Mvc/Jerrycurl.Mvc.Test/TemplateTests.cs | 551 | C# |
// <copyright file="ContentPanelView.xaml.cs" company="Mike Rudnikov">
// Copyright (c) Mike Rudnikov. All rights reserved.
// </copyright>
namespace RmEncrypter_PublicVersion.Views
{
using System.Windows.Controls;
/// <summary>
/// Interaction logic for ContentPanelView.xaml.
/// </summary>
public partial class ContentPanelView : UserControl
{
/// <summary>
/// Initializes a new instance of the <see cref="ContentPanelView"/> class.
/// </summary>
public ContentPanelView()
{
this.InitializeComponent();
}
}
}
| 26.304348 | 83 | 0.628099 | [
"MIT"
] | RudMike/RmEncrypter_PublicVersion | RmEncrypter_PublicVersion/Views/ContentPanelView.xaml.cs | 607 | C# |
namespace Simplex.BVT
{
internal class BVTRoot
{
}
} | 10.833333 | 26 | 0.6 | [
"MIT"
] | phinoox/simplex | Simplex/SimplexCore/BVT/BVTRoot.cs | 67 | C# |
using System.Collections.Generic;
using Microsoft.TeamFoundation.SourceControl.WebApi;
using PrDash.View;
namespace PrDash.DataSource
{
/// <summary>
/// Interface for interacting with the pull request.
/// </summary>
public interface IPullRequestSource
{
/// <summary>
/// Retrieves all active pull requests to the configured data source.
/// </summary>
/// <returns>A stream of <see cref="GitPullRequest"/></returns>
public IEnumerable<PullRequestViewElement> FetchActivePullRequsts();
}
}
| 30.315789 | 78 | 0.65625 | [
"MIT"
] | felixti/pr-dash | src/DataSource/IPullRequestSource.cs | 578 | C# |
using System;
using System.Collections.Generic;
using System.ComponentModel.Design;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using EnvDTE;
using EnvDTE80;
using Microsoft.VisualStudio.Shell;
using WebpToolkit.Dialogs;
namespace WebpToolkit.Commands
{
internal class GenerateCommand
{
private readonly IMenuCommandService commandService;
private readonly DTE2 dte;
private bool isProcessing;
private GenerateCommand(DTE2 dte, IMenuCommandService commandService)
{
this.dte = dte;
this.commandService = commandService;
AddCommand(
PackageIds.cmdGenerateLossless,
(s, e) => GenerateImageAsync(false, e).ConfigureAwait(true),
(s, e) =>
{
ThreadHelper.ThrowIfNotOnUIThread();
GenerateBeforeQueryStatus(s);
});
AddCommand(
PackageIds.cmdGenerateLossy,
(s, e) => GenerateImageAsync(true, e).ConfigureAwait(true),
(s, e) =>
{
GenerateBeforeQueryStatus(s);
});
}
public static async Task<IEnumerable<string>> GetSelectedFilePathsAsync(DTE2 dte)
{
await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();
return GetSelectedItemPaths(dte)
.SelectMany(p => Directory.Exists(p)
? Directory.EnumerateFiles(p, "*", SearchOption.AllDirectories)
: new[] { p });
}
public static IEnumerable<string> GetSelectedItemPaths(DTE2 dte)
{
ThreadHelper.ThrowIfNotOnUIThread();
var items = (Array)dte.ToolWindows.SolutionExplorer.SelectedItems;
foreach (UIHierarchyItem selItem in items)
{
if (selItem.Object is ProjectItem item && item.Properties != null)
{
yield return item.Properties.Item("FullPath").Value.ToString();
}
else if (selItem.Object is Project project && project.Kind != "{66A26720-8FB5-11D2-AA7E-00C04F688DDE}")
{
yield return project.GetRootFolder();
}
else if (selItem.Object is Solution solution && !string.IsNullOrEmpty(solution.FullName))
{
yield return Path.GetDirectoryName(solution.FullName);
}
}
}
public static async System.Threading.Tasks.Task<GenerateCommand> InitializeAsync(IAsyncServiceProvider package)
{
var menuCommandService = await package.GetServiceAsync(typeof(IMenuCommandService)).ConfigureAwait(true) as IMenuCommandService;
var dte2 = await package.GetServiceAsync(typeof(DTE)).ConfigureAwait(true) as DTE2;
return new GenerateCommand(dte2, menuCommandService);
}
private void AddCommand(int commandId, EventHandler invokeHandler, EventHandler beforeQueryStatus)
{
var cmdId = new CommandID(PackageGuids.guidWebpGeneratorCmdSet, commandId);
var menuCmd = new OleMenuCommand(invokeHandler, cmdId);
menuCmd.BeforeQueryStatus += beforeQueryStatus;
menuCmd.ParametersDescription = "*";
commandService.AddCommand(menuCmd);
}
private async System.Threading.Tasks.Task DisplayEndResultAsync(IList<ConversionResult> list, TimeSpan elapsed, bool isLossy)
{
await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();
var savings = list.Where(r => r?.Processed ?? false).Sum(r => r.Saving);
var originals = list.Where(r => r?.Processed ?? false).Sum(r => r.OriginalFileSize);
var results = list.Where(r => r?.Processed ?? false).Sum(r => r.ResultFileSize);
if (savings > 0)
{
var successfulGenerations = list.Count(x => x != null);
var percent = Math.Round(100 - ((double)results / (double)originals * 100), 1, MidpointRounding.AwayFromZero);
var image = successfulGenerations == 1 ? "image" : "images";
var lossyLabel = isLossy ? "lossy" : "lossless";
var msg = $"{successfulGenerations} {image} generated using {lossyLabel} settings in {Math.Round(elapsed.TotalMilliseconds / 1000, 2)} seconds. Total saving of {savings:N0} bytes / {percent}%";
dte.StatusBar.Text = msg;
await Logger.LogToOutputWindowAsync(msg + Environment.NewLine).ConfigureAwait(false);
var namesSeparator = " -> ";
var filesGenerated = list.Where(r => r != null && r.Saving > 0);
var maxLength = filesGenerated.Max(r => Path.GetFileName(r.OriginalFileName).Length + Path.GetFileName(r.ResultFileName).Length + namesSeparator.Length);
foreach (var result in filesGenerated)
{
var originalName = Path.GetFileName(result.OriginalFileName);
var generatedName = Path.GetFileName(result.ResultFileName).PadRight(maxLength);
if (result.Processed)
{
var p = Math.Round(100 - ((double)result.ResultFileSize / (double)result.OriginalFileSize * 100), 1, MidpointRounding.AwayFromZero);
await Logger.LogToOutputWindowAsync($" {originalName}{namesSeparator}{generatedName}\t saving {result.Saving:N0} bytes / {p}%").ConfigureAwait(false);
}
else
{
await Logger.LogToOutputWindowAsync($" {originalName}{namesSeparator}{generatedName} skipped").ConfigureAwait(false);
}
}
}
else
{
var message = "All images have already been generated.";
dte.StatusBar.Text = message;
await Logger.LogToOutputWindowAsync(message).ConfigureAwait(false);
}
}
private void GenerateBeforeQueryStatus(object sender)
{
ThreadHelper.ThrowIfNotOnUIThread();
var button = (OleMenuCommand)sender;
var paths = GetSelectedItemPaths(dte);
button.Visible = paths.Any();
button.Enabled = true;
if (button.Visible && isProcessing)
{
button.Enabled = false;
}
}
private async System.Threading.Tasks.Task GenerateImageAsync(bool isLossy, EventArgs e)
{
isProcessing = true;
await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();
IEnumerable<string> files = null;
// Check command parameters first
if (e is OleMenuCmdEventArgs cmdArgs && cmdArgs.InValue is string arg)
{
var filePath = arg.Trim('"', '\'');
if (Converter.IsFileSupported(filePath) && File.Exists(filePath))
{
files = new[] { filePath };
}
}
// Then check selected items
if (files == null)
{
await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();
var filePaths = await GetSelectedFilePathsAsync(dte).ConfigureAwait(true);
files = filePaths.Where(f => Converter.IsFileSupported(f)).ToArray();
}
if (!files.Any())
{
isProcessing = false;
await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();
dte.StatusBar.Text = "No images found to convert.";
return;
}
var list = new ConversionResult[files.Count()];
var stopwatch = Stopwatch.StartNew();
var count = files.Count();
await System.Threading.Tasks.Task.Run(async () =>
{
await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();
try
{
var text = count == 1 ? " image" : " images";
dte.StatusBar.Progress(true, "Generating " + count + text + "...", AmountCompleted: 1, Total: count + 1);
for (var i = 0; i < files.Count(); i++)
{
var file = files.ElementAt(i);
var converter = new Converter
{
LossyQualityLevel = WebpToolkitPackage.OptionsPage.LossyQuality,
AllowOverwrite = WebpToolkitPackage.OptionsPage.IsOverwriteEnabled,
AllowNearLossless = WebpToolkitPackage.OptionsPage.AllowNearLossless,
};
var result = converter.ConvertToWebp(file, isLossy);
await HandleResultAsync(result, i + 1).ConfigureAwait(true);
if (result.Saving > 0 && result.ResultFileSize > 0 && !string.IsNullOrEmpty(result.ResultFileName))
{
list[i] = result;
}
}
}
finally
{
dte.StatusBar.Progress(false);
stopwatch.Stop();
await DisplayEndResultAsync(list, stopwatch.Elapsed, isLossy).ConfigureAwait(false);
isProcessing = false;
}
}).ConfigureAwait(false);
}
private async System.Threading.Tasks.Task HandleResultAsync(ConversionResult result, int count)
{
await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();
var originalName = Path.GetFileName(result.OriginalFileName);
var generatedName = Path.GetFileName(result.ResultFileName);
if (result.Processed)
{
if (dte.SourceControl.IsItemUnderSCC(result.ResultFileName) && !dte.SourceControl.IsItemCheckedOut(result.ResultFileName))
{
dte.SourceControl.CheckOutItem(result.ResultFileName);
}
var text = $"Compressed {originalName} to {generatedName} saving {result.Saving} bytes / {result.Percent}%";
dte.StatusBar.Progress(true, text, count, count + 1);
}
else
{
dte.StatusBar.Progress(true, generatedName + " already exists", AmountCompleted: count, Total: count + 1);
}
}
}
} | 42.555118 | 209 | 0.560459 | [
"MIT"
] | kyleherzog/WebpToolkit | WebpToolkit/Commands/GenerateCommand.cs | 10,811 | C# |
using System;
using System.Collections;
using System.Runtime.InteropServices;
namespace NAudio.Wave.Compression
{
/// <summary>
/// Interop definitions for Windows ACM (Audio Compression Manager) API
/// </summary>
class AcmInterop
{
// http://msdn.microsoft.com/en-us/library/dd742891%28VS.85%29.aspx
public delegate bool AcmDriverEnumCallback(IntPtr hAcmDriverId, IntPtr instance, AcmDriverDetailsSupportFlags flags);
public delegate bool AcmFormatEnumCallback(IntPtr hAcmDriverId, ref AcmFormatDetails formatDetails, IntPtr dwInstance, AcmDriverDetailsSupportFlags flags);
public delegate bool AcmFormatTagEnumCallback(IntPtr hAcmDriverId, ref AcmFormatTagDetails formatTagDetails, IntPtr dwInstance, AcmDriverDetailsSupportFlags flags);
/// <summary>
/// http://msdn.microsoft.com/en-us/library/dd742910%28VS.85%29.aspx
/// UINT ACMFORMATCHOOSEHOOKPROC acmFormatChooseHookProc(
/// HWND hwnd,
/// UINT uMsg,
/// WPARAM wParam,
/// LPARAM lParam
/// </summary>
public delegate bool AcmFormatChooseHookProc(IntPtr windowHandle, int message, IntPtr wParam, IntPtr lParam);
// not done:
// acmDriverAdd
// acmDriverID
// acmDriverMessage
// acmDriverRemove
// acmFilterChoose
// acmFilterChooseHookProc
// acmFilterDetails
// acmFilterEnum -acmFilterEnumCallback
// acmFilterTagDetails
// acmFilterTagEnum
// acmFormatDetails
// acmFormatTagDetails
// acmGetVersion
// acmStreamMessage
// http://msdn.microsoft.com/en-us/library/dd742886%28VS.85%29.aspx
[DllImport("Msacm32.dll")]
public static extern MmResult acmDriverClose(IntPtr hAcmDriver, int closeFlags);
// http://msdn.microsoft.com/en-us/library/dd742890%28VS.85%29.aspx
[DllImport("Msacm32.dll")]
public static extern MmResult acmDriverEnum(AcmDriverEnumCallback fnCallback, IntPtr dwInstance, AcmDriverEnumFlags flags);
// http://msdn.microsoft.com/en-us/library/dd742887%28VS.85%29.aspx
[DllImport("Msacm32.dll")]
public static extern MmResult acmDriverDetails(IntPtr hAcmDriver, ref AcmDriverDetails driverDetails, int reserved);
// http://msdn.microsoft.com/en-us/library/dd742894%28VS.85%29.aspx
[DllImport("Msacm32.dll")]
public static extern MmResult acmDriverOpen(out IntPtr pAcmDriver, IntPtr hAcmDriverId, int openFlags);
// http://msdn.microsoft.com/en-us/library/dd742909%28VS.85%29.aspx
[DllImport("Msacm32.dll")]
public static extern MmResult acmFormatChoose(ref AcmFormatChoose formatChoose);
// http://msdn.microsoft.com/en-us/library/dd742914%28VS.85%29.aspx
[DllImport("Msacm32.dll")]
public static extern MmResult acmFormatEnum(IntPtr hAcmDriver, ref AcmFormatDetails formatDetails, AcmFormatEnumCallback callback, IntPtr instance, AcmFormatEnumFlags flags);
/// <summary>
/// http://msdn.microsoft.com/en-us/library/dd742916%28VS.85%29.aspx
/// MMRESULT acmFormatSuggest(
/// HACMDRIVER had,
/// LPWAVEFORMATEX pwfxSrc,
/// LPWAVEFORMATEX pwfxDst,
/// DWORD cbwfxDst,
/// DWORD fdwSuggest);
/// </summary>
[DllImport("Msacm32.dll")]
public static extern MmResult acmFormatSuggest(
IntPtr hAcmDriver,
[In, MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "NAudio.Wave.WaveFormatCustomMarshaler")]
WaveFormat sourceFormat,
[In, Out, MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "NAudio.Wave.WaveFormatCustomMarshaler")]
WaveFormat destFormat,
int sizeDestFormat,
AcmFormatSuggestFlags suggestFlags);
[DllImport("Msacm32.dll",EntryPoint="acmFormatSuggest")]
public static extern MmResult acmFormatSuggest2(
IntPtr hAcmDriver,
IntPtr sourceFormatPointer,
IntPtr destFormatPointer,
int sizeDestFormat,
AcmFormatSuggestFlags suggestFlags);
// http://msdn.microsoft.com/en-us/library/dd742919%28VS.85%29.aspx
[DllImport("Msacm32.dll")]
public static extern MmResult acmFormatTagEnum(IntPtr hAcmDriver, ref AcmFormatTagDetails formatTagDetails, AcmFormatTagEnumCallback callback, IntPtr instance, int reserved);
// http://msdn.microsoft.com/en-us/library/dd742922%28VS.85%29.aspx
// this version of the prototype is for metrics that output a single integer
[DllImport("Msacm32.dll")]
public static extern MmResult acmMetrics(IntPtr hAcmObject, AcmMetrics metric, out int output);
/// <summary>
/// http://msdn.microsoft.com/en-us/library/dd742928%28VS.85%29.aspx
/// MMRESULT acmStreamOpen(
/// LPHACMSTREAM phas,
/// HACMDRIVER had,
/// LPWAVEFORMATEX pwfxSrc,
/// LPWAVEFORMATEX pwfxDst,
/// LPWAVEFILTER pwfltr,
/// DWORD_PTR dwCallback,
/// DWORD_PTR dwInstance,
/// DWORD fdwOpen
/// </summary>
[DllImport("Msacm32.dll")]
public static extern MmResult acmStreamOpen(
out IntPtr hAcmStream,
IntPtr hAcmDriver,
[In, MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "NAudio.Wave.WaveFormatCustomMarshaler")]
WaveFormat sourceFormat,
[In, MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "NAudio.Wave.WaveFormatCustomMarshaler")]
WaveFormat destFormat,
[In] WaveFilter waveFilter,
IntPtr callback,
IntPtr instance,
AcmStreamOpenFlags openFlags);
/// <summary>
/// A version with pointers for troubleshooting
/// </summary>
[DllImport("Msacm32.dll",EntryPoint="acmStreamOpen")]
public static extern MmResult acmStreamOpen2(
out IntPtr hAcmStream,
IntPtr hAcmDriver,
IntPtr sourceFormatPointer,
IntPtr destFormatPointer,
[In] WaveFilter waveFilter,
IntPtr callback,
IntPtr instance,
AcmStreamOpenFlags openFlags);
// http://msdn.microsoft.com/en-us/library/dd742923%28VS.85%29.aspx
[DllImport("Msacm32.dll")]
public static extern MmResult acmStreamClose(IntPtr hAcmStream, int closeFlags);
// http://msdn.microsoft.com/en-us/library/dd742924%28VS.85%29.aspx
[DllImport("Msacm32.dll")]
public static extern MmResult acmStreamConvert(IntPtr hAcmStream, [In, Out] AcmStreamHeaderStruct streamHeader, AcmStreamConvertFlags streamConvertFlags);
// http://msdn.microsoft.com/en-us/library/dd742929%28VS.85%29.aspx
[DllImport("Msacm32.dll")]
public static extern MmResult acmStreamPrepareHeader(IntPtr hAcmStream, [In, Out] AcmStreamHeaderStruct streamHeader, int prepareFlags);
// http://msdn.microsoft.com/en-us/library/dd742929%28VS.85%29.aspx
[DllImport("Msacm32.dll")]
public static extern MmResult acmStreamReset(IntPtr hAcmStream, int resetFlags);
// http://msdn.microsoft.com/en-us/library/dd742931%28VS.85%29.aspx
[DllImport("Msacm32.dll")]
public static extern MmResult acmStreamSize(IntPtr hAcmStream, int inputBufferSize, out int outputBufferSize, AcmStreamSizeFlags flags);
// http://msdn.microsoft.com/en-us/library/dd742932%28VS.85%29.aspx
[DllImport("Msacm32.dll")]
public static extern MmResult acmStreamUnprepareHeader(IntPtr hAcmStream, [In, Out] AcmStreamHeaderStruct streamHeader, int flags);
}
}
| 46.934911 | 182 | 0.658094 | [
"MIT"
] | cnsuhao/OtterUI-1 | Tool/NAudio/NAudio/Wave/Compression/AcmInterop.cs | 7,932 | C# |
using System.Reflection;
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("HTML Renderer")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Open source hosted on CodePlex")]
[assembly: AssemblyProduct("HTML Renderer")]
[assembly: AssemblyCopyright("Copyright © 2008")]
[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("ec8a9e7e-9a9d-43c3-aa97-f6f505b1d3ed")]
// Version information for an assembly consists of the following four values:
[assembly: AssemblyVersion("1.5.1.0")] | 37.827586 | 84 | 0.771194 | [
"BSD-3-Clause"
] | the-department-of-code/HTML-Renderer | Source/SharedAssemblyInfo.cs | 1,100 | C# |
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using sgta.Models;
namespace sgta.Repositorio
{
public class TarefaRepositorio
{
private SqlConnection _con;
//Metodo para string de conexao
private void Connection()
{
string constr = ConfigurationManager.ConnectionStrings["stringConexao"].ToString();
_con = new SqlConnection(constr);
}
//Cadastrar uma tarefa
public bool CadastrarTarefa(Tarefas tarefaObj)
{
//Chamado o metodo de conexao criado
Connection();
int i;
//Trabalhando com as procedures criadas no Banco de dados
using (SqlCommand command = new SqlCommand("IncluirTarefa", _con))
{
//Informando que é uma procedure (necessario para trabalhar com procedure)
command.CommandType = System.Data.CommandType.StoredProcedure;
//Informando parametros da procedure
command.Parameters.AddWithValue("@nome", tarefaObj.nome);
command.Parameters.AddWithValue("@dataCadastro", tarefaObj.dataCadastro);
command.Parameters.AddWithValue("@dataLimite", tarefaObj.dataLimite);
//Abrir a conexão
_con.Open();
//Se for com sucesso o ExecuteNonQuery retorna quantas linhas foram afetadas
i = command.ExecuteNonQuery();
}
//Fechar a conexão
_con.Close();
//i sendo maior que 1 temos true
return i >= 1;
}
//Obter as tarefas criando uma lista
public List<Tarefas> ObterTarefas()
{
//Chamar conexao
Connection();
//Instanciando lista
List<Tarefas> TarefasList = new List<Tarefas>();
//Usando a procedure
using (SqlCommand command = new SqlCommand("SelecionarTarefas", _con))
{
command.CommandType = System.Data.CommandType.StoredProcedure;
_con.Open();
//Verifica na tabela os registros (instancia do método ExecuteReader)
SqlDataReader reader = command.ExecuteReader();
//Condição enquanto reader esta lendo trazendo cada linha
while (reader.Read())
{
Tarefas tarefa = new Tarefas()
{
//Convertendo para inteiro o conteudo de reader no campo id e passando para variavel id
id = Convert.ToInt32(reader["id"]),
nome = Convert.ToString(reader["nome"]),
dataCadastro = Convert.ToString(reader["dataCadastro"]),
dataLimite = Convert.ToString(reader["dataLimite"])
};
//Adicionando o objeto tarefa na lista TarefasList
TarefasList.Add(tarefa);
}
_con.Close();
return TarefasList;
}
}
//Atualizar uma tarefa
public bool AtualizarTarefa(Tarefas tarefaObj)
{
//Chamado o metodo de conexao criado
Connection();
int i;
//Trabalhando com as procedures criadas no Banco de dados
using (SqlCommand command = new SqlCommand("AtualizarTarefa", _con))
{
//Informando que é uma procedure (necessario para trabalhar com procedure)
command.CommandType = System.Data.CommandType.StoredProcedure;
//Informando parametros da procedure
command.Parameters.AddWithValue("@id", tarefaObj.id);
command.Parameters.AddWithValue("@nome", tarefaObj.nome);
command.Parameters.AddWithValue("@dataCadastro", tarefaObj.dataCadastro);
command.Parameters.AddWithValue("@dataLimite", tarefaObj.dataLimite);
//Abrir a conexão
_con.Open();
//Se for com sucesso o ExecuteNonQuery retorna quantas linhas foram afetadas
i = command.ExecuteNonQuery();
}
//Fechar a conexão
_con.Close();
//i sendo maior que 1 temos true
return i >= 1;
}
//Excluir uma tarefa por id
public bool ExcluirTarefa(int id)
{
//Chamado o metodo de conexao criado
Connection();
int i;
//Trabalhando com as procedures criadas no Banco de dados
using (SqlCommand command = new SqlCommand("ExcluirTarefaPorId", _con))
{
//Informando que é uma procedure (necessario para trabalhar com procedure)
command.CommandType = System.Data.CommandType.StoredProcedure;
//Informando parametros da procedure
command.Parameters.AddWithValue("@id", id);
//Abrir a conexão
_con.Open();
//Se for com sucesso o ExecuteNonQuery retorna quantas linhas foram afetadas
i = command.ExecuteNonQuery();
}
//Fechar a conexão
_con.Close();
//i sendo maior que 1 temos true
if (i >= 1)
{
return true;
}
return false;
}
//Obter tarefas do dia
public List<Tarefas> ObterTarefasPorData(string data)
{
//Chamar conexao
Connection();
//Instanciando lista
List<Tarefas> TarefasList = new List<Tarefas>();
//Usando a procedure
using (SqlCommand command = new SqlCommand("SelecionarTarefaPorData", _con))
{
command.CommandType = System.Data.CommandType.StoredProcedure;
_con.Open();
command.Parameters.AddWithValue("@dataLimite", data);
//Verifica na tabela os registros (instancia do método ExecuteReader)
SqlDataReader reader = command.ExecuteReader();
//Condição enquanto reader esta lendo trazendo cada linha
while (reader.Read())
{
Tarefas tarefa = new Tarefas()
{
//Convertendo para inteiro o conteudo de reader no campo id e passando para variavel id
id = Convert.ToInt32(reader["id"]),
nome = Convert.ToString(reader["nome"]),
dataCadastro = Convert.ToString(reader["dataCadastro"]),
dataLimite = Convert.ToString(reader["dataLimite"])
};
//Adicionando o objeto tarefa na lista TarefasList
TarefasList.Add(tarefa);
}
_con.Close();
return TarefasList;
}
}
}
} | 33.130233 | 111 | 0.540643 | [
"MIT"
] | karolinagb/sgta | aplicacao/sgta/sgta/Repositorio/TarefaRepositorio.cs | 7,140 | C# |
namespace SharpSfv
{
public enum SfvLineType
{
Key = 0,
Comment = 1
}
}
| 11.222222 | 27 | 0.49505 | [
"MIT"
] | jzebedee/sharpsfv | src/SharpSfv/SfvLineType.cs | 103 | C# |
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// Do not remove this, it is needed to retain calls to these conditional methods in release builds
#define DEBUG
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
using System.Threading;
namespace System.Diagnostics
{
/// <summary>
/// Provides a set of properties and methods for debugging code.
/// </summary>
public static partial class Debug
{
private static volatile DebugProvider s_provider = new DebugProvider();
public static DebugProvider SetProvider(DebugProvider provider)
{
if (provider == null)
throw new ArgumentNullException(nameof(provider));
return Interlocked.Exchange(ref s_provider, provider);
}
public static bool AutoFlush
{
get => true;
set { }
}
[ThreadStatic]
private static int t_indentLevel;
public static int IndentLevel
{
get => t_indentLevel;
set
{
t_indentLevel = value < 0 ? 0 : value;
s_provider.OnIndentLevelChanged(t_indentLevel);
}
}
private static volatile int s_indentSize = 4;
public static int IndentSize
{
get => s_indentSize;
set
{
s_indentSize = value < 0 ? 0 : value;
s_provider.OnIndentSizeChanged(s_indentSize);
}
}
[System.Diagnostics.Conditional("DEBUG")]
public static void Close() { }
[System.Diagnostics.Conditional("DEBUG")]
public static void Flush() { }
[System.Diagnostics.Conditional("DEBUG")]
public static void Indent() => IndentLevel++;
[System.Diagnostics.Conditional("DEBUG")]
public static void Unindent() => IndentLevel--;
[System.Diagnostics.Conditional("DEBUG")]
public static void Print(string? message) => WriteLine(message);
[System.Diagnostics.Conditional("DEBUG")]
public static void Print(string format, params object?[] args) =>
WriteLine(string.Format(null, format, args));
[System.Diagnostics.Conditional("DEBUG")]
public static void Assert([DoesNotReturnIf(false)] bool condition) =>
Assert(condition, string.Empty, string.Empty);
[System.Diagnostics.Conditional("DEBUG")]
public static void Assert([DoesNotReturnIf(false)] bool condition, string? message) =>
Assert(condition, message, string.Empty);
[System.Diagnostics.Conditional("DEBUG")]
public static void Assert(
[DoesNotReturnIf(false)] bool condition,
string? message,
string? detailMessage
)
{
if (!condition)
{
Fail(message, detailMessage);
}
}
internal static void ContractFailure(
string message,
string detailMessage,
string failureKindMessage
)
{
string stackTrace;
try
{
stackTrace = new StackTrace(2, true).ToString(
System.Diagnostics.StackTrace.TraceFormat.Normal
);
}
catch
{
stackTrace = "";
}
s_provider.WriteAssert(stackTrace, message, detailMessage);
DebugProvider.FailCore(stackTrace, message, detailMessage, failureKindMessage);
}
[System.Diagnostics.Conditional("DEBUG")]
[DoesNotReturn]
public static void Fail(string? message) => Fail(message, string.Empty);
[System.Diagnostics.Conditional("DEBUG")]
[DoesNotReturn]
[MethodImpl(MethodImplOptions.NoInlining)] // Preserve the frame for debugger
public static void Fail(string? message, string? detailMessage) =>
s_provider.Fail(message, detailMessage);
[System.Diagnostics.Conditional("DEBUG")]
public static void Assert(
[DoesNotReturnIf(false)] bool condition,
string? message,
string detailMessageFormat,
params object?[] args
) => Assert(condition, message, string.Format(detailMessageFormat, args));
[System.Diagnostics.Conditional("DEBUG")]
public static void WriteLine(string? message) => s_provider.WriteLine(message);
[System.Diagnostics.Conditional("DEBUG")]
public static void Write(string? message) => s_provider.Write(message);
[System.Diagnostics.Conditional("DEBUG")]
public static void WriteLine(object? value) => WriteLine(value?.ToString());
[System.Diagnostics.Conditional("DEBUG")]
public static void WriteLine(object? value, string? category) =>
WriteLine(value?.ToString(), category);
[System.Diagnostics.Conditional("DEBUG")]
public static void WriteLine(string format, params object?[] args) =>
WriteLine(string.Format(null, format, args));
[System.Diagnostics.Conditional("DEBUG")]
public static void WriteLine(string? message, string? category)
{
if (category == null)
{
WriteLine(message);
}
else
{
WriteLine(category + ": " + message);
}
}
[System.Diagnostics.Conditional("DEBUG")]
public static void Write(object? value) => Write(value?.ToString());
[System.Diagnostics.Conditional("DEBUG")]
public static void Write(string? message, string? category)
{
if (category == null)
{
Write(message);
}
else
{
Write(category + ": " + message);
}
}
[System.Diagnostics.Conditional("DEBUG")]
public static void Write(object? value, string? category) =>
Write(value?.ToString(), category);
[System.Diagnostics.Conditional("DEBUG")]
public static void WriteIf(bool condition, string? message)
{
if (condition)
{
Write(message);
}
}
[System.Diagnostics.Conditional("DEBUG")]
public static void WriteIf(bool condition, object? value)
{
if (condition)
{
Write(value);
}
}
[System.Diagnostics.Conditional("DEBUG")]
public static void WriteIf(bool condition, string? message, string? category)
{
if (condition)
{
Write(message, category);
}
}
[System.Diagnostics.Conditional("DEBUG")]
public static void WriteIf(bool condition, object? value, string? category)
{
if (condition)
{
Write(value, category);
}
}
[System.Diagnostics.Conditional("DEBUG")]
public static void WriteLineIf(bool condition, object? value)
{
if (condition)
{
WriteLine(value);
}
}
[System.Diagnostics.Conditional("DEBUG")]
public static void WriteLineIf(bool condition, object? value, string? category)
{
if (condition)
{
WriteLine(value, category);
}
}
[System.Diagnostics.Conditional("DEBUG")]
public static void WriteLineIf(bool condition, string? message)
{
if (condition)
{
WriteLine(message);
}
}
[System.Diagnostics.Conditional("DEBUG")]
public static void WriteLineIf(bool condition, string? message, string? category)
{
if (condition)
{
WriteLine(message, category);
}
}
}
}
| 31.355212 | 98 | 0.559906 | [
"MIT"
] | belav/runtime | src/libraries/System.Private.CoreLib/src/System/Diagnostics/Debug.cs | 8,121 | C# |
#if NET20 || NET30 || NET35
namespace System
{
public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, in T10, in T11, in T12, in T13, in T14, in T15, in T16, out TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14, T15 arg15, T16 arg16);
}
#endif | 47.75 | 323 | 0.662304 | [
"MIT",
"Unlicense"
] | qwertie/Theraot | Core/System/Func17.net35.cs | 384 | 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 redshift-2012-12-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.Redshift.Model
{
/// <summary>
/// Describes a reserved node. You can call the <a>DescribeReservedNodeOfferings</a> API
/// to obtain the available reserved node offerings.
/// </summary>
public partial class ReservedNode
{
private string _currencyCode;
private int? _duration;
private double? _fixedPrice;
private int? _nodeCount;
private string _nodeType;
private string _offeringType;
private List<RecurringCharge> _recurringCharges = new List<RecurringCharge>();
private string _reservedNodeId;
private string _reservedNodeOfferingId;
private ReservedNodeOfferingType _reservedNodeOfferingType;
private DateTime? _startTime;
private string _state;
private double? _usagePrice;
/// <summary>
/// Gets and sets the property CurrencyCode.
/// <para>
/// The currency code for the reserved cluster.
/// </para>
/// </summary>
public string CurrencyCode
{
get { return this._currencyCode; }
set { this._currencyCode = value; }
}
// Check to see if CurrencyCode property is set
internal bool IsSetCurrencyCode()
{
return this._currencyCode != null;
}
/// <summary>
/// Gets and sets the property Duration.
/// <para>
/// The duration of the node reservation in seconds.
/// </para>
/// </summary>
public int Duration
{
get { return this._duration.GetValueOrDefault(); }
set { this._duration = value; }
}
// Check to see if Duration property is set
internal bool IsSetDuration()
{
return this._duration.HasValue;
}
/// <summary>
/// Gets and sets the property FixedPrice.
/// <para>
/// The fixed cost Amazon Redshift charges you for this reserved node.
/// </para>
/// </summary>
public double FixedPrice
{
get { return this._fixedPrice.GetValueOrDefault(); }
set { this._fixedPrice = value; }
}
// Check to see if FixedPrice property is set
internal bool IsSetFixedPrice()
{
return this._fixedPrice.HasValue;
}
/// <summary>
/// Gets and sets the property NodeCount.
/// <para>
/// The number of reserved compute nodes.
/// </para>
/// </summary>
public int NodeCount
{
get { return this._nodeCount.GetValueOrDefault(); }
set { this._nodeCount = value; }
}
// Check to see if NodeCount property is set
internal bool IsSetNodeCount()
{
return this._nodeCount.HasValue;
}
/// <summary>
/// Gets and sets the property NodeType.
/// <para>
/// The node type of the reserved node.
/// </para>
/// </summary>
public string NodeType
{
get { return this._nodeType; }
set { this._nodeType = value; }
}
// Check to see if NodeType property is set
internal bool IsSetNodeType()
{
return this._nodeType != null;
}
/// <summary>
/// Gets and sets the property OfferingType.
/// <para>
/// The anticipated utilization of the reserved node, as defined in the reserved node
/// offering.
/// </para>
/// </summary>
public string OfferingType
{
get { return this._offeringType; }
set { this._offeringType = value; }
}
// Check to see if OfferingType property is set
internal bool IsSetOfferingType()
{
return this._offeringType != null;
}
/// <summary>
/// Gets and sets the property RecurringCharges.
/// <para>
/// The recurring charges for the reserved node.
/// </para>
/// </summary>
public List<RecurringCharge> RecurringCharges
{
get { return this._recurringCharges; }
set { this._recurringCharges = value; }
}
// Check to see if RecurringCharges property is set
internal bool IsSetRecurringCharges()
{
return this._recurringCharges != null && this._recurringCharges.Count > 0;
}
/// <summary>
/// Gets and sets the property ReservedNodeId.
/// <para>
/// The unique identifier for the reservation.
/// </para>
/// </summary>
public string ReservedNodeId
{
get { return this._reservedNodeId; }
set { this._reservedNodeId = value; }
}
// Check to see if ReservedNodeId property is set
internal bool IsSetReservedNodeId()
{
return this._reservedNodeId != null;
}
/// <summary>
/// Gets and sets the property ReservedNodeOfferingId.
/// <para>
/// The identifier for the reserved node offering.
/// </para>
/// </summary>
public string ReservedNodeOfferingId
{
get { return this._reservedNodeOfferingId; }
set { this._reservedNodeOfferingId = value; }
}
// Check to see if ReservedNodeOfferingId property is set
internal bool IsSetReservedNodeOfferingId()
{
return this._reservedNodeOfferingId != null;
}
/// <summary>
/// Gets and sets the property ReservedNodeOfferingType.
/// </summary>
public ReservedNodeOfferingType ReservedNodeOfferingType
{
get { return this._reservedNodeOfferingType; }
set { this._reservedNodeOfferingType = value; }
}
// Check to see if ReservedNodeOfferingType property is set
internal bool IsSetReservedNodeOfferingType()
{
return this._reservedNodeOfferingType != null;
}
/// <summary>
/// Gets and sets the property StartTime.
/// <para>
/// The time the reservation started. You purchase a reserved node offering for a duration.
/// This is the start time of that duration.
/// </para>
/// </summary>
public DateTime StartTime
{
get { return this._startTime.GetValueOrDefault(); }
set { this._startTime = value; }
}
// Check to see if StartTime property is set
internal bool IsSetStartTime()
{
return this._startTime.HasValue;
}
/// <summary>
/// Gets and sets the property State.
/// <para>
/// The state of the reserved compute node.
/// </para>
///
/// <para>
/// Possible Values:
/// </para>
/// <ul> <li>
/// <para>
/// pending-payment-This reserved node has recently been purchased, and the sale has been
/// approved, but payment has not yet been confirmed.
/// </para>
/// </li> <li>
/// <para>
/// active-This reserved node is owned by the caller and is available for use.
/// </para>
/// </li> <li>
/// <para>
/// payment-failed-Payment failed for the purchase attempt.
/// </para>
/// </li> </ul>
/// </summary>
public string State
{
get { return this._state; }
set { this._state = value; }
}
// Check to see if State property is set
internal bool IsSetState()
{
return this._state != null;
}
/// <summary>
/// Gets and sets the property UsagePrice.
/// <para>
/// The hourly rate Amazon Redshift charges you for this reserved node.
/// </para>
/// </summary>
public double UsagePrice
{
get { return this._usagePrice.GetValueOrDefault(); }
set { this._usagePrice = value; }
}
// Check to see if UsagePrice property is set
internal bool IsSetUsagePrice()
{
return this._usagePrice.HasValue;
}
}
} | 30.65894 | 106 | 0.556972 | [
"Apache-2.0"
] | HaiNguyenMediaStep/aws-sdk-net | sdk/src/Services/Redshift/Generated/Model/ReservedNode.cs | 9,259 | C# |
using System.IO;
using Aspose.Cells;
namespace Aspose.Cells.Examples.CSharp.RowsColumns.Grouping
{
public class GroupingRowsAndColumns
{
public static void Run()
{
// ExStart:1
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
// Creating a file stream containing the Excel file to be opened
FileStream fstream = new FileStream(dataDir + "book1.xls", FileMode.Open);
// Instantiating a Workbook object
// Opening the Excel file through the file stream
Workbook workbook = new Workbook(fstream);
// Accessing the first worksheet in the Excel file
Worksheet worksheet = workbook.Worksheets[0];
// Grouping first six rows (from 0 to 5) and making them hidden by passing true
worksheet.Cells.GroupRows(0, 5, true);
// Grouping first three columns (from 0 to 2) and making them hidden by passing true
worksheet.Cells.GroupColumns(0, 2, true);
// Saving the modified Excel file
workbook.Save(dataDir + "output.xls");
// Closing the file stream to free all resources
fstream.Close();
// ExEnd:1
}
}
}
| 32.738095 | 115 | 0.613091 | [
"MIT"
] | Aspose/Aspose.Cells-for-.NET | Examples/CSharp/RowsColumns/Grouping/GroupingRowsAndColumns.cs | 1,375 | C# |
using SmartAccounting.EventBus;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
namespace SmartAccounting.EventLog
{
public interface IEventLogService
{
Task SaveEventAsync(IntegrationEvent @event);
Task MarkEventAsPublishedAsync(Guid eventId);
Task MarkEventAsInProgressAsync(Guid eventId);
Task MarkEventAsFailedAsync(Guid eventId);
}
public class EventLogService : IEventLogService
{
private readonly EventLogContext _integrationEventLogContext;
private readonly List<Type> _eventTypes;
public EventLogService(EventLogContext integrationEventLogContext)
{
_integrationEventLogContext = integrationEventLogContext;
_eventTypes = Assembly.Load(Assembly.GetEntryAssembly().FullName)
.GetTypes()
.Where(t => t.Name.EndsWith(nameof(IntegrationEvent)))
.ToList();
}
public Task SaveEventAsync(IntegrationEvent @event)
{
var eventLogEntry = new IntegrationEventLogEntry(@event);
_integrationEventLogContext.IntegrationEventLogs.Add(eventLogEntry);
return _integrationEventLogContext.SaveChangesAsync();
}
public Task MarkEventAsPublishedAsync(Guid eventId)
{
return UpdateEventStatus(eventId, EventState.Published);
}
public Task MarkEventAsInProgressAsync(Guid eventId)
{
return UpdateEventStatus(eventId, EventState.InProgress);
}
public Task MarkEventAsFailedAsync(Guid eventId)
{
return UpdateEventStatus(eventId, EventState.PublishedFailed);
}
private Task UpdateEventStatus(Guid eventId, EventState status)
{
var eventLogEntry = _integrationEventLogContext.IntegrationEventLogs.Single(ie => ie.EventId == eventId);
eventLogEntry.State = status;
if (status == EventState.InProgress)
eventLogEntry.TimesSent++;
_integrationEventLogContext.IntegrationEventLogs.Update(eventLogEntry);
return _integrationEventLogContext.SaveChangesAsync();
}
}
}
| 32.855072 | 117 | 0.676224 | [
"MIT"
] | Daniel-Krzyczkowski/Smart-Accounting | src/smart-accounting-backend-services/src/BuildingBlocks/SmartAccounting.EventLog/EventLogService.cs | 2,269 | C# |
using System.Collections;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using BenchmarkDotNet.Attributes;
namespace Alice
{
[MemoryDiagnoser]
[RPlotExporter, RankColumn, AsciiDocExporter, MarkdownExporter]
public class AliceBenchTask
{
private static string AliceFilename = "Alice's_Adventures_in_Wonderland.txt";
private static string text;
private Regex dotnetRegex;
private Regex dotnetRegexNoCompile;
private IronRure.Regex rustRegex;
private IronRure.Regex rustRegexUnicode;
#if IncludeRe2
private IronRe2.Regex re2Regex;
#endif
[GlobalSetup]
public void GlobalSetup()
{
text = File.ReadAllText(AliceFilename, Encoding.UTF8);
InitializeRegex();
}
[Params(
@"\b(\w+)-legged",
//@"Alice",
//@"^Alice",
//@"Alice$",
//@"\d+",
//@"a[^x]{20}b",
//@"\w+@\w+.\w+",
//"\"[^\"]+\"",
//"\"[^\"]{0,30}[?!.]\"",
//"\"[^\"]+\"\\s+said",
//@"(\*\s+){4}\*",
//@"[a-q][^u-z]{13}x",
@"[a-zA-Z]+ing",
@"Alice|Adventure",
//@"Alice|Hatter|Cheshire|Dinah",
@".{0,3}(Alice|Hatter|Cheshire|Dinah)",
//@"zqj",
//@"aei",
//"(?i)the",
//"^.{16,20}$",
//".+",
//"(?s).+",
"Alice.{0,25}Hatter|Hatter.{0,25}Alice",
"([A-Za-z]lice|[A-Za-z]heshire)[^a-zA-Z]"
//".*"
)]
public string Pattern;
//[IterationSetup]
public void InitializeRegex()
{
dotnetRegex = new Regex(
Pattern,
RegexOptions.IgnoreCase | RegexOptions.Compiled);
dotnetRegexNoCompile = new Regex(
Pattern,
RegexOptions.IgnoreCase);
#if IncludeRe2
re2Regex = new IronRe2.Regex(Pattern, new IronRe2.Options { CaseSensitive = false });
#endif
rustRegex = new IronRure.Regex(Pattern, IronRure.RureFlags.Casei);
rustRegexUnicode = new IronRure.Regex(Pattern, IronRure.RureFlags.Casei | IronRure.RureFlags.Unicode);
}
[Benchmark(Baseline = true)]
public void DotnetRegex() => dotnetRegex.Matches(text).EnsureEnumerated();
[Benchmark]
public void DotnetRegexNoCompile() => dotnetRegexNoCompile.Matches(text).EnsureEnumerated();
#if IncludeRe2
[Benchmark]
public void Re2Regex() => re2Regex.FindAll(text).EnsureEnumerated();
#endif
[Benchmark]
public void RustRegex() => rustRegex.FindAll(text).EnsureEnumerated();
[Benchmark]
public void RustRegexUnicode() => rustRegexUnicode.FindAll(text).EnsureEnumerated();
}
public static class Extensions
{
public static void EnsureEnumerated(this IEnumerable e)
{
if (e != null)
{
foreach (var item in e) { }
}
}
}
}
| 28.851852 | 114 | 0.528883 | [
"MIT"
] | iwillspeak/IronRure | bench/Alice/AliceBenchTask.cs | 3,118 | C# |
// ------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
// ------------------------------------------------------------------------------
// **NOTE** This file was generated by a tool and any changes will be overwritten.
// <auto-generated/>
// Template Source: IEntityRequest.cs.tt
namespace Microsoft.Graph
{
using System;
using System.IO;
using System.Net.Http;
using System.Threading;
using System.Linq.Expressions;
/// <summary>
/// The interface IAndroidGeneralDeviceConfigurationRequest.
/// </summary>
public partial interface IAndroidGeneralDeviceConfigurationRequest : IBaseRequest
{
/// <summary>
/// Creates the specified AndroidGeneralDeviceConfiguration using POST.
/// </summary>
/// <param name="androidGeneralDeviceConfigurationToCreate">The AndroidGeneralDeviceConfiguration to create.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
/// <returns>The created AndroidGeneralDeviceConfiguration.</returns>
System.Threading.Tasks.Task<AndroidGeneralDeviceConfiguration> CreateAsync(AndroidGeneralDeviceConfiguration androidGeneralDeviceConfigurationToCreate, CancellationToken cancellationToken = default);
/// <summary>
/// Creates the specified AndroidGeneralDeviceConfiguration using POST and returns a <see cref="GraphResponse{AndroidGeneralDeviceConfiguration}"/> object.
/// </summary>
/// <param name="androidGeneralDeviceConfigurationToCreate">The AndroidGeneralDeviceConfiguration to create.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
/// <returns>The <see cref="GraphResponse{AndroidGeneralDeviceConfiguration}"/> object of the request.</returns>
System.Threading.Tasks.Task<GraphResponse<AndroidGeneralDeviceConfiguration>> CreateResponseAsync(AndroidGeneralDeviceConfiguration androidGeneralDeviceConfigurationToCreate, CancellationToken cancellationToken = default);
/// <summary>
/// Deletes the specified AndroidGeneralDeviceConfiguration.
/// </summary>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
/// <returns>The task to await.</returns>
System.Threading.Tasks.Task DeleteAsync(CancellationToken cancellationToken = default);
/// <summary>
/// Deletes the specified AndroidGeneralDeviceConfiguration and returns a <see cref="GraphResponse"/> object.
/// </summary>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
/// <returns>The task of <see cref="GraphResponse"/> to await.</returns>
System.Threading.Tasks.Task<GraphResponse> DeleteResponseAsync(CancellationToken cancellationToken = default);
/// <summary>
/// Gets the specified AndroidGeneralDeviceConfiguration.
/// </summary>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
/// <returns>The AndroidGeneralDeviceConfiguration.</returns>
System.Threading.Tasks.Task<AndroidGeneralDeviceConfiguration> GetAsync(CancellationToken cancellationToken = default);
/// <summary>
/// Gets the specified AndroidGeneralDeviceConfiguration and returns a <see cref="GraphResponse{AndroidGeneralDeviceConfiguration}"/> object.
/// </summary>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
/// <returns>The <see cref="GraphResponse{AndroidGeneralDeviceConfiguration}"/> object of the request.</returns>
System.Threading.Tasks.Task<GraphResponse<AndroidGeneralDeviceConfiguration>> GetResponseAsync(CancellationToken cancellationToken = default);
/// <summary>
/// Updates the specified AndroidGeneralDeviceConfiguration using PATCH.
/// </summary>
/// <param name="androidGeneralDeviceConfigurationToUpdate">The AndroidGeneralDeviceConfiguration to update.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
/// <exception cref="ClientException">Thrown when an object returned in a response is used for updating an object in Microsoft Graph.</exception>
/// <returns>The updated AndroidGeneralDeviceConfiguration.</returns>
System.Threading.Tasks.Task<AndroidGeneralDeviceConfiguration> UpdateAsync(AndroidGeneralDeviceConfiguration androidGeneralDeviceConfigurationToUpdate, CancellationToken cancellationToken = default);
/// <summary>
/// Updates the specified AndroidGeneralDeviceConfiguration using PATCH and returns a <see cref="GraphResponse{AndroidGeneralDeviceConfiguration}"/> object.
/// </summary>
/// <param name="androidGeneralDeviceConfigurationToUpdate">The AndroidGeneralDeviceConfiguration to update.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
/// <exception cref="ClientException">Thrown when an object returned in a response is used for updating an object in Microsoft Graph.</exception>
/// <returns>The <see cref="GraphResponse{AndroidGeneralDeviceConfiguration}"/> object of the request.</returns>
System.Threading.Tasks.Task<GraphResponse<AndroidGeneralDeviceConfiguration>> UpdateResponseAsync(AndroidGeneralDeviceConfiguration androidGeneralDeviceConfigurationToUpdate, CancellationToken cancellationToken = default);
/// <summary>
/// Updates the specified AndroidGeneralDeviceConfiguration using PUT.
/// </summary>
/// <param name="androidGeneralDeviceConfigurationToUpdate">The AndroidGeneralDeviceConfiguration object to update.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
/// <returns>The task to await.</returns>
System.Threading.Tasks.Task<AndroidGeneralDeviceConfiguration> PutAsync(AndroidGeneralDeviceConfiguration androidGeneralDeviceConfigurationToUpdate, CancellationToken cancellationToken = default);
/// <summary>
/// Updates the specified AndroidGeneralDeviceConfiguration using PUT and returns a <see cref="GraphResponse{AndroidGeneralDeviceConfiguration}"/> object.
/// </summary>
/// <param name="androidGeneralDeviceConfigurationToUpdate">The AndroidGeneralDeviceConfiguration object to update.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
/// <returns>The task of <see cref="GraphResponse{AndroidGeneralDeviceConfiguration}"/> to await.</returns>
System.Threading.Tasks.Task<GraphResponse<AndroidGeneralDeviceConfiguration>> PutResponseAsync(AndroidGeneralDeviceConfiguration androidGeneralDeviceConfigurationToUpdate, CancellationToken cancellationToken = default);
/// <summary>
/// Adds the specified expand value to the request.
/// </summary>
/// <param name="value">The expand value.</param>
/// <returns>The request object to send.</returns>
IAndroidGeneralDeviceConfigurationRequest Expand(string value);
/// <summary>
/// Adds the specified expand value to the request.
/// </summary>
/// <param name="expandExpression">The expression from which to calculate the expand value.</param>
/// <returns>The request object to send.</returns>
IAndroidGeneralDeviceConfigurationRequest Expand(Expression<Func<AndroidGeneralDeviceConfiguration, object>> expandExpression);
/// <summary>
/// Adds the specified select value to the request.
/// </summary>
/// <param name="value">The select value.</param>
/// <returns>The request object to send.</returns>
IAndroidGeneralDeviceConfigurationRequest Select(string value);
/// <summary>
/// Adds the specified select value to the request.
/// </summary>
/// <param name="selectExpression">The expression from which to calculate the select value.</param>
/// <returns>The request object to send.</returns>
IAndroidGeneralDeviceConfigurationRequest Select(Expression<Func<AndroidGeneralDeviceConfiguration, object>> selectExpression);
}
}
| 65.969466 | 230 | 0.711872 | [
"MIT"
] | Aliases/msgraph-sdk-dotnet | src/Microsoft.Graph/Generated/requests/IAndroidGeneralDeviceConfigurationRequest.cs | 8,642 | C# |
// *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
namespace Pulumi.AzureNative.Media.V20200501.Inputs
{
/// <summary>
/// Describes the properties for producing a series of PNG images from the input video.
/// </summary>
public sealed class PngImageArgs : Pulumi.ResourceArgs
{
/// <summary>
/// The distance between two key frames. The value should be non-zero in the range [0.5, 20] seconds, specified in ISO 8601 format. The default is 2 seconds(PT2S). Note that this setting is ignored if VideoSyncMode.Passthrough is set, where the KeyFrameInterval value will follow the input source setting.
/// </summary>
[Input("keyFrameInterval")]
public Input<string>? KeyFrameInterval { get; set; }
/// <summary>
/// An optional label for the codec. The label can be used to control muxing behavior.
/// </summary>
[Input("label")]
public Input<string>? Label { get; set; }
[Input("layers")]
private InputList<Inputs.PngLayerArgs>? _layers;
/// <summary>
/// A collection of output PNG image layers to be produced by the encoder.
/// </summary>
public InputList<Inputs.PngLayerArgs> Layers
{
get => _layers ?? (_layers = new InputList<Inputs.PngLayerArgs>());
set => _layers = value;
}
/// <summary>
/// The discriminator for derived types.
/// Expected value is '#Microsoft.Media.PngImage'.
/// </summary>
[Input("odataType", required: true)]
public Input<string> OdataType { get; set; } = null!;
/// <summary>
/// The position relative to transform preset start time in the input video at which to stop generating thumbnails. The value can be in ISO 8601 format (For example, PT5M30S to stop at 5 minutes and 30 seconds from start time), or a frame count (For example, 300 to stop at the 300th frame from the frame at start time. If this value is 1, it means only producing one thumbnail at start time), or a relative value to the stream duration (For example, 50% to stop at half of stream duration from start time). The default value is 100%, which means to stop at the end of the stream.
/// </summary>
[Input("range")]
public Input<string>? Range { get; set; }
/// <summary>
/// The position in the input video from where to start generating thumbnails. The value can be in ISO 8601 format (For example, PT05S to start at 5 seconds), or a frame count (For example, 10 to start at the 10th frame), or a relative value to stream duration (For example, 10% to start at 10% of stream duration). Also supports a macro {Best}, which tells the encoder to select the best thumbnail from the first few seconds of the video and will only produce one thumbnail, no matter what other settings are for Step and Range. The default value is macro {Best}.
/// </summary>
[Input("start", required: true)]
public Input<string> Start { get; set; } = null!;
/// <summary>
/// The intervals at which thumbnails are generated. The value can be in ISO 8601 format (For example, PT05S for one image every 5 seconds), or a frame count (For example, 30 for one image every 30 frames), or a relative value to stream duration (For example, 10% for one image every 10% of stream duration). Note: Step value will affect the first generated thumbnail, which may not be exactly the one specified at transform preset start time. This is due to the encoder, which tries to select the best thumbnail between start time and Step position from start time as the first output. As the default value is 10%, it means if stream has long duration, the first generated thumbnail might be far away from the one specified at start time. Try to select reasonable value for Step if the first thumbnail is expected close to start time, or set Range value at 1 if only one thumbnail is needed at start time.
/// </summary>
[Input("step")]
public Input<string>? Step { get; set; }
/// <summary>
/// The resizing mode - how the input video will be resized to fit the desired output resolution(s). Default is AutoSize
/// </summary>
[Input("stretchMode")]
public InputUnion<string, Pulumi.AzureNative.Media.V20200501.StretchMode>? StretchMode { get; set; }
/// <summary>
/// The Video Sync Mode
/// </summary>
[Input("syncMode")]
public InputUnion<string, Pulumi.AzureNative.Media.V20200501.VideoSyncMode>? SyncMode { get; set; }
public PngImageArgs()
{
}
}
}
| 58.72619 | 914 | 0.672208 | [
"Apache-2.0"
] | polivbr/pulumi-azure-native | sdk/dotnet/Media/V20200501/Inputs/PngImageArgs.cs | 4,933 | C# |
using System;
using System.Collections;
using NUnit.Framework;
using OSDP.Net.Messages;
using OSDP.Net.Model.CommandData;
namespace OSDP.Net.Tests.Messages
{
[TestFixture]
public class EncryptionKeySetTestCommand
{
[TestCaseSource(typeof(EncryptionKeySetCommandTestClass), nameof(EncryptionKeySetCommandTestClass.TestCases))]
public string BuildCommand_TestCases(byte address, bool useCrc, bool useSecureChannel)
{
var encryptionKeySetCommand = new EncryptionKeySetCommand(address,
new EncryptionKeyConfiguration(KeyType.SecureChannelBaseKey,
new byte[]
{
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07
}));
var device = new Device(0, useCrc, useSecureChannel, null);
device.MessageControl.IncrementSequence(1);
return BitConverter.ToString(encryptionKeySetCommand.BuildCommand(device));
}
public class EncryptionKeySetCommandTestClass
{
public static IEnumerable TestCases
{
get
{
yield return new TestCaseData((byte) 0x0, true, true).Returns(
"53-00-1C-00-0E-02-17-75-01-10-00-01-02-03-04-05-06-07-00-01-02-03-04-05-06-07-F8-F2");
yield return new TestCaseData((byte) 0x0, true, false).Returns(
"53-00-1A-00-06-75-01-10-00-01-02-03-04-05-06-07-00-01-02-03-04-05-06-07-CF-A3");
yield return new TestCaseData((byte) 0x0, false, false).Returns(
"53-00-19-00-02-75-01-10-00-01-02-03-04-05-06-07-00-01-02-03-04-05-06-07-D4");
}
}
}
}
} | 43.285714 | 118 | 0.589109 | [
"Apache-2.0"
] | IDmachinesOrg/OSDP.Net | src/OSDP.Net.Tests/Messages/EncryptionKeySetCommandTest.cs | 1,818 | C# |
using Lamedal_UIWinForms.UControl.button;
namespace Lamedal_UIWinForms.UControl.UControlTest
{
partial class Form_TestWindowsUControls
{
/// <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()
{
this.button_Standard1 = new Button_Standard();
this.button_1 = new Button_();
this.SuspendLayout();
//
// button_Standard1
//
this.button_Standard1.AccessibleRole = System.Windows.Forms.AccessibleRole.None;
this.button_Standard1.AutoScrollMargin = new System.Drawing.Size(0, 0);
this.button_Standard1.AutoScrollMinSize = new System.Drawing.Size(0, 0);
this.button_Standard1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.button_Standard1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
this.button_Standard1.CausesValidation = false;
this.button_Standard1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.button_Standard1.Location = new System.Drawing.Point(0, 297);
this.button_Standard1.Name = "button_Standard1";
this.button_Standard1.Size = new System.Drawing.Size(437, 30);
this.button_Standard1.TabIndex = 0;
this.button_Standard1.Text_Apply = "&Apply";
this.button_Standard1.Text_Cancel = "&Cancel";
this.button_Standard1.Text_Clipboard = "Copy to Clipboard";
this.button_Standard1.Text_Help = "&Help";
this.button_Standard1.Text_Ok = "&Ok";
this.button_Standard1.Text_Reset = false;
this.button_Standard1.Visible_Apply = false;
this.button_Standard1.Visible_Cancel = true;
this.button_Standard1.Visible_Clipboard = true;
this.button_Standard1.Visible_Help = false;
this.button_Standard1.Visible_Ok = true;
//
// button_1
//
this.button_1.Dock = System.Windows.Forms.DockStyle.Top;
this.button_1.Location = new System.Drawing.Point(0, 0);
this.button_1.Name = "button_1";
this.button_1.Size = new System.Drawing.Size(437, 23);
this.button_1.TabIndex = 1;
this.button_1.Text = "sdsds";
//
// Form_TestWindowsUControls
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(437, 327);
this.Controls.Add(this.button_1);
this.Controls.Add(this.button_Standard1);
this.Name = "Form_TestWindowsUControls";
this.Text = "Form1";
this.ResumeLayout(false);
}
#endregion
private Button_Standard button_Standard1;
private Button_ button_1;
}
} | 41.831461 | 107 | 0.608918 | [
"MIT"
] | LouwrensP/Lamedal_WinForms | src/UControl/UControlTest/Form_TestWindowsUControls.Designer.cs | 3,725 | C# |
using System;
using System.Diagnostics;
using UnityEngine;
public class Gun : MonoBehaviour{
public float damage = 10f;
public float range = 100f;
public float fireRate = 15f;
public float impactForce = 30f;
public Camera fpscamera;
public ParticleSystem muzzleflash;
public GameObject impactEffect;
private float nextTimeToFire = 0f;
// Update is called once per frame
void Update ()
{
if (Input.GetButton("Fire1") && Time.time >= nextTimeToFire)
{
nextTimeToFire = Time.time + 1f / fireRate;
Shoot();
}
}
void Shoot ()
{
muzzleflash.Play();
RaycastHit hit;
if (Physics.Raycast(fpscamera.transform.position, fpscamera.transform.forward, out hit, range))
{
UnityEngine.Debug.Log(hit.transform.name);
Target target = hit.transform.GetComponent<Target>();
if (target != null)
{
target.TakeDamage(damage);
}
if (hit.rigidbody != null)
{
hit.rigidbody.AddForce(-hit.normal * impactForce);
}
GameObject impactGO = Instantiate(impactEffect, hit.point, Quaternion.LookRotation(hit.normal));
Destroy(impactGO, 2f);
}
}
} | 23.839286 | 108 | 0.575281 | [
"MIT"
] | BurkeBlaine1999/Final-Year-Project | Assets/Scripts/Pistol/Gun.cs | 1,335 | C# |
using System;
namespace Wrido.Configuration
{
public interface IAppConfiguration
{
string HotKey { get; }
string ConfigurationFilePath { get; }
string InstallDirectory { get; }
Uri ServerUrl { get; }
}
} | 18.916667 | 41 | 0.682819 | [
"MIT"
] | wrido/wrido | src/Wrido.Core/Configuration/IAppConfiguration.cs | 229 | C# |
// commons-codec version compatibility level: 1.9
using System;
namespace Lucene.Net.Analysis.Phonetic.Language
{
/*
* 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>
/// Encodes a string into a Caverphone value.
/// <para/>
/// This is an algorithm created by the Caversham Project at the University of Otago. It implements the Caverphone 2.0
/// algorithm:
/// <para/>
/// This class is immutable and thread-safe.
/// <para/>
/// See <a href="http://en.wikipedia.org/wiki/Caverphone">Wikipedia - Caverphone</a>
/// </summary>
public abstract class AbstractCaverphone : IStringEncoder
{
/// <summary>
/// Creates an instance of the Caverphone encoder
/// </summary>
protected AbstractCaverphone() // LUCENENET: CA1012: Abstract types should not have constructors (marked protected)
: base()
{
}
// LUCENENET specific - in .NET we don't need an object overload of Encode(), since strings are sealed anyway.
// LUCENENET specific - must provide implementation for IStringEncoder
public abstract string Encode(string source);
/// <summary>
/// Tests if the encodings of two strings are equal.
/// <para/>
/// This method might be promoted to a new AbstractStringEncoder superclass.
/// </summary>
/// <param name="str1">First of two strings to compare.</param>
/// <param name="str2">Second of two strings to compare.</param>
/// <returns><c>true</c> if the encodings of these strings are identical, <c>false</c> otherwise.</returns>
public virtual bool IsEncodeEqual(string str1, string str2)
{
return this.Encode(str1).Equals(this.Encode(str2), StringComparison.Ordinal);
}
}
}
| 42.709677 | 123 | 0.655211 | [
"Apache-2.0"
] | 10088/lucenenet | src/Lucene.Net.Analysis.Phonetic/Language/AbstractCaverphone .cs | 2,650 | C# |
#region Apache License
//
// 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.
//
#endregion
using System;
using System.IO;
using log4net.Config;
using log4net.Core;
using log4net.Layout;
using log4net.Layout.Pattern;
using log4net.Repository;
using log4net.Tests.Appender;
using log4net.Util;
using NUnit.Framework;
using System.Globalization;
namespace log4net.Tests.Layout
{
/// <summary>
/// Used for internal unit testing the <see cref="PatternLayout"/> class.
/// </summary>
/// <remarks>
/// Used for internal unit testing the <see cref="PatternLayout"/> class.
/// </remarks>
[TestFixture]
public class PatternLayoutTest
{
#if !NETSTANDARD1_3
private CultureInfo _currentCulture;
private CultureInfo _currentUICulture;
[SetUp]
public void SetUp()
{
// set correct thread culture
_currentCulture = System.Threading.Thread.CurrentThread.CurrentCulture;
_currentUICulture = System.Threading.Thread.CurrentThread.CurrentUICulture;
System.Threading.Thread.CurrentThread.CurrentCulture = System.Threading.Thread.CurrentThread.CurrentUICulture = System.Globalization.CultureInfo.InvariantCulture;
}
[TearDown]
public void TearDown() {
Utils.RemovePropertyFromAllContexts();
// restore previous culture
System.Threading.Thread.CurrentThread.CurrentCulture = _currentCulture;
System.Threading.Thread.CurrentThread.CurrentUICulture = _currentUICulture;
}
#endif
protected virtual PatternLayout NewPatternLayout() {
return new PatternLayout();
}
protected virtual PatternLayout NewPatternLayout(string pattern) {
return new PatternLayout(pattern);
}
[Test]
public void TestThreadPropertiesPattern()
{
StringAppender stringAppender = new StringAppender();
stringAppender.Layout = NewPatternLayout("%property{" + Utils.PROPERTY_KEY + "}");
ILoggerRepository rep = LogManager.CreateRepository(Guid.NewGuid().ToString());
BasicConfigurator.Configure(rep, stringAppender);
ILog log1 = LogManager.GetLogger(rep.Name, "TestThreadProperiesPattern");
log1.Info("TestMessage");
Assert.AreEqual(SystemInfo.NullText, stringAppender.GetString(), "Test no thread properties value set");
stringAppender.Reset();
ThreadContext.Properties[Utils.PROPERTY_KEY] = "val1";
log1.Info("TestMessage");
Assert.AreEqual("val1", stringAppender.GetString(), "Test thread properties value set");
stringAppender.Reset();
ThreadContext.Properties.Remove(Utils.PROPERTY_KEY);
log1.Info("TestMessage");
Assert.AreEqual(SystemInfo.NullText, stringAppender.GetString(), "Test thread properties value removed");
stringAppender.Reset();
}
#if NETSTANDARD1_3
[Test, Ignore("System.Diagnostics.StackTrace isn't fully implemented on NETSTANDARD1_3")]
#else
[Test]
#endif
public void TestStackTracePattern()
{
StringAppender stringAppender = new StringAppender();
stringAppender.Layout = NewPatternLayout("%stacktrace{2}");
ILoggerRepository rep = LogManager.CreateRepository(Guid.NewGuid().ToString());
BasicConfigurator.Configure(rep, stringAppender);
ILog log1 = LogManager.GetLogger(rep.Name, "TestStackTracePattern");
log1.Info("TestMessage");
StringAssert.EndsWith("PatternLayoutTest.TestStackTracePattern", stringAppender.GetString(), "stack trace value set");
stringAppender.Reset();
}
[Test]
public void TestGlobalPropertiesPattern()
{
StringAppender stringAppender = new StringAppender();
stringAppender.Layout = NewPatternLayout("%property{" + Utils.PROPERTY_KEY + "}");
ILoggerRepository rep = LogManager.CreateRepository(Guid.NewGuid().ToString());
BasicConfigurator.Configure(rep, stringAppender);
ILog log1 = LogManager.GetLogger(rep.Name, "TestGlobalProperiesPattern");
log1.Info("TestMessage");
Assert.AreEqual(SystemInfo.NullText, stringAppender.GetString(), "Test no global properties value set");
stringAppender.Reset();
GlobalContext.Properties[Utils.PROPERTY_KEY] = "val1";
log1.Info("TestMessage");
Assert.AreEqual("val1", stringAppender.GetString(), "Test global properties value set");
stringAppender.Reset();
GlobalContext.Properties.Remove(Utils.PROPERTY_KEY);
log1.Info("TestMessage");
Assert.AreEqual(SystemInfo.NullText, stringAppender.GetString(), "Test global properties value removed");
stringAppender.Reset();
}
[Test]
public void TestAddingCustomPattern()
{
StringAppender stringAppender = new StringAppender();
PatternLayout layout = NewPatternLayout();
layout.AddConverter("TestAddingCustomPattern", typeof(TestMessagePatternConverter));
layout.ConversionPattern = "%TestAddingCustomPattern";
layout.ActivateOptions();
stringAppender.Layout = layout;
ILoggerRepository rep = LogManager.CreateRepository(Guid.NewGuid().ToString());
BasicConfigurator.Configure(rep, stringAppender);
ILog log1 = LogManager.GetLogger(rep.Name, "TestAddingCustomPattern");
log1.Info("TestMessage");
Assert.AreEqual("TestMessage", stringAppender.GetString(), "%TestAddingCustomPattern not registered");
stringAppender.Reset();
}
[Test]
public void NamedPatternConverterWithoutPrecisionShouldReturnFullName()
{
StringAppender stringAppender = new StringAppender();
PatternLayout layout = NewPatternLayout();
layout.AddConverter("message-as-name", typeof(MessageAsNamePatternConverter));
layout.ConversionPattern = "%message-as-name";
layout.ActivateOptions();
stringAppender.Layout = layout;
ILoggerRepository rep = LogManager.CreateRepository(Guid.NewGuid().ToString());
BasicConfigurator.Configure(rep, stringAppender);
ILog log1 = LogManager.GetLogger(rep.Name, "TestAddingCustomPattern");
log1.Info("NoDots");
Assert.AreEqual("NoDots", stringAppender.GetString(), "%message-as-name not registered");
stringAppender.Reset();
log1.Info("One.Dot");
Assert.AreEqual("One.Dot", stringAppender.GetString(), "%message-as-name not registered");
stringAppender.Reset();
log1.Info("Tw.o.Dots");
Assert.AreEqual("Tw.o.Dots", stringAppender.GetString(), "%message-as-name not registered");
stringAppender.Reset();
log1.Info("TrailingDot.");
Assert.AreEqual("TrailingDot.", stringAppender.GetString(), "%message-as-name not registered");
stringAppender.Reset();
log1.Info(".LeadingDot");
Assert.AreEqual(".LeadingDot", stringAppender.GetString(), "%message-as-name not registered");
stringAppender.Reset();
// empty string and other evil combinations as tests for of-by-one mistakes in index calculations
log1.Info(string.Empty);
Assert.AreEqual(string.Empty, stringAppender.GetString(), "%message-as-name not registered");
stringAppender.Reset();
log1.Info(".");
Assert.AreEqual(".", stringAppender.GetString(), "%message-as-name not registered");
stringAppender.Reset();
log1.Info("x");
Assert.AreEqual("x", stringAppender.GetString(), "%message-as-name not registered");
stringAppender.Reset();
}
[Test]
public void NamedPatternConverterWithPrecision1ShouldStripLeadingStuffIfPresent()
{
StringAppender stringAppender = new StringAppender();
PatternLayout layout = NewPatternLayout();
layout.AddConverter("message-as-name", typeof(MessageAsNamePatternConverter));
layout.ConversionPattern = "%message-as-name{1}";
layout.ActivateOptions();
stringAppender.Layout = layout;
ILoggerRepository rep = LogManager.CreateRepository(Guid.NewGuid().ToString());
BasicConfigurator.Configure(rep, stringAppender);
ILog log1 = LogManager.GetLogger(rep.Name, "TestAddingCustomPattern");
log1.Info("NoDots");
Assert.AreEqual("NoDots", stringAppender.GetString(), "%message-as-name not registered");
stringAppender.Reset();
log1.Info("One.Dot");
Assert.AreEqual("Dot", stringAppender.GetString(), "%message-as-name not registered");
stringAppender.Reset();
log1.Info("Tw.o.Dots");
Assert.AreEqual("Dots", stringAppender.GetString(), "%message-as-name not registered");
stringAppender.Reset();
log1.Info("TrailingDot.");
Assert.AreEqual("TrailingDot.", stringAppender.GetString(), "%message-as-name not registered");
stringAppender.Reset();
log1.Info(".LeadingDot");
Assert.AreEqual("LeadingDot", stringAppender.GetString(), "%message-as-name not registered");
stringAppender.Reset();
// empty string and other evil combinations as tests for of-by-one mistakes in index calculations
log1.Info(string.Empty);
Assert.AreEqual(string.Empty, stringAppender.GetString(), "%message-as-name not registered");
stringAppender.Reset();
log1.Info("x");
Assert.AreEqual("x", stringAppender.GetString(), "%message-as-name not registered");
stringAppender.Reset();
log1.Info(".");
Assert.AreEqual(".", stringAppender.GetString(), "%message-as-name not registered");
stringAppender.Reset();
}
[Test]
public void NamedPatternConverterWithPrecision2ShouldStripLessLeadingStuffIfPresent() {
StringAppender stringAppender = new StringAppender();
PatternLayout layout = NewPatternLayout();
layout.AddConverter("message-as-name", typeof(MessageAsNamePatternConverter));
layout.ConversionPattern = "%message-as-name{2}";
layout.ActivateOptions();
stringAppender.Layout = layout;
ILoggerRepository rep = LogManager.CreateRepository(Guid.NewGuid().ToString());
BasicConfigurator.Configure(rep, stringAppender);
ILog log1 = LogManager.GetLogger(rep.Name, "TestAddingCustomPattern");
log1.Info("NoDots");
Assert.AreEqual("NoDots", stringAppender.GetString(), "%message-as-name not registered");
stringAppender.Reset();
log1.Info("One.Dot");
Assert.AreEqual("One.Dot", stringAppender.GetString(), "%message-as-name not registered");
stringAppender.Reset();
log1.Info("Tw.o.Dots");
Assert.AreEqual("o.Dots", stringAppender.GetString(), "%message-as-name not registered");
stringAppender.Reset();
log1.Info("TrailingDot.");
Assert.AreEqual("TrailingDot.", stringAppender.GetString(), "%message-as-name not registered");
stringAppender.Reset();
log1.Info(".LeadingDot");
Assert.AreEqual("LeadingDot", stringAppender.GetString(), "%message-as-name not registered");
stringAppender.Reset();
// empty string and other evil combinations as tests for of-by-one mistakes in index calculations
log1.Info(string.Empty);
Assert.AreEqual(string.Empty, stringAppender.GetString(), "%message-as-name not registered");
stringAppender.Reset();
log1.Info("x");
Assert.AreEqual("x", stringAppender.GetString(), "%message-as-name not registered");
stringAppender.Reset();
log1.Info(".");
Assert.AreEqual(".", stringAppender.GetString(), "%message-as-name not registered");
stringAppender.Reset();
}
/// <summary>
/// Converter to include event message
/// </summary>
private class TestMessagePatternConverter : PatternLayoutConverter
{
/// <summary>
/// Convert the pattern to the rendered message
/// </summary>
/// <param name="writer"><see cref="TextWriter" /> that will receive the formatted result.</param>
/// <param name="loggingEvent">the event being logged</param>
/// <returns>the relevant location information</returns>
protected override void Convert(TextWriter writer, LoggingEvent loggingEvent)
{
loggingEvent.WriteRenderedMessage(writer);
}
}
[Test]
public void TestExceptionPattern()
{
StringAppender stringAppender = new StringAppender();
PatternLayout layout = NewPatternLayout("%exception{stacktrace}");
stringAppender.Layout = layout;
ILoggerRepository rep = LogManager.CreateRepository(Guid.NewGuid().ToString());
BasicConfigurator.Configure(rep, stringAppender);
ILog log1 = LogManager.GetLogger(rep.Name, "TestExceptionPattern");
Exception exception = new Exception("Oh no!");
log1.Info("TestMessage", exception);
Assert.AreEqual(SystemInfo.NullText, stringAppender.GetString());
stringAppender.Reset();
}
private class MessageAsNamePatternConverter : NamedPatternConverter
{
protected override string GetFullyQualifiedName(LoggingEvent loggingEvent)
{
return loggingEvent.MessageObject.ToString();
}
}
}
} | 39.437326 | 165 | 0.678133 | [
"Apache-2.0"
] | BUTTER-Tools/log4net-2.0.8 | tests/src/Layout/PatternLayoutTest.cs | 14,158 | C# |
using System;
using TotaMoviesRental.Core.Repositories;
namespace TotaMoviesRental.Core
{
public interface IUnitOfWork : IDisposable
{
ICustomerRepository Customers { get; }
IMovieRepository Movies { get; }
IGenreRepository Genres { get; }
IMembershipTypeRepository MembershipTypes { get; }
IRentalRepository Rentals { get; }
void Complete();
}
}
| 25.5625 | 58 | 0.677262 | [
"MIT"
] | massina/Tota-Movies-Rental | TotaMoviesRental/TotaMoviesRental/Core/IUnitOfWork.cs | 411 | C# |
using System.Reflection;
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("CrossingSequences")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CrossingSequences")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("ea492de6-638c-41d1-8274-c4d41a123502")]
// 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")]
| 37.861111 | 84 | 0.746148 | [
"MIT"
] | pirocorp/Programming-Basics | ProblemsChampions/CrossingSequences/Properties/AssemblyInfo.cs | 1,366 | C# |
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.Remoting;
using Mono.Cecil;
using Mono.Cecil.Mdb;
using Mono.Cecil.Pdb;
using Mono.Cecil.Rocks;
using FieldAttributes = Mono.Cecil.FieldAttributes;
using TypeAttributes = Mono.Cecil.TypeAttributes;
public partial class InnerWeaver : MarshalByRefObject, IInnerWeaver
{
public string ProjectDirectoryPath { get; set; }
public string AssemblyFilePath { get; set; }
public string SolutionDirectoryPath { get; set; }
public string References { get; set; }
public List<WeaverEntry> Weavers { get; set; }
public string KeyFilePath { get; set; }
public bool SignAssembly { get; set; }
public ILogger Logger { get; set; }
public string IntermediateDirectoryPath { get; set; }
public List<string> ReferenceCopyLocalPaths { get; set; }
public List<string> DefineConstants { get; set; }
public bool DebugSymbols { get; set; }
bool cancelRequested;
List<WeaverHolder> weaverInstances = new List<WeaverHolder>();
Action cancelDelegate;
public IAssemblyResolver assemblyResolver;
Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
{
var assemblyName = new AssemblyName(args.Name).Name;
if (assemblyName == "Mono.Cecil")
{
return typeof(ModuleDefinition).Assembly;
}
if (assemblyName == "Mono.Cecil.Rocks")
{
return typeof(MethodBodyRocks).Assembly;
}
if (assemblyName == "Mono.Cecil.Pdb")
{
return typeof(PdbReaderProvider).Assembly;
}
if (assemblyName == "Mono.Cecil.Mdb")
{
return typeof(MdbReaderProvider).Assembly;
}
foreach (var weaverPath in Weavers.Select(x => x.AssemblyPath))
{
var directoryName = Path.GetDirectoryName(weaverPath);
var assemblyFileName = assemblyName + ".dll";
var assemblyPath = Path.Combine(directoryName, assemblyFileName);
if (!File.Exists(assemblyPath))
{
continue;
}
try
{
return LoadFromFile(assemblyPath);
}
catch (Exception exception)
{
var message = $"Failed to load '{assemblyPath}'. Going to swallow and continue to let other AssemblyResolve events to attempt to resolve. Exception:{exception}";
Logger.LogWarning(message);
}
}
return null;
}
public void Execute()
{
ResolveEventHandler assemblyResolve = CurrentDomain_AssemblyResolve;
try
{
SplitUpReferences();
GetSymbolProviders();
assemblyResolver = new AssemblyResolver(ReferenceDictionary, Logger, SplitReferences);
ReadModule();
AppDomain.CurrentDomain.AssemblyResolve += assemblyResolve;
InitialiseWeavers();
ExecuteWeavers();
AddWeavingInfo();
FindStrongNameKey();
WriteModule();
ModuleDefinition?.Dispose();
SymbolStream?.Dispose();
ExecuteAfterWeavers();
DisposeWeavers();
}
catch (Exception exception)
{
AppDomain.CurrentDomain.AssemblyResolve -= assemblyResolve;
Logger.LogException(exception);
}
finally
{
ModuleDefinition?.Dispose();
SymbolStream?.Dispose();
assemblyResolver?.Dispose();
}
}
public void Cancel()
{
cancelRequested = true;
var action = cancelDelegate;
action?.Invoke();
}
void InitialiseWeavers()
{
foreach (var weaverConfig in Weavers)
{
if (cancelRequested)
{
return;
}
Logger.LogDebug($"Weaver '{weaverConfig.AssemblyPath}'.");
Logger.LogDebug(" Initializing weaver");
var assembly = LoadAssembly(weaverConfig.AssemblyPath);
VerifyMinCecilVersion(assembly);
var weaverType = assembly.FindType(weaverConfig.TypeName);
var delegateHolder = weaverType.GetDelegateHolderFromCache();
var weaverInstance = delegateHolder.ConstructInstance();
var weaverHolder = new WeaverHolder
{
Instance = weaverInstance,
WeaverDelegate = delegateHolder,
Config = weaverConfig
};
weaverInstances.Add(weaverHolder);
SetProperties(weaverConfig, weaverInstance, delegateHolder);
}
}
void VerifyMinCecilVersion(Assembly assembly)
{
var cecilReference = assembly.GetReferencedAssemblies()
.SingleOrDefault(x => x.Name == "Mono.Cecil");
if (cecilReference == null)
{
throw new WeavingException($"Expected the weaver '{assembly}' to reference Mono.Cecil.dll. {GetNugetError()}");
}
var minCecilVersion = new Version(0, 10);
if (cecilReference.Version < minCecilVersion)
{
throw new WeavingException($"The weaver assembly '{assembly}' references an out of date version of Mono.Cecil.dll (cecilReference.Version). At least version {minCecilVersion} is expected. {GetNugetError()}");
}
}
string GetNugetError()
{
return $"The weaver needs to add a NuGet reference to FodyCecil version {GetType().Assembly.GetName().Version.Major}.0.";
}
void ExecuteWeavers()
{
foreach (var weaver in weaverInstances)
{
if (cancelRequested)
{
return;
}
try
{
if (weaver.WeaverDelegate.Cancel != null)
{
cancelDelegate = () => weaver.WeaverDelegate.Cancel(weaver.Instance);
}
Logger.SetCurrentWeaverName(weaver.Config.AssemblyName);
var startNew = Stopwatch.StartNew();
Logger.LogDebug(" Executing Weaver ");
weaver.WeaverDelegate.Execute(weaver.Instance);
var finishedMessage = $" Finished '{weaver.Config.AssemblyName}' in {startNew.ElapsedMilliseconds}ms {Environment.NewLine}";
Logger.LogDebug(finishedMessage);
}
finally
{
cancelDelegate = null;
Logger.ClearWeaverName();
}
}
}
void AddWeavingInfo()
{
if (cancelRequested)
{
return;
}
Logger.LogDebug(" Adding weaving info");
var startNew = Stopwatch.StartNew();
var typeDefinition = new TypeDefinition(null, "ProcessedByFody", TypeAttributes.NotPublic | TypeAttributes.Class, ModuleDefinition.TypeSystem.Object);
ModuleDefinition.Types.Add(typeDefinition);
AddVersionField(typeof(IInnerWeaver).Assembly.Location, "FodyVersion", typeDefinition);
foreach (var weaver in weaverInstances)
{
var configAssemblyPath = weaver.Config.AssemblyPath;
var name = weaver.Config.AssemblyName.Replace(".", string.Empty);
AddVersionField(configAssemblyPath, name, typeDefinition);
}
var finishedMessage = $" Finished in {startNew.ElapsedMilliseconds}ms {Environment.NewLine}";
Logger.LogDebug(finishedMessage);
}
void AddVersionField(string configAssemblyPath, string name, TypeDefinition typeDefinition)
{
var weaverVersion = FileVersionInfo.GetVersionInfo(configAssemblyPath);
var fieldAttributes = FieldAttributes.Assembly | FieldAttributes.Literal | FieldAttributes.Static | FieldAttributes.HasDefault;
var systemString = ModuleDefinition.TypeSystem.String;
var field = new FieldDefinition(name, fieldAttributes, systemString)
{
Constant = weaverVersion.FileVersion
};
typeDefinition.Fields.Add(field);
}
void ExecuteAfterWeavers()
{
foreach (var weaver in weaverInstances
.Where(_ => _.WeaverDelegate.AfterWeavingExecute != null))
{
if (cancelRequested)
{
return;
}
try
{
Logger.SetCurrentWeaverName(weaver.Config.AssemblyName);
var startNew = Stopwatch.StartNew();
Logger.LogDebug(" Executing After Weaver");
weaver.WeaverDelegate.AfterWeavingExecute(weaver.Instance);
var finishedMessage = $" Finished '{weaver.Config.AssemblyName}' in {startNew.ElapsedMilliseconds}ms {Environment.NewLine}";
Logger.LogDebug(finishedMessage);
}
finally
{
Logger.ClearWeaverName();
}
}
}
void DisposeWeavers()
{
foreach (var disposable in weaverInstances
.Select(x => x.Instance)
.OfType<IDisposable>())
{
disposable.Dispose();
}
}
public sealed override object InitializeLifetimeService()
{
// Returning null designates an infinite non-expiring lease.
// We must therefore ensure that RemotingServices.Disconnect() is called when
// it's no longer needed otherwise there will be a memory leak.
return null;
}
public void Dispose()
{
//Disconnects the remoting channel(s) of this object and all nested objects.
RemotingServices.Disconnect(this);
}
} | 34.79078 | 220 | 0.596575 | [
"MIT"
] | LaudateCorpus1/Fody | FodyIsolated/InnerWeaver.cs | 9,811 | C# |
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.3053
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
// Copyright (c) 2007-2008
// Available under the terms of the
// Eclipse Public License with GPL exception
// See enclosed license file for more information
namespace PhysX.NET
{
using System;
using System.Runtime.InteropServices;
public class NxCapsuleController : NxController
{
internal NxCapsuleController(IntPtr ptr) :
base(ptr)
{
}
/// <summary></summary>
protected NxCapsuleController() :
base(IntPtr.Zero)
{
if ((GetType() != typeof(NxCapsuleController)))
{
doSetFunctionPointers = true;
SetPointer(new_NxCapsuleController_INVOKE(doSetFunctionPointers));
System.IntPtr[] pointers = CreateFunctionPointers().ToArray();
set_pointers_INVOKE(ClassPointer, pointers, pointers.Length);
}
else
{
SetPointer(new_NxCapsuleController_INVOKE(doSetFunctionPointers));
}
GC.ReRegisterForFinalize(this);
}
/// <summary>Gets controller's radius. </summary>
public virtual float getRadius()
{
if (doSetFunctionPointers)
{
throw new System.NotSupportedException("Cannot call abstract base member");
}
return NxCapsuleController_getRadius_INVOKE(ClassPointer, doSetFunctionPointers);
}
private float getRadius_virtual()
{
return getRadius();
}
delegate float getRadius_0_delegate();
private getRadius_0_delegate getRadius_0_delegatefield;
/// <summary>Sets controller's radius. </summary>
/// <param name="radius">The new radius for the controller. </param>
public virtual bool setRadius(float radius)
{
if (doSetFunctionPointers)
{
throw new System.NotSupportedException("Cannot call abstract base member");
}
return NxCapsuleController_setRadius_INVOKE(ClassPointer, doSetFunctionPointers, radius);
}
private bool setRadius_virtual(float radius)
{
return setRadius(radius);
}
delegate bool setRadius_1_delegate(float radius);
private setRadius_1_delegate setRadius_1_delegatefield;
/// <summary>Gets controller's height. </summary>
public virtual float getHeight()
{
if (doSetFunctionPointers)
{
throw new System.NotSupportedException("Cannot call abstract base member");
}
return NxCapsuleController_getHeight_INVOKE(ClassPointer, doSetFunctionPointers);
}
private float getHeight_virtual()
{
return getHeight();
}
delegate float getHeight_2_delegate();
private getHeight_2_delegate getHeight_2_delegatefield;
/// <summary>Gets controller's climbing mode. </summary>
public virtual NxCapsuleClimbingMode getClimbingMode()
{
if (doSetFunctionPointers)
{
throw new System.NotSupportedException("Cannot call abstract base member");
}
return NxCapsuleController_getClimbingMode_INVOKE(ClassPointer, doSetFunctionPointers);
}
private NxCapsuleClimbingMode getClimbingMode_virtual()
{
return getClimbingMode();
}
delegate NxCapsuleClimbingMode getClimbingMode_3_delegate();
private getClimbingMode_3_delegate getClimbingMode_3_delegatefield;
/// <summary>Resets controller's height. </summary>
/// <param name="height">The new height for the controller. </param>
public virtual bool setHeight(float height)
{
if (doSetFunctionPointers)
{
throw new System.NotSupportedException("Cannot call abstract base member");
}
return NxCapsuleController_setHeight_INVOKE(ClassPointer, doSetFunctionPointers, height);
}
private bool setHeight_virtual(float height)
{
return setHeight(height);
}
delegate bool setHeight_4_delegate(float height);
private setHeight_4_delegate setHeight_4_delegatefield;
/// <summary>Sets the step height/offset for the controller. </summary>
/// <param name="offset">The new step offset.</param>
public override void setStepOffset(float offset)
{
if (doSetFunctionPointers)
{
throw new System.NotSupportedException("Cannot call abstract base member");
}
NxCapsuleController_setStepOffset_INVOKE(ClassPointer, doSetFunctionPointers, offset);
}
private void setStepOffset_virtual(float offset)
{
setStepOffset(offset);
}
delegate void setStepOffset_5_delegate(float offset);
private setStepOffset_5_delegate setStepOffset_5_delegatefield;
/// <summary>Sets controller's climbing mode. </summary>
/// <param name="mode">The capsule controller's climbing mode.</param>
public virtual bool setClimbingMode(NxCapsuleClimbingMode mode)
{
if (doSetFunctionPointers)
{
throw new System.NotSupportedException("Cannot call abstract base member");
}
return NxCapsuleController_setClimbingMode_INVOKE(ClassPointer, doSetFunctionPointers, mode);
}
private bool setClimbingMode_virtual(NxCapsuleClimbingMode mode)
{
return setClimbingMode(mode);
}
delegate bool setClimbingMode_6_delegate(NxCapsuleClimbingMode mode);
private setClimbingMode_6_delegate setClimbingMode_6_delegatefield;
/// <summary>The character controller uses caching in order to speed up collision testing, this caching can not detect when static objects have changed in the scene. You need to call this method when such changes have been made. </summary>
public override void reportSceneChanged()
{
if (doSetFunctionPointers)
{
throw new System.NotSupportedException("Cannot call abstract base member");
}
NxCapsuleController_reportSceneChanged_INVOKE(ClassPointer, doSetFunctionPointers);
}
private void reportSceneChanged_virtual()
{
reportSceneChanged();
}
delegate void reportSceneChanged_7_delegate();
private reportSceneChanged_7_delegate reportSceneChanged_7_delegatefield;
#region Imports
[System.Security.SuppressUnmanagedCodeSecurity()]
[DllImport(NATIVE_LIBRARY, EntryPoint="new_NxCapsuleController")]
private extern static IntPtr new_NxCapsuleController_INVOKE (System.Boolean do_override);
[System.Security.SuppressUnmanagedCodeSecurity()]
[DllImport(NATIVE_LIBRARY, EntryPoint="NxCapsuleController_getRadius")]
private extern static System.Single NxCapsuleController_getRadius_INVOKE (HandleRef classPointer, System.Boolean call_explicit);
[System.Security.SuppressUnmanagedCodeSecurity()]
[DllImport(NATIVE_LIBRARY, EntryPoint="NxCapsuleController_setRadius")]
private extern static System.Boolean NxCapsuleController_setRadius_INVOKE (HandleRef classPointer, System.Boolean call_explicit, System.Single radius);
[System.Security.SuppressUnmanagedCodeSecurity()]
[DllImport(NATIVE_LIBRARY, EntryPoint="NxCapsuleController_getHeight")]
private extern static System.Single NxCapsuleController_getHeight_INVOKE (HandleRef classPointer, System.Boolean call_explicit);
[System.Security.SuppressUnmanagedCodeSecurity()]
[DllImport(NATIVE_LIBRARY, EntryPoint="NxCapsuleController_getClimbingMode")]
private extern static NxCapsuleClimbingMode NxCapsuleController_getClimbingMode_INVOKE (HandleRef classPointer, System.Boolean call_explicit);
[System.Security.SuppressUnmanagedCodeSecurity()]
[DllImport(NATIVE_LIBRARY, EntryPoint="NxCapsuleController_setHeight")]
private extern static System.Boolean NxCapsuleController_setHeight_INVOKE (HandleRef classPointer, System.Boolean call_explicit, System.Single height);
[System.Security.SuppressUnmanagedCodeSecurity()]
[DllImport(NATIVE_LIBRARY, EntryPoint="NxCapsuleController_setStepOffset")]
private extern static void NxCapsuleController_setStepOffset_INVOKE (HandleRef classPointer, System.Boolean call_explicit, System.Single offset);
[System.Security.SuppressUnmanagedCodeSecurity()]
[DllImport(NATIVE_LIBRARY, EntryPoint="NxCapsuleController_setClimbingMode")]
private extern static System.Boolean NxCapsuleController_setClimbingMode_INVOKE (HandleRef classPointer, System.Boolean call_explicit, NxCapsuleClimbingMode mode);
[System.Security.SuppressUnmanagedCodeSecurity()]
[DllImport(NATIVE_LIBRARY, EntryPoint="NxCapsuleController_reportSceneChanged")]
private extern static void NxCapsuleController_reportSceneChanged_INVOKE (HandleRef classPointer, System.Boolean call_explicit);
#endregion
private static System.Collections.Generic.Dictionary<System.IntPtr, System.WeakReference> database = new System.Collections.Generic.Dictionary<System.IntPtr, System.WeakReference>();
protected override void SetPointer(IntPtr ptr)
{
base.SetPointer(ptr);
database[ptr] = new WeakReference(this);
}
public override void Dispose()
{
database.Remove(ClassPointer.Handle);
base.Dispose();
}
public static NxCapsuleController GetClass(IntPtr ptr)
{
if ((ptr == IntPtr.Zero))
{
return null;
}
System.WeakReference obj;
if (database.TryGetValue(ptr, out obj))
{
if (obj.IsAlive)
{
return ((NxCapsuleController)(obj.Target));
}
}
return new NxCapsuleController(ptr);
}
protected override System.Collections.Generic.List<System.IntPtr> CreateFunctionPointers()
{
System.Collections.Generic.List<System.IntPtr> list = base.CreateFunctionPointers();
getRadius_0_delegatefield = new getRadius_0_delegate(this.getRadius_virtual);
list.Add(Marshal.GetFunctionPointerForDelegate(getRadius_0_delegatefield));
setRadius_1_delegatefield = new setRadius_1_delegate(this.setRadius_virtual);
list.Add(Marshal.GetFunctionPointerForDelegate(setRadius_1_delegatefield));
getHeight_2_delegatefield = new getHeight_2_delegate(this.getHeight_virtual);
list.Add(Marshal.GetFunctionPointerForDelegate(getHeight_2_delegatefield));
getClimbingMode_3_delegatefield = new getClimbingMode_3_delegate(this.getClimbingMode_virtual);
list.Add(Marshal.GetFunctionPointerForDelegate(getClimbingMode_3_delegatefield));
setHeight_4_delegatefield = new setHeight_4_delegate(this.setHeight_virtual);
list.Add(Marshal.GetFunctionPointerForDelegate(setHeight_4_delegatefield));
setStepOffset_5_delegatefield = new setStepOffset_5_delegate(this.setStepOffset_virtual);
list.Add(Marshal.GetFunctionPointerForDelegate(setStepOffset_5_delegatefield));
setClimbingMode_6_delegatefield = new setClimbingMode_6_delegate(this.setClimbingMode_virtual);
list.Add(Marshal.GetFunctionPointerForDelegate(setClimbingMode_6_delegatefield));
reportSceneChanged_7_delegatefield = new reportSceneChanged_7_delegate(this.reportSceneChanged_virtual);
list.Add(Marshal.GetFunctionPointerForDelegate(reportSceneChanged_7_delegatefield));
return list;
}
}
}
| 33.30814 | 242 | 0.726654 | [
"MIT"
] | d3x0r/xperdex | games/PhysX.NET/NxCapsuleController.cs | 11,458 | C# |
#pragma warning disable 108 // new keyword hiding
#pragma warning disable 114 // new keyword hiding
namespace Windows.Media.Miracast
{
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __MACOS__
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __MACOS__
[global::Uno.NotImplemented]
#endif
public enum MiracastReceiverWiFiStatus
{
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __MACOS__
MiracastSupportUndetermined,
#endif
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __MACOS__
MiracastNotSupported,
#endif
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __MACOS__
MiracastSupportNotOptimized,
#endif
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __MACOS__
MiracastSupported,
#endif
}
#endif
}
| 29.115385 | 63 | 0.719947 | [
"Apache-2.0"
] | JTOne123/uno | src/Uno.UWP/Generated/3.0.0.0/Windows.Media.Miracast/MiracastReceiverWiFiStatus.cs | 757 | C# |
using UnityEngine;
using System.Collections;
using System;
using UnityEngine.UI;
namespace Crowd
{
//POpulation is Declared in Population manager
public class FactoryWorld : MonoBehaviour
{
//--//
// [SerializeField]
//public bool isPopulationReadyToExport;
//bool bPreviousStateOfPopulationReadyToExport;
//--//
void Awake()
{
Application.runInBackground = true;
Global.gameState = Global.GameStateType.GAME_INITIALIZING;
gameObject.AddComponent<Global>();
//bPreviousStateOfPopulationReadyToExport = isPopulationReadyToExport;
//-----//
//if (Application.isEditor)//Returns true if the game is being run from the Unity editor; false if run from any deployment target.
// Global.gameMode = Global.GameModeType.EDIT_MODE;
//else
// Global.gameMode = Global.GameModeType.PRODUCTION_MODE;
}
//--//
void Start() {
if (Application.isPlaying)
{
gameObject.AddComponent<CitizenFactory>();//Para adicionar Markov Template
CitizenFactory citizens = GetComponent<CitizenFactory>();
//Se estiver em PRODUCAO
//Load data to Citizen Factory.
if (!Application.isEditor)
{
XMLLoader xml = new XMLLoader();
xml.LoadItems();
}
//Cria populacao
CitizenFactory.qtGajosBeginingPopulation = CitizenFactory.quantity_Production;
citizens.start();
}
}
//void Update()
//{
// Debug.Log(Time.time + " --------------------- Previous " + bPreviousStateOfPopulationReadyToExport + " Actual " + isPopulationReadyToExport);
//}
//void OnGUI()
//{
// if (Application.isEditor)// && PlayerPrefs.GetInt("EditorMode") == 0)
// {
// // Make a background box
// // GUI.Box(new Rect(10, 10, 200, 90), "Population Manager", "Top-Left");
// GUI.Box(new Rect(20, 10, 200, 80), "Population Manager");
// if (GUI.Button(new Rect(30, 40, 180, 20), "Reactivate Edition Mode"))
// {
// reactivatePopulationManager();
// Debug.Log("Clickou em reactivate");
// }
// }
//}
//#if UNITY_EDITOR
// private void RefreshAssets()
// {
// UnityEditor.AssetDatabase.Refresh();
// }
// private void OnValidate()
// {
// Debug.Log("OnValidate" + Time.time + " > " + isPopulationReadyToExport);
// Debug.Log("FactoryWorld OnValidate(): CitizenFactory.quantity_Production: " + CitizenFactory.quantity_Production);
//// if (Application.isEditor)
//// {
// Debug.Log(Time.time + " Previous " + bPreviousStateOfPopulationReadyToExport + " Actual " + isPopulationReadyToExport);
// Debug.Log(CitizenFactory.quantity_Production);
// if (bPreviousStateOfPopulationReadyToExport != isPopulationReadyToExport)
// {
// if (isPopulationReadyToExport)
// {
// disablePopulationManager();
// }
// else
// {
// enablePopulationManager();
// }
// bPreviousStateOfPopulationReadyToExport = isPopulationReadyToExport;
// RefreshAssets();
// }
//// }
// }//OnValidate
//#endif
//void enablePopulationManager()
//{
// string destinationDirectory = Application.dataPath + "/Actors/Easy-Population/CrowdScripts/gajo/XEditor";
// string sourceDirectory = Application.dataPath + "/Actors/Easy-Population/CrowdScripts/gajo/Editor";
// moveFiles(sourceDirectory, destinationDirectory);
//}//reactivate
//void disablePopulationManager()
//{
// ShippingHandler.PrepareShipping();
// string destinationDirectory = Application.dataPath + "/Actors/Easy-Population/CrowdScripts/gajo/Editor";
// string sourceDirectory = Application.dataPath + "/Actors/Easy-Population/CrowdScripts/gajo/XEditor";
// moveFiles(sourceDirectory, destinationDirectory);
//}//disable
//void moveFiles(string source, string dest)
//{
// try
// {
// if (System.IO.Directory.Exists(source))
// {
// if (System.IO.Directory.Exists(dest))
// System.IO.Directory.Delete(dest);
// System.IO.Directory.Move(source, dest);
// if (System.IO.Directory.Exists(source))
// System.IO.Directory.Delete(source);
// }
// else
// {
// Debug.Log("FactoryWorld: MoveFiles: Origin folder não existe!");
// }
// }
// catch (Exception e)
// {
// Debug.LogException(e);
// }
//}//move files
}//class
}//namespace
| 36.939189 | 155 | 0.515091 | [
"BSD-3-Clause"
] | vishrantgupta/Virtual-Reality-Oculus-Rift | Assets/EasyPopulation-Core/CrowdScripts/FactoryWorld.cs | 5,470 | C# |
using System;
using Umbraco.Core.Configuration;
using Umbraco.Core.Logging;
using Umbraco.Core.Persistence.SqlSyntax;
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSix
{
[Migration("6.0.0", 9, Constants.System.UmbracoMigrationName)]
public class EnsureAppsTreesUpdated : MigrationBase
{
public EnsureAppsTreesUpdated(ISqlSyntaxProvider sqlSyntax, ILogger logger) : base(sqlSyntax, logger)
{
}
public override void Up()
{
var e = new UpgradingEventArgs();
if (Upgrading != null)
Upgrading(this, e);
}
public override void Down()
{
}
public static event EventHandler<UpgradingEventArgs> Upgrading;
public class UpgradingEventArgs : EventArgs{}
}
} | 27.354839 | 110 | 0.630896 | [
"MIT"
] | Abhith/Umbraco-CMS | src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSix/EnsureAppsTreesUpdated.cs | 850 | C# |
// <copyright file="INumeric.cs" company="Shkyrockett" >
// Copyright © 2020 - 2021 Shkyrockett. All rights reserved.
// </copyright>
// <author id="shkyrockett">Shkyrockett</author>
// <license>
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
// </license>
// <summary></summary>
// <remarks>
// </remarks>
using System;
namespace MathematicsNotationLibrary;
/// <summary>
///
/// </summary>
public interface INumeric
: IExpression, INegatable, IFactor
{
/// <summary>
/// Gets or sets the value.
/// </summary>
/// <value>
/// The value.
/// </value>
public double Value { get; set; }
/// <summary>
/// Gets or sets the sign of the number.
/// </summary>
/// <value>
/// The sign.
/// </value>
public new int Sign { get => Math.Sign(Value); set => Value = (Math.Sign(Value) == Math.Sign(value)) ? Value : -Value; }
}
| 24.921053 | 124 | 0.605069 | [
"MIT"
] | Shkyrockett/Primer | Source/MathematicsNotationLibrary/Syntax/Interfaces/Attributes/Factors/INumeric.cs | 950 | C# |
namespace HouseManager.Services.Data.Models
{
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using HouseManager.Data.Models;
using Microsoft.AspNetCore.Mvc.Rendering;
public class CreatePropertyServiceModel
{
[Required]
[MinLength(2)]
[MaxLength(20)]
public string Name { get; set; }
[Required]
public string PropertyType { get; set; }
[Range(0, 20)]
public int ResidentsCount { get; set; }
public int PropertyCount { get; set; }
[Required]
[Display(Name ="Месечни такси")]
public ICollection<string> Fee { get; set; }
public SelectList Fees { get; set; }
public IEnumerable<SelectListItem> PropertyTypes { get; set; }
}
}
| 25.09375 | 70 | 0.62391 | [
"MIT"
] | JDzhambazov/HouseManager | Services/HouseManager.Services.Data/Models/CreatePropertyServiceModel.cs | 817 | C# |
using System;
using System.Collections.Generic;
using UnityEngine;
namespace WritersFlock
{
public enum MessageType
{
Connect,
Entry,
Vote,
Restart,
Quit,
Ready,
Wait
}
public class Message
{
public string messageTitle;
public MessageType messageType;
}
[Serializable]
public class ClientToServerMessage : Message
{
public string playerName;
public string message;
public ClientToServerMessage () { }
public ClientToServerMessage (MessageType messageType, string messageTitle, string message, string playerName)
{
this.messageType = messageType;
this.messageTitle = messageTitle;
this.message = message;
this.playerName = playerName;
}
public static ClientToServerMessage CreateFromJSON (string json)
{
return JsonUtility.FromJson<ClientToServerMessage>(json);
}
public string SaveJSON ()
{
return JsonUtility.ToJson(this);
}
}
[Serializable]
public class ServerToClientMessage : Message
{
public List<string> message;
public int numberOfWritingRounds;
public ServerToClientMessage () { }
public ServerToClientMessage (MessageType messageType, string messageTitle, List<string> message)
{
this.messageType = messageType;
this.messageTitle = messageTitle;
this.message = message;
}
public ServerToClientMessage (MessageType messageType, string messageTitle, List<string> message, int rounds)
{
this.messageType = messageType;
this.messageTitle = messageTitle;
this.message = message;
this.numberOfWritingRounds = rounds;
}
public static ClientToServerMessage CreateFromJSON (string json)
{
return JsonUtility.FromJson<ClientToServerMessage>(json);
}
public string SaveJSON ()
{
return JsonUtility.ToJson(this);
}
}
}
| 25.05814 | 118 | 0.606032 | [
"MIT"
] | TheConBot/GGJ2018 | WF-Root/WF-Server/Assets/Scripts/Message.cs | 2,157 | C# |
// 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.
// Generated code. DO NOT EDIT!
namespace Google.Apis.CloudTalentSolution.v4
{
/// <summary>The CloudTalentSolution Service.</summary>
public class CloudTalentSolutionService : Google.Apis.Services.BaseClientService
{
/// <summary>The API version.</summary>
public const string Version = "v4";
/// <summary>The discovery version used to generate this service.</summary>
public static Google.Apis.Discovery.DiscoveryVersion DiscoveryVersionUsed = Google.Apis.Discovery.DiscoveryVersion.Version_1_0;
/// <summary>Constructs a new service.</summary>
public CloudTalentSolutionService() : this(new Google.Apis.Services.BaseClientService.Initializer())
{
}
/// <summary>Constructs a new service.</summary>
/// <param name="initializer">The service initializer.</param>
public CloudTalentSolutionService(Google.Apis.Services.BaseClientService.Initializer initializer) : base(initializer)
{
Projects = new ProjectsResource(this);
}
/// <summary>Gets the service supported features.</summary>
public override System.Collections.Generic.IList<string> Features => new string[0];
/// <summary>Gets the service name.</summary>
public override string Name => "jobs";
/// <summary>Gets the service base URI.</summary>
public override string BaseUri =>
#if NETSTANDARD1_3 || NETSTANDARD2_0 || NET45
BaseUriOverride ?? "https://jobs.googleapis.com/";
#else
"https://jobs.googleapis.com/";
#endif
/// <summary>Gets the service base path.</summary>
public override string BasePath => "";
#if !NET40
/// <summary>Gets the batch base URI; <c>null</c> if unspecified.</summary>
public override string BatchUri => "https://jobs.googleapis.com/batch";
/// <summary>Gets the batch base path; <c>null</c> if unspecified.</summary>
public override string BatchPath => "batch";
#endif
/// <summary>Available OAuth 2.0 scopes for use with the Cloud Talent Solution API.</summary>
public class Scope
{
/// <summary>View and manage your data across Google Cloud Platform services</summary>
public static string CloudPlatform = "https://www.googleapis.com/auth/cloud-platform";
/// <summary>Manage job postings</summary>
public static string Jobs = "https://www.googleapis.com/auth/jobs";
}
/// <summary>Available OAuth 2.0 scope constants for use with the Cloud Talent Solution API.</summary>
public static class ScopeConstants
{
/// <summary>View and manage your data across Google Cloud Platform services</summary>
public const string CloudPlatform = "https://www.googleapis.com/auth/cloud-platform";
/// <summary>Manage job postings</summary>
public const string Jobs = "https://www.googleapis.com/auth/jobs";
}
/// <summary>Gets the Projects resource.</summary>
public virtual ProjectsResource Projects { get; }
}
/// <summary>A base abstract class for CloudTalentSolution requests.</summary>
public abstract class CloudTalentSolutionBaseServiceRequest<TResponse> : Google.Apis.Requests.ClientServiceRequest<TResponse>
{
/// <summary>Constructs a new CloudTalentSolutionBaseServiceRequest instance.</summary>
protected CloudTalentSolutionBaseServiceRequest(Google.Apis.Services.IClientService service) : base(service)
{
}
/// <summary>V1 error format.</summary>
[Google.Apis.Util.RequestParameterAttribute("$.xgafv", Google.Apis.Util.RequestParameterType.Query)]
public virtual System.Nullable<XgafvEnum> Xgafv { get; set; }
/// <summary>V1 error format.</summary>
public enum XgafvEnum
{
/// <summary>v1 error format</summary>
[Google.Apis.Util.StringValueAttribute("1")]
Value1,
/// <summary>v2 error format</summary>
[Google.Apis.Util.StringValueAttribute("2")]
Value2,
}
/// <summary>OAuth access token.</summary>
[Google.Apis.Util.RequestParameterAttribute("access_token", Google.Apis.Util.RequestParameterType.Query)]
public virtual string AccessToken { get; set; }
/// <summary>Data format for response.</summary>
[Google.Apis.Util.RequestParameterAttribute("alt", Google.Apis.Util.RequestParameterType.Query)]
public virtual System.Nullable<AltEnum> Alt { get; set; }
/// <summary>Data format for response.</summary>
public enum AltEnum
{
/// <summary>Responses with Content-Type of application/json</summary>
[Google.Apis.Util.StringValueAttribute("json")]
Json,
/// <summary>Media download with context-dependent Content-Type</summary>
[Google.Apis.Util.StringValueAttribute("media")]
Media,
/// <summary>Responses with Content-Type of application/x-protobuf</summary>
[Google.Apis.Util.StringValueAttribute("proto")]
Proto,
}
/// <summary>JSONP</summary>
[Google.Apis.Util.RequestParameterAttribute("callback", Google.Apis.Util.RequestParameterType.Query)]
public virtual string Callback { get; set; }
/// <summary>Selector specifying which fields to include in a partial response.</summary>
[Google.Apis.Util.RequestParameterAttribute("fields", Google.Apis.Util.RequestParameterType.Query)]
public virtual string Fields { get; set; }
/// <summary>API key. Your API key identifies your project and provides you with API access, quota, and reports.
/// Required unless you provide an OAuth 2.0 token.</summary>
[Google.Apis.Util.RequestParameterAttribute("key", Google.Apis.Util.RequestParameterType.Query)]
public virtual string Key { get; set; }
/// <summary>OAuth 2.0 token for the current user.</summary>
[Google.Apis.Util.RequestParameterAttribute("oauth_token", Google.Apis.Util.RequestParameterType.Query)]
public virtual string OauthToken { get; set; }
/// <summary>Returns response with indentations and line breaks.</summary>
[Google.Apis.Util.RequestParameterAttribute("prettyPrint", Google.Apis.Util.RequestParameterType.Query)]
public virtual System.Nullable<bool> PrettyPrint { get; set; }
/// <summary>Available to use for quota purposes for server-side applications. Can be any arbitrary string
/// assigned to a user, but should not exceed 40 characters.</summary>
[Google.Apis.Util.RequestParameterAttribute("quotaUser", Google.Apis.Util.RequestParameterType.Query)]
public virtual string QuotaUser { get; set; }
/// <summary>Legacy upload protocol for media (e.g. "media", "multipart").</summary>
[Google.Apis.Util.RequestParameterAttribute("uploadType", Google.Apis.Util.RequestParameterType.Query)]
public virtual string UploadType { get; set; }
/// <summary>Upload protocol for media (e.g. "raw", "multipart").</summary>
[Google.Apis.Util.RequestParameterAttribute("upload_protocol", Google.Apis.Util.RequestParameterType.Query)]
public virtual string UploadProtocol { get; set; }
/// <summary>Initializes CloudTalentSolution parameter list.</summary>
protected override void InitParameters()
{
base.InitParameters();
RequestParameters.Add("$.xgafv", new Google.Apis.Discovery.Parameter
{
Name = "$.xgafv",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
RequestParameters.Add("access_token", new Google.Apis.Discovery.Parameter
{
Name = "access_token",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
RequestParameters.Add("alt", new Google.Apis.Discovery.Parameter
{
Name = "alt",
IsRequired = false,
ParameterType = "query",
DefaultValue = "json",
Pattern = null,
});
RequestParameters.Add("callback", new Google.Apis.Discovery.Parameter
{
Name = "callback",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
RequestParameters.Add("fields", new Google.Apis.Discovery.Parameter
{
Name = "fields",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
RequestParameters.Add("key", new Google.Apis.Discovery.Parameter
{
Name = "key",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
RequestParameters.Add("oauth_token", new Google.Apis.Discovery.Parameter
{
Name = "oauth_token",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
RequestParameters.Add("prettyPrint", new Google.Apis.Discovery.Parameter
{
Name = "prettyPrint",
IsRequired = false,
ParameterType = "query",
DefaultValue = "true",
Pattern = null,
});
RequestParameters.Add("quotaUser", new Google.Apis.Discovery.Parameter
{
Name = "quotaUser",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
RequestParameters.Add("uploadType", new Google.Apis.Discovery.Parameter
{
Name = "uploadType",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
RequestParameters.Add("upload_protocol", new Google.Apis.Discovery.Parameter
{
Name = "upload_protocol",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
}
}
/// <summary>The "projects" collection of methods.</summary>
public class ProjectsResource
{
private const string Resource = "projects";
/// <summary>The service which this resource belongs to.</summary>
private readonly Google.Apis.Services.IClientService service;
/// <summary>Constructs a new resource.</summary>
public ProjectsResource(Google.Apis.Services.IClientService service)
{
this.service = service;
Tenants = new TenantsResource(service);
}
/// <summary>Gets the Tenants resource.</summary>
public virtual TenantsResource Tenants { get; }
/// <summary>The "tenants" collection of methods.</summary>
public class TenantsResource
{
private const string Resource = "tenants";
/// <summary>The service which this resource belongs to.</summary>
private readonly Google.Apis.Services.IClientService service;
/// <summary>Constructs a new resource.</summary>
public TenantsResource(Google.Apis.Services.IClientService service)
{
this.service = service;
ClientEvents = new ClientEventsResource(service);
Companies = new CompaniesResource(service);
Jobs = new JobsResource(service);
}
/// <summary>Gets the ClientEvents resource.</summary>
public virtual ClientEventsResource ClientEvents { get; }
/// <summary>The "clientEvents" collection of methods.</summary>
public class ClientEventsResource
{
private const string Resource = "clientEvents";
/// <summary>The service which this resource belongs to.</summary>
private readonly Google.Apis.Services.IClientService service;
/// <summary>Constructs a new resource.</summary>
public ClientEventsResource(Google.Apis.Services.IClientService service)
{
this.service = service;
}
/// <summary>Report events issued when end user interacts with customer's application that uses Cloud
/// Talent Solution. You may inspect the created events in [self service
/// tools](https://console.cloud.google.com/talent-solution/overview). [Learn
/// more](https://cloud.google.com/talent-solution/docs/management-tools) about self service
/// tools.</summary>
/// <param name="body">The body of the request.</param>
/// <param name="parent">Required. Resource name of the tenant under which the event is created. The format is
/// "projects/{project_id}/tenants/{tenant_id}", for example, "projects/foo/tenants/bar".</param>
public virtual CreateRequest Create(Google.Apis.CloudTalentSolution.v4.Data.ClientEvent body, string parent)
{
return new CreateRequest(service, body, parent);
}
/// <summary>Report events issued when end user interacts with customer's application that uses Cloud
/// Talent Solution. You may inspect the created events in [self service
/// tools](https://console.cloud.google.com/talent-solution/overview). [Learn
/// more](https://cloud.google.com/talent-solution/docs/management-tools) about self service
/// tools.</summary>
public class CreateRequest : CloudTalentSolutionBaseServiceRequest<Google.Apis.CloudTalentSolution.v4.Data.ClientEvent>
{
/// <summary>Constructs a new Create request.</summary>
public CreateRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudTalentSolution.v4.Data.ClientEvent body, string parent) : base(service)
{
Parent = parent;
Body = body;
InitParameters();
}
/// <summary>Required. Resource name of the tenant under which the event is created. The format is
/// "projects/{project_id}/tenants/{tenant_id}", for example, "projects/foo/tenants/bar".</summary>
[Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)]
public virtual string Parent { get; private set; }
/// <summary>Gets or sets the body of this request.</summary>
Google.Apis.CloudTalentSolution.v4.Data.ClientEvent Body { get; set; }
/// <summary>Returns the body of the request.</summary>
protected override object GetBody() => Body;
/// <summary>Gets the method name.</summary>
public override string MethodName => "create";
/// <summary>Gets the HTTP method.</summary>
public override string HttpMethod => "POST";
/// <summary>Gets the REST path.</summary>
public override string RestPath => "v4/{+parent}/clientEvents";
/// <summary>Initializes Create parameter list.</summary>
protected override void InitParameters()
{
base.InitParameters();
RequestParameters.Add("parent", new Google.Apis.Discovery.Parameter
{
Name = "parent",
IsRequired = true,
ParameterType = "path",
DefaultValue = null,
Pattern = @"^projects/[^/]+/tenants/[^/]+$",
});
}
}
}
/// <summary>Gets the Companies resource.</summary>
public virtual CompaniesResource Companies { get; }
/// <summary>The "companies" collection of methods.</summary>
public class CompaniesResource
{
private const string Resource = "companies";
/// <summary>The service which this resource belongs to.</summary>
private readonly Google.Apis.Services.IClientService service;
/// <summary>Constructs a new resource.</summary>
public CompaniesResource(Google.Apis.Services.IClientService service)
{
this.service = service;
}
/// <summary>Creates a new company entity.</summary>
/// <param name="body">The body of the request.</param>
/// <param name="parent">Required. Resource name of the tenant under which the company is created. The format is
/// "projects/{project_id}/tenants/{tenant_id}", for example, "projects/foo/tenants/bar".</param>
public virtual CreateRequest Create(Google.Apis.CloudTalentSolution.v4.Data.Company body, string parent)
{
return new CreateRequest(service, body, parent);
}
/// <summary>Creates a new company entity.</summary>
public class CreateRequest : CloudTalentSolutionBaseServiceRequest<Google.Apis.CloudTalentSolution.v4.Data.Company>
{
/// <summary>Constructs a new Create request.</summary>
public CreateRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudTalentSolution.v4.Data.Company body, string parent) : base(service)
{
Parent = parent;
Body = body;
InitParameters();
}
/// <summary>Required. Resource name of the tenant under which the company is created. The format is
/// "projects/{project_id}/tenants/{tenant_id}", for example, "projects/foo/tenants/bar".</summary>
[Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)]
public virtual string Parent { get; private set; }
/// <summary>Gets or sets the body of this request.</summary>
Google.Apis.CloudTalentSolution.v4.Data.Company Body { get; set; }
/// <summary>Returns the body of the request.</summary>
protected override object GetBody() => Body;
/// <summary>Gets the method name.</summary>
public override string MethodName => "create";
/// <summary>Gets the HTTP method.</summary>
public override string HttpMethod => "POST";
/// <summary>Gets the REST path.</summary>
public override string RestPath => "v4/{+parent}/companies";
/// <summary>Initializes Create parameter list.</summary>
protected override void InitParameters()
{
base.InitParameters();
RequestParameters.Add("parent", new Google.Apis.Discovery.Parameter
{
Name = "parent",
IsRequired = true,
ParameterType = "path",
DefaultValue = null,
Pattern = @"^projects/[^/]+/tenants/[^/]+$",
});
}
}
/// <summary>Deletes specified company. Prerequisite: The company has no jobs associated with
/// it.</summary>
/// <param name="name">Required. The resource name of the company to be deleted. The format is
/// "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for example,
/// "projects/foo/tenants/bar/companies/baz".</param>
public virtual DeleteRequest Delete(string name)
{
return new DeleteRequest(service, name);
}
/// <summary>Deletes specified company. Prerequisite: The company has no jobs associated with
/// it.</summary>
public class DeleteRequest : CloudTalentSolutionBaseServiceRequest<Google.Apis.CloudTalentSolution.v4.Data.Empty>
{
/// <summary>Constructs a new Delete request.</summary>
public DeleteRequest(Google.Apis.Services.IClientService service, string name) : base(service)
{
Name = name;
InitParameters();
}
/// <summary>Required. The resource name of the company to be deleted. The format is
/// "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for example,
/// "projects/foo/tenants/bar/companies/baz".</summary>
[Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)]
public virtual string Name { get; private set; }
/// <summary>Gets the method name.</summary>
public override string MethodName => "delete";
/// <summary>Gets the HTTP method.</summary>
public override string HttpMethod => "DELETE";
/// <summary>Gets the REST path.</summary>
public override string RestPath => "v4/{+name}";
/// <summary>Initializes Delete parameter list.</summary>
protected override void InitParameters()
{
base.InitParameters();
RequestParameters.Add("name", new Google.Apis.Discovery.Parameter
{
Name = "name",
IsRequired = true,
ParameterType = "path",
DefaultValue = null,
Pattern = @"^projects/[^/]+/tenants/[^/]+/companies/[^/]+$",
});
}
}
/// <summary>Retrieves specified company.</summary>
/// <param name="name">Required. The resource name of the company to be retrieved. The format is
/// "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for example, "projects/api-test-
/// project/tenants/foo/companies/bar".</param>
public virtual GetRequest Get(string name)
{
return new GetRequest(service, name);
}
/// <summary>Retrieves specified company.</summary>
public class GetRequest : CloudTalentSolutionBaseServiceRequest<Google.Apis.CloudTalentSolution.v4.Data.Company>
{
/// <summary>Constructs a new Get request.</summary>
public GetRequest(Google.Apis.Services.IClientService service, string name) : base(service)
{
Name = name;
InitParameters();
}
/// <summary>Required. The resource name of the company to be retrieved. The format is
/// "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for example, "projects/api-
/// test-project/tenants/foo/companies/bar".</summary>
[Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)]
public virtual string Name { get; private set; }
/// <summary>Gets the method name.</summary>
public override string MethodName => "get";
/// <summary>Gets the HTTP method.</summary>
public override string HttpMethod => "GET";
/// <summary>Gets the REST path.</summary>
public override string RestPath => "v4/{+name}";
/// <summary>Initializes Get parameter list.</summary>
protected override void InitParameters()
{
base.InitParameters();
RequestParameters.Add("name", new Google.Apis.Discovery.Parameter
{
Name = "name",
IsRequired = true,
ParameterType = "path",
DefaultValue = null,
Pattern = @"^projects/[^/]+/tenants/[^/]+/companies/[^/]+$",
});
}
}
/// <summary>Lists all companies associated with the project.</summary>
/// <param name="parent">Required. Resource name of the tenant under which the company is created. The format is
/// "projects/{project_id}/tenants/{tenant_id}", for example, "projects/foo/tenants/bar".</param>
public virtual ListRequest List(string parent)
{
return new ListRequest(service, parent);
}
/// <summary>Lists all companies associated with the project.</summary>
public class ListRequest : CloudTalentSolutionBaseServiceRequest<Google.Apis.CloudTalentSolution.v4.Data.ListCompaniesResponse>
{
/// <summary>Constructs a new List request.</summary>
public ListRequest(Google.Apis.Services.IClientService service, string parent) : base(service)
{
Parent = parent;
InitParameters();
}
/// <summary>Required. Resource name of the tenant under which the company is created. The format is
/// "projects/{project_id}/tenants/{tenant_id}", for example, "projects/foo/tenants/bar".</summary>
[Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)]
public virtual string Parent { get; private set; }
/// <summary>The maximum number of companies to be returned, at most 100. Default is 100 if a non-
/// positive number is provided.</summary>
[Google.Apis.Util.RequestParameterAttribute("pageSize", Google.Apis.Util.RequestParameterType.Query)]
public virtual System.Nullable<int> PageSize { get; set; }
/// <summary>The starting indicator from which to return results.</summary>
[Google.Apis.Util.RequestParameterAttribute("pageToken", Google.Apis.Util.RequestParameterType.Query)]
public virtual string PageToken { get; set; }
/// <summary>Set to true if the companies requested must have open jobs. Defaults to false. If true,
/// at most page_size of companies are fetched, among which only those with open jobs are
/// returned.</summary>
[Google.Apis.Util.RequestParameterAttribute("requireOpenJobs", Google.Apis.Util.RequestParameterType.Query)]
public virtual System.Nullable<bool> RequireOpenJobs { get; set; }
/// <summary>Gets the method name.</summary>
public override string MethodName => "list";
/// <summary>Gets the HTTP method.</summary>
public override string HttpMethod => "GET";
/// <summary>Gets the REST path.</summary>
public override string RestPath => "v4/{+parent}/companies";
/// <summary>Initializes List parameter list.</summary>
protected override void InitParameters()
{
base.InitParameters();
RequestParameters.Add("parent", new Google.Apis.Discovery.Parameter
{
Name = "parent",
IsRequired = true,
ParameterType = "path",
DefaultValue = null,
Pattern = @"^projects/[^/]+/tenants/[^/]+$",
});
RequestParameters.Add("pageSize", new Google.Apis.Discovery.Parameter
{
Name = "pageSize",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
RequestParameters.Add("pageToken", new Google.Apis.Discovery.Parameter
{
Name = "pageToken",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
RequestParameters.Add("requireOpenJobs", new Google.Apis.Discovery.Parameter
{
Name = "requireOpenJobs",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
}
}
/// <summary>Updates specified company.</summary>
/// <param name="body">The body of the request.</param>
/// <param name="name">Required during company update. The resource name for a company. This is generated by the service
/// when a company is created. The format is "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for
/// example, "projects/foo/tenants/bar/companies/baz".</param>
public virtual PatchRequest Patch(Google.Apis.CloudTalentSolution.v4.Data.Company body, string name)
{
return new PatchRequest(service, body, name);
}
/// <summary>Updates specified company.</summary>
public class PatchRequest : CloudTalentSolutionBaseServiceRequest<Google.Apis.CloudTalentSolution.v4.Data.Company>
{
/// <summary>Constructs a new Patch request.</summary>
public PatchRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudTalentSolution.v4.Data.Company body, string name) : base(service)
{
Name = name;
Body = body;
InitParameters();
}
/// <summary>Required during company update. The resource name for a company. This is generated by
/// the service when a company is created. The format is
/// "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for example,
/// "projects/foo/tenants/bar/companies/baz".</summary>
[Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)]
public virtual string Name { get; private set; }
/// <summary>Strongly recommended for the best service experience. If update_mask is provided, only
/// the specified fields in company are updated. Otherwise all the fields are updated. A field mask
/// to specify the company fields to be updated. Only top level fields of Company are
/// supported.</summary>
[Google.Apis.Util.RequestParameterAttribute("updateMask", Google.Apis.Util.RequestParameterType.Query)]
public virtual object UpdateMask { get; set; }
/// <summary>Gets or sets the body of this request.</summary>
Google.Apis.CloudTalentSolution.v4.Data.Company Body { get; set; }
/// <summary>Returns the body of the request.</summary>
protected override object GetBody() => Body;
/// <summary>Gets the method name.</summary>
public override string MethodName => "patch";
/// <summary>Gets the HTTP method.</summary>
public override string HttpMethod => "PATCH";
/// <summary>Gets the REST path.</summary>
public override string RestPath => "v4/{+name}";
/// <summary>Initializes Patch parameter list.</summary>
protected override void InitParameters()
{
base.InitParameters();
RequestParameters.Add("name", new Google.Apis.Discovery.Parameter
{
Name = "name",
IsRequired = true,
ParameterType = "path",
DefaultValue = null,
Pattern = @"^projects/[^/]+/tenants/[^/]+/companies/[^/]+$",
});
RequestParameters.Add("updateMask", new Google.Apis.Discovery.Parameter
{
Name = "updateMask",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
}
}
}
/// <summary>Gets the Jobs resource.</summary>
public virtual JobsResource Jobs { get; }
/// <summary>The "jobs" collection of methods.</summary>
public class JobsResource
{
private const string Resource = "jobs";
/// <summary>The service which this resource belongs to.</summary>
private readonly Google.Apis.Services.IClientService service;
/// <summary>Constructs a new resource.</summary>
public JobsResource(Google.Apis.Services.IClientService service)
{
this.service = service;
}
/// <summary>Begins executing a batch create jobs operation.</summary>
/// <param name="body">The body of the request.</param>
/// <param name="parent">Required. The resource name of the tenant under which the job is created. The format is
/// "projects/{project_id}/tenants/{tenant_id}". For example, "projects/foo/tenants/bar".</param>
public virtual BatchCreateRequest BatchCreate(Google.Apis.CloudTalentSolution.v4.Data.BatchCreateJobsRequest body, string parent)
{
return new BatchCreateRequest(service, body, parent);
}
/// <summary>Begins executing a batch create jobs operation.</summary>
public class BatchCreateRequest : CloudTalentSolutionBaseServiceRequest<Google.Apis.CloudTalentSolution.v4.Data.Operation>
{
/// <summary>Constructs a new BatchCreate request.</summary>
public BatchCreateRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudTalentSolution.v4.Data.BatchCreateJobsRequest body, string parent) : base(service)
{
Parent = parent;
Body = body;
InitParameters();
}
/// <summary>Required. The resource name of the tenant under which the job is created. The format is
/// "projects/{project_id}/tenants/{tenant_id}". For example, "projects/foo/tenants/bar".</summary>
[Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)]
public virtual string Parent { get; private set; }
/// <summary>Gets or sets the body of this request.</summary>
Google.Apis.CloudTalentSolution.v4.Data.BatchCreateJobsRequest Body { get; set; }
/// <summary>Returns the body of the request.</summary>
protected override object GetBody() => Body;
/// <summary>Gets the method name.</summary>
public override string MethodName => "batchCreate";
/// <summary>Gets the HTTP method.</summary>
public override string HttpMethod => "POST";
/// <summary>Gets the REST path.</summary>
public override string RestPath => "v4/{+parent}/jobs:batchCreate";
/// <summary>Initializes BatchCreate parameter list.</summary>
protected override void InitParameters()
{
base.InitParameters();
RequestParameters.Add("parent", new Google.Apis.Discovery.Parameter
{
Name = "parent",
IsRequired = true,
ParameterType = "path",
DefaultValue = null,
Pattern = @"^projects/[^/]+/tenants/[^/]+$",
});
}
}
/// <summary>Begins executing a batch delete jobs operation.</summary>
/// <param name="body">The body of the request.</param>
/// <param name="parent">Required. The resource name of the tenant under which the job is created. The format is
/// "projects/{project_id}/tenants/{tenant_id}". For example, "projects/foo/tenants/bar". The parent of all of the jobs
/// specified in `names` must match this field.</param>
public virtual BatchDeleteRequest BatchDelete(Google.Apis.CloudTalentSolution.v4.Data.BatchDeleteJobsRequest body, string parent)
{
return new BatchDeleteRequest(service, body, parent);
}
/// <summary>Begins executing a batch delete jobs operation.</summary>
public class BatchDeleteRequest : CloudTalentSolutionBaseServiceRequest<Google.Apis.CloudTalentSolution.v4.Data.Operation>
{
/// <summary>Constructs a new BatchDelete request.</summary>
public BatchDeleteRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudTalentSolution.v4.Data.BatchDeleteJobsRequest body, string parent) : base(service)
{
Parent = parent;
Body = body;
InitParameters();
}
/// <summary>Required. The resource name of the tenant under which the job is created. The format is
/// "projects/{project_id}/tenants/{tenant_id}". For example, "projects/foo/tenants/bar". The parent
/// of all of the jobs specified in `names` must match this field.</summary>
[Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)]
public virtual string Parent { get; private set; }
/// <summary>Gets or sets the body of this request.</summary>
Google.Apis.CloudTalentSolution.v4.Data.BatchDeleteJobsRequest Body { get; set; }
/// <summary>Returns the body of the request.</summary>
protected override object GetBody() => Body;
/// <summary>Gets the method name.</summary>
public override string MethodName => "batchDelete";
/// <summary>Gets the HTTP method.</summary>
public override string HttpMethod => "POST";
/// <summary>Gets the REST path.</summary>
public override string RestPath => "v4/{+parent}/jobs:batchDelete";
/// <summary>Initializes BatchDelete parameter list.</summary>
protected override void InitParameters()
{
base.InitParameters();
RequestParameters.Add("parent", new Google.Apis.Discovery.Parameter
{
Name = "parent",
IsRequired = true,
ParameterType = "path",
DefaultValue = null,
Pattern = @"^projects/[^/]+/tenants/[^/]+$",
});
}
}
/// <summary>Begins executing a batch update jobs operation.</summary>
/// <param name="body">The body of the request.</param>
/// <param name="parent">Required. The resource name of the tenant under which the job is created. The format is
/// "projects/{project_id}/tenants/{tenant_id}". For example, "projects/foo/tenants/bar".</param>
public virtual BatchUpdateRequest BatchUpdate(Google.Apis.CloudTalentSolution.v4.Data.BatchUpdateJobsRequest body, string parent)
{
return new BatchUpdateRequest(service, body, parent);
}
/// <summary>Begins executing a batch update jobs operation.</summary>
public class BatchUpdateRequest : CloudTalentSolutionBaseServiceRequest<Google.Apis.CloudTalentSolution.v4.Data.Operation>
{
/// <summary>Constructs a new BatchUpdate request.</summary>
public BatchUpdateRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudTalentSolution.v4.Data.BatchUpdateJobsRequest body, string parent) : base(service)
{
Parent = parent;
Body = body;
InitParameters();
}
/// <summary>Required. The resource name of the tenant under which the job is created. The format is
/// "projects/{project_id}/tenants/{tenant_id}". For example, "projects/foo/tenants/bar".</summary>
[Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)]
public virtual string Parent { get; private set; }
/// <summary>Gets or sets the body of this request.</summary>
Google.Apis.CloudTalentSolution.v4.Data.BatchUpdateJobsRequest Body { get; set; }
/// <summary>Returns the body of the request.</summary>
protected override object GetBody() => Body;
/// <summary>Gets the method name.</summary>
public override string MethodName => "batchUpdate";
/// <summary>Gets the HTTP method.</summary>
public override string HttpMethod => "POST";
/// <summary>Gets the REST path.</summary>
public override string RestPath => "v4/{+parent}/jobs:batchUpdate";
/// <summary>Initializes BatchUpdate parameter list.</summary>
protected override void InitParameters()
{
base.InitParameters();
RequestParameters.Add("parent", new Google.Apis.Discovery.Parameter
{
Name = "parent",
IsRequired = true,
ParameterType = "path",
DefaultValue = null,
Pattern = @"^projects/[^/]+/tenants/[^/]+$",
});
}
}
/// <summary>Creates a new job. Typically, the job becomes searchable within 10 seconds, but it may take
/// up to 5 minutes.</summary>
/// <param name="body">The body of the request.</param>
/// <param name="parent">Required. The resource name of the tenant under which the job is created. The format is
/// "projects/{project_id}/tenants/{tenant_id}". For example, "projects/foo/tenants/bar".</param>
public virtual CreateRequest Create(Google.Apis.CloudTalentSolution.v4.Data.Job body, string parent)
{
return new CreateRequest(service, body, parent);
}
/// <summary>Creates a new job. Typically, the job becomes searchable within 10 seconds, but it may take
/// up to 5 minutes.</summary>
public class CreateRequest : CloudTalentSolutionBaseServiceRequest<Google.Apis.CloudTalentSolution.v4.Data.Job>
{
/// <summary>Constructs a new Create request.</summary>
public CreateRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudTalentSolution.v4.Data.Job body, string parent) : base(service)
{
Parent = parent;
Body = body;
InitParameters();
}
/// <summary>Required. The resource name of the tenant under which the job is created. The format is
/// "projects/{project_id}/tenants/{tenant_id}". For example, "projects/foo/tenants/bar".</summary>
[Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)]
public virtual string Parent { get; private set; }
/// <summary>Gets or sets the body of this request.</summary>
Google.Apis.CloudTalentSolution.v4.Data.Job Body { get; set; }
/// <summary>Returns the body of the request.</summary>
protected override object GetBody() => Body;
/// <summary>Gets the method name.</summary>
public override string MethodName => "create";
/// <summary>Gets the HTTP method.</summary>
public override string HttpMethod => "POST";
/// <summary>Gets the REST path.</summary>
public override string RestPath => "v4/{+parent}/jobs";
/// <summary>Initializes Create parameter list.</summary>
protected override void InitParameters()
{
base.InitParameters();
RequestParameters.Add("parent", new Google.Apis.Discovery.Parameter
{
Name = "parent",
IsRequired = true,
ParameterType = "path",
DefaultValue = null,
Pattern = @"^projects/[^/]+/tenants/[^/]+$",
});
}
}
/// <summary>Deletes the specified job. Typically, the job becomes unsearchable within 10 seconds, but
/// it may take up to 5 minutes.</summary>
/// <param name="name">Required. The resource name of the job to be deleted. The format is
/// "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}". For example,
/// "projects/foo/tenants/bar/jobs/baz".</param>
public virtual DeleteRequest Delete(string name)
{
return new DeleteRequest(service, name);
}
/// <summary>Deletes the specified job. Typically, the job becomes unsearchable within 10 seconds, but
/// it may take up to 5 minutes.</summary>
public class DeleteRequest : CloudTalentSolutionBaseServiceRequest<Google.Apis.CloudTalentSolution.v4.Data.Empty>
{
/// <summary>Constructs a new Delete request.</summary>
public DeleteRequest(Google.Apis.Services.IClientService service, string name) : base(service)
{
Name = name;
InitParameters();
}
/// <summary>Required. The resource name of the job to be deleted. The format is
/// "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}". For example,
/// "projects/foo/tenants/bar/jobs/baz".</summary>
[Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)]
public virtual string Name { get; private set; }
/// <summary>Gets the method name.</summary>
public override string MethodName => "delete";
/// <summary>Gets the HTTP method.</summary>
public override string HttpMethod => "DELETE";
/// <summary>Gets the REST path.</summary>
public override string RestPath => "v4/{+name}";
/// <summary>Initializes Delete parameter list.</summary>
protected override void InitParameters()
{
base.InitParameters();
RequestParameters.Add("name", new Google.Apis.Discovery.Parameter
{
Name = "name",
IsRequired = true,
ParameterType = "path",
DefaultValue = null,
Pattern = @"^projects/[^/]+/tenants/[^/]+/jobs/[^/]+$",
});
}
}
/// <summary>Retrieves the specified job, whose status is OPEN or recently EXPIRED within the last 90
/// days.</summary>
/// <param name="name">Required. The resource name of the job to retrieve. The format is
/// "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}". For example,
/// "projects/foo/tenants/bar/jobs/baz".</param>
public virtual GetRequest Get(string name)
{
return new GetRequest(service, name);
}
/// <summary>Retrieves the specified job, whose status is OPEN or recently EXPIRED within the last 90
/// days.</summary>
public class GetRequest : CloudTalentSolutionBaseServiceRequest<Google.Apis.CloudTalentSolution.v4.Data.Job>
{
/// <summary>Constructs a new Get request.</summary>
public GetRequest(Google.Apis.Services.IClientService service, string name) : base(service)
{
Name = name;
InitParameters();
}
/// <summary>Required. The resource name of the job to retrieve. The format is
/// "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}". For example,
/// "projects/foo/tenants/bar/jobs/baz".</summary>
[Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)]
public virtual string Name { get; private set; }
/// <summary>Gets the method name.</summary>
public override string MethodName => "get";
/// <summary>Gets the HTTP method.</summary>
public override string HttpMethod => "GET";
/// <summary>Gets the REST path.</summary>
public override string RestPath => "v4/{+name}";
/// <summary>Initializes Get parameter list.</summary>
protected override void InitParameters()
{
base.InitParameters();
RequestParameters.Add("name", new Google.Apis.Discovery.Parameter
{
Name = "name",
IsRequired = true,
ParameterType = "path",
DefaultValue = null,
Pattern = @"^projects/[^/]+/tenants/[^/]+/jobs/[^/]+$",
});
}
}
/// <summary>Lists jobs by filter.</summary>
/// <param name="parent">Required. The resource name of the tenant under which the job is created. The format is
/// "projects/{project_id}/tenants/{tenant_id}". For example, "projects/foo/tenants/bar".</param>
public virtual ListRequest List(string parent)
{
return new ListRequest(service, parent);
}
/// <summary>Lists jobs by filter.</summary>
public class ListRequest : CloudTalentSolutionBaseServiceRequest<Google.Apis.CloudTalentSolution.v4.Data.ListJobsResponse>
{
/// <summary>Constructs a new List request.</summary>
public ListRequest(Google.Apis.Services.IClientService service, string parent) : base(service)
{
Parent = parent;
InitParameters();
}
/// <summary>Required. The resource name of the tenant under which the job is created. The format is
/// "projects/{project_id}/tenants/{tenant_id}". For example, "projects/foo/tenants/bar".</summary>
[Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)]
public virtual string Parent { get; private set; }
/// <summary>Required. The filter string specifies the jobs to be enumerated. Supported operator: =,
/// AND The fields eligible for filtering are: * `companyName` (Required) * `requisitionId` *
/// `status` Available values: OPEN, EXPIRED, ALL. Defaults to OPEN if no value is specified. Sample
/// Query: * companyName = "projects/foo/tenants/bar/companies/baz" * companyName =
/// "projects/foo/tenants/bar/companies/baz" AND requisitionId = "req-1" * companyName =
/// "projects/foo/tenants/bar/companies/baz" AND status = "EXPIRED"</summary>
[Google.Apis.Util.RequestParameterAttribute("filter", Google.Apis.Util.RequestParameterType.Query)]
public virtual string Filter { get; set; }
/// <summary>The desired job attributes returned for jobs in the search response. Defaults to
/// JobView.JOB_VIEW_FULL if no value is specified.</summary>
[Google.Apis.Util.RequestParameterAttribute("jobView", Google.Apis.Util.RequestParameterType.Query)]
public virtual System.Nullable<JobViewEnum> JobView { get; set; }
/// <summary>The desired job attributes returned for jobs in the search response. Defaults to
/// JobView.JOB_VIEW_FULL if no value is specified.</summary>
public enum JobViewEnum
{
/// <summary>Default value.</summary>
[Google.Apis.Util.StringValueAttribute("JOB_VIEW_UNSPECIFIED")]
JOBVIEWUNSPECIFIED,
/// <summary>A ID only view of job, with following attributes: Job.name, Job.requisition_id,
/// Job.language_code.</summary>
[Google.Apis.Util.StringValueAttribute("JOB_VIEW_ID_ONLY")]
JOBVIEWIDONLY,
/// <summary>A minimal view of the job, with the following attributes: Job.name,
/// Job.requisition_id, Job.title, Job.company, Job.DerivedInfo.locations,
/// Job.language_code.</summary>
[Google.Apis.Util.StringValueAttribute("JOB_VIEW_MINIMAL")]
JOBVIEWMINIMAL,
/// <summary>A small view of the job, with the following attributes in the search results:
/// Job.name, Job.requisition_id, Job.title, Job.company, Job.DerivedInfo.locations,
/// Job.visibility, Job.language_code, Job.description.</summary>
[Google.Apis.Util.StringValueAttribute("JOB_VIEW_SMALL")]
JOBVIEWSMALL,
/// <summary>All available attributes are included in the search results.</summary>
[Google.Apis.Util.StringValueAttribute("JOB_VIEW_FULL")]
JOBVIEWFULL,
}
/// <summary>The maximum number of jobs to be returned per page of results. If job_view is set to
/// JobView.JOB_VIEW_ID_ONLY, the maximum allowed page size is 1000. Otherwise, the maximum allowed
/// page size is 100. Default is 100 if empty or a number < 1 is specified.</summary>
[Google.Apis.Util.RequestParameterAttribute("pageSize", Google.Apis.Util.RequestParameterType.Query)]
public virtual System.Nullable<int> PageSize { get; set; }
/// <summary>The starting point of a query result.</summary>
[Google.Apis.Util.RequestParameterAttribute("pageToken", Google.Apis.Util.RequestParameterType.Query)]
public virtual string PageToken { get; set; }
/// <summary>Gets the method name.</summary>
public override string MethodName => "list";
/// <summary>Gets the HTTP method.</summary>
public override string HttpMethod => "GET";
/// <summary>Gets the REST path.</summary>
public override string RestPath => "v4/{+parent}/jobs";
/// <summary>Initializes List parameter list.</summary>
protected override void InitParameters()
{
base.InitParameters();
RequestParameters.Add("parent", new Google.Apis.Discovery.Parameter
{
Name = "parent",
IsRequired = true,
ParameterType = "path",
DefaultValue = null,
Pattern = @"^projects/[^/]+/tenants/[^/]+$",
});
RequestParameters.Add("filter", new Google.Apis.Discovery.Parameter
{
Name = "filter",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
RequestParameters.Add("jobView", new Google.Apis.Discovery.Parameter
{
Name = "jobView",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
RequestParameters.Add("pageSize", new Google.Apis.Discovery.Parameter
{
Name = "pageSize",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
RequestParameters.Add("pageToken", new Google.Apis.Discovery.Parameter
{
Name = "pageToken",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
}
}
/// <summary>Updates specified job. Typically, updated contents become visible in search results within
/// 10 seconds, but it may take up to 5 minutes.</summary>
/// <param name="body">The body of the request.</param>
/// <param name="name">Required during job update. The resource name for the job. This is generated by the service when
/// a job is created. The format is "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}". For example,
/// "projects/foo/tenants/bar/jobs/baz". Use of this field in job queries and API calls is preferred over the use of
/// requisition_id since this value is unique.</param>
public virtual PatchRequest Patch(Google.Apis.CloudTalentSolution.v4.Data.Job body, string name)
{
return new PatchRequest(service, body, name);
}
/// <summary>Updates specified job. Typically, updated contents become visible in search results within
/// 10 seconds, but it may take up to 5 minutes.</summary>
public class PatchRequest : CloudTalentSolutionBaseServiceRequest<Google.Apis.CloudTalentSolution.v4.Data.Job>
{
/// <summary>Constructs a new Patch request.</summary>
public PatchRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudTalentSolution.v4.Data.Job body, string name) : base(service)
{
Name = name;
Body = body;
InitParameters();
}
/// <summary>Required during job update. The resource name for the job. This is generated by the
/// service when a job is created. The format is
/// "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}". For example,
/// "projects/foo/tenants/bar/jobs/baz". Use of this field in job queries and API calls is preferred
/// over the use of requisition_id since this value is unique.</summary>
[Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)]
public virtual string Name { get; private set; }
/// <summary>Strongly recommended for the best service experience. If update_mask is provided, only
/// the specified fields in job are updated. Otherwise all the fields are updated. A field mask to
/// restrict the fields that are updated. Only top level fields of Job are supported.</summary>
[Google.Apis.Util.RequestParameterAttribute("updateMask", Google.Apis.Util.RequestParameterType.Query)]
public virtual object UpdateMask { get; set; }
/// <summary>Gets or sets the body of this request.</summary>
Google.Apis.CloudTalentSolution.v4.Data.Job Body { get; set; }
/// <summary>Returns the body of the request.</summary>
protected override object GetBody() => Body;
/// <summary>Gets the method name.</summary>
public override string MethodName => "patch";
/// <summary>Gets the HTTP method.</summary>
public override string HttpMethod => "PATCH";
/// <summary>Gets the REST path.</summary>
public override string RestPath => "v4/{+name}";
/// <summary>Initializes Patch parameter list.</summary>
protected override void InitParameters()
{
base.InitParameters();
RequestParameters.Add("name", new Google.Apis.Discovery.Parameter
{
Name = "name",
IsRequired = true,
ParameterType = "path",
DefaultValue = null,
Pattern = @"^projects/[^/]+/tenants/[^/]+/jobs/[^/]+$",
});
RequestParameters.Add("updateMask", new Google.Apis.Discovery.Parameter
{
Name = "updateMask",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
}
}
/// <summary>Searches for jobs using the provided SearchJobsRequest. This call constrains the visibility
/// of jobs present in the database, and only returns jobs that the caller has permission to search
/// against.</summary>
/// <param name="body">The body of the request.</param>
/// <param name="parent">Required. The resource name of the tenant to search within. The format is
/// "projects/{project_id}/tenants/{tenant_id}". For example, "projects/foo/tenants/bar".</param>
public virtual SearchRequest Search(Google.Apis.CloudTalentSolution.v4.Data.SearchJobsRequest body, string parent)
{
return new SearchRequest(service, body, parent);
}
/// <summary>Searches for jobs using the provided SearchJobsRequest. This call constrains the visibility
/// of jobs present in the database, and only returns jobs that the caller has permission to search
/// against.</summary>
public class SearchRequest : CloudTalentSolutionBaseServiceRequest<Google.Apis.CloudTalentSolution.v4.Data.SearchJobsResponse>
{
/// <summary>Constructs a new Search request.</summary>
public SearchRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudTalentSolution.v4.Data.SearchJobsRequest body, string parent) : base(service)
{
Parent = parent;
Body = body;
InitParameters();
}
/// <summary>Required. The resource name of the tenant to search within. The format is
/// "projects/{project_id}/tenants/{tenant_id}". For example, "projects/foo/tenants/bar".</summary>
[Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)]
public virtual string Parent { get; private set; }
/// <summary>Gets or sets the body of this request.</summary>
Google.Apis.CloudTalentSolution.v4.Data.SearchJobsRequest Body { get; set; }
/// <summary>Returns the body of the request.</summary>
protected override object GetBody() => Body;
/// <summary>Gets the method name.</summary>
public override string MethodName => "search";
/// <summary>Gets the HTTP method.</summary>
public override string HttpMethod => "POST";
/// <summary>Gets the REST path.</summary>
public override string RestPath => "v4/{+parent}/jobs:search";
/// <summary>Initializes Search parameter list.</summary>
protected override void InitParameters()
{
base.InitParameters();
RequestParameters.Add("parent", new Google.Apis.Discovery.Parameter
{
Name = "parent",
IsRequired = true,
ParameterType = "path",
DefaultValue = null,
Pattern = @"^projects/[^/]+/tenants/[^/]+$",
});
}
}
/// <summary>Searches for jobs using the provided SearchJobsRequest. This API call is intended for the
/// use case of targeting passive job seekers (for example, job seekers who have signed up to receive
/// email alerts about potential job opportunities), it has different algorithmic adjustments that are
/// designed to specifically target passive job seekers. This call constrains the visibility of jobs
/// present in the database, and only returns jobs the caller has permission to search
/// against.</summary>
/// <param name="body">The body of the request.</param>
/// <param name="parent">Required. The resource name of the tenant to search within. The format is
/// "projects/{project_id}/tenants/{tenant_id}". For example, "projects/foo/tenants/bar".</param>
public virtual SearchForAlertRequest SearchForAlert(Google.Apis.CloudTalentSolution.v4.Data.SearchJobsRequest body, string parent)
{
return new SearchForAlertRequest(service, body, parent);
}
/// <summary>Searches for jobs using the provided SearchJobsRequest. This API call is intended for the
/// use case of targeting passive job seekers (for example, job seekers who have signed up to receive
/// email alerts about potential job opportunities), it has different algorithmic adjustments that are
/// designed to specifically target passive job seekers. This call constrains the visibility of jobs
/// present in the database, and only returns jobs the caller has permission to search
/// against.</summary>
public class SearchForAlertRequest : CloudTalentSolutionBaseServiceRequest<Google.Apis.CloudTalentSolution.v4.Data.SearchJobsResponse>
{
/// <summary>Constructs a new SearchForAlert request.</summary>
public SearchForAlertRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudTalentSolution.v4.Data.SearchJobsRequest body, string parent) : base(service)
{
Parent = parent;
Body = body;
InitParameters();
}
/// <summary>Required. The resource name of the tenant to search within. The format is
/// "projects/{project_id}/tenants/{tenant_id}". For example, "projects/foo/tenants/bar".</summary>
[Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)]
public virtual string Parent { get; private set; }
/// <summary>Gets or sets the body of this request.</summary>
Google.Apis.CloudTalentSolution.v4.Data.SearchJobsRequest Body { get; set; }
/// <summary>Returns the body of the request.</summary>
protected override object GetBody() => Body;
/// <summary>Gets the method name.</summary>
public override string MethodName => "searchForAlert";
/// <summary>Gets the HTTP method.</summary>
public override string HttpMethod => "POST";
/// <summary>Gets the REST path.</summary>
public override string RestPath => "v4/{+parent}/jobs:searchForAlert";
/// <summary>Initializes SearchForAlert parameter list.</summary>
protected override void InitParameters()
{
base.InitParameters();
RequestParameters.Add("parent", new Google.Apis.Discovery.Parameter
{
Name = "parent",
IsRequired = true,
ParameterType = "path",
DefaultValue = null,
Pattern = @"^projects/[^/]+/tenants/[^/]+$",
});
}
}
}
/// <summary>Completes the specified prefix with keyword suggestions. Intended for use by a job search auto-
/// complete search box.</summary>
/// <param name="tenant">Required. Resource name of tenant the completion is performed within. The format is
/// "projects/{project_id}/tenants/{tenant_id}", for example, "projects/foo/tenants/bar".</param>
public virtual CompleteQueryRequest CompleteQuery(string tenant)
{
return new CompleteQueryRequest(service, tenant);
}
/// <summary>Completes the specified prefix with keyword suggestions. Intended for use by a job search auto-
/// complete search box.</summary>
public class CompleteQueryRequest : CloudTalentSolutionBaseServiceRequest<Google.Apis.CloudTalentSolution.v4.Data.CompleteQueryResponse>
{
/// <summary>Constructs a new CompleteQuery request.</summary>
public CompleteQueryRequest(Google.Apis.Services.IClientService service, string tenant) : base(service)
{
Tenant = tenant;
InitParameters();
}
/// <summary>Required. Resource name of tenant the completion is performed within. The format is
/// "projects/{project_id}/tenants/{tenant_id}", for example, "projects/foo/tenants/bar".</summary>
[Google.Apis.Util.RequestParameterAttribute("tenant", Google.Apis.Util.RequestParameterType.Path)]
public virtual string Tenant { get; private set; }
/// <summary>If provided, restricts completion to specified company. The format is
/// "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for example,
/// "projects/foo/tenants/bar/companies/baz".</summary>
[Google.Apis.Util.RequestParameterAttribute("company", Google.Apis.Util.RequestParameterType.Query)]
public virtual string Company { get; set; }
/// <summary>The list of languages of the query. This is the BCP-47 language code, such as "en-US" or
/// "sr-Latn". For more information, see [Tags for Identifying
/// Languages](https://tools.ietf.org/html/bcp47). The maximum number of allowed characters is
/// 255.</summary>
[Google.Apis.Util.RequestParameterAttribute("languageCodes", Google.Apis.Util.RequestParameterType.Query)]
public virtual Google.Apis.Util.Repeatable<string> LanguageCodes { get; set; }
/// <summary>Required. Completion result count. The maximum allowed page size is 10.</summary>
[Google.Apis.Util.RequestParameterAttribute("pageSize", Google.Apis.Util.RequestParameterType.Query)]
public virtual System.Nullable<int> PageSize { get; set; }
/// <summary>Required. The query used to generate suggestions. The maximum number of allowed characters
/// is 255.</summary>
[Google.Apis.Util.RequestParameterAttribute("query", Google.Apis.Util.RequestParameterType.Query)]
public virtual string Query { get; set; }
/// <summary>The scope of the completion. The defaults is CompletionScope.PUBLIC.</summary>
[Google.Apis.Util.RequestParameterAttribute("scope", Google.Apis.Util.RequestParameterType.Query)]
public virtual System.Nullable<ScopeEnum> Scope { get; set; }
/// <summary>The scope of the completion. The defaults is CompletionScope.PUBLIC.</summary>
public enum ScopeEnum
{
/// <summary>Default value.</summary>
[Google.Apis.Util.StringValueAttribute("COMPLETION_SCOPE_UNSPECIFIED")]
COMPLETIONSCOPEUNSPECIFIED,
/// <summary>Suggestions are based only on the data provided by the client.</summary>
[Google.Apis.Util.StringValueAttribute("TENANT")]
TENANT,
/// <summary>Suggestions are based on all jobs data in the system that's visible to the
/// client</summary>
[Google.Apis.Util.StringValueAttribute("PUBLIC")]
PUBLIC__,
}
/// <summary>The completion topic. The default is CompletionType.COMBINED.</summary>
[Google.Apis.Util.RequestParameterAttribute("type", Google.Apis.Util.RequestParameterType.Query)]
public virtual System.Nullable<TypeEnum> Type { get; set; }
/// <summary>The completion topic. The default is CompletionType.COMBINED.</summary>
public enum TypeEnum
{
/// <summary>Default value.</summary>
[Google.Apis.Util.StringValueAttribute("COMPLETION_TYPE_UNSPECIFIED")]
COMPLETIONTYPEUNSPECIFIED,
/// <summary>Suggest job titles for jobs autocomplete. For CompletionType.JOB_TITLE type, only open
/// jobs with the same language_codes are returned.</summary>
[Google.Apis.Util.StringValueAttribute("JOB_TITLE")]
JOBTITLE,
/// <summary>Suggest company names for jobs autocomplete. For CompletionType.COMPANY_NAME type, only
/// companies having open jobs with the same language_codes are returned.</summary>
[Google.Apis.Util.StringValueAttribute("COMPANY_NAME")]
COMPANYNAME,
/// <summary>Suggest both job titles and company names for jobs autocomplete. For
/// CompletionType.COMBINED type, only open jobs with the same language_codes or companies having
/// open jobs with the same language_codes are returned.</summary>
[Google.Apis.Util.StringValueAttribute("COMBINED")]
COMBINED,
}
/// <summary>Gets the method name.</summary>
public override string MethodName => "completeQuery";
/// <summary>Gets the HTTP method.</summary>
public override string HttpMethod => "GET";
/// <summary>Gets the REST path.</summary>
public override string RestPath => "v4/{+tenant}:completeQuery";
/// <summary>Initializes CompleteQuery parameter list.</summary>
protected override void InitParameters()
{
base.InitParameters();
RequestParameters.Add("tenant", new Google.Apis.Discovery.Parameter
{
Name = "tenant",
IsRequired = true,
ParameterType = "path",
DefaultValue = null,
Pattern = @"^projects/[^/]+/tenants/[^/]+$",
});
RequestParameters.Add("company", new Google.Apis.Discovery.Parameter
{
Name = "company",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
RequestParameters.Add("languageCodes", new Google.Apis.Discovery.Parameter
{
Name = "languageCodes",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
RequestParameters.Add("pageSize", new Google.Apis.Discovery.Parameter
{
Name = "pageSize",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
RequestParameters.Add("query", new Google.Apis.Discovery.Parameter
{
Name = "query",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
RequestParameters.Add("scope", new Google.Apis.Discovery.Parameter
{
Name = "scope",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
RequestParameters.Add("type", new Google.Apis.Discovery.Parameter
{
Name = "type",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
}
}
/// <summary>Creates a new tenant entity.</summary>
/// <param name="body">The body of the request.</param>
/// <param name="parent">Required. Resource name of the project under which the tenant is created. The format is
/// "projects/{project_id}", for example, "projects/foo".</param>
public virtual CreateRequest Create(Google.Apis.CloudTalentSolution.v4.Data.Tenant body, string parent)
{
return new CreateRequest(service, body, parent);
}
/// <summary>Creates a new tenant entity.</summary>
public class CreateRequest : CloudTalentSolutionBaseServiceRequest<Google.Apis.CloudTalentSolution.v4.Data.Tenant>
{
/// <summary>Constructs a new Create request.</summary>
public CreateRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudTalentSolution.v4.Data.Tenant body, string parent) : base(service)
{
Parent = parent;
Body = body;
InitParameters();
}
/// <summary>Required. Resource name of the project under which the tenant is created. The format is
/// "projects/{project_id}", for example, "projects/foo".</summary>
[Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)]
public virtual string Parent { get; private set; }
/// <summary>Gets or sets the body of this request.</summary>
Google.Apis.CloudTalentSolution.v4.Data.Tenant Body { get; set; }
/// <summary>Returns the body of the request.</summary>
protected override object GetBody() => Body;
/// <summary>Gets the method name.</summary>
public override string MethodName => "create";
/// <summary>Gets the HTTP method.</summary>
public override string HttpMethod => "POST";
/// <summary>Gets the REST path.</summary>
public override string RestPath => "v4/{+parent}/tenants";
/// <summary>Initializes Create parameter list.</summary>
protected override void InitParameters()
{
base.InitParameters();
RequestParameters.Add("parent", new Google.Apis.Discovery.Parameter
{
Name = "parent",
IsRequired = true,
ParameterType = "path",
DefaultValue = null,
Pattern = @"^projects/[^/]+$",
});
}
}
/// <summary>Deletes specified tenant.</summary>
/// <param name="name">Required. The resource name of the tenant to be deleted. The format is
/// "projects/{project_id}/tenants/{tenant_id}", for example, "projects/foo/tenants/bar".</param>
public virtual DeleteRequest Delete(string name)
{
return new DeleteRequest(service, name);
}
/// <summary>Deletes specified tenant.</summary>
public class DeleteRequest : CloudTalentSolutionBaseServiceRequest<Google.Apis.CloudTalentSolution.v4.Data.Empty>
{
/// <summary>Constructs a new Delete request.</summary>
public DeleteRequest(Google.Apis.Services.IClientService service, string name) : base(service)
{
Name = name;
InitParameters();
}
/// <summary>Required. The resource name of the tenant to be deleted. The format is
/// "projects/{project_id}/tenants/{tenant_id}", for example, "projects/foo/tenants/bar".</summary>
[Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)]
public virtual string Name { get; private set; }
/// <summary>Gets the method name.</summary>
public override string MethodName => "delete";
/// <summary>Gets the HTTP method.</summary>
public override string HttpMethod => "DELETE";
/// <summary>Gets the REST path.</summary>
public override string RestPath => "v4/{+name}";
/// <summary>Initializes Delete parameter list.</summary>
protected override void InitParameters()
{
base.InitParameters();
RequestParameters.Add("name", new Google.Apis.Discovery.Parameter
{
Name = "name",
IsRequired = true,
ParameterType = "path",
DefaultValue = null,
Pattern = @"^projects/[^/]+/tenants/[^/]+$",
});
}
}
/// <summary>Retrieves specified tenant.</summary>
/// <param name="name">Required. The resource name of the tenant to be retrieved. The format is
/// "projects/{project_id}/tenants/{tenant_id}", for example, "projects/foo/tenants/bar".</param>
public virtual GetRequest Get(string name)
{
return new GetRequest(service, name);
}
/// <summary>Retrieves specified tenant.</summary>
public class GetRequest : CloudTalentSolutionBaseServiceRequest<Google.Apis.CloudTalentSolution.v4.Data.Tenant>
{
/// <summary>Constructs a new Get request.</summary>
public GetRequest(Google.Apis.Services.IClientService service, string name) : base(service)
{
Name = name;
InitParameters();
}
/// <summary>Required. The resource name of the tenant to be retrieved. The format is
/// "projects/{project_id}/tenants/{tenant_id}", for example, "projects/foo/tenants/bar".</summary>
[Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)]
public virtual string Name { get; private set; }
/// <summary>Gets the method name.</summary>
public override string MethodName => "get";
/// <summary>Gets the HTTP method.</summary>
public override string HttpMethod => "GET";
/// <summary>Gets the REST path.</summary>
public override string RestPath => "v4/{+name}";
/// <summary>Initializes Get parameter list.</summary>
protected override void InitParameters()
{
base.InitParameters();
RequestParameters.Add("name", new Google.Apis.Discovery.Parameter
{
Name = "name",
IsRequired = true,
ParameterType = "path",
DefaultValue = null,
Pattern = @"^projects/[^/]+/tenants/[^/]+$",
});
}
}
/// <summary>Lists all tenants associated with the project.</summary>
/// <param name="parent">Required. Resource name of the project under which the tenant is created. The format is
/// "projects/{project_id}", for example, "projects/foo".</param>
public virtual ListRequest List(string parent)
{
return new ListRequest(service, parent);
}
/// <summary>Lists all tenants associated with the project.</summary>
public class ListRequest : CloudTalentSolutionBaseServiceRequest<Google.Apis.CloudTalentSolution.v4.Data.ListTenantsResponse>
{
/// <summary>Constructs a new List request.</summary>
public ListRequest(Google.Apis.Services.IClientService service, string parent) : base(service)
{
Parent = parent;
InitParameters();
}
/// <summary>Required. Resource name of the project under which the tenant is created. The format is
/// "projects/{project_id}", for example, "projects/foo".</summary>
[Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)]
public virtual string Parent { get; private set; }
/// <summary>The maximum number of tenants to be returned, at most 100. Default is 100 if a non-positive
/// number is provided.</summary>
[Google.Apis.Util.RequestParameterAttribute("pageSize", Google.Apis.Util.RequestParameterType.Query)]
public virtual System.Nullable<int> PageSize { get; set; }
/// <summary>The starting indicator from which to return results.</summary>
[Google.Apis.Util.RequestParameterAttribute("pageToken", Google.Apis.Util.RequestParameterType.Query)]
public virtual string PageToken { get; set; }
/// <summary>Gets the method name.</summary>
public override string MethodName => "list";
/// <summary>Gets the HTTP method.</summary>
public override string HttpMethod => "GET";
/// <summary>Gets the REST path.</summary>
public override string RestPath => "v4/{+parent}/tenants";
/// <summary>Initializes List parameter list.</summary>
protected override void InitParameters()
{
base.InitParameters();
RequestParameters.Add("parent", new Google.Apis.Discovery.Parameter
{
Name = "parent",
IsRequired = true,
ParameterType = "path",
DefaultValue = null,
Pattern = @"^projects/[^/]+$",
});
RequestParameters.Add("pageSize", new Google.Apis.Discovery.Parameter
{
Name = "pageSize",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
RequestParameters.Add("pageToken", new Google.Apis.Discovery.Parameter
{
Name = "pageToken",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
}
}
/// <summary>Updates specified tenant.</summary>
/// <param name="body">The body of the request.</param>
/// <param name="name">Required during tenant update. The resource name for a tenant. This is generated by the service
/// when a tenant is created. The format is "projects/{project_id}/tenants/{tenant_id}", for example,
/// "projects/foo/tenants/bar".</param>
public virtual PatchRequest Patch(Google.Apis.CloudTalentSolution.v4.Data.Tenant body, string name)
{
return new PatchRequest(service, body, name);
}
/// <summary>Updates specified tenant.</summary>
public class PatchRequest : CloudTalentSolutionBaseServiceRequest<Google.Apis.CloudTalentSolution.v4.Data.Tenant>
{
/// <summary>Constructs a new Patch request.</summary>
public PatchRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudTalentSolution.v4.Data.Tenant body, string name) : base(service)
{
Name = name;
Body = body;
InitParameters();
}
/// <summary>Required during tenant update. The resource name for a tenant. This is generated by the
/// service when a tenant is created. The format is "projects/{project_id}/tenants/{tenant_id}", for
/// example, "projects/foo/tenants/bar".</summary>
[Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)]
public virtual string Name { get; private set; }
/// <summary>Strongly recommended for the best service experience. If update_mask is provided, only the
/// specified fields in tenant are updated. Otherwise all the fields are updated. A field mask to
/// specify the tenant fields to be updated. Only top level fields of Tenant are supported.</summary>
[Google.Apis.Util.RequestParameterAttribute("updateMask", Google.Apis.Util.RequestParameterType.Query)]
public virtual object UpdateMask { get; set; }
/// <summary>Gets or sets the body of this request.</summary>
Google.Apis.CloudTalentSolution.v4.Data.Tenant Body { get; set; }
/// <summary>Returns the body of the request.</summary>
protected override object GetBody() => Body;
/// <summary>Gets the method name.</summary>
public override string MethodName => "patch";
/// <summary>Gets the HTTP method.</summary>
public override string HttpMethod => "PATCH";
/// <summary>Gets the REST path.</summary>
public override string RestPath => "v4/{+name}";
/// <summary>Initializes Patch parameter list.</summary>
protected override void InitParameters()
{
base.InitParameters();
RequestParameters.Add("name", new Google.Apis.Discovery.Parameter
{
Name = "name",
IsRequired = true,
ParameterType = "path",
DefaultValue = null,
Pattern = @"^projects/[^/]+/tenants/[^/]+$",
});
RequestParameters.Add("updateMask", new Google.Apis.Discovery.Parameter
{
Name = "updateMask",
IsRequired = false,
ParameterType = "query",
DefaultValue = null,
Pattern = null,
});
}
}
}
}
}
namespace Google.Apis.CloudTalentSolution.v4.Data
{
/// <summary>Application related details of a job posting.</summary>
public class ApplicationInfo : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>Use this field to specify email address(es) to which resumes or applications can be sent. The
/// maximum number of allowed characters for each entry is 255.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("emails")]
public virtual System.Collections.Generic.IList<string> Emails { get; set; }
/// <summary>Use this field to provide instructions, such as "Mail your application to ...", that a candidate
/// can follow to apply for the job. This field accepts and sanitizes HTML input, and also accepts bold, italic,
/// ordered list, and unordered list markup tags. The maximum number of allowed characters is 3,000.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("instruction")]
public virtual string Instruction { get; set; }
/// <summary>Use this URI field to direct an applicant to a website, for example to link to an online
/// application form. The maximum number of allowed characters for each entry is 2,000.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("uris")]
public virtual System.Collections.Generic.IList<string> Uris { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>Request to create a batch of jobs.</summary>
public class BatchCreateJobsRequest : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>Required. The jobs to be created. A maximum of 200 jobs can be created in a batch.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("jobs")]
public virtual System.Collections.Generic.IList<Job> Jobs { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>The result of JobService.BatchCreateJobs. It's used to replace google.longrunning.Operation.response in
/// case of success.</summary>
public class BatchCreateJobsResponse : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>List of job mutation results from a batch create operation. It can change until operation status is
/// FINISHED, FAILED or CANCELLED.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("jobResults")]
public virtual System.Collections.Generic.IList<JobResult> JobResults { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>Request to delete a batch of jobs.</summary>
public class BatchDeleteJobsRequest : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>The names of the jobs to delete. The format is
/// "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}". For example, "projects/foo/tenants/bar/jobs/baz".
/// A maximum of 200 jobs can be deleted in a batch.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("names")]
public virtual System.Collections.Generic.IList<string> Names { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>The result of JobService.BatchDeleteJobs. It's used to replace google.longrunning.Operation.response in
/// case of success.</summary>
public class BatchDeleteJobsResponse : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>List of job mutation results from a batch delete operation. It can change until operation status is
/// FINISHED, FAILED or CANCELLED.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("jobResults")]
public virtual System.Collections.Generic.IList<JobResult> JobResults { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>Metadata used for long running operations returned by CTS batch APIs. It's used to replace
/// google.longrunning.Operation.metadata.</summary>
public class BatchOperationMetadata : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>The time when the batch operation is created.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("createTime")]
public virtual object CreateTime { get; set; }
/// <summary>The time when the batch operation is finished and google.longrunning.Operation.done is set to
/// `true`.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("endTime")]
public virtual object EndTime { get; set; }
/// <summary>Count of failed item(s) inside an operation.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("failureCount")]
public virtual System.Nullable<int> FailureCount { get; set; }
/// <summary>The state of a long running operation.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("state")]
public virtual string State { get; set; }
/// <summary>More detailed information about operation state.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("stateDescription")]
public virtual string StateDescription { get; set; }
/// <summary>Count of successful item(s) inside an operation.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("successCount")]
public virtual System.Nullable<int> SuccessCount { get; set; }
/// <summary>Count of total item(s) inside an operation.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("totalCount")]
public virtual System.Nullable<int> TotalCount { get; set; }
/// <summary>The time when the batch operation status is updated. The metadata and the update_time is refreshed
/// every minute otherwise cached data is returned.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("updateTime")]
public virtual object UpdateTime { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>Request to update a batch of jobs.</summary>
public class BatchUpdateJobsRequest : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>Required. The jobs to be updated. A maximum of 200 jobs can be updated in a batch.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("jobs")]
public virtual System.Collections.Generic.IList<Job> Jobs { get; set; }
/// <summary>Strongly recommended for the best service experience. Be aware that it will also increase latency
/// when checking the status of a batch operation. If update_mask is provided, only the specified fields in Job
/// are updated. Otherwise all the fields are updated. A field mask to restrict the fields that are updated.
/// Only top level fields of Job are supported. If update_mask is provided, The Job inside JobResult will only
/// contains fields that is updated, plus the Id of the Job. Otherwise, Job will include all fields, which can
/// yield a very large response.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("updateMask")]
public virtual object UpdateMask { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>The result of JobService.BatchUpdateJobs. It's used to replace google.longrunning.Operation.response in
/// case of success.</summary>
public class BatchUpdateJobsResponse : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>List of job mutation results from a batch update operation. It can change until operation status is
/// FINISHED, FAILED or CANCELLED.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("jobResults")]
public virtual System.Collections.Generic.IList<JobResult> JobResults { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>An event issued when an end user interacts with the application that implements Cloud Talent Solution.
/// Providing this information improves the quality of results for the API clients, enabling the service to perform
/// optimally. The number of events sent must be consistent with other calls, such as job searches, issued to the
/// service by the client.</summary>
public class ClientEvent : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>Required. The timestamp of the event.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("createTime")]
public virtual object CreateTime { get; set; }
/// <summary>Required. A unique identifier, generated by the client application.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("eventId")]
public virtual string EventId { get; set; }
/// <summary>Notes about the event provided by recruiters or other users, for example, feedback on why a job was
/// bookmarked.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("eventNotes")]
public virtual string EventNotes { get; set; }
/// <summary>An event issued when a job seeker interacts with the application that implements Cloud Talent
/// Solution.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("jobEvent")]
public virtual JobEvent JobEvent { get; set; }
/// <summary>Strongly recommended for the best service experience. A unique ID generated in the API responses.
/// It can be found in ResponseMetadata.request_id.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("requestId")]
public virtual string RequestId { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>Parameters needed for commute search.</summary>
public class CommuteFilter : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>If `true`, jobs without street level addresses may also be returned. For city level addresses, the
/// city center is used. For state and coarser level addresses, text matching is used. If this field is set to
/// `false` or isn't specified, only jobs that include street level addresses will be returned by commute
/// search.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("allowImpreciseAddresses")]
public virtual System.Nullable<bool> AllowImpreciseAddresses { get; set; }
/// <summary>Required. The method of transportation to calculate the commute time for.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("commuteMethod")]
public virtual string CommuteMethod { get; set; }
/// <summary>The departure time used to calculate traffic impact, represented as google.type.TimeOfDay in local
/// time zone. Currently traffic model is restricted to hour level resolution.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("departureTime")]
public virtual TimeOfDay DepartureTime { get; set; }
/// <summary>Specifies the traffic density to use when calculating commute time.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("roadTraffic")]
public virtual string RoadTraffic { get; set; }
/// <summary>Required. The latitude and longitude of the location to calculate the commute time from.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("startCoordinates")]
public virtual LatLng StartCoordinates { get; set; }
/// <summary>Required. The maximum travel time in seconds. The maximum allowed value is `3600s` (one hour).
/// Format is `123s`.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("travelDuration")]
public virtual object TravelDuration { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>Commute details related to this job.</summary>
public class CommuteInfo : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>Location used as the destination in the commute calculation.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("jobLocation")]
public virtual Location JobLocation { get; set; }
/// <summary>The number of seconds required to travel to the job location from the query location. A duration of
/// 0 seconds indicates that the job isn't reachable within the requested duration, but was returned as part of
/// an expanded query.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("travelDuration")]
public virtual object TravelDuration { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>A Company resource represents a company in the service. A company is the entity that owns job postings,
/// that is, the hiring entity responsible for employing applicants for the job position.</summary>
public class Company : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>The URI to employer's career site or careers page on the employer's web site, for example,
/// "https://careers.google.com".</summary>
[Newtonsoft.Json.JsonPropertyAttribute("careerSiteUri")]
public virtual string CareerSiteUri { get; set; }
/// <summary>Output only. Derived details about the company.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("derivedInfo")]
public virtual CompanyDerivedInfo DerivedInfo { get; set; }
/// <summary>Required. The display name of the company, for example, "Google LLC".</summary>
[Newtonsoft.Json.JsonPropertyAttribute("displayName")]
public virtual string DisplayName { get; set; }
/// <summary>Equal Employment Opportunity legal disclaimer text to be associated with all jobs, and typically to
/// be displayed in all roles. The maximum number of allowed characters is 500.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("eeoText")]
public virtual string EeoText { get; set; }
/// <summary>Required. Client side company identifier, used to uniquely identify the company. The maximum number
/// of allowed characters is 255.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("externalId")]
public virtual string ExternalId { get; set; }
/// <summary>The street address of the company's main headquarters, which may be different from the job
/// location. The service attempts to geolocate the provided address, and populates a more specific location
/// wherever possible in DerivedInfo.headquarters_location.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("headquartersAddress")]
public virtual string HeadquartersAddress { get; set; }
/// <summary>Set to true if it is the hiring agency that post jobs for other employers. Defaults to false if not
/// provided.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("hiringAgency")]
public virtual System.Nullable<bool> HiringAgency { get; set; }
/// <summary>A URI that hosts the employer's company logo.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("imageUri")]
public virtual string ImageUri { get; set; }
/// <summary>A list of keys of filterable Job.custom_attributes, whose corresponding `string_values` are used in
/// keyword searches. Jobs with `string_values` under these specified field keys are returned if any of the
/// values match the search keyword. Custom field values with parenthesis, brackets and special symbols are not
/// searchable as-is, and those keyword queries must be surrounded by quotes.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("keywordSearchableJobCustomAttributes")]
public virtual System.Collections.Generic.IList<string> KeywordSearchableJobCustomAttributes { get; set; }
/// <summary>Required during company update. The resource name for a company. This is generated by the service
/// when a company is created. The format is "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}",
/// for example, "projects/foo/tenants/bar/companies/baz".</summary>
[Newtonsoft.Json.JsonPropertyAttribute("name")]
public virtual string Name { get; set; }
/// <summary>The employer's company size.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("size")]
public virtual string Size { get; set; }
/// <summary>Output only. Indicates whether a company is flagged to be suspended from public availability by the
/// service when job content appears suspicious, abusive, or spammy.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("suspended")]
public virtual System.Nullable<bool> Suspended { get; set; }
/// <summary>The URI representing the company's primary web site or home page, for example,
/// "https://www.google.com". The maximum number of allowed characters is 255.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("websiteUri")]
public virtual string WebsiteUri { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>Derived details about the company.</summary>
public class CompanyDerivedInfo : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>A structured headquarters location of the company, resolved from Company.headquarters_address if
/// provided.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("headquartersLocation")]
public virtual Location HeadquartersLocation { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>A compensation entry that represents one component of compensation, such as base pay, bonus, or other
/// compensation type. Annualization: One compensation entry can be annualized if - it contains valid amount or
/// range. - and its expected_units_per_year is set or can be derived. Its annualized range is determined as (amount
/// or range) times expected_units_per_year.</summary>
public class CompensationEntry : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>Compensation amount.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("amount")]
public virtual Money Amount { get; set; }
/// <summary>Compensation description. For example, could indicate equity terms or provide additional context to
/// an estimated bonus.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("description")]
public virtual string Description { get; set; }
/// <summary>Expected number of units paid each year. If not specified, when Job.employment_types is FULLTIME, a
/// default value is inferred based on unit. Default values: - HOURLY: 2080 - DAILY: 260 - WEEKLY: 52 - MONTHLY:
/// 12 - ANNUAL: 1</summary>
[Newtonsoft.Json.JsonPropertyAttribute("expectedUnitsPerYear")]
public virtual System.Nullable<double> ExpectedUnitsPerYear { get; set; }
/// <summary>Compensation range.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("range")]
public virtual CompensationRange Range { get; set; }
/// <summary>Compensation type. Default is CompensationType.COMPENSATION_TYPE_UNSPECIFIED.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("type")]
public virtual string Type { get; set; }
/// <summary>Frequency of the specified amount. Default is
/// CompensationUnit.COMPENSATION_UNIT_UNSPECIFIED.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("unit")]
public virtual string Unit { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>Filter on job compensation type and amount.</summary>
public class CompensationFilter : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>If set to true, jobs with unspecified compensation range fields are included.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("includeJobsWithUnspecifiedCompensationRange")]
public virtual System.Nullable<bool> IncludeJobsWithUnspecifiedCompensationRange { get; set; }
/// <summary>Compensation range.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("range")]
public virtual CompensationRange Range { get; set; }
/// <summary>Required. Type of filter.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("type")]
public virtual string Type { get; set; }
/// <summary>Required. Specify desired `base compensation entry's` CompensationInfo.CompensationUnit.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("units")]
public virtual System.Collections.Generic.IList<string> Units { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>Job compensation details.</summary>
public class CompensationInfo : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>Output only. Annualized base compensation range. Computed as base compensation entry's
/// CompensationEntry.amount times CompensationEntry.expected_units_per_year. See CompensationEntry for
/// explanation on compensation annualization.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("annualizedBaseCompensationRange")]
public virtual CompensationRange AnnualizedBaseCompensationRange { get; set; }
/// <summary>Output only. Annualized total compensation range. Computed as all compensation entries'
/// CompensationEntry.amount times CompensationEntry.expected_units_per_year. See CompensationEntry for
/// explanation on compensation annualization.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("annualizedTotalCompensationRange")]
public virtual CompensationRange AnnualizedTotalCompensationRange { get; set; }
/// <summary>Job compensation information. At most one entry can be of type
/// CompensationInfo.CompensationType.BASE, which is referred as **base compensation entry** for the
/// job.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("entries")]
public virtual System.Collections.Generic.IList<CompensationEntry> Entries { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>Compensation range.</summary>
public class CompensationRange : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>The maximum amount of compensation. If left empty, the value is set to a maximal compensation value
/// and the currency code is set to match the currency code of min_compensation.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("maxCompensation")]
public virtual Money MaxCompensation { get; set; }
/// <summary>The minimum amount of compensation. If left empty, the value is set to zero and the currency code
/// is set to match the currency code of max_compensation.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("minCompensation")]
public virtual Money MinCompensation { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>Response of auto-complete query.</summary>
public class CompleteQueryResponse : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>Results of the matching job/company candidates.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("completionResults")]
public virtual System.Collections.Generic.IList<CompletionResult> CompletionResults { get; set; }
/// <summary>Additional information for the API invocation, such as the request tracking id.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("metadata")]
public virtual ResponseMetadata Metadata { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>Resource that represents completion results.</summary>
public class CompletionResult : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>The URI of the company image for COMPANY_NAME.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("imageUri")]
public virtual string ImageUri { get; set; }
/// <summary>The suggestion for the query.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("suggestion")]
public virtual string Suggestion { get; set; }
/// <summary>The completion topic.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("type")]
public virtual string Type { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>Custom attribute values that are either filterable or non-filterable.</summary>
public class CustomAttribute : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>If the `filterable` flag is true, the custom field values may be used for custom attribute filters
/// JobQuery.custom_attribute_filter. If false, these values may not be used for custom attribute filters.
/// Default is false.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("filterable")]
public virtual System.Nullable<bool> Filterable { get; set; }
/// <summary>If the `keyword_searchable` flag is true, the keywords in custom fields are searchable by keyword
/// match. If false, the values are not searchable by keyword match. Default is false.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("keywordSearchable")]
public virtual System.Nullable<bool> KeywordSearchable { get; set; }
/// <summary>Exactly one of string_values or long_values must be specified. This field is used to perform number
/// range search. (`EQ`, `GT`, `GE`, `LE`, `LT`) over filterable `long_value`. Currently at most 1 long_values
/// is supported.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("longValues")]
public virtual System.Collections.Generic.IList<System.Nullable<long>> LongValues { get; set; }
/// <summary>Exactly one of string_values or long_values must be specified. This field is used to perform a
/// string match (`CASE_SENSITIVE_MATCH` or `CASE_INSENSITIVE_MATCH`) search. For filterable `string_value`s, a
/// maximum total number of 200 values is allowed, with each `string_value` has a byte size of no more than
/// 500B. For unfilterable `string_values`, the maximum total byte size of unfilterable `string_values` is 50KB.
/// Empty string isn't allowed.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("stringValues")]
public virtual System.Collections.Generic.IList<string> StringValues { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>Custom ranking information for SearchJobsRequest.</summary>
public class CustomRankingInfo : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>Required. Controls over how important the score of CustomRankingInfo.ranking_expression gets
/// applied to job's final ranking position. An error is thrown if not specified.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("importanceLevel")]
public virtual string ImportanceLevel { get; set; }
/// <summary>Required. Controls over how job documents get ranked on top of existing relevance score (determined
/// by API algorithm). A combination of the ranking expression and relevance score is used to determine job's
/// final ranking position. The syntax for this expression is a subset of Google SQL syntax. Supported operators
/// are: +, -, *, /, where the left and right side of the operator is either a numeric Job.custom_attributes
/// key, integer/double value or an expression that can be evaluated to a number. Parenthesis are supported to
/// adjust calculation precedence. The expression must be < 100 characters in length. The expression is
/// considered invalid for a job if the expression references custom attributes that are not populated on the
/// job or if the expression results in a divide by zero. If an expression is invalid for a job, that job is
/// demoted to the end of the results. Sample ranking expression (year + 25) * 0.25 - (freshness /
/// 0.5)</summary>
[Newtonsoft.Json.JsonPropertyAttribute("rankingExpression")]
public virtual string RankingExpression { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>Device information collected from the job seeker, candidate, or other entity conducting the job search.
/// Providing this information improves the quality of the search results across devices.</summary>
public class DeviceInfo : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>Type of the device.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("deviceType")]
public virtual string DeviceType { get; set; }
/// <summary>A device-specific ID. The ID must be a unique identifier that distinguishes the device from other
/// devices.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("id")]
public virtual string Id { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A
/// typical example is to use it as the request or the response type of an API method. For instance: service Foo {
/// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON representation for `Empty` is empty
/// JSON object `{}`.</summary>
public class Empty : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>The histogram request.</summary>
public class HistogramQuery : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>An expression specifies a histogram request against matching jobs for searches. See
/// SearchJobsRequest.histogram_queries for details about syntax.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("histogramQuery")]
public virtual string HistogramQueryValue { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>Histogram result that matches HistogramQuery specified in searches.</summary>
public class HistogramQueryResult : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>A map from the values of the facet associated with distinct values to the number of matching
/// entries with corresponding value. The key format is: * (for string histogram) string values stored in the
/// field. * (for named numeric bucket) name specified in `bucket()` function, like for `bucket(0, MAX, "non-
/// negative")`, the key will be `non-negative`. * (for anonymous numeric bucket) range formatted as `-`, for
/// example, `0-1000`, `MIN-0`, and `0-MAX`.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("histogram")]
public virtual System.Collections.Generic.IDictionary<string, System.Nullable<long>> Histogram { get; set; }
/// <summary>Requested histogram expression.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("histogramQuery")]
public virtual string HistogramQuery { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>A Job resource represents a job posting (also referred to as a "job listing" or "job requisition"). A
/// job belongs to a Company, which is the hiring entity responsible for the job.</summary>
public class Job : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>Strongly recommended for the best service experience. Location(s) where the employer is looking to
/// hire for this job posting. Specifying the full street address(es) of the hiring location enables better API
/// results, especially job searches by commute time. At most 50 locations are allowed for best search
/// performance. If a job has more locations, it is suggested to split it into multiple jobs with unique
/// requisition_ids (e.g. 'ReqA' becomes 'ReqA-1', 'ReqA-2', and so on.) as multiple jobs with the same company,
/// language_code and requisition_id are not allowed. If the original requisition_id must be preserved, a custom
/// field should be used for storage. It is also suggested to group the locations that close to each other in
/// the same job for better search experience. The maximum number of allowed characters is 500.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("addresses")]
public virtual System.Collections.Generic.IList<string> Addresses { get; set; }
/// <summary>Job application information.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("applicationInfo")]
public virtual ApplicationInfo ApplicationInfo { get; set; }
/// <summary>Required. The resource name of the company listing the job. The format is
/// "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}". For example,
/// "projects/foo/tenants/bar/companies/baz".</summary>
[Newtonsoft.Json.JsonPropertyAttribute("company")]
public virtual string Company { get; set; }
/// <summary>Output only. Display name of the company listing the job.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("companyDisplayName")]
public virtual string CompanyDisplayName { get; set; }
/// <summary>Job compensation information (a.k.a. "pay rate") i.e., the compensation that will paid to the
/// employee.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("compensationInfo")]
public virtual CompensationInfo CompensationInfo { get; set; }
/// <summary>A map of fields to hold both filterable and non-filterable custom job attributes that are not
/// covered by the provided structured fields. The keys of the map are strings up to 64 bytes and must match the
/// pattern: a-zA-Z*. For example, key0LikeThis or KEY_1_LIKE_THIS. At most 100 filterable and at most 100
/// unfilterable keys are supported. For filterable `string_values`, across all keys at most 200 values are
/// allowed, with each string no more than 255 characters. For unfilterable `string_values`, the maximum total
/// size of `string_values` across all keys is 50KB.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("customAttributes")]
public virtual System.Collections.Generic.IDictionary<string, CustomAttribute> CustomAttributes { get; set; }
/// <summary>The desired education degrees for the job, such as Bachelors, Masters.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("degreeTypes")]
public virtual System.Collections.Generic.IList<string> DegreeTypes { get; set; }
/// <summary>The department or functional area within the company with the open position. The maximum number of
/// allowed characters is 255.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("department")]
public virtual string Department { get; set; }
/// <summary>Output only. Derived details about the job posting.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("derivedInfo")]
public virtual JobDerivedInfo DerivedInfo { get; set; }
/// <summary>Required. The description of the job, which typically includes a multi-paragraph description of the
/// company and related information. Separate fields are provided on the job object for responsibilities,
/// qualifications, and other job characteristics. Use of these separate job fields is recommended. This field
/// accepts and sanitizes HTML input, and also accepts bold, italic, ordered list, and unordered list markup
/// tags. The maximum number of allowed characters is 100,000.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("description")]
public virtual string Description { get; set; }
/// <summary>The employment type(s) of a job, for example, full time or part time.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("employmentTypes")]
public virtual System.Collections.Generic.IList<string> EmploymentTypes { get; set; }
/// <summary>A description of bonus, commission, and other compensation incentives associated with the job not
/// including salary or pay. The maximum number of allowed characters is 10,000.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("incentives")]
public virtual string Incentives { get; set; }
/// <summary>The benefits included with the job.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("jobBenefits")]
public virtual System.Collections.Generic.IList<string> JobBenefits { get; set; }
/// <summary>The end timestamp of the job. Typically this field is used for contracting engagements. Invalid
/// timestamps are ignored.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("jobEndTime")]
public virtual object JobEndTime { get; set; }
/// <summary>The experience level associated with the job, such as "Entry Level".</summary>
[Newtonsoft.Json.JsonPropertyAttribute("jobLevel")]
public virtual string JobLevel { get; set; }
/// <summary>The start timestamp of the job in UTC time zone. Typically this field is used for contracting
/// engagements. Invalid timestamps are ignored.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("jobStartTime")]
public virtual object JobStartTime { get; set; }
/// <summary>The language of the posting. This field is distinct from any requirements for fluency that are
/// associated with the job. Language codes must be in BCP-47 format, such as "en-US" or "sr-Latn". For more
/// information, see [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47){: class="external"
/// target="_blank" }. If this field is unspecified and Job.description is present, detected language code based
/// on Job.description is assigned, otherwise defaults to 'en_US'.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("languageCode")]
public virtual string LanguageCode { get; set; }
/// <summary>Required during job update. The resource name for the job. This is generated by the service when a
/// job is created. The format is "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}". For example,
/// "projects/foo/tenants/bar/jobs/baz". Use of this field in job queries and API calls is preferred over the
/// use of requisition_id since this value is unique.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("name")]
public virtual string Name { get; set; }
/// <summary>Output only. The timestamp when this job posting was created.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("postingCreateTime")]
public virtual object PostingCreateTime { get; set; }
/// <summary>Strongly recommended for the best service experience. The expiration timestamp of the job. After
/// this timestamp, the job is marked as expired, and it no longer appears in search results. The expired job
/// can't be listed by the ListJobs API, but it can be retrieved with the GetJob API or updated with the
/// UpdateJob API or deleted with the DeleteJob API. An expired job can be updated and opened again by using a
/// future expiration timestamp. Updating an expired job fails if there is another existing open job with same
/// company, language_code and requisition_id. The expired jobs are retained in our system for 90 days. However,
/// the overall expired job count cannot exceed 3 times the maximum number of open jobs over previous 7 days. If
/// this threshold is exceeded, expired jobs are cleaned out in order of earliest expire time. Expired jobs are
/// no longer accessible after they are cleaned out. Invalid timestamps are ignored, and treated as expire time
/// not provided. If the timestamp is before the instant request is made, the job is treated as expired
/// immediately on creation. This kind of job can not be updated. And when creating a job with past timestamp,
/// the posting_publish_time must be set before posting_expire_time. The purpose of this feature is to allow
/// other objects, such as Application, to refer a job that didn't exist in the system prior to becoming
/// expired. If you want to modify a job that was expired on creation, delete it and create a new one. If this
/// value isn't provided at the time of job creation or is invalid, the job posting expires after 30 days from
/// the job's creation time. For example, if the job was created on 2017/01/01 13:00AM UTC with an unspecified
/// expiration date, the job expires after 2017/01/31 13:00AM UTC. If this value isn't provided on job update,
/// it depends on the field masks set by UpdateJobRequest.update_mask. If the field masks include job_end_time,
/// or the masks are empty meaning that every field is updated, the job posting expires after 30 days from the
/// job's last update time. Otherwise the expiration date isn't updated.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("postingExpireTime")]
public virtual object PostingExpireTime { get; set; }
/// <summary>The timestamp this job posting was most recently published. The default value is the time the
/// request arrives at the server. Invalid timestamps are ignored.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("postingPublishTime")]
public virtual object PostingPublishTime { get; set; }
/// <summary>The job PostingRegion (for example, state, country) throughout which the job is available. If this
/// field is set, a LocationFilter in a search query within the job region finds this job posting if an exact
/// location match isn't specified. If this field is set to PostingRegion.NATION or
/// PostingRegion.ADMINISTRATIVE_AREA, setting job Job.addresses to the same location level as this field is
/// strongly recommended.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("postingRegion")]
public virtual string PostingRegion { get; set; }
/// <summary>Output only. The timestamp when this job posting was last updated.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("postingUpdateTime")]
public virtual object PostingUpdateTime { get; set; }
/// <summary>Options for job processing.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("processingOptions")]
public virtual ProcessingOptions ProcessingOptions { get; set; }
/// <summary>A promotion value of the job, as determined by the client. The value determines the sort order of
/// the jobs returned when searching for jobs using the featured jobs search call, with higher promotional
/// values being returned first and ties being resolved by relevance sort. Only the jobs with a promotionValue
/// >0 are returned in a FEATURED_JOB_SEARCH. Default value is 0, and negative values are treated as
/// 0.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("promotionValue")]
public virtual System.Nullable<int> PromotionValue { get; set; }
/// <summary>A description of the qualifications required to perform the job. The use of this field is
/// recommended as an alternative to using the more general description field. This field accepts and sanitizes
/// HTML input, and also accepts bold, italic, ordered list, and unordered list markup tags. The maximum number
/// of allowed characters is 10,000.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("qualifications")]
public virtual string Qualifications { get; set; }
/// <summary>Required. The requisition ID, also referred to as the posting ID, is assigned by the client to
/// identify a job. This field is intended to be used by clients for client identification and tracking of
/// postings. A job isn't allowed to be created if there is another job with the same company, language_code and
/// requisition_id. The maximum number of allowed characters is 255.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("requisitionId")]
public virtual string RequisitionId { get; set; }
/// <summary>A description of job responsibilities. The use of this field is recommended as an alternative to
/// using the more general description field. This field accepts and sanitizes HTML input, and also accepts
/// bold, italic, ordered list, and unordered list markup tags. The maximum number of allowed characters is
/// 10,000.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("responsibilities")]
public virtual string Responsibilities { get; set; }
/// <summary>Required. The title of the job, such as "Software Engineer" The maximum number of allowed
/// characters is 500.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("title")]
public virtual string Title { get; set; }
/// <summary>Deprecated. The job is only visible to the owner. The visibility of the job. Defaults to
/// Visibility.ACCOUNT_ONLY if not specified.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("visibility")]
public virtual string Visibility { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>Derived details about the job posting.</summary>
public class JobDerivedInfo : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>Job categories derived from Job.title and Job.description.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("jobCategories")]
public virtual System.Collections.Generic.IList<string> JobCategories { get; set; }
/// <summary>Structured locations of the job, resolved from Job.addresses. locations are exactly matched to
/// Job.addresses in the same order.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("locations")]
public virtual System.Collections.Generic.IList<Location> Locations { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>An event issued when a job seeker interacts with the application that implements Cloud Talent
/// Solution.</summary>
public class JobEvent : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>Required. The job name(s) associated with this event. For example, if this is an impression event,
/// this field contains the identifiers of all jobs shown to the job seeker. If this was a view event, this
/// field contains the identifier of the viewed job. The format is
/// "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}", for example,
/// "projects/foo/tenants/bar/jobs/baz".</summary>
[Newtonsoft.Json.JsonPropertyAttribute("jobs")]
public virtual System.Collections.Generic.IList<string> Jobs { get; set; }
/// <summary>Required. The type of the event (see JobEventType).</summary>
[Newtonsoft.Json.JsonPropertyAttribute("type")]
public virtual string Type { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>The query required to perform a search query.</summary>
public class JobQuery : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>Allows filtering jobs by commute time with different travel methods (for example, driving or public
/// transit). Note: This only works when you specify a CommuteMethod. In this case, location_filters is ignored.
/// Currently we don't support sorting by commute time.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("commuteFilter")]
public virtual CommuteFilter CommuteFilter { get; set; }
/// <summary>This filter specifies the company entities to search against. If a value isn't specified, jobs are
/// searched for against all companies. If multiple values are specified, jobs are searched against the
/// companies specified. The format is "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}". For
/// example, "projects/foo/tenants/bar/companies/baz". At most 20 company filters are allowed.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("companies")]
public virtual System.Collections.Generic.IList<string> Companies { get; set; }
/// <summary>This filter specifies the exact company Company.display_name of the jobs to search against. If a
/// value isn't specified, jobs within the search results are associated with any company. If multiple values
/// are specified, jobs within the search results may be associated with any of the specified companies. At most
/// 20 company display name filters are allowed.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("companyDisplayNames")]
public virtual System.Collections.Generic.IList<string> CompanyDisplayNames { get; set; }
/// <summary>This search filter is applied only to Job.compensation_info. For example, if the filter is
/// specified as "Hourly job with per-hour compensation > $15", only jobs meeting these criteria are searched.
/// If a filter isn't defined, all open jobs are searched.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("compensationFilter")]
public virtual CompensationFilter CompensationFilter { get; set; }
/// <summary>This filter specifies a structured syntax to match against the Job.custom_attributes marked as
/// `filterable`. The syntax for this expression is a subset of SQL syntax. Supported operators are: `=`, `!=`,
/// `<`, `<=`, `>`, and `>=` where the left of the operator is a custom field key and the right of the operator
/// is a number or a quoted string. You must escape backslash (\\) and quote (\") characters. Supported
/// functions are `LOWER([field_name])` to perform a case insensitive match and `EMPTY([field_name])` to filter
/// on the existence of a key. Boolean expressions (AND/OR/NOT) are supported up to 3 levels of nesting (for
/// example, "((A AND B AND C) OR NOT D) AND E"), a maximum of 100 comparisons or functions are allowed in the
/// expression. The expression must be < 6000 bytes in length. Sample Query: `(LOWER(driving_license)="class
/// \"a\"" OR EMPTY(driving_license)) AND driving_years > 10`</summary>
[Newtonsoft.Json.JsonPropertyAttribute("customAttributeFilter")]
public virtual string CustomAttributeFilter { get; set; }
/// <summary>This flag controls the spell-check feature. If false, the service attempts to correct a misspelled
/// query, for example, "enginee" is corrected to "engineer". Defaults to false: a spell check is
/// performed.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("disableSpellCheck")]
public virtual System.Nullable<bool> DisableSpellCheck { get; set; }
/// <summary>The employment type filter specifies the employment type of jobs to search against, such as
/// EmploymentType.FULL_TIME. If a value isn't specified, jobs in the search results includes any employment
/// type. If multiple values are specified, jobs in the search results include any of the specified employment
/// types.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("employmentTypes")]
public virtual System.Collections.Generic.IList<string> EmploymentTypes { get; set; }
/// <summary>This filter specifies a list of job names to be excluded during search. At most 400 excluded job
/// names are allowed.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("excludedJobs")]
public virtual System.Collections.Generic.IList<string> ExcludedJobs { get; set; }
/// <summary>The category filter specifies the categories of jobs to search against. See JobCategory for more
/// information. If a value isn't specified, jobs from any category are searched against. If multiple values are
/// specified, jobs from any of the specified categories are searched against.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("jobCategories")]
public virtual System.Collections.Generic.IList<string> JobCategories { get; set; }
/// <summary>This filter specifies the locale of jobs to search against, for example, "en-US". If a value isn't
/// specified, the search results can contain jobs in any locale. Language codes should be in BCP-47 format,
/// such as "en-US" or "sr-Latn". For more information, see [Tags for Identifying
/// Languages](https://tools.ietf.org/html/bcp47). At most 10 language code filters are allowed.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("languageCodes")]
public virtual System.Collections.Generic.IList<string> LanguageCodes { get; set; }
/// <summary>The location filter specifies geo-regions containing the jobs to search against. See LocationFilter
/// for more information. If a location value isn't specified, jobs fitting the other search criteria are
/// retrieved regardless of where they're located. If multiple values are specified, jobs are retrieved from any
/// of the specified locations. If different values are specified for the LocationFilter.distance_in_miles
/// parameter, the maximum provided distance is used for all locations. At most 5 location filters are
/// allowed.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("locationFilters")]
public virtual System.Collections.Generic.IList<LocationFilter> LocationFilters { get; set; }
/// <summary>Jobs published within a range specified by this filter are searched against.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("publishTimeRange")]
public virtual TimestampRange PublishTimeRange { get; set; }
/// <summary>The query string that matches against the job title, description, and location fields. The maximum
/// number of allowed characters is 255.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("query")]
public virtual string Query { get; set; }
/// <summary>The language code of query. For example, "en-US". This field helps to better interpret the query.
/// If a value isn't specified, the query language code is automatically detected, which may not be accurate.
/// Language code should be in BCP-47 format, such as "en-US" or "sr-Latn". For more information, see [Tags for
/// Identifying Languages](https://tools.ietf.org/html/bcp47).</summary>
[Newtonsoft.Json.JsonPropertyAttribute("queryLanguageCode")]
public virtual string QueryLanguageCode { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>Mutation result of a job from a batch operation.</summary>
public class JobResult : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>Here Job only contains basic information including name, company, language_code and requisition_id,
/// use getJob method to retrieve detailed information of the created/updated job.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("job")]
public virtual Job Job { get; set; }
/// <summary>The status of the job processed. This field is populated if the processing of the job
/// fails.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("status")]
public virtual Status Status { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to
/// represent degrees latitude and degrees longitude. Unless specified otherwise, this must conform to the WGS84
/// standard. Values must be within normalized ranges.</summary>
public class LatLng : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>The latitude in degrees. It must be in the range [-90.0, +90.0].</summary>
[Newtonsoft.Json.JsonPropertyAttribute("latitude")]
public virtual System.Nullable<double> Latitude { get; set; }
/// <summary>The longitude in degrees. It must be in the range [-180.0, +180.0].</summary>
[Newtonsoft.Json.JsonPropertyAttribute("longitude")]
public virtual System.Nullable<double> Longitude { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>The List companies response object.</summary>
public class ListCompaniesResponse : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>Companies for the current client.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("companies")]
public virtual System.Collections.Generic.IList<Company> Companies { get; set; }
/// <summary>Additional information for the API invocation, such as the request tracking id.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("metadata")]
public virtual ResponseMetadata Metadata { get; set; }
/// <summary>A token to retrieve the next page of results.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("nextPageToken")]
public virtual string NextPageToken { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>List jobs response.</summary>
public class ListJobsResponse : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>The Jobs for a given company. The maximum number of items returned is based on the limit field
/// provided in the request.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("jobs")]
public virtual System.Collections.Generic.IList<Job> Jobs { get; set; }
/// <summary>Additional information for the API invocation, such as the request tracking id.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("metadata")]
public virtual ResponseMetadata Metadata { get; set; }
/// <summary>A token to retrieve the next page of results.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("nextPageToken")]
public virtual string NextPageToken { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>The List tenants response object.</summary>
public class ListTenantsResponse : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>Additional information for the API invocation, such as the request tracking id.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("metadata")]
public virtual ResponseMetadata Metadata { get; set; }
/// <summary>A token to retrieve the next page of results.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("nextPageToken")]
public virtual string NextPageToken { get; set; }
/// <summary>Tenants for the current client.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("tenants")]
public virtual System.Collections.Generic.IList<Tenant> Tenants { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>A resource that represents a location with full geographic information.</summary>
public class Location : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>An object representing a latitude/longitude pair.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("latLng")]
public virtual LatLng LatLng { get; set; }
/// <summary>The type of a location, which corresponds to the address lines field of google.type.PostalAddress.
/// For example, "Downtown, Atlanta, GA, USA" has a type of LocationType.NEIGHBORHOOD, and "Kansas City, KS,
/// USA" has a type of LocationType.LOCALITY.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("locationType")]
public virtual string LocationType { get; set; }
/// <summary>Postal address of the location that includes human readable information, such as postal delivery
/// and payments addresses. Given a postal address, a postal service can deliver items to a premises, P.O. Box,
/// or other delivery location.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("postalAddress")]
public virtual PostalAddress PostalAddress { get; set; }
/// <summary>Radius in miles of the job location. This value is derived from the location bounding box in which
/// a circle with the specified radius centered from google.type.LatLng covers the area associated with the job
/// location. For example, currently, "Mountain View, CA, USA" has a radius of 6.17 miles.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("radiusMiles")]
public virtual System.Nullable<double> RadiusMiles { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>Geographic region of the search.</summary>
public class LocationFilter : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>The address name, such as "Mountain View" or "Bay Area".</summary>
[Newtonsoft.Json.JsonPropertyAttribute("address")]
public virtual string Address { get; set; }
/// <summary>The distance_in_miles is applied when the location being searched for is identified as a city or
/// smaller. This field is ignored if the location being searched for is a state or larger.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("distanceInMiles")]
public virtual System.Nullable<double> DistanceInMiles { get; set; }
/// <summary>The latitude and longitude of the geographic center to search from. This field is ignored if
/// `address` is provided.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("latLng")]
public virtual LatLng LatLng { get; set; }
/// <summary>CLDR region code of the country/region of the address. This is used to address ambiguity of the
/// user-input location, for example, "Liverpool" against "Liverpool, NY, US" or "Liverpool, UK". Set this field
/// to bias location resolution toward a specific country or territory. If this field is not set, application
/// behavior is biased toward the United States by default. See
/// https://www.unicode.org/cldr/charts/30/supplemental/territory_information.html for details. Example: "CH"
/// for Switzerland.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("regionCode")]
public virtual string RegionCode { get; set; }
/// <summary>Allows the client to return jobs without a set location, specifically, telecommuting jobs
/// (telecommuting is considered by the service as a special location. Job.posting_region indicates if a job
/// permits telecommuting. If this field is set to TelecommutePreference.TELECOMMUTE_ALLOWED, telecommuting jobs
/// are searched, and address and lat_lng are ignored. If not set or set to
/// TelecommutePreference.TELECOMMUTE_EXCLUDED, telecommute job are not searched. This filter can be used by
/// itself to search exclusively for telecommuting jobs, or it can be combined with another location filter to
/// search for a combination of job locations, such as "Mountain View" or "telecommuting" jobs. However, when
/// used in combination with other location filters, telecommuting jobs can be treated as less relevant than
/// other jobs in the search response. This field is only used for job search requests.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("telecommutePreference")]
public virtual string TelecommutePreference { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>Job entry with metadata inside SearchJobsResponse.</summary>
public class MatchingJob : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>Commute information which is generated based on specified CommuteFilter.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("commuteInfo")]
public virtual CommuteInfo CommuteInfo { get; set; }
/// <summary>Job resource that matches the specified SearchJobsRequest.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("job")]
public virtual Job Job { get; set; }
/// <summary>A summary of the job with core information that's displayed on the search results listing
/// page.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("jobSummary")]
public virtual string JobSummary { get; set; }
/// <summary>Contains snippets of text from the Job.title field most closely matching a search query's keywords,
/// if available. The matching query keywords are enclosed in HTML bold tags.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("jobTitleSnippet")]
public virtual string JobTitleSnippet { get; set; }
/// <summary>Contains snippets of text from the Job.description and similar fields that most closely match a
/// search query's keywords, if available. All HTML tags in the original fields are stripped when returned in
/// this field, and matching query keywords are enclosed in HTML bold tags.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("searchTextSnippet")]
public virtual string SearchTextSnippet { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>Message representing input to a Mendel server for debug forcing. See go/mendel-debug-forcing for more
/// details. Next ID: 2</summary>
public class MendelDebugInput : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>When a request spans multiple servers, a MendelDebugInput may travel with the request and take
/// effect in all the servers. This field is a map of namespaces to NamespacedMendelDebugInput protos. In a
/// single server, up to two NamespacedMendelDebugInput protos are applied: 1. NamespacedMendelDebugInput with
/// the global namespace (key == ""). 2. NamespacedMendelDebugInput with the server's namespace. When both
/// NamespacedMendelDebugInput protos are present, they are merged. See go/mendel-debug-forcing for more
/// details.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("namespacedDebugInput")]
public virtual System.Collections.Generic.IDictionary<string, NamespacedDebugInput> NamespacedDebugInput { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>Represents an amount of money with its currency type.</summary>
public class Money : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>The three-letter currency code defined in ISO 4217.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("currencyCode")]
public virtual string CurrencyCode { get; set; }
/// <summary>Number of nano (10^-9) units of the amount. The value must be between -999,999,999 and +999,999,999
/// inclusive. If `units` is positive, `nanos` must be positive or zero. If `units` is zero, `nanos` can be
/// positive, zero, or negative. If `units` is negative, `nanos` must be negative or zero. For example $-1.75 is
/// represented as `units`=-1 and `nanos`=-750,000,000.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("nanos")]
public virtual System.Nullable<int> Nanos { get; set; }
/// <summary>The whole units of the amount. For example if `currencyCode` is `"USD"`, then 1 unit is one US
/// dollar.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("units")]
public virtual System.Nullable<long> Units { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>Next ID: 15</summary>
public class NamespacedDebugInput : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>Set of experiment names to be absolutely forced. These experiments will be forced without
/// evaluating the conditions.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("absolutelyForcedExpNames")]
public virtual System.Collections.Generic.IList<string> AbsolutelyForcedExpNames { get; set; }
/// <summary>Set of experiment tags to be absolutely forced. The experiments with these tags will be forced
/// without evaluating the conditions.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("absolutelyForcedExpTags")]
public virtual System.Collections.Generic.IList<string> AbsolutelyForcedExpTags { get; set; }
/// <summary>Set of experiment ids to be absolutely forced. These ids will be forced without evaluating the
/// conditions.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("absolutelyForcedExps")]
public virtual System.Collections.Generic.IList<System.Nullable<int>> AbsolutelyForcedExps { get; set; }
/// <summary>Set of experiment names to be conditionally forced. These experiments will be forced only if their
/// conditions and their parent domain's conditions are true.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("conditionallyForcedExpNames")]
public virtual System.Collections.Generic.IList<string> ConditionallyForcedExpNames { get; set; }
/// <summary>Set of experiment tags to be conditionally forced. The experiments with these tags will be forced
/// only if their conditions and their parent domain's conditions are true.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("conditionallyForcedExpTags")]
public virtual System.Collections.Generic.IList<string> ConditionallyForcedExpTags { get; set; }
/// <summary>Set of experiment ids to be conditionally forced. These ids will be forced only if their conditions
/// and their parent domain's conditions are true.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("conditionallyForcedExps")]
public virtual System.Collections.Generic.IList<System.Nullable<int>> ConditionallyForcedExps { get; set; }
/// <summary>If true, disable automatic enrollment selection (at all diversion points). Automatic enrollment
/// selection means experiment selection process based on the experiment's automatic enrollment condition. This
/// does not disable selection of forced experiments.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("disableAutomaticEnrollmentSelection")]
public virtual System.Nullable<bool> DisableAutomaticEnrollmentSelection { get; set; }
/// <summary>Set of experiment names to be disabled. If an experiment is disabled, it is never selected nor
/// forced. If an aggregate experiment is disabled, its partitions are disabled together. If an experiment with
/// an enrollment is disabled, the enrollment is disabled together. If a name corresponds to a domain, the
/// domain itself and all descendant experiments and domains are disabled together.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("disableExpNames")]
public virtual System.Collections.Generic.IList<string> DisableExpNames { get; set; }
/// <summary>Set of experiment tags to be disabled. All experiments that are tagged with one or more of these
/// tags are disabled. If an experiment is disabled, it is never selected nor forced. If an aggregate experiment
/// is disabled, its partitions are disabled together. If an experiment with an enrollment is disabled, the
/// enrollment is disabled together.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("disableExpTags")]
public virtual System.Collections.Generic.IList<string> DisableExpTags { get; set; }
/// <summary>Set of experiment ids to be disabled. If an experiment is disabled, it is never selected nor
/// forced. If an aggregate experiment is disabled, its partitions are disabled together. If an experiment with
/// an enrollment is disabled, the enrollment is disabled together. If an ID corresponds to a domain, the domain
/// itself and all descendant experiments and domains are disabled together.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("disableExps")]
public virtual System.Collections.Generic.IList<System.Nullable<int>> DisableExps { get; set; }
/// <summary>If true, disable manual enrollment selection (at all diversion points). Manual enrollment selection
/// means experiment selection process based on the request's manual enrollment states (a.k.a. opt-in
/// experiments). This does not disable selection of forced experiments.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("disableManualEnrollmentSelection")]
public virtual System.Nullable<bool> DisableManualEnrollmentSelection { get; set; }
/// <summary>If true, disable organic experiment selection (at all diversion points). Organic selection means
/// experiment selection process based on traffic allocation and diversion condition evaluation. This does not
/// disable selection of forced experiments. This is useful in cases when it is not known whether experiment
/// selection behavior is responsible for a error or breakage. Disabling organic selection may help to isolate
/// the cause of a given problem.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("disableOrganicSelection")]
public virtual System.Nullable<bool> DisableOrganicSelection { get; set; }
/// <summary>Flags to force in a particular experiment state. Map from flag name to flag value.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("forcedFlags")]
public virtual System.Collections.Generic.IDictionary<string, string> ForcedFlags { get; set; }
/// <summary>Rollouts to force in a particular experiment state. Map from rollout name to rollout
/// value.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("forcedRollouts")]
public virtual System.Collections.Generic.IDictionary<string, System.Nullable<bool>> ForcedRollouts { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>This resource represents a long-running operation that is the result of a network API call.</summary>
public class Operation : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>If the value is `false`, it means the operation is still in progress. If `true`, the operation is
/// completed, and either `error` or `response` is available.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("done")]
public virtual System.Nullable<bool> Done { get; set; }
/// <summary>The error result of the operation in case of failure or cancellation.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("error")]
public virtual Status Error { get; set; }
/// <summary>Service-specific metadata associated with the operation. It typically contains progress information
/// and common metadata such as create time. Some services might not provide such metadata. Any method that
/// returns a long-running operation should document the metadata type, if any.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("metadata")]
public virtual System.Collections.Generic.IDictionary<string, object> Metadata { get; set; }
/// <summary>The server-assigned name, which is only unique within the same service that originally returns it.
/// If you use the default HTTP mapping, the `name` should be a resource name ending with
/// `operations/{unique_id}`.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("name")]
public virtual string Name { get; set; }
/// <summary>The normal response of the operation in case of success. If the original method returns no data on
/// success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard
/// `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have
/// the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is
/// `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("response")]
public virtual System.Collections.Generic.IDictionary<string, object> Response { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>Represents a postal address, e.g. for postal delivery or payments addresses. Given a postal address, a
/// postal service can deliver items to a premise, P.O. Box or similar. It is not intended to model geographical
/// locations (roads, towns, mountains). In typical usage an address would be created via user input or from
/// importing existing data, depending on the type of process. Advice on address input / editing: - Use an i18n-
/// ready address widget such as https://github.com/google/libaddressinput) - Users should not be presented with UI
/// elements for input or editing of fields outside countries where that field is used. For more guidance on how to
/// use this schema, please see: https://support.google.com/business/answer/6397478</summary>
public class PostalAddress : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>Unstructured address lines describing the lower levels of an address. Because values in
/// address_lines do not have type information and may sometimes contain multiple values in a single field (e.g.
/// "Austin, TX"), it is important that the line order is clear. The order of address lines should be "envelope
/// order" for the country/region of the address. In places where this can vary (e.g. Japan), address_language
/// is used to make it explicit (e.g. "ja" for large-to-small ordering and "ja-Latn" or "en" for small-to-
/// large). This way, the most specific line of an address can be selected based on the language. The minimum
/// permitted structural representation of an address consists of a region_code with all remaining information
/// placed in the address_lines. It would be possible to format such an address very approximately without
/// geocoding, but no semantic reasoning could be made about any of the address components until it was at least
/// partially resolved. Creating an address only containing a region_code and address_lines, and then geocoding
/// is the recommended way to handle completely unstructured addresses (as opposed to guessing which parts of
/// the address should be localities or administrative areas).</summary>
[Newtonsoft.Json.JsonPropertyAttribute("addressLines")]
public virtual System.Collections.Generic.IList<string> AddressLines { get; set; }
/// <summary>Optional. Highest administrative subdivision which is used for postal addresses of a country or
/// region. For example, this can be a state, a province, an oblast, or a prefecture. Specifically, for Spain
/// this is the province and not the autonomous community (e.g. "Barcelona" and not "Catalonia"). Many countries
/// don't use an administrative area in postal addresses. E.g. in Switzerland this should be left
/// unpopulated.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("administrativeArea")]
public virtual string AdministrativeArea { get; set; }
/// <summary>Optional. BCP-47 language code of the contents of this address (if known). This is often the UI
/// language of the input form or is expected to match one of the languages used in the address' country/region,
/// or their transliterated equivalents. This can affect formatting in certain countries, but is not critical to
/// the correctness of the data and will never affect any validation or other non-formatting related operations.
/// If this value is not known, it should be omitted (rather than specifying a possibly incorrect default).
/// Examples: "zh-Hant", "ja", "ja-Latn", "en".</summary>
[Newtonsoft.Json.JsonPropertyAttribute("languageCode")]
public virtual string LanguageCode { get; set; }
/// <summary>Optional. Generally refers to the city/town portion of the address. Examples: US city, IT comune,
/// UK post town. In regions of the world where localities are not well defined or do not fit into this
/// structure well, leave locality empty and use address_lines.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("locality")]
public virtual string Locality { get; set; }
/// <summary>Optional. The name of the organization at the address.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("organization")]
public virtual string Organization { get; set; }
/// <summary>Optional. Postal code of the address. Not all countries use or require postal codes to be present,
/// but where they are used, they may trigger additional validation with other parts of the address (e.g.
/// state/zip validation in the U.S.A.).</summary>
[Newtonsoft.Json.JsonPropertyAttribute("postalCode")]
public virtual string PostalCode { get; set; }
/// <summary>Optional. The recipient at the address. This field may, under certain circumstances, contain
/// multiline information. For example, it might contain "care of" information.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("recipients")]
public virtual System.Collections.Generic.IList<string> Recipients { get; set; }
/// <summary>Required. CLDR region code of the country/region of the address. This is never inferred and it is
/// up to the user to ensure the value is correct. See http://cldr.unicode.org/ and
/// http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html for details. Example: "CH" for
/// Switzerland.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("regionCode")]
public virtual string RegionCode { get; set; }
/// <summary>The schema revision of the `PostalAddress`. This must be set to 0, which is the latest revision.
/// All new revisions **must** be backward compatible with old revisions.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("revision")]
public virtual System.Nullable<int> Revision { get; set; }
/// <summary>Optional. Additional, country-specific, sorting code. This is not used in most regions. Where it is
/// used, the value is either a string like "CEDEX", optionally followed by a number (e.g. "CEDEX 7"), or just a
/// number alone, representing the "sector code" (Jamaica), "delivery area indicator" (Malawi) or "post office
/// indicator" (e.g. Côte d'Ivoire).</summary>
[Newtonsoft.Json.JsonPropertyAttribute("sortingCode")]
public virtual string SortingCode { get; set; }
/// <summary>Optional. Sublocality of the address. For example, this can be neighborhoods, boroughs,
/// districts.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("sublocality")]
public virtual string Sublocality { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>Options for job processing.</summary>
public class ProcessingOptions : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>If set to `true`, the service does not attempt to resolve a more precise address for the
/// job.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("disableStreetAddressResolution")]
public virtual System.Nullable<bool> DisableStreetAddressResolution { get; set; }
/// <summary>Option for job HTML content sanitization. Applied fields are: * description *
/// applicationInfo.instruction * incentives * qualifications * responsibilities HTML tags in these fields may
/// be stripped if sanitiazation isn't disabled. Defaults to HtmlSanitization.SIMPLE_FORMATTING_ONLY.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("htmlSanitization")]
public virtual string HtmlSanitization { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>Meta information related to the job searcher or entity conducting the job search. This information is
/// used to improve the performance of the service.</summary>
public class RequestMetadata : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>Only set when any of domain, session_id and user_id isn't available for some reason. It is highly
/// recommended not to set this field and provide accurate domain, session_id and user_id for the best service
/// experience.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("allowMissingIds")]
public virtual System.Nullable<bool> AllowMissingIds { get; set; }
/// <summary>The type of device used by the job seeker at the time of the call to the service.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("deviceInfo")]
public virtual DeviceInfo DeviceInfo { get; set; }
/// <summary>Required if allow_missing_ids is unset or `false`. The client-defined scope or source of the
/// service call, which typically is the domain on which the service has been implemented and is currently being
/// run. For example, if the service is being run by client *Foo, Inc.*, on job board www.foo.com and career
/// site www.bar.com, then this field is set to "foo.com" for use on the job board, and "bar.com" for use on the
/// career site. Note that any improvements to the model for a particular tenant site rely on this field being
/// set correctly to a unique domain. The maximum number of allowed characters is 255.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("domain")]
public virtual string Domain { get; set; }
/// <summary>Required if allow_missing_ids is unset or `false`. A unique session identification string. A
/// session is defined as the duration of an end user's interaction with the service over a certain period.
/// Obfuscate this field for privacy concerns before providing it to the service. Note that any improvements to
/// the model for a particular tenant site rely on this field being set correctly to a unique session ID. The
/// maximum number of allowed characters is 255.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("sessionId")]
public virtual string SessionId { get; set; }
/// <summary>Required if allow_missing_ids is unset or `false`. A unique user identification string, as
/// determined by the client. To have the strongest positive impact on search quality make sure the client-level
/// is unique. Obfuscate this field for privacy concerns before providing it to the service. Note that any
/// improvements to the model for a particular tenant site rely on this field being set correctly to a unique
/// user ID. The maximum number of allowed characters is 255.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("userId")]
public virtual string UserId { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>Additional information returned to client, such as debugging information.</summary>
public class ResponseMetadata : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>A unique id associated with this call. This id is logged for tracking purposes.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("requestId")]
public virtual string RequestId { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>The Request body of the `SearchJobs` call.</summary>
public class SearchJobsRequest : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>Controls over how job documents get ranked on top of existing relevance score (determined by API
/// algorithm).</summary>
[Newtonsoft.Json.JsonPropertyAttribute("customRankingInfo")]
public virtual CustomRankingInfo CustomRankingInfo { get; set; }
/// <summary>Controls whether to disable exact keyword match on Job.title, Job.description,
/// Job.company_display_name, Job.addresses, Job.qualifications. When disable keyword match is turned off, a
/// keyword match returns jobs that do not match given category filters when there are matching keywords. For
/// example, for the query "program manager," a result is returned even if the job posting has the title
/// "software developer," which doesn't fall into "program manager" ontology, but does have "program manager"
/// appearing in its description. For queries like "cloud" that don't contain title or location specific
/// ontology, jobs with "cloud" keyword matches are returned regardless of this flag's value. Use
/// Company.keyword_searchable_job_custom_attributes if company-specific globally matched custom field/attribute
/// string values are needed. Enabling keyword match improves recall of subsequent search requests. Defaults to
/// false.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("disableKeywordMatch")]
public virtual System.Nullable<bool> DisableKeywordMatch { get; set; }
/// <summary>Controls whether highly similar jobs are returned next to each other in the search results. Jobs
/// are identified as highly similar based on their titles, job categories, and locations. Highly similar
/// results are clustered so that only one representative job of the cluster is displayed to the job seeker
/// higher up in the results, with the other jobs being displayed lower down in the results. Defaults to
/// DiversificationLevel.SIMPLE if no value is specified.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("diversificationLevel")]
public virtual string DiversificationLevel { get; set; }
/// <summary>Controls whether to broaden the search when it produces sparse results. Broadened queries append
/// results to the end of the matching results list. Defaults to false.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("enableBroadening")]
public virtual System.Nullable<bool> EnableBroadening { get; set; }
/// <summary>An expression specifies a histogram request against matching jobs. Expression syntax is an
/// aggregation function call with histogram facets and other options. Available aggregation function calls are:
/// * `count(string_histogram_facet)`: Count the number of matching entities, for each distinct attribute value.
/// * `count(numeric_histogram_facet, list of buckets)`: Count the number of matching entities within each
/// bucket. Data types: * Histogram facet: facet names with format a-zA-Z+. * String: string like "any string
/// with backslash escape for quote(\")." * Number: whole number and floating point number like 10, -1 and
/// -0.01. * List: list of elements with comma(,) separator surrounded by square brackets, for example, [1, 2,
/// 3] and ["one", "two", "three"]. Built-in constants: * MIN (minimum number similar to java Double.MIN_VALUE)
/// * MAX (maximum number similar to java Double.MAX_VALUE) Built-in functions: * bucket(start, end[, label]):
/// bucket built-in function creates a bucket with range of start, end). Note that the end is exclusive, for
/// example, bucket(1, MAX, "positive number") or bucket(1, 10). Job histogram facets: * company_display_name:
/// histogram by [Job.company_display_name. * employment_type: histogram by Job.employment_types, for example,
/// "FULL_TIME", "PART_TIME". * company_size: histogram by CompanySize, for example, "SMALL", "MEDIUM", "BIG". *
/// publish_time_in_month: histogram by the Job.posting_publish_time in months. Must specify list of numeric
/// buckets in spec. * publish_time_in_year: histogram by the Job.posting_publish_time in years. Must specify
/// list of numeric buckets in spec. * degree_types: histogram by the Job.degree_types, for example,
/// "Bachelors", "Masters". * job_level: histogram by the Job.job_level, for example, "Entry Level". * country:
/// histogram by the country code of jobs, for example, "US", "FR". * admin1: histogram by the admin1 code of
/// jobs, which is a global placeholder referring to the state, province, or the particular term a country uses
/// to define the geographic structure below the country level, for example, "CA", "IL". * city: histogram by a
/// combination of the "city name, admin1 code". For example, "Mountain View, CA", "New York, NY". *
/// admin1_country: histogram by a combination of the "admin1 code, country", for example, "CA, US", "IL, US". *
/// city_coordinate: histogram by the city center's GPS coordinates (latitude and longitude), for example,
/// 37.4038522,-122.0987765. Since the coordinates of a city center can change, customers may need to refresh
/// them periodically. * locale: histogram by the Job.language_code, for example, "en-US", "fr-FR". * language:
/// histogram by the language subtag of the Job.language_code, for example, "en", "fr". * category: histogram by
/// the JobCategory, for example, "COMPUTER_AND_IT", "HEALTHCARE". * base_compensation_unit: histogram by the
/// CompensationInfo.CompensationUnit of base salary, for example, "WEEKLY", "MONTHLY". * base_compensation:
/// histogram by the base salary. Must specify list of numeric buckets to group results by. *
/// annualized_base_compensation: histogram by the base annualized salary. Must specify list of numeric buckets
/// to group results by. * annualized_total_compensation: histogram by the total annualized salary. Must specify
/// list of numeric buckets to group results by. * string_custom_attribute: histogram by string
/// Job.custom_attributes. Values can be accessed via square bracket notations like
/// string_custom_attribute["key1"]. * numeric_custom_attribute: histogram by numeric Job.custom_attributes.
/// Values can be accessed via square bracket notations like numeric_custom_attribute["key1"]. Must specify list
/// of numeric buckets to group results by. Example expressions: * `count(admin1)` * `count(base_compensation,
/// [bucket(1000, 10000), bucket(10000, 100000), bucket(100000, MAX)])` * `count(string_custom_attribute["some-
/// string-custom-attribute"])` * `count(numeric_custom_attribute["some-numeric-custom-attribute"], [bucket(MIN,
/// 0, "negative"), bucket(0, MAX, "non-negative"])`</summary>
[Newtonsoft.Json.JsonPropertyAttribute("histogramQueries")]
public virtual System.Collections.Generic.IList<HistogramQuery> HistogramQueries { get; set; }
/// <summary>Query used to search against jobs, such as keyword, location filters, etc.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("jobQuery")]
public virtual JobQuery JobQuery { get; set; }
/// <summary>The desired job attributes returned for jobs in the search response. Defaults to
/// JobView.JOB_VIEW_SMALL if no value is specified.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("jobView")]
public virtual string JobView { get; set; }
/// <summary>A limit on the number of jobs returned in the search results. Increasing this value above the
/// default value of 10 can increase search response time. The value can be between 1 and 100.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("maxPageSize")]
public virtual System.Nullable<int> MaxPageSize { get; set; }
/// <summary>An integer that specifies the current offset (that is, starting result location, amongst the jobs
/// deemed by the API as relevant) in search results. This field is only considered if page_token is unset. The
/// maximum allowed value is 5000. Otherwise an error is thrown. For example, 0 means to return results starting
/// from the first matching job, and 10 means to return from the 11th job. This can be used for pagination, (for
/// example, pageSize = 10 and offset = 10 means to return from the second page).</summary>
[Newtonsoft.Json.JsonPropertyAttribute("offset")]
public virtual System.Nullable<int> Offset { get; set; }
/// <summary>The criteria determining how search results are sorted. Default is `"relevance desc"`. Supported
/// options are: * `"relevance desc"`: By relevance descending, as determined by the API algorithms. Relevance
/// thresholding of query results is only available with this ordering. * `"posting_publish_time desc"`: By
/// Job.posting_publish_time descending. * `"posting_update_time desc"`: By Job.posting_update_time descending.
/// * `"title"`: By Job.title ascending. * `"title desc"`: By Job.title descending. *
/// `"annualized_base_compensation"`: By job's CompensationInfo.annualized_base_compensation_range ascending.
/// Jobs whose annualized base compensation is unspecified are put at the end of search results. *
/// `"annualized_base_compensation desc"`: By job's CompensationInfo.annualized_base_compensation_range
/// descending. Jobs whose annualized base compensation is unspecified are put at the end of search results. *
/// `"annualized_total_compensation"`: By job's CompensationInfo.annualized_total_compensation_range ascending.
/// Jobs whose annualized base compensation is unspecified are put at the end of search results. *
/// `"annualized_total_compensation desc"`: By job's CompensationInfo.annualized_total_compensation_range
/// descending. Jobs whose annualized base compensation is unspecified are put at the end of search results. *
/// `"custom_ranking desc"`: By the relevance score adjusted to the
/// SearchJobsRequest.CustomRankingInfo.ranking_expression with weight factor assigned by
/// SearchJobsRequest.CustomRankingInfo.importance_level in descending order. * Location sorting: Use the
/// special syntax to order jobs by distance: `"distance_from('Hawaii')"`: Order by distance from Hawaii.
/// `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate. `"distance_from('Hawaii'),
/// distance_from('Puerto Rico')"`: Order by multiple locations. See details below. `"distance_from('Hawaii'),
/// distance_from(19.89, 155.5)"`: Order by multiple locations. See details below. The string can have a maximum
/// of 256 characters. When multiple distance centers are provided, a job that is close to any of the distance
/// centers would have a high rank. When a job has multiple locations, the job location closest to one of the
/// distance centers will be used. Jobs that don't have locations will be ranked at the bottom. Distance is
/// calculated with a precision of 11.3 meters (37.4 feet). Diversification strategy is still applied unless
/// explicitly disabled in diversification_level.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("orderBy")]
public virtual string OrderBy { get; set; }
/// <summary>The token specifying the current offset within search results. See
/// SearchJobsResponse.next_page_token for an explanation of how to obtain the next set of query
/// results.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("pageToken")]
public virtual string PageToken { get; set; }
/// <summary>Required. The meta information collected about the job searcher, used to improve the search quality
/// of the service. The identifiers (such as `user_id`) are provided by users, and must be unique and
/// consistent.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("requestMetadata")]
public virtual RequestMetadata RequestMetadata { get; set; }
/// <summary>Mode of a search. Defaults to SearchMode.JOB_SEARCH.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("searchMode")]
public virtual string SearchMode { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>Response for SearchJob method.</summary>
public class SearchJobsResponse : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>If query broadening is enabled, we may append additional results from the broadened query. This
/// number indicates how many of the jobs returned in the jobs field are from the broadened query. These results
/// are always at the end of the jobs list. In particular, a value of 0, or if the field isn't set, all the jobs
/// in the jobs list are from the original (without broadening) query. If this field is non-zero, subsequent
/// requests with offset after this result set should contain all broadened results.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("broadenedQueryJobsCount")]
public virtual System.Nullable<int> BroadenedQueryJobsCount { get; set; }
/// <summary>The histogram results that match with specified SearchJobsRequest.histogram_queries.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("histogramQueryResults")]
public virtual System.Collections.Generic.IList<HistogramQueryResult> HistogramQueryResults { get; set; }
/// <summary>The location filters that the service applied to the specified query. If any filters are lat-lng
/// based, the Location.location_type is Location.LocationType.LOCATION_TYPE_UNSPECIFIED.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("locationFilters")]
public virtual System.Collections.Generic.IList<Location> LocationFilters { get; set; }
/// <summary>The Job entities that match the specified SearchJobsRequest.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("matchingJobs")]
public virtual System.Collections.Generic.IList<MatchingJob> MatchingJobs { get; set; }
/// <summary>Additional information for the API invocation, such as the request tracking id.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("metadata")]
public virtual ResponseMetadata Metadata { get; set; }
/// <summary>The token that specifies the starting position of the next page of results. This field is empty if
/// there are no more results.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("nextPageToken")]
public virtual string NextPageToken { get; set; }
/// <summary>The spell checking result, and correction.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("spellCorrection")]
public virtual SpellingCorrection SpellCorrection { get; set; }
/// <summary>Number of jobs that match the specified query. Note: This size is precise only if the total is less
/// than 100,000.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("totalSize")]
public virtual System.Nullable<int> TotalSize { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>Spell check result.</summary>
public class SpellingCorrection : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>Indicates if the query was corrected by the spell checker.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("corrected")]
public virtual System.Nullable<bool> Corrected { get; set; }
/// <summary>Corrected output with html tags to highlight the corrected words. Corrected words are called out
/// with the "*...*" html tags. For example, the user input query is "software enginear", where the second word,
/// "enginear," is incorrect. It should be "engineer". When spelling correction is enabled, this value is
/// "software *engineer*".</summary>
[Newtonsoft.Json.JsonPropertyAttribute("correctedHtml")]
public virtual string CorrectedHtml { get; set; }
/// <summary>Correction output consisting of the corrected keyword string.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("correctedText")]
public virtual string CorrectedText { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>The `Status` type defines a logical error model that is suitable for different programming
/// environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status`
/// message contains three pieces of data: error code, error message, and error details. You can find out more about
/// this error model and how to work with it in the [API Design
/// Guide](https://cloud.google.com/apis/design/errors).</summary>
public class Status : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>The status code, which should be an enum value of google.rpc.Code.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("code")]
public virtual System.Nullable<int> Code { get; set; }
/// <summary>A list of messages that carry the error details. There is a common set of message types for APIs to
/// use.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("details")]
public virtual System.Collections.Generic.IList<System.Collections.Generic.IDictionary<string, object>> Details { get; set; }
/// <summary>A developer-facing error message, which should be in English. Any user-facing error message should
/// be localized and sent in the google.rpc.Status.details field, or localized by the client.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("message")]
public virtual string Message { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>A Tenant resource represents a tenant in the service. A tenant is a group or entity that shares common
/// access with specific privileges for resources like jobs. Customer may create multiple tenants to provide data
/// isolation for different groups.</summary>
public class Tenant : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>Required. Client side tenant identifier, used to uniquely identify the tenant. The maximum number
/// of allowed characters is 255.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("externalId")]
public virtual string ExternalId { get; set; }
/// <summary>Required during tenant update. The resource name for a tenant. This is generated by the service
/// when a tenant is created. The format is "projects/{project_id}/tenants/{tenant_id}", for example,
/// "projects/foo/tenants/bar".</summary>
[Newtonsoft.Json.JsonPropertyAttribute("name")]
public virtual string Name { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>Represents a time of day. The date and time zone are either not significant or are specified elsewhere.
/// An API may choose to allow leap seconds. Related types are google.type.Date and
/// `google.protobuf.Timestamp`.</summary>
public class TimeOfDay : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>Hours of day in 24 hour format. Should be from 0 to 23. An API may choose to allow the value
/// "24:00:00" for scenarios like business closing time.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("hours")]
public virtual System.Nullable<int> Hours { get; set; }
/// <summary>Minutes of hour of day. Must be from 0 to 59.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("minutes")]
public virtual System.Nullable<int> Minutes { get; set; }
/// <summary>Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("nanos")]
public virtual System.Nullable<int> Nanos { get; set; }
/// <summary>Seconds of minutes of the time. Must normally be from 0 to 59. An API may allow the value 60 if it
/// allows leap-seconds.</summary>
[Newtonsoft.Json.JsonPropertyAttribute("seconds")]
public virtual System.Nullable<int> Seconds { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
/// <summary>Message representing a period of time between two timestamps.</summary>
public class TimestampRange : Google.Apis.Requests.IDirectResponseSchema
{
/// <summary>End of the period (exclusive).</summary>
[Newtonsoft.Json.JsonPropertyAttribute("endTime")]
public virtual object EndTime { get; set; }
/// <summary>Begin of the period (inclusive).</summary>
[Newtonsoft.Json.JsonPropertyAttribute("startTime")]
public virtual object StartTime { get; set; }
/// <summary>The ETag of the item.</summary>
public virtual string ETag { get; set; }
}
}
| 57.953603 | 190 | 0.622044 | [
"Apache-2.0"
] | Alexisblues/google-api-dotnet-client | Src/Generated/Google.Apis.CloudTalentSolution.v4/Google.Apis.CloudTalentSolution.v4.cs | 212,343 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StringManipulationLecture
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Yoda said \"Do or do not, there is no try\"");
Console.WriteLine("The file is located in the C:\\Users\\Directory");
Console.WriteLine("Typing backslash n in a string\nwill cause a line break");
Console.ReadKey();
}
}
}
| 25.190476 | 89 | 0.637051 | [
"Unlicense"
] | agurokeendavid/learn-how-to-code-using-csharp | StringManipulationLecture/Program.cs | 529 | 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 pr1 {
public partial class Record {
protected System.Web.UI.WebControls.Content RecordContent;
protected System.Web.UI.WebControls.MultiView RecordMultiView;
protected System.Web.UI.WebControls.View RecordViewForm;
protected System.Web.UI.WebControls.Label ViewRecordId;
protected System.Web.UI.WebControls.Button ViewRecordEditButton;
protected System.Web.UI.WebControls.Label ViewRecordRating;
protected System.Web.UI.WebControls.Button ViewRecordUp;
protected System.Web.UI.WebControls.Button ViewRecordDown;
protected System.Web.UI.WebControls.ImageButton ViewRecordCover;
protected System.Web.UI.WebControls.Label ViewRecordArtist;
protected System.Web.UI.WebControls.Label ViewRecordTitle;
protected System.Web.UI.WebControls.Label ViewRecordLabel;
protected System.Web.UI.WebControls.Label ViewRecordGenre;
protected System.Web.UI.WebControls.Label ViewRecordStyle;
protected System.Web.UI.WebControls.Label ViewRecordFormat;
protected System.Web.UI.WebControls.Label ViewRecordContry;
protected System.Web.UI.WebControls.View RecordEditView;
protected System.Web.UI.WebControls.Label EditRecordId;
protected System.Web.UI.WebControls.FileUpload EditRecordFileUpload;
protected System.Web.UI.WebControls.Button EditRecordFileUploadButton;
protected System.Web.UI.WebControls.Label EditRecordFileUploadStatus;
protected System.Web.UI.WebControls.ImageButton EditRecordCover;
protected System.Web.UI.WebControls.TextBox EditRecordTitle;
protected System.Web.UI.WebControls.RequiredFieldValidator EditRecordUsernameValidator;
protected System.Web.UI.WebControls.TextBox EditRecordArtist;
protected System.Web.UI.WebControls.RequiredFieldValidator EditRecordArtistValidator;
protected System.Web.UI.WebControls.TextBox EditRecordLabel;
protected System.Web.UI.WebControls.RequiredFieldValidator EditRecordLabelValidator;
protected System.Web.UI.WebControls.TextBox EditRecordYear;
protected System.Web.UI.WebControls.TextBox EditRecordOther;
protected System.Web.UI.WebControls.DropDownList EditRecordGenre;
protected System.Web.UI.WebControls.DropDownList EditRecordStyle;
protected System.Web.UI.WebControls.DropDownList EditRecordFormat;
protected System.Web.UI.WebControls.DropDownList EditRecordCountry;
protected System.Web.UI.WebControls.Panel EditRecordTracksPanel;
protected System.Web.UI.WebControls.RangeValidator EditRecordTrackCountValidator;
protected System.Web.UI.WebControls.TextBox EditRecordTrackCount;
protected System.Web.UI.WebControls.Button EditRecordAddTrack;
protected System.Web.UI.WebControls.Button EditRecordButton;
protected System.Web.UI.WebControls.Button ResetRecordButton;
protected System.Web.UI.WebControls.Button DeleteRecordButton;
}
}
| 38.383838 | 95 | 0.658421 | [
"MIT"
] | xdegtyarev/bsuir | 5/1/IGI/pr1/pr1/Record.aspx.designer.cs | 3,800 | C# |
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Text;
namespace System.Xml
{
// Provides text-manipulation methods that are used by several classes.
public abstract class XmlCharacterData : XmlLinkedNode
{
private string _data;
//base(doc) will throw exception if doc is null.
protected internal XmlCharacterData(string data, XmlDocument doc) : base(doc)
{
_data = data;
}
// Gets or sets the value of the node.
public override String Value
{
get { return Data; }
set { Data = value; }
}
// Gets or sets the concatenated values of the node and
// all its children.
public override string InnerText
{
get { return Value; }
set { Value = value; }
}
// Contains this node's data.
public virtual string Data
{
get
{
if (_data != null)
{
return _data;
}
else
{
return String.Empty;
}
}
set
{
XmlNode parent = ParentNode;
XmlNodeChangedEventArgs args = GetEventArgs(this, parent, parent, _data, value, XmlNodeChangedAction.Change);
if (args != null)
BeforeEvent(args);
_data = value;
if (args != null)
AfterEvent(args);
}
}
// Gets the length of the data, in characters.
public virtual int Length
{
get
{
if (_data != null)
{
return _data.Length;
}
return 0;
}
}
// Retrieves a substring of the full string from the specified range.
public virtual String Substring(int offset, int count)
{
int len = _data != null ? _data.Length : 0;
if (len > 0)
{
if (len < (offset + count))
{
count = len - offset;
}
return _data.Substring(offset, count);
}
return String.Empty;
}
// Appends the specified string to the end of the character
// data of the node.
public virtual void AppendData(String strData)
{
XmlNode parent = ParentNode;
int capacity = _data != null ? _data.Length : 0;
if (strData != null) capacity += strData.Length;
string newValue = new StringBuilder(capacity).Append(_data).Append(strData).ToString();
XmlNodeChangedEventArgs args = GetEventArgs(this, parent, parent, _data, newValue, XmlNodeChangedAction.Change);
if (args != null)
BeforeEvent(args);
_data = newValue;
if (args != null)
AfterEvent(args);
}
// Insert the specified string at the specified character offset.
public virtual void InsertData(int offset, string strData)
{
XmlNode parent = ParentNode;
int capacity = _data != null ? _data.Length : 0;
if (strData != null) capacity += strData.Length;
string newValue = new StringBuilder(capacity).Append(_data).Insert(offset, strData).ToString();
XmlNodeChangedEventArgs args = GetEventArgs(this, parent, parent, _data, newValue, XmlNodeChangedAction.Change);
if (args != null)
BeforeEvent(args);
_data = newValue;
if (args != null)
AfterEvent(args);
}
// Remove a range of characters from the node.
public virtual void DeleteData(int offset, int count)
{
//Debug.Assert(offset >= 0 && offset <= Length);
int len = _data != null ? _data.Length : 0;
if (len > 0)
{
if (len < (offset + count))
{
count = Math.Max(len - offset, 0);
}
}
string newValue = new StringBuilder(_data).Remove(offset, count).ToString();
XmlNode parent = ParentNode;
XmlNodeChangedEventArgs args = GetEventArgs(this, parent, parent, _data, newValue, XmlNodeChangedAction.Change);
if (args != null)
BeforeEvent(args);
_data = newValue;
if (args != null)
AfterEvent(args);
}
// Replace the specified number of characters starting at the specified offset with the
// specified string.
public virtual void ReplaceData(int offset, int count, String strData)
{
int len = _data != null ? _data.Length : 0;
if (len > 0)
{
if (len < (offset + count))
{
count = Math.Max(len - offset, 0);
}
}
StringBuilder temp = new StringBuilder(_data).Remove(offset, count);
string newValue = temp.Insert(offset, strData).ToString();
XmlNode parent = ParentNode;
XmlNodeChangedEventArgs args = GetEventArgs(this, parent, parent, _data, newValue, XmlNodeChangedAction.Change);
if (args != null)
BeforeEvent(args);
_data = newValue;
if (args != null)
AfterEvent(args);
}
internal bool CheckOnData(string data)
{
return XmlCharType.Instance.IsOnlyWhitespace(data);
}
}
}
| 30.937173 | 125 | 0.5099 | [
"MIT"
] | OceanYan/corefx | src/System.Xml.XmlDocument/src/System/Xml/Dom/XmlCharacterData.cs | 5,909 | 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.Security.Permissions;
namespace System.Diagnostics
{
#if NETCOREAPP
[Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
#endif
public sealed class PerformanceCounterPermission : ResourcePermissionBase
{
public PerformanceCounterPermission() { }
public PerformanceCounterPermission(PerformanceCounterPermissionAccess permissionAccess, string machineName, string categoryName) { }
public PerformanceCounterPermission(PerformanceCounterPermissionEntry[] permissionAccessEntries) { }
public PerformanceCounterPermission(PermissionState state) { }
public PerformanceCounterPermissionEntryCollection PermissionEntries { get { return null; } }
}
}
| 47.05 | 147 | 0.793836 | [
"MIT"
] | AUTOMATE-2001/runtime | src/libraries/System.Security.Permissions/src/System/Diagnostics/PerformanceCounterPermission.cs | 941 | C# |
using System;
using System.Threading;
using System.Threading.Tasks;
using Avalonia.Platform;
namespace Avalonia.Threading
{
/// <summary>
/// Provides services for managing work items on a thread.
/// </summary>
/// <remarks>
/// In Avalonia, there is usually only a single <see cref="Dispatcher"/> in the application -
/// the one for the UI thread, retrieved via the <see cref="UIThread"/> property.
/// </remarks>
public class Dispatcher : IDispatcher
{
private readonly JobRunner _jobRunner;
private IPlatformThreadingInterface? _platform;
public static Dispatcher UIThread { get; } =
new Dispatcher(AvaloniaLocator.Current.GetService<IPlatformThreadingInterface>());
public Dispatcher(IPlatformThreadingInterface? platform)
{
_platform = platform;
_jobRunner = new JobRunner(platform);
if (_platform != null)
{
_platform.Signaled += _jobRunner.RunJobs;
}
}
/// <summary>
/// Checks that the current thread is the UI thread.
/// </summary>
public bool CheckAccess() => _platform?.CurrentThreadIsLoopThread ?? true;
/// <summary>
/// Checks that the current thread is the UI thread and throws if not.
/// </summary>
/// <exception cref="InvalidOperationException">
/// The current thread is not the UI thread.
/// </exception>
public void VerifyAccess()
{
if (!CheckAccess())
throw new InvalidOperationException("Call from invalid thread");
}
/// <summary>
/// Runs the dispatcher's main loop.
/// </summary>
/// <param name="cancellationToken">
/// A cancellation token used to exit the main loop.
/// </param>
public void MainLoop(CancellationToken cancellationToken)
{
var platform = AvaloniaLocator.Current.GetRequiredService<IPlatformThreadingInterface>();
cancellationToken.Register(() => platform.Signal(DispatcherPriority.Send));
platform.RunLoop(cancellationToken);
}
/// <summary>
/// Runs continuations pushed on the loop.
/// </summary>
public void RunJobs()
{
_jobRunner.RunJobs(null);
}
/// <summary>
/// Use this method to ensure that more prioritized tasks are executed
/// </summary>
/// <param name="minimumPriority"></param>
public void RunJobs(DispatcherPriority minimumPriority) => _jobRunner.RunJobs(minimumPriority);
/// <summary>
/// Use this method to check if there are more prioritized tasks
/// </summary>
/// <param name="minimumPriority"></param>
public bool HasJobsWithPriority(DispatcherPriority minimumPriority) =>
_jobRunner.HasJobsWithPriority(minimumPriority);
/// <inheritdoc/>
public Task InvokeAsync(Action action, DispatcherPriority priority = DispatcherPriority.Normal)
{
_ = action ?? throw new ArgumentNullException(nameof(action));
return _jobRunner.InvokeAsync(action, priority);
}
/// <inheritdoc/>
public Task<TResult> InvokeAsync<TResult>(Func<TResult> function, DispatcherPriority priority = DispatcherPriority.Normal)
{
_ = function ?? throw new ArgumentNullException(nameof(function));
return _jobRunner.InvokeAsync(function, priority);
}
/// <inheritdoc/>
public Task InvokeAsync(Func<Task> function, DispatcherPriority priority = DispatcherPriority.Normal)
{
_ = function ?? throw new ArgumentNullException(nameof(function));
return _jobRunner.InvokeAsync(function, priority).Unwrap();
}
/// <inheritdoc/>
public Task<TResult> InvokeAsync<TResult>(Func<Task<TResult>> function, DispatcherPriority priority = DispatcherPriority.Normal)
{
_ = function ?? throw new ArgumentNullException(nameof(function));
return _jobRunner.InvokeAsync(function, priority).Unwrap();
}
/// <inheritdoc/>
public void Post(Action action, DispatcherPriority priority = DispatcherPriority.Normal)
{
_ = action ?? throw new ArgumentNullException(nameof(action));
_jobRunner.Post(action, priority);
}
/// <inheritdoc/>
public void Post<T>(Action<T> action, T arg, DispatcherPriority priority = DispatcherPriority.Normal)
{
_ = action ?? throw new ArgumentNullException(nameof(action));
_jobRunner.Post(action, arg, priority);
}
/// <summary>
/// This is needed for platform backends that don't have internal priority system (e. g. win32)
/// To ensure that there are no jobs with higher priority
/// </summary>
/// <param name="currentPriority"></param>
internal void EnsurePriority(DispatcherPriority currentPriority)
{
if (currentPriority == DispatcherPriority.MaxValue)
return;
currentPriority += 1;
_jobRunner.RunJobs(currentPriority);
}
/// <summary>
/// Allows unit tests to change the platform threading interface.
/// </summary>
internal void UpdateServices()
{
if (_platform != null)
{
_platform.Signaled -= _jobRunner.RunJobs;
}
_platform = AvaloniaLocator.Current.GetService<IPlatformThreadingInterface>();
_jobRunner.UpdateServices();
if (_platform != null)
{
_platform.Signaled += _jobRunner.RunJobs;
}
}
}
}
| 36.725 | 136 | 0.603302 | [
"MIT"
] | AbdalaMask/Avalonia | src/Avalonia.Base/Threading/Dispatcher.cs | 5,876 | C# |
using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc;
using Kraken.Api.Sensor.Models;
using Kraken.Api.Sensor.Services;
namespace Kraken.Api.Sensor.Controllers
{
/// <summary>
/// The pipe measurement controller.
/// </summary>
[ApiController]
[Route("api/measurements/[controller]")]
public class PipeController : ControllerBase
{
private DataService _dataService;
/// <summary>
/// Creates a new pipe measurement controller.
/// </summary>
/// <param name="dataService">The data service.</param>
public PipeController(DataService dataService) => _dataService = dataService;
/// <summary>
/// Handles requests to fetch all pipe measurements. Note that this will return ALL measurements,
/// even older ones.
/// </summary>
/// <returns>Status 200 along with list of all pipe measurements.</returns>
[HttpGet]
public ActionResult<List<Pipe>> Get()
{
return Ok(_dataService.GetAll<Pipe>());
}
/// <summary>
/// Handles requests to return a single measurement.
/// </summary>
/// <param name="id">The measurement id.</param>
/// <returns>Status 200 along with the measurement.</returns>
[HttpGet("{id:guid}")]
public ActionResult<Pipe> GetSingle(string id)
{
Pipe measurement = _dataService.GetSingle<Pipe>(id);
if (measurement == null)
{
return NotFound();
}
return Ok(measurement);
}
/// <summary>
/// Handles requests to fetch the latest measurement for each pipe.
/// </summary>
/// <returns>Status 200 with the latest measurement for each pipe.</returns>
[HttpGet("latest")]
public ActionResult<Pipe> GetLatest()
{
return Ok(_dataService.GetLatest<Pipe, string>(item => item.PipeId));
}
/// <summary>
/// Handles requests to add a new measurement to the database.
/// </summary>
/// <param name="pipe">The measurement.</param>
/// <returns>Status 201 along with the measurement.</returns>
[HttpPost]
public ActionResult<Pipe> Create(Pipe pipe)
{
_dataService.Create(pipe);
return CreatedAtAction(nameof(GetSingle), new Pipe { Id = pipe.Id }, pipe);
}
/// <summary>
/// Handles requests to delete a measurement from the database.
/// </summary>
/// <param name="id">The pipe id.</param>
/// <returns>Status 201 if successful, 404 if not found.</returns>
[HttpDelete("{id:guid}")]
public ActionResult Delete(string id)
{
Pipe measurement = _dataService.GetSingle<Pipe>(id);
if (measurement == null)
{
return NotFound();
}
_dataService.Remove(measurement);
return NoContent();
}
}
} | 31.791667 | 105 | 0.571101 | [
"MIT"
] | nedroden/Kraken-Backend | Sensor/Controllers/PipeController.cs | 3,052 | C# |
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
#if !NO_REMOTING && !XUNIT
using System;
using System.Collections.Generic;
using System.IO;
using System.Reactive;
using System.Reactive.Concurrency;
using System.Reactive.Disposables;
using System.Reactive.PlatformServices;
using Xunit;
namespace ReactiveTests.Tests
{
static class Exts
{
public static T Deq<T>(this List<T> l)
{
var t = l[0];
l.RemoveAt(0);
return t;
}
}
public class SystemClockTest
{
private void Run(CrossAppDomainDelegate a)
{
var domain = AppDomain.CreateDomain(Guid.NewGuid().ToString(), null, new AppDomainSetup { ApplicationBase = AppDomain.CurrentDomain.BaseDirectory });
domain.DoCallBack(a);
AppDomain.Unload(domain);
}
[Fact]
public void PastWork()
{
Run(PastWork_Callback);
}
private static void PastWork_Callback()
{
var provider = new MyPlatformEnlightenmentProvider();
PlatformEnlightenmentProvider.Current = provider;
var cal = provider._cal;
var now = new DateTimeOffset(2012, 4, 25, 12, 0, 0, TimeSpan.Zero);
var due = now - TimeSpan.FromMinutes(1);
var s = new MyScheduler();
s.SetTime(now);
var done = false;
s.Schedule(due, () => { done = true; });
Assert.Equal(1, s._queue.Count);
var next = s._queue.Deq();
Assert.True(s.Now + next.DueTime == now);
s.SetTime(due);
next.Invoke();
Assert.True(done);
}
[Fact]
public void ImmediateWork()
{
Run(ImmediateWork_Callback);
}
private static void ImmediateWork_Callback()
{
var provider = new MyPlatformEnlightenmentProvider();
PlatformEnlightenmentProvider.Current = provider;
var cal = provider._cal;
var now = new DateTimeOffset(2012, 4, 25, 12, 0, 0, TimeSpan.Zero);
var due = now;
var s = new MyScheduler();
s.SetTime(now);
var done = false;
s.Schedule(due, () => { done = true; });
Assert.Equal(1, s._queue.Count);
var next = s._queue.Deq();
Assert.True(s.Now + next.DueTime == due);
s.SetTime(due);
next.Invoke();
Assert.True(done);
}
[Fact]
public void ShortTermWork()
{
Run(ShortTermWork_Callback);
}
private static void ShortTermWork_Callback()
{
var provider = new MyPlatformEnlightenmentProvider();
PlatformEnlightenmentProvider.Current = provider;
var cal = provider._cal;
var now = new DateTimeOffset(2012, 4, 25, 12, 0, 0, TimeSpan.Zero);
var rel = TimeSpan.FromSeconds(1) /* rel <= SHORTTERM */;
var due = now + rel;
var s = new MyScheduler();
s.SetTime(now);
var done = false;
s.Schedule(due, () => { done = true; });
Assert.Equal(1, s._queue.Count);
var next = s._queue.Deq();
Assert.True(s.Now + next.DueTime == due);
s.SetTime(due);
next.Invoke();
Assert.True(done);
}
[Fact]
public void ShortTermWork_Dispose()
{
Run(ShortTermWork_Dispose_Callback);
}
private static void ShortTermWork_Dispose_Callback()
{
var provider = new MyPlatformEnlightenmentProvider();
PlatformEnlightenmentProvider.Current = provider;
var cal = provider._cal;
var now = new DateTimeOffset(2012, 4, 25, 12, 0, 0, TimeSpan.Zero);
var rel = TimeSpan.FromSeconds(1) /* rel <= SHORTTERM */;
var due = now + rel;
var s = new MyScheduler();
s.SetTime(now);
var done = false;
var d = s.Schedule(due, () => { done = true; });
Assert.Equal(1, s._queue.Count);
var next = s._queue.Deq();
Assert.True(s.Now + next.DueTime == due);
d.Dispose();
s.SetTime(due);
next.Invoke();
Assert.False(done);
}
[Fact]
public void ShortTermWork_InaccurateClock()
{
Run(ShortTermWork_InaccurateClock_Callback);
}
private static void ShortTermWork_InaccurateClock_Callback()
{
var provider = new MyPlatformEnlightenmentProvider();
PlatformEnlightenmentProvider.Current = provider;
var cal = provider._cal;
var now = new DateTimeOffset(2012, 4, 25, 12, 0, 0, TimeSpan.Zero);
var rel = TimeSpan.FromSeconds(1);
var due = now + rel;
var s = new MyScheduler();
s.SetTime(now);
var done = false;
s.Schedule(due, () => { done = true; });
Assert.Equal(1, s._queue.Count);
var nxt1 = s._queue.Deq();
Assert.True(s.Now + nxt1.DueTime == due);
s.SetTime(due - TimeSpan.FromMilliseconds(500) /* > RETRYSHORT */);
nxt1.Invoke();
Assert.Equal(1, s._queue.Count);
var nxt2 = s._queue.Deq();
Assert.True(s.Now + nxt2.DueTime == due);
s.SetTime(due);
nxt2.Invoke();
Assert.True(done);
}
[Fact]
public void LongTermWork1()
{
Run(LongTermWork1_Callback);
}
private static void LongTermWork1_Callback()
{
var provider = new MyPlatformEnlightenmentProvider();
PlatformEnlightenmentProvider.Current = provider;
var cal = provider._cal;
var now = new DateTimeOffset(2012, 4, 25, 12, 0, 0, TimeSpan.Zero);
var rel = TimeSpan.FromMinutes(1) /* rel > SHORTTERM */;
var due = now + rel;
var s = new MyScheduler();
s.SetTime(now);
var done = false;
s.Schedule(due, () => { done = true; });
Assert.Equal(1, cal._queue.Count);
var work = cal._queue.Deq();
Assert.True(work.Interval < rel);
s.SetTime(s.Now + work.Interval);
work.Value._action(work.Value._state);
Assert.Equal(1, s._queue.Count);
var next = s._queue.Deq();
Assert.True(s.Now + next.DueTime == due);
s.SetTime(due);
next.Invoke();
Assert.True(done);
}
[Fact]
public void LongTermWork2()
{
Run(LongTermWork2_Callback);
}
private static void LongTermWork2_Callback()
{
var provider = new MyPlatformEnlightenmentProvider();
PlatformEnlightenmentProvider.Current = provider;
var cal = provider._cal;
var now = new DateTimeOffset(2012, 4, 25, 12, 0, 0, TimeSpan.Zero);
var rel = TimeSpan.FromDays(1) /* rel > SHORTTERM and rel * MAXERRORRATIO > SHORTTERM */;
var due = now + rel;
var s = new MyScheduler();
s.SetTime(now);
var done = false;
s.Schedule(due, () => { done = true; });
Assert.Equal(1, cal._queue.Count);
var wrk1 = cal._queue.Deq();
Assert.True(wrk1.Interval < rel);
s.SetTime(s.Now + wrk1.Interval);
wrk1.Value._action(wrk1.Value._state);
// Begin of second long term scheduling
Assert.Equal(1, cal._queue.Count);
var wrk2 = cal._queue.Deq();
Assert.True(wrk2.Interval < rel);
s.SetTime(s.Now + wrk2.Interval);
wrk2.Value._action(wrk2.Value._state);
// End of second long term scheduling
Assert.Equal(1, s._queue.Count);
var next = s._queue.Deq();
Assert.True(s.Now + next.DueTime == due);
s.SetTime(due);
next.Invoke();
Assert.True(done);
}
[Fact]
public void LongTerm_Multiple()
{
Run(LongTerm_Multiple_Callback);
}
private static void LongTerm_Multiple_Callback()
{
var provider = new MyPlatformEnlightenmentProvider();
PlatformEnlightenmentProvider.Current = provider;
var cal = provider._cal;
var now = new DateTimeOffset(2012, 4, 25, 12, 0, 0, TimeSpan.Zero);
var s = new MyScheduler();
s.SetTime(now);
var due1 = now + TimeSpan.FromMinutes(10);
var due2 = now + TimeSpan.FromMinutes(30);
var due3 = now + TimeSpan.FromMinutes(60);
var done1 = false;
var done2 = false;
var done3 = false;
s.Schedule(due2, () => { done2 = true; });
s.Schedule(due1, () => { done1 = true; });
s.Schedule(due3, () => { done3 = true; });
// First CHK
Assert.Equal(1, cal._queue.Count);
var wrk1 = cal._queue.Deq();
var fst = s.Now + wrk1.Interval;
Assert.True(fst < due1);
// First TRN
s.SetTime(fst);
wrk1.Value._action(wrk1.Value._state);
// First SHT
Assert.Equal(1, s._queue.Count);
var sh1 = s._queue.Deq();
// Second CHK
Assert.Equal(1, cal._queue.Count);
var wrk2 = cal._queue.Deq();
var snd = s.Now + wrk2.Interval;
Assert.True(snd < due2);
// First RUN
s.SetTime(due1);
sh1.Invoke();
Assert.True(done1);
// Second TRN
s.SetTime(snd);
wrk2.Value._action(wrk2.Value._state);
// Second SHT
Assert.Equal(1, s._queue.Count);
var sh2 = s._queue.Deq();
// Third CHK
Assert.Equal(1, cal._queue.Count);
var wrk3 = cal._queue.Deq();
var trd = s.Now + wrk3.Interval;
Assert.True(trd < due3);
// Second RUN
s.SetTime(due2);
sh2.Invoke();
Assert.True(done2);
// Third TRN
s.SetTime(trd);
wrk3.Value._action(wrk3.Value._state);
// Third SHT
Assert.Equal(1, s._queue.Count);
var sh3 = s._queue.Deq();
// Third RUN
s.SetTime(due3);
sh3.Invoke();
Assert.True(done3);
}
[Fact]
public void LongTerm_Multiple_Dispose()
{
Run(LongTerm_Multiple_Dispose_Callback);
}
private static void LongTerm_Multiple_Dispose_Callback()
{
var provider = new MyPlatformEnlightenmentProvider();
PlatformEnlightenmentProvider.Current = provider;
var cal = provider._cal;
var now = new DateTimeOffset(2012, 4, 25, 12, 0, 0, TimeSpan.Zero);
var s = new MyScheduler();
s.SetTime(now);
var due1 = now + TimeSpan.FromMinutes(10);
var due2 = now + TimeSpan.FromMinutes(30);
var due3 = now + TimeSpan.FromMinutes(60);
var done1 = false;
var done2 = false;
var done3 = false;
var d2 = s.Schedule(due2, () => { done2 = true; });
var d1 = s.Schedule(due1, () => { done1 = true; });
var d3 = s.Schedule(due3, () => { done3 = true; });
// First CHK
Assert.Equal(1, cal._queue.Count);
var wrk1 = cal._queue.Deq();
var fst = s.Now + wrk1.Interval;
Assert.True(fst < due1);
// First TRN
s.SetTime(fst);
wrk1.Value._action(wrk1.Value._state);
// First DIS
d1.Dispose();
// First SHT
Assert.Equal(1, s._queue.Count);
var sh1 = s._queue.Deq();
// Second CHK
Assert.Equal(1, cal._queue.Count);
var wrk2 = cal._queue.Deq();
var snd = s.Now + wrk2.Interval;
Assert.True(snd < due2);
// First RUN
s.SetTime(due1);
sh1.Invoke();
Assert.False(done1);
// Second DIS
// Third DIS
d2.Dispose();
d3.Dispose();
// Second TRN
s.SetTime(snd);
wrk2.Value._action(wrk2.Value._state);
// Second SHT
Assert.Equal(1, s._queue.Count);
var sh2 = s._queue.Deq();
// Third CHK
Assert.Equal(1, cal._queue.Count);
var wrk3 = cal._queue.Deq();
var trd = s.Now + wrk3.Interval;
Assert.True(trd < due3);
// Second RUN
s.SetTime(due2);
sh2.Invoke();
Assert.False(done2);
// Third TRN
s.SetTime(trd);
wrk3.Value._action(wrk3.Value._state);
// Third SHT
Assert.Equal(1, s._queue.Count);
var sh3 = s._queue.Deq();
// Third RUN
s.SetTime(due3);
sh3.Invoke();
Assert.False(done3);
}
[Fact]
public void ClockChanged_FalsePositive()
{
Run(ClockChanged_FalsePositive_Callback);
}
private static void ClockChanged_FalsePositive_Callback()
{
var provider = new MyPlatformEnlightenmentProvider();
PlatformEnlightenmentProvider.Current = provider;
var scm = (ClockChanged)provider.GetService<INotifySystemClockChanged>();
var cal = provider._cal;
var now = new DateTimeOffset(2012, 4, 25, 12, 0, 0, TimeSpan.Zero);
var rel = TimeSpan.FromMinutes(1);
var due = now + rel;
var s = new MyScheduler();
s.SetTime(now);
var done = false;
s.Schedule(due, () => { done = true; });
Assert.Equal(1, cal._queue.Count);
s.SetTime(now);
scm.OnSystemClockChanged();
var work = cal._queue.Deq();
Assert.True(work.Interval < rel);
s.SetTime(s.Now + work.Interval);
work.Value._action(work.Value._state);
Assert.Equal(1, s._queue.Count);
var next = s._queue.Deq();
Assert.True(s.Now + next.DueTime == due);
s.SetTime(due);
next.Invoke();
Assert.True(done);
}
[Fact]
public void ClockChanged_Forward1()
{
Run(ClockChanged_Forward1_Callback);
}
private static void ClockChanged_Forward1_Callback()
{
var provider = new MyPlatformEnlightenmentProvider();
PlatformEnlightenmentProvider.Current = provider;
var scm = (ClockChanged)provider.GetService<INotifySystemClockChanged>();
var cal = provider._cal;
var now = new DateTimeOffset(2012, 4, 25, 12, 0, 0, TimeSpan.Zero);
var rel = TimeSpan.FromMinutes(1);
var due = now + rel;
var err = TimeSpan.FromMinutes(1);
var s = new MyScheduler();
s.SetTime(now);
var done = false;
s.Schedule(due, () => { done = true; });
Assert.Equal(1, cal._queue.Count);
Assert.Equal(0, s._queue.Count);
s.SetTime(due + err);
scm.OnSystemClockChanged();
Assert.Equal(1, s._queue.Count);
var next = s._queue.Deq();
Assert.True(next.DueTime == TimeSpan.Zero);
next.Invoke();
Assert.True(done);
var tmr = cal._queue.Deq();
tmr.Value._action(tmr.Value._state);
Assert.Equal(0, cal._queue.Count);
Assert.Equal(0, s._queue.Count);
}
[Fact]
public void ClockChanged_Forward2()
{
Run(ClockChanged_Forward2_Callback);
}
private static void ClockChanged_Forward2_Callback()
{
var provider = new MyPlatformEnlightenmentProvider();
PlatformEnlightenmentProvider.Current = provider;
var scm = (ClockChanged)provider.GetService<INotifySystemClockChanged>();
var cal = provider._cal;
var now = new DateTimeOffset(2012, 4, 25, 12, 0, 0, TimeSpan.Zero);
var rel = TimeSpan.FromSeconds(1);
var due = now + rel;
var err = TimeSpan.FromMinutes(1);
var s = new MyScheduler();
s.SetTime(now);
var n = 0;
s.Schedule(due, () => { n++; });
Assert.Equal(1, s._queue.Count);
var wrk = s._queue.Deq();
Assert.True(wrk.DueTime == rel);
s.SetTime(due + err);
scm.OnSystemClockChanged();
Assert.Equal(1, s._queue.Count);
var next = s._queue.Deq();
Assert.True(next.DueTime == TimeSpan.Zero);
next.Invoke();
Assert.Equal(1, n);
wrk.Invoke(); // Bad schedulers may not grant cancellation immediately.
Assert.Equal(1, n); // Invoke shouldn't cause double execution of the work.
}
[Fact]
public void ClockChanged_Backward1()
{
Run(ClockChanged_Backward1_Callback);
}
private static void ClockChanged_Backward1_Callback()
{
var provider = new MyPlatformEnlightenmentProvider();
PlatformEnlightenmentProvider.Current = provider;
var scm = (ClockChanged)provider.GetService<INotifySystemClockChanged>();
var cal = provider._cal;
var now = new DateTimeOffset(2012, 4, 25, 12, 0, 0, TimeSpan.Zero);
var rel = TimeSpan.FromMinutes(1);
var due = now + rel;
var err = TimeSpan.FromMinutes(-2);
var s = new MyScheduler();
s.SetTime(now);
var done = false;
s.Schedule(due, () => { done = true; });
Assert.Equal(1, cal._queue.Count);
Assert.True(cal._queue[0].Interval < rel);
Assert.Equal(0, s._queue.Count);
s.SetTime(due + err);
scm.OnSystemClockChanged();
Assert.Equal(1, cal._queue.Count);
var tmr = cal._queue.Deq();
Assert.True(tmr.Interval > rel);
Assert.True(tmr.Interval < -err);
s.SetTime(s.Now + tmr.Interval);
tmr.Value._action(tmr.Value._state);
Assert.False(done);
Assert.Equal(0, cal._queue.Count);
Assert.Equal(1, s._queue.Count);
s.SetTime(due);
s._queue.Deq().Invoke();
Assert.True(done);
}
[Fact]
public void ClockChanged_Backward2()
{
Run(ClockChanged_Backward2_Callback);
}
private static void ClockChanged_Backward2_Callback()
{
var provider = new MyPlatformEnlightenmentProvider();
PlatformEnlightenmentProvider.Current = provider;
var scm = (ClockChanged)provider.GetService<INotifySystemClockChanged>();
var cal = provider._cal;
var now = new DateTimeOffset(2012, 4, 25, 12, 0, 0, TimeSpan.Zero);
var rel = TimeSpan.FromSeconds(1);
var due = now + rel;
var err = TimeSpan.FromMinutes(-1);
var s = new MyScheduler();
s.SetTime(now);
var n = 0;
s.Schedule(due, () => { n++; });
Assert.Equal(0, cal._queue.Count);
Assert.Equal(1, s._queue.Count);
var wrk = s._queue[0];
Assert.True(wrk.DueTime == rel);
s.SetTime(due + err);
scm.OnSystemClockChanged();
Assert.Equal(1, cal._queue.Count);
var tmr = cal._queue.Deq();
Assert.True(tmr.Interval > rel);
Assert.True(tmr.Interval < -err);
s.SetTime(s.Now + tmr.Interval);
tmr.Value._action(tmr.Value._state);
Assert.Equal(0, n);
Assert.Equal(0, cal._queue.Count);
Assert.Equal(1, s._queue.Count);
s.SetTime(due);
s._queue.Deq().Invoke();
Assert.Equal(1, n);
wrk.Invoke(); // Bad schedulers may not grant cancellation immediately.
Assert.Equal(1, n); // Invoke shouldn't cause double execution of the work.
}
[Fact]
public void PeriodicSystemClockChangeMonitor()
{
Run(PeriodicSystemClockChangeMonitor_Callback);
}
private static void PeriodicSystemClockChangeMonitor_Callback()
{
var provider = new FakeClockPlatformEnlightenmentProvider();
PlatformEnlightenmentProvider.Current = provider;
var clock = (FakeClock)provider.GetService<ISystemClock>();
clock._now = new DateTimeOffset(2012, 4, 26, 12, 0, 0, TimeSpan.Zero);
var cal = (FakeClockCAL)provider.GetService<IConcurrencyAbstractionLayer>();
var period = TimeSpan.FromSeconds(1);
var ptscm = new PeriodicTimerSystemClockMonitor(period);
var delta = TimeSpan.Zero;
var n = 0;
var h = new EventHandler<SystemClockChangedEventArgs>((o, e) =>
{
delta = e.NewTime - e.OldTime;
n++;
});
ptscm.SystemClockChanged += h;
Assert.NotNull(cal._action);
Assert.True(cal._period == period);
Assert.Equal(0, n);
clock._now += period;
cal._action();
Assert.Equal(0, n);
clock._now += period;
cal._action();
Assert.Equal(0, n);
var diff1 = TimeSpan.FromSeconds(3);
clock._now += period + diff1;
cal._action();
Assert.Equal(1, n);
Assert.True(delta == diff1);
clock._now += period;
cal._action();
Assert.Equal(1, n);
clock._now += period;
cal._action();
Assert.Equal(1, n);
var diff2 = TimeSpan.FromSeconds(-5);
clock._now += period + diff2;
cal._action();
Assert.Equal(2, n);
Assert.True(delta == diff2);
clock._now += period;
cal._action();
Assert.Equal(2, n);
ptscm.SystemClockChanged -= h;
Assert.Null(cal._action);
}
[Fact]
public void ClockChanged_RefCounting()
{
Run(ClockChanged_RefCounting_Callback);
}
private static void ClockChanged_RefCounting_Callback()
{
var provider = new MyPlatformEnlightenmentProvider();
PlatformEnlightenmentProvider.Current = provider;
var scm = (ClockChanged)provider.GetService<INotifySystemClockChanged>();
var cal = provider._cal;
var now = new DateTimeOffset(2012, 4, 25, 12, 0, 0, TimeSpan.Zero);
var s = new MyScheduler();
s.SetTime(now);
var due1 = now + TimeSpan.FromSeconds(5);
var due2 = now + TimeSpan.FromSeconds(8);
var due3 = now + TimeSpan.FromMinutes(1);
var due4 = now + TimeSpan.FromMinutes(2);
var due5 = now + TimeSpan.FromMinutes(3);
var due6 = now + TimeSpan.FromMinutes(3) + TimeSpan.FromSeconds(2);
var done1 = false;
var done2 = false;
var done3 = false;
var done4 = false;
var done5 = false;
var done6 = false;
var d1 = s.Schedule(due1, () => { done1 = true; });
var d5 = s.Schedule(due5, () => { done5 = true; });
var d3 = s.Schedule(due3, () => { done3 = true; throw new Exception(); });
var d2 = s.Schedule(due2, () => { done2 = true; });
var d4 = s.Schedule(due4, () => { done4 = true; });
d2.Dispose();
d4.Dispose();
Assert.Equal(1, scm.n);
s.SetTime(due1);
var i1 = s._queue.Deq();
i1.Invoke();
Assert.True(done1);
Assert.Equal(1, scm.n);
s.SetTime(due2);
var i2 = s._queue.Deq();
i2.Invoke();
Assert.False(done2);
Assert.Equal(1, scm.n);
var l1 = cal._queue.Deq();
var l1d = now + l1.Interval;
s.SetTime(l1d);
l1.Value._action(l1.Value._state);
s.SetTime(due3);
var i3 = s._queue.Deq();
try
{
i3.Invoke();
Assert.True(false);
}
catch { }
Assert.True(done3);
Assert.Equal(1, scm.n);
var l2 = cal._queue.Deq();
var l2d = l1d + l2.Interval;
s.SetTime(l2d);
l2.Value._action(l2.Value._state);
s.SetTime(due4);
var i4 = s._queue.Deq();
i4.Invoke();
Assert.False(done4);
Assert.Equal(1, scm.n);
var l3 = cal._queue.Deq();
var l3d = l2d + l3.Interval;
s.SetTime(l3d);
l3.Value._action(l3.Value._state);
s.SetTime(due5);
var i5 = s._queue.Deq();
i5.Invoke();
Assert.True(done5);
Assert.Equal(0, scm.n);
var d6 = s.Schedule(due6, () => { done6 = true; });
Assert.Equal(1, scm.n);
s.SetTime(due6);
var i6 = s._queue.Deq();
i6.Invoke();
Assert.True(done6);
Assert.Equal(0, scm.n);
}
class MyScheduler : LocalScheduler
{
internal List<ScheduledItem<TimeSpan>> _queue = new List<ScheduledItem<TimeSpan>>();
private DateTimeOffset _now;
public void SetTime(DateTimeOffset now)
{
_now = now;
}
public override DateTimeOffset Now
{
get { return _now; }
}
public override IDisposable Schedule<TState>(TState state, TimeSpan dueTime, Func<IScheduler, TState, IDisposable> action)
{
var s = new ScheduledItem<TimeSpan, TState>(this, state, action, dueTime);
_queue.Add(s);
return Disposable.Create(() => _queue.Remove(s));
}
}
class MyPlatformEnlightenmentProvider : IPlatformEnlightenmentProvider
{
internal MyCAL _cal;
public MyPlatformEnlightenmentProvider()
{
_cal = new MyCAL();
}
public T GetService<T>(params object[] args) where T : class
{
if (typeof(T) == typeof(IConcurrencyAbstractionLayer))
{
return (T)(object)_cal;
}
else if (typeof(T) == typeof(INotifySystemClockChanged))
{
return (T)(object)ClockChanged.Instance;
}
return null;
}
}
class FakeClockPlatformEnlightenmentProvider : IPlatformEnlightenmentProvider
{
internal FakeClockCAL _cal;
internal FakeClock _clock;
public FakeClockPlatformEnlightenmentProvider()
{
_cal = new FakeClockCAL();
_clock = new FakeClock();
}
public T GetService<T>(params object[] args) where T : class
{
if (typeof(T) == typeof(IConcurrencyAbstractionLayer))
{
return (T)(object)_cal;
}
else if (typeof(T) == typeof(ISystemClock))
{
return (T)(object)_clock;
}
return null;
}
}
class Work
{
internal readonly Action<object> _action;
internal readonly object _state;
public Work(Action<object> action, object state)
{
_action = action;
_state = state;
}
}
class MyCAL : IConcurrencyAbstractionLayer
{
internal List<TimeInterval<Work>> _queue = new List<TimeInterval<Work>>();
public IDisposable StartTimer(Action<object> action, object state, TimeSpan dueTime)
{
var t = new TimeInterval<Work>(new Work(action, state), dueTime);
_queue.Add(t);
return Disposable.Create(() => _queue.Remove(t));
}
public IDisposable StartPeriodicTimer(Action action, TimeSpan period)
{
return Disposable.Empty;
}
public IDisposable QueueUserWorkItem(Action<object> action, object state)
{
throw new NotImplementedException();
}
public void Sleep(TimeSpan timeout)
{
throw new NotImplementedException();
}
public IStopwatch StartStopwatch()
{
throw new NotImplementedException();
}
public bool SupportsLongRunning
{
get { throw new NotImplementedException(); }
}
public void StartThread(Action<object> action, object state)
{
throw new NotImplementedException();
}
}
class FakeClockCAL : IConcurrencyAbstractionLayer
{
internal Action _action;
internal TimeSpan _period;
public IDisposable StartTimer(Action<object> action, object state, TimeSpan dueTime)
{
throw new NotImplementedException();
}
public IDisposable StartPeriodicTimer(Action action, TimeSpan period)
{
_action = action;
_period = period;
return Disposable.Create(() => _action = null);
}
public IDisposable QueueUserWorkItem(Action<object> action, object state)
{
throw new NotImplementedException();
}
public void Sleep(TimeSpan timeout)
{
throw new NotImplementedException();
}
public IStopwatch StartStopwatch()
{
throw new NotImplementedException();
}
public bool SupportsLongRunning
{
get { throw new NotImplementedException(); }
}
public void StartThread(Action<object> action, object state)
{
throw new NotImplementedException();
}
}
class FakeClock : ISystemClock
{
internal DateTimeOffset _now;
public DateTimeOffset UtcNow
{
get { return _now; }
}
}
class ClockChanged : INotifySystemClockChanged
{
private static ClockChanged s_instance = new ClockChanged();
private EventHandler<SystemClockChangedEventArgs> _systemClockChanged;
internal int n = 0;
public event EventHandler<SystemClockChangedEventArgs> SystemClockChanged
{
add
{
_systemClockChanged += value;
n++;
}
remove
{
_systemClockChanged -= value;
n--;
}
}
public static ClockChanged Instance
{
get
{
return s_instance;
}
}
public void OnSystemClockChanged()
{
var scc = _systemClockChanged;
if (scc != null)
scc(this, new SystemClockChangedEventArgs());
}
}
}
}
#endif | 29.045133 | 161 | 0.506566 | [
"Apache-2.0"
] | ryanwersal/reactive | Rx.NET/Source/tests/Tests.System.Reactive/Tests/SystemClockTest.cs | 32,823 | C# |
using Autofac;
using UrbanSketchers.Interfaces;
using Xamarin.Forms.Xaml;
namespace UrbanSketchers.Pages
{
/// <summary>
/// Sketch comments page
/// </summary>
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class SketchCommentsPage : ISketchCommentsPage
{
private readonly ISketchCommentsPageViewModel _viewModel;
/// <summary>
/// Initializes a new instance of the SketchCommentsPage class.
/// </summary>
public SketchCommentsPage()
{
InitializeComponent();
_viewModel = Core.Container.Current.Resolve<ISketchCommentsPageViewModel>();
_viewModel.Page = this;
BindingContext = _viewModel;
}
/// <summary>
/// Gets or sets the sketch Id
/// </summary>
public string SketchId
{
get => _viewModel.SketchId;
set => _viewModel.SketchId = value;
}
private void OnImagePropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
if (e.PropertyName == nameof(Image.Width) || e.PropertyName == nameof(Image.Height))
{
if (Image.Width * Image.Height > 4)
{
Image.StartConnectedAnimation("Image");
}
}
}
}
} | 28.387755 | 108 | 0.574407 | [
"MIT"
] | mscherotter/UrbanSketchers | UrbanSketchers/UrbanSketchers/Pages/SketchCommentsPage.xaml.cs | 1,393 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using LiveToLift.Data;
using LiveToLift.Web.Infrastructure.Models;
using AutoMapper.QueryableExtensions;
using LiveToLift.Models;
using AutoMapper;
namespace LiveToLift.Services
{
public class ProgressSheetService : CommonService, IProgressSheetService
{
public ProgressSheetService(IUowData data) : base(data)
{
}
public void AddExerciseInstanceToProgressSheet(AddExInstanceToProgressSheetViewModel model, bool isAdmin, string userId)
{
ProgressSheet dbProgressSheet = this.data.ProgressSheets.All().FirstOrDefault(p => p.Id == model.ProgressSheetId);
ExerciseInstance dbExInstance = this.data.ExerciseInstances.All().FirstOrDefault(e => e.Id == model.ExInstanceId);
if (isAdmin == true || userId == dbProgressSheet.UserId)
{
dbProgressSheet.ExerciseInstances.Add(dbExInstance);
this.data.ProgressSheets.Update(dbProgressSheet);
data.SaveChanges();
}
else
{
throw new UnauthorizedAccessException();
}
}
public int CreateNewProgressSheet(ProgressSheetViewModel model)
{
ProgressSheet dbModel = Mapper.Map<ProgressSheet>(model);
data.ProgressSheets.Add(dbModel);
data.SaveChanges();
return dbModel.Id;
}
public List<ProgressSheetViewModel> GetUserProgressSheet(string userId)
{
List<ProgressSheetViewModel> progressSheets = this.data.ProgressSheets.All().Where(p => p.UserId == userId).
Project().To<ProgressSheetViewModel>().ToList();
return progressSheets;
}
public bool HasAuthorityToCreateProgressSheet(string userId, string adressUserId)
{
var user = this.data.Identity.GetById(userId);
var result = false;
var activeTraining = this.data.ActiveTrainingUsers.All().Where(s => s.TrainerId == userId).FirstOrDefault(s=>s.TraineeId == adressUserId);
//user.UserRoles.Any(s=>s.) &&
if ( activeTraining !=null)
{
result = true;
}
return result;
}
public int UpdateProgressSheet(ProgressSheetViewModel viewModel, bool isAdmin, string userId)
{
var dbProgressSheet = this.data.ProgressSheets.All().FirstOrDefault(p => p.Id == viewModel.Id);
dbProgressSheet.Date = viewModel.Date;
dbProgressSheet.PhotoUrl = viewModel.PhotoUrl;
dbProgressSheet.VideoUrl = viewModel.VideoUrl;
if (isAdmin == true || userId == dbProgressSheet.UserId)
{
this.data.ProgressSheets.Update(dbProgressSheet);
this.data.SaveChanges();
}
else
{
throw new UnauthorizedAccessException();
}
return dbProgressSheet.Id;
}
}
}
| 32.298969 | 150 | 0.61347 | [
"MIT"
] | ivansto01/LiveToFit | LiveToLift.Services/ProgressSheetService.cs | 3,135 | C# |
namespace Microsoft.Protocols.TestSuites.MS_OXNSPI
{
using System;
/// <summary>
/// A class indicates the response body of GetSpecialTable request
/// </summary>
public class GetSpecialTableResponseBody : AddressBookResponseBodyBase
{
/// <summary>
/// Gets or sets an unsigned integer that specifies the return status of the operation.
/// </summary>
public uint ErrorCode { get; set; }
/// <summary>
/// Gets or sets an unsigned integer that specifies the code page that the server used to express string properties.
/// </summary>
public uint CodePage { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the Version field is present.
/// </summary>
public bool HasVersion { get; set; }
/// <summary>
/// Gets or sets an unsigned integer that specifies the version number of the address book hierarchy table that the server has.
/// </summary>
public uint? Version { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the PropertyValues field is present.
/// </summary>
public bool HasRows { get; set; }
/// <summary>
/// Gets or sets an unsigned integer that specifies the number of structures in the Rows field.
/// </summary>
public uint? RowCount { get; set; }
/// <summary>
/// Gets or sets a AddressBookPropValueList structure that contains the values of properties requested.
/// </summary>
public AddressBookPropValueList[] Rows { get; set; }
/// <summary>
/// Parse the response data into response body.
/// </summary>
/// <param name="rawData">The raw data of response</param>
/// <returns>The response body of the request</returns>
public static GetSpecialTableResponseBody Parse(byte[] rawData)
{
GetSpecialTableResponseBody responseBody = new GetSpecialTableResponseBody();
int index = 0;
responseBody.StatusCode = BitConverter.ToUInt32(rawData, index);
index += sizeof(uint);
responseBody.ErrorCode = BitConverter.ToUInt32(rawData, index);
index += sizeof(uint);
responseBody.CodePage = BitConverter.ToUInt32(rawData, index);
index += sizeof(uint);
responseBody.HasVersion = BitConverter.ToBoolean(rawData, index);
index += sizeof(bool);
if (responseBody.HasVersion)
{
responseBody.Version = BitConverter.ToUInt32(rawData, index);
index += sizeof(uint);
}
else
{
responseBody.Version = null;
}
responseBody.HasRows = BitConverter.ToBoolean(rawData, index);
index += sizeof(bool);
if (responseBody.HasRows)
{
responseBody.RowCount = BitConverter.ToUInt32(rawData, index);
index += sizeof(uint);
responseBody.Rows = new AddressBookPropValueList[(uint)responseBody.RowCount];
for (int i = 0; i < responseBody.RowCount; i++)
{
responseBody.Rows[i] = AddressBookPropValueList.Parse(rawData, ref index);
}
}
else
{
responseBody.RowCount = null;
responseBody.Rows = null;
}
responseBody.AuxiliaryBufferSize = BitConverter.ToUInt32(rawData, index);
index += 4;
responseBody.AuxiliaryBuffer = new byte[responseBody.AuxiliaryBufferSize];
Array.Copy(rawData, index, responseBody.AuxiliaryBuffer, 0, responseBody.AuxiliaryBufferSize);
return responseBody;
}
}
} | 40.622449 | 136 | 0.569706 | [
"MIT"
] | ChangDu2021/Interop-TestSuites | ExchangeMAPI/Source/MS-OXNSPI/Adapter/Helper/Structure/ResponseBody/GetSpecialTableResponseBody.cs | 3,981 | C# |
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
namespace Essensoft.AspNetCore.Payment.Alipay.Domain
{
/// <summary>
/// AlipayMarketingToolFengdieTemplateSendModel Data Structure.
/// </summary>
[Serializable]
public class AlipayMarketingToolFengdieTemplateSendModel : AlipayObject
{
/// <summary>
/// 企业 VIP 用户的ID(以 2088 开头的ID)
/// </summary>
[JsonProperty("operator")]
public string Operator { get; set; }
/// <summary>
/// 欲分配站点模板的空间业务 ID 列表
/// </summary>
[JsonProperty("space_ids")]
public List<string> SpaceIds { get; set; }
/// <summary>
/// 欲分配的站点模板的名称,可以在模板包的 package.json 文件中找到 name 字段
/// </summary>
[JsonProperty("template_name")]
public string TemplateName { get; set; }
}
}
| 27 | 75 | 0.606481 | [
"MIT"
] | gebiWangshushu/payment | src/Essensoft.AspNetCore.Payment.Alipay/Domain/AlipayMarketingToolFengdieTemplateSendModel.cs | 968 | C# |
using System;
using System.Collections.Generic;
using OpenTK;
namespace HalfEdgeConverter.HEStructure
{
/// <summary>
/// 頂点情報
/// </summary>
public class Vertex
{
/// <summary>
/// 閾値
/// </summary>
private static float THRESHOLD05 = 0.00001f;
/// <summary>
/// この頂点を始点とするエッジ
/// </summary>
private List<Edge> m_AroundEdge = new List<Edge>();
/// <summary>
/// 座標
/// </summary>
public Vector3 Position
{
get;
private set;
}
/// <summary>
/// HalfEdgeでもつm_VertexのIndex番号
/// </summary>
public int Index { get; set; }
#region [operator]
public static Vector3 operator +(Vertex v1, Vertex v2)
{
return new Vector3(v1.Position + v2.Position);
}
public static Vector3 operator -(Vertex v1, Vertex v2)
{
return new Vector3(v1.Position - v2.Position);
}
public static Vector3 operator *(Vertex v1, Vertex v2)
{
return new Vector3(v1.Position * v2.Position);
}
public static bool operator ==(Vertex v1, Vertex v2)
{
if (object.ReferenceEquals(v1, v2))
{
return true;
}
if ((object)v1 == null || (object)v2 == null)
{
return false;
}
if (Math.Abs(v1.Position.X - v2.Position.X) > THRESHOLD05)
{
return false;
}
if (Math.Abs(v1.Position.Y - v2.Position.Y) > THRESHOLD05)
{
return false;
}
if (Math.Abs(v1.Position.Z - v2.Position.Z) > THRESHOLD05)
{
return false;
}
return true;
}
public static bool operator !=(Vertex v1, Vertex v2)
{
return !(v1 == v2);
}
#endregion
/// <summary>
/// Constructor.
/// </summary>
/// <param name="pos">座標</param>
/// <param name="number"> HalfEdgeでもつm_VertexのIndex番号</param>
public Vertex(Vector3 pos, int index)
{
Position = pos;
Index = index;
}
/// <summary>
/// エッジのセッタ
/// </summary>
/// <param name="edge"></param>
public void AddEdge(Edge edge)
{
if(!m_AroundEdge.Contains(edge))
{
m_AroundEdge.Add(edge);
}
}
/// <summary>
/// この頂点を始点とするエッジのゲッタ
/// </summary>
public IEnumerable<Edge> AroundEdge
{
get
{
if (m_AroundEdge != null)
{
foreach (var edge in m_AroundEdge)
{
yield return edge;
}
}
}
}
/// <summary>
/// この頂点を含むMeshの取得
/// </summary>
public IEnumerable<Mesh> AroundMesh
{
get
{
foreach (var edge in AroundEdge)
{
yield return edge.Mesh;
}
}
}
/// <summary>
/// この頂点の周囲の頂点
/// </summary>
public IEnumerable<Vertex> AroundVertex
{
get
{
foreach (var edge in AroundEdge)
{
yield return edge.End;
}
}
}
}
}
| 24.80137 | 70 | 0.42364 | [
"MIT"
] | slothgreed/HalfEdgeConverter | HEStructure/Vertex.cs | 3,781 | C# |
using System;
namespace PBug.Data
{
public abstract partial class KBActivity
{
public uint Id { get; set; }
public DateTime? DateOfOccurance { get; set; }
public uint InfopageId { get; set; }
public uint? AuthorId { get; set; }
public string Type { get; set; }
public virtual User Author { get; set; }
public virtual Infopage Infopage { get; set; }
}
public partial class CreatePageActivity : KBActivity
{
public string Name { get; set; }
public string ContainedText { get; set; }
public string Tags { get; set; }
public int? Secrecy { get; set; }
}
public partial class EditPageActivity : KBActivity
{
public string OldName { get; set; }
public string NewName { get; set; }
public string OldContainedText { get; set; }
public string NewContainedText { get; set; }
public string OldTags { get; set; }
public string NewTags { get; set; }
public int? OldSecrecy { get; set; }
public int? NewSecrecy { get; set; }
}
public partial class CommentActivity : KBActivity
{
public string ContainedText { get; set; }
public uint CommentId { get; set; }
public virtual InfopageComment Comment { get; set; }
}
public partial class EditCommentActivity : KBActivity
{
public string OldContainedText { get; set; }
public string NewContainedText { get; set; }
public uint CommentId { get; set; }
public virtual InfopageComment Comment { get; set; }
}
} | 30.415094 | 60 | 0.60732 | [
"MIT"
] | BasiqueEvangelist/PBugDotNet | PBug/Data/KBActivity.cs | 1,612 | 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("03. Sheets")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("03. Sheets")]
[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("1a1ac6a7-c444-4edf-9a24-f81713c874eb")]
// 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")]
| 37.648649 | 84 | 0.741565 | [
"MIT"
] | petyakostova/Telerik-Academy | C#/C# 1 Contests/3/Sheets/03. Sheets/Properties/AssemblyInfo.cs | 1,396 | C# |
using System.Collections.Generic;
using Newtonsoft.Json;
namespace ImageDL.Classes.ImageDownloading.Vsco.Models
{
/// <summary>
/// Json model for the request of a Vsco user's information.
/// </summary>
public class VscoUserResults
{
/// <summary>
/// The gathered users.
/// </summary>
[JsonProperty("sites")]
public IList<VscoUserInfo> Users { get; private set; }
}
} | 21.611111 | 61 | 0.694087 | [
"MIT"
] | advorange/ImageDL | src/ImageDL.Core/Classes/ImageDownloading/Vsco/Models/VscoUserResults.cs | 391 | C# |
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Planet : MonoBehaviour {
[Header("Spawns")]
public List<GameObject> BasicSpawns;
public List<GameObject> EliteSpawns;
public List<GameObject> BossSpawns;
[Header("Spawn Preferences")]
public int BasicSpawnCount = 0;
public int EliteSpawnCount = 0;
public int BossSpawnCount = 0;
public float NoSpawnAngle = 40f;
[Header("General Info")]
public string Name;
public float WorldScale = 0.4f;
// Use this for BasicSpawnCount
void Start () {
if (BasicSpawns.Count > 0)
{
for (int i = 0; i < BasicSpawnCount; i++)
{
Vector2 movement = new Vector2();
do
{
movement = new Vector2(Random.value * 360, Random.value * 360);
} while (Vector3.Angle(Quaternion.identity * Vector3.up, World.Instance.PlayerController.GetNewRotation(movement) * Vector3.up) < NoSpawnAngle);
World.Instance.SpawnEnemy(BasicSpawns[(int)Random.Range(0, BasicSpawns.Count)], movement);
}
}
if (EliteSpawns.Count > 0)
{
for (int i = 0; i < EliteSpawnCount; i++)
{
Vector2 movement = new Vector2();
do
{
movement = new Vector2(Random.value * 360, Random.value * 360);
} while (Vector3.Angle(Quaternion.identity * Vector3.up, World.Instance.PlayerController.GetNewRotation(movement) * Vector3.up) < NoSpawnAngle);
World.Instance.SpawnEnemy(EliteSpawns[(int)Random.Range(0, EliteSpawns.Count)], movement);
}
}
if (BossSpawns.Count > 0) {
for (int i = 0; i < BossSpawnCount; i++)
{
Vector2 movement = new Vector2();
do
{
movement = new Vector2(Random.value * 360, Random.value * 360);
} while (Vector3.Angle(Quaternion.identity * Vector3.up, World.Instance.PlayerController.GetNewRotation(movement) * Vector3.up) < NoSpawnAngle);
World.Instance.SpawnEnemy(BossSpawns[(int)Random.Range(0, BossSpawns.Count)], movement);
}
}
}
}
| 34.816667 | 160 | 0.635711 | [
"MIT"
] | SodaCookie/FriendlyGameJam4 | FriendlyGameJam4/Assets/FriendlyGameJam4/Scripts/Planet.cs | 2,091 | C# |
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated from a template.
//
// Manual changes to this file may cause unexpected behavior in your application.
// Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace DataLayer
{
using System.ComponentModel.DataAnnotations;
using System;
using System.Collections.Generic;
[MetadataType(typeof(OrderDetailsMetaData))]
public partial class OrderDetails
{
public int DetailID { get; set; }
public int OrderID { get; set; }
public int ProductID { get; set; }
public int Price { get; set; }
public int Count { get; set; }
public virtual Orders Orders { get; set; }
public virtual Products Products { get; set; }
}
}
| 33.517241 | 85 | 0.54321 | [
"MIT"
] | mahmoodghanbary/EshopASP.Net-MVC | DataLayer/OrderDetails.cs | 972 | C# |
using System.Net;
using Server.Client;
using Server.Command.Command.Base;
using Server.Command.Common;
using Server.Log;
using Server.Server;
namespace Server.Command.Command
{
public class BanIpCommand : HandledCommand
{
protected override string FileName => "LMPIPBans.txt";
protected override object CommandLock { get; } = new object();
public override void Execute(string commandArgs)
{
CommandSystemHelperMethods.SplitCommand(commandArgs, out var ip, out var reason);
reason = string.IsNullOrEmpty(reason) ? "No reason specified" : reason;
if (IPAddress.TryParse(ip, out var ipAddress))
{
var player = ClientRetriever.GetClientByIp(ipAddress);
if (player != null)
MessageQueuer.SendConnectionEnd(player, $"You were banned from the server: {reason}");
Add(ipAddress.ToString());
LunaLog.Normal($"IP Address '{ip}' was banned from the server: {reason}");
}
else
{
LunaLog.Normal($"{ip} is not a valid IP address");
}
}
}
} | 32.75 | 106 | 0.600509 | [
"MIT"
] | Badca52/LunaMultiplayer | Server/Command/Command/BanIpCommand.cs | 1,181 | C# |
using System;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.Owin;
using Microsoft.Owin;
using Microsoft.Owin.Security.Cookies;
using Microsoft.Owin.Security.Google;
using Owin;
using CarRentalSystem.Models;
using CarRentalSystem.Data;
namespace CarRentalSystem
{
public partial class Startup
{
// For more information on configuring authentication, please visit https://go.microsoft.com/fwlink/?LinkId=301864
public void ConfigureAuth(IAppBuilder app)
{
// Configure the db context, user manager and signin manager to use a single instance per request
app.CreatePerOwinContext(CarsDbContext.Create);
app.CreatePerOwinContext<ApplicationUserManager>(ApplicationUserManager.Create);
app.CreatePerOwinContext<ApplicationSignInManager>(ApplicationSignInManager.Create);
// Enable the application to use a cookie to store information for the signed in user
// and to use a cookie to temporarily store information about a user logging in with a third party login provider
// Configure the sign in cookie
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
LoginPath = new PathString("/Account/Login"),
Provider = new CookieAuthenticationProvider
{
// Enables the application to validate the security stamp when the user logs in.
// This is a security feature which is used when you change a password or add an external login to your account.
OnValidateIdentity = SecurityStampValidator.OnValidateIdentity<ApplicationUserManager, User>(
validateInterval: TimeSpan.FromMinutes(30),
regenerateIdentity: (manager, user) => user.GenerateUserIdentityAsync(manager))
}
});
app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);
// Enables the application to temporarily store user information when they are verifying the second factor in the two-factor authentication process.
app.UseTwoFactorSignInCookie(DefaultAuthenticationTypes.TwoFactorCookie, TimeSpan.FromMinutes(5));
// Enables the application to remember the second login verification factor such as phone or email.
// Once you check this option, your second step of verification during the login process will be remembered on the device where you logged in from.
// This is similar to the RememberMe option when you log in.
app.UseTwoFactorRememberBrowserCookie(DefaultAuthenticationTypes.TwoFactorRememberBrowserCookie);
// Uncomment the following lines to enable logging in with third party login providers
//app.UseMicrosoftAccountAuthentication(
// clientId: "",
// clientSecret: "");
//app.UseTwitterAuthentication(
// consumerKey: "",
// consumerSecret: "");
//app.UseFacebookAuthentication(
// appId: "",
// appSecret: "");
//app.UseGoogleAuthentication(new GoogleOAuth2AuthenticationOptions()
//{
// ClientId = "",
// ClientSecret = ""
//});
}
}
} | 51.347826 | 161 | 0.646627 | [
"MIT"
] | Gandjurov/Car-Rental-System | CarRentalSystem/App_Start/Startup.Auth.cs | 3,545 | C# |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.