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 |
|---|---|---|---|---|---|---|---|---|
//-----------------------------------------------------------------------
// <copyright file="InstantPreviewManager.cs" company="Google">
//
// Copyright 2017 Google 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.
//
// </copyright>
//-----------------------------------------------------------------------
namespace GoogleARCoreInternal
{
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Threading;
using GoogleARCore;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.SpatialTracking;
#if UNITY_EDITOR
using UnityEditor;
#endif
#if UNITY_IOS && !UNITY_EDITOR
using AndroidImport = GoogleARCoreInternal.DllImportNoop;
using IOSImport = System.Runtime.InteropServices.DllImportAttribute;
#else
using AndroidImport = System.Runtime.InteropServices.DllImportAttribute;
using IOSImport = GoogleARCoreInternal.DllImportNoop;
#endif
/// <summary>
/// Contains methods for managing communication to the Instant Preview
/// plugin.
/// </summary>
public static class InstantPreviewManager
{
/// <summary>
/// Name of the Instant Preview plugin library.
/// </summary>
public const string InstantPreviewNativeApi = "instant_preview_unity_plugin";
// Guid is taken from meta file and should never change.
private const string k_ApkGuid = "cf7b10762fe921e40a18151a6c92a8a6";
private const string k_NoDevicesFoundAdbResult = "error: device not found";
private const float k_MaxTolerableAspectRatioDifference = 0.1f;
private const string k_MismatchedAspectRatioWarningFormatString =
"The aspect ratio of your game window is different from the aspect ratio of your Instant Preview camera " +
"texture. Please resize your game window's aspect ratio to match, or your preview will be distorted. The " +
"camera texture resolution is {0}, {1}.";
private static readonly WaitForEndOfFrame k_WaitForEndOfFrame = new WaitForEndOfFrame();
private static bool s_PauseWarned = false;
private static bool s_DisabledLightEstimationWarned = false;
private static bool s_DisabledPlaneFindingWarned = false;
/// <summary>
/// Coroutine method that communicates to the Instant Preview plugin
/// every frame.
///
/// If not running in the editor, this does nothing.
/// </summary>
/// <returns>Enumerator for a coroutine that updates Instant Preview
/// every frame.</returns>
public static IEnumerator InitializeIfNeeded()
{
// Terminates if not running in editor.
if (!Application.isEditor)
{
yield break;
}
// User may have explicitly disabled Instant Preview.
if (ARCoreProjectSettings.Instance != null &&
!ARCoreProjectSettings.Instance.IsInstantPreviewEnabled)
{
yield break;
}
#if UNITY_EDITOR
// Determine if any augmented image databases need a rebuild.
List<AugmentedImageDatabase> databases = new List<AugmentedImageDatabase>();
bool shouldRebuild = false;
var augmentedImageDatabaseGuids = AssetDatabase.FindAssets("t:AugmentedImageDatabase");
foreach (var databaseGuid in augmentedImageDatabaseGuids)
{
var database = AssetDatabase.LoadAssetAtPath<AugmentedImageDatabase>(
AssetDatabase.GUIDToAssetPath(databaseGuid));
databases.Add(database);
shouldRebuild = shouldRebuild || database.IsBuildNeeded();
}
// If the preference is to ask the user to rebuild, ask now.
if (shouldRebuild && PromptToRebuildAugmentedImagesDatabase())
{
foreach (var database in databases)
{
string error;
database.BuildIfNeeded(out error);
if (!string.IsNullOrEmpty(error))
{
Debug.LogWarning("Failed to rebuild augmented " +
"image database: " + error);
}
}
}
#endif
var adbPath = InstantPreviewManager.GetAdbPath();
if (adbPath == null)
{
Debug.LogError("Instant Preview requires your Unity Android SDK path to be set. Please set it under " +
"'Preferences > External Tools > Android'. You may need to install the Android SDK first.");
yield break;
}
else if (!File.Exists(adbPath))
{
Debug.LogErrorFormat("adb not found at \"{0}\". Please add adb to your SDK path and restart the Unity editor.", adbPath);
yield break;
}
string localVersion;
if (!StartServer(adbPath, out localVersion))
{
yield break;
}
yield return InstallApkAndRunIfConnected(adbPath, localVersion);
yield return UpdateLoop(adbPath);
}
/// <summary>
/// Uploads the latest camera video frame received from Instant Preview
/// to the specified texture. The texture might be recreated if it is
/// not the right size or null.
/// </summary>
/// <param name="backgroundTexture">Texture variable to store the latest
/// Instant Preview video frame.</param>
/// <returns>True if InstantPreview updated the background texture,
/// false if it did not and the texture still needs updating.</returns>
public static bool UpdateBackgroundTextureIfNeeded(ref Texture2D backgroundTexture)
{
if (!Application.isEditor)
{
return false;
}
IntPtr pixelBytes;
int width;
int height;
if (NativeApi.LockCameraTexture(out pixelBytes, out width, out height))
{
if (backgroundTexture == null || width != backgroundTexture.width ||
height != backgroundTexture.height)
{
backgroundTexture = new Texture2D(width, height, TextureFormat.BGRA32, false);
}
backgroundTexture.LoadRawTextureData(pixelBytes, width * height * 4);
backgroundTexture.Apply();
NativeApi.UnlockCameraTexture();
}
return true;
}
/// <summary>
/// Handles Instant Preview logic when ARCore's EarlyUpdate method is called.
/// </summary>
public static void OnEarlyUpdate()
{
var session = LifecycleManager.Instance.SessionComponent;
if (!Application.isEditor || session == null)
{
return;
}
if (!s_PauseWarned && !session.enabled)
{
Debug.LogWarning("Disabling ARCore session is not available in editor.");
s_PauseWarned = true;
}
var config = session.SessionConfig;
if (config == null)
{
return;
}
if (!s_DisabledLightEstimationWarned && !config.EnableLightEstimation)
{
Debug.LogWarning("ARCore light estimation cannot be disabled in editor.");
s_DisabledLightEstimationWarned = true;
}
if (!s_DisabledPlaneFindingWarned && config.PlaneFindingMode == DetectedPlaneFindingMode.Disabled)
{
Debug.LogWarning("ARCore plane finding cannot be disabled in editor.");
s_DisabledPlaneFindingWarned = true;
}
}
private static IEnumerator UpdateLoop(string adbPath)
{
var renderEventFunc = NativeApi.GetRenderEventFunc();
var shouldConvertToBgra = SystemInfo.graphicsDeviceType == GraphicsDeviceType.Direct3D11;
var loggedAspectRatioWarning = false;
// Waits until the end of the first frame until capturing the screen size,
// because it might be incorrect when first querying it.
yield return k_WaitForEndOfFrame;
var currentWidth = 0;
var currentHeight = 0;
var needToStartActivity = true;
var prevFrameLandscape = false;
RenderTexture screenTexture = null;
RenderTexture targetTexture = null;
RenderTexture bgrTexture = null;
// Begins update loop. The coroutine will cease when the
// ARCoreSession component it's called from is destroyed.
for (;;)
{
yield return k_WaitForEndOfFrame;
var curFrameLandscape = Screen.width > Screen.height;
if (prevFrameLandscape != curFrameLandscape)
{
needToStartActivity = true;
}
prevFrameLandscape = curFrameLandscape;
if (needToStartActivity)
{
string activityName = curFrameLandscape ? "InstantPreviewLandscapeActivity" :
"InstantPreviewActivity";
string output;
string errors;
ShellHelper.RunCommand(adbPath,
"shell am start -S -n com.google.ar.core.instantpreview/." + activityName,
out output, out errors);
needToStartActivity = false;
}
// Creates a target texture to capture the preview window onto.
// Some video encoders prefer the dimensions to be a multiple of 16.
var targetWidth = RoundUpToNearestMultipleOf16(Screen.width);
var targetHeight = RoundUpToNearestMultipleOf16(Screen.height);
if (targetWidth != currentWidth || targetHeight != currentHeight)
{
screenTexture = new RenderTexture(targetWidth, targetHeight, 0);
targetTexture = screenTexture;
if (shouldConvertToBgra)
{
bgrTexture = new RenderTexture(screenTexture.width, screenTexture.height, 0, RenderTextureFormat.BGRA32);
targetTexture = bgrTexture;
}
currentWidth = targetWidth;
currentHeight = targetHeight;
}
NativeApi.Update();
InstantPreviewInput.Update();
AddInstantPreviewTrackedPoseDriverWhenNeeded();
Graphics.Blit(null, screenTexture);
if (shouldConvertToBgra)
{
Graphics.Blit(screenTexture, bgrTexture);
}
var cameraTexture = Frame.CameraImage.Texture;
if (!loggedAspectRatioWarning && cameraTexture != null)
{
var sourceWidth = cameraTexture.width;
var sourceHeight = cameraTexture.height;
var sourceAspectRatio = (float)sourceWidth / sourceHeight;
var destinationWidth = Screen.width;
var destinationHeight = Screen.height;
var destinationAspectRatio = (float)destinationWidth / destinationHeight;
if (Mathf.Abs(sourceAspectRatio - destinationAspectRatio) >
k_MaxTolerableAspectRatioDifference)
{
Debug.LogWarningFormat(k_MismatchedAspectRatioWarningFormatString, sourceWidth,
sourceHeight);
loggedAspectRatioWarning = true;
}
}
NativeApi.SendFrame(targetTexture.GetNativeTexturePtr());
GL.IssuePluginEvent(renderEventFunc, 1);
}
}
private static void AddInstantPreviewTrackedPoseDriverWhenNeeded()
{
foreach (var poseDriver in Component.FindObjectsOfType<TrackedPoseDriver>())
{
poseDriver.enabled = false;
var gameObject = poseDriver.gameObject;
var hasInstantPreviewTrackedPoseDriver =
gameObject.GetComponent<InstantPreviewTrackedPoseDriver>() != null;
if (!hasInstantPreviewTrackedPoseDriver)
{
gameObject.AddComponent<InstantPreviewTrackedPoseDriver>();
}
}
}
private static string GetAdbPath()
{
string sdkRoot = null;
#if UNITY_EDITOR
// Gets adb path and starts instant preview server.
sdkRoot = UnityEditor.EditorPrefs.GetString("AndroidSdkRoot");
#endif // UNITY_EDITOR
if (string.IsNullOrEmpty(sdkRoot))
{
return null;
}
// Gets adb path from known directory.
var adbPath = Path.Combine(Path.GetFullPath(sdkRoot), "platform-tools" + Path.DirectorySeparatorChar + "adb");
if (Application.platform == RuntimePlatform.WindowsEditor)
{
adbPath = Path.ChangeExtension(adbPath, "exe");
}
return adbPath;
}
/// <summary>
/// Tries to install and run the Instant Preview android app.
/// </summary>
/// <param name="adbPath">Path to adb to use for installing.</param>
/// <param name="localVersion">Local version of Instant Preview plugin to compare installed APK against.</param>
/// <returns>Enumerator for coroutine that handles installation if necessary.</returns>
private static IEnumerator InstallApkAndRunIfConnected(string adbPath, string localVersion)
{
string apkPath = null;
#if UNITY_EDITOR
apkPath = UnityEditor.AssetDatabase.GUIDToAssetPath(k_ApkGuid);
#endif // !UNITY_EDITOR
// Early outs if set to install but the apk can't be found.
if (!File.Exists(apkPath))
{
Debug.LogErrorFormat("Trying to install Instant Preview APK but reference to InstantPreview.apk is " +
"broken. Couldn't find an asset with .meta file guid={0}.", k_ApkGuid);
yield break;
}
Result result = new Result();
Thread checkAdbThread = new Thread((object obj) =>
{
Result res = (Result)obj;
string output;
string errors;
// Gets version of installed apk.
ShellHelper.RunCommand(adbPath,
"shell dumpsys package com.google.ar.core.instantpreview | grep versionName",
out output, out errors);
string installedVersion = null;
if (!string.IsNullOrEmpty(output) && string.IsNullOrEmpty(errors))
{
installedVersion = output.Substring(output.IndexOf('=') + 1);
}
// Early outs if no device is connected.
if (string.Compare(errors, k_NoDevicesFoundAdbResult) == 0)
{
return;
}
// Prints errors and exits on failure.
if (!string.IsNullOrEmpty(errors))
{
Debug.LogError(errors);
return;
}
if (installedVersion == null)
{
Debug.LogFormat(
"Instant Preview app not installed on device.",
apkPath);
}
else if (installedVersion != localVersion)
{
Debug.LogFormat(
"Instant Preview installed version \"{0}\" does not match local version \"{1}\".",
installedVersion, localVersion);
}
res.ShouldPromptForInstall = installedVersion != localVersion;
});
checkAdbThread.Start(result);
while (!checkAdbThread.Join(0))
{
yield return 0;
}
if (result.ShouldPromptForInstall)
{
if (PromptToInstall())
{
Thread installThread = new Thread(() =>
{
string output;
string errors;
Debug.LogFormat(
"Installing Instant Preview app version {0}.",
localVersion);
ShellHelper.RunCommand(adbPath,
string.Format("uninstall com.google.ar.core.instantpreview", apkPath),
out output, out errors);
ShellHelper.RunCommand(adbPath,
string.Format("install \"{0}\"", apkPath),
out output, out errors);
// Prints any output from trying to install.
if (!string.IsNullOrEmpty(output))
{
Debug.LogFormat("Instant Preview installation\n{0}", output);
}
if (!string.IsNullOrEmpty(errors))
{
Debug.LogErrorFormat("Failed to install Instant Preview app:\n{0}", errors);
}
});
installThread.Start();
while (!installThread.Join(0))
{
yield return 0;
}
}
else
{
yield break;
}
}
}
private static bool PromptToInstall()
{
#if UNITY_EDITOR
return UnityEditor.EditorUtility.DisplayDialog("Instant Preview",
"To instantly reflect your changes on device, the " +
"Instant Preview app will be installed on your " +
"connected device.\n\nTo disable Instant Preview, " +
"uncheck 'Instant Preview Enabled' under 'Edit > Project Settings > ARCore'.", "Okay", "Don't Install This Time");
#else
return false;
#endif
}
private static bool PromptToRebuildAugmentedImagesDatabase()
{
#if UNITY_EDITOR
return UnityEditor.EditorUtility.DisplayDialog("Augmented Images",
"The Augmented Images database is out of date, " +
"rebuild it now?",
"Build", "Don't Build This Time");
#else
return false;
#endif
}
private static bool StartServer(string adbPath, out string version)
{
// Tries to start server.
const int k_InstantPreviewVersionStringMaxLength = 64;
var versionStringBuilder = new StringBuilder(k_InstantPreviewVersionStringMaxLength);
var started = NativeApi.InitializeInstantPreview(adbPath, versionStringBuilder,
versionStringBuilder.Capacity);
if (!started)
{
Debug.LogErrorFormat("Couldn't start Instant Preview server with adb path \"{0}\".", adbPath);
version = null;
return false;
}
version = versionStringBuilder.ToString();
Debug.LogFormat("Instant Preview version {0}\n" +
"To disable Instant Preview, " +
"uncheck 'Instant Preview Enabled' under 'Edit > Project Settings > ARCore'.",
version);
return true;
}
private static int RoundUpToNearestMultipleOf16(int value)
{
return (value + 15) & ~15;
}
private struct NativeApi
{
#pragma warning disable 626
[AndroidImport(InstantPreviewNativeApi)]
public static extern bool InitializeInstantPreview(
string adbPath, StringBuilder version, int versionStringLength);
[AndroidImport(InstantPreviewNativeApi)]
public static extern void Update();
[AndroidImport(InstantPreviewNativeApi)]
public static extern IntPtr GetRenderEventFunc();
[AndroidImport(InstantPreviewNativeApi)]
public static extern void SendFrame(IntPtr renderTexture);
[AndroidImport(InstantPreviewNativeApi)]
public static extern bool LockCameraTexture(out IntPtr pixelBytes, out int width,
out int height);
[AndroidImport(InstantPreviewNativeApi)]
public static extern void UnlockCameraTexture();
[AndroidImport(InstantPreviewNativeApi)]
public static extern bool IsConnected();
#pragma warning restore 626
}
private class Result
{
public bool ShouldPromptForInstall = false;
}
}
}
| 39.007055 | 138 | 0.55021 | [
"MIT"
] | jukkae/ar-game | Assets/GoogleARCore/SDK/InstantPreview/Scripts/InstantPreviewManager.cs | 22,117 | C# |
using System.Collections.Generic;
using System.Text.Json.Serialization;
namespace Essensoft.AspNetCore.Payment.Alipay.Domain
{
/// <summary>
/// AlipayEcoRenthouseCommunityBaseinfoSyncModel Data Structure.
/// </summary>
public class AlipayEcoRenthouseCommunityBaseinfoSyncModel : AlipayObject
{
/// <summary>
/// 商圈编码
/// </summary>
[JsonPropertyName("bus_code")]
public string BusCode { get; set; }
/// <summary>
/// 商圈所在纬度
/// </summary>
[JsonPropertyName("bus_lat")]
public string BusLat { get; set; }
/// <summary>
/// 商圈所在经度
/// </summary>
[JsonPropertyName("bus_lng")]
public string BusLng { get; set; }
/// <summary>
/// 商圈名称
/// </summary>
[JsonPropertyName("bus_name")]
public string BusName { get; set; }
/// <summary>
/// 商圈覆盖半径(单位:米)
/// </summary>
[JsonPropertyName("bus_radius")]
public long BusRadius { get; set; }
/// <summary>
/// 城市编码
/// </summary>
[JsonPropertyName("city_code")]
public string CityCode { get; set; }
/// <summary>
/// 城市所在纬度
/// </summary>
[JsonPropertyName("city_lat")]
public string CityLat { get; set; }
/// <summary>
/// 城市所在经度
/// </summary>
[JsonPropertyName("city_lng")]
public string CityLng { get; set; }
/// <summary>
/// 城市名称
/// </summary>
[JsonPropertyName("city_name")]
public string CityName { get; set; }
/// <summary>
/// 小区/大楼编码
/// </summary>
[JsonPropertyName("community_code")]
public string CommunityCode { get; set; }
/// <summary>
/// 小区/大楼所在纬度
/// </summary>
[JsonPropertyName("community_lat")]
public string CommunityLat { get; set; }
/// <summary>
/// 小区/大楼所在经度
/// </summary>
[JsonPropertyName("community_lng")]
public string CommunityLng { get; set; }
/// <summary>
/// 小区/大楼名称
/// </summary>
[JsonPropertyName("community_name")]
public string CommunityName { get; set; }
/// <summary>
/// 小区/大楼弄号
/// </summary>
[JsonPropertyName("community_nong")]
public string CommunityNong { get; set; }
/// <summary>
/// 小区/大楼街道
/// </summary>
[JsonPropertyName("community_street")]
public string CommunityStreet { get; set; }
/// <summary>
/// 小区/大楼标识类型 1:小区 2:大楼
/// </summary>
[JsonPropertyName("community_tag")]
public string CommunityTag { get; set; }
/// <summary>
/// 行政区域编码
/// </summary>
[JsonPropertyName("district_code")]
public string DistrictCode { get; set; }
/// <summary>
/// 行政区域所在纬度
/// </summary>
[JsonPropertyName("district_lat")]
public string DistrictLat { get; set; }
/// <summary>
/// 行政区域所在经度
/// </summary>
[JsonPropertyName("district_lng")]
public string DistrictLng { get; set; }
/// <summary>
/// 行政区域名称
/// </summary>
[JsonPropertyName("district_name")]
public string DistrictName { get; set; }
/// <summary>
/// 地铁线地铁站关系
/// </summary>
[JsonPropertyName("subway_stations")]
public List<string> SubwayStations { get; set; }
}
}
| 26.094203 | 76 | 0.512635 | [
"MIT"
] | LuohuaRain/payment | src/Essensoft.AspNetCore.Payment.Alipay/Domain/AlipayEcoRenthouseCommunityBaseinfoSyncModel.cs | 3,879 | C# |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System.Collections.Generic;
using System.Text.Json;
using Azure.Core;
namespace Azure.ResourceManager.Sql.Models
{
public partial class Operation
{
internal static Operation DeserializeOperation(JsonElement element)
{
Optional<string> name = default;
Optional<OperationDisplay> display = default;
Optional<OperationOrigin> origin = default;
Optional<IReadOnlyDictionary<string, object>> properties = default;
foreach (var property in element.EnumerateObject())
{
if (property.NameEquals("name"))
{
name = property.Value.GetString();
continue;
}
if (property.NameEquals("display"))
{
if (property.Value.ValueKind == JsonValueKind.Null)
{
property.ThrowNonNullablePropertyIsNull();
continue;
}
display = OperationDisplay.DeserializeOperationDisplay(property.Value);
continue;
}
if (property.NameEquals("origin"))
{
if (property.Value.ValueKind == JsonValueKind.Null)
{
property.ThrowNonNullablePropertyIsNull();
continue;
}
origin = new OperationOrigin(property.Value.GetString());
continue;
}
if (property.NameEquals("properties"))
{
if (property.Value.ValueKind == JsonValueKind.Null)
{
property.ThrowNonNullablePropertyIsNull();
continue;
}
Dictionary<string, object> dictionary = new Dictionary<string, object>();
foreach (var property0 in property.Value.EnumerateObject())
{
dictionary.Add(property0.Name, property0.Value.GetObject());
}
properties = dictionary;
continue;
}
}
return new Operation(name.Value, display.Value, Optional.ToNullable(origin), Optional.ToDictionary(properties));
}
}
}
| 37.043478 | 124 | 0.504304 | [
"MIT"
] | 0rland0Wats0n/azure-sdk-for-net | sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/Operation.Serialization.cs | 2,556 | C# |
using System;
using System.Text;
using NSec.Cryptography;
using NSec.Cryptography.Formatting;
using Xunit;
namespace NSec.Tests.Formatting
{
public static class Ed25519Tests
{
private static readonly byte[] s_oid = new Asn1Oid(1, 3, 101, 112).Bytes.ToArray();
[Fact]
public static void PkixPrivateKey()
{
var a = new Ed25519();
var b = Utilities.RandomBytes.Slice(0, a.PrivateKeySize);
using (var k = Key.Import(a, b, KeyBlobFormat.RawPrivateKey, KeyExportPolicies.AllowPlaintextExport))
{
var blob = k.Export(KeyBlobFormat.PkixPrivateKey);
var reader = new Asn1Reader(blob);
reader.BeginSequence();
Assert.Equal(0, reader.Integer32());
reader.BeginSequence();
Assert.Equal(s_oid, reader.ObjectIdentifier().ToArray());
reader.End();
var curvePrivateKey = new Asn1Reader(reader.OctetString());
Assert.Equal(b.ToArray(), curvePrivateKey.OctetString().ToArray());
Assert.True(curvePrivateKey.SuccessComplete);
reader.End();
Assert.True(reader.SuccessComplete);
}
}
[Fact]
public static void PkixPrivateKeyText()
{
var a = new Ed25519();
var b = Utilities.RandomBytes.Slice(0, a.PrivateKeySize);
using (var k = Key.Import(a, b, KeyBlobFormat.RawPrivateKey, KeyExportPolicies.AllowPlaintextExport))
{
var expected = Encoding.UTF8.GetBytes(
"-----BEGIN PRIVATE KEY-----\r\n" +
Convert.ToBase64String(k.Export(KeyBlobFormat.PkixPrivateKey)) + "\r\n" +
"-----END PRIVATE KEY-----\r\n");
var actual = k.Export(KeyBlobFormat.PkixPrivateKeyText);
Assert.Equal(expected, actual);
}
}
[Fact]
public static void PkixPublicKey()
{
var a = new Ed25519();
var b = Utilities.RandomBytes.Slice(0, a.PrivateKeySize);
using (var k = Key.Import(a, b, KeyBlobFormat.RawPrivateKey))
{
var publicKeyBytes = k.Export(KeyBlobFormat.RawPublicKey);
var blob = k.Export(KeyBlobFormat.PkixPublicKey);
var reader = new Asn1Reader(blob);
reader.BeginSequence();
reader.BeginSequence();
Assert.Equal(s_oid, reader.ObjectIdentifier().ToArray());
reader.End();
Assert.Equal(publicKeyBytes, reader.BitString().ToArray());
reader.End();
Assert.True(reader.SuccessComplete);
}
}
[Fact]
public static void PkixPublicKeyText()
{
var a = new Ed25519();
var b = Utilities.RandomBytes.Slice(0, a.PrivateKeySize);
using (var k = Key.Import(a, b, KeyBlobFormat.RawPrivateKey))
{
var expected = Encoding.UTF8.GetBytes(
"-----BEGIN PUBLIC KEY-----\r\n" +
Convert.ToBase64String(k.Export(KeyBlobFormat.PkixPublicKey)) + "\r\n" +
"-----END PUBLIC KEY-----\r\n");
var actual = k.Export(KeyBlobFormat.PkixPublicKeyText);
Assert.Equal(expected, actual);
}
}
}
}
| 35.510204 | 113 | 0.540517 | [
"MIT"
] | Shereef/nsec | tests/Formatting/Ed25519Tests.cs | 3,480 | C# |
using System;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading;
using UnityEngine;
// Token: 0x02000010 RID: 16
public class TCPUDPSocket : MonoBehaviour
{
// Token: 0x14000004 RID: 4
// (add) Token: 0x0600006A RID: 106 RVA: 0x00004174 File Offset: 0x00002374
// (remove) Token: 0x0600006B RID: 107 RVA: 0x000041AC File Offset: 0x000023AC
public event Action<string> RecevieDataEvent;
// Token: 0x0600006C RID: 108 RVA: 0x000041E1 File Offset: 0x000023E1
private void Awake()
{
if (TCPUDPSocket.Instance != null)
{
throw new UnityException("单例没有释放");
}
TCPUDPSocket.Instance = this;
}
// Token: 0x0600006D RID: 109 RVA: 0x00004201 File Offset: 0x00002401
public void Start_UDPSender(int self_port, int target_port)
{
if (this.udp_send_flag)
{
return;
}
this.udpClient = new UdpClient(self_port);
this.targetPoint = new IPEndPoint(IPAddress.Parse("255.255.255.255"), target_port);
this.udp_send_flag = true;
}
// Token: 0x0600006E RID: 110 RVA: 0x00004238 File Offset: 0x00002438
public void Start_UDPReceive(int recv_port)
{
if (this.udp_recv_flag)
{
return;
}
this.UDPrecv = new UdpClient(new IPEndPoint(IPAddress.Any, recv_port));
this.endpoint = new IPEndPoint(IPAddress.Any, 0);
this.recvThread = new Thread(new ThreadStart(this.RecvThread));
this.recvThread.IsBackground = true;
this.recvThread.Start();
this.udp_recv_flag = true;
}
// Token: 0x0600006F RID: 111 RVA: 0x000042AA File Offset: 0x000024AA
public void Close_UDPSender()
{
if (!this.udp_send_flag)
{
return;
}
this.udpClient.Close();
this.udp_send_flag = false;
}
// Token: 0x06000070 RID: 112 RVA: 0x000042C7 File Offset: 0x000024C7
public void Close_UDPReceive()
{
if (!this.udp_recv_flag)
{
return;
}
this.thrRecv.Interrupt();
this.thrRecv.Abort();
this.udp_recv_flag = false;
}
// Token: 0x06000071 RID: 113 RVA: 0x000042F0 File Offset: 0x000024F0
public void Write_UDPSender(string strdata)
{
if (!this.udp_send_flag)
{
return;
}
byte[] bytes = Encoding.Default.GetBytes(strdata);
this.udpClient.Send(bytes, bytes.Length, this.targetPoint);
}
// Token: 0x06000072 RID: 114 RVA: 0x00004328 File Offset: 0x00002528
public string Read_UDPReceive()
{
if (this.recvdata == null)
{
return null;
}
this.returnstr = string.Copy(this.recvdata);
if (this.old)
{
this.old = false;
this.recvdata = "";
return this.returnstr;
}
return "";
}
// Token: 0x06000073 RID: 115 RVA: 0x00004378 File Offset: 0x00002578
private void ReceiveCallback(IAsyncResult ar)
{
this.recvBuf = this.UDPrecv.EndReceive(ar, ref this.endpoint);
this.recvdata += Encoding.Default.GetString(this.recvBuf);
this.old = true;
this.messageReceive = true;
}
// Token: 0x06000074 RID: 116 RVA: 0x000043CC File Offset: 0x000025CC
private void RecvThread()
{
this.messageReceive = true;
for (; ; )
{
try
{
if (this.messageReceive)
{
this.UDPrecv.BeginReceive(new AsyncCallback(this.ReceiveCallback), null);
this.messageReceive = false;
}
}
catch (Exception)
{
}
}
}
// Token: 0x06000075 RID: 117 RVA: 0x00004420 File Offset: 0x00002620
private void Start()
{
this.Start_UDPReceive(6000);
}
// Token: 0x06000076 RID: 118 RVA: 0x0000442D File Offset: 0x0000262D
private void Update()
{
this._receiveStr = this.Read_UDPReceive();
if (!string.IsNullOrEmpty(this._receiveStr) && this.RecevieDataEvent != null)
{
this.RecevieDataEvent(this._receiveStr);
}
}
// Token: 0x04000061 RID: 97
private UdpClient udpClient;
// Token: 0x04000062 RID: 98
private IPEndPoint targetPoint;
// Token: 0x04000063 RID: 99
public static TCPUDPSocket Instance;
// Token: 0x04000064 RID: 100
private bool udp_send_flag;
// Token: 0x04000065 RID: 101
private bool udp_recv_flag;
// Token: 0x04000067 RID: 103
private Thread thrRecv;
// Token: 0x04000068 RID: 104
private UdpClient UDPrecv;
// Token: 0x04000069 RID: 105
private IPEndPoint endpoint;
// Token: 0x0400006A RID: 106
private byte[] recvBuf;
// Token: 0x0400006B RID: 107
private Thread recvThread;
// Token: 0x0400006C RID: 108
private bool old;
// Token: 0x0400006D RID: 109
private string returnstr;
// Token: 0x0400006E RID: 110
private string recvdata;
// Token: 0x0400006F RID: 111
private bool messageReceive;
// Token: 0x04000070 RID: 112
private string _receiveStr;
}
| 23.020619 | 85 | 0.710031 | [
"MIT"
] | mmuu1987/Slideway | Assets/Scripts/TCPUDPSocket.cs | 4,480 | C# |
// Copyright (C) 2015 Google, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using System;
using System.Collections.Generic;
using System.Reflection;
using GoogleMobileAds.Common;
namespace GoogleMobileAds.Api
{
public enum NativeAdType
{
CustomTemplate = 0
}
public class AdLoader
{
private IAdLoaderClient adLoaderClient;
private AdLoader(Builder builder)
{
this.AdUnitId = string.Copy(builder.AdUnitId);
this.CustomNativeTemplateClickHandlers =
new Dictionary<string, Action<CustomNativeTemplateAd, string>>(
builder.CustomNativeTemplateClickHandlers);
this.TemplateIds = new HashSet<string>(builder.TemplateIds);
this.AdTypes = new HashSet<NativeAdType>(builder.AdTypes);
Type googleMobileAdsClientFactory = Type.GetType(
"GoogleMobileAds.GoogleMobileAdsClientFactory,Assembly-CSharp");
MethodInfo method = googleMobileAdsClientFactory.GetMethod(
"BuildAdLoaderClient",
BindingFlags.Static | BindingFlags.Public);
this.adLoaderClient = (IAdLoaderClient)method.Invoke(null, new object[] { this });
this.adLoaderClient.OnCustomNativeTemplateAdLoaded +=
delegate (object sender, CustomNativeEventArgs args)
{
if (this.OnCustomNativeTemplateAdLoaded != null)
{
this.OnCustomNativeTemplateAdLoaded(this, args);
}
};
this.adLoaderClient.OnAdFailedToLoad += delegate (
object sender, AdFailedToLoadEventArgs args)
{
if (this.OnAdFailedToLoad != null)
{
this.OnAdFailedToLoad(this, args);
}
};
}
public event EventHandler<AdFailedToLoadEventArgs> OnAdFailedToLoad;
public event EventHandler<CustomNativeEventArgs> OnCustomNativeTemplateAdLoaded;
public Dictionary<string, Action<CustomNativeTemplateAd, string>>
CustomNativeTemplateClickHandlers
{
get; private set;
}
public string AdUnitId { get; private set; }
public HashSet<NativeAdType> AdTypes { get; private set; }
public HashSet<string> TemplateIds { get; private set; }
public void LoadAd(AdRequest request)
{
this.adLoaderClient.LoadAd(request);
}
public class Builder
{
public Builder(string adUnitId)
{
this.AdUnitId = adUnitId;
this.AdTypes = new HashSet<NativeAdType>();
this.TemplateIds = new HashSet<string>();
this.CustomNativeTemplateClickHandlers =
new Dictionary<string, Action<CustomNativeTemplateAd, string>>();
}
internal string AdUnitId { get; private set; }
internal HashSet<NativeAdType> AdTypes { get; private set; }
internal HashSet<string> TemplateIds { get; private set; }
internal Dictionary<string, Action<CustomNativeTemplateAd, string>>
CustomNativeTemplateClickHandlers
{
get; private set;
}
public Builder ForCustomNativeAd(string templateId)
{
this.TemplateIds.Add(templateId);
this.AdTypes.Add(NativeAdType.CustomTemplate);
return this;
}
public Builder ForCustomNativeAd(
string templateId,
Action<CustomNativeTemplateAd, string> callback)
{
this.TemplateIds.Add(templateId);
this.CustomNativeTemplateClickHandlers[templateId] = callback;
this.AdTypes.Add(NativeAdType.CustomTemplate);
return this;
}
public AdLoader Build()
{
return new AdLoader(this);
}
}
}
}
| 34.529851 | 94 | 0.599525 | [
"MIT"
] | Agisight/KalmWords-Crosswords | Assets/GoogleMobileAds/Api/AdLoader.cs | 4,629 | C# |
// Copyright 2008-2009 Louis DeJardin - http://whereslou.com
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
using System;
using System.Collections.Generic;
using Spark.Parser.Markup;
namespace Spark.Compiler.NodeVisitors
{
public abstract class AbstractNodeVisitor : INodeVisitor
{
protected AbstractNodeVisitor(VisitorContext context)
{
Context = context;
}
public VisitorContext Context { get; set; }
public abstract IList<Node> Nodes { get; }
public void Accept(IList<Node> nodes)
{
BeforeAcceptNodes();
foreach (var node in nodes)
Accept(node);
AfterAcceptNodes();
}
protected virtual void BeforeAcceptNodes()
{
}
protected virtual void AfterAcceptNodes()
{
}
public void Accept(Node node)
{
if (node is TextNode)
Visit((TextNode)node);
else if (node is EntityNode)
Visit((EntityNode)node);
else if (node is ExpressionNode)
Visit((ExpressionNode)node);
else if (node is ElementNode)
Visit((ElementNode)node);
else if (node is AttributeNode)
Visit((AttributeNode)node);
else if (node is EndElementNode)
Visit((EndElementNode)node);
else if (node is DoctypeNode)
Visit((DoctypeNode)node);
else if (node is CommentNode)
Visit((CommentNode)node);
else if (node is SpecialNode)
Visit((SpecialNode)node);
else if (node is ExtensionNode)
Visit((ExtensionNode)node);
else if (node is StatementNode)
Visit((StatementNode)node);
else if (node is ConditionNode)
Visit((ConditionNode)node);
else if (node is XMLDeclNode)
Visit((XMLDeclNode) node);
else if (node is ProcessingInstructionNode)
Visit((ProcessingInstructionNode)node);
else
throw new ArgumentException(string.Format("Unknown node type {0}", node.GetType()), "node");
}
protected abstract void Visit(StatementNode node);
protected abstract void Visit(ExpressionNode node);
protected abstract void Visit(EntityNode entityNode);
protected abstract void Visit(DoctypeNode docTypeNode);
protected abstract void Visit(TextNode textNode);
protected abstract void Visit(ElementNode node);
protected abstract void Visit(EndElementNode node);
protected abstract void Visit(AttributeNode attributeNode);
protected abstract void Visit(CommentNode commentNode);
protected abstract void Visit(SpecialNode specialNode);
protected abstract void Visit(ExtensionNode node);
protected abstract void Visit(ConditionNode node);
protected abstract void Visit(XMLDeclNode node);
protected abstract void Visit(ProcessingInstructionNode node);
}
} | 37.22449 | 108 | 0.625548 | [
"Apache-2.0"
] | jayharris/spark | src/Spark/Compiler/NodeVisitors/AbstractNodeVisitor.cs | 3,648 | C# |
using System;
using System.Threading.Tasks;
namespace Onbox.Core.VDev.ReactFactory
{
/// <summary>
/// Onbox Debouncer runs an action after a particular time span has passed without another action is fired
/// </summary>
public class Debouncer
{
private string taskId;
/// <summary>
/// Debounces an action
/// </summary>
public void Debounce(Action action, int delay = 500)
{
var taskId = Guid.NewGuid().ToString();
this.taskId = taskId;
Task.Factory.StartNew(async () =>
{
await Task.Delay(delay);
if (this.taskId == taskId)
{
action?.Invoke();
}
});
}
}
} | 24.59375 | 110 | 0.505718 | [
"MIT"
] | Coolicky/Onboxframework | src/Core.Standard/ReactFactory/Debouncer.cs | 789 | 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("8.2.2.2_OUT_primjer_prirucnik")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("8.2.2.2_OUT_primjer_prirucnik")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[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("930dd7cb-d0af-4164-acf1-edf398b3f6b4")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| 38.540541 | 84 | 0.749649 | [
"MIT"
] | WorldArtGames/AlgebraCSharp2019-1 | ConsoleApp1/8.2.2.2_OUT_primjer_prirucnik/Properties/AssemblyInfo.cs | 1,429 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
using osu.Framework.Input.Bindings;
using osu.Framework.Platform;
using osu.Game.Beatmaps;
using osu.Game.Configuration;
using osu.Game.Overlays.Settings;
using osu.Game.Rulesets.Configuration;
using osu.Game.Rulesets.Difficulty;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Replays.Types;
using osu.Game.Rulesets.Scoring;
using osu.Game.Rulesets.Sentakki.Beatmaps;
using osu.Game.Rulesets.Sentakki.Configuration;
using osu.Game.Rulesets.Sentakki.Difficulty;
using osu.Game.Rulesets.Sentakki.Mods;
using osu.Game.Rulesets.Sentakki.Objects;
using osu.Game.Rulesets.Sentakki.Replays;
using osu.Game.Rulesets.Sentakki.Scoring;
using osu.Game.Rulesets.Sentakki.Statistics;
using osu.Game.Rulesets.Sentakki.UI;
using osu.Game.Rulesets.UI;
using osu.Game.Scoring;
using osu.Game.Screens.Ranking.Statistics;
using osuTK;
namespace osu.Game.Rulesets.Sentakki
{
public class SentakkiRuleset : Ruleset
{
public override string Description => "sentakki";
public override string PlayingVerb => "Washing laundry";
public override ScoreProcessor CreateScoreProcessor() => new SentakkiScoreProcessor();
public override DrawableRuleset CreateDrawableRulesetWith(IBeatmap beatmap, IReadOnlyList<Mod> mods) =>
new DrawableSentakkiRuleset(this, beatmap, mods);
public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) =>
new SentakkiBeatmapConverter(beatmap, this);
public override IBeatmapProcessor CreateBeatmapProcessor(IBeatmap beatmap) =>
new SentakkiBeatmapProcessor(beatmap);
public override DifficultyCalculator CreateDifficultyCalculator(WorkingBeatmap beatmap) =>
new SentakkiDifficultyCalculator(this, beatmap);
public override IConvertibleReplayFrame CreateConvertibleReplayFrame() => new SentakkiReplayFrame();
public override IEnumerable<Mod> GetModsFor(ModType type)
{
switch (type)
{
case ModType.DifficultyReduction:
return new Mod[]
{
new MultiMod(new SentakkiModHalfTime(), new SentakkiModDaycore()),
new SentakkiModNoFail(),
};
case ModType.DifficultyIncrease:
return new Mod[]
{
new SentakkiModHardRock(),
new MultiMod(new SentakkiModSuddenDeath(), new SentakkiModPerfect()),
new MultiMod(new SentakkiModDoubleTime(), new SentakkiModNightcore()),
};
case ModType.Automation:
return new Mod[]
{
new SentakkiModAutoplay(),
new SentakkiModAutoTouch()
};
case ModType.Fun:
return new Mod[]
{
new MultiMod(new ModWindUp(), new ModWindDown()),
new SentakkiModSpin(),
new SentakkiModExperimental(),
};
default:
return Array.Empty<Mod>();
}
}
public override string ShortName => "Sentakki";
public override RulesetSettingsSubsection CreateSettings() => new SentakkiSettingsSubsection(this);
public override IRulesetConfigManager CreateConfig(SettingsStore settings) => new SentakkiRulesetConfigManager(settings, RulesetInfo);
public override IEnumerable<KeyBinding> GetDefaultKeyBindings(int variant = 0) => new[]
{
new KeyBinding(InputKey.Z, SentakkiAction.Button1),
new KeyBinding(InputKey.X, SentakkiAction.Button2),
new KeyBinding(InputKey.MouseLeft, SentakkiAction.Button1),
new KeyBinding(InputKey.MouseRight, SentakkiAction.Button2),
new KeyBinding(InputKey.Number1, SentakkiAction.Key1),
new KeyBinding(InputKey.Number2, SentakkiAction.Key2),
new KeyBinding(InputKey.Number3, SentakkiAction.Key3),
new KeyBinding(InputKey.Number4, SentakkiAction.Key4),
new KeyBinding(InputKey.Number5, SentakkiAction.Key5),
new KeyBinding(InputKey.Number6, SentakkiAction.Key6),
new KeyBinding(InputKey.Number7, SentakkiAction.Key7),
new KeyBinding(InputKey.Number8, SentakkiAction.Key8),
};
public override StatisticRow[] CreateStatisticsForScore(ScoreInfo score, IBeatmap playableBeatmap) => new[]
{
new StatisticRow
{
Columns = new[]
{
new StatisticItem("Timing Distribution", new HitEventTimingDistributionGraph(score.HitEvents)
{
RelativeSizeAxes = Axes.X,
Height = 250
})
}
},
new StatisticRow
{
Columns = new[]
{
new StatisticItem("Judgement Distribution", new JudgementChart(score.HitEvents.Where(e=>e.HitObject is SentakkiHitObject).ToList())
{
RelativeSizeAxes = Axes.X,
Size = new Vector2(1, 250)
}),
}
},
new StatisticRow
{
Columns = new[]
{
new StatisticItem(string.Empty, new SimpleStatisticTable(3, new SimpleStatisticItem[]
{
new UnstableRate(score.HitEvents)
}))
}
}
};
public override Drawable CreateIcon() => new SentakkiIcon(this);
protected override IEnumerable<HitResult> GetValidHitResults()
{
return new[]
{
HitResult.Perfect,
HitResult.Great,
HitResult.Good,
};
}
private class SentakkiIcon : Sprite
{
private readonly Ruleset ruleset;
public SentakkiIcon(Ruleset ruleset)
{
this.ruleset = ruleset;
}
[BackgroundDependencyLoader]
private void load(TextureStore textures, GameHost host)
{
if (!textures.GetAvailableResources().Contains("Textures/SentakkiIcon.png"))
textures.AddStore(host.CreateTextureLoaderStore(ruleset.CreateResourceStore()));
Texture = textures.Get("Textures/SentakkiIcon.png");
}
}
}
}
| 38.754098 | 152 | 0.577411 | [
"MIT"
] | Flutterish/sentakki | osu.Game.Rulesets.Sentakki/SentakkiRuleset.cs | 6,912 | C# |
using System.Collections.Generic;
using System.Threading.Tasks;
namespace FoxTunes.Interfaces
{
public interface IOnDemandMetaDataSource
{
bool Enabled { get; }
string Name { get; }
MetaDataItemType Type { get; }
bool CanGetValue(IFileData fileData, OnDemandMetaDataRequest request);
Task<OnDemandMetaDataValues> GetValues(IEnumerable<IFileData> fileDatas, OnDemandMetaDataRequest request);
}
public class OnDemandMetaDataRequest
{
public OnDemandMetaDataRequest(string name, MetaDataItemType type, bool user, object state = null)
{
this.Name = name;
this.Type = type;
this.User = user;
this.State = state;
}
public string Name { get; private set; }
public MetaDataItemType Type { get; private set; }
public bool User { get; private set; }
public object State { get; private set; }
}
public class OnDemandMetaDataValues
{
public OnDemandMetaDataValues(IEnumerable<OnDemandMetaDataValue> values, bool write)
{
this.Values = values;
this.Write = write;
}
public IEnumerable<OnDemandMetaDataValue> Values { get; private set; }
public bool Write { get; private set; }
}
public class OnDemandMetaDataValue
{
public OnDemandMetaDataValue(IFileData fileData, string value)
{
this.FileData = fileData;
this.Value = value;
}
public IFileData FileData { get; private set; }
public string Value { get; private set; }
}
}
| 26.71875 | 115 | 0.6 | [
"MIT"
] | Raimusoft/FoxTunes | FoxTunes.Core/Interfaces/MetaData/IOnDemandMetaDataSource.cs | 1,712 | C# |
namespace MassTransit.Tests.Middleware
{
using System;
using System.Threading.Tasks;
using MassTransit.Internals;
using MassTransit.Middleware;
using NUnit.Framework;
using Util;
[TestFixture]
public class Bind_Specs
{
[Test]
public async Task Should_include_the_bound_context_in_the_pipe()
{
Filter filter = null;
IPipe<InputContext> pipe = Pipe.New<InputContext>(cfg =>
{
cfg.UseBind(x => x.Source(new ThingFactory(), p =>
{
p.ContextPipe.UseExecuteAsync(context => Console.Out.WriteLineAsync($"ContextPipe: {context.Value}"));
filter = new Filter();
p.UseFilter(filter);
}));
});
await pipe.Send(new InputContext("Input"));
await filter.GotTheThing.OrTimeout(s: 5);
}
class Filter :
IFilter<BindContext<InputContext, Thing>>
{
readonly TaskCompletionSource<Thing> _completed;
public Filter()
{
_completed = TaskUtil.GetTask<Thing>();
}
public Task<Thing> GotTheThing => _completed.Task;
public async Task Send(BindContext<InputContext, Thing> context, IPipe<BindContext<InputContext, Thing>> next)
{
_completed.SetResult(context.Right);
await next.Send(context);
}
public void Probe(ProbeContext context)
{
}
}
class ThingFactory :
IPipeContextSource<Thing, InputContext>
{
public Task Send(InputContext context, IPipe<Thing> pipe)
{
var thing = new Thing { Value = "Rock!" };
return pipe.Send(thing);
}
public void Probe(ProbeContext context)
{
}
}
class Thing :
BasePipeContext,
PipeContext
{
public string Value { get; set; }
}
}
}
| 25.590361 | 122 | 0.51742 | [
"ECL-2.0",
"Apache-2.0"
] | AlexanderMeier/MassTransit | tests/MassTransit.Tests/Middleware/Bind_Specs.cs | 2,126 | C# |
/*
* Copyright 2016 Mikhail Shiryaev
*
* 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.
*
*
* Product : Rapid SCADA
* Module : ScadaData.Svc
* Summary : The base class for Windows service installer
*
* Author : Mikhail Shiryaev
* Created : 2016
* Modified : 2016
*/
using System;
using System.Configuration.Install;
using System.ServiceProcess;
namespace Scada.Svc
{
/// <summary>
/// The base class for Windows service installer
/// <para>Базовый класс установщика службы Windows</para>
/// </summary>
public abstract class BaseSvcInstaller : Installer
{
/// <summary>
/// Инициализировать установщик службы
/// </summary>
protected void Init(string defSvcName, string defDescr)
{
// загрузка и проверка свойств службы
SvcProps svcProps = new SvcProps();
if (!svcProps.LoadFromFile())
{
svcProps.ServiceName = defSvcName;
svcProps.Description = defDescr;
}
if (string.IsNullOrEmpty(svcProps.ServiceName))
throw new ScadaException(SvcProps.ServiceNameEmptyError);
// настройка установщика
ServiceInstaller serviceInstaller = new ServiceInstaller();
ServiceProcessInstaller serviceProcessInstaller = new ServiceProcessInstaller();
serviceInstaller.ServiceName = svcProps.ServiceName;
serviceInstaller.DisplayName = svcProps.ServiceName;
serviceInstaller.Description = svcProps.Description ?? "";
serviceInstaller.StartType = ServiceStartMode.Automatic;
serviceProcessInstaller.Account = ServiceAccount.LocalSystem;
serviceProcessInstaller.Password = null;
serviceProcessInstaller.Username = null;
Installers.AddRange(new Installer[] {serviceInstaller, serviceProcessInstaller});
}
}
}
| 34.055556 | 93 | 0.66721 | [
"Apache-2.0"
] | Arvid-new/scada | ScadaData/ScadaData.Svc/BaseSvcInstaller.cs | 2,565 | C# |
using System.Runtime.CompilerServices;
[assembly: InternalsVisibleTo("JsonStore.Sql.Tests", AllInternalsVisible = true)] | 40.666667 | 81 | 0.819672 | [
"MIT"
] | arleypadua/JsonStore | src/JsonStore.Sql/Assembly.cs | 124 | C# |
using System.Linq;
using HtmlAgilityPack;
namespace ReverseMarkdown.Converters
{
public class Strong
: ConverterBase
{
public Strong(Converter converter)
: base(converter)
{
this.Converter.Register("strong", this);
this.Converter.Register("b", this);
this.Converter.Register("u", this);
}
public override string Convert(HtmlNode node)
{
string content = this.TreatChildren(node);
if (this.Converter.Config.TextNotMarkdown || string.IsNullOrEmpty(content.Trim()) || AlreadyBold(node))
{
return content;
}
else
{
return "**" + content.Trim() + "**";
}
}
private bool AlreadyBold(HtmlNode node)
{
return node.Ancestors("strong").Count() > 0 || node.Ancestors("b").Count() > 0;
}
}
}
| 20.210526 | 106 | 0.648438 | [
"MIT"
] | chrisquirk/reversemarkdown-net | src/ReverseMarkdown/Converters/Strong.cs | 770 | C# |
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the clouddirectory-2017-01-11.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Amazon.CloudDirectory.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.CloudDirectory.Model.Internal.MarshallTransformations
{
/// <summary>
/// ListOutgoingTypedLinks Request Marshaller
/// </summary>
public class ListOutgoingTypedLinksRequestMarshaller : IMarshaller<IRequest, ListOutgoingTypedLinksRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
{
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public IRequest Marshall(AmazonWebServiceRequest input)
{
return this.Marshall((ListOutgoingTypedLinksRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(ListOutgoingTypedLinksRequest publicRequest)
{
IRequest request = new DefaultRequest(publicRequest, "Amazon.CloudDirectory");
request.Headers["Content-Type"] = "application/json";
request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-01-11";
request.HttpMethod = "POST";
request.ResourcePath = "/amazonclouddirectory/2017-01-11/typedlink/outgoing";
request.MarshallerVersion = 2;
using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture))
{
JsonWriter writer = new JsonWriter(stringWriter);
writer.WriteObjectStart();
var context = new JsonMarshallerContext(request, writer);
if(publicRequest.IsSetConsistencyLevel())
{
context.Writer.WritePropertyName("ConsistencyLevel");
context.Writer.Write(publicRequest.ConsistencyLevel);
}
if(publicRequest.IsSetFilterAttributeRanges())
{
context.Writer.WritePropertyName("FilterAttributeRanges");
context.Writer.WriteArrayStart();
foreach(var publicRequestFilterAttributeRangesListValue in publicRequest.FilterAttributeRanges)
{
context.Writer.WriteObjectStart();
var marshaller = TypedLinkAttributeRangeMarshaller.Instance;
marshaller.Marshall(publicRequestFilterAttributeRangesListValue, context);
context.Writer.WriteObjectEnd();
}
context.Writer.WriteArrayEnd();
}
if(publicRequest.IsSetFilterTypedLink())
{
context.Writer.WritePropertyName("FilterTypedLink");
context.Writer.WriteObjectStart();
var marshaller = TypedLinkSchemaAndFacetNameMarshaller.Instance;
marshaller.Marshall(publicRequest.FilterTypedLink, context);
context.Writer.WriteObjectEnd();
}
if(publicRequest.IsSetMaxResults())
{
context.Writer.WritePropertyName("MaxResults");
context.Writer.Write(publicRequest.MaxResults);
}
if(publicRequest.IsSetNextToken())
{
context.Writer.WritePropertyName("NextToken");
context.Writer.Write(publicRequest.NextToken);
}
if(publicRequest.IsSetObjectReference())
{
context.Writer.WritePropertyName("ObjectReference");
context.Writer.WriteObjectStart();
var marshaller = ObjectReferenceMarshaller.Instance;
marshaller.Marshall(publicRequest.ObjectReference, context);
context.Writer.WriteObjectEnd();
}
writer.WriteObjectEnd();
string snippet = stringWriter.ToString();
request.Content = System.Text.Encoding.UTF8.GetBytes(snippet);
}
if(publicRequest.IsSetDirectoryArn())
request.Headers["x-amz-data-partition"] = publicRequest.DirectoryArn;
return request;
}
private static ListOutgoingTypedLinksRequestMarshaller _instance = new ListOutgoingTypedLinksRequestMarshaller();
internal static ListOutgoingTypedLinksRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static ListOutgoingTypedLinksRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 37.980769 | 159 | 0.606414 | [
"Apache-2.0"
] | PureKrome/aws-sdk-net | sdk/src/Services/CloudDirectory/Generated/Model/Internal/MarshallTransformations/ListOutgoingTypedLinksRequestMarshaller.cs | 5,925 | C# |
namespace MassTransit.WindsorIntegration.ScopeProviders
{
using System;
using System.Threading.Tasks;
using Castle.MicroKernel;
using Courier;
using Courier.Contexts;
using GreenPipes;
using Scoping;
using Scoping.CourierContexts;
public class WindsorExecuteActivityScopeProvider<TActivity, TArguments> :
IExecuteActivityScopeProvider<TActivity, TArguments>
where TActivity : class, IExecuteActivity<TArguments>
where TArguments : class
{
readonly IKernel _kernel;
public WindsorExecuteActivityScopeProvider(IKernel kernel)
{
_kernel = kernel;
}
public ValueTask<IExecuteActivityScopeContext<TActivity, TArguments>> GetScope(ExecuteContext<TArguments> context)
{
if (context.TryGetPayload<IKernel>(out var kernel))
{
kernel.UpdateScope(context);
var activity = kernel.Resolve<TActivity>(new Arguments().AddTyped(context.Arguments));
ExecuteActivityContext<TActivity, TArguments> activityContext = context.CreateActivityContext(activity);
return new ValueTask<IExecuteActivityScopeContext<TActivity, TArguments>>(
new ExistingExecuteActivityScopeContext<TActivity, TArguments>(activityContext, ReleaseComponent));
}
var scope = _kernel.CreateNewOrUseExistingMessageScope();
try
{
ExecuteContext<TArguments> scopeContext = new ExecuteContextScope<TArguments>(context, _kernel);
_kernel.UpdateScope(scopeContext);
var activity = _kernel.Resolve<TActivity>(new Arguments().AddTyped(context.Arguments));
ExecuteActivityContext<TActivity, TArguments> activityContext = scopeContext.CreateActivityContext(activity);
return new ValueTask<IExecuteActivityScopeContext<TActivity, TArguments>>(
new CreatedExecuteActivityScopeContext<IDisposable, TActivity, TArguments>(scope, activityContext, ReleaseComponent));
}
catch
{
scope.Dispose();
throw;
}
}
public void Probe(ProbeContext context)
{
context.Add("provider", "windsor");
}
void ReleaseComponent<T>(T component)
{
_kernel.ReleaseComponent(component);
}
}
}
| 34.676056 | 138 | 0.644192 | [
"ECL-2.0",
"Apache-2.0"
] | BartekSTRX/MassTransit | src/Containers/MassTransit.WindsorIntegration/ScopeProviders/WindsorExecuteActivityScopeProvider.cs | 2,462 | C# |
using System;
namespace IniWrapper.Attribute
{
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct | AttributeTargets.Interface)]
public class IniConverterAttribute : System.Attribute
{
public Type IniHandlerType { get; }
public object[] ConverterParameters { get; }
public IniConverterAttribute(Type iniHandlerType)
{
IniHandlerType = iniHandlerType;
}
public IniConverterAttribute(Type iniHandlerType, object[] converterParameters)
{
IniHandlerType = iniHandlerType;
ConverterParameters = converterParameters;
}
}
} | 31.652174 | 176 | 0.690934 | [
"MIT"
] | Szpi/IniWrapper | IniWrapper/IniWrapper/Attribute/IniConverterAttribute.cs | 730 | C# |
/**
* Copyright 2013-2013 Mohawk College of Applied Arts and Technology
*
* 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.
*
* User: fyfej
* Date: 24-5-2013
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.Specialized;
using MohawkCollege.Util.Console.Parameters;
namespace MARC.HI.EHRS.CR.Configurator
{
/// <summary>
/// Console parameters
/// </summary>
public class ConsoleParameters
{
/// <summary>
/// List deployment options
/// </summary>
[Parameter("l")]
[Parameter("list")]
public bool ListDeploy { get; set; }
/// <summary>
/// Deployment scripts to run
/// </summary>
[Parameter("d")]
[Parameter("deploy")]
public StringCollection Deploy { get; set; }
/// <summary>
/// Deployment options
/// </summary>
[ParameterExtension()]
public Dictionary<String, StringCollection> Options { get; set; }
}
}
| 28.803571 | 82 | 0.623063 | [
"Apache-2.0"
] | MohawkMEDIC/client-registry | MARC.HI.EHRS.CR.Configurator/ConsoleParameters.cs | 1,615 | C# |
using AlphaTest.Core.Common;
namespace AlphaTest.Core.Tests.Publishing.Rules
{
public class OnlyPendingProposalCanBeAprovedOrDeclinedRule : IBusinessRule
{
private readonly PublishingProposal _proposal;
public OnlyPendingProposalCanBeAprovedOrDeclinedRule(PublishingProposal proposal)
{
_proposal = proposal;
}
public string Message => $"Заявка может быть одобрена или отклонена только после назначения исполнителя.";
public bool IsBroken => _proposal.Status != ProposalStatus.PENDING;
}
}
| 29.842105 | 114 | 0.724868 | [
"MIT"
] | Damakshn/AlphaTest | src/AlphaTest.Core/Tests/Publishing/Rules/OnlyPendingProposalCanBeAprovedOrDeclinedRule.cs | 636 | C# |
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.XR.Interaction.Toolkit;
public class Swordbehaviour : XRGrabInteractable
{
public Transform objectToVibrate;
private Vector3 initialPosition;
public float amplitude; // the amount it moves
public float frequency; // the period of the earthquake
public Material normalMaterial;
public Material hoveredMaterial;
public MeshRenderer swordObjectRenderer;
void Start()
{
initialPosition = objectToVibrate.position; // store this to avoid floating point error drift
}
void Update()
{
initialPosition = objectToVibrate.position;
if (isHovered && !isSelected)
{
objectToVibrate.position = initialPosition + (objectToVibrate.forward * Mathf.Sin(frequency * Time.time) * amplitude) + objectToVibrate.right * Mathf.Sin(frequency/2 * Time.time) * amplitude + objectToVibrate.up * Mathf.Sin(frequency /3 * Time.time) * amplitude;
}
if (isSelected && swordObjectRenderer.material != normalMaterial)
{
swordObjectRenderer.material = normalMaterial;
}
}
protected override void OnHoverEnter(XRBaseInteractor interactor)
{
base.OnHoverEnter(interactor);
swordObjectRenderer.material = hoveredMaterial;
}
protected override void OnHoverExit(XRBaseInteractor interactor)
{
base.OnHoverExit(interactor);
swordObjectRenderer.material = normalMaterial;
}
}
| 25.916667 | 271 | 0.694534 | [
"MIT"
] | jpcurti/Can-I-make-a-game | Can-I-make-a-VR-Game/Assets/Swordbehaviour.cs | 1,557 | C# |
using System;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace Json.Schema
{
/// <summary>
/// Handles `exclusiveMinimum`.
/// </summary>
[SchemaKeyword(Name)]
[SchemaDraft(Draft.Draft6)]
[SchemaDraft(Draft.Draft7)]
[SchemaDraft(Draft.Draft201909)]
[SchemaDraft(Draft.Draft202012)]
[Vocabulary(Vocabularies.Validation201909Id)]
[Vocabulary(Vocabularies.Validation202012Id)]
[JsonConverter(typeof(ExclusiveMinimumKeywordJsonConverter))]
public class ExclusiveMinimumKeyword : IJsonSchemaKeyword, IEquatable<ExclusiveMinimumKeyword>
{
internal const string Name = "exclusiveMinimum";
/// <summary>
/// The minimum value.
/// </summary>
public decimal Value { get; }
/// <summary>
/// Creates a new <see cref="ExclusiveMinimumKeyword"/>.
/// </summary>
/// <param name="value">The minimum value.</param>
public ExclusiveMinimumKeyword(decimal value)
{
Value = value;
}
/// <summary>
/// Provides validation for the keyword.
/// </summary>
/// <param name="context">Contextual details for the validation process.</param>
public void Validate(ValidationContext context, in JsonElement target, out ValidationResult result)
{
context.EnterKeyword(Name);
if (target.ValueKind != JsonValueKind.Number)
{
context.WrongValueKind(target.ValueKind);
result = ValidationResult.Success;
return;
}
var number = target.GetDecimal();
result = ValidationResult.Check(Value < number,
$"{number} is not less than {Value}");
context.ExitKeyword(Name, result.IsValid);
}
/// <summary>Indicates whether the current object is equal to another object of the same type.</summary>
/// <param name="other">An object to compare with this object.</param>
/// <returns>true if the current object is equal to the <paramref name="other">other</paramref> parameter; otherwise, false.</returns>
public bool Equals(ExclusiveMinimumKeyword? other)
{
if (ReferenceEquals(null, other)) return false;
if (ReferenceEquals(this, other)) return true;
return Value == other.Value;
}
/// <summary>Determines whether the specified object is equal to the current object.</summary>
/// <param name="obj">The object to compare with the current object.</param>
/// <returns>true if the specified object is equal to the current object; otherwise, false.</returns>
public override bool Equals(object obj)
{
return Equals(obj as ExclusiveMinimumKeyword);
}
/// <summary>Serves as the default hash function.</summary>
/// <returns>A hash code for the current object.</returns>
public override int GetHashCode()
{
return Value.GetHashCode();
}
}
internal class ExclusiveMinimumKeywordJsonConverter : JsonConverter<ExclusiveMinimumKeyword>
{
public override ExclusiveMinimumKeyword Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
if (reader.TokenType != JsonTokenType.Number)
throw new JsonException("Expected number");
var number = reader.GetDecimal();
return new ExclusiveMinimumKeyword(number);
}
public override void Write(Utf8JsonWriter writer, ExclusiveMinimumKeyword value, JsonSerializerOptions options)
{
writer.WriteNumber(ExclusiveMinimumKeyword.Name, value.Value);
}
}
} | 33.377551 | 136 | 0.731275 | [
"MIT"
] | dazerdude/json-everything | JsonSchema/ExclusiveMinimumKeyword.cs | 3,273 | C# |
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Numerics;
using PersistentPlanet.Graphics;
namespace PersistentPlanet.DualContouring
{
public class Octree
{
public static int MATERIAL_AIR = 0;
public static int MATERIAL_SOLID = 1;
public static float QEF_ERROR = 1e-6f;
public static int QEF_SWEEPS = 4;
private static readonly Queue<OctreeNode> _spareNodes = new Queue<OctreeNode>();
private static readonly Queue<OctreeDrawInfo> _spareDrawInfo = new Queue<OctreeDrawInfo>();
public static readonly Vector3[] CHILD_MIN_OFFSETS =
{
// needs to match the vertMap from Dual Contouring impl
new Vector3(0, 0, 0),
new Vector3(0, 0, 1),
new Vector3(0, 1, 0),
new Vector3(0, 1, 1),
new Vector3(1, 0, 0),
new Vector3(1, 0, 1),
new Vector3(1, 1, 0),
new Vector3(1, 1, 1),
};
// data from the original DC impl, drives the contouring process
private static readonly int[][] Edgevmap =
{
new[] {2, 4},
new[] {1, 5},
new[] {2, 6},
new[] {3, 7}, // x-axis
new[] {0, 2},
new[] {1, 3},
new[] {4, 6},
new[] {5, 7}, // y-axis
new[] {0, 1},
new[] {2, 3},
new[] {4, 5},
new[] {6, 7} // z-axis
};
public static readonly int[] edgemask = {5, 3, 6};
public static readonly int[][] vertMap =
{
new[] {0, 0, 0},
new[] {0, 0, 1},
new[] {0, 1, 0},
new[] {0, 1, 1},
new[] {1, 0, 0},
new[] {1, 0, 1},
new[] {1, 1, 0},
new[] {1, 1, 1}
};
public static readonly int[][] faceMap =
{
new[] {4, 8, 5, 9},
new[] {6, 10, 7, 11},
new[] {0, 8, 1, 10},
new[] {2, 9, 3, 11},
new[] {0, 4, 2, 6},
new[] {1, 5, 3, 7}
};
public static readonly int[][] cellProcFaceMask =
{
new[] {0, 4, 0},
new[] {1, 5, 0},
new[] {2, 6, 0},
new[] {3, 7, 0},
new[] {0, 2, 1},
new[] {4, 6, 1},
new[] {1, 3, 1},
new[] {5, 7, 1},
new[] {0, 1, 2},
new[] {2, 3, 2},
new[] {4, 5, 2},
new[] {6, 7, 2}
};
public static readonly int[][] cellProcEdgeMask =
{
new[] {0, 1, 2, 3, 0},
new[] {4, 5, 6, 7, 0},
new[] {0, 4, 1, 5, 1},
new[] {2, 6, 3, 7, 1},
new[] {0, 2, 4, 6, 2},
new[] {1, 3, 5, 7, 2}
};
public static readonly int[][][] faceProcFaceMask =
{
new[] {new[] {4, 0, 0}, new[] {5, 1, 0}, new[] {6, 2, 0}, new[] {7, 3, 0}},
new[] {new[] {2, 0, 1}, new[] {6, 4, 1}, new[] {3, 1, 1}, new[] {7, 5, 1}},
new[] {new[] {1, 0, 2}, new[] {3, 2, 2}, new[] {5, 4, 2}, new[] {7, 6, 2}}
};
public static readonly int[][][] faceProcEdgeMask =
{
new[] {new[] {1, 4, 0, 5, 1, 1}, new[] {1, 6, 2, 7, 3, 1}, new[] {0, 4, 6, 0, 2, 2}, new[] {0, 5, 7, 1, 3, 2}},
new[] {new[] {0, 2, 3, 0, 1, 0}, new[] {0, 6, 7, 4, 5, 0}, new[] {1, 2, 0, 6, 4, 2}, new[] {1, 3, 1, 7, 5, 2}},
new[] {new[] {1, 1, 0, 3, 2, 0}, new[] {1, 5, 4, 7, 6, 0}, new[] {0, 1, 5, 0, 4, 1}, new[] {0, 3, 7, 2, 6, 1}}
};
public static readonly int[][][] edgeProcEdgeMask =
{
new[] {new[] {3, 2, 1, 0, 0}, new[] {7, 6, 5, 4, 0}},
new[] {new[] {5, 1, 4, 0, 1}, new[] {7, 3, 6, 2, 1}},
new[] {new[] {6, 4, 2, 0, 2}, new[] {7, 5, 3, 1, 2}},
};
public static readonly int[][] processEdgeMask =
{
new[] {3, 2, 1, 0},
new[] {7, 5, 6, 4},
new[] {11, 10, 9, 8}
};
public static OctreeNode SimplifyOctree(OctreeNode node, float threshold)
{
if (node == null)
{
return null;
}
if (node.Type != OctreeNodeType.Node_Internal)
{
// can't simplify!
return node;
}
var qef = new QefSolver();
var signs = new[] {-1, -1, -1, -1, -1, -1, -1, -1};
var midsign = -1;
var isCollapsible = true;
for (var i = 0; i < 8; i++)
{
node.children[i] = SimplifyOctree(node.children[i], threshold);
if (node.children[i] != null)
{
var child = node.children[i];
if (child.Type == OctreeNodeType.Node_Internal)
{
isCollapsible = false;
}
else
{
qef.add(child.drawInfo.qef);
midsign = (child.drawInfo.corners >> (7 - i)) & 1;
signs[i] = (child.drawInfo.corners >> i) & 1;
}
}
}
if (!isCollapsible)
{
// at least one child is an internal node, can't collapse
return node;
}
var qefPosition = Vector3.Zero;
qef.solve(qefPosition, QEF_ERROR, QEF_SWEEPS, QEF_ERROR);
var error = qef.getError();
// convert to glm vec3 for ease of use
var position = new Vector3(qefPosition.X, qefPosition.Y, qefPosition.Z);
// at this point the masspoint will actually be a sum, so divide to make it the average
if (error > threshold)
{
// this collapse breaches the threshold
return node;
}
if (position.X < node.min.X || position.X > (node.min.X + node.size) ||
position.Y < node.min.Y || position.Y > (node.min.Y + node.size) ||
position.Z < node.min.Z || position.Z > (node.min.Z + node.size))
{
position = qef.getMassPoint();
}
// change the node from an internal node to a 'psuedo leaf' node
var drawInfo = _spareDrawInfo.Count > 0 ? _spareDrawInfo.Dequeue() : new OctreeDrawInfo();
drawInfo.corners = 0;
drawInfo.index = 0;
for (var i = 0; i < 8; i++)
{
if (signs[i] == -1)
{
// Undetermined, use centre sign instead
drawInfo.corners |= (midsign << i);
}
else
{
drawInfo.corners |= (signs[i] << i);
}
}
drawInfo.averageNormal = Vector3.Zero;
for (var i = 0; i < 8; i++)
{
if (node.children[i] != null)
{
var child = node.children[i];
if (child.Type == OctreeNodeType.Node_Psuedo ||
child.Type == OctreeNodeType.Node_Leaf)
{
drawInfo.averageNormal += child.drawInfo.averageNormal;
}
}
}
drawInfo.averageNormal = Vector3.Normalize(drawInfo.averageNormal);
drawInfo.position = position;
drawInfo.qef = qef.getData();
DestroyOctree(node);
node.Type = OctreeNodeType.Node_Psuedo;
node.drawInfo = drawInfo;
return node;
}
private static void GenerateVertexIndices(OctreeNode node, List<MeshVertex> vertexBuffer)
{
if (node == null)
{
return;
}
if (node.Type != OctreeNodeType.Node_Leaf)
{
for (var i = 0; i < 8; i++)
{
GenerateVertexIndices(node.children[i], vertexBuffer);
}
}
if (node.Type != OctreeNodeType.Node_Internal)
{
node.drawInfo.index = (uint) vertexBuffer.Count;
vertexBuffer.Add(new MeshVertex(node.drawInfo.position, node.drawInfo.averageNormal));
}
}
private static void ContourProcessEdge(OctreeNode[] node, int dir, List<uint> indexBuffer)
{
var minSize = 1000000; // arbitrary big number
var minIndex = 0;
var indices = new uint[4] {0, 0, 0, 0};
var flip = false;
var signChange = new bool[4] {false, false, false, false};
for (var i = 0; i < 4; i++)
{
var edge = processEdgeMask[dir][i];
var c1 = Edgevmap[edge][0];
var c2 = Edgevmap[edge][1];
var m1 = (node[i].drawInfo.corners >> c1) & 1;
var m2 = (node[i].drawInfo.corners >> c2) & 1;
if (node[i].size < minSize)
{
minSize = node[i].size;
minIndex = i;
flip = m1 != MATERIAL_AIR;
}
indices[i] = node[i].drawInfo.index;
signChange[i] =
(m1 == MATERIAL_AIR && m2 != MATERIAL_AIR) ||
(m1 != MATERIAL_AIR && m2 == MATERIAL_AIR);
}
if (signChange[minIndex])
{
if (!flip)
{
indexBuffer.Add(indices[0]);
indexBuffer.Add(indices[1]);
indexBuffer.Add(indices[3]);
indexBuffer.Add(indices[0]);
indexBuffer.Add(indices[3]);
indexBuffer.Add(indices[2]);
}
else
{
indexBuffer.Add(indices[0]);
indexBuffer.Add(indices[3]);
indexBuffer.Add(indices[1]);
indexBuffer.Add(indices[0]);
indexBuffer.Add(indices[2]);
indexBuffer.Add(indices[3]);
}
}
}
private static void ContourEdgeProc(OctreeNode[] node, int dir, List<uint> indexBuffer)
{
if (node[0] == null || node[1] == null || node[2] == null || node[3] == null)
{
return;
}
if (node[0].Type != OctreeNodeType.Node_Internal &&
node[1].Type != OctreeNodeType.Node_Internal &&
node[2].Type != OctreeNodeType.Node_Internal &&
node[3].Type != OctreeNodeType.Node_Internal)
{
ContourProcessEdge(node, dir, indexBuffer);
}
else
{
for (var i = 0; i < 2; i++)
{
var edgeNodes = new OctreeNode[4];
var c = new int[4]
{
edgeProcEdgeMask[dir][i][0],
edgeProcEdgeMask[dir][i][1],
edgeProcEdgeMask[dir][i][2],
edgeProcEdgeMask[dir][i][3],
};
for (var j = 0; j < 4; j++)
{
if (node[j].Type == OctreeNodeType.Node_Leaf || node[j].Type == OctreeNodeType.Node_Psuedo)
{
edgeNodes[j] = node[j];
}
else
{
edgeNodes[j] = node[j].children[c[j]];
}
}
ContourEdgeProc(edgeNodes, edgeProcEdgeMask[dir][i][4], indexBuffer);
}
}
}
private static void ContourFaceProc(OctreeNode[] node, int dir, List<uint> indexBuffer)
{
if (node[0] == null || node[1] == null)
{
return;
}
if (node[0].Type == OctreeNodeType.Node_Internal ||
node[1].Type == OctreeNodeType.Node_Internal)
{
for (var i = 0; i < 4; i++)
{
var faceNodes = new OctreeNode[2];
var c = new int[2]
{
faceProcFaceMask[dir][i][0],
faceProcFaceMask[dir][i][1],
};
for (var j = 0; j < 2; j++)
{
if (node[j].Type != OctreeNodeType.Node_Internal)
{
faceNodes[j] = node[j];
}
else
{
faceNodes[j] = node[j].children[c[j]];
}
}
ContourFaceProc(faceNodes, faceProcFaceMask[dir][i][2], indexBuffer);
}
var orders = new int[2][]
{
new int[4] {0, 0, 1, 1},
new int[4] {0, 1, 0, 1},
};
for (var i = 0; i < 4; i++)
{
var edgeNodes = new OctreeNode[4];
var c = new int[4]
{
faceProcEdgeMask[dir][i][1],
faceProcEdgeMask[dir][i][2],
faceProcEdgeMask[dir][i][3],
faceProcEdgeMask[dir][i][4],
};
var order = orders[faceProcEdgeMask[dir][i][0]];
for (var j = 0; j < 4; j++)
{
if (node[order[j]].Type == OctreeNodeType.Node_Leaf ||
node[order[j]].Type == OctreeNodeType.Node_Psuedo)
{
edgeNodes[j] = node[order[j]];
}
else
{
edgeNodes[j] = node[order[j]].children[c[j]];
}
}
ContourEdgeProc(edgeNodes, faceProcEdgeMask[dir][i][5], indexBuffer);
}
}
}
private static void ContourCellProc(OctreeNode node, List<uint> indexBuffer)
{
if (node == null)
{
return;
}
if (node.Type == OctreeNodeType.Node_Internal)
{
for (var i = 0; i < 8; i++)
{
ContourCellProc(node.children[i], indexBuffer);
}
for (var i = 0; i < 12; i++)
{
var faceNodes = new OctreeNode[2];
int[] c = {cellProcFaceMask[i][0], cellProcFaceMask[i][1]};
faceNodes[0] = node.children[c[0]];
faceNodes[1] = node.children[c[1]];
ContourFaceProc(faceNodes, cellProcFaceMask[i][2], indexBuffer);
}
for (var i = 0; i < 6; i++)
{
var edgeNodes = new OctreeNode[4];
var c = new int[4]
{
cellProcEdgeMask[i][0],
cellProcEdgeMask[i][1],
cellProcEdgeMask[i][2],
cellProcEdgeMask[i][3],
};
for (var j = 0; j < 4; j++)
{
edgeNodes[j] = node.children[c[j]];
}
ContourEdgeProc(edgeNodes, cellProcEdgeMask[i][4], indexBuffer);
}
}
}
private static Vector3 ApproximateZeroCrossingPosition(Vector3 p0, Vector3 p1, Func<Vector3, float> densityFunc)
{
// approximate the zero crossing by finding the min value along the edge
var d0 = densityFunc(p0);
var d1 = densityFunc(p1);
d1 -= d0;
var mid = 0 - d0;
return p0 + ((p1 - p0) * (mid / d1));
}
public static int NormalCount, CrossingPosition, Leaf;
private static Vector3 CalculateSurfaceNormal(Vector3 p, Func<Vector3, float> densityFunc)
{
var H = 0.1f;
//float H = 1;
NormalCount += 6;
var dx = densityFunc(p + new Vector3(H, 0.0f, 0.0f)) - densityFunc(p - new Vector3(H, 0.0f, 0.0f));
var dy = densityFunc(p + new Vector3(0.0f, H, 0.0f)) - densityFunc(p - new Vector3(0.0f, H, 0.0f));
var dz = densityFunc(p + new Vector3(0.0f, 0.0f, H)) - densityFunc(p - new Vector3(0.0f, 0.0f, H));
return Vector3.Normalize(new Vector3(dx, dy, dz));
}
public static Stopwatch sw;
private static OctreeNode ConstructOctreeNodes(OctreeNode node, Func<Vector3, float> densityFunc)
{
if (node == null)
{
return null;
}
if (node.size <= 1)
{
var constructOctreeNodes = ConstructLeaf(node, densityFunc);
return constructOctreeNodes;
}
sw.Start();
Leaf++;
var density = densityFunc(node.min) > 0;
var noEdge = true;
for (var x = -2; x <= node.size + 1; x++)
{
for (var y = -2; y <= node.size + 1; y++)
{
for (var z = -2; z <= node.size + 1; z++)
{
var pos = node.min + new Vector3(x, y, z);
Leaf++;
if (density != densityFunc(pos) > 0)
{
noEdge = false;
break;
}
}
}
}
sw.Stop();
if (noEdge)
{
return null;
}
var childSize = node.size / 2;
var hasChildren = false;
for (var i = 0; i < 8; i++)
{
var child = _spareNodes.Count > 0 ? _spareNodes.Dequeue() : new OctreeNode();
child.size = childSize;
child.min = node.min + (CHILD_MIN_OFFSETS[i] * childSize);
child.Type = OctreeNodeType.Node_Internal;
node.children[i] = ConstructOctreeNodes(child, densityFunc);
hasChildren |= (node.children[i] != null);
}
if (!hasChildren)
{
return null;
}
return node;
}
private static OctreeNode ConstructLeaf(OctreeNode leaf, Func<Vector3, float> densityFunc)
{
if (leaf == null || leaf.size > 1)
{
return null;
}
var corners = 0;
for (var i = 0; i < 8; i++)
{
var cornerPos = leaf.min + CHILD_MIN_OFFSETS[i];
Leaf++;
var density = densityFunc(cornerPos);
var material = density < 0.0f ? MATERIAL_SOLID : MATERIAL_AIR;
corners |= (material << i);
}
if (corners == 0 || corners == 255)
{
// voxel is full inside or outside the volume
return null;
}
// otherwise the voxel contains the surface, so find the edge intersections
const int MAX_CROSSINGS = 6;
var edgeCount = 0;
var averageNormal = Vector3.Zero;
var qef = new QefSolver();
for (var i = 0; i < 12 && edgeCount < MAX_CROSSINGS; i++)
{
var c1 = Edgevmap[i][0];
var c2 = Edgevmap[i][1];
var m1 = (corners >> c1) & 1;
var m2 = (corners >> c2) & 1;
if ((m1 == MATERIAL_AIR && m2 == MATERIAL_AIR) || (m1 == MATERIAL_SOLID && m2 == MATERIAL_SOLID))
{
// no zero crossing on this edge
continue;
}
var p1 = leaf.min + CHILD_MIN_OFFSETS[c1];
var p2 = leaf.min + CHILD_MIN_OFFSETS[c2];
var p = ApproximateZeroCrossingPosition(p1, p2, densityFunc);
var n = CalculateSurfaceNormal(p, densityFunc);
qef.add(p.X, p.Y, p.Z, n.X, n.Y, n.Z);
averageNormal += n;
edgeCount++;
}
var qefPosition = Vector3.Zero;
qef.solve(qefPosition, QEF_ERROR, QEF_SWEEPS, QEF_ERROR);
var drawInfo = _spareDrawInfo.Count > 0 ? _spareDrawInfo.Dequeue() : new OctreeDrawInfo();
drawInfo.corners = 0;
drawInfo.index = 0;
drawInfo.position = new Vector3(qefPosition.X, qefPosition.Y, qefPosition.Z);
drawInfo.qef = qef.getData();
var min = leaf.min;
var max = new Vector3(leaf.min.X + leaf.size, leaf.min.Y + leaf.size, leaf.min.Z + leaf.size);
if (drawInfo.position.X < min.X || drawInfo.position.X > max.X ||
drawInfo.position.Y < min.Y || drawInfo.position.Y > max.Y ||
drawInfo.position.Z < min.Z || drawInfo.position.Z > max.Z)
{
drawInfo.position = qef.getMassPoint();
}
drawInfo.averageNormal = Vector3.Normalize(averageNormal / (float) edgeCount);
drawInfo.corners = corners;
leaf.Type = OctreeNodeType.Node_Leaf;
leaf.drawInfo = drawInfo;
return leaf;
}
public static OctreeNode BuildOctree(Vector3 min, int size, float threshold, Func<Vector3, float> densityFunc)
{
Debug.WriteLine("Building Octree at {0}, with size of {1} and threshold of {2}", min, size, threshold);
var field = new int[65 * 65 * 65];
for (var x = 0; x < 65; x++)
for (var y = 0; y < 65; y++)
for (var z = 0; z < 65; z++)
{
GenerateDefaultField(new Vector3(x, y, z), densityFunc, field);
}
var root = new OctreeNode
{
min = min,
size = size,
Type = OctreeNodeType.Node_Internal
};
root = ConstructOctreeNodes(root, densityFunc);
root = SimplifyOctree(root, threshold);
return root;
}
private static void GenerateDefaultField(Vector3 position, Func<Vector3, float> densityFunc, int[] field)
{
var index = (int) (position.X + (position.Y * 65) + (position.Z * 65 * 65));
field[index] = densityFunc(position) < 0 ? MATERIAL_SOLID : MATERIAL_AIR;
}
public static OctreeNode BuildOctree(OctreeNode root,
float threshold,
Vector3 position,
Vector3 size,
Func<Vector3, float> densityFunc)
{
Debug.WriteLine("Updating Octree node");
root = ConstructOctreeNodes(root, densityFunc);
root = SimplifyOctree(root, threshold);
return root;
}
public static void GenerateMeshFromOctree(OctreeNode node, Action<Vertex[], uint[]> buildMesh)
{
if (node == null)
{
return;
}
var vertexBuffer = new List<MeshVertex>();
var indexBuffer = new List<uint>();
GenerateVertexIndices(node, vertexBuffer);
ContourCellProc(node, indexBuffer);
var verts = new Vertex[vertexBuffer.Count];
for (var i = 0; i < vertexBuffer.Count; i++)
{
var uv = new Vector2(vertexBuffer[i].xyz.X, vertexBuffer[i].xyz.Z);
verts[i] = new Vertex(vertexBuffer[i].xyz, uv, vertexBuffer[i].normal);
}
buildMesh(verts.ToArray(), indexBuffer.ToArray());
}
public static void DrawOctree(OctreeNode rootNode, int colorIndex, Matrix4x4 transform)
{
if (rootNode == null || rootNode.children.Length <= 0) return;
foreach (var t in rootNode.children)
{
DrawOctree(t, colorIndex + 1, transform);
}
}
public static void DestroyOctree(OctreeNode node)
{
if (node == null)
{
return;
}
for (var i = 0; i < 8; i++)
{
DestroyOctree(node.children[i]);
if (node.children[i] != null && node.children[i].drawInfo != null)
{
_spareDrawInfo.Enqueue(node.children[i].drawInfo);
node.children[i].drawInfo = null;
}
_spareNodes.Enqueue(node.children[i]);
node.children[i] = null;
}
}
}
} | 34.116622 | 123 | 0.423598 | [
"MIT"
] | James226/persistent-planet | PersistentPlanet/DualContouring/Octree.cs | 25,453 | C# |
namespace zgcwkj.Util.Models
{
/// <summary>
/// 方法结果
/// </summary>
public class MethodResult
{
/// <summary>
/// 错误代码
/// </summary>
public int? ErrorCode { get; set; } = null;
/// <summary>
/// 错误消息
/// </summary>
public string ErrorMessage { get; set; } = null;
/// <summary>
/// 数据
/// </summary>
public object Data { get; set; } = null;
/// <summary>
/// 数据数量
/// </summary>
public int? DataCount { get; set; } = null;
}
} | 20.857143 | 56 | 0.431507 | [
"MIT"
] | zgcwkj/zgcwkj.DotnetCore | zgcwkj.Util/Models/MethodResult.cs | 622 | C# |
using SQLite;
namespace KOF.Models
{
[Table("loot")]
public class Loot
{
[PrimaryKey, AutoIncrement]
[Column("id")]
public int Id { get; set; }
[Column("user")]
public string User { get; set; }
[Column("itemid")]
public int ItemId { get; set; }
[Column("itemname")]
public string ItemName { get; set; }
[Column("platform")]
public string Platform { get; set; }
}
}
| 19 | 44 | 0.517895 | [
"MIT"
] | trkyshorty/KOF | KOF/Models/Loot.cs | 477 | C# |
using System;
namespace AuthorProblem
{
[Author("Ventsi")]
public class StartUp
{
[Author("Gosho")]
static void Main(string[] args)
{
var tracker = new Tracker();
tracker.PrintMethodsByAuthor();
}
}
}
| 16.235294 | 43 | 0.525362 | [
"MIT"
] | yovko93/CSharp-Repo | CSharp_OOP/ReflectionAndAttributes/AuthorProblem/StartUp.cs | 278 | C# |
namespace CarDealer.Web.Controllers
{
using CarDealer.Services;
using CarDealer.Services.Models.Parts;
using CarDealer.Web.Models.Parts;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
using System;
using System.Collections.Generic;
using System.Linq;
public class PartsController : Controller
{
private const int PageSize = 25;
private readonly IPartService parts;
private readonly ISupplierService suppliers;
public PartsController(IPartService parts, ISupplierService suppliers)
{
this.parts = parts;
this.suppliers = suppliers;
}
public IActionResult All(int page = 1)
{
return View(new PartPageListingModel
{
Parts = this.parts.All(page, PageSize),
CurrentPage = page,
TotalPages = (int)Math.Ceiling(this.parts.Total() / (double)PageSize)
});
}
public IActionResult Create()
{
return View(new PartFormModel
{
Suppliers = this.GetSuppliersListItems()
});
}
[HttpPost]
public IActionResult Create(PartFormModel model)
{
if (!ModelState.IsValid)
{
model.Suppliers = this.GetSuppliersListItems();
return View(model);
}
this.parts.Create(
model.Name,
model.Price,
model.Quantity,
model.SupplierId);
return RedirectToAction(nameof(All));
}
public IActionResult Edit(int id)
{
var part = this.parts.ById(id);
if (part == null)
{
return NotFound();
}
return View(new PartFormModel
{
Name = part.Name,
Price = part.Price,
Quantity = part.Quantity,
IsEdit = true
});
}
[HttpPost]
public IActionResult Edit(int id, PartFormModel model)
{
if (!ModelState.IsValid)
{
model.IsEdit = true;
return View(model);
}
this.parts.Edit(
id,
model.Price,
model.Quantity);
return RedirectToAction(nameof(All));
}
public IActionResult Delete(int id)
{
return View(id);
}
public IActionResult Destroy(int id)
{
this.parts.Delete(id);
return RedirectToAction(nameof(All));
}
private IEnumerable<SelectListItem> GetSuppliersListItems()
{
return this.suppliers
.All()
.Select(s => new SelectListItem
{
Text = s.Name,
Value = s.Id.ToString()
});
}
}
}
| 25.165289 | 85 | 0.492282 | [
"MIT"
] | emilianpetrov/c-sharp-repository | c-sharp-web/ASP.NET/CarDealer/CarDealer.Web/Controllers/PartsController.cs | 3,047 | C# |
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Money : MonoBehaviour
{
public int value;
private int distance;
// Start is called before the first frame update
void Start()
{
distance = 50;
}
// Update is called once per frame
void Update()
{
//RotateOrgan
transform.Rotate(new Vector3(0, 1, 0), 20 * Time.deltaTime);
}
public bool PickInput()
{
bool ret = false;
if (Input.touchCount > 0 || Input.GetMouseButtonDown(0))
{
//create a ray cast and set it to the mouses cursor position in game
Ray ray;
if (Input.GetMouseButtonDown(0))
ray = Camera.main.ScreenPointToRay(Input.mousePosition);
else
ray = Camera.main.ScreenPointToRay(Input.GetTouch(0).position);
RaycastHit hit;
if (Physics.Raycast(ray, out hit, distance))
{
//draw invisible ray cast/vector
Debug.DrawLine(ray.origin, hit.point);
if (hit.collider.gameObject == this.gameObject)
ret = true;
}
}
return ret;
}
}
| 26.891304 | 80 | 0.557801 | [
"MIT"
] | BizarreTeam/BizarreBidAR | AR/Assets/Resources/Scripts/Money.cs | 1,239 | C# |
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
namespace HamburgersAPI.Entities.Models
{
public partial class HamburgersContext : DbContext
{
public HamburgersContext()
{
}
public HamburgersContext(DbContextOptions<HamburgersContext> options)
: base(options)
{
}
public virtual DbSet<Contacto> Contacto { get; set; }
public virtual DbSet<Usuario> Usuario { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (!optionsBuilder.IsConfigured)
{
#warning To protect potentially sensitive information in your connection string, you should move it out of source code. See http://go.microsoft.com/fwlink/?LinkId=723263 for guidance on storing connection strings.
optionsBuilder.UseSqlServer("Server=tcp:hamburgerserver.database.windows.net,1433;Initial Catalog=HamburgersDB;Persist Security Info=False;User ID=rotiux;Password=titos95r.g;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;");
}
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Contacto>(entity =>
{
entity.Property(e => e.Id).ValueGeneratedNever();
entity.Property(e => e.FechaCreacion).HasColumnType("datetime");
entity.HasOne(d => d.IdUsuarioNavigation)
.WithMany(p => p.Contacto)
.HasForeignKey(d => d.IdUsuario)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("FK_Contacto_Usuario");
});
modelBuilder.Entity<Usuario>(entity =>
{
entity.Property(e => e.Id).ValueGeneratedNever();
entity.Property(e => e.ColorFavorito)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.Correo)
.IsRequired()
.HasMaxLength(100);
entity.Property(e => e.FechaIngreso).HasColumnType("datetime");
entity.Property(e => e.FechaNacimiento).HasColumnType("datetime");
entity.Property(e => e.Nombre)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.NombreUsuario)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.Sexo)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.Telefono)
.IsRequired()
.HasMaxLength(50);
});
OnModelCreatingPartial(modelBuilder);
}
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
}
}
| 35.535714 | 288 | 0.578559 | [
"MIT"
] | Torebor/APIS-Xamarin-Forms-Basico | HamburgersAPI/HamburgersAPI/Data/HamburgersContext.cs | 2,987 | C# |
using System.Drawing;
using System.Drawing.Drawing2D;
namespace GridOverlay
{
public abstract class RoundedRectangle
{
public enum RectangleCorners
{
None = 0, TopLeft = 1, TopRight = 2, BottomLeft = 4, BottomRight = 8,
All = TopLeft | TopRight | BottomLeft | BottomRight
}
public static GraphicsPath Create(int x, int y, int width, int height,
int radius, RectangleCorners corners)
{
int xw = x + width;
int yh = y + height;
int xwr = xw - radius;
int yhr = yh - radius;
int xr = x + radius;
int yr = y + radius;
int r2 = radius * 2;
int xwr2 = xw - r2;
int yhr2 = yh - r2;
GraphicsPath p = new GraphicsPath();
p.StartFigure();
//Top Left Corner
if ((RectangleCorners.TopLeft & corners) == RectangleCorners.TopLeft)
{
p.AddArc(x, y, r2, r2, 180, 90);
}
else
{
p.AddLine(x, yr, x, y);
p.AddLine(x, y, xr, y);
}
//Top Edge
p.AddLine(xr, y, xwr, y);
//Top Right Corner
if ((RectangleCorners.TopRight & corners) == RectangleCorners.TopRight)
{
p.AddArc(xwr2, y, r2, r2, 270, 90);
}
else
{
p.AddLine(xwr, y, xw, y);
p.AddLine(xw, y, xw, yr);
}
//Right Edge
p.AddLine(xw, yr, xw, yhr);
//Bottom Right Corner
if ((RectangleCorners.BottomRight & corners) == RectangleCorners.BottomRight)
{
p.AddArc(xwr2, yhr2, r2, r2, 0, 90);
}
else
{
p.AddLine(xw, yhr, xw, yh);
p.AddLine(xw, yh, xwr, yh);
}
//Bottom Edge
p.AddLine(xwr, yh, xr, yh);
//Bottom Left Corner
if ((RectangleCorners.BottomLeft & corners) == RectangleCorners.BottomLeft)
{
p.AddArc(x, yhr2, r2, r2, 90, 90);
}
else
{
p.AddLine(xr, yh, x, yh);
p.AddLine(x, yh, x, yhr);
}
//Left Edge
p.AddLine(x, yhr, x, yr);
p.CloseFigure();
return p;
}
public static GraphicsPath Create(Rectangle rect, int radius, RectangleCorners c)
{ return Create(rect.X, rect.Y, rect.Width, rect.Height, radius, c); }
public static GraphicsPath Create(int x, int y, int width, int height, int radius)
{ return Create(x, y, width, height, radius, RectangleCorners.All); }
public static GraphicsPath Create(Rectangle rect, int radius)
{ return Create(rect.X, rect.Y, rect.Width, rect.Height, radius); }
public static GraphicsPath Create(int x, int y, int width, int height)
{ return Create(x, y, width, height, 5); }
public static GraphicsPath Create(Rectangle rect)
{ return Create(rect.X, rect.Y, rect.Width, rect.Height); }
}
}
| 23.801887 | 84 | 0.622671 | [
"MIT"
] | mtsk/datagrid-overlay | src/GridOverlay/RoundedRectangle.cs | 2,525 | C# |
//------------------------------------------------------------------------------
// <auto-generated>
// Dieser Code wurde von einem Tool generiert.
// Laufzeitversion:4.0.30319.42000
//
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
// der Code erneut generiert wird.
// </auto-generated>
//------------------------------------------------------------------------------
using NMF.Collections.Generic;
using NMF.Collections.ObjectModel;
using NMF.Expressions;
using NMF.Expressions.Linq;
using NMF.Models;
using NMF.Models.Collections;
using NMF.Models.Expressions;
using NMF.Models.Meta;
using NMF.Models.Repository;
using NMF.Serialization;
using NMF.Utilities;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using TTC2017.SmartGrids.CIM.IEC61968.AssetModels;
using TTC2017.SmartGrids.CIM.IEC61968.Assets;
using TTC2017.SmartGrids.CIM.IEC61968.Common;
using TTC2017.SmartGrids.CIM.IEC61968.Metering;
using TTC2017.SmartGrids.CIM.IEC61968.WiresExt;
using TTC2017.SmartGrids.CIM.IEC61970.Core;
using TTC2017.SmartGrids.CIM.IEC61970.Informative.InfAssetModels;
using TTC2017.SmartGrids.CIM.IEC61970.Informative.InfCommon;
using TTC2017.SmartGrids.CIM.IEC61970.Informative.InfERPSupport;
using TTC2017.SmartGrids.CIM.IEC61970.Informative.InfOperations;
using TTC2017.SmartGrids.CIM.IEC61970.Informative.InfTypeAsset;
using TTC2017.SmartGrids.CIM.IEC61970.Informative.InfWork;
using TTC2017.SmartGrids.CIM.IEC61970.Meas;
using TTC2017.SmartGrids.CIM.IEC61970.Wires;
namespace TTC2017.SmartGrids.CIM.IEC61970.Informative.InfAssets
{
/// <summary>
/// The default implementation of the TowerInfo class
/// </summary>
[XmlNamespaceAttribute("http://iec.ch/TC57/2009/CIM-schema-cim14#InfAssets")]
[XmlNamespacePrefixAttribute("cimInfAssets")]
[ModelRepresentationClassAttribute("http://iec.ch/TC57/2009/CIM-schema-cim14#//IEC61970/Informative/InfAssets/TowerIn" +
"fo")]
[DebuggerDisplayAttribute("TowerInfo {UUID}")]
public partial class TowerInfo : StructureInfo, ITowerInfo, IModelElement
{
/// <summary>
/// The backing field for the ConstructionKind property
/// </summary>
private Nullable<TowerConstructionKind> _constructionKind;
private static Lazy<ITypedElement> _constructionKindAttribute = new Lazy<ITypedElement>(RetrieveConstructionKindAttribute);
private static IClass _classInstance;
/// <summary>
/// The constructionKind property
/// </summary>
[XmlElementNameAttribute("constructionKind")]
[XmlAttributeAttribute(true)]
public virtual Nullable<TowerConstructionKind> ConstructionKind
{
get
{
return this._constructionKind;
}
set
{
if ((this._constructionKind != value))
{
Nullable<TowerConstructionKind> old = this._constructionKind;
ValueChangedEventArgs e = new ValueChangedEventArgs(old, value);
this.OnConstructionKindChanging(e);
this.OnPropertyChanging("ConstructionKind", e, _constructionKindAttribute);
this._constructionKind = value;
this.OnConstructionKindChanged(e);
this.OnPropertyChanged("ConstructionKind", e, _constructionKindAttribute);
}
}
}
/// <summary>
/// Gets the Class model for this type
/// </summary>
public new static IClass ClassInstance
{
get
{
if ((_classInstance == null))
{
_classInstance = ((IClass)(MetaRepository.Instance.Resolve("http://iec.ch/TC57/2009/CIM-schema-cim14#//IEC61970/Informative/InfAssets/TowerIn" +
"fo")));
}
return _classInstance;
}
}
/// <summary>
/// Gets fired before the ConstructionKind property changes its value
/// </summary>
public event System.EventHandler<ValueChangedEventArgs> ConstructionKindChanging;
/// <summary>
/// Gets fired when the ConstructionKind property changed its value
/// </summary>
public event System.EventHandler<ValueChangedEventArgs> ConstructionKindChanged;
private static ITypedElement RetrieveConstructionKindAttribute()
{
return ((ITypedElement)(((ModelElement)(TowerInfo.ClassInstance)).Resolve("constructionKind")));
}
/// <summary>
/// Raises the ConstructionKindChanging event
/// </summary>
/// <param name="eventArgs">The event data</param>
protected virtual void OnConstructionKindChanging(ValueChangedEventArgs eventArgs)
{
System.EventHandler<ValueChangedEventArgs> handler = this.ConstructionKindChanging;
if ((handler != null))
{
handler.Invoke(this, eventArgs);
}
}
/// <summary>
/// Raises the ConstructionKindChanged event
/// </summary>
/// <param name="eventArgs">The event data</param>
protected virtual void OnConstructionKindChanged(ValueChangedEventArgs eventArgs)
{
System.EventHandler<ValueChangedEventArgs> handler = this.ConstructionKindChanged;
if ((handler != null))
{
handler.Invoke(this, eventArgs);
}
}
/// <summary>
/// Resolves the given attribute name
/// </summary>
/// <returns>The attribute value or null if it could not be found</returns>
/// <param name="attribute">The requested attribute name</param>
/// <param name="index">The index of this attribute</param>
protected override object GetAttributeValue(string attribute, int index)
{
if ((attribute == "CONSTRUCTIONKIND"))
{
return this.ConstructionKind;
}
return base.GetAttributeValue(attribute, index);
}
/// <summary>
/// Sets a value to the given feature
/// </summary>
/// <param name="feature">The requested feature</param>
/// <param name="value">The value that should be set to that feature</param>
protected override void SetFeature(string feature, object value)
{
if ((feature == "CONSTRUCTIONKIND"))
{
this.ConstructionKind = ((TowerConstructionKind)(value));
return;
}
base.SetFeature(feature, value);
}
/// <summary>
/// Gets the Class for this model element
/// </summary>
public override IClass GetClass()
{
if ((_classInstance == null))
{
_classInstance = ((IClass)(MetaRepository.Instance.Resolve("http://iec.ch/TC57/2009/CIM-schema-cim14#//IEC61970/Informative/InfAssets/TowerIn" +
"fo")));
}
return _classInstance;
}
/// <summary>
/// Represents a proxy to represent an incremental access to the constructionKind property
/// </summary>
private sealed class ConstructionKindProxy : ModelPropertyChange<ITowerInfo, Nullable<TowerConstructionKind>>
{
/// <summary>
/// Creates a new observable property access proxy
/// </summary>
/// <param name="modelElement">The model instance element for which to create the property access proxy</param>
public ConstructionKindProxy(ITowerInfo modelElement) :
base(modelElement, "constructionKind")
{
}
/// <summary>
/// Gets or sets the value of this expression
/// </summary>
public override Nullable<TowerConstructionKind> Value
{
get
{
return this.ModelElement.ConstructionKind;
}
set
{
this.ModelElement.ConstructionKind = value;
}
}
}
}
}
| 37.938326 | 164 | 0.594171 | [
"MIT"
] | georghinkel/ttc2017smartGrids | generator/Schema/IEC61970/Informative/InfAssets/TowerInfo.cs | 8,614 | C# |
namespace IoTSharp.ClientApp.Models
{
public class ActivityUser
{
public string Name { get; set; }
public string Avatar { get; set; }
}
} | 20.625 | 42 | 0.612121 | [
"MIT"
] | rennner/IoTSharp | IoTSharp.ClientApp/Models/ActivityUser.cs | 165 | C# |
using Microsoft.Extensions.DependencyInjection;
using System.IO;
namespace Sir.Store
{
public class Start : IPluginStart
{
public void OnApplicationStartup(IServiceCollection services)
{
services.AddSingleton(typeof(LocalStorageSessionFactory), new LocalStorageSessionFactory(Path.Combine(Directory.GetCurrentDirectory(), "App_Data")));
services.AddSingleton(typeof(ITokenizer), new LatinTokenizer());
}
}
}
| 31.333333 | 161 | 0.719149 | [
"MIT"
] | bradparks/resin___google_and_altavista_killer_search_engine | src/Sir.Store/Start.cs | 472 | C# |
namespace HotUI.Layout
{
public class ZStackLayoutManager : ILayoutManager
{
public SizeF Measure(AbstractLayout layout, SizeF available)
{
return available;
}
public void Layout(AbstractLayout layout, SizeF measured)
{
}
}
} | 20.733333 | 68 | 0.578778 | [
"MIT"
] | BenBtg/HotUI | src/HotUI/Layout/ZStackLayoutManager.cs | 311 | 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("Microsoft.VisualStudio.Debugger.SampleEngine")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("Microsoft.VisualStudio.Debugger.SampleEngine")]
[assembly: AssemblyCopyright("Copyright © Microsoft")]
[assembly: AssemblyTrademark("Copyright © Microsoft")]
[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("42127a66-b150-42db-8ca0-a4f059e60e6e")]
| 45.041667 | 84 | 0.790009 | [
"MIT"
] | Bhaskers-Blu-Org2/VSLua | src/Microsoft.VisualStudio.Debugger.Lua/Properties/AssemblyInfo.cs | 1,085 | C# |
#region License
/*
* Fin.cs
*
* The MIT License
*
* Copyright (c) 2012-2015 sta.blockhead
*
* 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.
*/
#endregion
using System;
namespace WebSocketCore
{
/// <summary>
/// Indicates whether a WebSocket frame is the final frame of a message.
/// </summary>
/// <remarks>
/// The values of this enumeration are defined in
/// <see href="http://tools.ietf.org/html/rfc6455#section-5.2">Section 5.2</see> of RFC 6455.
/// </remarks>
internal enum Fin : byte
{
/// <summary>
/// Equivalent to numeric value 0. Indicates more frames of a message follow.
/// </summary>
More = 0x0,
/// <summary>
/// Equivalent to numeric value 1. Indicates the final frame of a message.
/// </summary>
Final = 0x1
}
}
| 35 | 95 | 0.710989 | [
"MIT"
] | 16it/surging | src/WebSocket/WebSocketCore/Fin.cs | 1,820 | C# |
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
*
* 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.Concurrent;
using System.Linq;
using QuantConnect.Interfaces;
using QuantConnect.Lean.Engine.Results;
using QuantConnect.Logging;
using QuantConnect.Packets;
using QuantConnect.Scheduling;
using QuantConnect.Util;
namespace QuantConnect.Lean.Engine.RealTime
{
/// <summary>
/// Psuedo realtime event processing for backtesting to simulate realtime events in fast forward.
/// </summary>
public class BacktestingRealTimeHandler : IRealTimeHandler
{
private IAlgorithm _algorithm;
private IResultHandler _resultHandler;
// initialize this immediately since the Initialzie method gets called after IAlgorithm.Initialize,
// so we want to be ready to accept events as soon as possible
private readonly ConcurrentDictionary<string, ScheduledEvent> _scheduledEvents = new ConcurrentDictionary<string, ScheduledEvent>();
/// <summary>
/// Flag indicating the hander thread is completely finished and ready to dispose.
/// </summary>
public bool IsActive
{
// this doesn't run as its own thread
get { return false; }
}
/// <summary>
/// Intializes the real time handler for the specified algorithm and job
/// </summary>
public void Setup(IAlgorithm algorithm, AlgorithmNodePacket job, IResultHandler resultHandler, IApi api)
{
//Initialize:
_algorithm = algorithm;
_resultHandler = resultHandler;
// create events for algorithm's end of tradeable dates
Add(ScheduledEventFactory.EveryAlgorithmEndOfDay(_algorithm, _resultHandler, _algorithm.StartDate, _algorithm.EndDate, ScheduledEvent.AlgorithmEndOfDayDelta));
// set up the events for each security to fire every tradeable date before market close
foreach (var security in _algorithm.Securities.Values.Where(x => x.IsInternalFeed()))
{
Add(ScheduledEventFactory.EverySecurityEndOfDay(_algorithm, _resultHandler, security, algorithm.StartDate, _algorithm.EndDate, ScheduledEvent.SecurityEndOfDayDelta));
}
foreach (var scheduledEvent in _scheduledEvents)
{
// zoom past old events
scheduledEvent.Value.SkipEventsUntil(algorithm.UtcTime);
// set logging accordingly
scheduledEvent.Value.IsLoggingEnabled = Log.DebuggingEnabled;
}
}
/// <summary>
/// Normally this would run the realtime event monitoring. Backtesting is in fastforward so the realtime is linked to the backtest clock.
/// This thread does nothing. Wait until the job is over.
/// </summary>
public void Run()
{
}
/// <summary>
/// Adds the specified event to the schedule
/// </summary>
/// <param name="scheduledEvent">The event to be scheduled, including the date/times the event fires and the callback</param>
public void Add(ScheduledEvent scheduledEvent)
{
if (_algorithm != null)
{
scheduledEvent.SkipEventsUntil(_algorithm.UtcTime);
}
_scheduledEvents[scheduledEvent.Name] = scheduledEvent;
if (Log.DebuggingEnabled)
{
scheduledEvent.IsLoggingEnabled = true;
}
}
/// <summary>
/// Removes the specified event from the schedule
/// </summary>
/// <param name="name">The name of the event to remove</param>
public void Remove(string name)
{
ScheduledEvent scheduledEvent;
_scheduledEvents.TryRemove(name, out scheduledEvent);
}
/// <summary>
/// Set the time for the realtime event handler.
/// </summary>
/// <param name="time">Current time.</param>
public void SetTime(DateTime time)
{
// poke each event to see if it has fired, be sure to invoke these in time order
foreach (var scheduledEvent in _scheduledEvents)//.OrderBy(x => x.Value.NextEventUtcTime))
{
scheduledEvent.Value.Scan(time);
}
}
/// <summary>
/// Scan for past events that didn't fire because there was no data at the scheduled time.
/// </summary>
/// <param name="time">Current time.</param>
public void ScanPastEvents(DateTime time)
{
foreach (var scheduledEvent in _scheduledEvents)
{
while (scheduledEvent.Value.NextEventUtcTime < time)
{
_algorithm.SetDateTime(scheduledEvent.Value.NextEventUtcTime);
scheduledEvent.Value.Scan(scheduledEvent.Value.NextEventUtcTime);
}
}
}
/// <summary>
/// Stop the real time thread
/// </summary>
public void Exit()
{
// this doesn't run as it's own thread, so nothing to exit
}
}
} | 39.322148 | 182 | 0.629971 | [
"Apache-2.0"
] | WhiteSourceE/LeanUnsafe | Engine/RealTime/BacktestingRealTimeHandler.cs | 5,861 | C# |
namespace Application.MainBoundedContext.BatchModule.Configurators
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Application.MainBoundedContext.DTO;
using Domain.MainBoundedContext.BatchModule.Aggregates.Jobs;
using Domain.MainBoundedContext.BatchModule.Aggregates.Jobs.Builders;
using Domain.MainBoundedContext.BatchModule.Aggregates.Jobs.Decorators;
using Domain.MainBoundedContext.BatchModule.Aggregates.NodePools;
using Domain.MainBoundedContext.BatchModule.Aggregates.Tasks;
using Domain.MainBoundedContext.BatchModule.Aggregates.Tasks.Builders;
internal class JobConfigurator : Configurator
{
public JobConfigurator(BatchExecutorConfig config) : base(config)
{
}
public override async Task<INodePool> ConfigureAsync(INodePool request)
{
if (this.config.Resources is null || !this.config.Resources.Any())
{
throw new InvalidOperationException("Resource object can't be null or empty.");
}
if (this.config.JobsConfig is null)
{
throw new ArgumentNullException(nameof(this.config.JobsConfig));
}
if (this.config.TasksConfig is null)
{
throw new ArgumentNullException(nameof(this.config.TasksConfig));
}
var jobConfig = this.config.JobsConfig;
foreach (var resources in ChunkInternal(this.config.Resources, jobConfig.TasksPerJob))
{
var job = GiveMeTheJob(jobConfig);
foreach (var resource in resources)
{
job.Tasks.Add(GiveMeTheTask(this.config.TasksConfig, resource));
}
request.Jobs.Add(job);
}
return await base.ConfigureAsync(request);
}
private static IEnumerable<IEnumerable<ResourceFile>> ChunkInternal(IEnumerable<ResourceFile> source, uint chunkSize)
{
if (chunkSize == 0)
{
throw new ArgumentOutOfRangeException(nameof(chunkSize), "The chunkSize parameter must be a greather than 0.");
}
using IEnumerator<ResourceFile> enumerator = source.GetEnumerator();
do
{
if (!enumerator.MoveNext())
{
yield break;
}
yield return ChunkSequence(enumerator, chunkSize);
}
while (true);
}
private static IEnumerable<ResourceFile> ChunkSequence(IEnumerator<ResourceFile> enumerator, uint chunkSize)
{
int count = 0;
do
{
yield return enumerator.Current;
}
while (++count < chunkSize && enumerator.MoveNext());
}
private static Job GiveMeTheJob(JobsConfig config)
{
var jobId = config.Prefix + Guid.NewGuid();
var job = new JobBuilder()
.ID(jobId)
.Contraints(config.MaxTaskRetryCount ?? 0, config.MaxWallClockTime)
.TaskFailureAction((TaskFailure)(config.TaskFailedAction ?? 0))//Test the result when the value is greather than 1
.Build();
if(config.PreparationTask is not null)
{
job = new AddJobPreparationTask(job,
new PreparationTaskBuilder()
.ID($"preparation_task_{jobId}")
.Command(config.PreparationTask.Command)
.ResourceFile(config.PreparationTask.ResourceFile?.ContainerName, config.PreparationTask.ResourceFile?.BlobName)
.TaskConstraints(
config.PreparationTask.MaxTaskRetryCount ?? 0,
config.PreparationTask.MaxWallClockTime,
config.PreparationTask.RetentionTime)
.WaitForSuccess(config.PreparationTask.WaitForSuccess ?? false)
.ReRunOnComputeNodeRebootAfterSuccess(
config.PreparationTask.ReRunOnComputeNodeRebootAfterSuccess ?? false)
.Build());
}
if(config.ReleaseTask is not null)
{
new AddJobReleaseTask(job, new ReleaseTaskBuilder()
.ID($"release_task_{jobId}")
.Command(config.ReleaseTask.Command)
.ResourceFile(config.ReleaseTask.ResourceFile?.ContainerName, config.ReleaseTask.ResourceFile?.BlobName)
.TaskConstraints(config.ReleaseTask.MaxWallClockTime, config.ReleaseTask.RetentionTime)
.Build());
}
return job;
}
private static ITask GiveMeTheTask(TaskConfig config, ResourceFile resource)
{
if (string.IsNullOrWhiteSpace(config.Prefix))
{
throw new ArgumentNullException(nameof(config.Prefix));
}
var taskId = config.Prefix + Guid.NewGuid();
//TODO: Create task
var builder = new TaskBuilder()
.ID(taskId)
.Command(config.Command)
.TaskConstraints(config.MaxTaskRetryCount ?? 0, config.MaxWallClockTime, config.RetentionTime)
.ResourceFile(resource.ContainerName, resource.BlobName);
return builder.Build();
}
}
}
| 37.173333 | 132 | 0.58142 | [
"Apache-2.0"
] | iddelacruz/studious-pancake | src/HPC.Batch/Application.MainBoundedContext/BatchModule/Configurators/JobConfigurator.cs | 5,578 | C# |
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// 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.Management.Automation;
using Microsoft.Azure.Management.Network;
namespace Microsoft.Azure.Commands.Network
{
[Cmdlet(VerbsDiagnostic.Test, "AzureRmDnsAvailability"), OutputType(typeof(bool))]
public class TestAzureDnsAvailabilityCmdlet : NetworkBaseCmdlet
{
[Alias("DomainQualifiedName")]
[Parameter(
Mandatory = true,
HelpMessage = "The Domain Qualified Name.")]
[ValidateNotNullOrEmpty]
public string DomainNameLabel { get; set; }
[Parameter(
Mandatory = true,
HelpMessage = "Location.")]
[ValidateNotNullOrEmpty]
public string Location { get; set; }
public override void ExecuteCmdlet()
{
this.Location = this.Location.Replace(" ", string.Empty);
var result = this.NetworkClient.NetworkManagementClient.CheckDnsNameAvailability(this.Location, this.DomainNameLabel);
WriteObject(result.Available);
}
}
}
| 40.977273 | 131 | 0.610649 | [
"MIT"
] | AzureDataBox/azure-powershell | src/ResourceManager/Network/Stack/Commands.Network/ProviderWideCmdlets/TestAzureDnsAvailabilityCmdlet.cs | 1,762 | C# |
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.544
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace AppHarborLookout.Properties {
using System;
/// <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 (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AppHarborLookout.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;
}
}
internal static System.Drawing.Icon GrayButton {
get {
object obj = ResourceManager.GetObject("GrayButton", resourceCulture);
return ((System.Drawing.Icon)(obj));
}
}
internal static System.Drawing.Icon GreenButton {
get {
object obj = ResourceManager.GetObject("GreenButton", resourceCulture);
return ((System.Drawing.Icon)(obj));
}
}
internal static System.Drawing.Icon OrangeButton {
get {
object obj = ResourceManager.GetObject("OrangeButton", resourceCulture);
return ((System.Drawing.Icon)(obj));
}
}
internal static System.Drawing.Icon RedButton {
get {
object obj = ResourceManager.GetObject("RedButton", resourceCulture);
return ((System.Drawing.Icon)(obj));
}
}
}
}
| 41.184783 | 182 | 0.589074 | [
"Apache-2.0"
] | marcel-valdez/AppHarborLookout | AppHarbor.Lookout/Properties/Resources.Designer.cs | 3,791 | C# |
namespace MyDAL.Test.Options
{
public class ProductQueryOption : PagingQueryOption
{
public bool? VipProduct { get; set; }
}
}
| 18.5 | 55 | 0.655405 | [
"Apache-2.0"
] | BestHYC/MyDAL | MyDAL.Test/Options/ProductQueryOption.cs | 150 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace MCTuristic_Centro_Historico.MasterPage
{
public partial class PaginaPrincipal : System.Web.UI.MasterPage
{
string Admin, Usuario;
protected void Page_Load(object sender, EventArgs e)
{
Admin = (string)Session["idAdmin"];
Usuario = (string)Session["idUser"];
if (Admin == "" || Admin == null && Usuario == "" || Usuario == null)
{
Session["idAdmin"] = "";
Session["idUser"] = "";
}
else
{
if (!IsPostBack)
{
try
{
if (Admin != "" || Usuario != "")
{
hyInicioSeción.Visible = false;
lnkCerrarSecion.Visible = true;
}
else
{
hyInicioSeción.Visible = true;
lnkCerrarSecion.Visible = false;
}
}
catch { }
}
}
}
protected void lnkCerrarSecion_Click(object sender, EventArgs e)
{
Session["idAdmin"] = "";
Session["idUser"] = "";
Server.Transfer("PagPrincipal.aspx");
}
}
} | 28.981481 | 81 | 0.412141 | [
"MIT"
] | JLPuc/TU | Proyecto0.1/MCTuristic_Centro_Historico/MCTuristic_Centro_Historico/MasterPage/PaginaPrincipal.Master.cs | 1,569 | C# |
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// 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.Collections.Generic;
using System.Linq;
using System.Management.Automation;
using Microsoft.Azure.Management.RecoveryServices.SiteRecovery.Models;
namespace Microsoft.Azure.Commands.RecoveryServices.SiteRecovery
{
/// <summary>
/// Gets Azure Site Recovery Notification / Alert Settings.
/// </summary>
[Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "RecoveryServicesAsrAlertSetting")]
[Alias(
"Get-ASRNotificationSetting",
"Get-" + ResourceManager.Common.AzureRMConstants.AzureRMPrefix+ "RecoveryServicesAsrNotificationSetting",
"Get-ASRAlertSetting")]
[OutputType(typeof(ASRAlertSetting))]
public class GetAzureRmRecoveryServicesAsrAlertSetting : SiteRecoveryCmdletBase
{
/// <summary>
/// ProcessRecord of the command.
/// </summary>
public override void ExecuteSiteRecoveryCmdlet()
{
base.ExecuteSiteRecoveryCmdlet();
var alertSetting =
this.RecoveryServicesClient.GetAzureSiteRecoveryAlertSetting();
this.WriteObject(alertSetting.Select(p => new ASRAlertSetting(p)), true);
}
}
}
| 44.177778 | 114 | 0.642354 | [
"MIT"
] | 3quanfeng/azure-powershell | src/RecoveryServices/RecoveryServices.SiteRecovery/AlertSetting/GetAzureRmRecoveryServicesAsrAlertSetting.cs | 1,946 | 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.Web.V20201001.Outputs
{
/// <summary>
/// MachineKey of an app.
/// </summary>
[OutputType]
public sealed class SiteMachineKeyResponse
{
/// <summary>
/// Algorithm used for decryption.
/// </summary>
public readonly string? Decryption;
/// <summary>
/// Decryption key.
/// </summary>
public readonly string? DecryptionKey;
/// <summary>
/// MachineKey validation.
/// </summary>
public readonly string? Validation;
/// <summary>
/// Validation key.
/// </summary>
public readonly string? ValidationKey;
[OutputConstructor]
private SiteMachineKeyResponse(
string? decryption,
string? decryptionKey,
string? validation,
string? validationKey)
{
Decryption = decryption;
DecryptionKey = decryptionKey;
Validation = validation;
ValidationKey = validationKey;
}
}
}
| 26.037736 | 81 | 0.588406 | [
"Apache-2.0"
] | polivbr/pulumi-azure-native | sdk/dotnet/Web/V20201001/Outputs/SiteMachineKeyResponse.cs | 1,380 | C# |
// <copyright file="PacketTwister30.cs" company="MUnique">
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
// </copyright>
namespace MUnique.OpenMU.Network.PacketTwister
{
using System;
/// <summary>
/// PacketTwister implementation for packets of an unknown type.
/// </summary>
internal class PacketTwister30 : IPacketTwister
{
/// <inheritdoc/>
public void Twist(Span<byte> data)
{
if (data.Length >= 4)
{
if (data.Length >= 8)
{
if (data.Length >= 16)
{
if (data.Length >= 32)
{
var v16 = data[16];
data[16] = data[9];
data[9] = v16;
data[18] ^= 0x8F;
var v17 = (byte)(data[7] >> 3);
data[7] *= 32;
data[7] |= v17;
var v21 = (byte)((data[22] >> 1) & 1);
if (((data[22] >> 4) & 1) != 0)
{
data[22] |= 2;
}
else
{
data[22] &= 0xFD;
}
if (v21 != 0)
{
data[22] |= 0x10;
}
else
{
data[22] &= 0xEF;
}
var v18 = data[23];
data[23] = data[24];
data[24] = v18;
var v19 = data[18];
data[18] = data[21];
data[21] = v19;
var v20 = data[8];
data[8] = data[14];
data[14] = v20;
}
else
{
var v13 = (byte)(data[13] >> 4);
data[13] *= 16;
data[13] |= v13;
var v14 = (byte)(data[6] >> 6);
data[6] *= 4;
data[6] |= v14;
data[1] ^= 0xA3;
var v23 = (byte)((data[15] >> 2) & 1);
if (((data[15] >> 7) & 1) != 0)
{
data[15] |= 4;
}
else
{
data[15] &= 0xFB;
}
if (v23 != 0)
{
data[15] |= 0x80;
}
else
{
data[15] &= 0x7F;
}
var v22 = (byte)((data[8] >> 2) & 1);
if (((data[8] >> 1) & 1) != 0)
{
data[8] |= 4;
}
else
{
data[8] &= 0xFB;
}
if (v22 != 0)
{
data[8] |= 2;
}
else
{
data[8] &= 0xFD;
}
var v15 = data[2];
data[2] = data[8];
data[8] = v15;
}
}
else
{
var v7 = data[0];
data[0] = data[4];
data[4] = v7;
var v8 = (byte)(data[5] >> 5);
data[5] *= 8;
data[5] |= v8;
var v26 = (byte)((data[1] >> 3) & 1);
if (((data[1] >> 3) & 1) != 0)
{
data[1] |= 8;
}
else
{
data[1] &= 0xF7;
}
if (v26 != 0)
{
data[1] |= 8;
}
else
{
data[1] &= 0xF7;
}
var v9 = (byte)(data[0] >> 6);
data[0] *= 4;
data[0] |= v9;
var v10 = data[3];
data[3] = data[5];
data[5] = v10;
var v25 = (byte)((data[2] >> 4) & 1);
if (((data[2] >> 1) & 1) != 0)
{
data[2] |= 0x10;
}
else
{
data[2] &= 0xEF;
}
if (v25 != 0)
{
data[2] |= 2;
}
else
{
data[2] &= 0xFD;
}
var v11 = data[6];
data[6] = data[3];
data[3] = v11;
var v12 = (byte)(data[0] >> 7);
data[0] *= 2;
data[0] |= v12;
var v24 = (byte)((data[5] >> 1) & 1);
if (((data[5] >> 2) & 1) != 0)
{
data[5] |= 2;
}
else
{
data[5] &= 0xFD;
}
if (v24 != 0)
{
data[5] |= 4;
}
else
{
data[5] &= 0xFB;
}
}
}
else
{
var v3 = data[3];
data[3] = data[0];
data[0] = v3;
var v2 = (byte)((data[1] >> 3) & 1);
if (((data[1] >> 7) & 1) != 0)
{
data[1] |= 8;
}
else
{
data[1] &= 0xF7;
}
if (v2 != 0)
{
data[1] |= 0x80;
}
else
{
data[1] &= 0x7F;
}
data[0] ^= 0x18;
var v4 = (byte)(data[0] >> 7);
data[0] *= 2;
data[0] |= v4;
data[0] ^= 0x8E;
data[0] ^= 0xE7;
var v5 = (byte)(data[1] >> 3);
data[1] *= 32;
data[1] |= v5;
var v6 = (byte)(data[2] >> 6);
data[2] *= 4;
data[2] |= v6;
}
}
}
/// <inheritdoc/>
public void Correct(Span<byte> data)
{
if (data.Length >= 4)
{
if (data.Length >= 8)
{
if (data.Length >= 16)
{
if (data.Length >= 32)
{
var v16 = data[8];
data[8] = data[14];
data[14] = v16;
var v17 = data[18];
data[18] = data[21];
data[21] = v17;
var v18 = data[23];
data[23] = data[24];
data[24] = v18;
var v21 = (byte)((data[22] >> 1) & 1);
if (((data[22] >> 4) & 1) != 0)
{
data[22] |= 2;
}
else
{
data[22] &= 0xFD;
}
if (v21 != 0)
{
data[22] |= 0x10;
}
else
{
data[22] &= 0xEF;
}
var v19 = (byte)(data[7] >> 5);
data[7] *= 8;
data[7] |= v19;
data[18] ^= 0x8F;
var v20 = data[16];
data[16] = data[9];
data[9] = v20;
}
else
{
var v13 = data[2];
data[2] = data[8];
data[8] = v13;
var v23 = (byte)((data[8] >> 2) & 1);
if (((data[8] >> 1) & 1) != 0)
{
data[8] |= 4;
}
else
{
data[8] &= 0xFB;
}
if (v23 != 0)
{
data[8] |= 2;
}
else
{
data[8] &= 0xFD;
}
var v22 = (byte)((data[15] >> 2) & 1);
if (((data[15] >> 7) & 1) != 0)
{
data[15] |= 4;
}
else
{
data[15] &= 0xFB;
}
if (v22 != 0)
{
data[15] |= 0x80;
}
else
{
data[15] &= 0x7F;
}
data[1] ^= 0xA3;
var v14 = (byte)(data[6] >> 2);
data[6] <<= 6;
data[6] |= v14;
var v15 = (byte)(data[13] >> 4);
data[13] *= 16;
data[13] |= v15;
}
}
else
{
var v26 = (byte)((data[5] >> 1) & 1);
if (((data[5] >> 2) & 1) != 0)
{
data[5] |= 2;
}
else
{
data[5] &= 0xFD;
}
if (v26 != 0)
{
data[5] |= 4;
}
else
{
data[5] &= 0xFB;
}
var v7 = (byte)(data[0] >> 1);
data[0] <<= 7;
data[0] |= v7;
var v8 = data[6];
data[6] = data[3];
data[3] = v8;
var v25 = (byte)((data[2] >> 4) & 1);
if (((data[2] >> 1) & 1) != 0)
{
data[2] |= 0x10;
}
else
{
data[2] &= 0xEF;
}
if (v25 != 0)
{
data[2] |= 2;
}
else
{
data[2] &= 0xFD;
}
var v9 = data[3];
data[3] = data[5];
data[5] = v9;
var v10 = (byte)(data[0] >> 2);
data[0] <<= 6;
data[0] |= v10;
var v24 = (byte)((data[1] >> 3) & 1);
if (((data[1] >> 3) & 1) != 0)
{
data[1] |= 8;
}
else
{
data[1] &= 0xF7;
}
if (v24 != 0)
{
data[1] |= 8;
}
else
{
data[1] &= 0xF7;
}
var v11 = (byte)(data[5] >> 3);
data[5] *= 32;
data[5] |= v11;
var v12 = data[0];
data[0] = data[4];
data[4] = v12;
}
}
else
{
var v3 = (byte)(data[2] >> 2);
data[2] <<= 6;
data[2] |= v3;
var v4 = (byte)(data[1] >> 5);
data[1] *= 8;
data[1] |= v4;
data[0] ^= 0xE7;
data[0] ^= 0x8E;
var v5 = (byte)(data[0] >> 1);
data[0] <<= 7;
data[0] |= v5;
data[0] ^= 0x18;
var v2 = (byte)((data[1] >> 3) & 1);
if (((data[1] >> 7) & 1) != 0)
{
data[1] |= 8;
}
else
{
data[1] &= 0xF7;
}
if (v2 != 0)
{
data[1] |= 0x80;
}
else
{
data[1] &= 0x7F;
}
var v6 = data[3];
data[3] = data[0];
data[0] = v6;
}
}
}
}
} | 34.52784 | 101 | 0.174289 | [
"MIT"
] | And3rsL/OpenMU | src/Network/PacketTwister/PacketTwister30.cs | 15,503 | C# |
using Newtonsoft.Json.Linq;
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;
namespace PuppeteerSharp.Tests.JSHandleTests
{
[Collection(TestConstants.TestFixtureCollectionName)]
public class JsonValueTests : PuppeteerPageBaseTest
{
public JsonValueTests(ITestOutputHelper output) : base(output)
{
}
[Fact]
public async Task ShouldWork()
{
var aHandle = await Page.EvaluateExpressionHandleAsync("({ foo: 'bar'})");
var json = await aHandle.JsonValueAsync();
Assert.Equal(JObject.Parse("{ foo: 'bar' }"), json);
}
[Fact]
public async Task ShouldNotWorkWithDates()
{
var dateHandle = await Page.EvaluateExpressionHandleAsync("new Date('2017-09-26T00:00:00.000Z')");
var json = await dateHandle.JsonValueAsync();
Assert.Equal(JObject.Parse("{}"), json);
}
[Fact]
public async Task ShouldThrowForCircularObjects()
{
var windowHandle = await Page.EvaluateExpressionHandleAsync("window");
var exception = await Assert.ThrowsAsync<MessageException>(()
=> windowHandle.JsonValueAsync());
Assert.Contains("Object reference chain is too long", exception.Message);
}
}
} | 33.575 | 110 | 0.625465 | [
"MIT"
] | HarinezumiSama/puppeteer-sharp | lib/PuppeteerSharp.Tests/JSHandleTests/JsonValueTests.cs | 1,345 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
namespace TestWebApp.Controllers
{
[Route("api/[controller]")]
public class CookieTestsController : Controller
{
[HttpGet]
public string Get()
{
var cookieOptions = new Microsoft.AspNetCore.Http.CookieOptions
{
Expires = DateTime.Now.AddMinutes(5)
};
Response.Cookies.Append("TestCookie", "TestValue", cookieOptions);
return String.Empty;
}
[HttpGet("{id}")]
public string Get(string id)
{
return Request.Cookies.FirstOrDefault(c => c.Key == id).Value;
}
}
}
| 24.516129 | 78 | 0.593421 | [
"Apache-2.0"
] | GuzzoLM/aws-lambda-dotnet | Libraries/test/TestWebApp/Controllers/CookieTestsController.cs | 762 | 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.
#nullable enable
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Reflection.Metadata;
using System.Reflection.PortableExecutable;
using Microsoft.CodeAnalysis;
using Roslyn.Utilities;
namespace Roslyn.Utilities
{
internal static class AssemblyUtilities
{
/// <summary>
/// Given a path to an assembly, identifies files in the same directory
/// that could satisfy the assembly's dependencies. May throw.
/// </summary>
/// <remarks>
/// Dependencies are identified by simply checking the name of an assembly
/// reference against a file name; if they match the file is considered a
/// dependency. Other factors, such as version, culture, public key, etc.,
/// are not considered, and so the returned collection may include items that
/// cannot in fact satisfy the original assembly's dependencies.
/// </remarks>
/// <exception cref="IOException">If the file at <paramref name="filePath"/> does not exist or cannot be accessed.</exception>
/// <exception cref="BadImageFormatException">If the file is not an assembly or is somehow corrupted.</exception>
public static ImmutableArray<string> FindAssemblySet(string filePath)
{
RoslynDebug.Assert(filePath != null);
RoslynDebug.Assert(PathUtilities.IsAbsolute(filePath));
Queue<string> workList = new Queue<string>();
HashSet<string> assemblySet = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
workList.Enqueue(filePath);
while (workList.Count > 0)
{
string assemblyPath = workList.Dequeue();
if (!assemblySet.Add(assemblyPath))
{
continue;
}
var directory = Path.GetDirectoryName(assemblyPath);
using (var reader = new PEReader(FileUtilities.OpenRead(assemblyPath)))
{
var metadataReader = reader.GetMetadataReader();
var assemblyReferenceHandles = metadataReader.AssemblyReferences;
foreach (var handle in assemblyReferenceHandles)
{
var reference = metadataReader.GetAssemblyReference(handle);
var referenceName = metadataReader.GetString(reference.Name);
string referencePath = Path.Combine(directory!, referenceName + ".dll");
if (!assemblySet.Contains(referencePath) &&
File.Exists(referencePath))
{
workList.Enqueue(referencePath);
}
}
}
}
return ImmutableArray.CreateRange(assemblySet);
}
/// <summary>
/// Given a path to an assembly, returns its MVID (Module Version ID).
/// May throw.
/// </summary>
/// <exception cref="IOException">If the file at <paramref name="filePath"/> does not exist or cannot be accessed.</exception>
/// <exception cref="BadImageFormatException">If the file is not an assembly or is somehow corrupted.</exception>
public static Guid ReadMvid(string filePath)
{
Debug.Assert(filePath != null);
Debug.Assert(PathUtilities.IsAbsolute(filePath));
using (var reader = new PEReader(FileUtilities.OpenRead(filePath)))
{
var metadataReader = reader.GetMetadataReader();
var mvidHandle = metadataReader.GetModuleDefinition().Mvid;
var fileMvid = metadataReader.GetGuid(mvidHandle);
return fileMvid;
}
}
/// <summary>
/// Given a path to an assembly, finds the paths to all of its satellite
/// assemblies.
/// </summary>
/// <exception cref="IOException">If the file at <paramref name="filePath"/> does not exist or cannot be accessed.</exception>
/// <exception cref="BadImageFormatException">If the file is not an assembly or is somehow corrupted.</exception>
public static ImmutableArray<string> FindSatelliteAssemblies(string filePath)
{
Debug.Assert(filePath != null);
Debug.Assert(PathUtilities.IsAbsolute(filePath));
var builder = ImmutableArray.CreateBuilder<string>();
string? directory = Path.GetDirectoryName(filePath);
string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(filePath);
string resourcesNameWithoutExtension = fileNameWithoutExtension + ".resources";
string resourcesNameWithExtension = resourcesNameWithoutExtension + ".dll";
foreach (var subDirectory in Directory.EnumerateDirectories(directory, "*", SearchOption.TopDirectoryOnly))
{
string satelliteAssemblyPath = Path.Combine(subDirectory, resourcesNameWithExtension);
if (File.Exists(satelliteAssemblyPath))
{
builder.Add(satelliteAssemblyPath);
}
satelliteAssemblyPath = Path.Combine(subDirectory, resourcesNameWithoutExtension, resourcesNameWithExtension);
if (File.Exists(satelliteAssemblyPath))
{
builder.Add(satelliteAssemblyPath);
}
}
return builder.ToImmutable();
}
/// <summary>
/// Given a path to an assembly and a set of paths to possible dependencies,
/// identifies which of the assembly's references are missing. May throw.
/// </summary>
/// <exception cref="IOException">If the files does not exist or cannot be accessed.</exception>
/// <exception cref="BadImageFormatException">If one of the files is not an assembly or is somehow corrupted.</exception>
public static ImmutableArray<AssemblyIdentity> IdentifyMissingDependencies(string assemblyPath, IEnumerable<string> dependencyFilePaths)
{
RoslynDebug.Assert(assemblyPath != null);
RoslynDebug.Assert(PathUtilities.IsAbsolute(assemblyPath));
RoslynDebug.Assert(dependencyFilePaths != null);
HashSet<AssemblyIdentity> assemblyDefinitions = new HashSet<AssemblyIdentity>();
foreach (var potentialDependency in dependencyFilePaths)
{
using (var reader = new PEReader(FileUtilities.OpenRead(potentialDependency)))
{
var metadataReader = reader.GetMetadataReader();
var assemblyDefinition = metadataReader.ReadAssemblyIdentityOrThrow();
assemblyDefinitions.Add(assemblyDefinition);
}
}
HashSet<AssemblyIdentity> assemblyReferences = new HashSet<AssemblyIdentity>();
using (var reader = new PEReader(FileUtilities.OpenRead(assemblyPath)))
{
var metadataReader = reader.GetMetadataReader();
var references = metadataReader.GetReferencedAssembliesOrThrow();
assemblyReferences.AddAll(references);
}
assemblyReferences.ExceptWith(assemblyDefinitions);
return ImmutableArray.CreateRange(assemblyReferences);
}
/// <summary>
/// Given a path to an assembly, returns the <see cref="AssemblyIdentity"/> for the assembly.
/// May throw.
/// </summary>
/// <exception cref="IOException">If the file at <paramref name="assemblyPath"/> does not exist or cannot be accessed.</exception>
/// <exception cref="BadImageFormatException">If the file is not an assembly or is somehow corrupted.</exception>
public static AssemblyIdentity GetAssemblyIdentity(string assemblyPath)
{
Debug.Assert(assemblyPath != null);
Debug.Assert(PathUtilities.IsAbsolute(assemblyPath));
using (var reader = new PEReader(FileUtilities.OpenRead(assemblyPath)))
{
var metadataReader = reader.GetMetadataReader();
var assemblyIdentity = metadataReader.ReadAssemblyIdentityOrThrow();
return assemblyIdentity;
}
}
}
}
| 44.213198 | 144 | 0.622847 | [
"MIT"
] | ThadHouse/roslyn | src/Compilers/Core/Portable/AssemblyUtilities.cs | 8,712 | C# |
/*
* Trade secret of Alibaba Group R&D.
* Copyright (c) 2015 Alibaba Group R&D.
*
* All rights reserved. This notice is intended as a precaution against
* inadvertent publication and does not imply publication or any waiver
* of confidentiality. The year included in the foregoing notice is the
* year of creation of the work.
*
*/
using NUnit.Framework;
namespace Aliyun.OTS.UnitTest
{
[TestFixture]
public class ConnectionPoolTest
{
// <summary>
// 串行地执行1000次PutRow或GetRow请求。
// </summary>
[Test]
public void TestSerialConnections() { }
// <summary>
// 起50(待确定)个线程并行地执行PutRow或者GetRow请求。
// </summary>
[Test]
public void TestParallelConnections() { }
// <summary>
// 将连接池大小设为5,起50(待确定)个线程并行地执行PutRow或者GetRow请求,期望操作成功,并且校验总连接个数不超过5。
// </summary>
[Test]
public void TestConnectionPoolWaiting() { }
}
}
| 24.05 | 75 | 0.62578 | [
"Apache-2.0"
] | aliyun/aliyun-tablestore-csharp-sdk | test/UnitTest/ConnectionPoolTest.cs | 1,116 | C# |
namespace MouseChef.Input
{
public class Event
{
/// <summary>
/// Determins which of the event data properties will be populated (all but one will be null).
/// </summary>
public EventType Type { get; set; }
/// <summary>
/// Mouse movement data, if Type == EventType.Move.
/// </summary>
public MoveEvent Move { get; set; }
/// <summary>
/// Device data, if Type == EventType.DeviceInfo.
/// </summary>
public DeviceInfoEvent DeviceInfo { get; set; }
}
}
| 29.789474 | 102 | 0.54947 | [
"MIT"
] | rspeele/MouseChef | MouseChef.Library/Input/SerializationTypes/Event.cs | 568 | C# |
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
namespace DarenTechs.Web.Models
{
public class UserRoleViewModel
{
[HiddenInput]
public string UserId { get; set; }
//public string UserName { get; set; }
//public string RoleId { get; set; }
[HiddenInput]
public string RoleName { get; internal set; }
}
}
| 24.6 | 53 | 0.676829 | [
"Unlicense"
] | bakerd13/DarenTechs_Starter | DarenTechs.Web/Models/UserRoleViewModel.cs | 494 | C# |
// Copyright © 2012-2021 VLINGO LABS. All rights reserved.
//
// This Source Code Form is subject to the terms of the
// Mozilla Public License, v. 2.0. If a copy of the MPL
// was not distributed with this file, You can obtain
// one at https://mozilla.org/MPL/2.0/.
using System;
using Vlingo.Xoom.Common;
namespace Vlingo.Xoom.Symbio
{
public class Metadata : IComparable<Metadata>
{
public static object EmptyObject => new DummyObject();
public static Metadata NullMetadata() => new Metadata(EmptyObject, string.Empty, string.Empty);
public static Metadata WithObject(object @object) => new Metadata(@object, string.Empty, string.Empty);
public static Metadata WithOperation(string operation) => new Metadata(EmptyObject, string.Empty, operation);
public static Metadata WithValue(string value) => new Metadata(EmptyObject, value, string.Empty);
public static Metadata With(string value, string operation) => new Metadata(EmptyObject, value, operation);
public static Metadata With(object @object, string value, string operation) => new Metadata(@object, value, operation);
public static Metadata With<TOperation>(object @object, string value) => With<TOperation>(@object, value, true);
public static Metadata With<TOperation>(object @object, string value, bool compact)
{
var operation = compact ? typeof(TOperation).Name : typeof(TOperation).FullName!;
return new Metadata(@object, value, operation);
}
public Metadata(object @object, string value, string operation)
{
Object = @object ?? EmptyObject;
Value = value ?? string.Empty;
Operation = operation ?? string.Empty;
}
public Metadata(string value, string operation) : this(EmptyObject, value, operation)
{
}
public Metadata() : this(EmptyObject, string.Empty, string.Empty)
{
}
public object Object { get; }
public Optional<object> OptionalObject => HasObject ? Optional.Of(Object) : Optional.Empty<object>();
public string Operation { get; }
public string Value { get; }
public bool HasObject => Object != EmptyObject;
public bool HasOperation => Operation != string.Empty;
public bool HasValue => Value != string.Empty;
public bool IsEmpty => !HasOperation && !HasValue;
public int CompareTo(Metadata? other)
{
if (!Object.Equals(other?.Object))
{
return 1;
}
if (Value == other.Value)
{
return string.Compare(Operation, other.Operation, StringComparison.Ordinal);
}
return string.Compare(other.Value, Value, StringComparison.Ordinal);
}
public override bool Equals(object? obj)
{
if (obj == null || obj.GetType() != GetType())
{
return false;
}
var otherMetadata = (Metadata) obj;
return Value.Equals(otherMetadata.Value) &&
Operation.Equals(otherMetadata.Operation) &&
Object.Equals(otherMetadata.Object);
}
public override int GetHashCode() => 31 * Value.GetHashCode() + Operation.GetHashCode() + Object.GetHashCode();
public override string ToString() => $"[Value={Value} Operation={Operation} Object={Object}]";
private class DummyObject
{
public override bool Equals(object? obj) => ToString() == obj?.ToString();
public override int GetHashCode()
{
return base.GetHashCode();
}
public override string ToString() => "(empty)";
}
}
} | 34.477876 | 127 | 0.598819 | [
"MPL-2.0",
"MPL-2.0-no-copyleft-exception"
] | Luteceo/vlingo-net-symbio | src/Vlingo.Xoom.Symbio/Metadata.cs | 3,897 | C# |
using System.Threading.Tasks;
namespace FluentMediator.Pipelines.PipelineAsync
{
/// <summary>
///
/// </summary>
public interface IAsyncMediator
{
/// <summary>
///
/// </summary>
/// <param name="request"></param>
/// <param name="pipelineName"></param>
/// <returns></returns>
Task PublishAsync(object request, string? pipelineName = null);
/// <summary>
///
/// </summary>
/// <param name="request"></param>
/// <param name="pipelineName"></param>
/// <typeparam name="TResult"></typeparam>
/// <returns></returns>
Task<TResult> SendAsync<TResult>(object request, string? pipelineName = null);
}
} | 27.777778 | 86 | 0.54 | [
"Apache-2.0"
] | ivanpaulovich/FluentMediator | src/FluentMediator/Pipelines/PipelineAsync/IAsyncMediator.cs | 750 | C# |
using System.Web;
/// <summary>
/// Extension methods for the HttpResponse class
/// </summary>
public static class HttpResponseExtensions {
/// <summary>
/// Reloads the current page / handler by performing a redirect to the current url
/// </summary>
/// <param name = "response">The HttpResponse to perform on.</param>
public static void Reload(this HttpResponse response) {
response.Redirect(HttpContext.Current.Request.Url.ToString(), true);
}
/// <summary>
/// Performs a response redirect and allows the url to be populated with string format parameters.
/// </summary>
/// <param name = "response">The HttpResponse to perform on.</param>
/// <param name = "urlFormat">The URL including string.Format placeholders.</param>
/// <param name = "values">The values to the populated.</param>
public static void Redirect(this HttpResponse response, string urlFormat, params object[] values) {
response.Redirect(urlFormat, true, values);
}
/// <summary>
/// Performs a response redirect and allows the url to be populated with string format parameters.
/// </summary>
/// <param name = "response">The HttpResponse to perform on.</param>
/// <param name = "urlFormat">The URL including string.Format placeholders.</param>
/// <param name = "endResponse">If set to <c>true</c> the response will be terminated.</param>
/// <param name = "values">The values to the populated.</param>
public static void Redirect(this HttpResponse response, string urlFormat, bool endResponse, params object[] values) {
var url = string.Format(urlFormat, values);
response.Redirect(url, endResponse);
}
/// <summary>
/// Performs a response redirect and allows the url to be populated with a query string.
/// </summary>
/// <param name = "response">The HttpResponse to perform on.</param>
/// <param name = "url">The URL.</param>
/// <param name = "queryString">The query string.</param>
public static void Redirect(this HttpResponse response, string url, UriQueryString queryString) {
response.Redirect(url, queryString, true);
}
/// <summary>
/// Performs a response redirect and allows the url to be populated with a query string.
/// </summary>
/// <param name = "response">The HttpResponse to perform on.</param>
/// <param name = "url">The URL.</param>
/// <param name = "queryString">The query string.</param>
/// <param name = "endResponse">If set to <c>true</c> the response will be terminated.</param>
public static void Redirect(this HttpResponse response, string url, UriQueryString queryString, bool endResponse) {
url = queryString.ToString(url);
response.Redirect(url, endResponse);
}
/// <summary>
/// Returns a 404 to the client and ends the response.
/// </summary>
/// <param name = "response">The HttpResponse to perform on.</param>
public static void SetFileNotFound(this HttpResponse response) {
response.SetFileNotFound(true);
}
/// <summary>
/// Returns a 404 to the client and optionally ends the response.
/// </summary>
/// <param name = "response">The HttpResponse to perform on.</param>
/// <param name = "endResponse">If set to <c>true</c> the response will be terminated.</param>
public static void SetFileNotFound(this HttpResponse response, bool endResponse) {
response.SetStatus(404, "Not Found", endResponse);
}
/// <summary>
/// Returns a 500 to the client and ends the response.
/// </summary>
/// <param name = "response">The HttpResponse to perform on.</param>
public static void SetInternalServerError(this HttpResponse response) {
response.SetInternalServerError(true);
}
/// <summary>
/// Returns a 500 to the client and optionally ends the response.
/// </summary>
/// <param name = "response">The HttpResponse to perform on.</param>
/// <param name = "endResponse">If set to <c>true</c> the response will be terminated.</param>
public static void SetInternalServerError(this HttpResponse response, bool endResponse) {
response.SetStatus(500, "Internal Server Error", endResponse);
}
/// <summary>
/// Set the specified HTTP status code and description and optionally ends the response.
/// </summary>
/// <param name = "response">The HttpResponse to perform on.</param>
/// <param name = "code">The status code.</param>
/// <param name = "description">The status description.</param>
/// <param name = "endResponse">If set to <c>true</c> the response will be terminated.</param>
public static void SetStatus(this HttpResponse response, int code, string description, bool endResponse) {
response.StatusCode = code;
response.StatusDescription = description;
if (endResponse) response.End();
}
} | 46.801887 | 121 | 0.66539 | [
"Apache-2.0"
] | JoySky/.NET-Extensions | PGK.Extensions.Web/HttpResponseExtensions.cs | 4,963 | C# |
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System;
using System.Diagnostics.ContractsLight;
using BuildXL.Cache.ContentStore.Hashing;
using BuildXL.Storage;
using BuildXL.Storage.Fingerprints;
using BuildXL.Utilities;
#pragma warning disable 1591 // disabling warning about missing API documentation; TODO: Remove this line and write documentation!
namespace BuildXL.Scheduler.Fingerprints
{
/// <summary>
/// Type of <see cref="ObservedInput" />.
/// </summary>
public enum ObservedInputType
{
/// <summary>
/// A path was probed, but did not exist.
/// </summary>
AbsentPathProbe,
/// <summary>
/// A file with known contents was read.
/// </summary>
FileContentRead,
/// <summary>
/// A directory was enumerated (kind of like a directory read).
/// </summary>
DirectoryEnumeration,
/// <summary>
/// An existing directory probe.
/// </summary>
ExistingDirectoryProbe,
/// <summary>
/// An existing file probe.
/// </summary>
ExistingFileProbe,
}
/// <summary>
/// String constants to keep labels consistent.
/// </summary>
public static class ObservedInputConstants
{
/// <summary>
/// Hashing label for <see cref="ObservedInputType.AbsentPathProbe"/>.
/// </summary>
public const string AbsentPathProbe = "P";
/// <summary>
/// Hashing label for <see cref="ObservedInputType.FileContentRead"/>.
/// </summary>
public const string FileContentRead = "R";
/// <summary>
/// Hashing label for <see cref="ObservedInputType.DirectoryEnumeration"/>.
/// </summary>
public const string DirectoryEnumeration = "E";
/// <summary>
/// Hashing label for <see cref="ObservedInputType.ExistingDirectoryProbe"/>.
/// </summary>
public const string ExistingDirectoryProbe = "D";
/// <summary>
/// Hashing label for <see cref="ObservedInputType.ExistingFileProbe"/>.
/// </summary>
public const string ExistingFileProbe = "F";
/// <summary>
/// Hashing label for collection of <see cref="ObservedInput"/>
/// </summary>
public const string ObservedInputs = "ObservedInputs";
/// <summary>
/// Helper function to convert from abbreviated strings to full type strings.
/// </summary>
/// <returns>
/// If the input string is an abbreviated observed input type, the expanded form; otherwise, the input string unaltered.
/// </returns>
public static string ToExpandedString(string observedInputConstant)
{
switch (observedInputConstant)
{
case ObservedInputConstants.AbsentPathProbe:
return ObservedInputType.AbsentPathProbe.ToString();
case ObservedInputConstants.FileContentRead:
return ObservedInputType.FileContentRead.ToString();
case ObservedInputConstants.DirectoryEnumeration:
return ObservedInputType.DirectoryEnumeration.ToString();
case ObservedInputConstants.ExistingDirectoryProbe:
return ObservedInputType.ExistingDirectoryProbe.ToString();
case ObservedInputConstants.ExistingFileProbe:
return ObservedInputType.ExistingFileProbe.ToString();
default:
return observedInputConstant;
}
}
}
/// <summary>
/// An <see cref="ObservedInput" /> represents a dynamically discovered dependency on some aspect of the filesystem.
/// The supported types of dependencies are enumerated as <see cref="ObservedInputType" /> (such as <see cref="ObservedInputType.AbsentPathProbe" />).
/// Versus an <see cref="BuildXL.Processes.ObservedFileAccess" />, this dependency identifies the particular content accessed (e.g. file hash) rather than
/// the particular low-level filesystem operations used to access it.
/// One may service <see cref="ObservedInput" />s from a list of accessed paths using an <see cref="ObservedInputProcessor" />, which
/// applies access rules such that (if successful) the returned dependencies are actually valid for the traced process.
/// </summary>
public readonly struct ObservedInput : IEquatable<ObservedInput>
{
public readonly ObservedInputType Type;
public readonly ContentHash Hash;
internal readonly ObservedPathEntry PathEntry;
public AbsolutePath Path => PathEntry.Path;
public bool IsSearchPath => PathEntry.IsSearchPath;
public bool IsDirectoryPath => PathEntry.IsDirectoryPath;
public bool DirectoryEnumeration => PathEntry.DirectoryEnumeration;
private ObservedInput(
ObservedInputType type,
AbsolutePath path,
ContentHash? hash = null,
bool isSearchPath = false,
bool isDirectoryPath = false,
bool directoryEnumeration = false,
bool isFileProbe = false,
string enumeratePatternRegex = null)
:
this(type, hash, new ObservedPathEntry(path,
isSearchPathEnumeration: isSearchPath,
isDirectoryPath: isDirectoryPath,
isDirectoryEnumeration: directoryEnumeration,
enumeratePatternRegex: enumeratePatternRegex,
isFileProbe: isFileProbe))
{
Contract.Requires(path.IsValid);
}
internal ObservedInput(
ObservedInputType type,
ContentHash? hash,
ObservedPathEntry pathEntry)
{
Contract.Requires(hash.HasValue || HasPredefinedHash(type));
Contract.Requires(hash == null || hash.Value.HashType != HashType.Unknown);
Type = type;
Hash = hash ?? GetPredefinedHash(type);
PathEntry = pathEntry;
}
/// <summary>
/// Creates an input of type <see cref="ObservedInputType.AbsentPathProbe" />
/// </summary>
public static ObservedInput CreateAbsentPathProbe(
AbsolutePath path,
bool isSearchPath = false,
bool isDirectoryPath = false,
bool directoryEnumeration = false,
string enumeratePatternRegex = null)
{
return new ObservedInput(
ObservedInputType.AbsentPathProbe,
path: path,
isSearchPath: isSearchPath,
isDirectoryPath: isDirectoryPath,
directoryEnumeration: directoryEnumeration,
enumeratePatternRegex: enumeratePatternRegex);
}
/// <summary>
/// Creates an input of type <see cref="ObservedInputType.FileContentRead" />
/// </summary>
public static ObservedInput CreateFileContentRead(AbsolutePath path, ContentHash fileContent)
{
return new ObservedInput(ObservedInputType.FileContentRead, path, fileContent);
}
/// <summary>
/// Creates an input of type <see cref="ObservedInputType.DirectoryEnumeration" />
/// </summary>
public static ObservedInput CreateDirectoryEnumeration(
AbsolutePath path,
DirectoryFingerprint fingerprint,
bool isSearchPath = false,
string enumeratePatternRegex = null)
{
return new ObservedInput(
ObservedInputType.DirectoryEnumeration,
path,
fingerprint.Hash,
isSearchPath: isSearchPath,
isDirectoryPath: true,
directoryEnumeration: true,
enumeratePatternRegex: enumeratePatternRegex);
}
/// <summary>
/// Creates an input of type <see cref="ObservedInputType.ExistingFileProbe" />
/// </summary>
public static ObservedInput CreateExistingFileProbe(AbsolutePath path)
{
return new ObservedInput(ObservedInputType.ExistingFileProbe, path, isFileProbe: true);
}
/// <summary>
/// Creates an input of type <see cref="ObservedInputType.ExistingDirectoryProbe" />
/// </summary>
public static ObservedInput CreateExistingDirectoryProbe(AbsolutePath path)
{
return new ObservedInput(ObservedInputType.ExistingDirectoryProbe, path, isDirectoryPath: true);
}
/// <nodoc />
public static bool operator ==(ObservedInput left, ObservedInput right)
{
return left.Equals(right);
}
/// <nodoc />
public static bool operator !=(ObservedInput left, ObservedInput right)
{
return !left.Equals(right);
}
/// <inheritdoc />
public bool Equals(ObservedInput other)
{
return other.Type == Type && other.Hash == Hash && PathEntry.Equals(other.PathEntry);
}
/// <inheritdoc />
public override bool Equals(object obj)
{
return StructUtilities.Equals(this, obj);
}
/// <inheritdoc />
public override int GetHashCode()
{
return HashCodeHelper.Combine(Type.GetHashCode(), Hash.GetHashCode(), PathEntry.GetHashCode());
}
/// <summary>
/// Gets the predefined hash for the observed input type. This should only be called if
/// <see cref="HasPredefinedHash(ObservedInputType)"/> returns true.
/// </summary>
public static ContentHash GetPredefinedHash(ObservedInputType type)
{
Contract.Requires(HasPredefinedHash(type), "ObservedInput type does not have predefined hash");
switch (type)
{
case ObservedInputType.AbsentPathProbe:
return WellKnownContentHashes.AbsentFile;
case ObservedInputType.ExistingDirectoryProbe:
case ObservedInputType.ExistingFileProbe:
return ContentHashingUtilities.ZeroHash;
default:
throw Contract.AssertFailure("Unexpected ObservedInputType");
}
}
/// <summary>
/// Gets whether the observed input type represents a type which has a predefined hash
/// </summary>
[Pure]
public static bool HasPredefinedHash(ObservedInputType type)
{
switch (type)
{
case ObservedInputType.AbsentPathProbe:
case ObservedInputType.ExistingDirectoryProbe:
case ObservedInputType.ExistingFileProbe:
return true;
case ObservedInputType.FileContentRead:
case ObservedInputType.DirectoryEnumeration:
return false;
default:
throw Contract.AssertFailure("Unknown ObservedInputType");
}
}
public void Serialize(BuildXLWriter writer)
{
writer.WriteCompact((int)Type);
PathEntry.Serialize(writer);
if (!HasPredefinedHash(Type))
{
Hash.SerializeHashBytes(writer);
}
}
public static ObservedInput Deserialize(BuildXLReader reader)
{
ObservedInputType type = (ObservedInputType)reader.ReadInt32Compact();
ObservedPathEntry pathEntry = ObservedPathEntry.Deserialize(reader);
ContentHash? hash = HasPredefinedHash(type)
? (ContentHash?) null
: ContentHashingUtilities.CreateFrom(reader); // don't specific explicit hash for predefined hash input types
return new ObservedInput(type, hash, pathEntry);
}
}
}
| 38.971519 | 159 | 0.591799 | [
"MIT"
] | Bhaskers-Blu-Org2/BuildXL | Public/Src/Engine/Scheduler/Fingerprints/ObservedInput.cs | 12,315 | C# |
using System.Linq;
using LinqToDB;
using LinqToDB.Mapping;
using NUnit.Framework;
using Tests.Model;
using Tests.xUpdate;
namespace Tests.Mapping
{
public class MappingAmbiguityTests : TestBase
{
[Table]
public class TestTable
{
[PrimaryKey] public int ID { get; set; }
// mapped field and property with same name different cases and types
[Column] public int Field1 { get; set; }
[Column("field11")] public string? field1;
// mapped property and unmapped field with same name different cases and types
[Column] public int Field2 { get; set; }
[NotColumn] public string? field2;
// mapped field and unmapped property with same name different cases and types
[Column] public int Field3 { get; set; }
[NotColumn] public string? field3;
// mapped and unmapped property with same name different cases and types
[Column] public int Field4 { get; set; }
[NotColumn] public string? field4 { get; set; }
// mapped and unmapped field with same name different cases and types
[Column] public int Field5;
[NotColumn] public string? field5;
}
[Test]
public void TestCreate([IncludeDataSources(false, TestProvName.AllSQLite)] string context)
{
using (var db = new TestDataConnection(context))
using (db.CreateLocalTable<TestTable>())
{
var sql = db.LastQuery!;
Assert.AreEqual(sql.Replace("\r", ""), @"CREATE TABLE [TestTable]
(
[ID] INTEGER NOT NULL,
[Field1] INTEGER NOT NULL,
[Field2] INTEGER NOT NULL,
[Field3] INTEGER NOT NULL,
[Field4] INTEGER NOT NULL,
[field11] NVarChar(255) NULL,
[Field5] INTEGER NOT NULL,
CONSTRAINT [PK_TestTable] PRIMARY KEY ([ID])
)
".Replace("\r", ""));
}
}
[Test]
public void TestDefaultInsertUpdateMerge([MergeTests.MergeDataContextSource(true, TestProvName.AllSybase, TestProvName.AllSapHana)] string context)
{
using (var db = GetDataContext(context))
using (db.CreateLocalTable<TestTable>())
{
var res = db.GetTable<TestTable>()
.Merge()
.UsingTarget()
.OnTargetKey()
.InsertWhenNotMatched()
.UpdateWhenMatched()
.Merge();
if (context.Contains("Oracle") && context.Contains("Native"))
Assert.AreEqual(-1, res);
else
Assert.AreEqual(0, res);
}
}
}
}
| 28.27907 | 150 | 0.638569 | [
"MIT"
] | Corey-M/linq2db | Tests/Linq/Mapping/MappingAmbiguityTests.cs | 2,349 | 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.Runtime.CompilerServices;
namespace System.Diagnostics
{
internal static class Precondition
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void Require(bool condition)
{
if (!condition)
{
Fail();
}
}
private static void Fail()
{
if (Debugger.IsAttached)
{
Debugger.Break();
}
throw new Failure();
}
public sealed class Failure : Exception
{
static string s_message = "precondition failed";
internal Failure() : base(s_message) { }
}
}
}
| 24.542857 | 101 | 0.55064 | [
"MIT"
] | benaadams/corefxlab | src/System.Text.Formatting/System/InternalHelpers/Precondition.cs | 861 | C# |
using System.Collections.Generic;
using RegionOrebroLan.Web.Authentication;
namespace HansKindberg.IdentityServer.Application.Models.Views.Diagnostics
{
public class AuthenticationSchemeViewModel
{
#region Properties
public virtual bool AuthenticationSchemesMissing { get; set; }
public virtual IDictionary<IAuthenticationScheme, string> Items { get; } = new Dictionary<IAuthenticationScheme, string>();
#endregion
}
} | 28.8 | 125 | 0.80787 | [
"MIT"
] | HansKindberg/Identity-Server | Source/Application/Models/Views/Diagnostics/AuthenticationSchemeViewModel.cs | 432 | C# |
using CaraDotNetCore5V2.Application.DTOs;
using CaraDotNetCore5V2.Application.Features.ActivityLog.Queries.GetUserLogs;
using CaraDotNetCore5V2.Application.Interfaces.Shared;
using CaraDotNetCore5V2.Web.Abstractions;
using MediatR;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace CaraDotNetCore5V2.Web.Areas.Identity.Pages.Account
{
public class AuditLogModel : PageModel
{
private readonly IMediator _mediator;
private readonly IAuthenticatedUserService _userService;
public List<AuditLogResponse> AuditLogResponses;
private IViewRenderService _viewRenderer;
public AuditLogModel(IMediator mediator, IAuthenticatedUserService userService, IViewRenderService viewRenderer)
{
_mediator = mediator;
_userService = userService;
_viewRenderer = viewRenderer;
}
public async Task OnGet()
{
var response = await _mediator.Send(new GetAuditLogsQuery() { userId = _userService.UserId });
AuditLogResponses = response.Data;
}
}
} | 35.147059 | 120 | 0.736402 | [
"MIT"
] | rosdisulaiman/CaraDotNetCore5V2 | CaraDotNetCore5V2.Web/Areas/Identity/Pages/Account/AuditLog.cshtml.cs | 1,195 | C# |
// ------------------------------------------------------------------------------
// <auto-generated>
// Generated by Xsd2Code. Version 3.4.0.18239 Microsoft Reciprocal License (Ms-RL)
// <NameSpace>Mim.V6301</NameSpace><Collection>Array</Collection><codeType>CSharp</codeType><EnableDataBinding>False</EnableDataBinding><EnableLazyLoading>False</EnableLazyLoading><TrackingChangesEnable>False</TrackingChangesEnable><GenTrackingClasses>False</GenTrackingClasses><HidePrivateFieldInIDE>False</HidePrivateFieldInIDE><EnableSummaryComment>True</EnableSummaryComment><VirtualProp>False</VirtualProp><IncludeSerializeMethod>True</IncludeSerializeMethod><UseBaseClass>False</UseBaseClass><GenBaseClass>False</GenBaseClass><GenerateCloneMethod>True</GenerateCloneMethod><GenerateDataContracts>False</GenerateDataContracts><CodeBaseTag>Net35</CodeBaseTag><SerializeMethodName>Serialize</SerializeMethodName><DeserializeMethodName>Deserialize</DeserializeMethodName><SaveToFileMethodName>SaveToFile</SaveToFileMethodName><LoadFromFileMethodName>LoadFromFile</LoadFromFileMethodName><GenerateXMLAttributes>True</GenerateXMLAttributes><OrderXMLAttrib>False</OrderXMLAttrib><EnableEncoding>False</EnableEncoding><AutomaticProperties>False</AutomaticProperties><GenerateShouldSerialize>False</GenerateShouldSerialize><DisableDebug>False</DisableDebug><PropNameSpecified>Default</PropNameSpecified><Encoder>UTF8</Encoder><CustomUsings></CustomUsings><ExcludeIncludedTypes>True</ExcludeIncludedTypes><EnableInitializeFields>False</EnableInitializeFields>
// </auto-generated>
// ------------------------------------------------------------------------------
namespace Mim.V6301 {
using System;
using System.Diagnostics;
using System.Xml.Serialization;
using System.Collections;
using System.Xml.Schema;
using System.ComponentModel;
using System.IO;
using System.Text;
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.18239")]
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(TypeName="POCD_IN170001UK06.MCCI_MT010101UK12.Message", Namespace="urn:hl7-org:v3")]
[System.Xml.Serialization.XmlRootAttribute("POCD_IN170001UK06.MCCI_MT010101UK12.Message", Namespace="urn:hl7-org:v3")]
public partial class POCD_IN170001UK06MCCI_MT010101UK12Message {
private IINPfITuuidmandatory idField;
private POCD_IN170001UK06MCCI_MT010101UK12MessageCreationTime creationTimeField;
private POCD_IN170001UK06MCCI_MT010101UK12MessageVersionCode versionCodeField;
private POCD_IN170001UK06MCCI_MT010101UK12MessageInteractionId interactionIdField;
private POCD_IN170001UK06MCCI_MT010101UK12MessageProcessingCode processingCodeField;
private POCD_IN170001UK06MCCI_MT010101UK12MessageProcessingModeCode processingModeCodeField;
private CS acceptAckCodeField;
private MCCI_MT010101UK12CommunicationFunctionRcv[] communicationFunctionRcvField;
private MCCI_MT010101UK12CommunicationFunctionSnd communicationFunctionSndField;
private POCD_IN170001UK06MCAI_MT040101UK03ControlActEvent controlActEventField;
private string nullFlavorField;
private cs_UpdateMode updateModeField;
private bool updateModeFieldSpecified;
private static System.Xml.Serialization.XmlSerializer serializer;
public IINPfITuuidmandatory id {
get {
return this.idField;
}
set {
this.idField = value;
}
}
public POCD_IN170001UK06MCCI_MT010101UK12MessageCreationTime creationTime {
get {
return this.creationTimeField;
}
set {
this.creationTimeField = value;
}
}
public POCD_IN170001UK06MCCI_MT010101UK12MessageVersionCode versionCode {
get {
return this.versionCodeField;
}
set {
this.versionCodeField = value;
}
}
public POCD_IN170001UK06MCCI_MT010101UK12MessageInteractionId interactionId {
get {
return this.interactionIdField;
}
set {
this.interactionIdField = value;
}
}
public POCD_IN170001UK06MCCI_MT010101UK12MessageProcessingCode processingCode {
get {
return this.processingCodeField;
}
set {
this.processingCodeField = value;
}
}
public POCD_IN170001UK06MCCI_MT010101UK12MessageProcessingModeCode processingModeCode {
get {
return this.processingModeCodeField;
}
set {
this.processingModeCodeField = value;
}
}
public CS acceptAckCode {
get {
return this.acceptAckCodeField;
}
set {
this.acceptAckCodeField = value;
}
}
[System.Xml.Serialization.XmlElementAttribute("communicationFunctionRcv")]
public MCCI_MT010101UK12CommunicationFunctionRcv[] communicationFunctionRcv {
get {
return this.communicationFunctionRcvField;
}
set {
this.communicationFunctionRcvField = value;
}
}
public MCCI_MT010101UK12CommunicationFunctionSnd communicationFunctionSnd {
get {
return this.communicationFunctionSndField;
}
set {
this.communicationFunctionSndField = value;
}
}
[System.Xml.Serialization.XmlElementAttribute()]
public POCD_IN170001UK06MCAI_MT040101UK03ControlActEvent ControlActEvent {
get {
return this.controlActEventField;
}
set {
this.controlActEventField = value;
}
}
[System.Xml.Serialization.XmlAttributeAttribute()]
public string nullFlavor {
get {
return this.nullFlavorField;
}
set {
this.nullFlavorField = value;
}
}
[System.Xml.Serialization.XmlAttributeAttribute()]
public cs_UpdateMode updateMode {
get {
return this.updateModeField;
}
set {
this.updateModeField = value;
}
}
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool updateModeSpecified {
get {
return this.updateModeFieldSpecified;
}
set {
this.updateModeFieldSpecified = value;
}
}
private static System.Xml.Serialization.XmlSerializer Serializer {
get {
if ((serializer == null)) {
serializer = new System.Xml.Serialization.XmlSerializer(typeof(POCD_IN170001UK06MCCI_MT010101UK12Message));
}
return serializer;
}
}
#region Serialize/Deserialize
/// <summary>
/// Serializes current POCD_IN170001UK06MCCI_MT010101UK12Message object into an XML document
/// </summary>
/// <returns>string XML value</returns>
public virtual string Serialize() {
System.IO.StreamReader streamReader = null;
System.IO.MemoryStream memoryStream = null;
try {
memoryStream = new System.IO.MemoryStream();
Serializer.Serialize(memoryStream, this);
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
streamReader = new System.IO.StreamReader(memoryStream);
return streamReader.ReadToEnd();
}
finally {
if ((streamReader != null)) {
streamReader.Dispose();
}
if ((memoryStream != null)) {
memoryStream.Dispose();
}
}
}
/// <summary>
/// Deserializes workflow markup into an POCD_IN170001UK06MCCI_MT010101UK12Message object
/// </summary>
/// <param name="xml">string workflow markup to deserialize</param>
/// <param name="obj">Output POCD_IN170001UK06MCCI_MT010101UK12Message object</param>
/// <param name="exception">output Exception value if deserialize failed</param>
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
public static bool Deserialize(string xml, out POCD_IN170001UK06MCCI_MT010101UK12Message obj, out System.Exception exception) {
exception = null;
obj = default(POCD_IN170001UK06MCCI_MT010101UK12Message);
try {
obj = Deserialize(xml);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool Deserialize(string xml, out POCD_IN170001UK06MCCI_MT010101UK12Message obj) {
System.Exception exception = null;
return Deserialize(xml, out obj, out exception);
}
public static POCD_IN170001UK06MCCI_MT010101UK12Message Deserialize(string xml) {
System.IO.StringReader stringReader = null;
try {
stringReader = new System.IO.StringReader(xml);
return ((POCD_IN170001UK06MCCI_MT010101UK12Message)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
}
finally {
if ((stringReader != null)) {
stringReader.Dispose();
}
}
}
/// <summary>
/// Serializes current POCD_IN170001UK06MCCI_MT010101UK12Message object into file
/// </summary>
/// <param name="fileName">full path of outupt xml file</param>
/// <param name="exception">output Exception value if failed</param>
/// <returns>true if can serialize and save into file; otherwise, false</returns>
public virtual bool SaveToFile(string fileName, out System.Exception exception) {
exception = null;
try {
SaveToFile(fileName);
return true;
}
catch (System.Exception e) {
exception = e;
return false;
}
}
public virtual void SaveToFile(string fileName) {
System.IO.StreamWriter streamWriter = null;
try {
string xmlString = Serialize();
System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
streamWriter = xmlFile.CreateText();
streamWriter.WriteLine(xmlString);
streamWriter.Close();
}
finally {
if ((streamWriter != null)) {
streamWriter.Dispose();
}
}
}
/// <summary>
/// Deserializes xml markup from file into an POCD_IN170001UK06MCCI_MT010101UK12Message object
/// </summary>
/// <param name="fileName">string xml file to load and deserialize</param>
/// <param name="obj">Output POCD_IN170001UK06MCCI_MT010101UK12Message object</param>
/// <param name="exception">output Exception value if deserialize failed</param>
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
public static bool LoadFromFile(string fileName, out POCD_IN170001UK06MCCI_MT010101UK12Message obj, out System.Exception exception) {
exception = null;
obj = default(POCD_IN170001UK06MCCI_MT010101UK12Message);
try {
obj = LoadFromFile(fileName);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool LoadFromFile(string fileName, out POCD_IN170001UK06MCCI_MT010101UK12Message obj) {
System.Exception exception = null;
return LoadFromFile(fileName, out obj, out exception);
}
public static POCD_IN170001UK06MCCI_MT010101UK12Message LoadFromFile(string fileName) {
System.IO.FileStream file = null;
System.IO.StreamReader sr = null;
try {
file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
sr = new System.IO.StreamReader(file);
string xmlString = sr.ReadToEnd();
sr.Close();
file.Close();
return Deserialize(xmlString);
}
finally {
if ((file != null)) {
file.Dispose();
}
if ((sr != null)) {
sr.Dispose();
}
}
}
#endregion
#region Clone method
/// <summary>
/// Create a clone of this POCD_IN170001UK06MCCI_MT010101UK12Message object
/// </summary>
public virtual POCD_IN170001UK06MCCI_MT010101UK12Message Clone() {
return ((POCD_IN170001UK06MCCI_MT010101UK12Message)(this.MemberwiseClone()));
}
#endregion
}
}
| 41.192308 | 1,358 | 0.592329 | [
"MIT"
] | Kusnaditjung/MimDms | src/Mim.V6301/Generated/POCD_IN170001UK06MCCI_MT010101UK12Message.cs | 13,923 | C# |
using System.Threading.Tasks;
using Abp.Application.Services;
using NorthLion.Zero.AuditLogs.Dto;
using NorthLion.Zero.PaginatedModel;
namespace NorthLion.Zero.AuditLogs
{
public interface IAuditLogAppService : IApplicationService
{
Task<AuditLogOutput> GetLatestAuditLogOutput();
Task<AuditLogOutput> GetAuditLogTable(AuditLogPaginableInput input);
Task<AuditLogDto> GetAuditLogDetails(long id);
AuditLogTimeOutput GetAuditLogTimes(AuditLogTimesInput input);
Task<AuditLogOutput> GetLatestAuditLogOutputForTenant(long tenantId);
Task<AuditLogOutput> GetAuditLogTableForTenant(PaginatedInputDto input, int tenantId);
Task<AuditLogDto> GetAuditLogDetailsForTenant(long id, int tenantId);
}
}
| 40.052632 | 94 | 0.779238 | [
"MIT"
] | CodefyMX/NorthLionAbpZeroNetCore | aspnet-core/src/NorthLion.Zero.Application/AuditLogs/IAuditLogAppService.cs | 763 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;
namespace ChatBotPrime.FrontEnd.Areas.Identity.Pages.Account.Manage
{
public class GenerateRecoveryCodesModel : PageModel
{
private readonly UserManager<IdentityUser> _userManager;
private readonly ILogger<GenerateRecoveryCodesModel> _logger;
public GenerateRecoveryCodesModel(
UserManager<IdentityUser> userManager,
ILogger<GenerateRecoveryCodesModel> logger)
{
_userManager = userManager;
_logger = logger;
}
[TempData]
public string[] RecoveryCodes { get; set; }
[TempData]
public string StatusMessage { get; set; }
public async Task<IActionResult> OnGetAsync()
{
var user = await _userManager.GetUserAsync(User);
if (user == null)
{
return NotFound($"Unable to load user with ID '{_userManager.GetUserId(User)}'.");
}
var isTwoFactorEnabled = await _userManager.GetTwoFactorEnabledAsync(user);
if (!isTwoFactorEnabled)
{
var userId = await _userManager.GetUserIdAsync(user);
throw new InvalidOperationException($"Cannot generate recovery codes for user with ID '{userId}' because they do not have 2FA enabled.");
}
return Page();
}
public async Task<IActionResult> OnPostAsync()
{
var user = await _userManager.GetUserAsync(User);
if (user == null)
{
return NotFound($"Unable to load user with ID '{_userManager.GetUserId(User)}'.");
}
var isTwoFactorEnabled = await _userManager.GetTwoFactorEnabledAsync(user);
var userId = await _userManager.GetUserIdAsync(user);
if (!isTwoFactorEnabled)
{
throw new InvalidOperationException($"Cannot generate recovery codes for user with ID '{userId}' as they do not have 2FA enabled.");
}
var recoveryCodes = await _userManager.GenerateNewTwoFactorRecoveryCodesAsync(user, 10);
RecoveryCodes = recoveryCodes.ToArray();
_logger.LogInformation("User with ID '{UserId}' has generated new 2FA recovery codes.", userId);
StatusMessage = "You have generated new recovery codes.";
return RedirectToPage("./ShowRecoveryCodes");
}
}
} | 36.958333 | 153 | 0.633221 | [
"MIT"
] | CrypticEngima/ChatBotPrime | ChatBotPrime.FrontEnd/Areas/Identity/Pages/Account/Manage/GenerateRecoveryCodes.cshtml.cs | 2,663 | C# |
namespace Library_API_SYSCOMPSA.Areas.HelpPage.ModelDescriptions
{
public class CollectionModelDescription : ModelDescription
{
public ModelDescription ElementDescription { get; set; }
}
} | 29.714286 | 64 | 0.764423 | [
"Apache-2.0"
] | Syscompsa/APIS-REST--Library | Library-API-SYSCOMPSA/Library-API-SYSCOMPSA/Areas/HelpPage/ModelDescriptions/CollectionModelDescription.cs | 208 | C# |
using System.Web;
using System.Web.Mvc;
namespace EmployeeTree.Web
{
public class FilterConfig
{
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute());
}
}
}
| 19.214286 | 80 | 0.657993 | [
"MIT"
] | iramov/HRM | EmployeesTree/EmployeeTree.Web/App_Start/FilterConfig.cs | 271 | C# |
// <auto-generated />
using System;
using System.Reflection;
using System.Resources;
using System.Threading;
using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore.Diagnostics;
using Microsoft.Extensions.Logging;
namespace Microsoft.EntityFrameworkCore.Diagnostics
{
/// <summary>
/// <para>
/// String resources used in EF exceptions, etc.
/// </para>
/// <para>
/// These strings are exposed publicly for use by database providers and extensions.
/// It is unusual for application code to need these strings.
/// </para>
/// </summary>
public static class CoreStrings
{
private static readonly ResourceManager _resourceManager
= new ResourceManager("Microsoft.EntityFrameworkCore.Properties.CoreStrings", typeof(CoreStrings).Assembly);
/// <summary>
/// Unable to save changes because a circular dependency was detected in the data to be saved: '{cycle}'.
/// </summary>
public static string CircularDependency([CanBeNull] object cycle)
=> string.Format(
GetString("CircularDependency", nameof(cycle)),
cycle);
/// <summary>
/// The LINQ expression '{expression}' could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to either AsEnumerable(), AsAsyncEnumerable(), ToList(), or ToListAsync(). See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.
/// </summary>
public static string TranslationFailed([CanBeNull] object expression)
=> string.Format(
GetString("TranslationFailed", nameof(expression)),
expression);
/// <summary>
/// The LINQ expression '{expression}' could not be translated. Additional information: {details} Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to either AsEnumerable(), AsAsyncEnumerable(), ToList(), or ToListAsync(). See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.
/// </summary>
public static string TranslationFailedWithDetails([CanBeNull] object expression, [CanBeNull] object details)
=> string.Format(
GetString("TranslationFailedWithDetails", nameof(expression), nameof(details)),
expression, details);
/// <summary>
/// Processing of the LINQ expression '{expression}' by '{visitor}' failed. This may indicate either a bug or a limitation in EF Core. See https://go.microsoft.com/fwlink/?linkid=2101433 for more detailed information.
/// </summary>
public static string QueryFailed([CanBeNull] object expression, [CanBeNull] object visitor)
=> string.Format(
GetString("QueryFailed", nameof(expression), nameof(visitor)),
expression, visitor);
/// <summary>
/// The model must be finalized before '{method}' can be used. Ensure that either 'OnModelCreating' has completed or, if using a stand-alone 'ModelBuilder', that 'FinalizeModel' has been called.
/// </summary>
public static string ModelNotFinalized([CanBeNull] object method)
=> string.Format(
GetString("ModelNotFinalized", nameof(method)),
method);
/// <summary>
/// Sequence contains no elements.
/// </summary>
public static string NoElements
=> GetString("NoElements");
/// <summary>
/// The given 'IQueryable' does not support generation of query strings.
/// </summary>
public static string NotQueryingEnumerable
=> GetString("NotQueryingEnumerable");
/// <summary>
/// The value provided for argument '{argumentName}' must be a valid value of enum type '{enumType}'.
/// </summary>
public static string InvalidEnumValue([CanBeNull] object argumentName, [CanBeNull] object enumType)
=> string.Format(
GetString("InvalidEnumValue", nameof(argumentName), nameof(enumType)),
argumentName, enumType);
/// <summary>
/// The type mapping for '{type}' has not implemented code literal generation.
/// </summary>
public static string LiteralGenerationNotSupported([CanBeNull] object type)
=> string.Format(
GetString("LiteralGenerationNotSupported", nameof(type)),
type);
/// <summary>
/// The properties expression '{expression}' is not valid. The expression should represent a simple property access: 't => t.MyProperty'. When specifying multiple properties use an anonymous type: 't => new {{ t.MyProperty1, t.MyProperty2 }}'.
/// </summary>
[Obsolete]
public static string InvalidPropertiesExpression([CanBeNull] object expression)
=> string.Format(
GetString("InvalidPropertiesExpression", nameof(expression)),
expression);
/// <summary>
/// The expression '{expression}' is not a valid property expression. The expression should represent a simple property access: 't => t.MyProperty'.
/// </summary>
[Obsolete]
public static string InvalidPropertyExpression([CanBeNull] object expression)
=> string.Format(
GetString("InvalidPropertyExpression", nameof(expression)),
expression);
/// <summary>
/// The expression '{expression}' is not a valid members access expression. The expression should represent a simple property or field access: 't => t.MyProperty'. When specifying multiple properties or fields use an anonymous type: 't => new {{ t.MyProperty, t.MyField }}'.
/// </summary>
public static string InvalidMembersExpression([CanBeNull] object expression)
=> string.Format(
GetString("InvalidMembersExpression", nameof(expression)),
expression);
/// <summary>
/// The expression '{expression}' is not a valid member access expression. The expression should represent a simple property or field access: 't => t.MyProperty'.
/// </summary>
public static string InvalidMemberExpression([CanBeNull] object expression)
=> string.Format(
GetString("InvalidMemberExpression", nameof(expression)),
expression);
/// <summary>
/// The instance of entity type '{entityType}' cannot be tracked because another instance with the same key value for {keyProperties} is already being tracked. When attaching existing entities, ensure that only one entity instance with a given key value is attached. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the conflicting key values.
/// </summary>
public static string IdentityConflict([CanBeNull] object entityType, [CanBeNull] object keyProperties)
=> string.Format(
GetString("IdentityConflict", nameof(entityType), nameof(keyProperties)),
entityType, keyProperties);
/// <summary>
/// The instance of entity type '{entityType}' cannot be tracked because another instance with the key value '{keyValue}' is already being tracked. When attaching existing entities, ensure that only one entity instance with a given key value is attached.
/// </summary>
public static string IdentityConflictSensitive([CanBeNull] object entityType, [CanBeNull] object keyValue)
=> string.Format(
GetString("IdentityConflictSensitive", nameof(entityType), nameof(keyValue)),
entityType, keyValue);
/// <summary>
/// Cannot start tracking InternalEntityEntry for entity type '{entityType}' because it was created by a different StateManager instance.
/// </summary>
public static string WrongStateManager([CanBeNull] object entityType)
=> string.Format(
GetString("WrongStateManager", nameof(entityType)),
entityType);
/// <summary>
/// Cannot start tracking InternalEntityEntry for entity type '{entityType}' because another InternalEntityEntry is already tracking the same entity.
/// </summary>
public static string MultipleEntries([CanBeNull] object entityType)
=> string.Format(
GetString("MultipleEntries", nameof(entityType)),
entityType);
/// <summary>
/// The property '{property}' on entity type '{entityType}' could not be found. Ensure that the property exists and has been included in the model.
/// </summary>
public static string PropertyNotFound([CanBeNull] object property, [CanBeNull] object entityType)
=> string.Format(
GetString("PropertyNotFound", nameof(property), nameof(entityType)),
property, entityType);
/// <summary>
/// The property '{property}' on entity type '{entityType}' is being accessed using the '{PropertyMethod}' method, but is defined in the model as a navigation property. Use either the '{ReferenceMethod}' or '{CollectionMethod}' method to access navigation properties.
/// </summary>
public static string PropertyIsNavigation([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object PropertyMethod, [CanBeNull] object ReferenceMethod, [CanBeNull] object CollectionMethod)
=> string.Format(
GetString("PropertyIsNavigation", nameof(property), nameof(entityType), nameof(PropertyMethod), nameof(ReferenceMethod), nameof(CollectionMethod)),
property, entityType, PropertyMethod, ReferenceMethod, CollectionMethod);
/// <summary>
/// The property '{property}' on entity type '{entityType}' is being accessed using the '{ReferenceMethod}' or '{CollectionMethod}' method, but is defined in the model as a non-navigation property. Use the '{PropertyMethod}' method to access non-navigation properties.
/// </summary>
public static string NavigationIsProperty([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object ReferenceMethod, [CanBeNull] object CollectionMethod, [CanBeNull] object PropertyMethod)
=> string.Format(
GetString("NavigationIsProperty", nameof(property), nameof(entityType), nameof(ReferenceMethod), nameof(CollectionMethod), nameof(PropertyMethod)),
property, entityType, ReferenceMethod, CollectionMethod, PropertyMethod);
/// <summary>
/// The property '{property}' on entity type '{entityType}' is being accessed using the '{ReferenceMethod}' method, but is defined in the model as a collection navigation property. Use the '{CollectionMethod}' method to access collection navigation properties.
/// </summary>
public static string ReferenceIsCollection([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object ReferenceMethod, [CanBeNull] object CollectionMethod)
=> string.Format(
GetString("ReferenceIsCollection", nameof(property), nameof(entityType), nameof(ReferenceMethod), nameof(CollectionMethod)),
property, entityType, ReferenceMethod, CollectionMethod);
/// <summary>
/// The property '{property}' on entity type '{entityType}' is being accessed using the '{CollectionMethod}' method, but is defined in the model as a non-collection, reference navigation property. Use the '{ReferenceMethod}' method to access reference navigation properties.
/// </summary>
public static string CollectionIsReference([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object CollectionMethod, [CanBeNull] object ReferenceMethod)
=> string.Format(
GetString("CollectionIsReference", nameof(property), nameof(entityType), nameof(CollectionMethod), nameof(ReferenceMethod)),
property, entityType, CollectionMethod, ReferenceMethod);
/// <summary>
/// Navigation property '{navigation}' on entity type '{entityType}' cannot have 'IsLoaded' set to false because the referenced entity is non-null and therefore is loaded.
/// </summary>
public static string ReferenceMustBeLoaded([CanBeNull] object navigation, [CanBeNull] object entityType)
=> string.Format(
GetString("ReferenceMustBeLoaded", nameof(navigation), nameof(entityType)),
navigation, entityType);
/// <summary>
/// Navigation property '{navigation}' on entity of type '{entityType}' cannot be loaded because the entity is not being tracked. Navigation properties can only be loaded for tracked entities.
/// </summary>
public static string CannotLoadDetached([CanBeNull] object navigation, [CanBeNull] object entityType)
=> string.Format(
GetString("CannotLoadDetached", nameof(navigation), nameof(entityType)),
navigation, entityType);
/// <summary>
/// The entity type '{entityType}' requires a primary key to be defined. If you intended to use a keyless entity type call 'HasNoKey()'.
/// </summary>
public static string EntityRequiresKey([CanBeNull] object entityType)
=> string.Format(
GetString("EntityRequiresKey", nameof(entityType)),
entityType);
/// <summary>
/// The specified key properties {key} are not declared on the entity type '{entityType}'. Ensure key properties are declared on the target entity type.
/// </summary>
public static string KeyPropertiesWrongEntity([CanBeNull] object key, [CanBeNull] object entityType)
=> string.Format(
GetString("KeyPropertiesWrongEntity", nameof(key), nameof(entityType)),
key, entityType);
/// <summary>
/// The specified foreign key properties {foreignKey} are not declared on the entity type '{entityType}'. Ensure foreign key properties are declared on the target entity type.
/// </summary>
public static string ForeignKeyPropertiesWrongEntity([CanBeNull] object foreignKey, [CanBeNull] object entityType)
=> string.Format(
GetString("ForeignKeyPropertiesWrongEntity", nameof(foreignKey), nameof(entityType)),
foreignKey, entityType);
/// <summary>
/// The specified index properties {index} are not declared on the entity type '{entityType}'. Ensure index properties are declared on the target entity type.
/// </summary>
public static string IndexPropertiesWrongEntity([CanBeNull] object index, [CanBeNull] object entityType)
=> string.Format(
GetString("IndexPropertiesWrongEntity", nameof(index), nameof(entityType)),
index, entityType);
/// <summary>
/// The source IQueryable doesn't implement IAsyncEnumerable<{genericParameter}>. Only sources that implement IAsyncEnumerable can be used for Entity Framework asynchronous operations.
/// </summary>
public static string IQueryableNotAsync([CanBeNull] object genericParameter)
=> string.Format(
GetString("IQueryableNotAsync", nameof(genericParameter)),
genericParameter);
/// <summary>
/// The provider for the source IQueryable doesn't implement IAsyncQueryProvider. Only providers that implement IAsyncQueryProvider can be used for Entity Framework asynchronous operations.
/// </summary>
public static string IQueryableProviderNotAsync
=> GetString("IQueryableProviderNotAsync");
/// <summary>
/// The entity type '{entityType}' is configured to use the '{changeTrackingStrategy}' change tracking strategy but does not implement the required '{notificationInterface}' interface.
/// </summary>
public static string ChangeTrackingInterfaceMissing([CanBeNull] object entityType, [CanBeNull] object changeTrackingStrategy, [CanBeNull] object notificationInterface)
=> string.Format(
GetString("ChangeTrackingInterfaceMissing", nameof(entityType), nameof(changeTrackingStrategy), nameof(notificationInterface)),
entityType, changeTrackingStrategy, notificationInterface);
/// <summary>
/// The collection type being used for navigation property '{navigation}' on entity type '{entityType}' does not implement 'INotifyCollectionChanged'. Any entity type configured to use the '{changeTrackingStrategy}' change tracking strategy must use collections that implement 'INotifyCollectionChanged'. Consider using 'ObservableCollection<T>' for this.
/// </summary>
public static string NonNotifyingCollection([CanBeNull] object navigation, [CanBeNull] object entityType, [CanBeNull] object changeTrackingStrategy)
=> string.Format(
GetString("NonNotifyingCollection", nameof(navigation), nameof(entityType), nameof(changeTrackingStrategy)),
navigation, entityType, changeTrackingStrategy);
/// <summary>
/// 'ObservableCollection<T>.Clear()' is not supported because it uses the 'INotifyCollectionChanged' 'Reset' operation, which does not supply the items removed. Either use multiple calls to 'Remove' or use a notifying collection that supports 'Clear', such as 'Microsoft.EntityFrameworkCore.ChangeTracking.ObservableHashSet<T>'.
/// </summary>
public static string ResetNotSupported
=> GetString("ResetNotSupported");
/// <summary>
/// The original value for property '{property}' of entity type '{entityType}' cannot be accessed because it is not being tracked. Original values are not recorded for most properties of entities when the 'ChangingAndChangedNotifications' strategy is used. To access all original values use a different change tracking strategy such as 'ChangingAndChangedNotificationsWithOriginalValues'.
/// </summary>
public static string OriginalValueNotTracked([CanBeNull] object property, [CanBeNull] object entityType)
=> string.Format(
GetString("OriginalValueNotTracked", nameof(property), nameof(entityType)),
property, entityType);
/// <summary>
/// The value for property '{property}' of entity type '{entityType}' cannot be set to null because its type is '{propertyType}' which is not a nullable type.
/// </summary>
public static string ValueCannotBeNull([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object propertyType)
=> string.Format(
GetString("ValueCannotBeNull", nameof(property), nameof(entityType), nameof(propertyType)),
property, entityType, propertyType);
/// <summary>
/// The value for property '{property}' of entity type '{entityType}' cannot be set to a value of type '{valueType}' because its type is '{propertyType}'.
/// </summary>
public static string InvalidType([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object valueType, [CanBeNull] object propertyType)
=> string.Format(
GetString("InvalidType", nameof(property), nameof(entityType), nameof(valueType), nameof(propertyType)),
property, entityType, valueType, propertyType);
/// <summary>
/// The property '{property}' belongs to entity type '{entityType}' but is being used with an instance of entity type '{expectedType}'.
/// </summary>
public static string PropertyDoesNotBelong([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object expectedType)
=> string.Format(
GetString("PropertyDoesNotBelong", nameof(property), nameof(entityType), nameof(expectedType)),
property, entityType, expectedType);
/// <summary>
/// The specified field '{field}' could not be found for property '{property}' on entity type '{entityType}'.
/// </summary>
public static string MissingBackingField([CanBeNull] object field, [CanBeNull] object property, [CanBeNull] object entityType)
=> string.Format(
GetString("MissingBackingField", nameof(field), nameof(property), nameof(entityType)),
field, property, entityType);
/// <summary>
/// The specified field '{field}' of type '{fieldType}' cannot be used for the property '{entityType}.{property}' of type '{propertyType}'. Only backing fields of types that are assignable from the property type can be used.
/// </summary>
public static string BadBackingFieldType([CanBeNull] object field, [CanBeNull] object fieldType, [CanBeNull] object entityType, [CanBeNull] object property, [CanBeNull] object propertyType)
=> string.Format(
GetString("BadBackingFieldType", nameof(field), nameof(fieldType), nameof(entityType), nameof(property), nameof(propertyType)),
field, fieldType, entityType, property, propertyType);
/// <summary>
/// No field was found backing property '{property}' of entity type '{entity}'. Either name the backing field so that it is picked up by convention, configure the backing field to use, or use a different '{pam}'.
/// </summary>
public static string NoBackingField([CanBeNull] object property, [CanBeNull] object entity, [CanBeNull] object pam)
=> string.Format(
GetString("NoBackingField", nameof(property), nameof(entity), nameof(pam)),
property, entity, pam);
/// <summary>
/// No field was found backing property '{property}' of entity type '{entity}'. Lazy-loaded navigation properties must have backing fields. Either name the backing field so that it is picked up by convention or configure the backing field to use.
/// </summary>
public static string NoBackingFieldLazyLoading([CanBeNull] object property, [CanBeNull] object entity)
=> string.Format(
GetString("NoBackingFieldLazyLoading", nameof(property), nameof(entity)),
property, entity);
/// <summary>
/// No backing field could be found for property '{property}' of entity type '{entity}' and the property does not have a setter.
/// </summary>
public static string NoFieldOrSetter([CanBeNull] object property, [CanBeNull] object entity)
=> string.Format(
GetString("NoFieldOrSetter", nameof(property), nameof(entity)),
property, entity);
/// <summary>
/// No backing field could be found for property '{property}' of entity type '{entity}' and the property does not have a getter.
/// </summary>
public static string NoFieldOrGetter([CanBeNull] object property, [CanBeNull] object entity)
=> string.Format(
GetString("NoFieldOrGetter", nameof(property), nameof(entity)),
property, entity);
/// <summary>
/// No property was associated with field '{field}' of entity type '{entity}'. Either configure a property or use a different '{pam}'.
/// </summary>
public static string NoProperty([CanBeNull] object field, [CanBeNull] object entity, [CanBeNull] object pam)
=> string.Format(
GetString("NoProperty", nameof(field), nameof(entity), nameof(pam)),
field, entity, pam);
/// <summary>
/// The property '{property}' of entity type '{entity}' does not have a setter. Either make the property writable or use a different '{pam}'.
/// </summary>
public static string NoSetter([CanBeNull] object property, [CanBeNull] object entity, [CanBeNull] object pam)
=> string.Format(
GetString("NoSetter", nameof(property), nameof(entity), nameof(pam)),
property, entity, pam);
/// <summary>
/// The property '{property}' of entity type '{entity}' does not have a getter. Either make the property readable or use a different '{pam}'.
/// </summary>
public static string NoGetter([CanBeNull] object property, [CanBeNull] object entity, [CanBeNull] object pam)
=> string.Format(
GetString("NoGetter", nameof(property), nameof(entity), nameof(pam)),
property, entity, pam);
/// <summary>
/// The CLR entity materializer cannot be used for entity type '{entityType}' because it is a shadow state entity type. Materialization to a CLR type is only possible for entity types that have a corresponding CLR type.
/// </summary>
public static string NoClrType([CanBeNull] object entityType)
=> string.Format(
GetString("NoClrType", nameof(entityType)),
entityType);
/// <summary>
/// Services for database providers {storeNames} have been registered in the service provider. Only a single database provider can be registered in a service provider. If possible, ensure that Entity Framework is managing its service provider by removing the call to UseInternalServiceProvider. Otherwise, consider conditionally registering the database provider, or maintaining one service provider per database provider.
/// </summary>
public static string MultipleProvidersConfigured([CanBeNull] object storeNames)
=> string.Format(
GetString("MultipleProvidersConfigured", nameof(storeNames)),
storeNames);
/// <summary>
/// AddDbContext was called with configuration, but the context type '{contextType}' only declares a parameterless constructor. This means that the configuration passed to AddDbContext will never be used. If configuration is passed to AddDbContext, then '{contextType}' should declare a constructor that accepts a DbContextOptions<{contextType}> and must pass it to the base constructor for DbContext.
/// </summary>
public static string DbContextMissingConstructor([CanBeNull] object contextType)
=> string.Format(
GetString("DbContextMissingConstructor", nameof(contextType)),
contextType);
/// <summary>
/// No database provider has been configured for this DbContext. A provider can be configured by overriding the DbContext.OnConfiguring method or by using AddDbContext on the application service provider. If AddDbContext is used, then also ensure that your DbContext type accepts a DbContextOptions<TContext> object in its constructor and passes it to the base constructor for DbContext.
/// </summary>
public static string NoProviderConfigured
=> GetString("NoProviderConfigured");
/// <summary>
/// Entity Framework services have not been added to the internal service provider. Either remove the call to UseInternalServiceProvider so that EF will manage its own internal services, or use the method from your database provider to add the required services to the service provider (e.g. AddEntityFrameworkSqlServer).
/// </summary>
public static string NoEfServices
=> GetString("NoEfServices");
/// <summary>
/// A call was made to '{replaceService}', but Entity Framework is not building its own internal service provider. Either allow EF to build the service provider by removing the call to '{useInternalServiceProvider}', or build replacement services into the service provider before passing it to '{useInternalServiceProvider}'.
/// </summary>
public static string InvalidReplaceService([CanBeNull] object replaceService, [CanBeNull] object useInternalServiceProvider)
=> string.Format(
GetString("InvalidReplaceService", nameof(replaceService), nameof(useInternalServiceProvider)),
replaceService, useInternalServiceProvider);
/// <summary>
/// A call was made to '{useService}', but Entity Framework is not building its own internal service provider. Either allow EF to build the service provider by removing the call to '{useInternalServiceProvider}', or build the '{service}' services to use into the service provider before passing it to '{useInternalServiceProvider}'.
/// </summary>
public static string InvalidUseService([CanBeNull] object useService, [CanBeNull] object useInternalServiceProvider, [CanBeNull] object service)
=> string.Format(
GetString("InvalidUseService", nameof(useService), nameof(useInternalServiceProvider), nameof(service)),
useService, useInternalServiceProvider, service);
/// <summary>
/// A call was made to '{optionCall}' that changed an option that must be constant within a service provider, but Entity Framework is not building its own internal service provider. Either allow EF to build the service provider by removing the call to '{useInternalServiceProvider}', or ensure that the configuration for '{optionCall}' does not change for all uses of a given service provider passed to '{useInternalServiceProvider}'.
/// </summary>
public static string SingletonOptionChanged([CanBeNull] object optionCall, [CanBeNull] object useInternalServiceProvider)
=> string.Format(
GetString("SingletonOptionChanged", nameof(optionCall), nameof(useInternalServiceProvider)),
optionCall, useInternalServiceProvider);
/// <summary>
/// configuration changed for '{key}'
/// </summary>
public static string ServiceProviderConfigChanged([CanBeNull] object key)
=> string.Format(
GetString("ServiceProviderConfigChanged", nameof(key)),
key);
/// <summary>
/// configuration added for '{key}'
/// </summary>
public static string ServiceProviderConfigAdded([CanBeNull] object key)
=> string.Format(
GetString("ServiceProviderConfigAdded", nameof(key)),
key);
/// <summary>
/// configuration removed for '{key}'
/// </summary>
public static string ServiceProviderConfigRemoved([CanBeNull] object key)
=> string.Format(
GetString("ServiceProviderConfigRemoved", nameof(key)),
key);
/// <summary>
/// The database provider attempted to register an implementation of the '{service}' service. This is not a service defined by EF and as such must be registered as a provider-specific service using the 'TryAddProviderSpecificServices' method.
/// </summary>
public static string NotAnEFService([CanBeNull] object service)
=> string.Format(
GetString("NotAnEFService", nameof(service)),
service);
/// <summary>
/// The current database provider has not implemented the 'CanConnect' method.
/// </summary>
public static string CanConnectNotImplemented
=> GetString("CanConnectNotImplemented");
/// <summary>
/// The implementation type for the registration of the '{service}' service could not be determined. Specific implementation types must be used for services that expect multiple registrations so as to avoid duplicates.
/// </summary>
public static string ImplementationTypeRequired([CanBeNull] object service)
=> string.Format(
GetString("ImplementationTypeRequired", nameof(service)),
service);
/// <summary>
/// An attempt was made to register an instance for the '{scope}' service '{service}'. Instances can only be registered for 'Singleton' services.
/// </summary>
public static string SingletonRequired([CanBeNull] object scope, [CanBeNull] object service)
=> string.Format(
GetString("SingletonRequired", nameof(scope), nameof(service)),
scope, service);
/// <summary>
/// The '{property}' on entity type '{entityType}' does not have a value set and no value generator is available for properties of type '{propertyType}'. Either set a value for the property before adding the entity or configure a value generator for properties of type '{propertyType}'.
/// </summary>
public static string NoValueGenerator([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object propertyType)
=> string.Format(
GetString("NoValueGenerator", nameof(property), nameof(entityType), nameof(propertyType)),
property, entityType, propertyType);
/// <summary>
/// The service dependencies type '{dependenciesType}' has been registered inappropriately in the service collection. Service dependencies types must only be registered by Entity Framework, or in rare cases by database providers and then only to change the service lifetime.
/// </summary>
public static string BadDependencyRegistration([CanBeNull] object dependenciesType)
=> string.Format(
GetString("BadDependencyRegistration", nameof(dependenciesType)),
dependenciesType);
/// <summary>
/// The type '{givenType}' cannot be used as a value generator because it does not inherit from '{expectedType}'.
/// </summary>
public static string BadValueGeneratorType([CanBeNull] object givenType, [CanBeNull] object expectedType)
=> string.Format(
GetString("BadValueGeneratorType", nameof(givenType), nameof(expectedType)),
givenType, expectedType);
/// <summary>
/// Cannot create instance of value generator type '{generatorType}'. Ensure that the type is instantiable and has a parameterless constructor, or use the overload of HasValueGenerator that accepts a delegate.
/// </summary>
public static string CannotCreateValueGenerator([CanBeNull] object generatorType)
=> string.Format(
GetString("CannotCreateValueGenerator", nameof(generatorType)),
generatorType);
/// <summary>
/// The property '{property}' on entity type '{entityType}' has a temporary value while attempting to change the entity's state to '{state}'. Either set a permanent value explicitly or ensure that the database is configured to generate values for this property.
/// </summary>
public static string TempValuePersists([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object state)
=> string.Format(
GetString("TempValuePersists", nameof(property), nameof(entityType), nameof(state)),
property, entityType, state);
/// <summary>
/// The value of '{entityType}.{property}' is unknown when attempting to save changes. This is because the property is also part of a foreign key for which the principal entity in the relationship is not known.
/// </summary>
public static string UnknownKeyValue([CanBeNull] object entityType, [CanBeNull] object property)
=> string.Format(
GetString("UnknownKeyValue", nameof(entityType), nameof(property)),
entityType, property);
/// <summary>
/// The EF.Property<T> method may only be used within LINQ queries.
/// </summary>
public static string PropertyMethodInvoked
=> GetString("PropertyMethodInvoked");
/// <summary>
/// The property '{property}' cannot be added to type '{entityType}' because the type of the corresponding CLR property or field '{clrType}' does not match the specified type '{propertyType}'.
/// </summary>
public static string PropertyWrongClrType([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object clrType, [CanBeNull] object propertyType)
=> string.Format(
GetString("PropertyWrongClrType", nameof(property), nameof(entityType), nameof(clrType), nameof(propertyType)),
property, entityType, clrType, propertyType);
/// <summary>
/// The property '{property}' cannot exist on type '{entityType}' because the type is marked as shadow state while the property is not. Shadow state types can only contain shadow state properties.
/// </summary>
public static string ClrPropertyOnShadowEntity([CanBeNull] object property, [CanBeNull] object entityType)
=> string.Format(
GetString("ClrPropertyOnShadowEntity", nameof(property), nameof(entityType)),
property, entityType);
/// <summary>
/// The property '{property}' cannot be removed from entity type '{entityType}' because it is being used in the key {key}. All containing keys must be removed or redefined before the property can be removed.
/// </summary>
public static string PropertyInUseKey([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object key)
=> string.Format(
GetString("PropertyInUseKey", nameof(property), nameof(entityType), nameof(key)),
property, entityType, key);
/// <summary>
/// Cannot remove key {key} from entity type '{entityType}' because it is referenced by a foreign key {foreignKey} in entity type '{dependentType}'. All foreign keys must be removed or redefined before the referenced key can be removed.
/// </summary>
public static string KeyInUse([CanBeNull] object key, [CanBeNull] object entityType, [CanBeNull] object foreignKey, [CanBeNull] object dependentType)
=> string.Format(
GetString("KeyInUse", nameof(key), nameof(entityType), nameof(foreignKey), nameof(dependentType)),
key, entityType, foreignKey, dependentType);
/// <summary>
/// The service property '{property}' of type '{serviceType}' cannot be added to the entity type '{entityType}' because service property '{duplicateName}' of the same type already exists on entity type '{duplicateEntityType}'.
/// </summary>
public static string DuplicateServicePropertyType([CanBeNull] object property, [CanBeNull] object serviceType, [CanBeNull] object entityType, [CanBeNull] object duplicateName, [CanBeNull] object duplicateEntityType)
=> string.Format(
GetString("DuplicateServicePropertyType", nameof(property), nameof(serviceType), nameof(entityType), nameof(duplicateName), nameof(duplicateEntityType)),
property, serviceType, entityType, duplicateName, duplicateEntityType);
/// <summary>
/// The navigation property '{navigation}' cannot be added to the entity type '{entityType}' because there is no corresponding CLR property on the underlying type and navigations properties cannot be added in shadow state.
/// </summary>
public static string NoClrNavigation([CanBeNull] object navigation, [CanBeNull] object entityType)
=> string.Format(
GetString("NoClrNavigation", nameof(navigation), nameof(entityType)),
navigation, entityType);
/// <summary>
/// The navigation property '{navigation}' cannot be added to the entity type '{entityType}' because its CLR type '{clrType}' does not match the expected CLR type '{targetType}'.
/// </summary>
public static string NavigationSingleWrongClrType([CanBeNull] object navigation, [CanBeNull] object entityType, [CanBeNull] object clrType, [CanBeNull] object targetType)
=> string.Format(
GetString("NavigationSingleWrongClrType", nameof(navigation), nameof(entityType), nameof(clrType), nameof(targetType)),
navigation, entityType, clrType, targetType);
/// <summary>
/// The collection navigation property '{navigation}' cannot be added to the entity type '{entityType}' because its CLR type '{clrType}' does not implement 'IEnumerable<{targetType}>'. Collection navigation properties must implement IEnumerable<> of the related entity.
/// </summary>
public static string NavigationCollectionWrongClrType([CanBeNull] object navigation, [CanBeNull] object entityType, [CanBeNull] object clrType, [CanBeNull] object targetType)
=> string.Format(
GetString("NavigationCollectionWrongClrType", nameof(navigation), nameof(entityType), nameof(clrType), nameof(targetType)),
navigation, entityType, clrType, targetType);
/// <summary>
/// The number of properties specified for the foreign key {foreignKey} on entity type '{dependentType}' does not match the number of properties in the principal key {principalKey} on entity type '{principalType}'.
/// </summary>
public static string ForeignKeyCountMismatch([CanBeNull] object foreignKey, [CanBeNull] object dependentType, [CanBeNull] object principalKey, [CanBeNull] object principalType)
=> string.Format(
GetString("ForeignKeyCountMismatch", nameof(foreignKey), nameof(dependentType), nameof(principalKey), nameof(principalType)),
foreignKey, dependentType, principalKey, principalType);
/// <summary>
/// The types of the properties specified for the foreign key {foreignKey} on entity type '{dependentType}' do not match the types of the properties in the principal key {principalKey} on entity type '{principalType}'.
/// </summary>
public static string ForeignKeyTypeMismatch([CanBeNull] object foreignKey, [CanBeNull] object dependentType, [CanBeNull] object principalKey, [CanBeNull] object principalType)
=> string.Format(
GetString("ForeignKeyTypeMismatch", nameof(foreignKey), nameof(dependentType), nameof(principalKey), nameof(principalType)),
foreignKey, dependentType, principalKey, principalType);
/// <summary>
/// The type of navigation property '{navigation}' on the entity type '{entityType}' is '{foundType}' which does not implement ICollection<{targetType}>. Collection navigation properties must implement ICollection<> of the target type.
/// </summary>
public static string NavigationBadType([CanBeNull] object navigation, [CanBeNull] object entityType, [CanBeNull] object foundType, [CanBeNull] object targetType)
=> string.Format(
GetString("NavigationBadType", nameof(navigation), nameof(entityType), nameof(foundType), nameof(targetType)),
navigation, entityType, foundType, targetType);
/// <summary>
/// The type of navigation property '{navigation}' on the entity type '{entityType}' is '{foundType}' which is an array type. Collection navigation properties cannot be arrays.
/// </summary>
public static string NavigationArray([CanBeNull] object navigation, [CanBeNull] object entityType, [CanBeNull] object foundType)
=> string.Format(
GetString("NavigationArray", nameof(navigation), nameof(entityType), nameof(foundType)),
navigation, entityType, foundType);
/// <summary>
/// The navigation property '{navigation}' on the entity type '{entityType}' does not have a setter and no writable backing field was found or specified. Read-only collection navigation properties must be initialized before use.
/// </summary>
public static string NavigationNoSetter([CanBeNull] object navigation, [CanBeNull] object entityType)
=> string.Format(
GetString("NavigationNoSetter", nameof(navigation), nameof(entityType)),
navigation, entityType);
/// <summary>
/// The type of navigation property '{navigation}' on the entity type '{entityType}' is '{foundType}' for which it was not possible to create a concrete instance. Either initialize the property before use, add a public parameterless constructor to the type, or use a type which can be assigned a HashSet<> or List<>.
/// </summary>
public static string NavigationCannotCreateType([CanBeNull] object navigation, [CanBeNull] object entityType, [CanBeNull] object foundType)
=> string.Format(
GetString("NavigationCannotCreateType", nameof(navigation), nameof(entityType), nameof(foundType)),
navigation, entityType, foundType);
/// <summary>
/// The property '{property}' on entity type '{entityType}' is part of a key and so cannot be modified or marked as modified. To change the principal of an existing entity with an identifying foreign key first delete the dependent and invoke 'SaveChanges' then associate the dependent with the new principal.
/// </summary>
public static string KeyReadOnly([CanBeNull] object property, [CanBeNull] object entityType)
=> string.Format(
GetString("KeyReadOnly", nameof(property), nameof(entityType)),
property, entityType);
/// <summary>
/// The property '{property}' on entity type '{entityType}' is defined to be read-only after it has been saved, but its value has been modified or marked as modified.
/// </summary>
public static string PropertyReadOnlyAfterSave([CanBeNull] object property, [CanBeNull] object entityType)
=> string.Format(
GetString("PropertyReadOnlyAfterSave", nameof(property), nameof(entityType)),
property, entityType);
/// <summary>
/// The property '{property}' on entity type '{entityType}' is defined to be read-only before it is saved, but its value has been set to something other than a temporary or default value.
/// </summary>
public static string PropertyReadOnlyBeforeSave([CanBeNull] object property, [CanBeNull] object entityType)
=> string.Format(
GetString("PropertyReadOnlyBeforeSave", nameof(property), nameof(entityType)),
property, entityType);
/// <summary>
/// The property '{property}' on entity type '{entityType}' must be marked as read-only after it has been saved because it is part of a key. Key properties are always read-only once an entity has been saved for the first time.
/// </summary>
public static string KeyPropertyMustBeReadOnly([CanBeNull] object property, [CanBeNull] object entityType)
=> string.Format(
GetString("KeyPropertyMustBeReadOnly", nameof(property), nameof(entityType)),
property, entityType);
/// <summary>
/// The association between entity types '{firstType}' and '{secondType}' has been severed but the relationship is either marked as 'Required' or is implicitly required because the foreign key is not nullable. If the dependent/child entity should be deleted when a required relationship is severed, then setup the relationship to use cascade deletes. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the key values.
/// </summary>
public static string RelationshipConceptualNull([CanBeNull] object firstType, [CanBeNull] object secondType)
=> string.Format(
GetString("RelationshipConceptualNull", nameof(firstType), nameof(secondType)),
firstType, secondType);
/// <summary>
/// The property '{property}' on entity type '{entityType}' is marked as null, but this cannot be saved because the property is marked as required. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the key values.
/// </summary>
public static string PropertyConceptualNull([CanBeNull] object property, [CanBeNull] object entityType)
=> string.Format(
GetString("PropertyConceptualNull", nameof(property), nameof(entityType)),
property, entityType);
/// <summary>
/// The foreign key {foreignKey} cannot be added to the entity type '{entityType}' because a foreign key on the same properties already exists on entity type '{duplicateEntityType}' and also targets the key {key} on '{principalType}'.
/// </summary>
public static string DuplicateForeignKey([CanBeNull] object foreignKey, [CanBeNull] object entityType, [CanBeNull] object duplicateEntityType, [CanBeNull] object key, [CanBeNull] object principalType)
=> string.Format(
GetString("DuplicateForeignKey", nameof(foreignKey), nameof(entityType), nameof(duplicateEntityType), nameof(key), nameof(principalType)),
foreignKey, entityType, duplicateEntityType, key, principalType);
/// <summary>
/// The index {indexProperties} cannot be added to the entity type '{entityType}' because an index on the same properties already exists on entity type '{duplicateEntityType}'.
/// </summary>
public static string DuplicateIndex([CanBeNull] object indexProperties, [CanBeNull] object entityType, [CanBeNull] object duplicateEntityType)
=> string.Format(
GetString("DuplicateIndex", nameof(indexProperties), nameof(entityType), nameof(duplicateEntityType)),
indexProperties, entityType, duplicateEntityType);
/// <summary>
/// The index named '{indexName}' defined on properties {indexProperties} cannot be added to the entity type '{entityType}' because an index with the same name already exists on entity type '{duplicateEntityType}'.
/// </summary>
public static string DuplicateNamedIndex([CanBeNull] object indexName, [CanBeNull] object indexProperties, [CanBeNull] object entityType, [CanBeNull] object duplicateEntityType)
=> string.Format(
GetString("DuplicateNamedIndex", nameof(indexName), nameof(indexProperties), nameof(entityType), nameof(duplicateEntityType)),
indexName, indexProperties, entityType, duplicateEntityType);
/// <summary>
/// The key {key} cannot be added to the entity type '{entityType}' because a key on the same properties already exists on entity type '{duplicateEntityType}'.
/// </summary>
public static string DuplicateKey([CanBeNull] object key, [CanBeNull] object entityType, [CanBeNull] object duplicateEntityType)
=> string.Format(
GetString("DuplicateKey", nameof(key), nameof(entityType), nameof(duplicateEntityType)),
key, entityType, duplicateEntityType);
/// <summary>
/// The navigation property '{navigation}' cannot be added to the entity type '{entityType}' because the target entity type '{targetType}' is defined in shadow state and navigations properties cannot point to shadow state entities.
/// </summary>
public static string NavigationToShadowEntity([CanBeNull] object navigation, [CanBeNull] object entityType, [CanBeNull] object targetType)
=> string.Format(
GetString("NavigationToShadowEntity", nameof(navigation), nameof(entityType), nameof(targetType)),
navigation, entityType, targetType);
/// <summary>
/// The specified entity type '{entityType}' is invalid. It should be either the dependent entity type '{dependentType}' or the principal entity type '{principalType}' or an entity type derived from one of them.
/// </summary>
public static string EntityTypeNotInRelationship([CanBeNull] object entityType, [CanBeNull] object dependentType, [CanBeNull] object principalType)
=> string.Format(
GetString("EntityTypeNotInRelationship", nameof(entityType), nameof(dependentType), nameof(principalType)),
entityType, dependentType, principalType);
/// <summary>
/// The entity type '{entityType}' cannot be added to the model because an entity type with the same name already exists.
/// </summary>
public static string DuplicateEntityType([CanBeNull] object entityType)
=> string.Format(
GetString("DuplicateEntityType", nameof(entityType)),
entityType);
/// <summary>
/// The annotation '{annotation}' cannot be added because an annotation with the same name already exists.
/// </summary>
public static string DuplicateAnnotation([CanBeNull] object annotation)
=> string.Format(
GetString("DuplicateAnnotation", nameof(annotation)),
annotation);
/// <summary>
/// The annotation '{annotation}' was not found. Ensure that the annotation has been added.
/// </summary>
public static string AnnotationNotFound([CanBeNull] object annotation)
=> string.Format(
GetString("AnnotationNotFound", nameof(annotation)),
annotation);
/// <summary>
/// The property '{property}' on entity type '{entityType}' cannot be marked as nullable/optional because the type of the property is '{propertyType}' which is not a nullable type. Any property can be marked as non-nullable/required, but only properties of nullable types and which are not part of primary key can be marked as nullable/optional.
/// </summary>
public static string CannotBeNullable([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object propertyType)
=> string.Format(
GetString("CannotBeNullable", nameof(property), nameof(entityType), nameof(propertyType)),
property, entityType, propertyType);
/// <summary>
/// The property '{property}' on entity type '{entityType}' cannot be marked as nullable/optional because it has been included in a key {key}.
/// </summary>
public static string KeyPropertyCannotBeNullable([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object key)
=> string.Format(
GetString("KeyPropertyCannotBeNullable", nameof(property), nameof(entityType), nameof(key)),
property, entityType, key);
/// <summary>
/// An attempt was made to use the model while it was being created. A DbContext instance cannot be used inside OnModelCreating in any way that makes use of the model that is being created.
/// </summary>
public static string RecursiveOnModelCreating
=> GetString("RecursiveOnModelCreating");
/// <summary>
/// An attempt was made to use the context while it is being configured. A DbContext instance cannot be used inside OnConfiguring since it is still being configured at this point. This can happen if a second operation is started on this context before a previous operation completed. Any instance members are not guaranteed to be thread safe.
/// </summary>
public static string RecursiveOnConfiguring
=> GetString("RecursiveOnConfiguring");
/// <summary>
/// The entity type '{entityType}' cannot be removed because it is being referenced by foreign key {foreignKey} on '{referencingEntityType}'. All referencing foreign keys must be removed or redefined before the entity type can be removed.
/// </summary>
public static string EntityTypeInUseByReferencingForeignKey([CanBeNull] object entityType, [CanBeNull] object foreignKey, [CanBeNull] object referencingEntityType)
=> string.Format(
GetString("EntityTypeInUseByReferencingForeignKey", nameof(entityType), nameof(foreignKey), nameof(referencingEntityType)),
entityType, foreignKey, referencingEntityType);
/// <summary>
/// The property '{property}' of the argument '{argument}' cannot be null.
/// </summary>
public static string ArgumentPropertyNull([CanBeNull] object property, [CanBeNull] object argument)
=> string.Format(
GetString("ArgumentPropertyNull", nameof(property), nameof(argument)),
property, argument);
/// <summary>
/// The principal and dependent ends of the relationship cannot be flipped once foreign key or principal key properties have been specified.
/// </summary>
public static string RelationshipCannotBeInverted
=> GetString("RelationshipCannotBeInverted");
/// <summary>
/// The specified type '{type}'must be a non-interface reference type to be used as an entity type .
/// </summary>
public static string InvalidEntityType([CanBeNull] object type)
=> string.Format(
GetString("InvalidEntityType", nameof(type)),
type);
/// <summary>
/// The relationship from '{referencingEntityTypeOrNavigation}' to '{referencedEntityTypeOrNavigation}' with foreign key properties {foreignKeyPropertiesWithTypes} cannot target the primary key {primaryKeyPropertiesWithTypes} because it is not compatible. Configure a principal key or a set of compatible foreign key properties for this relationship.
/// </summary>
public static string ReferencedShadowKey([CanBeNull] object referencingEntityTypeOrNavigation, [CanBeNull] object referencedEntityTypeOrNavigation, [CanBeNull] object foreignKeyPropertiesWithTypes, [CanBeNull] object primaryKeyPropertiesWithTypes)
=> string.Format(
GetString("ReferencedShadowKey", nameof(referencingEntityTypeOrNavigation), nameof(referencedEntityTypeOrNavigation), nameof(foreignKeyPropertiesWithTypes), nameof(primaryKeyPropertiesWithTypes)),
referencingEntityTypeOrNavigation, referencedEntityTypeOrNavigation, foreignKeyPropertiesWithTypes, primaryKeyPropertiesWithTypes);
/// <summary>
/// The property '{keyProperty}' cannot be configured as 'ValueGeneratedOnUpdate' or 'ValueGeneratedOnAddOrUpdate' because the key value cannot be changed after the entity has been added to the store.
/// </summary>
public static string MutableKeyProperty([CanBeNull] object keyProperty)
=> string.Format(
GetString("MutableKeyProperty", nameof(keyProperty)),
keyProperty);
/// <summary>
/// An exception was thrown while attempting to evaluate a LINQ query parameter expression. To show additional information call EnableSensitiveDataLogging() when overriding DbContext.OnConfiguring.
/// </summary>
public static string ExpressionParameterizationException
=> GetString("ExpressionParameterizationException");
/// <summary>
/// The '{factory}' cannot create a value generator for property '{property}' on entity type '{entityType}'. Only integer properties are supported.
/// </summary>
public static string InvalidValueGeneratorFactoryProperty([CanBeNull] object factory, [CanBeNull] object property, [CanBeNull] object entityType)
=> string.Format(
GetString("InvalidValueGeneratorFactoryProperty", nameof(factory), nameof(property), nameof(entityType)),
factory, property, entityType);
/// <summary>
/// A key cannot be configured on '{derivedType}' because it is a derived type. The key must be configured on the root type '{rootType}'. If you did not intend for '{rootType}' to be included in the model, ensure that it is not included in a DbSet property on your context, referenced in a configuration call to ModelBuilder, or referenced from a navigation property on a type that is included in the model.
/// </summary>
public static string DerivedEntityTypeKey([CanBeNull] object derivedType, [CanBeNull] object rootType)
=> string.Format(
GetString("DerivedEntityTypeKey", nameof(derivedType), nameof(rootType)),
derivedType, rootType);
/// <summary>
/// The entity type '{entityType}' cannot inherit from '{baseEntityType}' because '{baseEntityType}' is a descendant of '{entityType}'.
/// </summary>
public static string CircularInheritance([CanBeNull] object entityType, [CanBeNull] object baseEntityType)
=> string.Format(
GetString("CircularInheritance", nameof(entityType), nameof(baseEntityType)),
entityType, baseEntityType);
/// <summary>
/// Unable to set a base type for entity type '{entityType}' because it has one or more keys defined.
/// </summary>
public static string DerivedEntityCannotHaveKeys([CanBeNull] object entityType)
=> string.Format(
GetString("DerivedEntityCannotHaveKeys", nameof(entityType)),
entityType);
/// <summary>
/// The edge cannot be added because the graph does not contain vertex '{vertex}'.
/// </summary>
public static string GraphDoesNotContainVertex([CanBeNull] object vertex)
=> string.Format(
GetString("GraphDoesNotContainVertex", nameof(vertex)),
vertex);
/// <summary>
/// Unable to create an instance of type entity type '{entityType}' because it is abstract. Either make it non-abstract or consider mapping at least one derived type.
/// </summary>
public static string CannotMaterializeAbstractType([CanBeNull] object entityType)
=> string.Format(
GetString("CannotMaterializeAbstractType", nameof(entityType)),
entityType);
/// <summary>
/// Entity type '{entityType}' is defined with a single key property, but {valuesCount} values were passed to the 'DbSet.Find' method.
/// </summary>
public static string FindNotCompositeKey([CanBeNull] object entityType, [CanBeNull] object valuesCount)
=> string.Format(
GetString("FindNotCompositeKey", nameof(entityType), nameof(valuesCount)),
entityType, valuesCount);
/// <summary>
/// Entity type '{entityType}' is defined with a {propertiesCount}-part composite key, but {valuesCount} values were passed to the 'DbSet.Find' method.
/// </summary>
public static string FindValueCountMismatch([CanBeNull] object entityType, [CanBeNull] object propertiesCount, [CanBeNull] object valuesCount)
=> string.Format(
GetString("FindValueCountMismatch", nameof(entityType), nameof(propertiesCount), nameof(valuesCount)),
entityType, propertiesCount, valuesCount);
/// <summary>
/// The key value at position {index} of the call to 'DbSet<{entityType}>.Find' was of type '{valueType}', which does not match the property type of '{propertyType}'.
/// </summary>
public static string FindValueTypeMismatch([CanBeNull] object index, [CanBeNull] object entityType, [CanBeNull] object valueType, [CanBeNull] object propertyType)
=> string.Format(
GetString("FindValueTypeMismatch", nameof(index), nameof(entityType), nameof(valueType), nameof(propertyType)),
index, entityType, valueType, propertyType);
/// <summary>
/// The provided principal entity key '{principalKey}' is not a key on the entity type '{principalEntityType}'.
/// </summary>
public static string ForeignKeyReferencedEntityKeyMismatch([CanBeNull] object principalKey, [CanBeNull] object principalEntityType)
=> string.Format(
GetString("ForeignKeyReferencedEntityKeyMismatch", nameof(principalKey), nameof(principalEntityType)),
principalKey, principalEntityType);
/// <summary>
/// Property '{property}' on entity type '{entityType}' is of type '{actualType}' but the generic type provided is of type '{genericType}'.
/// </summary>
public static string WrongGenericPropertyType([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object actualType, [CanBeNull] object genericType)
=> string.Format(
GetString("WrongGenericPropertyType", nameof(property), nameof(entityType), nameof(actualType), nameof(genericType)),
property, entityType, actualType, genericType);
/// <summary>
/// The DbContextOptions passed to the {contextType} constructor must be a DbContextOptions<{contextType}>. When registering multiple DbContext types make sure that the constructor for each context type has a DbContextOptions<TContext> parameter rather than a non-generic DbContextOptions parameter.
/// </summary>
public static string NonGenericOptions([CanBeNull] object contextType)
=> string.Format(
GetString("NonGenericOptions", nameof(contextType)),
contextType);
/// <summary>
/// Options extension of type '{optionsExtension}' not found.
/// </summary>
public static string OptionsExtensionNotFound([CanBeNull] object optionsExtension)
=> string.Format(
GetString("OptionsExtensionNotFound", nameof(optionsExtension)),
optionsExtension);
/// <summary>
/// The type '{entityType}' cannot have base type '{baseType}' because the properties '{derivedPropertyType}.{derivedProperty}' and '{basePropertyType}.{baseProperty}' are conflicting.
/// </summary>
public static string DuplicatePropertiesOnBase([CanBeNull] object entityType, [CanBeNull] object baseType, [CanBeNull] object derivedPropertyType, [CanBeNull] object derivedProperty, [CanBeNull] object basePropertyType, [CanBeNull] object baseProperty)
=> string.Format(
GetString("DuplicatePropertiesOnBase", nameof(entityType), nameof(baseType), nameof(derivedPropertyType), nameof(derivedProperty), nameof(basePropertyType), nameof(baseProperty)),
entityType, baseType, derivedPropertyType, derivedProperty, basePropertyType, baseProperty);
/// <summary>
/// The property '{property}' on entity type '{entityType}' cannot be marked as nullable/optional because the property is a part of a key. Any property can be marked as non-nullable/required, but only properties of nullable types and which are not part of a key can be marked as nullable/optional.
/// </summary>
public static string CannotBeNullablePK([CanBeNull] object property, [CanBeNull] object entityType)
=> string.Format(
GetString("CannotBeNullablePK", nameof(property), nameof(entityType)),
property, entityType);
/// <summary>
/// Entity type '{entityType}' is in shadow-state. A valid model requires all entity types to have corresponding CLR type.
/// </summary>
public static string ShadowEntity([CanBeNull] object entityType)
=> string.Format(
GetString("ShadowEntity", nameof(entityType)),
entityType);
/// <summary>
/// Entity type '{entityType}' has composite primary key defined with data annotations. To set composite primary key, use fluent API.
/// </summary>
public static string CompositePKWithDataAnnotation([CanBeNull] object entityType)
=> string.Format(
GetString("CompositePKWithDataAnnotation", nameof(entityType)),
entityType);
/// <summary>
/// The entity types '{firstEntityType}' and '{secondEntityType}' do not belong to the same model.
/// </summary>
public static string EntityTypeModelMismatch([CanBeNull] object firstEntityType, [CanBeNull] object secondEntityType)
=> string.Format(
GetString("EntityTypeModelMismatch", nameof(firstEntityType), nameof(secondEntityType)),
firstEntityType, secondEntityType);
/// <summary>
/// The block size used for Hi-Lo value generation must be positive. When the Hi-Lo generator is backed by a SQL sequence this means that the sequence increment must be positive.
/// </summary>
public static string HiLoBadBlockSize
=> GetString("HiLoBadBlockSize");
/// <summary>
/// Value generation is not supported for property '{entityType}.{property}' because it has a '{converter}' converter configured. Configure the property to not use value generation using 'ValueGenerated.Never' or 'DatabaseGeneratedOption.None' and specify explicit values instead.
/// </summary>
public static string ValueGenWithConversion([CanBeNull] object entityType, [CanBeNull] object property, [CanBeNull] object converter)
=> string.Format(
GetString("ValueGenWithConversion", nameof(entityType), nameof(property), nameof(converter)),
entityType, property, converter);
/// <summary>
/// The entity type related to '{entityType}' cannot be determined because the specified foreign key {foreignKey} references entity type '{principalEntityType}' that it is in the same hierarchy as the entity type that it is declared on '{dependentEntityType}'.
/// </summary>
public static string IntraHierarchicalAmbiguousTargetEntityType([CanBeNull] object entityType, [CanBeNull] object foreignKey, [CanBeNull] object principalEntityType, [CanBeNull] object dependentEntityType)
=> string.Format(
GetString("IntraHierarchicalAmbiguousTargetEntityType", nameof(entityType), nameof(foreignKey), nameof(principalEntityType), nameof(dependentEntityType)),
entityType, foreignKey, principalEntityType, dependentEntityType);
/// <summary>
/// The entity type '{entityType}' cannot inherit from '{baseEntityType}' because '{baseEntityType}' is a shadow state entity type while '{entityType}' is not.
/// </summary>
public static string NonClrBaseType([CanBeNull] object entityType, [CanBeNull] object baseEntityType)
=> string.Format(
GetString("NonClrBaseType", nameof(entityType), nameof(baseEntityType)),
entityType, baseEntityType);
/// <summary>
/// The entity type '{entityType}' cannot inherit from '{baseEntityType}' because '{entityType}' is a shadow state entity type while '{baseEntityType}' is not.
/// </summary>
public static string NonShadowBaseType([CanBeNull] object entityType, [CanBeNull] object baseEntityType)
=> string.Format(
GetString("NonShadowBaseType", nameof(entityType), nameof(baseEntityType)),
entityType, baseEntityType);
/// <summary>
/// The entity type '{entityType}' cannot inherit from '{baseEntityType}' because '{clrType}' is not a descendant of '{baseClrType}'.
/// </summary>
public static string NotAssignableClrBaseType([CanBeNull] object entityType, [CanBeNull] object baseEntityType, [CanBeNull] object clrType, [CanBeNull] object baseClrType)
=> string.Format(
GetString("NotAssignableClrBaseType", nameof(entityType), nameof(baseEntityType), nameof(clrType), nameof(baseClrType)),
entityType, baseEntityType, clrType, baseClrType);
/// <summary>
/// CLR property '{property}' cannot be added to entity type '{entityType}' because it is declared on the CLR type '{clrType}'.
/// </summary>
public static string PropertyWrongEntityClrType([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object clrType)
=> string.Format(
GetString("PropertyWrongEntityClrType", nameof(property), nameof(entityType), nameof(clrType)),
property, entityType, clrType);
/// <summary>
/// The InversePropertyAttribute on property '{property}' on type '{entityType}' is not valid. The property '{referencedProperty}' is not a valid navigation property on the related type '{referencedEntityType}'. Ensure that the property exists and is a valid reference or collection navigation property.
/// </summary>
public static string InvalidNavigationWithInverseProperty([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object referencedProperty, [CanBeNull] object referencedEntityType)
=> string.Format(
GetString("InvalidNavigationWithInverseProperty", nameof(property), nameof(entityType), nameof(referencedProperty), nameof(referencedEntityType)),
property, entityType, referencedProperty, referencedEntityType);
/// <summary>
/// A relationship cannot be established from property '{property}' on type '{entityType}' to property '{referencedProperty}' on type '{referencedEntityType}'. Check the values in the InversePropertyAttribute to ensure relationship definitions are unique and reference from one navigation property to its corresponding inverse navigation property.
/// </summary>
public static string SelfReferencingNavigationWithInverseProperty([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object referencedProperty, [CanBeNull] object referencedEntityType)
=> string.Format(
GetString("SelfReferencingNavigationWithInverseProperty", nameof(property), nameof(entityType), nameof(referencedProperty), nameof(referencedEntityType)),
property, entityType, referencedProperty, referencedEntityType);
/// <summary>
/// Data binding directly to a store query is not supported. Instead populate a DbSet with data, for example by calling Load on the DbSet, and then bind to local data to avoid sending a query to the database each time the databound control iterates the data. For WPF bind to 'DbSet.Local.ToObservableCollection()'. For WinForms bind to 'DbSet.Local.ToBindingList()'. For ASP.NET WebForms bind to 'DbSet.ToList()' or use Model Binding.
/// </summary>
public static string DataBindingWithIListSource
=> GetString("DataBindingWithIListSource");
/// <summary>
/// Data binding directly to 'DbSet.Local' is not supported since it does not provide a stable ordering. For WPF bind to 'DbSet.Local.ToObservableCollection()'. For WinForms bind to 'DbSet.Local.ToBindingList()'. For ASP.NET WebForms bind to 'DbSet.ToList()' or use Model Binding.
/// </summary>
public static string DataBindingToLocalWithIListSource
=> GetString("DataBindingToLocalWithIListSource");
/// <summary>
/// The derived type '{derivedType}' cannot have KeyAttribute on property '{property}' since primary key can only be declared on the root type.
/// </summary>
public static string KeyAttributeOnDerivedEntity([CanBeNull] object derivedType, [CanBeNull] object property)
=> string.Format(
GetString("KeyAttributeOnDerivedEntity", nameof(derivedType), nameof(property)),
derivedType, property);
/// <summary>
/// InversePropertyAttributes on navigation '{navigation}' in entity type '{entityType}' and on navigation '{referencedNavigation}' in entity type '{referencedEntityType}' are not pointing to each other.
/// </summary>
public static string InversePropertyMismatch([CanBeNull] object navigation, [CanBeNull] object entityType, [CanBeNull] object referencedNavigation, [CanBeNull] object referencedEntityType)
=> string.Format(
GetString("InversePropertyMismatch", nameof(navigation), nameof(entityType), nameof(referencedNavigation), nameof(referencedEntityType)),
navigation, entityType, referencedNavigation, referencedEntityType);
/// <summary>
/// There are multiple properties pointing to navigation '{navigation}' in entity type '{entityType}'. To define composite foreign key using data annotations, use ForeignKeyAttribute on navigation.
/// </summary>
public static string CompositeFkOnProperty([CanBeNull] object navigation, [CanBeNull] object entityType)
=> string.Format(
GetString("CompositeFkOnProperty", nameof(navigation), nameof(entityType)),
navigation, entityType);
/// <summary>
/// The ForeignKeyAttributes on property '{property}' and navigation '{navigation}' in entity type '{entityType}' do not point at each other. The value of ForeignKeyAttribute on property should be navigation name and the value of ForeignKeyAttribute on navigation should be the foreign key property name.
/// </summary>
public static string FkAttributeOnPropertyNavigationMismatch([CanBeNull] object property, [CanBeNull] object navigation, [CanBeNull] object entityType)
=> string.Format(
GetString("FkAttributeOnPropertyNavigationMismatch", nameof(property), nameof(navigation), nameof(entityType)),
property, navigation, entityType);
/// <summary>
/// The property list specified using ForeignKeyAttribute on navigation '{navigation}' in entity type '{entityType}' is incorrect. The attribute value should be comma-separated list of property names.
/// </summary>
public static string InvalidPropertyListOnNavigation([CanBeNull] object navigation, [CanBeNull] object entityType)
=> string.Format(
GetString("InvalidPropertyListOnNavigation", nameof(navigation), nameof(entityType)),
navigation, entityType);
/// <summary>
/// Invalid relationship has been specified using InversePropertyAttribute and ForeignKeyAttribute. The navigation '{navigation}' in entity type '{entityType}' and the navigation '{referencedNavigation}' in entity type '{referencedEntityType}' are related by InversePropertyAttribute but the ForeignKeyAttribute specified for both navigations have different values.
/// </summary>
public static string InvalidRelationshipUsingDataAnnotations([CanBeNull] object navigation, [CanBeNull] object entityType, [CanBeNull] object referencedNavigation, [CanBeNull] object referencedEntityType)
=> string.Format(
GetString("InvalidRelationshipUsingDataAnnotations", nameof(navigation), nameof(entityType), nameof(referencedNavigation), nameof(referencedEntityType)),
navigation, entityType, referencedNavigation, referencedEntityType);
/// <summary>
/// The property or navigation '{member}' cannot be added to the entity type '{entityType}' because a property or navigation with the same name already exists on entity type '{conflictingEntityType}'.
/// </summary>
public static string ConflictingPropertyOrNavigation([CanBeNull] object member, [CanBeNull] object entityType, [CanBeNull] object conflictingEntityType)
=> string.Format(
GetString("ConflictingPropertyOrNavigation", nameof(member), nameof(entityType), nameof(conflictingEntityType)),
member, entityType, conflictingEntityType);
/// <summary>
/// The specified entity type '{entityType}' is invalid. It should be either the dependent entity type '{dependentType}' or the principal entity type '{principalType}'.
/// </summary>
public static string EntityTypeNotInRelationshipStrict([CanBeNull] object entityType, [CanBeNull] object dependentType, [CanBeNull] object principalType)
=> string.Format(
GetString("EntityTypeNotInRelationshipStrict", nameof(entityType), nameof(dependentType), nameof(principalType)),
entityType, dependentType, principalType);
/// <summary>
/// The entity type '{entityType}' cannot be removed because '{derivedEntityType}' is derived from it. All derived entity types must be removed or redefined before the entity type can be removed.
/// </summary>
public static string EntityTypeInUseByDerived([CanBeNull] object entityType, [CanBeNull] object derivedEntityType)
=> string.Format(
GetString("EntityTypeInUseByDerived", nameof(entityType), nameof(derivedEntityType)),
entityType, derivedEntityType);
/// <summary>
/// Unable to determine the relationship represented by navigation property '{entityType}.{navigation}' of type '{propertyType}'. Either manually configure the relationship, or ignore this property using the '[NotMapped]' attribute or by using 'EntityTypeBuilder.Ignore' in 'OnModelCreating'.
/// </summary>
public static string NavigationNotAdded([CanBeNull] object entityType, [CanBeNull] object navigation, [CanBeNull] object propertyType)
=> string.Format(
GetString("NavigationNotAdded", nameof(entityType), nameof(navigation), nameof(propertyType)),
entityType, navigation, propertyType);
/// <summary>
/// The property '{entityType}.{property}' could not be mapped, because it is of type '{propertyType}' which is not a supported primitive type or a valid entity type. Either explicitly map this property, or ignore it using the '[NotMapped]' attribute or by using 'EntityTypeBuilder.Ignore' in 'OnModelCreating'.
/// </summary>
public static string PropertyNotAdded([CanBeNull] object entityType, [CanBeNull] object property, [CanBeNull] object propertyType)
=> string.Format(
GetString("PropertyNotAdded", nameof(entityType), nameof(property), nameof(propertyType)),
entityType, property, propertyType);
/// <summary>
/// The property '{entityType}.{property}' is of type '{propertyType}' which is not supported by current database provider. Either change the property CLR type or ignore the property using the '[NotMapped]' attribute or by using 'EntityTypeBuilder.Ignore' in 'OnModelCreating'.
/// </summary>
public static string PropertyNotMapped([CanBeNull] object entityType, [CanBeNull] object property, [CanBeNull] object propertyType)
=> string.Format(
GetString("PropertyNotMapped", nameof(entityType), nameof(property), nameof(propertyType)),
entityType, property, propertyType);
/// <summary>
/// The property '{entityType}.{navigation}' is of an interface type ('{propertyType}'). If it is a navigation property manually configure the relationship for this property by casting it to a mapped entity type, otherwise ignore the property using the NotMappedAttribute or 'EntityTypeBuilder.Ignore' in 'OnModelCreating'.
/// </summary>
public static string InterfacePropertyNotAdded([CanBeNull] object entityType, [CanBeNull] object navigation, [CanBeNull] object propertyType)
=> string.Format(
GetString("InterfacePropertyNotAdded", nameof(entityType), nameof(navigation), nameof(propertyType)),
entityType, navigation, propertyType);
/// <summary>
/// The navigation property '{navigation}' on entity type '{entityType}' cannot be associated with foreign key {targetFk} because it was created for foreign key {actualFk}.
/// </summary>
public static string NavigationForWrongForeignKey([CanBeNull] object navigation, [CanBeNull] object entityType, [CanBeNull] object targetFk, [CanBeNull] object actualFk)
=> string.Format(
GetString("NavigationForWrongForeignKey", nameof(navigation), nameof(entityType), nameof(targetFk), nameof(actualFk)),
navigation, entityType, targetFk, actualFk);
/// <summary>
/// The entity type '{entityType}' was not found. Ensure that the entity type has been added to the model.
/// </summary>
public static string EntityTypeNotFound([CanBeNull] object entityType)
=> string.Format(
GetString("EntityTypeNotFound", nameof(entityType)),
entityType);
/// <summary>
/// The extension method '{method}' is being used with a custom implementation of '{interfaceType}'. Use of custom implementations of the Entity Framework metadata interfaces is not supported. Consider deriving from '{concreteType}' instead. Please contact the Entity Framework team if you have a compelling case for a custom implementation of the metadata interfaces so that we can consider ways to achieve this.
/// </summary>
public static string CustomMetadata([CanBeNull] object method, [CanBeNull] object interfaceType, [CanBeNull] object concreteType)
=> string.Format(
GetString("CustomMetadata", nameof(method), nameof(interfaceType), nameof(concreteType)),
method, interfaceType, concreteType);
/// <summary>
/// Unhandled operation: MemberInitExpression binding is not a MemberAssignment
/// </summary>
public static string InvalidMemberInitBinding
=> GetString("InvalidMemberInitBinding");
/// <summary>
/// Unable to track an entity of type '{entityType}' because primary key property '{keyProperty}' is null.
/// </summary>
public static string InvalidKeyValue([CanBeNull] object entityType, [CanBeNull] object keyProperty)
=> string.Format(
GetString("InvalidKeyValue", nameof(entityType), nameof(keyProperty)),
entityType, keyProperty);
/// <summary>
/// Unable to track an entity of type '{entityType}' because alternate key property '{keyProperty}' is null. If the alternate key is not used in a relationship, then consider using a unique index instead. Unique indexes may contain nulls, while alternate keys must not.
/// </summary>
public static string InvalidAlternateKeyValue([CanBeNull] object entityType, [CanBeNull] object keyProperty)
=> string.Format(
GetString("InvalidAlternateKeyValue", nameof(entityType), nameof(keyProperty)),
entityType, keyProperty);
/// <summary>
/// An exception was thrown while attempting to evaluate the LINQ query parameter expression '{expression}'.
/// </summary>
public static string ExpressionParameterizationExceptionSensitive([CanBeNull] object expression)
=> string.Format(
GetString("ExpressionParameterizationExceptionSensitive", nameof(expression)),
expression);
/// <summary>
/// There are multiple navigations in entity type '{entityType}' which are pointing to same set of properties - '{propertyList}' using ForeignKeyAttribute.
/// </summary>
public static string MultipleNavigationsSameFk([CanBeNull] object entityType, [CanBeNull] object propertyList)
=> string.Format(
GetString("MultipleNavigationsSameFk", nameof(entityType), nameof(propertyList)),
entityType, propertyList);
/// <summary>
/// The entity type '{entityType}' should derive from '{baseEntityType}' to reflect the hierarchy of the corresponding CLR types.
/// </summary>
public static string InconsistentInheritance([CanBeNull] object entityType, [CanBeNull] object baseEntityType)
=> string.Format(
GetString("InconsistentInheritance", nameof(entityType), nameof(baseEntityType)),
entityType, baseEntityType);
/// <summary>
/// You are configuring a relationship between '{dependentEntityType}' and '{principalEntityType}' but have specified a foreign key on '{entityType}'. The foreign key must be defined on a type that is part of the relationship.
/// </summary>
public static string DependentEntityTypeNotInRelationship([CanBeNull] object dependentEntityType, [CanBeNull] object principalEntityType, [CanBeNull] object entityType)
=> string.Format(
GetString("DependentEntityTypeNotInRelationship", nameof(dependentEntityType), nameof(principalEntityType), nameof(entityType)),
dependentEntityType, principalEntityType, entityType);
/// <summary>
/// You are configuring a relationship between '{dependentEntityType}' and '{principalEntityType}' but have specified a foreign key targeting '{entityType}'. The foreign key must be targeting a type that is part of the relationship.
/// </summary>
public static string PrincipalEntityTypeNotInRelationship([CanBeNull] object dependentEntityType, [CanBeNull] object principalEntityType, [CanBeNull] object entityType)
=> string.Format(
GetString("PrincipalEntityTypeNotInRelationship", nameof(dependentEntityType), nameof(principalEntityType), nameof(entityType)),
dependentEntityType, principalEntityType, entityType);
/// <summary>
/// The property '{property}' cannot be part of a foreign key on '{entityType}' because it has value generation enabled and is contained in the key {key} defined on a base entity type '{baseEntityType}'.
/// </summary>
public static string ForeignKeyPropertyInKey([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object key, [CanBeNull] object baseEntityType)
=> string.Format(
GetString("ForeignKeyPropertyInKey", nameof(property), nameof(entityType), nameof(key), nameof(baseEntityType)),
property, entityType, key, baseEntityType);
/// <summary>
/// The property '{property}' cannot be part of a key on '{entityType}' because it has value generation enabled and is contained in a foreign key defined on a derived entity type.
/// </summary>
public static string KeyPropertyInForeignKey([CanBeNull] object property, [CanBeNull] object entityType)
=> string.Format(
GetString("KeyPropertyInForeignKey", nameof(property), nameof(entityType)),
property, entityType);
/// <summary>
/// A key on entity type '{entityType}' cannot contain the property '{property}' because it is nullable/optional. All properties on which a key is declared must be marked as non-nullable/required.
/// </summary>
public static string NullableKey([CanBeNull] object entityType, [CanBeNull] object property)
=> string.Format(
GetString("NullableKey", nameof(entityType), nameof(property)),
entityType, property);
/// <summary>
/// A second operation started on this context before a previous operation completed. This is usually caused by different threads using the same instance of DbContext. For more information on how to avoid threading issues with DbContext, see https://go.microsoft.com/fwlink/?linkid=2097913.
/// </summary>
public static string ConcurrentMethodInvocation
=> GetString("ConcurrentMethodInvocation");
/// <summary>
/// The specified entity types '{invalidDependentType}' and '{invalidPrincipalType}' are invalid. They should be '{dependentType}' and '{principalType}' or entity types in the same hierarchy.
/// </summary>
public static string EntityTypesNotInRelationship([CanBeNull] object invalidDependentType, [CanBeNull] object invalidPrincipalType, [CanBeNull] object dependentType, [CanBeNull] object principalType)
=> string.Format(
GetString("EntityTypesNotInRelationship", nameof(invalidDependentType), nameof(invalidPrincipalType), nameof(dependentType), nameof(principalType)),
invalidDependentType, invalidPrincipalType, dependentType, principalType);
/// <summary>
/// Cannot create a DbSet for '{typeName}' because this type is not included in the model for the context.
/// </summary>
public static string InvalidSetType([CanBeNull] object typeName)
=> string.Format(
GetString("InvalidSetType", nameof(typeName)),
typeName);
/// <summary>
/// The child/dependent side could not be determined for the one-to-one relationship between '{dependentToPrincipalNavigationSpecification}' and '{principalToDependentNavigationSpecification}'. To identify the child/dependent side of the relationship, configure the foreign key property. If these navigations should not be part of the same relationship configure them without specifying the inverse. See http://go.microsoft.com/fwlink/?LinkId=724062 for more details.
/// </summary>
public static string AmbiguousOneToOneRelationship([CanBeNull] object dependentToPrincipalNavigationSpecification, [CanBeNull] object principalToDependentNavigationSpecification)
=> string.Format(
GetString("AmbiguousOneToOneRelationship", nameof(dependentToPrincipalNavigationSpecification), nameof(principalToDependentNavigationSpecification)),
dependentToPrincipalNavigationSpecification, principalToDependentNavigationSpecification);
/// <summary>
/// Both relationships between '{firstDependentToPrincipalNavigationSpecification}' and '{firstPrincipalToDependentNavigationSpecification}' and between '{secondDependentToPrincipalNavigationSpecification}' and '{secondPrincipalToDependentNavigationSpecification}' could use {foreignKeyProperties} as the foreign key. To resolve this configure the foreign key properties explicitly on at least one of the relationships.
/// </summary>
public static string AmbiguousForeignKeyPropertyCandidates([CanBeNull] object firstDependentToPrincipalNavigationSpecification, [CanBeNull] object firstPrincipalToDependentNavigationSpecification, [CanBeNull] object secondDependentToPrincipalNavigationSpecification, [CanBeNull] object secondPrincipalToDependentNavigationSpecification, [CanBeNull] object foreignKeyProperties)
=> string.Format(
GetString("AmbiguousForeignKeyPropertyCandidates", nameof(firstDependentToPrincipalNavigationSpecification), nameof(firstPrincipalToDependentNavigationSpecification), nameof(secondDependentToPrincipalNavigationSpecification), nameof(secondPrincipalToDependentNavigationSpecification), nameof(foreignKeyProperties)),
firstDependentToPrincipalNavigationSpecification, firstPrincipalToDependentNavigationSpecification, secondDependentToPrincipalNavigationSpecification, secondPrincipalToDependentNavigationSpecification, foreignKeyProperties);
/// <summary>
/// The expression '{expression}' is invalid inside Include operation. The expression should represent a property access: 't => t.MyProperty'. To target navigations declared on derived types use cast, e.g. 't => ((Derived)t).MyProperty' or 'as' operator, e.g. 't => (t as Derived).MyProperty'. Collection navigation access can be filtered by composing Where, OrderBy(Descending), ThenBy(Descending), Skip or Take operations. For more information on including related data, see http://go.microsoft.com/fwlink/?LinkID=746393.
/// </summary>
public static string InvalidIncludeExpression([CanBeNull] object expression)
=> string.Format(
GetString("InvalidIncludeExpression", nameof(expression)),
expression);
/// <summary>
/// The corresponding CLR type for entity type '{entityType}' is not instantiable and there is no derived entity type in the model that corresponds to a concrete CLR type.
/// </summary>
public static string AbstractLeafEntityType([CanBeNull] object entityType)
=> string.Format(
GetString("AbstractLeafEntityType", nameof(entityType)),
entityType);
/// <summary>
/// The property '{property}' cannot be added to the type '{entityType}' because there was no property type specified and there is no corresponding CLR property or field. To add a shadow state property the property type must be specified.
/// </summary>
public static string NoPropertyType([CanBeNull] object property, [CanBeNull] object entityType)
=> string.Format(
GetString("NoPropertyType", nameof(property), nameof(entityType)),
property, entityType);
/// <summary>
/// The property '{property}' on entity type '{entityType}' cannot be assigned a temporary value. Temporary values can only be assigned to properties configured to use store-generated values.
/// </summary>
public static string TempValue([CanBeNull] object property, [CanBeNull] object entityType)
=> string.Format(
GetString("TempValue", nameof(property), nameof(entityType)),
property, entityType);
/// <summary>
/// The property '{property}' on entity type '{entityType}' cannot be assigned a value generated by the database. Store-generated values can only be assigned to properties configured to use store-generated values.
/// </summary>
public static string StoreGenValue([CanBeNull] object property, [CanBeNull] object entityType)
=> string.Format(
GetString("StoreGenValue", nameof(property), nameof(entityType)),
property, entityType);
/// <summary>
/// A parameterless constructor was not found on entity type '{entityType}'. In order to create an instance of '{entityType}' EF requires that a parameterless constructor be declared.
/// </summary>
public static string NoParameterlessConstructor([CanBeNull] object entityType)
=> string.Format(
GetString("NoParameterlessConstructor", nameof(entityType)),
entityType);
/// <summary>
/// Cannot create a relationship between '{newPrincipalNavigationSpecification}' and '{newDependentNavigationSpecification}', because there already is a relationship between '{existingPrincipalNavigationSpecification}' and '{existingDependentNavigationSpecification}'. Navigation properties can only participate in a single relationship. If you want to override an existing relationship call Ignore on the navigation first.
/// </summary>
public static string ConflictingRelationshipNavigation([CanBeNull] object newPrincipalNavigationSpecification, [CanBeNull] object newDependentNavigationSpecification, [CanBeNull] object existingPrincipalNavigationSpecification, [CanBeNull] object existingDependentNavigationSpecification)
=> string.Format(
GetString("ConflictingRelationshipNavigation", nameof(newPrincipalNavigationSpecification), nameof(newDependentNavigationSpecification), nameof(existingPrincipalNavigationSpecification), nameof(existingDependentNavigationSpecification)),
newPrincipalNavigationSpecification, newDependentNavigationSpecification, existingPrincipalNavigationSpecification, existingDependentNavigationSpecification);
/// <summary>
/// Error generated for warning '{eventName}': {message} This exception can be suppressed or logged by passing event ID '{eventId}' to the 'ConfigureWarnings' method in 'DbContext.OnConfiguring' or 'AddDbContext'.
/// </summary>
public static string WarningAsErrorTemplate([CanBeNull] object eventName, [CanBeNull] object message, [CanBeNull] object eventId)
=> string.Format(
GetString("WarningAsErrorTemplate", nameof(eventName), nameof(message), nameof(eventId)),
eventName, message, eventId);
/// <summary>
/// Cannot access a disposed object. A common cause of this error is disposing a context that was resolved from dependency injection and then later trying to use the same context instance elsewhere in your application. This may occur if you are calling Dispose() on the context, or wrapping the context in a using statement. If you are using dependency injection, you should let the dependency injection container take care of disposing context instances.
/// </summary>
public static string ContextDisposed
=> GetString("ContextDisposed");
/// <summary>
/// Unable to resolve service for type '{service}'. This is often because no database provider has been configured for this DbContext. A provider can be configured by overriding the DbContext.OnConfiguring method or by using AddDbContext on the application service provider. If AddDbContext is used, then also ensure that your DbContext type accepts a DbContextOptions<TContext> object in its constructor and passes it to the base constructor for DbContext.
/// </summary>
public static string NoProviderConfiguredFailedToResolveService([CanBeNull] object service)
=> string.Format(
GetString("NoProviderConfiguredFailedToResolveService", nameof(service)),
service);
/// <summary>
/// An exception occurred while reading a database value for property '{entityType}.{property}'. See the inner exception for more information.
/// </summary>
public static string ErrorMaterializingProperty([CanBeNull] object entityType, [CanBeNull] object property)
=> string.Format(
GetString("ErrorMaterializingProperty", nameof(entityType), nameof(property)),
entityType, property);
/// <summary>
/// An exception occurred while reading a database value for property '{entityType}.{property}'. The expected type was '{expectedType}' but the actual value was of type '{actualType}'.
/// </summary>
public static string ErrorMaterializingPropertyInvalidCast([CanBeNull] object entityType, [CanBeNull] object property, [CanBeNull] object expectedType, [CanBeNull] object actualType)
=> string.Format(
GetString("ErrorMaterializingPropertyInvalidCast", nameof(entityType), nameof(property), nameof(expectedType), nameof(actualType)),
entityType, property, expectedType, actualType);
/// <summary>
/// An exception occurred while reading a database value for property '{entityType}.{property}'. The expected type was '{expectedType}' but the actual value was null.
/// </summary>
public static string ErrorMaterializingPropertyNullReference([CanBeNull] object entityType, [CanBeNull] object property, [CanBeNull] object expectedType)
=> string.Format(
GetString("ErrorMaterializingPropertyNullReference", nameof(entityType), nameof(property), nameof(expectedType)),
entityType, property, expectedType);
/// <summary>
/// An exception occurred while reading a database value. See the inner exception for more information.
/// </summary>
public static string ErrorMaterializingValue
=> GetString("ErrorMaterializingValue");
/// <summary>
/// An exception occurred while reading a database value. The expected type was '{expectedType}' but the actual value was of type '{actualType}'.
/// </summary>
public static string ErrorMaterializingValueInvalidCast([CanBeNull] object expectedType, [CanBeNull] object actualType)
=> string.Format(
GetString("ErrorMaterializingValueInvalidCast", nameof(expectedType), nameof(actualType)),
expectedType, actualType);
/// <summary>
/// An exception occurred while reading a database value. The expected type was '{expectedType}' but the actual value was null.
/// </summary>
public static string ErrorMaterializingValueNullReference([CanBeNull] object expectedType)
=> string.Format(
GetString("ErrorMaterializingValueNullReference", nameof(expectedType)),
expectedType);
/// <summary>
/// The property '{property}' cannot be ignored on entity type '{entityType}', because it's declared on the base entity type '{baseEntityType}'. To exclude this property from your model, use NotMappedAttribute or Ignore method on the base type.
/// </summary>
public static string InheritedPropertyCannotBeIgnored([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object baseEntityType)
=> string.Format(
GetString("InheritedPropertyCannotBeIgnored", nameof(property), nameof(entityType), nameof(baseEntityType)),
property, entityType, baseEntityType);
/// <summary>
/// Maximum number of retries ({retryLimit}) exceeded while executing database operations with '{strategy}'. See inner exception for the most recent failure.
/// </summary>
public static string RetryLimitExceeded([CanBeNull] object retryLimit, [CanBeNull] object strategy)
=> string.Format(
GetString("RetryLimitExceeded", nameof(retryLimit), nameof(strategy)),
retryLimit, strategy);
/// <summary>
/// The configured execution strategy '{strategy}' does not support user initiated transactions. Use the execution strategy returned by '{getExecutionStrategyMethod}' to execute all the operations in the transaction as a retriable unit.
/// </summary>
public static string ExecutionStrategyExistingTransaction([CanBeNull] object strategy, [CanBeNull] object getExecutionStrategyMethod)
=> string.Format(
GetString("ExecutionStrategyExistingTransaction", nameof(strategy), nameof(getExecutionStrategyMethod)),
strategy, getExecutionStrategyMethod);
/// <summary>
/// '{property}' cannot be used as a property on entity type '{entityType}' because it is configured as a navigation.
/// </summary>
public static string PropertyCalledOnNavigation([CanBeNull] object property, [CanBeNull] object entityType)
=> string.Format(
GetString("PropertyCalledOnNavigation", nameof(property), nameof(entityType)),
property, entityType);
/// <summary>
/// The property '{property}' cannot be removed from entity type '{entityType}' because it is being used in the foreign key {foreignKey} on '{foreignKeyType}'. All containing foreign keys must be removed or redefined before the property can be removed.
/// </summary>
public static string PropertyInUseForeignKey([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object foreignKey, [CanBeNull] object foreignKeyType)
=> string.Format(
GetString("PropertyInUseForeignKey", nameof(property), nameof(entityType), nameof(foreignKey), nameof(foreignKeyType)),
property, entityType, foreignKey, foreignKeyType);
/// <summary>
/// The property '{property}' cannot be removed from entity type '{entityType}' because it is being used in the index {index} on '{indexType}'. All containing indexes must be removed or redefined before the property can be removed.
/// </summary>
public static string PropertyInUseIndex([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object index, [CanBeNull] object indexType)
=> string.Format(
GetString("PropertyInUseIndex", nameof(property), nameof(entityType), nameof(index), nameof(indexType)),
property, entityType, index, indexType);
/// <summary>
/// The specified poolSize must be greater than 0.
/// </summary>
public static string InvalidPoolSize
=> GetString("InvalidPoolSize");
/// <summary>
/// The DbContext of type '{contextType}' cannot be pooled because it does not have a single public constructor accepting a single parameter of type DbContextOptions.
/// </summary>
public static string PoolingContextCtorError([CanBeNull] object contextType)
=> string.Format(
GetString("PoolingContextCtorError", nameof(contextType)),
contextType);
/// <summary>
/// OnConfiguring cannot be used to modify DbContextOptions when DbContext pooling is enabled.
/// </summary>
public static string PoolingOptionsModified
=> GetString("PoolingOptionsModified");
/// <summary>
/// The foreign keys on entity type '{dependentType}' cannot target the same entity type because it is a weak entity type.
/// </summary>
public static string ForeignKeySelfReferencingDependentEntityType([CanBeNull] object dependentType)
=> string.Format(
GetString("ForeignKeySelfReferencingDependentEntityType", nameof(dependentType)),
dependentType);
/// <summary>
/// The entity type '{entityType}' cannot be removed because it is being referenced by the skip navigation '{skipNavigation}' on '{referencingEntityType}'. All referencing skip navigations must be removed before the entity type can be removed.
/// </summary>
public static string EntityTypeInUseByReferencingSkipNavigation([CanBeNull] object entityType, [CanBeNull] object skipNavigation, [CanBeNull] object referencingEntityType)
=> string.Format(
GetString("EntityTypeInUseByReferencingSkipNavigation", nameof(entityType), nameof(skipNavigation), nameof(referencingEntityType)),
entityType, skipNavigation, referencingEntityType);
/// <summary>
/// The entity type '{entityType}' cannot be added to the model because a weak entity type with the same name already exists.
/// </summary>
public static string ClashingWeakEntityType([CanBeNull] object entityType)
=> string.Format(
GetString("ClashingWeakEntityType", nameof(entityType)),
entityType);
/// <summary>
/// The weak entity type '{entityType}' cannot be added to the model because an entity type with the same name already exists.
/// </summary>
public static string ClashingNonWeakEntityType([CanBeNull] object entityType)
=> string.Format(
GetString("ClashingNonWeakEntityType", nameof(entityType)),
entityType);
/// <summary>
/// The type '{entityType}' cannot have weak entity type '{baseType}' as the base type.
/// </summary>
public static string WeakBaseType([CanBeNull] object entityType, [CanBeNull] object baseType)
=> string.Format(
GetString("WeakBaseType", nameof(entityType), nameof(baseType)),
entityType, baseType);
/// <summary>
/// The weak entity type '{entityType}' cannot have a base type.
/// </summary>
public static string WeakDerivedType([CanBeNull] object entityType)
=> string.Format(
GetString("WeakDerivedType", nameof(entityType)),
entityType);
/// <summary>
/// The property list {propertyList} cannot be used, because it contains a duplicate - '{property}'.
/// </summary>
public static string DuplicatePropertyInList([CanBeNull] object propertyList, [CanBeNull] object property)
=> string.Format(
GetString("DuplicatePropertyInList", nameof(propertyList), nameof(property)),
propertyList, property);
/// <summary>
/// The convention invocations have reached the recursion limit. This is likely an issue in EF Core, please report it.
/// </summary>
public static string ConventionsInfiniteLoop
=> GetString("ConventionsInfiniteLoop");
/// <summary>
/// The navigation '{navigation}' used to define the entity type '{entityType}' is not present on '{definingEntityType}'.
/// </summary>
public static string NoDefiningNavigation([CanBeNull] object navigation, [CanBeNull] object entityType, [CanBeNull] object definingEntityType)
=> string.Format(
GetString("NoDefiningNavigation", nameof(navigation), nameof(entityType), nameof(definingEntityType)),
navigation, entityType, definingEntityType);
/// <summary>
/// The entity type '{entityType}' is the target of multiple ownership relationships.
/// </summary>
public static string MultipleOwnerships([CanBeNull] object entityType)
=> string.Format(
GetString("MultipleOwnerships", nameof(entityType)),
entityType);
/// <summary>
/// The ownership by '{ownershipNavigation}' should use defining navigation '{definingNavigation}' for the owned type '{entityType}'
/// </summary>
public static string NonDefiningOwnership([CanBeNull] object ownershipNavigation, [CanBeNull] object definingNavigation, [CanBeNull] object entityType)
=> string.Format(
GetString("NonDefiningOwnership", nameof(ownershipNavigation), nameof(definingNavigation), nameof(entityType)),
ownershipNavigation, definingNavigation, entityType);
/// <summary>
/// The entity type '{ownedEntityType}' is configured as owned, but the entity type '{nonOwnedEntityType}' is not. All entity types sharing a CLR type must be configured as owned.
/// </summary>
public static string InconsistentOwnership([CanBeNull] object ownedEntityType, [CanBeNull] object nonOwnedEntityType)
=> string.Format(
GetString("InconsistentOwnership", nameof(ownedEntityType), nameof(nonOwnedEntityType)),
ownedEntityType, nonOwnedEntityType);
/// <summary>
/// The navigation '{principalEntityType}.{navigation}' is not supported because it is pointing to an owned entity type '{ownedType}'. Only the ownership navigation from the entity type '{ownerType}' can point to the owned entity type.
/// </summary>
public static string InverseToOwnedType([CanBeNull] object principalEntityType, [CanBeNull] object navigation, [CanBeNull] object ownedType, [CanBeNull] object ownerType)
=> string.Format(
GetString("InverseToOwnedType", nameof(principalEntityType), nameof(navigation), nameof(ownedType), nameof(ownerType)),
principalEntityType, navigation, ownedType, ownerType);
/// <summary>
/// The relationship from '{referencingEntityTypeOrNavigation}' to '{referencedEntityTypeOrNavigation}' is not supported because the owned entity type '{ownedType}' cannot be on the principal side of a non-ownership relationship.
/// </summary>
public static string PrincipalOwnedType([CanBeNull] object referencingEntityTypeOrNavigation, [CanBeNull] object referencedEntityTypeOrNavigation, [CanBeNull] object ownedType)
=> string.Format(
GetString("PrincipalOwnedType", nameof(referencingEntityTypeOrNavigation), nameof(referencedEntityTypeOrNavigation), nameof(ownedType)),
referencingEntityTypeOrNavigation, referencedEntityTypeOrNavigation, ownedType);
/// <summary>
/// The entity type '{entityType}' has a defining navigation and the supplied entity is currently referenced from several owner entities. To access the entry for a particular reference call '{targetEntryCall}' on the owner entry.
/// </summary>
public static string AmbiguousDependentEntity([CanBeNull] object entityType, [CanBeNull] object targetEntryCall)
=> string.Format(
GetString("AmbiguousDependentEntity", nameof(entityType), nameof(targetEntryCall)),
entityType, targetEntryCall);
/// <summary>
/// The entity type '{entityType}' has a defining navigation and the supplied entity is currently not being tracked. To start tracking this entity call '{referenceCall}' or '{collectionCall}' on the owner entry.
/// </summary>
public static string UntrackedDependentEntity([CanBeNull] object entityType, [CanBeNull] object referenceCall, [CanBeNull] object collectionCall)
=> string.Format(
GetString("UntrackedDependentEntity", nameof(entityType), nameof(referenceCall), nameof(collectionCall)),
entityType, referenceCall, collectionCall);
/// <summary>
/// The filter expression '{filter}' specified for entity type '{entityType}' is invalid. The expression must accept a single parameter of type '{clrType}', return bool, and may not contain references to navigation properties.
/// </summary>
public static string BadFilterExpression([CanBeNull] object filter, [CanBeNull] object entityType, [CanBeNull] object clrType)
=> string.Format(
GetString("BadFilterExpression", nameof(filter), nameof(entityType), nameof(clrType)),
filter, entityType, clrType);
/// <summary>
/// The filter expression '{filter}' cannot be specified for entity type '{entityType}'. A filter may only be applied to the root entity type in a hierarchy.
/// </summary>
public static string BadFilterDerivedType([CanBeNull] object filter, [CanBeNull] object entityType)
=> string.Format(
GetString("BadFilterDerivedType", nameof(filter), nameof(entityType)),
filter, entityType);
/// <summary>
/// The filter expression '{filter}' cannot be specified for entity type '{entityType}'. A filter may only be applied to the entity that is not owned.
/// </summary>
public static string BadFilterOwnedType([CanBeNull] object filter, [CanBeNull] object entityType)
=> string.Format(
GetString("BadFilterOwnedType", nameof(filter), nameof(entityType)),
filter, entityType);
/// <summary>
/// Converter for model type '{converterType}' cannot be used for '{entityType}.{propertyName}' because its type is '{propertyType}'.
/// </summary>
public static string ConverterPropertyMismatch([CanBeNull] object converterType, [CanBeNull] object entityType, [CanBeNull] object propertyName, [CanBeNull] object propertyType)
=> string.Format(
GetString("ConverterPropertyMismatch", nameof(converterType), nameof(entityType), nameof(propertyName), nameof(propertyType)),
converterType, entityType, propertyName, propertyType);
/// <summary>
/// Comparer for type '{type}' cannot be used for '{entityType}.{propertyName}' because its type is '{propertyType}'.
/// </summary>
public static string ComparerPropertyMismatch([CanBeNull] object type, [CanBeNull] object entityType, [CanBeNull] object propertyName, [CanBeNull] object propertyType)
=> string.Format(
GetString("ComparerPropertyMismatch", nameof(type), nameof(entityType), nameof(propertyName), nameof(propertyType)),
type, entityType, propertyName, propertyType);
/// <summary>
/// Property '{entityType}.{property}' cannot be used as a key because it has type '{providerType}' which does not implement 'IComparable<T>', 'IComparable' or 'IStructuralComparable'. Use 'HasConversion()' in 'OnModelCreating()' to wrap '{providerType}' with a type that can be compared.
/// </summary>
public static string NonComparableKeyType([CanBeNull] object entityType, [CanBeNull] object property, [CanBeNull] object providerType)
=> string.Format(
GetString("NonComparableKeyType", nameof(entityType), nameof(property), nameof(providerType)),
entityType, property, providerType);
/// <summary>
/// Property '{entityType}.{property}' cannot be used as a key because it has type '{modelType}' and provider type '{providerType}' neither of which implement 'IComparable<T>', 'IComparable' or 'IStructuralComparable'. Make '{modelType}' implement one of these interfaces to use it as a key.
/// </summary>
public static string NonComparableKeyTypes([CanBeNull] object entityType, [CanBeNull] object property, [CanBeNull] object modelType, [CanBeNull] object providerType)
=> string.Format(
GetString("NonComparableKeyTypes", nameof(entityType), nameof(property), nameof(modelType), nameof(providerType)),
entityType, property, modelType, providerType);
/// <summary>
/// The instance of entity type '{entityType}' cannot be tracked because another instance with the same key value for {keyProperties} is already being tracked. When replacing owned entities modify the properties without changing the instance or detach the previous owned entity entry first. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the conflicting key values.
/// </summary>
public static string IdentityConflictOwned([CanBeNull] object entityType, [CanBeNull] object keyProperties)
=> string.Format(
GetString("IdentityConflictOwned", nameof(entityType), nameof(keyProperties)),
entityType, keyProperties);
/// <summary>
/// The instance of entity type '{entityType}' cannot be tracked because another instance with the key value '{keyValue}' is already being tracked. When replacing owned entities modify the properties without changing the instance or detach the previous owned entity entry first.
/// </summary>
public static string IdentityConflictOwnedSensitive([CanBeNull] object entityType, [CanBeNull] object keyValue)
=> string.Format(
GetString("IdentityConflictOwnedSensitive", nameof(entityType), nameof(keyValue)),
entityType, keyValue);
/// <summary>
/// Cannot compose converter from '{typeOneIn}' to '{typeOneOut}' with converter from '{typeTwoIn}' to '{typeTwoOut}' because the output type of the first converter is different from the input type of the second converter.
/// </summary>
public static string ConvertersCannotBeComposed([CanBeNull] object typeOneIn, [CanBeNull] object typeOneOut, [CanBeNull] object typeTwoIn, [CanBeNull] object typeTwoOut)
=> string.Format(
GetString("ConvertersCannotBeComposed", nameof(typeOneIn), nameof(typeOneOut), nameof(typeTwoIn), nameof(typeTwoOut)),
typeOneIn, typeOneOut, typeTwoIn, typeTwoOut);
/// <summary>
/// The value converter '{converter}' cannot be used with type '{type}'. This converter can only be used with {allowed}.
/// </summary>
public static string ConverterBadType([CanBeNull] object converter, [CanBeNull] object type, [CanBeNull] object allowed)
=> string.Format(
GetString("ConverterBadType", nameof(converter), nameof(type), nameof(allowed)),
converter, type, allowed);
/// <summary>
/// The seed entity for entity type '{entityType}' cannot be added because another seed entity with the same key value for {keyProperties} has already been added. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the conflicting key values.
/// </summary>
public static string SeedDatumDuplicate([CanBeNull] object entityType, [CanBeNull] object keyProperties)
=> string.Format(
GetString("SeedDatumDuplicate", nameof(entityType), nameof(keyProperties)),
entityType, keyProperties);
/// <summary>
/// The seed entity for entity type '{entityType}' cannot be added because another seed entity with the key value '{keyValue}' has already been added.
/// </summary>
public static string SeedDatumDuplicateSensitive([CanBeNull] object entityType, [CanBeNull] object keyValue)
=> string.Format(
GetString("SeedDatumDuplicateSensitive", nameof(entityType), nameof(keyValue)),
entityType, keyValue);
/// <summary>
/// The seed entity for entity type '{entityType}' cannot be added because the value provided for the property '{property}' is not of the type '{type}'. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the involved property values.
/// </summary>
public static string SeedDatumIncompatibleValue([CanBeNull] object entityType, [CanBeNull] object property, [CanBeNull] object type)
=> string.Format(
GetString("SeedDatumIncompatibleValue", nameof(entityType), nameof(property), nameof(type)),
entityType, property, type);
/// <summary>
/// The seed entity for entity type '{entityType}' cannot be added because the value '{value}' provided for the property '{property}' is not of the type '{type}'.
/// </summary>
public static string SeedDatumIncompatibleValueSensitive([CanBeNull] object entityType, [CanBeNull] object value, [CanBeNull] object property, [CanBeNull] object type)
=> string.Format(
GetString("SeedDatumIncompatibleValueSensitive", nameof(entityType), nameof(value), nameof(property), nameof(type)),
entityType, value, property, type);
/// <summary>
/// The seed entity for entity type '{entityType}' cannot be added because there was no value provided for the required property '{property}'.
/// </summary>
public static string SeedDatumMissingValue([CanBeNull] object entityType, [CanBeNull] object property)
=> string.Format(
GetString("SeedDatumMissingValue", nameof(entityType), nameof(property)),
entityType, property);
/// <summary>
/// The seed entity for entity type '{entityType}' cannot be added because a default value was provided for the required property '{property}'. Please provide a value different from '{defaultValue}'.
/// </summary>
public static string SeedDatumDefaultValue([CanBeNull] object entityType, [CanBeNull] object property, [CanBeNull] object defaultValue)
=> string.Format(
GetString("SeedDatumDefaultValue", nameof(entityType), nameof(property), nameof(defaultValue)),
entityType, property, defaultValue);
/// <summary>
/// The seed entity for entity type '{entityType}' cannot be added because a non-zero value is required for property '{property}'. Consider providing a negative value to avoid collisions with non-seed data.
/// </summary>
public static string SeedDatumSignedNumericValue([CanBeNull] object entityType, [CanBeNull] object property)
=> string.Format(
GetString("SeedDatumSignedNumericValue", nameof(entityType), nameof(property)),
entityType, property);
/// <summary>
/// The seed entity for entity type '{entityType}' cannot be added because it has the navigation '{navigation}' set. To seed relationships you need to add the related entity seed to '{relatedEntityType}' and specify the foreign key values {foreignKeyProperties}. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the involved property values.
/// </summary>
public static string SeedDatumNavigation([CanBeNull] object entityType, [CanBeNull] object navigation, [CanBeNull] object relatedEntityType, [CanBeNull] object foreignKeyProperties)
=> string.Format(
GetString("SeedDatumNavigation", nameof(entityType), nameof(navigation), nameof(relatedEntityType), nameof(foreignKeyProperties)),
entityType, navigation, relatedEntityType, foreignKeyProperties);
/// <summary>
/// The seed entity for entity type '{entityType}' with the key value '{keyValue}' cannot be added because it has the navigation '{navigation}' set. To seed relationships you need to add the related entity seed to '{relatedEntityType}' and specify the foreign key values {foreignKeyProperties}.
/// </summary>
public static string SeedDatumNavigationSensitive([CanBeNull] object entityType, [CanBeNull] object keyValue, [CanBeNull] object navigation, [CanBeNull] object relatedEntityType, [CanBeNull] object foreignKeyProperties)
=> string.Format(
GetString("SeedDatumNavigationSensitive", nameof(entityType), nameof(keyValue), nameof(navigation), nameof(relatedEntityType), nameof(foreignKeyProperties)),
entityType, keyValue, navigation, relatedEntityType, foreignKeyProperties);
/// <summary>
/// The seed entity for entity type '{entityType}' cannot be added because the value provided is of a derived type '{derivedType}'. Add the derived seed entities to the corresponding entity type.
/// </summary>
public static string SeedDatumDerivedType([CanBeNull] object entityType, [CanBeNull] object derivedType)
=> string.Format(
GetString("SeedDatumDerivedType", nameof(entityType), nameof(derivedType)),
entityType, derivedType);
/// <summary>
/// No suitable constructor found for entity type '{entityType}'. The following constructors had parameters that could not be bound to properties of the entity type: {constructors}.
/// </summary>
public static string ConstructorNotFound([CanBeNull] object entityType, [CanBeNull] object constructors)
=> string.Format(
GetString("ConstructorNotFound", nameof(entityType), nameof(constructors)),
entityType, constructors);
/// <summary>
/// Two constructors were found with the same number of parameters that could both be used by Entity Framework. The constructor to use must be configured explicitly. The two constructors are '{firstConstructor}' and '{secondConstructor}'.
/// </summary>
public static string ConstructorConflict([CanBeNull] object firstConstructor, [CanBeNull] object secondConstructor)
=> string.Format(
GetString("ConstructorConflict", nameof(firstConstructor), nameof(secondConstructor)),
firstConstructor, secondConstructor);
/// <summary>
/// The type '{entityType}' cannot be marked as owned because a non-owned entity type with the same name already exists.
/// </summary>
public static string ClashingNonOwnedEntityType([CanBeNull] object entityType)
=> string.Format(
GetString("ClashingNonOwnedEntityType", nameof(entityType)),
entityType);
/// <summary>
/// Current provider doesn't support System.Transaction.
/// </summary>
public static string TransactionsNotSupported
=> GetString("TransactionsNotSupported");
/// <summary>
/// Unable to track an instance of type '{type}' because it does not have a primary key. Only entity types with primary keys may be tracked.
/// </summary>
public static string KeylessTypeTracked([CanBeNull] object type)
=> string.Format(
GetString("KeylessTypeTracked", nameof(type)),
type);
/// <summary>
/// The owned entity type '{entityType}' cannot have a base type.
/// </summary>
public static string OwnedDerivedType([CanBeNull] object entityType)
=> string.Format(
GetString("OwnedDerivedType", nameof(entityType)),
entityType);
/// <summary>
/// Cannot create a DbSet for '{typeName}' because it is mapped to multiple entity types and should be accessed through the defining entities.
/// </summary>
public static string InvalidSetTypeWeak([CanBeNull] object typeName)
=> string.Format(
GetString("InvalidSetTypeWeak", nameof(typeName)),
typeName);
/// <summary>
/// The property '{property}' is marked as null on entity '{entityType}' with the key value '{keyValue}', but this cannot be saved because the property is marked as required.
/// </summary>
public static string PropertyConceptualNullSensitive([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object keyValue)
=> string.Format(
GetString("PropertyConceptualNullSensitive", nameof(property), nameof(entityType), nameof(keyValue)),
property, entityType, keyValue);
/// <summary>
/// The association between entities '{firstType}' and '{secondType}' with the key value '{secondKeyValue}' has been severed but the relationship is either marked as 'Required' or is implicitly required because the foreign key is not nullable. If the dependent/child entity should be deleted when a required relationship is severed, then setup the relationship to use cascade deletes.
/// </summary>
public static string RelationshipConceptualNullSensitive([CanBeNull] object firstType, [CanBeNull] object secondType, [CanBeNull] object secondKeyValue)
=> string.Format(
GetString("RelationshipConceptualNullSensitive", nameof(firstType), nameof(secondType), nameof(secondKeyValue)),
firstType, secondType, secondKeyValue);
/// <summary>
/// The entity type '{entityType}' is part of a relationship cycle involving its primary key.
/// </summary>
public static string IdentifyingRelationshipCycle([CanBeNull] object entityType)
=> string.Format(
GetString("IdentifyingRelationshipCycle", nameof(entityType)),
entityType);
/// <summary>
/// The service property '{property}' of type '{serviceType}' cannot be added to the entity type '{entityType}' because there is another property of the same type. Ignore one of the properties using the NotMappedAttribute or 'EntityTypeBuilder.Ignore' in 'OnModelCreating'.
/// </summary>
public static string AmbiguousServiceProperty([CanBeNull] object property, [CanBeNull] object serviceType, [CanBeNull] object entityType)
=> string.Format(
GetString("AmbiguousServiceProperty", nameof(property), nameof(serviceType), nameof(entityType)),
property, serviceType, entityType);
/// <summary>
/// Cannot use multiple DbContext instances within a single query execution. Ensure the query uses a single context instance.
/// </summary>
public static string ErrorInvalidQueryable
=> GetString("ErrorInvalidQueryable");
/// <summary>
/// The entity type '{entityType}' cannot have a defining query because it is derived from '{baseType}'. Only base keyless entity types can have a defining query.
/// </summary>
public static string DerivedTypeDefiningQuery([CanBeNull] object entityType, [CanBeNull] object baseType)
=> string.Format(
GetString("DerivedTypeDefiningQuery", nameof(entityType), nameof(baseType)),
entityType, baseType);
/// <summary>
/// The owned entity type '{ownedType}' requires to be referenced from another entity type via a navigation. Add a navigation to an entity type that points at '{ownedType}'.
/// </summary>
public static string OwnerlessOwnedType([CanBeNull] object ownedType)
=> string.Format(
GetString("OwnerlessOwnedType", nameof(ownedType)),
ownedType);
/// <summary>
/// Unable to determine the owner for the relationship between '{entityTypeNavigationSpecification}' and '{otherEntityType}' as both types have been marked as owned. Either manually configure the ownership, or ignore the corresponding navigations using the '[NotMapped]' attribute or by using 'EntityTypeBuilder.Ignore' in 'OnModelCreating'.
/// </summary>
public static string AmbiguousOwnedNavigation([CanBeNull] object entityTypeNavigationSpecification, [CanBeNull] object otherEntityType)
=> string.Format(
GetString("AmbiguousOwnedNavigation", nameof(entityTypeNavigationSpecification), nameof(otherEntityType)),
entityTypeNavigationSpecification, otherEntityType);
/// <summary>
/// The ForeignKeyAttribute for the navigation '{navigation}' cannot be specified on the entity type '{principalType}' since it represents a one-to-many relationship. Move the ForeignKeyAttribute to a property on '{dependentType}'.
/// </summary>
public static string FkAttributeOnNonUniquePrincipal([CanBeNull] object navigation, [CanBeNull] object principalType, [CanBeNull] object dependentType)
=> string.Format(
GetString("FkAttributeOnNonUniquePrincipal", nameof(navigation), nameof(principalType), nameof(dependentType)),
navigation, principalType, dependentType);
/// <summary>
/// cannot bind '{failedBinds}' in '{parameters}'
/// </summary>
public static string ConstructorBindingFailed([CanBeNull] object failedBinds, [CanBeNull] object parameters)
=> string.Format(
GetString("ConstructorBindingFailed", nameof(failedBinds), nameof(parameters)),
failedBinds, parameters);
/// <summary>
/// The navigation '{navigation}' cannot be added because it targets the keyless entity type '{entityType}'. Navigations can only target entity types with keys.
/// </summary>
public static string NavigationToKeylessType([CanBeNull] object navigation, [CanBeNull] object entityType)
=> string.Format(
GetString("NavigationToKeylessType", nameof(navigation), nameof(entityType)),
navigation, entityType);
/// <summary>
/// Property '{property}' on entity type '{entityType}' matches both '{field1}' and '{field2}' by convention. Explicitly specify the backing field to use with '.HasField()' in 'OnModelCreating()'.
/// </summary>
public static string ConflictingBackingFields([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object field1, [CanBeNull] object field2)
=> string.Format(
GetString("ConflictingBackingFields", nameof(property), nameof(entityType), nameof(field1), nameof(field2)),
property, entityType, field1, field2);
/// <summary>
/// The entity type '{entityType}' cannot be marked as keyless because it contains a key.
/// </summary>
public static string KeylessTypeExistingKey([CanBeNull] object entityType)
=> string.Format(
GetString("KeylessTypeExistingKey", nameof(entityType)),
entityType);
/// <summary>
/// The key {key} cannot be added to keyless type '{entityType}'.
/// </summary>
public static string KeylessTypeWithKey([CanBeNull] object key, [CanBeNull] object entityType)
=> string.Format(
GetString("KeylessTypeWithKey", nameof(key), nameof(entityType)),
key, entityType);
/// <summary>
/// There are multiple ForeignKeyAttributes which are pointing to same set of properties - '{propertyList}' on entity type '{entityType}'.
/// </summary>
public static string ConflictingForeignKeyAttributes([CanBeNull] object propertyList, [CanBeNull] object entityType)
=> string.Format(
GetString("ConflictingForeignKeyAttributes", nameof(propertyList), nameof(entityType)),
propertyList, entityType);
/// <summary>
/// The type '{entityType}' cannot be configured as non-owned because an owned entity type with the same name already exists.
/// </summary>
public static string ClashingOwnedEntityType([CanBeNull] object entityType)
=> string.Format(
GetString("ClashingOwnedEntityType", nameof(entityType)),
entityType);
/// <summary>
/// Cannot create a DbSet for '{typeName}' because it is configured as an owned entity type and should be accessed through the defining entities.
/// </summary>
public static string InvalidSetTypeOwned([CanBeNull] object typeName)
=> string.Format(
GetString("InvalidSetTypeOwned", nameof(typeName)),
typeName);
/// <summary>
/// The invoked method cannot be used for the entity type '{entityType}' because it does not have a primary key.
/// </summary>
public static string InvalidSetKeylessOperation([CanBeNull] object entityType)
=> string.Format(
GetString("InvalidSetKeylessOperation", nameof(entityType)),
entityType);
/// <summary>
/// A '{derivedType}' cannot be configured as keyless because it is a derived type. The root type '{rootType}' must be configured as keyless. If you did not intend for '{rootType}' to be included in the model, ensure that it is not included in a DbSet property on your context, referenced in a configuration call to ModelBuilder, or referenced from a navigation property on a type that is included in the model.
/// </summary>
public static string DerivedEntityTypeHasNoKey([CanBeNull] object derivedType, [CanBeNull] object rootType)
=> string.Format(
GetString("DerivedEntityTypeHasNoKey", nameof(derivedType), nameof(rootType)),
derivedType, rootType);
/// <summary>
/// Unable to set a base type for entity type '{entityType}' because it has been configured as having no keys.
/// </summary>
public static string DerivedEntityCannotBeKeyless([CanBeNull] object entityType)
=> string.Format(
GetString("DerivedEntityCannotBeKeyless", nameof(entityType)),
entityType);
/// <summary>
/// The instance of entity type '{runtimeEntityType}' cannot be tracked as the entity type '{entityType}' because they are not in the same hierarchy.
/// </summary>
public static string TrackingTypeMismatch([CanBeNull] object runtimeEntityType, [CanBeNull] object entityType)
=> string.Format(
GetString("TrackingTypeMismatch", nameof(runtimeEntityType), nameof(entityType)),
runtimeEntityType, entityType);
/// <summary>
/// The specified field '{field}' cannot be used for the property '{entityType}.{property}' because it does not match the property name.
/// </summary>
public static string FieldNameMismatch([CanBeNull] object field, [CanBeNull] object entityType, [CanBeNull] object property)
=> string.Format(
GetString("FieldNameMismatch", nameof(field), nameof(entityType), nameof(property)),
field, entityType, property);
/// <summary>
/// Cannot configure the discriminator value for entity type '{entityType}' because it doesn't derive from '{rootEntityType}'.
/// </summary>
public static string DiscriminatorEntityTypeNotDerived([CanBeNull] object entityType, [CanBeNull] object rootEntityType)
=> string.Format(
GetString("DiscriminatorEntityTypeNotDerived", nameof(entityType), nameof(rootEntityType)),
entityType, rootEntityType);
/// <summary>
/// A discriminator property cannot be set for the entity type '{entityType}' because it is not the root of an inheritance hierarchy.
/// </summary>
public static string DiscriminatorPropertyMustBeOnRoot([CanBeNull] object entityType)
=> string.Format(
GetString("DiscriminatorPropertyMustBeOnRoot", nameof(entityType)),
entityType);
/// <summary>
/// Unable to set property '{property}' as a discriminator for entity type '{entityType}' because it is not a property of '{entityType}'.
/// </summary>
public static string DiscriminatorPropertyNotFound([CanBeNull] object property, [CanBeNull] object entityType)
=> string.Format(
GetString("DiscriminatorPropertyNotFound", nameof(property), nameof(entityType)),
property, entityType);
/// <summary>
/// Cannot set discriminator value '{value}' for discriminator property '{discriminator}' because it is not assignable to property of type '{discriminatorType}'.
/// </summary>
public static string DiscriminatorValueIncompatible([CanBeNull] object value, [CanBeNull] object discriminator, [CanBeNull] object discriminatorType)
=> string.Format(
GetString("DiscriminatorValueIncompatible", nameof(value), nameof(discriminator), nameof(discriminatorType)),
value, discriminator, discriminatorType);
/// <summary>
/// The discriminator value for '{entityType1}' is '{discriminatorValue}' which is the same for '{entityType2}'. Every concrete entity type in the hierarchy needs to have a unique discriminator value.
/// </summary>
public static string DuplicateDiscriminatorValue([CanBeNull] object entityType1, [CanBeNull] object discriminatorValue, [CanBeNull] object entityType2)
=> string.Format(
GetString("DuplicateDiscriminatorValue", nameof(entityType1), nameof(discriminatorValue), nameof(entityType2)),
entityType1, discriminatorValue, entityType2);
/// <summary>
/// Cannot set discriminator value for entity type '{entityType}' because the root entity type '{rootEntityType}' doesn't have a discriminator property set.
/// </summary>
public static string NoDiscriminatorForValue([CanBeNull] object entityType, [CanBeNull] object rootEntityType)
=> string.Format(
GetString("NoDiscriminatorForValue", nameof(entityType), nameof(rootEntityType)),
entityType, rootEntityType);
/// <summary>
/// The entity type '{entityType}' is part of a hierarchy, but does not have a discriminator property configured.
/// </summary>
public static string NoDiscriminatorProperty([CanBeNull] object entityType)
=> string.Format(
GetString("NoDiscriminatorProperty", nameof(entityType)),
entityType);
/// <summary>
/// The entity type '{entityType}' is part of a hierarchy, but does not have a discriminator value configured.
/// </summary>
public static string NoDiscriminatorValue([CanBeNull] object entityType)
=> string.Format(
GetString("NoDiscriminatorValue", nameof(entityType)),
entityType);
/// <summary>
/// The foreign key {foreignKey} targeting the key {key} on '{principalType}' cannot be removed from the entity type '{entityType}' because it is defined on the entity type '{otherEntityType}'.
/// </summary>
public static string ForeignKeyWrongType([CanBeNull] object foreignKey, [CanBeNull] object key, [CanBeNull] object principalType, [CanBeNull] object entityType, [CanBeNull] object otherEntityType)
=> string.Format(
GetString("ForeignKeyWrongType", nameof(foreignKey), nameof(key), nameof(principalType), nameof(entityType), nameof(otherEntityType)),
foreignKey, key, principalType, entityType, otherEntityType);
/// <summary>
/// The index {indexProperties} cannot be removed from the entity type '{entityType}' because it is defined on the entity type '{otherEntityType}'.
/// </summary>
public static string IndexWrongType([CanBeNull] object indexProperties, [CanBeNull] object entityType, [CanBeNull] object otherEntityType)
=> string.Format(
GetString("IndexWrongType", nameof(indexProperties), nameof(entityType), nameof(otherEntityType)),
indexProperties, entityType, otherEntityType);
/// <summary>
/// The index with name {indexName} cannot be removed from the entity type '{entityType}' because no such index exists on that entity type.
/// </summary>
public static string NamedIndexWrongType([CanBeNull] object indexName, [CanBeNull] object entityType)
=> string.Format(
GetString("NamedIndexWrongType", nameof(indexName), nameof(entityType)),
indexName, entityType);
/// <summary>
/// The key {key} cannot be removed from the entity type '{entityType}' because it is defined on the entity type '{otherEntityType}'.
/// </summary>
public static string KeyWrongType([CanBeNull] object key, [CanBeNull] object entityType, [CanBeNull] object otherEntityType)
=> string.Format(
GetString("KeyWrongType", nameof(key), nameof(entityType), nameof(otherEntityType)),
key, entityType, otherEntityType);
/// <summary>
/// The property '{property}' cannot be removed from the entity type '{entityType}' because it is declared on the entity type '{otherEntityType}'.
/// </summary>
public static string PropertyWrongType([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object otherEntityType)
=> string.Format(
GetString("PropertyWrongType", nameof(property), nameof(entityType), nameof(otherEntityType)),
property, entityType, otherEntityType);
/// <summary>
/// There is no navigation on entity type '{entityType}' associated with the foreign key {foreignKey}.
/// </summary>
public static string NoNavigation([CanBeNull] object entityType, [CanBeNull] object foreignKey)
=> string.Format(
GetString("NoNavigation", nameof(entityType), nameof(foreignKey)),
entityType, foreignKey);
/// <summary>
/// The property '{property}' cannot be added to type '{entityType}' because the name of the given CLR property or field '{clrName}' is different.
/// </summary>
public static string PropertyWrongName([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object clrName)
=> string.Format(
GetString("PropertyWrongName", nameof(property), nameof(entityType), nameof(clrName)),
property, entityType, clrName);
/// <summary>
/// The indexer property '{property}' cannot be added to type '{entityType}' because the CLR class contains a member with the same name.
/// </summary>
public static string PropertyClashingNonIndexer([CanBeNull] object property, [CanBeNull] object entityType)
=> string.Format(
GetString("PropertyClashingNonIndexer", nameof(property), nameof(entityType)),
property, entityType);
/// <summary>
/// This query would cause multiple evaluation of a subquery because entity '{entityType}' has a composite key. Rewrite your query avoiding the subquery.
/// </summary>
public static string EntityEqualitySubqueryWithCompositeKeyNotSupported([CanBeNull] object entityType)
=> string.Format(
GetString("EntityEqualitySubqueryWithCompositeKeyNotSupported", nameof(entityType)),
entityType);
/// <summary>
/// Cannot translate a Contains() operator on entity '{entityType}' because it has a composite key.
/// </summary>
public static string EntityEqualityContainsWithCompositeKeyNotSupported([CanBeNull] object entityType)
=> string.Format(
GetString("EntityEqualityContainsWithCompositeKeyNotSupported", nameof(entityType)),
entityType);
/// <summary>
/// Comparison on entity type '{entityType}' is not supported because it is a keyless entity.
/// </summary>
public static string EntityEqualityOnKeylessEntityNotSupported([CanBeNull] object entityType)
=> string.Format(
GetString("EntityEqualityOnKeylessEntityNotSupported", nameof(entityType)),
entityType);
/// <summary>
/// Unable to materialize entity of type '{entityType}'. No discriminators matched '{discriminator}'.
/// </summary>
public static string UnableToDiscriminate([CanBeNull] object entityType, [CanBeNull] object discriminator)
=> string.Format(
GetString("UnableToDiscriminate", nameof(entityType), nameof(discriminator)),
entityType, discriminator);
/// <summary>
/// 'InterceptionResult.Result' was called when 'InterceptionResult.HasResult' is false.
/// </summary>
public static string NoInterceptionResult
=> GetString("NoInterceptionResult");
/// <summary>
/// When performing a set operation, both operands must have the same Include operations.
/// </summary>
public static string SetOperationWithDifferentIncludesInOperands
=> GetString("SetOperationWithDifferentIncludesInOperands");
/// <summary>
/// Include is not supported for entities with defining query. Entity type: '{entityType}'
/// </summary>
public static string IncludeOnEntityWithDefiningQueryNotSupported([CanBeNull] object entityType)
=> string.Format(
GetString("IncludeOnEntityWithDefiningQueryNotSupported", nameof(entityType)),
entityType);
/// <summary>
/// The type '{entityType}' cannot be marked as owned because the derived entity type - '{derivedType}' has been configured as non-owned.
/// </summary>
public static string ClashingNonOwnedDerivedEntityType([CanBeNull] object entityType, [CanBeNull] object derivedType)
=> string.Format(
GetString("ClashingNonOwnedDerivedEntityType", nameof(entityType), nameof(derivedType)),
entityType, derivedType);
/// <summary>
/// Client projection contains reference to constant expression of '{constantType}' which is being passed as argument to method '{methodName}'. This could potentially cause memory leak. Consider assigning this constant to local variable and using the variable in the query instead. See https://go.microsoft.com/fwlink/?linkid=2103067 for more information.
/// </summary>
public static string ClientProjectionCapturingConstantInMethodArgument([CanBeNull] object constantType, [CanBeNull] object methodName)
=> string.Format(
GetString("ClientProjectionCapturingConstantInMethodArgument", nameof(constantType), nameof(methodName)),
constantType, methodName);
/// <summary>
/// Client projection contains reference to constant expression of '{constantType}' through instance method '{methodName}'. This could potentially cause memory leak. Consider making the method static so that it does not capture constant in the instance. See https://go.microsoft.com/fwlink/?linkid=2103067 for more information.
/// </summary>
public static string ClientProjectionCapturingConstantInMethodInstance([CanBeNull] object constantType, [CanBeNull] object methodName)
=> string.Format(
GetString("ClientProjectionCapturingConstantInMethodInstance", nameof(constantType), nameof(methodName)),
constantType, methodName);
/// <summary>
/// Client projection contains reference to constant expression of '{constantType}'. This could potentially cause memory leak. Consider assigning this constant to local variable and using the variable in the query instead. See https://go.microsoft.com/fwlink/?linkid=2103067 for more information.
/// </summary>
public static string ClientProjectionCapturingConstantInTree([CanBeNull] object constantType)
=> string.Format(
GetString("ClientProjectionCapturingConstantInTree", nameof(constantType)),
constantType);
/// <summary>
/// Cannot remove foreign key {foreigKey} from entity type '{entityType}' because it is referenced by a skip navigation '{navigation}' on entity type '{navigationEntityType}'. All referencing skip navigation must be removed before the referenced foreign key can be removed.
/// </summary>
public static string ForeignKeyInUseSkipNavigation([CanBeNull] object foreigKey, [CanBeNull] object entityType, [CanBeNull] object navigation, [CanBeNull] object navigationEntityType)
=> string.Format(
GetString("ForeignKeyInUseSkipNavigation", nameof(foreigKey), nameof(entityType), nameof(navigation), nameof(navigationEntityType)),
foreigKey, entityType, navigation, navigationEntityType);
/// <summary>
/// The skip navigation '{inverse}' declared on the entity type '{inverseEntityType}' cannot be set as the inverse of '{navigation}' that targets '{targetEntityType}'. The inverse should be declared on the target entity type.
/// </summary>
public static string SkipNavigationWrongInverse([CanBeNull] object inverse, [CanBeNull] object inverseEntityType, [CanBeNull] object navigation, [CanBeNull] object targetEntityType)
=> string.Format(
GetString("SkipNavigationWrongInverse", nameof(inverse), nameof(inverseEntityType), nameof(navigation), nameof(targetEntityType)),
inverse, inverseEntityType, navigation, targetEntityType);
/// <summary>
/// The skip navigation property '{navigation}' cannot be removed from the entity type '{entityType}' because it is defined on the entity type '{otherEntityType}'.
/// </summary>
public static string SkipNavigationWrongType([CanBeNull] object navigation, [CanBeNull] object entityType, [CanBeNull] object otherEntityType)
=> string.Format(
GetString("SkipNavigationWrongType", nameof(navigation), nameof(entityType), nameof(otherEntityType)),
navigation, entityType, otherEntityType);
/// <summary>
/// The skip navigation '{inverse}' using the association entity type '{inverseAssociationType}' cannot be set as the inverse of '{navigation}' that uses the association entity type '{associationType}'. The inverse should use the same association entity type.
/// </summary>
public static string SkipInverseMismatchedAssociationType([CanBeNull] object inverse, [CanBeNull] object inverseAssociationType, [CanBeNull] object navigation, [CanBeNull] object associationType)
=> string.Format(
GetString("SkipInverseMismatchedAssociationType", nameof(inverse), nameof(inverseAssociationType), nameof(navigation), nameof(associationType)),
inverse, inverseAssociationType, navigation, associationType);
/// <summary>
/// The skip navigation '{navigation}' on entity type '{entityType}' doesn't have an inverse configured. Every skip navigation should have an inverse skip navigation.
/// </summary>
public static string SkipNavigationNoInverse([CanBeNull] object navigation, [CanBeNull] object entityType)
=> string.Format(
GetString("SkipNavigationNoInverse", nameof(navigation), nameof(entityType)),
navigation, entityType);
/// <summary>
/// The skip navigation '{navigation}' on entity type '{entityType}' is not a collection. Only collection skip navigation properties are currently supported.
/// </summary>
public static string SkipNavigationNonCollection([CanBeNull] object navigation, [CanBeNull] object entityType)
=> string.Format(
GetString("SkipNavigationNonCollection", nameof(navigation), nameof(entityType)),
navigation, entityType);
/// <summary>
/// The foreign key '{foreignKey}' cannot be set for the skip navigation '{navigation}' as it uses the association entity type '{associationType}' while the inverse skip navigation '{inverse}' is using the association entity type '{inverseAssociationType}'. The inverse should use the same association entity type.
/// </summary>
public static string SkipInverseMismatchedForeignKey([CanBeNull] object foreignKey, [CanBeNull] object navigation, [CanBeNull] object associationType, [CanBeNull] object inverse, [CanBeNull] object inverseAssociationType)
=> string.Format(
GetString("SkipInverseMismatchedForeignKey", nameof(foreignKey), nameof(navigation), nameof(associationType), nameof(inverse), nameof(inverseAssociationType)),
foreignKey, navigation, associationType, inverse, inverseAssociationType);
/// <summary>
/// The skip navigation '{navigation}' on entity type '{entityType}' doesn't have a foreign key associated with it. Every skip navigation should have a configured foreign key.
/// </summary>
public static string SkipNavigationNoForeignKey([CanBeNull] object navigation, [CanBeNull] object entityType)
=> string.Format(
GetString("SkipNavigationNoForeignKey", nameof(navigation), nameof(entityType)),
navigation, entityType);
/// <summary>
/// The foreign key {foreignKey} cannot be used for the skip navigation property '{navigation}' on the entity type '{entityType}' because it is expected to be on the dependent entity type '{dependentEntityType}'.
/// </summary>
public static string SkipNavigationForeignKeyWrongDependentType([CanBeNull] object foreignKey, [CanBeNull] object navigation, [CanBeNull] object entityType, [CanBeNull] object dependentEntityType)
=> string.Format(
GetString("SkipNavigationForeignKeyWrongDependentType", nameof(foreignKey), nameof(navigation), nameof(entityType), nameof(dependentEntityType)),
foreignKey, navigation, entityType, dependentEntityType);
/// <summary>
/// The foreign key {foreignKey} cannot be used for the skip navigation property '{navigation}' on the entity type '{entityType}' because it is expected to be on the principal entity type '{principalEntityType}'.
/// </summary>
public static string SkipNavigationForeignKeyWrongPrincipalType([CanBeNull] object foreignKey, [CanBeNull] object navigation, [CanBeNull] object entityType, [CanBeNull] object principalEntityType)
=> string.Format(
GetString("SkipNavigationForeignKeyWrongPrincipalType", nameof(foreignKey), nameof(navigation), nameof(entityType), nameof(principalEntityType)),
foreignKey, navigation, entityType, principalEntityType);
/// <summary>
/// Cannot add property '{property}' on entity type '{entity}' since there is no indexer on '{entity}' taking a single argument of type '{type}'.
/// </summary>
public static string NonIndexerEntityType([CanBeNull] object property, [CanBeNull] object entity, [CanBeNull] object type)
=> string.Format(
GetString("NonIndexerEntityType", nameof(property), nameof(entity), nameof(type)),
property, entity, type);
/// <summary>
/// Cannot set backing field '{field}' for the indexer property '{entityType}.{property}'. Indexer properties are not allowed to use a backing field.
/// </summary>
public static string BackingFieldOnIndexer([CanBeNull] object field, [CanBeNull] object entityType, [CanBeNull] object property)
=> string.Format(
GetString("BackingFieldOnIndexer", nameof(field), nameof(entityType), nameof(property)),
field, entityType, property);
/// <summary>
/// The entity type '{entityType}' cannot be added to the model because a shared entity type with the same clr type already exists.
/// </summary>
public static string ClashingSharedType([CanBeNull] object entityType)
=> string.Format(
GetString("ClashingSharedType", nameof(entityType)),
entityType);
/// <summary>
/// The skip navigation '{skipNavigation}' cannot be removed because it is set as the inverse of the skip navigation '{inverseSkipNavigation}' on '{referencingEntityType}'. All referencing skip navigations must be removed before this skip navigation can be removed.
/// </summary>
public static string SkipNavigationInUseBySkipNavigation([CanBeNull] object skipNavigation, [CanBeNull] object inverseSkipNavigation, [CanBeNull] object referencingEntityType)
=> string.Format(
GetString("SkipNavigationInUseBySkipNavigation", nameof(skipNavigation), nameof(inverseSkipNavigation), nameof(referencingEntityType)),
skipNavigation, inverseSkipNavigation, referencingEntityType);
/// <summary>
/// Queries performing '{method}' operation must have a deterministic sort order. Rewrite the query to apply an OrderBy clause on the sequence before calling '{method}'.
/// </summary>
public static string LastUsedWithoutOrderBy([CanBeNull] object method)
=> string.Format(
GetString("LastUsedWithoutOrderBy", nameof(method)),
method);
/// <summary>
/// Immediate convention scope cannot be run again.
/// </summary>
public static string ImmediateConventionScopeCannotBeRunAgain
=> GetString("ImmediateConventionScopeCannotBeRunAgain");
/// <summary>
/// Unknown {entity}.
/// </summary>
public static string UnknownEntity([CanBeNull] object entity)
=> string.Format(
GetString("UnknownEntity", nameof(entity)),
entity);
/// <summary>
/// Unhandled expression node type '{nodeType}'.
/// </summary>
public static string UnhandledExpressionNode([CanBeNull] object nodeType)
=> string.Format(
GetString("UnhandledExpressionNode", nameof(nodeType)),
nodeType);
/// <summary>
/// Unhandled member binding type '{bindingType}'.
/// </summary>
public static string UnhandledMemberBinding([CanBeNull] object bindingType)
=> string.Format(
GetString("UnhandledMemberBinding", nameof(bindingType)),
bindingType);
/// <summary>
/// Invalid include path '{navigationChain}', couldn't find navigation for '{navigationName}'.
/// </summary>
public static string InvalidIncludePath([CanBeNull] object navigationChain, [CanBeNull] object navigationName)
=> string.Format(
GetString("InvalidIncludePath", nameof(navigationChain), nameof(navigationName)),
navigationChain, navigationName);
/// <summary>
/// Lambda expression used inside Include is not valid.
/// </summary>
public static string InvalidLambdaExpressionInsideInclude
=> GetString("InvalidLambdaExpressionInsideInclude");
/// <summary>
/// Include has been used on non entity queryable.
/// </summary>
public static string IncludeOnNonEntity
=> GetString("IncludeOnNonEntity");
/// <summary>
/// Different filters: '{filter1}' and '{filter2}' have been applied on the same included navigation. Only one unique filter per navigation is allowed. For more information on including related data, see http://go.microsoft.com/fwlink/?LinkID=746393.
/// </summary>
public static string MultipleFilteredIncludesOnSameNavigation([CanBeNull] object filter1, [CanBeNull] object filter2)
=> string.Format(
GetString("MultipleFilteredIncludesOnSameNavigation", nameof(filter1), nameof(filter2)),
filter1, filter2);
/// <summary>
/// Unable to convert queryable method to enumerable method.
/// </summary>
public static string CannotConvertQueryableToEnumerableMethod
=> GetString("CannotConvertQueryableToEnumerableMethod");
/// <summary>
/// Invalid type conversion when specifying include.
/// </summary>
public static string InvalidTypeConversationWithInclude
=> GetString("InvalidTypeConversationWithInclude");
/// <summary>
/// The Include path '{navigationName}->{inverseNavigationName}' results in a cycle. Cycles are not allowed in no-tracking queries. Either use a tracking query or remove the cycle.
/// </summary>
public static string IncludeWithCycle([CanBeNull] object navigationName, [CanBeNull] object inverseNavigationName)
=> string.Format(
GetString("IncludeWithCycle", nameof(navigationName), nameof(inverseNavigationName)),
navigationName, inverseNavigationName);
/// <summary>
/// Unhandled method '{methodName}'.
/// </summary>
public static string UnhandledMethod([CanBeNull] object methodName)
=> string.Format(
GetString("UnhandledMethod", nameof(methodName)),
methodName);
/// <summary>
/// Runtime parameter extraction lambda must have one QueryContext parameter.
/// </summary>
public static string RuntimeParameterMissingParameter
=> GetString("RuntimeParameterMissingParameter");
/// <summary>
/// Sequence contains no elements.
/// </summary>
public static string SequenceContainsNoElements
=> GetString("SequenceContainsNoElements");
/// <summary>
/// Sequence contains more than one element.
/// </summary>
public static string SequenceContainsMoreThanOneElement
=> GetString("SequenceContainsMoreThanOneElement");
/// <summary>
/// A tracking query projects owned entity without corresponding owner in result. Owned entities cannot be tracked without their owner. Either include the owner entity in the result or make query non-tracking using AsNoTracking().
/// </summary>
public static string OwnedEntitiesCannotBeTrackedWithoutTheirOwner
=> GetString("OwnedEntitiesCannotBeTrackedWithoutTheirOwner");
/// <summary>
/// Calling '{visitMethodName}' is not allowed. Visit expression manually for relevant part.
/// </summary>
public static string VisitIsNotAllowed([CanBeNull] object visitMethodName)
=> string.Format(
GetString("VisitIsNotAllowed", nameof(visitMethodName)),
visitMethodName);
/// <summary>
/// Called EntityProjectionExpression.{methodName}() with incorrect {interfaceType}. EntityType:{entityType}, {entityValue}
/// </summary>
public static string EntityProjectionExpressionCalledWithIncorrectInterface([CanBeNull] object methodName, [CanBeNull] object interfaceType, [CanBeNull] object entityType, [CanBeNull] object entityValue)
=> string.Format(
GetString("EntityProjectionExpressionCalledWithIncorrectInterface", nameof(methodName), nameof(interfaceType), nameof(entityType), nameof(entityValue)),
methodName, interfaceType, entityType, entityValue);
/// <summary>
/// Unsupported Unary operator type specified.
/// </summary>
public static string UnsupportedUnary
=> GetString("UnsupportedUnary");
/// <summary>
/// Incorrect operatorType for SqlBinaryExpression.
/// </summary>
public static string IncorrectOperatorType
=> GetString("IncorrectOperatorType");
/// <summary>
/// Null TypeMapping in Sql Tree.
/// </summary>
public static string NullTypeMappingInSqlTree
=> GetString("NullTypeMappingInSqlTree");
/// <summary>
/// VisitChildren must be overridden in class deriving from SqlExpression.
/// </summary>
public static string VisitChildrenMustBeOverridden
=> GetString("VisitChildrenMustBeOverridden");
/// <summary>
/// Unsupported Binary operator type specified.
/// </summary>
public static string UnsupportedBinaryOperator
=> GetString("UnsupportedBinaryOperator");
/// <summary>
/// Translation of '{expression}' failed. Either source is not an entity type or the specified property does not exist on the entity type.
/// </summary>
public static string QueryUnableToTranslateEFProperty([CanBeNull] object expression)
=> string.Format(
GetString("QueryUnableToTranslateEFProperty", nameof(expression)),
expression);
/// <summary>
/// Translation of member '{member}' on entity type '{entityType}' failed. Possibly the specified member is not mapped.
/// </summary>
public static string QueryUnableToTranslateMember([CanBeNull] object member, [CanBeNull] object entityType)
=> string.Format(
GetString("QueryUnableToTranslateMember", nameof(member), nameof(entityType)),
member, entityType);
/// <summary>
/// Translation of 'string.Equals' method which takes 'StringComparison' argument is not supported. See https://go.microsoft.com/fwlink/?linkid=2129535 for more information.
/// </summary>
public static string QueryUnableToTranslateStringEqualsWithStringComparison
=> GetString("QueryUnableToTranslateStringEqualsWithStringComparison");
/// <summary>
/// Translation of method '{declaringTypeName}.{methodName}' failed. If you are trying to map your custom function, see https://go.microsoft.com/fwlink/?linkid=2132413 for more information.
/// </summary>
public static string QueryUnableToTranslateMethod([CanBeNull] object declaringTypeName, [CanBeNull] object methodName)
=> string.Format(
GetString("QueryUnableToTranslateMethod", nameof(declaringTypeName), nameof(methodName)),
declaringTypeName, methodName);
/// <summary>
/// Invalid {state} encountered.
/// </summary>
public static string InvalidStateEncountered([CanBeNull] object state)
=> string.Format(
GetString("InvalidStateEncountered", nameof(state)),
state);
/// <summary>
/// Cannot apply DefaultIfEmpty after a client-evaluated projection.
/// </summary>
public static string DefaultIfEmptyAppliedAfterProjection
=> GetString("DefaultIfEmptyAppliedAfterProjection");
/// <summary>
/// Invalid {name}: {value}
/// </summary>
public static string InvalidSwitch([CanBeNull] object name, [CanBeNull] object value)
=> string.Format(
GetString("InvalidSwitch", nameof(name), nameof(value)),
name, value);
/// <summary>
/// Cannot add an entity type with type '{typeName}'. That type is a dynamically-generated proxy type.
/// </summary>
public static string AttemptToCreateEntityTypeBasedOnProxyClass([CanBeNull] object typeName)
=> string.Format(
GetString("AttemptToCreateEntityTypeBasedOnProxyClass", nameof(typeName)),
typeName);
/// <summary>
/// There is no navigation property with name '{navigationName}' on entity type '{entityType}'. Please add the navigation to the entity type before configuring it.
/// </summary>
public static string CanOnlyConfigureExistingNavigations([CanBeNull] object navigationName, [CanBeNull] object entityType)
=> string.Format(
GetString("CanOnlyConfigureExistingNavigations", nameof(navigationName), nameof(entityType)),
navigationName, entityType);
/// <summary>
/// The '{methodName}' method is not supported because the query has switched to client-evaluation. Inspect the log to determine which query expressions are triggering client-evaluation.
/// </summary>
public static string FunctionOnClient([CanBeNull] object methodName)
=> string.Format(
GetString("FunctionOnClient", nameof(methodName)),
methodName);
/// <summary>
/// Materialization condition passed for entity shaper of entity type '{entityType}' is not of correct shape. Materialization condition must be LambdaExpression of 'Func<ValueBuffer, IEntityType>'
/// </summary>
public static string QueryEntityMaterializationConditionWrongShape([CanBeNull] object entityType)
=> string.Format(
GetString("QueryEntityMaterializationConditionWrongShape", nameof(entityType)),
entityType);
/// <summary>
/// Unable to set IsUnique to '{isUnique}' on the relationship underlying the navigation property '{navigationName}' on the entity type '{entityType}' because the navigation property has the opposite multiplicity.
/// </summary>
public static string UnableToSetIsUnique([CanBeNull] object isUnique, [CanBeNull] object navigationName, [CanBeNull] object entityType)
=> string.Format(
GetString("UnableToSetIsUnique", nameof(isUnique), nameof(navigationName), nameof(entityType)),
isUnique, navigationName, entityType);
/// <summary>
/// Unable to set up a many-to-many relationship between the entity types '{principalEntityType}' and '{declaringEntityType}' because one of the navigations was not specified. Please provide a navigation property in the HasMany() call.
/// </summary>
public static string MissingInverseManyToManyNavigation([CanBeNull] object principalEntityType, [CanBeNull] object declaringEntityType)
=> string.Format(
GetString("MissingInverseManyToManyNavigation", nameof(principalEntityType), nameof(declaringEntityType)),
principalEntityType, declaringEntityType);
/// <summary>
/// InitializeStateManager method has been called multiple times on current query context. This method is intended to be called only once before query enumeration starts.
/// </summary>
public static string QueryContextAlreadyInitializedStateManager
=> GetString("QueryContextAlreadyInitializedStateManager");
/// <summary>
/// The index named '{indexName}' on the entity type '{entityType}' with properties {indexPropertyList} is invalid. The property '{propertyName}' has been marked NotMapped or Ignore(). An index cannot use such properties.
/// </summary>
public static string NamedIndexDefinedOnIgnoredProperty([CanBeNull] object indexName, [CanBeNull] object entityType, [CanBeNull] object indexPropertyList, [CanBeNull] object propertyName)
=> string.Format(
GetString("NamedIndexDefinedOnIgnoredProperty", nameof(indexName), nameof(entityType), nameof(indexPropertyList), nameof(propertyName)),
indexName, entityType, indexPropertyList, propertyName);
/// <summary>
/// The unnamed index on the entity type '{entityType}' with properties {indexPropertyList} is invalid. The property '{propertyName}' has been marked NotMapped or Ignore(). An index cannot use such properties.
/// </summary>
public static string UnnamedIndexDefinedOnIgnoredProperty([CanBeNull] object entityType, [CanBeNull] object indexPropertyList, [CanBeNull] object propertyName)
=> string.Format(
GetString("UnnamedIndexDefinedOnIgnoredProperty", nameof(entityType), nameof(indexPropertyList), nameof(propertyName)),
entityType, indexPropertyList, propertyName);
/// <summary>
/// An index named '{indexName}' on the entity type '{entityType}' specifies properties {indexPropertyList}. But no property with name '{propertyName}' exists on that entity type or any of its base types.
/// </summary>
public static string NamedIndexDefinedOnNonExistentProperty([CanBeNull] object indexName, [CanBeNull] object entityType, [CanBeNull] object indexPropertyList, [CanBeNull] object propertyName)
=> string.Format(
GetString("NamedIndexDefinedOnNonExistentProperty", nameof(indexName), nameof(entityType), nameof(indexPropertyList), nameof(propertyName)),
indexName, entityType, indexPropertyList, propertyName);
/// <summary>
/// An unnamed index on the entity type '{entityType}' specifies properties {indexPropertyList}. But no property with name '{propertyName}' exists on that entity type or any of its base types.
/// </summary>
public static string UnnamedIndexDefinedOnNonExistentProperty([CanBeNull] object entityType, [CanBeNull] object indexPropertyList, [CanBeNull] object propertyName)
=> string.Format(
GetString("UnnamedIndexDefinedOnNonExistentProperty", nameof(entityType), nameof(indexPropertyList), nameof(propertyName)),
entityType, indexPropertyList, propertyName);
/// <summary>
/// Unhandled 'INavigationBase' of type '{type}'.
/// </summary>
public static string UnhandledNavigationBase([CanBeNull] object type)
=> string.Format(
GetString("UnhandledNavigationBase", nameof(type)),
type);
/// <summary>
/// The entity type '{entityType}' cannot be on the principal end of the relationship between '{firstNavigationSpecification}' and '{secondNavigationSpecification}'. The principal entity type must have a key.
/// </summary>
public static string PrincipalKeylessType([CanBeNull] object entityType, [CanBeNull] object firstNavigationSpecification, [CanBeNull] object secondNavigationSpecification)
=> string.Format(
GetString("PrincipalKeylessType", nameof(entityType), nameof(firstNavigationSpecification), nameof(secondNavigationSpecification)),
entityType, firstNavigationSpecification, secondNavigationSpecification);
/// <summary>
/// The shared type entity type '{entityType}' cannot be added to the model because a shared entity type with the same name but different clr type already exists.
/// </summary>
public static string ClashingMismatchedSharedType([CanBeNull] object entityType)
=> string.Format(
GetString("ClashingMismatchedSharedType", nameof(entityType)),
entityType);
/// <summary>
/// The shared type entity type '{entityType}' cannot be added to the model because a non shared entity type with the same clr type already exists.
/// </summary>
public static string ClashingNonSharedType([CanBeNull] object entityType)
=> string.Format(
GetString("ClashingNonSharedType", nameof(entityType)),
entityType);
/// <summary>
/// Cannot create a DbSet for '{typeName}' because it is configured as an shared type entity type and should be accessed through entity type name based Set method.
/// </summary>
public static string InvalidSetSharedType([CanBeNull] object typeName)
=> string.Format(
GetString("InvalidSetSharedType", nameof(typeName)),
typeName);
/// <summary>
/// Type '{type}' cannot be marked as shared type since entity type with same CLR type exists in the model.
/// </summary>
public static string CannotMarkShared([CanBeNull] object type)
=> string.Format(
GetString("CannotMarkShared", nameof(type)),
type);
/// <summary>
/// Type '{type}' is not been configured as shared type in the model. Before calling 'UsingEntity', please mark the type as shared or add the entity type in the model as shared entity.
/// </summary>
public static string TypeNotMarkedAsShared([CanBeNull] object type)
=> string.Format(
GetString("TypeNotMarkedAsShared", nameof(type)),
type);
private static string GetString(string name, params string[] formatterNames)
{
var value = _resourceManager.GetString(name);
for (var i = 0; i < formatterNames.Length; i++)
{
value = value.Replace("{" + formatterNames[i] + "}", "{" + i + "}");
}
return value;
}
}
}
namespace Microsoft.EntityFrameworkCore.Diagnostics.Internal
{
/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public static class CoreResources
{
private static readonly ResourceManager _resourceManager
= new ResourceManager("Microsoft.EntityFrameworkCore.Properties.CoreStrings", typeof(CoreResources).Assembly);
/// <summary>
/// An 'IServiceProvider' was created for internal use by Entity Framework.
/// </summary>
public static EventDefinition LogServiceProviderCreated([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogServiceProviderCreated;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogServiceProviderCreated,
() => new EventDefinition(
logger.Options,
CoreEventId.ServiceProviderCreated,
LogLevel.Debug,
"CoreEventId.ServiceProviderCreated",
level => LoggerMessage.Define(
level,
CoreEventId.ServiceProviderCreated,
_resourceManager.GetString("LogServiceProviderCreated"))));
}
return (EventDefinition)definition;
}
/// <summary>
/// More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. This is commonly caused by injection of a new singleton service instance into every DbContext instance. For example, calling UseLoggerFactory passing in a new instance each time--see https://go.microsoft.com/fwlink/?linkid=869049 for more details. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built.
/// </summary>
public static EventDefinition LogManyServiceProvidersCreated([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogManyServiceProvidersCreated;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogManyServiceProvidersCreated,
() => new EventDefinition(
logger.Options,
CoreEventId.ManyServiceProvidersCreatedWarning,
LogLevel.Warning,
"CoreEventId.ManyServiceProvidersCreatedWarning",
level => LoggerMessage.Define(
level,
CoreEventId.ManyServiceProvidersCreatedWarning,
_resourceManager.GetString("LogManyServiceProvidersCreated"))));
}
return (EventDefinition)definition;
}
/// <summary>
/// An additional 'IServiceProvider' was created for internal use by Entity Framework. An existing service provider was not used due to the following configuration changes: {debugInfo}.
/// </summary>
public static EventDefinition<string> LogServiceProviderDebugInfo([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogServiceProviderDebugInfo;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogServiceProviderDebugInfo,
() => new EventDefinition<string>(
logger.Options,
CoreEventId.ServiceProviderDebugInfo,
LogLevel.Debug,
"CoreEventId.ServiceProviderDebugInfo",
level => LoggerMessage.Define<string>(
level,
CoreEventId.ServiceProviderDebugInfo,
_resourceManager.GetString("LogServiceProviderDebugInfo"))));
}
return (EventDefinition<string>)definition;
}
/// <summary>
/// Entity Framework Core {version} initialized '{contextType}' using provider '{provider}' with options: {options}
/// </summary>
public static EventDefinition<string, string, string, string> LogContextInitialized([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogContextInitialized;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogContextInitialized,
() => new EventDefinition<string, string, string, string>(
logger.Options,
CoreEventId.ContextInitialized,
LogLevel.Information,
"CoreEventId.ContextInitialized",
level => LoggerMessage.Define<string, string, string, string>(
level,
CoreEventId.ContextInitialized,
_resourceManager.GetString("LogContextInitialized"))));
}
return (EventDefinition<string, string, string, string>)definition;
}
/// <summary>
/// An exception occurred while iterating over the results of a query for context type '{contextType}'.{newline}{error}
/// </summary>
public static EventDefinition<Type, string, Exception> LogExceptionDuringQueryIteration([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogExceptionDuringQueryIteration;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogExceptionDuringQueryIteration,
() => new EventDefinition<Type, string, Exception>(
logger.Options,
CoreEventId.QueryIterationFailed,
LogLevel.Error,
"CoreEventId.QueryIterationFailed",
level => LoggerMessage.Define<Type, string, Exception>(
level,
CoreEventId.QueryIterationFailed,
_resourceManager.GetString("LogExceptionDuringQueryIteration"))));
}
return (EventDefinition<Type, string, Exception>)definition;
}
/// <summary>
/// An exception occurred in the database while saving changes for context type '{contextType}'.{newline}{error}
/// </summary>
public static EventDefinition<Type, string, Exception> LogExceptionDuringSaveChanges([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogExceptionDuringSaveChanges;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogExceptionDuringSaveChanges,
() => new EventDefinition<Type, string, Exception>(
logger.Options,
CoreEventId.SaveChangesFailed,
LogLevel.Error,
"CoreEventId.SaveChangesFailed",
level => LoggerMessage.Define<Type, string, Exception>(
level,
CoreEventId.SaveChangesFailed,
_resourceManager.GetString("LogExceptionDuringSaveChanges"))));
}
return (EventDefinition<Type, string, Exception>)definition;
}
/// <summary>
/// DetectChanges starting for '{contextType}'.
/// </summary>
public static EventDefinition<string> LogDetectChangesStarting([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogDetectChangesStarting;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogDetectChangesStarting,
() => new EventDefinition<string>(
logger.Options,
CoreEventId.DetectChangesStarting,
LogLevel.Debug,
"CoreEventId.DetectChangesStarting",
level => LoggerMessage.Define<string>(
level,
CoreEventId.DetectChangesStarting,
_resourceManager.GetString("LogDetectChangesStarting"))));
}
return (EventDefinition<string>)definition;
}
/// <summary>
/// DetectChanges completed for '{contextType}'.
/// </summary>
public static EventDefinition<string> LogDetectChangesCompleted([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogDetectChangesCompleted;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogDetectChangesCompleted,
() => new EventDefinition<string>(
logger.Options,
CoreEventId.DetectChangesCompleted,
LogLevel.Debug,
"CoreEventId.DetectChangesCompleted",
level => LoggerMessage.Define<string>(
level,
CoreEventId.DetectChangesCompleted,
_resourceManager.GetString("LogDetectChangesCompleted"))));
}
return (EventDefinition<string>)definition;
}
/// <summary>
/// Unchanged '{entityType}.{property}' detected as changed and will be marked as modified. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see property values.
/// </summary>
public static EventDefinition<string, string> LogPropertyChangeDetected([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogPropertyChangeDetected;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogPropertyChangeDetected,
() => new EventDefinition<string, string>(
logger.Options,
CoreEventId.PropertyChangeDetected,
LogLevel.Debug,
"CoreEventId.PropertyChangeDetected",
level => LoggerMessage.Define<string, string>(
level,
CoreEventId.PropertyChangeDetected,
_resourceManager.GetString("LogPropertyChangeDetected"))));
}
return (EventDefinition<string, string>)definition;
}
/// <summary>
/// Unchanged '{entityType}.{property}' detected as changed from '{oldValue}' to '{newValue}' and will be marked as modified for entity with key '{keyValues}'.
/// </summary>
public static EventDefinition<string, string, object, object, string> LogPropertyChangeDetectedSensitive([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogPropertyChangeDetectedSensitive;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogPropertyChangeDetectedSensitive,
() => new EventDefinition<string, string, object, object, string>(
logger.Options,
CoreEventId.PropertyChangeDetected,
LogLevel.Debug,
"CoreEventId.PropertyChangeDetected",
level => LoggerMessage.Define<string, string, object, object, string>(
level,
CoreEventId.PropertyChangeDetected,
_resourceManager.GetString("LogPropertyChangeDetectedSensitive"))));
}
return (EventDefinition<string, string, object, object, string>)definition;
}
/// <summary>
/// Foreign key property '{entityType}.{property}' detected as changed. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see property values.
/// </summary>
public static EventDefinition<string, string> LogForeignKeyChangeDetected([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogForeignKeyChangeDetected;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogForeignKeyChangeDetected,
() => new EventDefinition<string, string>(
logger.Options,
CoreEventId.ForeignKeyChangeDetected,
LogLevel.Debug,
"CoreEventId.ForeignKeyChangeDetected",
level => LoggerMessage.Define<string, string>(
level,
CoreEventId.ForeignKeyChangeDetected,
_resourceManager.GetString("LogForeignKeyChangeDetected"))));
}
return (EventDefinition<string, string>)definition;
}
/// <summary>
/// Foreign key property '{entityType}.{property}' detected as changed from '{oldValue}' to '{newValue}' for entity with key '{keyValues}'.
/// </summary>
public static EventDefinition<string, string, object, object, string> LogForeignKeyChangeDetectedSensitive([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogForeignKeyChangeDetectedSensitive;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogForeignKeyChangeDetectedSensitive,
() => new EventDefinition<string, string, object, object, string>(
logger.Options,
CoreEventId.ForeignKeyChangeDetected,
LogLevel.Debug,
"CoreEventId.ForeignKeyChangeDetected",
level => LoggerMessage.Define<string, string, object, object, string>(
level,
CoreEventId.ForeignKeyChangeDetected,
_resourceManager.GetString("LogForeignKeyChangeDetectedSensitive"))));
}
return (EventDefinition<string, string, object, object, string>)definition;
}
/// <summary>
/// Detected {addedCount} entities added and {removedCount} entities removed from navigation property '{entityType}.{property}'. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see key values.
/// </summary>
public static EventDefinition<int, int, string, string> LogCollectionChangeDetected([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogCollectionChangeDetected;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogCollectionChangeDetected,
() => new EventDefinition<int, int, string, string>(
logger.Options,
CoreEventId.CollectionChangeDetected,
LogLevel.Debug,
"CoreEventId.CollectionChangeDetected",
level => LoggerMessage.Define<int, int, string, string>(
level,
CoreEventId.CollectionChangeDetected,
_resourceManager.GetString("LogCollectionChangeDetected"))));
}
return (EventDefinition<int, int, string, string>)definition;
}
/// <summary>
/// Detected {addedCount} entities added and {removedCount} entities removed from navigation property '{entityType}.{property}' on entity with key '{keyValues}'.
/// </summary>
public static EventDefinition<int, int, string, string, string> LogCollectionChangeDetectedSensitive([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogCollectionChangeDetectedSensitive;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogCollectionChangeDetectedSensitive,
() => new EventDefinition<int, int, string, string, string>(
logger.Options,
CoreEventId.CollectionChangeDetected,
LogLevel.Debug,
"CoreEventId.CollectionChangeDetected",
level => LoggerMessage.Define<int, int, string, string, string>(
level,
CoreEventId.CollectionChangeDetected,
_resourceManager.GetString("LogCollectionChangeDetectedSensitive"))));
}
return (EventDefinition<int, int, string, string, string>)definition;
}
/// <summary>
/// Detected {addedCount} entities added and {removedCount} entities removed from skip navigation property '{entityType}.{property}'. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see key values.
/// </summary>
public static EventDefinition<int, int, string, string> LogSkipCollectionChangeDetected([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogSkipCollectionChangeDetected;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogSkipCollectionChangeDetected,
() => new EventDefinition<int, int, string, string>(
logger.Options,
CoreEventId.SkipCollectionChangeDetected,
LogLevel.Debug,
"CoreEventId.SkipCollectionChangeDetected",
level => LoggerMessage.Define<int, int, string, string>(
level,
CoreEventId.SkipCollectionChangeDetected,
_resourceManager.GetString("LogSkipCollectionChangeDetected"))));
}
return (EventDefinition<int, int, string, string>)definition;
}
/// <summary>
/// Detected {addedCount} entities added and {removedCount} entities removed from skip navigation property '{entityType}.{property}' on entity with key '{keyValues}'.
/// </summary>
public static EventDefinition<int, int, string, string, string> LogSkipCollectionChangeDetectedSensitive([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogSkipCollectionChangeDetectedSensitive;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogSkipCollectionChangeDetectedSensitive,
() => new EventDefinition<int, int, string, string, string>(
logger.Options,
CoreEventId.SkipCollectionChangeDetected,
LogLevel.Debug,
"CoreEventId.SkipCollectionChangeDetected",
level => LoggerMessage.Define<int, int, string, string, string>(
level,
CoreEventId.SkipCollectionChangeDetected,
_resourceManager.GetString("LogSkipCollectionChangeDetectedSensitive"))));
}
return (EventDefinition<int, int, string, string, string>)definition;
}
/// <summary>
/// Navigation property '{entityType}.{property}' detected as changed. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see key values.
/// </summary>
public static EventDefinition<string, string> LogReferenceChangeDetected([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogReferenceChangeDetected;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogReferenceChangeDetected,
() => new EventDefinition<string, string>(
logger.Options,
CoreEventId.ReferenceChangeDetected,
LogLevel.Debug,
"CoreEventId.ReferenceChangeDetected",
level => LoggerMessage.Define<string, string>(
level,
CoreEventId.ReferenceChangeDetected,
_resourceManager.GetString("LogReferenceChangeDetected"))));
}
return (EventDefinition<string, string>)definition;
}
/// <summary>
/// Navigation property '{entityType}.{property}' for entity with key '{keyValues}' detected as changed.
/// </summary>
public static EventDefinition<string, string, string> LogReferenceChangeDetectedSensitive([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogReferenceChangeDetectedSensitive;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogReferenceChangeDetectedSensitive,
() => new EventDefinition<string, string, string>(
logger.Options,
CoreEventId.ReferenceChangeDetected,
LogLevel.Debug,
"CoreEventId.ReferenceChangeDetected",
level => LoggerMessage.Define<string, string, string>(
level,
CoreEventId.ReferenceChangeDetected,
_resourceManager.GetString("LogReferenceChangeDetectedSensitive"))));
}
return (EventDefinition<string, string, string>)definition;
}
/// <summary>
/// Cascade state change of '{entityType}' entity to '{state}' due to deletion of parent '{parentType}' entity. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see key values.
/// </summary>
public static EventDefinition<string, EntityState, string> LogCascadeDelete([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogCascadeDelete;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogCascadeDelete,
() => new EventDefinition<string, EntityState, string>(
logger.Options,
CoreEventId.CascadeDelete,
LogLevel.Debug,
"CoreEventId.CascadeDelete",
level => LoggerMessage.Define<string, EntityState, string>(
level,
CoreEventId.CascadeDelete,
_resourceManager.GetString("LogCascadeDelete"))));
}
return (EventDefinition<string, EntityState, string>)definition;
}
/// <summary>
/// Cascade state change of '{entityType}' entity with key '{keyValues}' to '{state}' due to deletion of parent '{parentType}' entity with key '{parentKeyValues}'.
/// </summary>
public static EventDefinition<string, string, EntityState, string, string> LogCascadeDeleteSensitive([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogCascadeDeleteSensitive;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogCascadeDeleteSensitive,
() => new EventDefinition<string, string, EntityState, string, string>(
logger.Options,
CoreEventId.CascadeDelete,
LogLevel.Debug,
"CoreEventId.CascadeDelete",
level => LoggerMessage.Define<string, string, EntityState, string, string>(
level,
CoreEventId.CascadeDelete,
_resourceManager.GetString("LogCascadeDeleteSensitive"))));
}
return (EventDefinition<string, string, EntityState, string, string>)definition;
}
/// <summary>
/// '{entityType}' entity changed to '{state}' state due to severed required relationship to parent '{parentType}' entity. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see key values.
/// </summary>
public static EventDefinition<string, EntityState, string> LogCascadeDeleteOrphan([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogCascadeDeleteOrphan;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogCascadeDeleteOrphan,
() => new EventDefinition<string, EntityState, string>(
logger.Options,
CoreEventId.CascadeDeleteOrphan,
LogLevel.Debug,
"CoreEventId.CascadeDeleteOrphan",
level => LoggerMessage.Define<string, EntityState, string>(
level,
CoreEventId.CascadeDeleteOrphan,
_resourceManager.GetString("LogCascadeDeleteOrphan"))));
}
return (EventDefinition<string, EntityState, string>)definition;
}
/// <summary>
/// '{entityType}' entity with key '{keyValues}' changed to '{state}' state due to severed required relationship to parent '{parentType}' entity.
/// </summary>
public static EventDefinition<string, string, EntityState, string> LogCascadeDeleteOrphanSensitive([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogCascadeDeleteOrphanSensitive;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogCascadeDeleteOrphanSensitive,
() => new EventDefinition<string, string, EntityState, string>(
logger.Options,
CoreEventId.CascadeDeleteOrphan,
LogLevel.Debug,
"CoreEventId.CascadeDeleteOrphan",
level => LoggerMessage.Define<string, string, EntityState, string>(
level,
CoreEventId.CascadeDeleteOrphan,
_resourceManager.GetString("LogCascadeDeleteOrphanSensitive"))));
}
return (EventDefinition<string, string, EntityState, string>)definition;
}
/// <summary>
/// Context '{contextType}' started tracking '{entityType}' entity. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see key values.
/// </summary>
public static EventDefinition<string, string> LogStartedTracking([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogStartedTracking;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogStartedTracking,
() => new EventDefinition<string, string>(
logger.Options,
CoreEventId.StartedTracking,
LogLevel.Debug,
"CoreEventId.StartedTracking",
level => LoggerMessage.Define<string, string>(
level,
CoreEventId.StartedTracking,
_resourceManager.GetString("LogStartedTracking"))));
}
return (EventDefinition<string, string>)definition;
}
/// <summary>
/// Context '{contextType}' started tracking '{entityType}' entity with key '{keyValues}'.
/// </summary>
public static EventDefinition<string, string, string> LogStartedTrackingSensitive([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogStartedTrackingSensitive;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogStartedTrackingSensitive,
() => new EventDefinition<string, string, string>(
logger.Options,
CoreEventId.StartedTracking,
LogLevel.Debug,
"CoreEventId.StartedTracking",
level => LoggerMessage.Define<string, string, string>(
level,
CoreEventId.StartedTracking,
_resourceManager.GetString("LogStartedTrackingSensitive"))));
}
return (EventDefinition<string, string, string>)definition;
}
/// <summary>
/// An '{entityType}' entity tracked by '{contextType}' changed from '{oldState}' to '{newState}'. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see key values.
/// </summary>
public static EventDefinition<string, string, EntityState, EntityState> LogStateChanged([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogStateChanged;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogStateChanged,
() => new EventDefinition<string, string, EntityState, EntityState>(
logger.Options,
CoreEventId.StateChanged,
LogLevel.Debug,
"CoreEventId.StateChanged",
level => LoggerMessage.Define<string, string, EntityState, EntityState>(
level,
CoreEventId.StateChanged,
_resourceManager.GetString("LogStateChanged"))));
}
return (EventDefinition<string, string, EntityState, EntityState>)definition;
}
/// <summary>
/// The '{entityType}' entity with key '{keyValues}' tracked by '{contextType}' changed from '{oldState}' to '{newState}'.
/// </summary>
public static EventDefinition<string, string, string, EntityState, EntityState> LogStateChangedSensitive([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogStateChangedSensitive;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogStateChangedSensitive,
() => new EventDefinition<string, string, string, EntityState, EntityState>(
logger.Options,
CoreEventId.StateChanged,
LogLevel.Debug,
"CoreEventId.StateChanged",
level => LoggerMessage.Define<string, string, string, EntityState, EntityState>(
level,
CoreEventId.StateChanged,
_resourceManager.GetString("LogStateChangedSensitive"))));
}
return (EventDefinition<string, string, string, EntityState, EntityState>)definition;
}
/// <summary>
/// '{contextType}' generated a value for the '{property}' property of new '{entityType}' entity. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see key values.
/// </summary>
public static EventDefinition<string, string, string> LogValueGenerated([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogValueGenerated;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogValueGenerated,
() => new EventDefinition<string, string, string>(
logger.Options,
CoreEventId.ValueGenerated,
LogLevel.Debug,
"CoreEventId.ValueGenerated",
level => LoggerMessage.Define<string, string, string>(
level,
CoreEventId.ValueGenerated,
_resourceManager.GetString("LogValueGenerated"))));
}
return (EventDefinition<string, string, string>)definition;
}
/// <summary>
/// '{contextType}' generated value '{keyValue}' for the '{property}' property of new '{entityType}' entity.
/// </summary>
public static EventDefinition<string, object, string, string> LogValueGeneratedSensitive([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogValueGeneratedSensitive;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogValueGeneratedSensitive,
() => new EventDefinition<string, object, string, string>(
logger.Options,
CoreEventId.ValueGenerated,
LogLevel.Debug,
"CoreEventId.ValueGenerated",
level => LoggerMessage.Define<string, object, string, string>(
level,
CoreEventId.ValueGenerated,
_resourceManager.GetString("LogValueGeneratedSensitive"))));
}
return (EventDefinition<string, object, string, string>)definition;
}
/// <summary>
/// '{contextType}' generated a temporary value for the '{property}' property of new '{entityType}' entity. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see key values.
/// </summary>
public static EventDefinition<string, string, string> LogTempValueGenerated([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogTempValueGenerated;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogTempValueGenerated,
() => new EventDefinition<string, string, string>(
logger.Options,
CoreEventId.ValueGenerated,
LogLevel.Debug,
"CoreEventId.ValueGenerated",
level => LoggerMessage.Define<string, string, string>(
level,
CoreEventId.ValueGenerated,
_resourceManager.GetString("LogTempValueGenerated"))));
}
return (EventDefinition<string, string, string>)definition;
}
/// <summary>
/// '{contextType}' generated temporary value '{keyValue}' for the '{property}' property of new '{entityType}' entity.
/// </summary>
public static EventDefinition<string, object, string, string> LogTempValueGeneratedSensitive([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogTempValueGeneratedSensitive;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogTempValueGeneratedSensitive,
() => new EventDefinition<string, object, string, string>(
logger.Options,
CoreEventId.ValueGenerated,
LogLevel.Debug,
"CoreEventId.ValueGenerated",
level => LoggerMessage.Define<string, object, string, string>(
level,
CoreEventId.ValueGenerated,
_resourceManager.GetString("LogTempValueGeneratedSensitive"))));
}
return (EventDefinition<string, object, string, string>)definition;
}
/// <summary>
/// SaveChanges starting for '{contextType}'.
/// </summary>
public static EventDefinition<string> LogSaveChangesStarting([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogSaveChangesStarting;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogSaveChangesStarting,
() => new EventDefinition<string>(
logger.Options,
CoreEventId.SaveChangesStarting,
LogLevel.Debug,
"CoreEventId.SaveChangesStarting",
level => LoggerMessage.Define<string>(
level,
CoreEventId.SaveChangesStarting,
_resourceManager.GetString("LogSaveChangesStarting"))));
}
return (EventDefinition<string>)definition;
}
/// <summary>
/// SaveChanges completed for '{contextType}' with {savedCount} entities written to the database.
/// </summary>
public static EventDefinition<string, int> LogSaveChangesCompleted([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogSaveChangesCompleted;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogSaveChangesCompleted,
() => new EventDefinition<string, int>(
logger.Options,
CoreEventId.SaveChangesCompleted,
LogLevel.Debug,
"CoreEventId.SaveChangesCompleted",
level => LoggerMessage.Define<string, int>(
level,
CoreEventId.SaveChangesCompleted,
_resourceManager.GetString("LogSaveChangesCompleted"))));
}
return (EventDefinition<string, int>)definition;
}
/// <summary>
/// '{contextType}' disposed.
/// </summary>
public static EventDefinition<string> LogContextDisposed([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogContextDisposed;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogContextDisposed,
() => new EventDefinition<string>(
logger.Options,
CoreEventId.ContextDisposed,
LogLevel.Debug,
"CoreEventId.ContextDisposed",
level => LoggerMessage.Define<string>(
level,
CoreEventId.ContextDisposed,
_resourceManager.GetString("LogContextDisposed"))));
}
return (EventDefinition<string>)definition;
}
/// <summary>
/// {plan}
/// </summary>
public static EventDefinition<string> LogQueryExecutionPlanned([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogQueryExecutionPlanned;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogQueryExecutionPlanned,
() => new EventDefinition<string>(
logger.Options,
CoreEventId.QueryExecutionPlanned,
LogLevel.Debug,
"CoreEventId.QueryExecutionPlanned",
level => LoggerMessage.Define<string>(
level,
CoreEventId.QueryExecutionPlanned,
_resourceManager.GetString("LogQueryExecutionPlanned"))));
}
return (EventDefinition<string>)definition;
}
/// <summary>
/// Sensitive data logging is enabled. Log entries and exception messages may include sensitive application data, this mode should only be enabled during development.
/// </summary>
public static EventDefinition LogSensitiveDataLoggingEnabled([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogSensitiveDataLoggingEnabled;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogSensitiveDataLoggingEnabled,
() => new EventDefinition(
logger.Options,
CoreEventId.SensitiveDataLoggingEnabledWarning,
LogLevel.Warning,
"CoreEventId.SensitiveDataLoggingEnabledWarning",
level => LoggerMessage.Define(
level,
CoreEventId.SensitiveDataLoggingEnabledWarning,
_resourceManager.GetString("LogSensitiveDataLoggingEnabled"))));
}
return (EventDefinition)definition;
}
/// <summary>
/// Collection navigations are only considered null if their parent entity is null. Use '.Any()' to check whether collection navigation '{navigationPath}' is empty.
/// </summary>
public static EventDefinition<string> LogPossibleUnintendedCollectionNavigationNullComparison([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogPossibleUnintendedCollectionNavigationNullComparison;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogPossibleUnintendedCollectionNavigationNullComparison,
() => new EventDefinition<string>(
logger.Options,
CoreEventId.PossibleUnintendedCollectionNavigationNullComparisonWarning,
LogLevel.Warning,
"CoreEventId.PossibleUnintendedCollectionNavigationNullComparisonWarning",
level => LoggerMessage.Define<string>(
level,
CoreEventId.PossibleUnintendedCollectionNavigationNullComparisonWarning,
_resourceManager.GetString("LogPossibleUnintendedCollectionNavigationNullComparison"))));
}
return (EventDefinition<string>)definition;
}
/// <summary>
/// Possible unintended reference comparison between '{left}' and '{right}'.
/// </summary>
public static EventDefinition<object, object> LogPossibleUnintendedReferenceComparison([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogPossibleUnintendedReferenceComparison;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogPossibleUnintendedReferenceComparison,
() => new EventDefinition<object, object>(
logger.Options,
CoreEventId.PossibleUnintendedReferenceComparisonWarning,
LogLevel.Warning,
"CoreEventId.PossibleUnintendedReferenceComparisonWarning",
level => LoggerMessage.Define<object, object>(
level,
CoreEventId.PossibleUnintendedReferenceComparisonWarning,
_resourceManager.GetString("LogPossibleUnintendedReferenceComparison"))));
}
return (EventDefinition<object, object>)definition;
}
/// <summary>
/// Invalid include path '{navigationChain}', couldn't find navigation for '{navigationName}'.
/// </summary>
public static EventDefinition<object, object> LogInvalidIncludePath([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogInvalidIncludePath;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogInvalidIncludePath,
() => new EventDefinition<object, object>(
logger.Options,
CoreEventId.InvalidIncludePathError,
LogLevel.Error,
"CoreEventId.InvalidIncludePathError",
level => LoggerMessage.Define<object, object>(
level,
CoreEventId.InvalidIncludePathError,
_resourceManager.GetString("LogInvalidIncludePath"))));
}
return (EventDefinition<object, object>)definition;
}
/// <summary>
/// The same entity is being tracked as different weak entity types '{dependent1}' and '{dependent2}'. If a property value changes it will result in two store changes, which might not be the desired outcome.
/// </summary>
public static EventDefinition<string, string> LogDuplicateDependentEntityTypeInstance([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogDuplicateDependentEntityTypeInstance;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogDuplicateDependentEntityTypeInstance,
() => new EventDefinition<string, string>(
logger.Options,
CoreEventId.DuplicateDependentEntityTypeInstanceWarning,
LogLevel.Warning,
"CoreEventId.DuplicateDependentEntityTypeInstanceWarning",
level => LoggerMessage.Define<string, string>(
level,
CoreEventId.DuplicateDependentEntityTypeInstanceWarning,
_resourceManager.GetString("LogDuplicateDependentEntityTypeInstance"))));
}
return (EventDefinition<string, string>)definition;
}
/// <summary>
/// The property '{property}' on entity type '{entityType}' was created in shadow state because there are no eligible CLR members with a matching name.
/// </summary>
public static EventDefinition<string, string> LogShadowPropertyCreated([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogShadowPropertyCreated;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogShadowPropertyCreated,
() => new EventDefinition<string, string>(
logger.Options,
CoreEventId.ShadowPropertyCreated,
LogLevel.Debug,
"CoreEventId.ShadowPropertyCreated",
level => LoggerMessage.Define<string, string>(
level,
CoreEventId.ShadowPropertyCreated,
_resourceManager.GetString("LogShadowPropertyCreated"))));
}
return (EventDefinition<string, string>)definition;
}
/// <summary>
/// The property '{property}' on entity type '{entityType}' is a collection or enumeration type with a value converter but with no value comparer. Set a value comparer to ensure the collection/enumeration elements are compared correctly.
/// </summary>
public static EventDefinition<string, string> LogCollectionWithoutComparer([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogCollectionWithoutComparer;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogCollectionWithoutComparer,
() => new EventDefinition<string, string>(
logger.Options,
CoreEventId.CollectionWithoutComparer,
LogLevel.Warning,
"CoreEventId.CollectionWithoutComparer",
level => LoggerMessage.Define<string, string>(
level,
CoreEventId.CollectionWithoutComparer,
_resourceManager.GetString("LogCollectionWithoutComparer"))));
}
return (EventDefinition<string, string>)definition;
}
/// <summary>
/// A transient exception has been encountered during execution and the operation will be retried after {delay}ms.{newline}{error}
/// </summary>
public static EventDefinition<int, string, Exception> LogExecutionStrategyRetrying([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogExecutionStrategyRetrying;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogExecutionStrategyRetrying,
() => new EventDefinition<int, string, Exception>(
logger.Options,
CoreEventId.ExecutionStrategyRetrying,
LogLevel.Information,
"CoreEventId.ExecutionStrategyRetrying",
level => LoggerMessage.Define<int, string, Exception>(
level,
CoreEventId.ExecutionStrategyRetrying,
_resourceManager.GetString("LogExecutionStrategyRetrying"))));
}
return (EventDefinition<int, string, Exception>)definition;
}
/// <summary>
/// Navigation property '{navigation}' of entity type '{entityType}' is being lazy-loaded.
/// </summary>
public static EventDefinition<string, string> LogNavigationLazyLoading([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogNavigationLazyLoading;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogNavigationLazyLoading,
() => new EventDefinition<string, string>(
logger.Options,
CoreEventId.NavigationLazyLoading,
LogLevel.Debug,
"CoreEventId.NavigationLazyLoading",
level => LoggerMessage.Define<string, string>(
level,
CoreEventId.NavigationLazyLoading,
_resourceManager.GetString("LogNavigationLazyLoading"))));
}
return (EventDefinition<string, string>)definition;
}
/// <summary>
/// An attempt was made to lazy-load navigation property '{navigation}' on entity type '{entityType}' after the associated DbContext was disposed.
/// </summary>
public static EventDefinition<string, string> LogLazyLoadOnDisposedContext([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogLazyLoadOnDisposedContext;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogLazyLoadOnDisposedContext,
() => new EventDefinition<string, string>(
logger.Options,
CoreEventId.LazyLoadOnDisposedContextWarning,
LogLevel.Warning,
"CoreEventId.LazyLoadOnDisposedContextWarning",
level => LoggerMessage.Define<string, string>(
level,
CoreEventId.LazyLoadOnDisposedContextWarning,
_resourceManager.GetString("LogLazyLoadOnDisposedContext"))));
}
return (EventDefinition<string, string>)definition;
}
/// <summary>
/// An attempt was made to lazy-load navigation property '{navigation}' on detached entity of type '{entityType}'. Lazy-loading is not supported for detached entities or entities that are loaded with 'AsNoTracking()'.
/// </summary>
public static EventDefinition<string, string> LogDetachedLazyLoading([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogDetachedLazyLoading;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogDetachedLazyLoading,
() => new EventDefinition<string, string>(
logger.Options,
CoreEventId.DetachedLazyLoadingWarning,
LogLevel.Warning,
"CoreEventId.DetachedLazyLoadingWarning",
level => LoggerMessage.Define<string, string>(
level,
CoreEventId.DetachedLazyLoadingWarning,
_resourceManager.GetString("LogDetachedLazyLoading"))));
}
return (EventDefinition<string, string>)definition;
}
/// <summary>
/// The index {redundantIndex} was not created on entity type '{firstEntityType}' as the properties are already covered by the index {otherIndex}.
/// </summary>
public static EventDefinition<string, string, string> LogRedundantIndexRemoved([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogRedundantIndexRemoved;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogRedundantIndexRemoved,
() => new EventDefinition<string, string, string>(
logger.Options,
CoreEventId.RedundantIndexRemoved,
LogLevel.Debug,
"CoreEventId.RedundantIndexRemoved",
level => LoggerMessage.Define<string, string, string>(
level,
CoreEventId.RedundantIndexRemoved,
_resourceManager.GetString("LogRedundantIndexRemoved"))));
}
return (EventDefinition<string, string, string>)definition;
}
/// <summary>
/// For the relationship between dependent '{dependentToPrincipalNavigationSpecification}' and principal '{principalToDependentNavigationSpecification}', the foreign key properties haven't been configured by convention because the best match {foreignKey} are incompatible with the current principal key {principalKey}. This message can be disregarded if explicit configuration has been specified.
/// </summary>
public static EventDefinition<string, string, string, string> LogIncompatibleMatchingForeignKeyProperties([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogIncompatibleMatchingForeignKeyProperties;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogIncompatibleMatchingForeignKeyProperties,
() => new EventDefinition<string, string, string, string>(
logger.Options,
CoreEventId.IncompatibleMatchingForeignKeyProperties,
LogLevel.Debug,
"CoreEventId.IncompatibleMatchingForeignKeyProperties",
level => LoggerMessage.Define<string, string, string, string>(
level,
CoreEventId.IncompatibleMatchingForeignKeyProperties,
_resourceManager.GetString("LogIncompatibleMatchingForeignKeyProperties"))));
}
return (EventDefinition<string, string, string, string>)definition;
}
/// <summary>
/// The navigation property '{navigation}' has a RequiredAttribute causing the entity type '{entityType}' to be configured as the dependent side in the corresponding relationship.
/// </summary>
[Obsolete]
public static EventDefinition<string, string> LogRequiredAttributeInverted([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogRequiredAttributeInverted;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogRequiredAttributeInverted,
() => new EventDefinition<string, string>(
logger.Options,
CoreEventId.RequiredAttributeInverted,
LogLevel.Debug,
"CoreEventId.RequiredAttributeInverted",
level => LoggerMessage.Define<string, string>(
level,
CoreEventId.RequiredAttributeInverted,
_resourceManager.GetString("LogRequiredAttributeInverted"))));
}
return (EventDefinition<string, string>)definition;
}
/// <summary>
/// The navigation property '{navigation}' is non-nullable, causing the entity type '{entityType}' to be configured as the dependent side in the corresponding relationship.
/// </summary>
[Obsolete]
public static EventDefinition<string, string> LogNonNullableInverted([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogNonNullableInverted;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogNonNullableInverted,
() => new EventDefinition<string, string>(
logger.Options,
CoreEventId.NonNullableInverted,
LogLevel.Debug,
"CoreEventId.NonNullableInverted",
level => LoggerMessage.Define<string, string>(
level,
CoreEventId.NonNullableInverted,
_resourceManager.GetString("LogNonNullableInverted"))));
}
return (EventDefinition<string, string>)definition;
}
/// <summary>
/// The RequiredAttribute on '{principalEntityType}.{principalNavigation}' was ignored because there is also a RequiredAttribute on '{dependentEntityType}.{dependentNavigation}'. RequiredAttribute should only be specified on the dependent side of the relationship.
/// </summary>
public static EventDefinition<string, string, string, string> LogRequiredAttributeOnBothNavigations([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogRequiredAttributeOnBothNavigations;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogRequiredAttributeOnBothNavigations,
() => new EventDefinition<string, string, string, string>(
logger.Options,
CoreEventId.RequiredAttributeOnBothNavigations,
LogLevel.Debug,
"CoreEventId.RequiredAttributeOnBothNavigations",
level => LoggerMessage.Define<string, string, string, string>(
level,
CoreEventId.RequiredAttributeOnBothNavigations,
_resourceManager.GetString("LogRequiredAttributeOnBothNavigations"))));
}
return (EventDefinition<string, string, string, string>)definition;
}
/// <summary>
/// '{principalEntityType}.{principalNavigation}' may still be null at runtime despite being declared as non-nullable since only the navigation to principal '{dependentEntityType}.{dependentNavigation}' can be configured as required.
/// </summary>
public static EventDefinition<string, string, string, string> LogNonNullableReferenceOnBothNavigations([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogNonNullableReferenceOnBothNavigations;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogNonNullableReferenceOnBothNavigations,
() => new EventDefinition<string, string, string, string>(
logger.Options,
CoreEventId.NonNullableReferenceOnBothNavigations,
LogLevel.Debug,
"CoreEventId.NonNullableReferenceOnBothNavigations",
level => LoggerMessage.Define<string, string, string, string>(
level,
CoreEventId.NonNullableReferenceOnBothNavigations,
_resourceManager.GetString("LogNonNullableReferenceOnBothNavigations"))));
}
return (EventDefinition<string, string, string, string>)definition;
}
/// <summary>
/// Navigations '{dependentEntityType}.{dependentNavigation}' and '{principalEntityType}.{principalNavigation}' were separated into two relationships as ForeignKeyAttribute was specified on navigations on both sides.
/// </summary>
public static EventDefinition<string, string, string, string> LogForeignKeyAttributesOnBothNavigations([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogForeignKeyAttributesOnBothNavigations;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogForeignKeyAttributesOnBothNavigations,
() => new EventDefinition<string, string, string, string>(
logger.Options,
CoreEventId.ForeignKeyAttributesOnBothNavigationsWarning,
LogLevel.Warning,
"CoreEventId.ForeignKeyAttributesOnBothNavigationsWarning",
level => LoggerMessage.Define<string, string, string, string>(
level,
CoreEventId.ForeignKeyAttributesOnBothNavigationsWarning,
_resourceManager.GetString("LogForeignKeyAttributesOnBothNavigations"))));
}
return (EventDefinition<string, string, string, string>)definition;
}
/// <summary>
/// Navigations '{dependentEntityType}.{dependentNavigation}' and '{principalEntityType}.{principalNavigation}' were separated into two relationships as ForeignKeyAttribute was specified on properties '{dependentProperty}' and '{principalProperty}' on both sides.
/// </summary>
public static EventDefinition<string, string, string, string, string, string> LogForeignKeyAttributesOnBothProperties([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogForeignKeyAttributesOnBothProperties;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogForeignKeyAttributesOnBothProperties,
() => new EventDefinition<string, string, string, string, string, string>(
logger.Options,
CoreEventId.ForeignKeyAttributesOnBothPropertiesWarning,
LogLevel.Warning,
"CoreEventId.ForeignKeyAttributesOnBothPropertiesWarning",
level => LoggerMessage.Define<string, string, string, string, string, string>(
level,
CoreEventId.ForeignKeyAttributesOnBothPropertiesWarning,
_resourceManager.GetString("LogForeignKeyAttributesOnBothProperties"))));
}
return (EventDefinition<string, string, string, string, string, string>)definition;
}
/// <summary>
/// The relationship was separated into two relationships because ForeignKeyAttribute specified on the navigation '{navigationEntityType}.{navigation}' doesn't match the ForeignKeyAttribute specified on the property '{propertyEntityType}.{property}'.
/// </summary>
public static EventDefinition<string, string, string, string> LogConflictingForeignKeyAttributesOnNavigationAndProperty([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogConflictingForeignKeyAttributesOnNavigationAndProperty;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogConflictingForeignKeyAttributesOnNavigationAndProperty,
() => new EventDefinition<string, string, string, string>(
logger.Options,
CoreEventId.ConflictingForeignKeyAttributesOnNavigationAndPropertyWarning,
LogLevel.Warning,
"CoreEventId.ConflictingForeignKeyAttributesOnNavigationAndPropertyWarning",
level => LoggerMessage.Define<string, string, string, string>(
level,
CoreEventId.ConflictingForeignKeyAttributesOnNavigationAndPropertyWarning,
_resourceManager.GetString("LogConflictingForeignKeyAttributesOnNavigationAndProperty"))));
}
return (EventDefinition<string, string, string, string>)definition;
}
/// <summary>
/// There are multiple navigations ({navigations}) configured with InversePropertyAttribute that point to the same inverse navigation '{inverseNavigation}'.
/// </summary>
public static EventDefinition<string, string> LogMultipleInversePropertiesSameTarget([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogMultipleInversePropertiesSameTarget;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogMultipleInversePropertiesSameTarget,
() => new EventDefinition<string, string>(
logger.Options,
CoreEventId.MultipleInversePropertiesSameTargetWarning,
LogLevel.Warning,
"CoreEventId.MultipleInversePropertiesSameTargetWarning",
level => LoggerMessage.Define<string, string>(
level,
CoreEventId.MultipleInversePropertiesSameTargetWarning,
_resourceManager.GetString("LogMultipleInversePropertiesSameTarget"))));
}
return (EventDefinition<string, string>)definition;
}
/// <summary>
/// There are multiple relationships between '{dependentEntityType}' and '{principalEntityType}' without configured foreign key properties causing EF to create shadow properties on '{dependentType}' with names dependent on the discovery order.
/// </summary>
public static EventDefinition<string, string, string> LogConflictingShadowForeignKeys([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogConflictingShadowForeignKeys;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogConflictingShadowForeignKeys,
() => new EventDefinition<string, string, string>(
logger.Options,
CoreEventId.ConflictingShadowForeignKeysWarning,
LogLevel.Warning,
"CoreEventId.ConflictingShadowForeignKeysWarning",
level => LoggerMessage.Define<string, string, string>(
level,
CoreEventId.ConflictingShadowForeignKeysWarning,
_resourceManager.GetString("LogConflictingShadowForeignKeys"))));
}
return (EventDefinition<string, string, string>)definition;
}
/// <summary>
/// No relationship from '{firstEntityType}' to '{secondEntityType}' has been configured by convention because there are multiple properties on one entity type {navigationProperties} that could be matched with the properties on the other entity type {inverseNavigations}. This message can be disregarded if explicit configuration has been specified.
/// </summary>
public static EventDefinition<string, string, string, string> LogMultipleNavigationProperties([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogMultipleNavigationProperties;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogMultipleNavigationProperties,
() => new EventDefinition<string, string, string, string>(
logger.Options,
CoreEventId.MultipleNavigationProperties,
LogLevel.Debug,
"CoreEventId.MultipleNavigationProperties",
level => LoggerMessage.Define<string, string, string, string>(
level,
CoreEventId.MultipleNavigationProperties,
_resourceManager.GetString("LogMultipleNavigationProperties"))));
}
return (EventDefinition<string, string, string, string>)definition;
}
/// <summary>
/// Primary key hasn't been configured by convention as both properties '{firstProperty}' and '{secondProperty}' could be used as the primary key for the entity type '{entityType}'. This message can be disregarded if explicit configuration has been specified.
/// </summary>
public static EventDefinition<string, string, string> LogMultiplePrimaryKeyCandidates([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogMultiplePrimaryKeyCandidates;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogMultiplePrimaryKeyCandidates,
() => new EventDefinition<string, string, string>(
logger.Options,
CoreEventId.MultiplePrimaryKeyCandidates,
LogLevel.Debug,
"CoreEventId.MultiplePrimaryKeyCandidates",
level => LoggerMessage.Define<string, string, string>(
level,
CoreEventId.MultiplePrimaryKeyCandidates,
_resourceManager.GetString("LogMultiplePrimaryKeyCandidates"))));
}
return (EventDefinition<string, string, string>)definition;
}
/// <summary>
/// The navigation '{targetEntityType}.{inverseNavigation}' cannot be used as the inverse of '{weakEntityType}.{navigation}' because it's not the defining navigation '{definingNavigation}'
/// </summary>
public static EventDefinition<string, string, string, string, string> LogNonDefiningInverseNavigation([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogNonDefiningInverseNavigation;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogNonDefiningInverseNavigation,
() => new EventDefinition<string, string, string, string, string>(
logger.Options,
CoreEventId.NonDefiningInverseNavigationWarning,
LogLevel.Warning,
"CoreEventId.NonDefiningInverseNavigationWarning",
level => LoggerMessage.Define<string, string, string, string, string>(
level,
CoreEventId.NonDefiningInverseNavigationWarning,
_resourceManager.GetString("LogNonDefiningInverseNavigation"))));
}
return (EventDefinition<string, string, string, string, string>)definition;
}
/// <summary>
/// The navigation '{targetEntityType}.{inverseNavigation}' cannot be used as the inverse of '{ownedEntityType}.{navigation}' because it's not the ownership navigation '{ownershipNavigation}'
/// </summary>
public static EventDefinition<string, string, string, string, string> LogNonOwnershipInverseNavigation([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogNonOwnershipInverseNavigation;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogNonOwnershipInverseNavigation,
() => new EventDefinition<string, string, string, string, string>(
logger.Options,
CoreEventId.NonOwnershipInverseNavigationWarning,
LogLevel.Warning,
"CoreEventId.NonOwnershipInverseNavigationWarning",
level => LoggerMessage.Define<string, string, string, string, string>(
level,
CoreEventId.NonOwnershipInverseNavigationWarning,
_resourceManager.GetString("LogNonOwnershipInverseNavigation"))));
}
return (EventDefinition<string, string, string, string, string>)definition;
}
/// <summary>
/// {error}
/// </summary>
public static EventDefinition<Exception> LogOptimisticConcurrencyException([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogOptimisticConcurrencyException;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogOptimisticConcurrencyException,
() => new EventDefinition<Exception>(
logger.Options,
CoreEventId.OptimisticConcurrencyException,
LogLevel.Debug,
"CoreEventId.OptimisticConcurrencyException",
level => LoggerMessage.Define<Exception>(
level,
CoreEventId.OptimisticConcurrencyException,
_resourceManager.GetString("LogOptimisticConcurrencyException"))));
}
return (EventDefinition<Exception>)definition;
}
/// <summary>
/// The foreign key {redundantForeignKey} on entity type '{entityType} targets itself, it should be removed since it serves no purpose.
/// </summary>
public static EventDefinition<string, string> LogRedundantForeignKey([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogRedundantForeignKey;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogRedundantForeignKey,
() => new EventDefinition<string, string>(
logger.Options,
CoreEventId.RedundantForeignKeyWarning,
LogLevel.Warning,
"CoreEventId.RedundantForeignKeyWarning",
level => LoggerMessage.Define<string, string>(
level,
CoreEventId.RedundantForeignKeyWarning,
_resourceManager.GetString("LogRedundantForeignKey"))));
}
return (EventDefinition<string, string>)definition;
}
/// <summary>
/// The RequiredAttribute on '{principalEntityType}.{principalNavigation}' was ignored because it is a collection. RequiredAttribute should only be specified on reference navigations pointing to the principal side of the relationship.
/// </summary>
public static EventDefinition<string, string> LogRequiredAttributeOnCollection([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogRequiredAttributeOnCollection;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogRequiredAttributeOnCollection,
() => new EventDefinition<string, string>(
logger.Options,
CoreEventId.RequiredAttributeOnCollection,
LogLevel.Debug,
"CoreEventId.RequiredAttributeOnCollection",
level => LoggerMessage.Define<string, string>(
level,
CoreEventId.RequiredAttributeOnCollection,
_resourceManager.GetString("LogRequiredAttributeOnCollection"))));
}
return (EventDefinition<string, string>)definition;
}
/// <summary>
/// The RequiredAttribute on '{principalEntityType}.{principalNavigation}' is invalid. RequiredAttribute should only be specified on the navigation pointing to the principal side of the relationship. To change the dependent side configure the foreign key properties.
/// </summary>
public static EventDefinition<string, string> LogRequiredAttributeOnDependent([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogRequiredAttributeOnDependent;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogRequiredAttributeOnDependent,
() => new EventDefinition<string, string>(
logger.Options,
CoreEventId.RequiredAttributeOnDependent,
LogLevel.Error,
"CoreEventId.RequiredAttributeOnDependent",
level => LoggerMessage.Define<string, string>(
level,
CoreEventId.RequiredAttributeOnDependent,
_resourceManager.GetString("LogRequiredAttributeOnDependent"))));
}
return (EventDefinition<string, string>)definition;
}
/// <summary>
/// '{principalEntityType}.{principalNavigation}' may still be null at runtime despite being declared as non-nullable since only the navigation to principal can be configured as required.
/// </summary>
public static EventDefinition<string, string> LogNonNullableReferenceOnDependent([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogNonNullableReferenceOnDependent;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogNonNullableReferenceOnDependent,
() => new EventDefinition<string, string>(
logger.Options,
CoreEventId.NonNullableReferenceOnDependent,
LogLevel.Debug,
"CoreEventId.NonNullableReferenceOnDependent",
level => LoggerMessage.Define<string, string>(
level,
CoreEventId.NonNullableReferenceOnDependent,
_resourceManager.GetString("LogNonNullableReferenceOnDependent"))));
}
return (EventDefinition<string, string>)definition;
}
/// <summary>
/// 'AddEntityFramework*' was called on the service provider, but 'UseInternalServiceProvider' wasn't called in the DbContext options configuration. Remove the 'AddEntityFramework*' call as in most cases it's not needed and might cause conflicts with other products and services registered in the same service provider.
/// </summary>
public static EventDefinition LogRedundantAddServicesCall([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogRedundantAddServicesCall;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogRedundantAddServicesCall,
() => new EventDefinition(
logger.Options,
CoreEventId.RedundantAddServicesCallWarning,
LogLevel.Warning,
"CoreEventId.RedundantAddServicesCallWarning",
level => LoggerMessage.Define(
level,
CoreEventId.RedundantAddServicesCallWarning,
_resourceManager.GetString("LogRedundantAddServicesCall"))));
}
return (EventDefinition)definition;
}
/// <summary>
/// Conflicting attributes have been applied: the 'Key' attribute on property '{property}' and the 'Keyless' attribute on its entity '{entity}'. Note that the entity will have no key unless you use fluent API to override this.
/// </summary>
public static EventDefinition<string, string> LogConflictingKeylessAndKeyAttributes([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogConflictingKeylessAndKeyAttributes;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogConflictingKeylessAndKeyAttributes,
() => new EventDefinition<string, string>(
logger.Options,
CoreEventId.ConflictingKeylessAndKeyAttributesWarning,
LogLevel.Warning,
"CoreEventId.ConflictingKeylessAndKeyAttributesWarning",
level => LoggerMessage.Define<string, string>(
level,
CoreEventId.ConflictingKeylessAndKeyAttributesWarning,
_resourceManager.GetString("LogConflictingKeylessAndKeyAttributes"))));
}
return (EventDefinition<string, string>)definition;
}
/// <summary>
/// Entity '{principalEntityType}' has global query filter defined and is a required end of a relationship with the entity '{declaringEntityType}'. This may lead to unexpected results when the required entity is filtered out. Either use optional navigation or define matching query filters for both entities in the navigation. See https://go.microsoft.com/fwlink/?linkid=2131316 for more information.
/// </summary>
public static EventDefinition<string, string> LogPossibleIncorrectRequiredNavigationWithQueryFilterInteraction([NotNull] IDiagnosticsLogger logger)
{
var definition = ((LoggingDefinitions)logger.Definitions).LogPossibleIncorrectRequiredNavigationWithQueryFilterInteraction;
if (definition == null)
{
definition = LazyInitializer.EnsureInitialized<EventDefinitionBase>(
ref ((LoggingDefinitions)logger.Definitions).LogPossibleIncorrectRequiredNavigationWithQueryFilterInteraction,
() => new EventDefinition<string, string>(
logger.Options,
CoreEventId.PossibleIncorrectRequiredNavigationWithQueryFilterInteractionWarning,
LogLevel.Warning,
"CoreEventId.PossibleIncorrectRequiredNavigationWithQueryFilterInteractionWarning",
level => LoggerMessage.Define<string, string>(
level,
CoreEventId.PossibleIncorrectRequiredNavigationWithQueryFilterInteractionWarning,
_resourceManager.GetString("LogPossibleIncorrectRequiredNavigationWithQueryFilterInteraction"))));
}
return (EventDefinition<string, string>)definition;
}
}
}
| 63.825159 | 544 | 0.646493 | [
"Apache-2.0"
] | Potapy4/EntityFrameworkCore | src/EFCore/Properties/CoreStrings.Designer.cs | 281,086 | C# |
namespace Gliber
{
using System.Collections.Generic;
using System.Reflection;
internal class Config : IConfig
{
public Config()
{
this.SelectedPropertiesOfSourceObject = null;
this.HasOneToOneMapping = false;
}
public IEnumerable<string> SelectedPropertiesOfSourceObject { get; set; }
public bool HasOneToOneMapping { get; set; }
}
} | 24.705882 | 81 | 0.630952 | [
"MIT"
] | goldytech/Gliber | src/Gliber/Config.cs | 422 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Native.Csharp.App.Model;
namespace Native.Csharp.App.Interface
{
/// <summary>
/// 酷Q 群消息接口
/// </summary>
public interface IEvent_GroupMessage
{
/// <summary>
/// Type=2 群消息<para/>
/// 当在派生类中重写时, 处理收到的群消息
/// </summary>
/// <param name="sender">事件的触发对象</param>
/// <param name="e">事件的附加参数</param>
void ReceiveGroupMessage (object sender, GroupMessageEventArgs e);
/// <summary>
/// Type=21 群私聊<para/>
/// 当在派生类中重写时, 处理收到的群私聊消息
/// </summary>
/// <param name="sender">事件的触发对象</param>
/// <param name="e">事件的附加参数</param>
void ReceiveGroupPrivateMessage (object sender, PrivateMessageEventArgs e);
/// <summary>
/// Type=11 群文件上传事件<para/>
/// 当在派生类中重写时, 处理收到的群文件上传结果
/// </summary>
/// <param name="sender">事件的触发对象</param>
/// <param name="e">事件的附加参数</param>
void ReceiveGroupFileUpload (object sender, FileUploadMessageEventArgs e);
/// <summary>
/// Type=101 群事件 - 管理员增加<para/>
/// 当在派生类中重写时, 处理收到的群管理员增加事件
/// </summary>
/// <param name="sender">事件的触发对象</param>
/// <param name="e">事件的附加参数</param>
void ReceiveGroupManageIncrease (object sender, GroupManageAlterEventArgs e);
/// <summary>
/// Type=101 群事件 - 管理员减少<para/>
/// 当在派生类中重写时, 处理收到的群管理员减少事件
/// </summary>
/// <param name="sender">事件的触发对象</param>
/// <param name="e">事件的附加参数</param>
void ReceiveGroupManageDecrease (object sender, GroupManageAlterEventArgs e);
/// <summary>
/// Type=103 群事件 - 群成员增加 - 主动入群<para/>
/// 当在派生类中重写时, 处理收到的群成员增加 (主动入群) 事件
/// </summary>
/// <param name="sender">事件的触发对象</param>
/// <param name="e">事件的附加参数</param>
void ReceiveGroupMemberJoin (object sender, GroupMemberAlterEventArgs e);
/// <summary>
/// Type=103 群事件 - 群成员增加 - 被邀入群<para/>
/// 当在派生类中重写时, 处理收到的群成员增加 (被邀入群) 事件
/// </summary>
/// <param name="sender">事件的触发对象</param>
/// <param name="e">事件的附加参数</param>
void ReceiveGroupMemberInvitee (object sender, GroupMemberAlterEventArgs e);
/// <summary>
/// Type=102 群事件 - 群成员减少 - 成员离开<para/>
/// 当在派生类中重写时, 处理收到的群成员减少 (成员离开) 事件
/// </summary>
/// <param name="sender">事件的触发对象</param>
/// <param name="e">事件的附加参数</param>
void ReceiveGroupMemberLeave (object sender, GroupMemberAlterEventArgs e);
/// <summary>
/// Type=102 群事件 - 群成员减少 - 成员移除<para/>
/// 当在派生类中重写时, 处理收到的群成员减少 (成员移除) 事件
/// </summary>
/// <param name="sender">事件的触发对象</param>
/// <param name="e">事件的附加参数</param>
void ReceiveGroupMemberRemove (object sender, GroupMemberAlterEventArgs e);
/// <summary>
/// Type=302 群事件 - 群请求 - 申请入群<para/>
/// 当在派生类中重写时, 处理收到的群请求 (申请入群) 事件
/// </summary>
/// <param name="sender">事件的触发对象</param>
/// <param name="e">事件的附加参数</param>
void ReceiveGroupAddApply (object sender, GroupAddRequestEventArgs e);
/// <summary>
/// Type=302 群事件 - 群请求 - 被邀入群 (机器人被邀)<para/>
/// 当在派生类中重写时, 处理收到的群请求 (被邀入群) 事件
/// </summary>
/// <param name="sender">事件的触发对象</param>
/// <param name="e">事件的附加参数</param>
void ReceiveGroupAddInvitee (object sender, GroupAddRequestEventArgs e);
}
}
| 30.31068 | 79 | 0.657271 | [
"MIT"
] | IchenDEV/CoolQ-Baidu-Bot | Native.Csharp/App/Interface/IEvent_GroupMessage.cs | 4,142 | 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("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("")]
[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("1564b3fa-27d1-4f37-b323-74b8f66b32c1")]
// 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")]
| 36.621622 | 84 | 0.740959 | [
"MIT"
] | HunterCarlson/ProjectEuler | Problems/087 Prime power triples/Properties/AssemblyInfo.cs | 1,355 | C# |
using System.Threading.Tasks;
using Nethereum.Hex.HexTypes;
using Nethereum.JsonRpc.Client;
using Newtonsoft.Json.Linq;
namespace Nethereum.Parity.RPC.Trace
{
/// <Summary>
/// Returns trace at given position.
/// </Summary>
public class TraceGet : RpcRequestResponseHandler<JObject>, ITraceGet
{
public TraceGet(IClient client) : base(client, ApiMethods.trace_get.ToString())
{
}
public Task<JObject> SendRequestAsync(string transactionHash, HexBigInteger[] index, object id = null)
{
return base.SendRequestAsync(id, transactionHash, index);
}
public RpcRequest BuildRequest(string transactionHash, HexBigInteger[] index, object id = null)
{
return base.BuildRequest(id, transactionHash, index);
}
}
} | 30.740741 | 110 | 0.66506 | [
"MIT"
] | 6ara6aka/Nethereum | src/Nethereum.Parity/RPC/Trace/TraceGet.cs | 830 | C# |
using System;
using System.Diagnostics.Contracts;
using ReClassNET.Memory;
namespace ReClassNET.Debugger
{
public delegate void BreakpointHandler(IBreakpoint breakpoint, ref DebugEvent evt);
public interface IBreakpoint
{
IntPtr Address { get; }
bool Set(RemoteProcess process);
void Remove(RemoteProcess process);
void Handler(ref DebugEvent evt);
}
[ContractClassFor(typeof(IBreakpoint))]
internal abstract class IBreakpointContract : IBreakpoint
{
public IntPtr Address => throw new NotImplementedException();
public void Handler(ref DebugEvent evt)
{
throw new NotImplementedException();
}
public void Remove(RemoteProcess process)
{
Contract.Requires(process != null);
throw new NotImplementedException();
}
public bool Set(RemoteProcess process)
{
Contract.Requires(process != null);
throw new NotImplementedException();
}
}
}
| 20.340909 | 84 | 0.749721 | [
"MIT"
] | denot/ReClass.NET | Debugger/IBreakpoint.cs | 897 | C# |
//-----------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All Rights Reserved.
// This code is licensed under the Microsoft Public License.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//-----------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.IO;
using Microsoft.Cci.MetadataReader;
using Microsoft.Cci.MetadataReader.PEFile;
using Microsoft.Cci.MetadataReader.ObjectModelImplementation;
using Microsoft.Cci.UtilityDataStructures;
using System.Threading;
using System.Text;
using System.Diagnostics;
using System.Diagnostics.Contracts;
//^ using Microsoft.Contracts;
namespace Microsoft.Cci {
/// <summary>
/// Generic exception thrown by the internal implementation. This exception is not meant to be leaked outside, hence all the
/// public classes where this exception can be thrown needs to catch this.
/// </summary>
internal sealed class MetadataReaderException : Exception {
internal MetadataReaderException(
string message
)
: base(message) {
}
}
/// <summary>
/// This interface is implemented by providers of Module read write errors. That is, errors discovered while reading the metadata/il.
/// Many of these errors will be discovered incrementally and as part of background activities.
/// </summary>
public interface IMetadataReaderErrorsReporter {
}
/// <summary>
/// Dummy class to identify the error reporter.
/// </summary>
internal sealed class MetadataReaderErrorsReporter : IMetadataReaderErrorsReporter {
}
/// <summary>
/// Factory for loading assemblies and modules persisted as portable executable (pe) files.
/// </summary>
public sealed class PeReader {
internal readonly MetadataReaderErrorsReporter ErrorsReporter;
internal readonly IMetadataReaderHost metadataReaderHost;
// In Multimodule case only the main module is added to this map.
readonly Hashtable<Module> InternedIdToModuleMap;
Assembly/*?*/ coreAssembly;
internal readonly IName Value__;
internal readonly IName AsyncCallback;
internal readonly IName ParamArrayAttribute;
internal readonly IName IAsyncResult;
internal readonly IName ICloneable;
internal readonly IName RuntimeArgumentHandle;
internal readonly IName RuntimeFieldHandle;
internal readonly IName RuntimeMethodHandle;
internal readonly IName RuntimeTypeHandle;
internal readonly IName ArgIterator;
internal readonly IName IList;
internal readonly IName Mscorlib;
internal readonly IName System_Runtime;
internal readonly IName _Deleted_;
/*^
#pragma warning disable 2669
^*/
/// <summary>
/// Allocates a factory for loading assemblies and modules persisted as portable executable (pe) files.
/// </summary>
/// <param name="metadataReaderHost">
/// The host is used for providing access to pe files (OpenBinaryDocument),
/// applying host specific unification policies (UnifyAssembly, UnifyAssemblyReference, UnifyModuleReference) and for deciding
/// whether and how to load referenced assemblies and modules (ResolvingAssemblyReference, ResolvingModuleReference).
/// </param>
public PeReader(
IMetadataReaderHost metadataReaderHost
) {
this.ErrorsReporter = new MetadataReaderErrorsReporter();
this.metadataReaderHost = metadataReaderHost;
this.InternedIdToModuleMap = new Hashtable<Module>();
INameTable nameTable = metadataReaderHost.NameTable;
this.Value__ = nameTable.GetNameFor("value__");
this.AsyncCallback = nameTable.GetNameFor("AsyncCallback");
this.ParamArrayAttribute = nameTable.GetNameFor("ParamArrayAttribute");
this.IAsyncResult = nameTable.GetNameFor("IAsyncResult");
this.ICloneable = nameTable.GetNameFor("ICloneable");
this.RuntimeArgumentHandle = nameTable.GetNameFor("RuntimeArgumentHandle");
this.RuntimeFieldHandle = nameTable.GetNameFor("RuntimeFieldHandle");
this.RuntimeMethodHandle = nameTable.GetNameFor("RuntimeMethodHandle");
this.RuntimeTypeHandle = nameTable.GetNameFor("RuntimeTypeHandle");
this.ArgIterator = nameTable.GetNameFor("ArgIterator");
this.IList = nameTable.GetNameFor("IList");
this.Mscorlib = nameTable.GetNameFor("mscorlib");
this.System_Runtime = nameTable.GetNameFor("System.Runtime");
this._Deleted_ = nameTable.GetNameFor("_Deleted*");
}
/*^
#pragma warning restore 2669
^*/
/// <summary>
/// Registers the core assembly. This is called by PEFileToObjectModel when it recognizes that assembly being loaded is the Core assembly as
/// identified by the Compilation Host.
/// </summary>
/// <param name="coreAssembly"></param>
internal void RegisterCoreAssembly(Assembly/*?*/ coreAssembly) {
if (coreAssembly == null) {
// Error... Core assembly is not proper.
}
if (this.coreAssembly != null) {
// Error Core Assembly Already loaded?!?
}
this.coreAssembly = coreAssembly;
}
internal Assembly/*?*/ CoreAssembly {
get {
if (this.coreAssembly == null)
this.coreAssembly = this.LookupAssembly(null, this.metadataReaderHost.CoreAssemblySymbolicIdentity) as Assembly;
return this.coreAssembly;
}
}
/// <summary>
/// This method is called when an assembly is loaded. This makes sure that all the member modules of the assembly are loaded.
/// </summary>
/// <param name="binaryDocument"></param>
/// <param name="assembly"></param>
void OpenMemberModules(IBinaryDocument binaryDocument, Assembly assembly) {
List<Module> memberModuleList = new List<Module>();
AssemblyIdentity assemblyIdentity = assembly.AssemblyIdentity;
foreach (IFileReference fileRef in assembly.PEFileToObjectModel.GetFiles()) {
if (!fileRef.HasMetadata)
continue;
IBinaryDocumentMemoryBlock/*?*/ binaryDocumentMemoryBlock = this.metadataReaderHost.OpenBinaryDocument(binaryDocument, fileRef.FileName.Value);
if (binaryDocumentMemoryBlock == null) {
// Error...
continue;
}
try {
PEFileReader peFileReader = new PEFileReader(this, binaryDocumentMemoryBlock);
if (peFileReader.ReaderState < ReaderState.Metadata) {
// Error...
continue;
}
if (peFileReader.IsAssembly) {
// Error...
continue;
}
ModuleIdentity moduleIdentity = this.GetModuleIdentifier(peFileReader, assemblyIdentity);
PEFileToObjectModel peFileToObjectModel = new PEFileToObjectModel(this, peFileReader, moduleIdentity, assembly, this.metadataReaderHost.PointerSize);
memberModuleList.Add(peFileToObjectModel.Module);
} catch (MetadataReaderException) {
continue;
}
}
if (memberModuleList.Count == 0)
return;
assembly.SetMemberModules(memberModuleList.ToArray());
}
void LoadedModule(Module module) {
this.InternedIdToModuleMap.Add(module.InternedModuleId, module);
}
/// <summary>
/// Method to open the assembly in MetadataReader. This method loads the assembly and returns the object corresponding to the
/// opened assembly. Also returns the AssemblyIdentifier corresponding to the assembly as the out parameter.
/// Only assemblies that unify to themselves can be opened i.e. if the unification policy of the compilation host says that mscorlib 1.0 unifies to mscorlib 2.0
/// then only mscorlib 2.0 can be loaded.
/// </summary>
/// <param name="binaryDocument">The binary document that needes to be opened as an assembly.</param>
/// <param name="assemblyIdentity">Contains the assembly identifier of the binary document in case it is an assembly.</param>
/// <returns>Assembly that is loaded or Dummy.Assembly in case assembly could not be loaded.</returns>
public IAssembly OpenAssembly(IBinaryDocument binaryDocument, out AssemblyIdentity/*?*/ assemblyIdentity) {
Contract.Requires(binaryDocument != null);
Contract.Ensures(Contract.Result<IAssembly>() != null);
assemblyIdentity = null;
lock (GlobalLock.LockingObject) {
IBinaryDocumentMemoryBlock/*?*/ binaryDocumentMemoryBlock = this.metadataReaderHost.OpenBinaryDocument(binaryDocument);
if (binaryDocumentMemoryBlock == null) {
// Error...
return Dummy.Assembly;
}
PEFileReader peFileReader = new PEFileReader(this, binaryDocumentMemoryBlock);
if (peFileReader.ReaderState < ReaderState.Metadata) {
// Error...
return Dummy.Assembly;
}
//^ assert peFileReader.ReaderState >= ReaderState.Metadata;
if (!peFileReader.IsAssembly) {
// Error...
return Dummy.Assembly;
}
assemblyIdentity = this.GetAssemblyIdentifier(peFileReader);
Assembly/*?*/ lookupAssembly = this.LookupAssembly(null, assemblyIdentity);
if (lookupAssembly != null) {
return lookupAssembly;
}
try {
PEFileToObjectModel peFileToObjectModel = new PEFileToObjectModel(this, peFileReader, assemblyIdentity, null, this.metadataReaderHost.PointerSize);
Assembly/*?*/ assembly = peFileToObjectModel.Module as Assembly;
//^ assert assembly != null;
this.LoadedModule(assembly);
this.OpenMemberModules(binaryDocument, assembly);
return assembly;
} catch (MetadataReaderException) {
return Dummy.Assembly;
}
}
}
/// <summary>
/// Method to open the module in the MetadataReader. This method loads the module and returns the object corresponding to the opened module.
/// Also returns the ModuleIDentifier corresponding to the module as the out parameter. Modules are opened as if they are not contained in any assembly.
/// </summary>
/// <param name="binaryDocument">The binary document that needes to be opened as an module.</param>
/// <param name="moduleIdentity">Contains the module identity of the binary document in case it is an module.</param>
/// <returns>Module that is loaded or Dummy.Module in case module could not be loaded.</returns>
public IModule OpenModule(IBinaryDocument binaryDocument, out ModuleIdentity/*?*/ moduleIdentity) {
Contract.Requires(binaryDocument != null);
Contract.Ensures(Contract.Result<IModule>() != null);
moduleIdentity = null;
lock (GlobalLock.LockingObject) {
IBinaryDocumentMemoryBlock/*?*/ binaryDocumentMemoryBlock = this.metadataReaderHost.OpenBinaryDocument(binaryDocument);
if (binaryDocumentMemoryBlock == null) {
// Error...
return Dummy.Module;
}
PEFileReader peFileReader = new PEFileReader(this, binaryDocumentMemoryBlock);
if (peFileReader.ReaderState < ReaderState.Metadata) {
// Error...
return Dummy.Module;
}
//^ assert peFileReader.ReaderState >= ReaderState.Metadata;
if (peFileReader.IsAssembly) {
AssemblyIdentity assemblyIdentity = this.GetAssemblyIdentifier(peFileReader);
moduleIdentity = assemblyIdentity;
Assembly/*?*/ lookupAssembly = this.LookupAssembly(null, assemblyIdentity);
if (lookupAssembly != null) {
return lookupAssembly;
}
} else {
moduleIdentity = this.GetModuleIdentifier(peFileReader);
Module/*?*/ lookupModule = this.LookupModule(null, moduleIdentity);
if (lookupModule != null) {
return lookupModule;
}
}
try {
PEFileToObjectModel peFileToObjectModel = new PEFileToObjectModel(this, peFileReader, moduleIdentity, null, this.metadataReaderHost.PointerSize);
this.LoadedModule(peFileToObjectModel.Module);
Assembly/*?*/ assembly = peFileToObjectModel.Module as Assembly;
if (assembly != null) {
this.OpenMemberModules(binaryDocument, assembly);
}
return peFileToObjectModel.Module;
} catch (MetadataReaderException) {
// Error...
}
}
return Dummy.Module;
}
/// <summary>
/// Method to open the assembly in MetadataReader. This method loads the assembly and returns the object corresponding to the
/// opened assembly. Also returns the AssemblyIdentifier corresponding to the assembly as the out parameter.
/// Only assemblies that unify to themselves can be opened i.e. if the unification policy of the compilation host says that mscorlib 1.0 unifies to mscorlib 2.0
/// then only mscorlib 2.0 can be loaded.
/// </summary>
/// <param name="binaryDocument">The binary document that needes to be opened as an assembly.</param>
/// <returns>Assembly that is loaded or Dummy.Assembly in case assembly could not be loaded.</returns>
public IAssembly OpenAssembly(IBinaryDocument binaryDocument) {
Contract.Requires(binaryDocument != null);
Contract.Ensures(Contract.Result<IAssembly>() != null);
AssemblyIdentity/*?*/ retAssemblyIdentity;
return this.OpenAssembly(binaryDocument, out retAssemblyIdentity);
}
/// <summary>
/// Method to open the module in the MetadataReader. This method loads the module and returns the object corresponding to the opened module.
/// Also returns the ModuleIDentifier corresponding to the module as the out parameter. Modules are opened as if they are not contained in any assembly.
/// </summary>
/// <param name="binaryDocument">The binary document that needes to be opened as an module.</param>
/// <returns>Module that is loaded or Dummy.Module in case module could not be loaded.</returns>
public IModule OpenModule(IBinaryDocument binaryDocument) {
Contract.Requires(binaryDocument != null);
Contract.Ensures(Contract.Result<IModule>() != null);
ModuleIdentity/*?*/ retModuleIdentity;
return this.OpenModule(binaryDocument, out retModuleIdentity);
}
/// <summary>
/// This method loads a module from a file containing only the metadata section of a PE file. (No headers and no IL.)
/// </summary>
/// <param name="binaryDocument">The binary document that needes to be opened as an module.</param>
/// <returns>Module that is loaded or Dummy.Module in case module could not be loaded.</returns>
public IModule OpenSnapshot(IBinaryDocument binaryDocument) {
ModuleIdentity moduleIdentity;
lock (GlobalLock.LockingObject) {
IBinaryDocumentMemoryBlock/*?*/ binaryDocumentMemoryBlock = this.metadataReaderHost.OpenBinaryDocument(binaryDocument);
if (binaryDocumentMemoryBlock == null) {
// Error...
return Dummy.Module;
}
PEFileReader peFileReader = new PEFileReader(this, binaryDocumentMemoryBlock, snapshot: true);
if (peFileReader.ReaderState < ReaderState.Metadata) {
// Error...
return Dummy.Module;
}
if (peFileReader.IsAssembly) {
AssemblyIdentity assemblyIdentity = this.GetAssemblyIdentifier(peFileReader);
moduleIdentity = assemblyIdentity;
Assembly/*?*/ lookupAssembly = this.LookupAssembly(null, assemblyIdentity);
if (lookupAssembly != null) {
return lookupAssembly;
}
} else {
moduleIdentity = this.GetModuleIdentifier(peFileReader);
Module/*?*/ lookupModule = this.LookupModule(null, moduleIdentity);
if (lookupModule != null) {
return lookupModule;
}
}
if (peFileReader.ReaderState < ReaderState.Metadata) {
// Error...
return Dummy.Module;
}
try {
PEFileToObjectModel peFileToObjectModel = new PEFileToObjectModel(this, peFileReader, moduleIdentity, null, this.metadataReaderHost.PointerSize);
this.LoadedModule(peFileToObjectModel.Module);
return peFileToObjectModel.Module;
} catch (MetadataReaderException) {
// Error...
}
}
return Dummy.Module;
}
/// <summary>
/// Does a look up in the loaded assemblies if the given assembly identified by assemblyIdentifier is loaded. This also gives a chance to MetadataReaderHost to
/// delay load the assembly if needed.
/// </summary>
/// <param name="referringModule"></param>
/// <param name="unifiedAssemblyIdentity"></param>
/// <returns></returns>
internal Assembly/*?*/ LookupAssembly(IModule/*?*/ referringModule, AssemblyIdentity unifiedAssemblyIdentity) {
lock (GlobalLock.LockingObject) {
uint internedModuleId = (uint)this.metadataReaderHost.InternFactory.GetAssemblyInternedKey(unifiedAssemblyIdentity);
Module/*?*/ module = this.InternedIdToModuleMap.Find(internedModuleId);
if (module == null && referringModule != null) {
this.metadataReaderHost.ResolvingAssemblyReference(referringModule, unifiedAssemblyIdentity);
// See if the host loaded the assembly using this PeReader (loading indirectly causes the map to be updated)
module = this.InternedIdToModuleMap.Find(internedModuleId);
if (module == null) {
// One last chance, it might have been already loaded by a different instance of PeReader
var a = this.metadataReaderHost.FindAssembly(unifiedAssemblyIdentity);
Module m = a as Module;
if (m != null) {
this.LoadedModule(m);
module = m;
}
}
}
return module as Assembly;
}
}
/// <summary>
/// Does a look up in the loaded modules if the given module identified by moduleIdentifier is loaded. This also gives a chance to MetadataReaderHost to
/// delay load the module if needed.
/// </summary>
/// <param name="referringModule"></param>
/// <param name="moduleIdentity"></param>
/// <returns></returns>
internal Module/*?*/ LookupModule(IModule/*?*/ referringModule, ModuleIdentity moduleIdentity) {
lock (GlobalLock.LockingObject) {
uint internedModuleId = (uint)this.metadataReaderHost.InternFactory.GetModuleInternedKey(moduleIdentity);
Module/*?*/ module = this.InternedIdToModuleMap.Find(internedModuleId);
if (module == null && referringModule != null) {
this.metadataReaderHost.ResolvingModuleReference(referringModule, moduleIdentity);
module = this.InternedIdToModuleMap.Find(internedModuleId);
}
return module;
}
}
/// <summary>
/// If the given binary document contains a CLR assembly, return the identity of the assembly. Otherwise, return null.
/// </summary>
public AssemblyIdentity/*?*/ GetAssemblyIdentifier(IBinaryDocument binaryDocument) {
IBinaryDocumentMemoryBlock/*?*/ binaryDocumentMemoryBlock = this.metadataReaderHost.OpenBinaryDocument(binaryDocument);
if (binaryDocumentMemoryBlock == null) return null;
PEFileReader peFileReader = new PEFileReader(this, binaryDocumentMemoryBlock);
if (peFileReader.ReaderState < ReaderState.Metadata) return null;
if (!peFileReader.IsAssembly) return null;
return this.GetAssemblyIdentifier(peFileReader);
}
/// <summary>
/// Computes the AssemblyIdentifier of the PE File. This requires that peFile is an assembly.
/// </summary>
/// <param name="peFileReader"></param>
/// <returns></returns>
internal AssemblyIdentity GetAssemblyIdentifier(PEFileReader peFileReader)
//^ requires peFileReader.ReaderState >= ReaderState.Metadata && peFileReader.IsAssembly;
//^ ensures (result.Location != null && result.Location.Length != 0);
{
AssemblyRow assemblyRow = peFileReader.AssemblyTable[1];
IName assemblyName = this.metadataReaderHost.NameTable.GetNameFor(peFileReader.StringStream[assemblyRow.Name]);
string cultureName = peFileReader.StringStream[assemblyRow.Culture];
Version version = new Version(assemblyRow.MajorVersion, assemblyRow.MinorVersion, assemblyRow.BuildNumber, assemblyRow.RevisionNumber);
byte[] publicKeyArray = TypeCache.EmptyByteArray;
byte[] publicKeyTokenArray = TypeCache.EmptyByteArray;
if (assemblyRow.PublicKey != 0) {
publicKeyArray = peFileReader.BlobStream[assemblyRow.PublicKey];
if (publicKeyArray.Length > 0) {
publicKeyTokenArray = UnitHelper.ComputePublicKeyToken(publicKeyArray);
}
}
return new AssemblyIdentity(assemblyName, cultureName, version, publicKeyTokenArray, peFileReader.BinaryDocumentMemoryBlock.BinaryDocument.Location);
}
/// <summary>
/// Computes the ModuleIdentifier of the PE File as if the module did not belong to any assembly.
/// </summary>
/// <param name="peFileReader"></param>
/// <returns></returns>
internal ModuleIdentity GetModuleIdentifier(PEFileReader peFileReader)
//^ requires peFileReader.ReaderState >= ReaderState.Metadata;
//^ ensures (result.Location != null && result.Location.Length != 0);
{
ModuleRow moduleRow = peFileReader.ModuleTable[1];
IName moduleName = this.metadataReaderHost.NameTable.GetNameFor(peFileReader.StringStream[moduleRow.Name]);
return new ModuleIdentity(moduleName, peFileReader.BinaryDocumentMemoryBlock.BinaryDocument.Location);
}
/// <summary>
/// Computes the ModuleIdentifier of the PE File as if the module belong to given assembly.
/// </summary>
/// <param name="peFileReader"></param>
/// <param name="containingAssemblyIdentity"></param>
/// <returns></returns>
internal ModuleIdentity GetModuleIdentifier(PEFileReader peFileReader, AssemblyIdentity containingAssemblyIdentity)
//^ requires peFileReader.ReaderState >= ReaderState.Metadata;
//^ ensures (result.Location != null && result.Location.Length != 0);
{
ModuleRow moduleRow = peFileReader.ModuleTable[1];
IName moduleName = this.metadataReaderHost.NameTable.GetNameFor(peFileReader.StringStream[moduleRow.Name]);
return new ModuleIdentity(moduleName, peFileReader.BinaryDocumentMemoryBlock.BinaryDocument.Location, containingAssemblyIdentity);
}
/// <summary>
/// Lists all the opened modules.
/// </summary>
public IEnumerable<IModule> OpenedModules {
get {
foreach (Module module in this.InternedIdToModuleMap.Values) {
yield return module;
}
}
}
/// <summary>
/// Returns the module corresponding to passed moduleIdentifier if it was loaded.
/// </summary>
/// <param name="moduleIdentity"></param>
/// <returns></returns>
public IModule/*?*/ FindModule(ModuleIdentity moduleIdentity) {
return this.LookupModule(null, moduleIdentity);
}
/// <summary>
/// Returns the assembly corresponding to passed assemblyIdentifier if it was loaded.
/// </summary>
/// <param name="unifiedAssemblyIdentity">THe assembly Identifier that is unified with respect to the compilation host.</param>
/// <returns></returns>
public IAssembly/*?*/ FindAssembly(AssemblyIdentity unifiedAssemblyIdentity) {
lock (GlobalLock.LockingObject) {
uint internedModuleId = (uint)this.metadataReaderHost.InternFactory.GetAssemblyInternedKey(unifiedAssemblyIdentity);
Module/*?*/ module = this.InternedIdToModuleMap.Find(internedModuleId);
return module as IAssembly;
}
}
/// <summary>
/// Resolves the serialized type name as if it belonged to the passed assembly.
/// </summary>
/// <param name="typeName">Serialized type name.</param>
/// <param name="assembly">Assembly in which this needs to be resolved. If null then it is to be resolved in mscorlib.</param>
/// <returns></returns>
public ITypeDefinition ResolveSerializedTypeName(string typeName, IAssembly/*?*/ assembly) {
if (assembly == null) {
assembly = this.CoreAssembly;
}
Assembly/*?*/ internalAssembly = assembly as Assembly;
if (internalAssembly == null) {
return Dummy.Type;
}
ITypeReference/*?*/ moduleTypeRef = internalAssembly.PEFileToObjectModel.GetSerializedTypeNameAsTypeReference(typeName);
if (moduleTypeRef == null) {
return Dummy.Type;
}
return moduleTypeRef.ResolvedType;
}
/// <summary>
/// A simple host environment using default settings inherited from MetadataReaderHost and that
/// uses PeReader as its metadata reader.
/// </summary>
public class DefaultHost : MetadataReaderHost {
/// <summary>
/// The PeReader instance that is used to implement LoadUnitFrom.
/// </summary>
protected PeReader peReader;
/// <summary>
/// Allocates a simple host environment using default settings inherited from MetadataReaderHost and that
/// uses PeReader as its metadata reader.
/// </summary>
public DefaultHost()
: base(new NameTable(), new InternFactory(), 0, null, true) {
this.peReader = new PeReader(this);
}
/// <summary>
/// Allocates a simple host environment using default settings inherited from MetadataReaderHost and that
/// uses PeReader as its metadata reader.
/// </summary>
/// <param name="nameTable">
/// A collection of IName instances that represent names that are commonly used during compilation.
/// This is a provided as a parameter to the host environment in order to allow more than one host
/// environment to co-exist while agreeing on how to map strings to IName instances.
/// </param>
public DefaultHost(INameTable nameTable)
: base(nameTable, new InternFactory(), 0, null, false) {
this.peReader = new PeReader(this);
}
/// <summary>
/// Returns the unit that is stored at the given location, or a dummy unit if no unit exists at that location or if the unit at that location is not accessible.
/// </summary>
/// <param name="location">A path to the file that contains the unit of metdata to load.</param>
public override IUnit LoadUnitFrom(string location) {
IUnit result = this.peReader.OpenModule(
BinaryDocument.GetBinaryDocumentForFile(location, this));
this.RegisterAsLatest(result);
return result;
}
}
}
}
| 47.978984 | 167 | 0.671813 | [
"MIT"
] | RUB-SysSec/Probfuscator | src/Sources/PeReader/ModuleReadWriteFactory.cs | 27,396 | 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 DirectN
{
/// <summary>
/// WingdingsGlyph Enums.
/// </summary>
public enum WingdingsGlyphEnum
{
/// <summary>
/// Device Control Four.
/// </summary>
DeviceControlFour = 0x0014,
/// <summary>
/// Lower Left Pencil.
/// </summary>
LowerLeftPencil = 0x0021,
/// <summary>
/// Black Scissors.
/// </summary>
BlackScissors = 0x0022,
/// <summary>
/// Upper Blade Scissors.
/// </summary>
UpperBladeScissors = 0x0023,
/// <summary>
/// Eyeglasses.
/// </summary>
Eyeglasses = 0x0024,
/// <summary>
/// Ringing Bell.
/// </summary>
RingingBell = 0x0025,
/// <summary>
/// Book.
/// </summary>
Book = 0x0026,
/// <summary>
/// Candle.
/// </summary>
Candle = 0x0027,
/// <summary>
/// Black Touchtone Telephone.
/// </summary>
BlackTouchtoneTelephone = 0x0028,
/// <summary>
/// Telephone Location Sign.
/// </summary>
TelephoneLocationSign = 0x0029,
/// <summary>
/// Back Of Envelope.
/// </summary>
BackOfEnvelope = 0x002a,
/// <summary>
/// Stamped Envelope.
/// </summary>
StampedEnvelope = 0x002b,
/// <summary>
/// Closed Mailbox With Lowered Flag.
/// </summary>
ClosedMailboxWithLoweredFlag = 0x002c,
/// <summary>
/// Closed Mailbox With Raised Flag.
/// </summary>
ClosedMailboxWithRaisedFlag = 0x002d,
/// <summary>
/// Open Mailbox With Raised Flag.
/// </summary>
OpenMailboxWithRaisedFlag = 0x002e,
/// <summary>
/// Open Mailbox With Lowered Flag.
/// </summary>
OpenMailboxWithLoweredFlag = 0x002f,
/// <summary>
/// File Folder.
/// </summary>
FileFolder = 0x0030,
/// <summary>
/// Open File Folder.
/// </summary>
OpenFileFolder = 0x0031,
/// <summary>
/// Page Facing Up.
/// </summary>
PageFacingUp = 0x0032,
/// <summary>
/// Page.
/// </summary>
Page = 0x0033,
/// <summary>
/// Pages.
/// </summary>
Pages = 0x0034,
/// <summary>
/// File Cabinet.
/// </summary>
FileCabinet = 0x0035,
/// <summary>
/// Hourglass.
/// </summary>
Hourglass = 0x0036,
/// <summary>
/// Wired Keyboard.
/// </summary>
WiredKeyboard = 0x0037,
/// <summary>
/// Two Button Mouse.
/// </summary>
TwoButtonMouse = 0x0038,
/// <summary>
/// Trackball.
/// </summary>
Trackball = 0x0039,
/// <summary>
/// Old Personal Computer.
/// </summary>
OldPersonalComputer = 0x003a,
/// <summary>
/// Hard Disk.
/// </summary>
HardDisk = 0x003b,
/// <summary>
/// White Hard Shell Floppy Disk.
/// </summary>
WhiteHardShellFloppyDisk = 0x003c,
/// <summary>
/// Soft Shell Floppy Disk.
/// </summary>
SoftShellFloppyDisk = 0x003d,
/// <summary>
/// Tape Drive.
/// </summary>
TapeDrive = 0x003e,
/// <summary>
/// Writing Hand.
/// </summary>
WritingHand = 0x003f,
/// <summary>
/// Left Writing Hand.
/// </summary>
LeftWritingHand = 0x0040,
/// <summary>
/// Victory Hand.
/// </summary>
VictoryHand = 0x0041,
/// <summary>
/// Ok Hand Sign.
/// </summary>
OkHandSign = 0x0042,
/// <summary>
/// Thumbs Up Sign.
/// </summary>
ThumbsUpSign = 0x0043,
/// <summary>
/// Thumbs Down Sign.
/// </summary>
ThumbsDownSign = 0x0044,
/// <summary>
/// White Left Pointing Index.
/// </summary>
WhiteLeftPointingIndex = 0x0045,
/// <summary>
/// White Right Pointing Index.
/// </summary>
WhiteRightPointingIndex = 0x0046,
/// <summary>
/// White Up Pointing Index.
/// </summary>
WhiteUpPointingIndex = 0x0047,
/// <summary>
/// White Down Pointing Index.
/// </summary>
WhiteDownPointingIndex = 0x0048,
/// <summary>
/// Raised Hand With Fingers Splayed.
/// </summary>
RaisedHandWithFingersSplayed = 0x0049,
/// <summary>
/// White Smiling Face.
/// </summary>
WhiteSmilingFace = 0x004a,
/// <summary>
/// Neutral Face.
/// </summary>
NeutralFace = 0x004b,
/// <summary>
/// White Frowning Face.
/// </summary>
WhiteFrowningFace = 0x004c,
/// <summary>
/// Bomb.
/// </summary>
Bomb = 0x004d,
/// <summary>
/// Skull And Crossbones.
/// </summary>
SkullAndCrossbones = 0x004e,
/// <summary>
/// Waving White Flag.
/// </summary>
WavingWhiteFlag = 0x004f,
/// <summary>
/// White Pennant.
/// </summary>
WhitePennant = 0x0050,
/// <summary>
/// Airplane.
/// </summary>
Airplane = 0x0051,
/// <summary>
/// White Sun With Rays.
/// </summary>
WhiteSunWithRays = 0x0052,
/// <summary>
/// Droplet.
/// </summary>
Droplet = 0x0053,
/// <summary>
/// Snowflake.
/// </summary>
Snowflake = 0x0054,
/// <summary>
/// White Latin Cross.
/// </summary>
WhiteLatinCross = 0x0055,
/// <summary>
/// Shadowed White Latin Cross.
/// </summary>
ShadowedWhiteLatinCross = 0x0056,
/// <summary>
/// Celtic Cross.
/// </summary>
CelticCross = 0x0057,
/// <summary>
/// Maltese Cross.
/// </summary>
MalteseCross = 0x0058,
/// <summary>
/// Star Of David.
/// </summary>
StarOfDavid = 0x0059,
/// <summary>
/// Star And Crescent.
/// </summary>
StarAndCrescent = 0x005a,
/// <summary>
/// Yin Yang.
/// </summary>
YinYang = 0x005b,
/// <summary>
/// Devanagari Om.
/// </summary>
DevanagariOm = 0x005c,
/// <summary>
/// Wheel Of Dharma.
/// </summary>
WheelOfDharma = 0x005d,
/// <summary>
/// Aries.
/// </summary>
Aries = 0x005e,
/// <summary>
/// Taurus.
/// </summary>
Taurus = 0x005f,
/// <summary>
/// Gemini.
/// </summary>
Gemini = 0x0060,
/// <summary>
/// Cancer.
/// </summary>
Cancer = 0x0061,
/// <summary>
/// Leo.
/// </summary>
Leo = 0x0062,
/// <summary>
/// Virgo.
/// </summary>
Virgo = 0x0063,
/// <summary>
/// Libra.
/// </summary>
Libra = 0x0064,
/// <summary>
/// Scorpius.
/// </summary>
Scorpius = 0x0065,
/// <summary>
/// Sagittarius.
/// </summary>
Sagittarius = 0x0066,
/// <summary>
/// Capricorn.
/// </summary>
Capricorn = 0x0067,
/// <summary>
/// Aquarius.
/// </summary>
Aquarius = 0x0068,
/// <summary>
/// Pisces.
/// </summary>
Pisces = 0x0069,
/// <summary>
/// Script Ligature Et Ornament.
/// </summary>
ScriptLigatureEtOrnament = 0x006a,
/// <summary>
/// Swash Ampersand Ornament.
/// </summary>
SwashAmpersandOrnament = 0x006b,
/// <summary>
/// Black Circle.
/// </summary>
BlackCircle = 0x006c,
/// <summary>
/// Lower Right Shadowed White Circle.
/// </summary>
LowerRightShadowedWhiteCircle = 0x006d,
/// <summary>
/// Black Square.
/// </summary>
BlackSquare = 0x006e,
/// <summary>
/// White Square.
/// </summary>
WhiteSquare = 0x006f,
/// <summary>
/// Bold White Square.
/// </summary>
BoldWhiteSquare = 0x0070,
/// <summary>
/// Lower Right Shadowed White Square.
/// </summary>
LowerRightShadowedWhiteSquare = 0x0071,
/// <summary>
/// Upper Right Shadowed White Square.
/// </summary>
UpperRightShadowedWhiteSquare = 0x0072,
/// <summary>
/// Black Medium Lozenge.
/// </summary>
BlackMediumLozenge = 0x0073,
/// <summary>
/// Black Lozenge.
/// </summary>
BlackLozenge = 0x0074,
/// <summary>
/// Black Diamond.
/// </summary>
BlackDiamond = 0x0075,
/// <summary>
/// Black Diamond Minus White X.
/// </summary>
BlackDiamondMinusWhiteX = 0x0076,
/// <summary>
/// Black Medium Diamond.
/// </summary>
BlackMediumDiamond = 0x0077,
/// <summary>
/// X In A Rectangle Box.
/// </summary>
XInARectangleBox = 0x0078,
/// <summary>
/// Up Arrowhead In A Rectangle Box.
/// </summary>
UpArrowheadInARectangleBox = 0x0079,
/// <summary>
/// Place Of Interest Sign.
/// </summary>
PlaceOfInterestSign = 0x007a,
/// <summary>
/// Rosette.
/// </summary>
Rosette = 0x007b,
/// <summary>
/// Black Rosette.
/// </summary>
BlackRosette = 0x007c,
/// <summary>
/// Sans-Serif Heavy Double Turned Comma Quotation Mark Ornament.
/// </summary>
SansSerifHeavyDoubleTurnedCommaQuotationMarkOrnament = 0x007d,
/// <summary>
/// Sans-Serif Heavy Double Comma Quotation Mark Ornament.
/// </summary>
SansSerifHeavyDoubleCommaQuotationMarkOrnament = 0x007e,
/// <summary>
/// Circled Digit Zero.
/// </summary>
CircledDigitZero = 0x0080,
/// <summary>
/// Circled Digit One.
/// </summary>
CircledDigitOne = 0x0081,
/// <summary>
/// Circled Digit Two.
/// </summary>
CircledDigitTwo = 0x0082,
/// <summary>
/// Circled Digit Three.
/// </summary>
CircledDigitThree = 0x0083,
/// <summary>
/// Circled Digit Four.
/// </summary>
CircledDigitFour = 0x0084,
/// <summary>
/// Circled Digit Five.
/// </summary>
CircledDigitFive = 0x0085,
/// <summary>
/// Circled Digit Six.
/// </summary>
CircledDigitSix = 0x0086,
/// <summary>
/// Circled Digit Seven.
/// </summary>
CircledDigitSeven = 0x0087,
/// <summary>
/// Circled Digit Eight.
/// </summary>
CircledDigitEight = 0x0088,
/// <summary>
/// Circled Digit Nine.
/// </summary>
CircledDigitNine = 0x0089,
/// <summary>
/// Circled Number Ten.
/// </summary>
CircledNumberTen = 0x008a,
/// <summary>
/// Negative Circled Digit Zero.
/// </summary>
NegativeCircledDigitZero = 0x008b,
/// <summary>
/// Dingbat Negative Circled Digit One.
/// </summary>
DingbatNegativeCircledDigitOne = 0x008c,
/// <summary>
/// Dingbat Negative Circled Digit Two.
/// </summary>
DingbatNegativeCircledDigitTwo = 0x008d,
/// <summary>
/// Dingbat Negative Circled Digit Three.
/// </summary>
DingbatNegativeCircledDigitThree = 0x008e,
/// <summary>
/// Dingbat Negative Circled Digit Four.
/// </summary>
DingbatNegativeCircledDigitFour = 0x008f,
/// <summary>
/// Dingbat Negative Circled Digit Five.
/// </summary>
DingbatNegativeCircledDigitFive = 0x0090,
/// <summary>
/// Dingbat Negative Circled Digit Six.
/// </summary>
DingbatNegativeCircledDigitSix = 0x0091,
/// <summary>
/// Dingbat Negative Circled Digit Seven.
/// </summary>
DingbatNegativeCircledDigitSeven = 0x0092,
/// <summary>
/// Dingbat Negative Circled Digit Eight.
/// </summary>
DingbatNegativeCircledDigitEight = 0x0093,
/// <summary>
/// Dingbat Negative Circled Digit Nine.
/// </summary>
DingbatNegativeCircledDigitNine = 0x0094,
/// <summary>
/// Dingbat Negative Circled Number Ten.
/// </summary>
DingbatNegativeCircledNumberTen = 0x0095,
/// <summary>
/// North East Pointing Bud.
/// </summary>
NorthEastPointingBud = 0x0096,
/// <summary>
/// North West Pointing Bud.
/// </summary>
NorthWestPointingBud = 0x0097,
/// <summary>
/// South West Pointing Bud.
/// </summary>
SouthWestPointingBud = 0x0098,
/// <summary>
/// South East Pointing Bud.
/// </summary>
SouthEastPointingBud = 0x0099,
/// <summary>
/// Heavy North East Pointing Vine Leaf.
/// </summary>
HeavyNorthEastPointingVineLeaf = 0x009a,
/// <summary>
/// Heavy North West Pointing Vine Leaf.
/// </summary>
HeavyNorthWestPointingVineLeaf = 0x009b,
/// <summary>
/// Heavy South West Pointing Vine Leaf.
/// </summary>
HeavySouthWestPointingVineLeaf = 0x009c,
/// <summary>
/// Heavy South East Pointing Vine Leaf.
/// </summary>
HeavySouthEastPointingVineLeaf = 0x009d,
/// <summary>
/// Middle Dot.
/// </summary>
MiddleDot = 0x009e,
/// <summary>
/// Bullet.
/// </summary>
Bullet = 0x009f,
/// <summary>
/// Black Small Square.
/// </summary>
BlackSmallSquare = 0x00a0,
/// <summary>
/// Medium White Circle.
/// </summary>
MediumWhiteCircle = 0x00a1,
/// <summary>
/// Bold White Circle.
/// </summary>
BoldWhiteCircle = 0x00a2,
/// <summary>
/// Very Heavy White Circle.
/// </summary>
VeryHeavyWhiteCircle = 0x00a3,
/// <summary>
/// Fisheye.
/// </summary>
Fisheye = 0x00a4,
/// <summary>
/// Bullseye.
/// </summary>
Bullseye = 0x00a5,
/// <summary>
/// Upper Right Shadowed White Circle.
/// </summary>
UpperRightShadowedWhiteCircle = 0x00a6,
/// <summary>
/// Black Small Square.
/// </summary>
BlackSmallSquare_2 = 0x00a7,
/// <summary>
/// White Medium Square.
/// </summary>
WhiteMediumSquare = 0x00a8,
/// <summary>
/// Three Pointed Black Star.
/// </summary>
ThreePointedBlackStar = 0x00a9,
/// <summary>
/// Black Four Pointed Star.
/// </summary>
BlackFourPointedStar = 0x00aa,
/// <summary>
/// Black Star.
/// </summary>
BlackStar = 0x00ab,
/// <summary>
/// Six Pointed Black Star.
/// </summary>
SixPointedBlackStar = 0x00ac,
/// <summary>
/// Eight Pointed Black Star.
/// </summary>
EightPointedBlackStar = 0x00ad,
/// <summary>
/// Twelve Pointed Black Star.
/// </summary>
TwelvePointedBlackStar = 0x00ae,
/// <summary>
/// Eight Pointed Pinwheel Star.
/// </summary>
EightPointedPinwheelStar = 0x00af,
/// <summary>
/// Square Position Indicator.
/// </summary>
SquarePositionIndicator = 0x00b0,
/// <summary>
/// Position Indicator.
/// </summary>
PositionIndicator = 0x00b1,
/// <summary>
/// White Concave-Sided Diamond.
/// </summary>
WhiteConcaveSidedDiamond = 0x00b2,
/// <summary>
/// Square Lozenge.
/// </summary>
SquareLozenge = 0x00b3,
/// <summary>
/// Uncertainty Sign.
/// </summary>
UncertaintySign = 0x00b4,
/// <summary>
/// Circled White Star.
/// </summary>
CircledWhiteStar = 0x00b5,
/// <summary>
/// Shadowed White Star.
/// </summary>
ShadowedWhiteStar = 0x00b6,
/// <summary>
/// Clock Face One Oclock.
/// </summary>
ClockFaceOneOclock = 0x00b7,
/// <summary>
/// Clock Face Two Oclock.
/// </summary>
ClockFaceTwoOclock = 0x00b8,
/// <summary>
/// Clock Face Three Oclock.
/// </summary>
ClockFaceThreeOclock = 0x00b9,
/// <summary>
/// Clock Face Four Oclock.
/// </summary>
ClockFaceFourOclock = 0x00ba,
/// <summary>
/// Clock Face Five Oclock.
/// </summary>
ClockFaceFiveOclock = 0x00bb,
/// <summary>
/// Clock Face Six Oclock.
/// </summary>
ClockFaceSixOclock = 0x00bc,
/// <summary>
/// Clock Face Seven Oclock.
/// </summary>
ClockFaceSevenOclock = 0x00bd,
/// <summary>
/// Clock Face Eight Oclock.
/// </summary>
ClockFaceEightOclock = 0x00be,
/// <summary>
/// Clock Face Nine Oclock.
/// </summary>
ClockFaceNineOclock = 0x00bf,
/// <summary>
/// Clock Face Ten Oclock.
/// </summary>
ClockFaceTenOclock = 0x00c0,
/// <summary>
/// Clock Face Eleven Oclock.
/// </summary>
ClockFaceElevenOclock = 0x00c1,
/// <summary>
/// Clock Face Twelve Oclock.
/// </summary>
ClockFaceTwelveOclock = 0x00c2,
/// <summary>
/// Ribbon Arrow Down Left.
/// </summary>
RibbonArrowDownLeft = 0x00c3,
/// <summary>
/// Ribbon Arrow Down Right.
/// </summary>
RibbonArrowDownRight = 0x00c4,
/// <summary>
/// Ribbon Arrow Up Left.
/// </summary>
RibbonArrowUpLeft = 0x00c5,
/// <summary>
/// Ribbon Arrow Up Right.
/// </summary>
RibbonArrowUpRight = 0x00c6,
/// <summary>
/// Ribbon Arrow Left Up.
/// </summary>
RibbonArrowLeftUp = 0x00c7,
/// <summary>
/// Ribbon Arrow Right Up.
/// </summary>
RibbonArrowRightUp = 0x00c8,
/// <summary>
/// Ribbon Arrow Left Down.
/// </summary>
RibbonArrowLeftDown = 0x00c9,
/// <summary>
/// Ribbon Arrow Right Down.
/// </summary>
RibbonArrowRightDown = 0x00ca,
/// <summary>
/// Solid Quilt Square Ornament.
/// </summary>
SolidQuiltSquareOrnament = 0x00cb,
/// <summary>
/// Solid Quilt Square Ornament In Black Square.
/// </summary>
SolidQuiltSquareOrnamentInBlackSquare = 0x00cc,
/// <summary>
/// Turned South West Pointing Leaf.
/// </summary>
TurnedSouthWestPointingLeaf = 0x00cd,
/// <summary>
/// Turned North West Pointing Leaf.
/// </summary>
TurnedNorthWestPointingLeaf = 0x00ce,
/// <summary>
/// Turned South East Pointing Leaf.
/// </summary>
TurnedSouthEastPointingLeaf = 0x00cf,
/// <summary>
/// Turned North East Pointing Leaf.
/// </summary>
TurnedNorthEastPointingLeaf = 0x00d0,
/// <summary>
/// North West Pointing Leaf.
/// </summary>
NorthWestPointingLeaf = 0x00d1,
/// <summary>
/// South West Pointing Leaf.
/// </summary>
SouthWestPointingLeaf = 0x00d2,
/// <summary>
/// North East Pointing Leaf.
/// </summary>
NorthEastPointingLeaf = 0x00d3,
/// <summary>
/// South East Pointing Leaf.
/// </summary>
SouthEastPointingLeaf = 0x00d4,
/// <summary>
/// Erase To The Left.
/// </summary>
EraseToTheLeft = 0x00d5,
/// <summary>
/// Erase To The Right.
/// </summary>
EraseToTheRight = 0x00d6,
/// <summary>
/// Three-D Top-Lighted Leftwards Equilateral Arrowhead.
/// </summary>
ThreeDTopLightedLeftwardsEquilateralArrowhead = 0x00d7,
/// <summary>
/// Three-D Top-Lighted Rightwards Equilateral Arrowhead.
/// </summary>
ThreeDTopLightedRightwardsEquilateralArrowhead = 0x00d8,
/// <summary>
/// Three-D Right-Lighted Upwards Equilateral Arrowhead.
/// </summary>
ThreeDRightLightedUpwardsEquilateralArrowhead = 0x00d9,
/// <summary>
/// Three-D Left-Lighted Downwards Equilateral Arrowhead.
/// </summary>
ThreeDLeftLightedDownwardsEquilateralArrowhead = 0x00da,
/// <summary>
/// Leftwards Black Circled White Arrow.
/// </summary>
LeftwardsBlackCircledWhiteArrow = 0x00db,
/// <summary>
/// Rightwards Black Circled White Arrow.
/// </summary>
RightwardsBlackCircledWhiteArrow = 0x00dc,
/// <summary>
/// Upwards Black Circled White Arrow.
/// </summary>
UpwardsBlackCircledWhiteArrow = 0x00dd,
/// <summary>
/// Downwards Black Circled White Arrow.
/// </summary>
DownwardsBlackCircledWhiteArrow = 0x00de,
/// <summary>
/// Wide-Headed Leftwards Barb Arrow.
/// </summary>
WideHeadedLeftwardsBarbArrow = 0x00df,
/// <summary>
/// Wide-Headed Rightwards Barb Arrow.
/// </summary>
WideHeadedRightwardsBarbArrow = 0x00e0,
/// <summary>
/// Wide-Headed Upwards Barb Arrow.
/// </summary>
WideHeadedUpwardsBarbArrow = 0x00e1,
/// <summary>
/// Wide-Headed Downwards Barb Arrow.
/// </summary>
WideHeadedDownwardsBarbArrow = 0x00e2,
/// <summary>
/// Wide-Headed North West Barb Arrow.
/// </summary>
WideHeadedNorthWestBarbArrow = 0x00e3,
/// <summary>
/// Wide-Headed North East Barb Arrow.
/// </summary>
WideHeadedNorthEastBarbArrow = 0x00e4,
/// <summary>
/// Wide-Headed South West Barb Arrow.
/// </summary>
WideHeadedSouthWestBarbArrow = 0x00e5,
/// <summary>
/// Wide-Headed South East Barb Arrow.
/// </summary>
WideHeadedSouthEastBarbArrow = 0x00e6,
/// <summary>
/// Wide-Headed Leftwards Heavy Barb Arrow.
/// </summary>
WideHeadedLeftwardsHeavyBarbArrow = 0x00e7,
/// <summary>
/// Wide-Headed Rightwards Heavy Barb Arrow.
/// </summary>
WideHeadedRightwardsHeavyBarbArrow = 0x00e8,
/// <summary>
/// Wide-Headed Upwards Heavy Barb Arrow.
/// </summary>
WideHeadedUpwardsHeavyBarbArrow = 0x00e9,
/// <summary>
/// Wide-Headed Downwards Heavy Barb Arrow.
/// </summary>
WideHeadedDownwardsHeavyBarbArrow = 0x00ea,
/// <summary>
/// Wide-Headed North West Heavy Barb Arrow.
/// </summary>
WideHeadedNorthWestHeavyBarbArrow = 0x00eb,
/// <summary>
/// Wide-Headed North East Heavy Barb Arrow.
/// </summary>
WideHeadedNorthEastHeavyBarbArrow = 0x00ec,
/// <summary>
/// Wide-Headed South West Heavy Barb Arrow.
/// </summary>
WideHeadedSouthWestHeavyBarbArrow = 0x00ed,
/// <summary>
/// Wide-Headed South East Heavy Barb Arrow.
/// </summary>
WideHeadedSouthEastHeavyBarbArrow = 0x00ee,
/// <summary>
/// Leftwards White Arrow.
/// </summary>
LeftwardsWhiteArrow = 0x00ef,
/// <summary>
/// Rightwards White Arrow.
/// </summary>
RightwardsWhiteArrow = 0x00f0,
/// <summary>
/// Upwards White Arrow.
/// </summary>
UpwardsWhiteArrow = 0x00f1,
/// <summary>
/// Downwards White Arrow.
/// </summary>
DownwardsWhiteArrow = 0x00f2,
/// <summary>
/// Left Right White Arrow.
/// </summary>
LeftRightWhiteArrow = 0x00f3,
/// <summary>
/// Up Down White Arrow.
/// </summary>
UpDownWhiteArrow = 0x00f4,
/// <summary>
/// North East White Arrow.
/// </summary>
NorthEastWhiteArrow = 0x00f5,
/// <summary>
/// North West White Arrow.
/// </summary>
NorthWestWhiteArrow = 0x00f6,
/// <summary>
/// South West White Arrow.
/// </summary>
SouthWestWhiteArrow = 0x00f7,
/// <summary>
/// South East White Arrow.
/// </summary>
SouthEastWhiteArrow = 0x00f8,
/// <summary>
/// White Arrow Shaft Width One.
/// </summary>
WhiteArrowShaftWidthOne = 0x00f9,
/// <summary>
/// White Arrow Shaft Width Two Thirds.
/// </summary>
WhiteArrowShaftWidthTwoThirds = 0x00fa,
/// <summary>
/// Ballot Bold Script X.
/// </summary>
BallotBoldScriptX = 0x00fb,
/// <summary>
/// Heavy Check Mark.
/// </summary>
HeavyCheckMark = 0x00fc,
/// <summary>
/// Ballot Box With Bold Script X.
/// </summary>
BallotBoxWithBoldScriptX = 0x00fd,
/// <summary>
/// Ballot Box With Bold Check.
/// </summary>
BallotBoxWithBoldCheck = 0x00fe,
/// <summary>
/// Windows Flag.
/// </summary>
WindowsFlag = 0x00ff,
/// <summary>
/// Device Control Four.
/// </summary>
DeviceControlFour_2 = 0xf014,
/// <summary>
/// Lower Left Pencil.
/// </summary>
LowerLeftPencil_2 = 0xf021,
/// <summary>
/// Black Scissors.
/// </summary>
BlackScissors_2 = 0xf022,
/// <summary>
/// Upper Blade Scissors.
/// </summary>
UpperBladeScissors_2 = 0xf023,
/// <summary>
/// Eyeglasses.
/// </summary>
Eyeglasses_2 = 0xf024,
/// <summary>
/// Ringing Bell.
/// </summary>
RingingBell_2 = 0xf025,
/// <summary>
/// Book.
/// </summary>
Book_2 = 0xf026,
/// <summary>
/// Candle.
/// </summary>
Candle_2 = 0xf027,
/// <summary>
/// Black Touchtone Telephone.
/// </summary>
BlackTouchtoneTelephone_2 = 0xf028,
/// <summary>
/// Telephone Location Sign.
/// </summary>
TelephoneLocationSign_2 = 0xf029,
/// <summary>
/// Back Of Envelope.
/// </summary>
BackOfEnvelope_2 = 0xf02a,
/// <summary>
/// Stamped Envelope.
/// </summary>
StampedEnvelope_2 = 0xf02b,
/// <summary>
/// Closed Mailbox With Lowered Flag.
/// </summary>
ClosedMailboxWithLoweredFlag_2 = 0xf02c,
/// <summary>
/// Closed Mailbox With Raised Flag.
/// </summary>
ClosedMailboxWithRaisedFlag_2 = 0xf02d,
/// <summary>
/// Open Mailbox With Raised Flag.
/// </summary>
OpenMailboxWithRaisedFlag_2 = 0xf02e,
/// <summary>
/// Open Mailbox With Lowered Flag.
/// </summary>
OpenMailboxWithLoweredFlag_2 = 0xf02f,
/// <summary>
/// File Folder.
/// </summary>
FileFolder_2 = 0xf030,
/// <summary>
/// Open File Folder.
/// </summary>
OpenFileFolder_2 = 0xf031,
/// <summary>
/// Page Facing Up.
/// </summary>
PageFacingUp_2 = 0xf032,
/// <summary>
/// Page.
/// </summary>
Page_2 = 0xf033,
/// <summary>
/// Pages.
/// </summary>
Pages_2 = 0xf034,
/// <summary>
/// File Cabinet.
/// </summary>
FileCabinet_2 = 0xf035,
/// <summary>
/// Hourglass.
/// </summary>
Hourglass_2 = 0xf036,
/// <summary>
/// Wired Keyboard.
/// </summary>
WiredKeyboard_2 = 0xf037,
/// <summary>
/// Two Button Mouse.
/// </summary>
TwoButtonMouse_2 = 0xf038,
/// <summary>
/// Trackball.
/// </summary>
Trackball_2 = 0xf039,
/// <summary>
/// Old Personal Computer.
/// </summary>
OldPersonalComputer_2 = 0xf03a,
/// <summary>
/// Hard Disk.
/// </summary>
HardDisk_2 = 0xf03b,
/// <summary>
/// White Hard Shell Floppy Disk.
/// </summary>
WhiteHardShellFloppyDisk_2 = 0xf03c,
/// <summary>
/// Soft Shell Floppy Disk.
/// </summary>
SoftShellFloppyDisk_2 = 0xf03d,
/// <summary>
/// Tape Drive.
/// </summary>
TapeDrive_2 = 0xf03e,
/// <summary>
/// Writing Hand.
/// </summary>
WritingHand_2 = 0xf03f,
/// <summary>
/// Left Writing Hand.
/// </summary>
LeftWritingHand_2 = 0xf040,
/// <summary>
/// Victory Hand.
/// </summary>
VictoryHand_2 = 0xf041,
/// <summary>
/// Ok Hand Sign.
/// </summary>
OkHandSign_2 = 0xf042,
/// <summary>
/// Thumbs Up Sign.
/// </summary>
ThumbsUpSign_2 = 0xf043,
/// <summary>
/// Thumbs Down Sign.
/// </summary>
ThumbsDownSign_2 = 0xf044,
/// <summary>
/// White Left Pointing Index.
/// </summary>
WhiteLeftPointingIndex_2 = 0xf045,
/// <summary>
/// White Right Pointing Index.
/// </summary>
WhiteRightPointingIndex_2 = 0xf046,
/// <summary>
/// White Up Pointing Index.
/// </summary>
WhiteUpPointingIndex_2 = 0xf047,
/// <summary>
/// White Down Pointing Index.
/// </summary>
WhiteDownPointingIndex_2 = 0xf048,
/// <summary>
/// Raised Hand With Fingers Splayed.
/// </summary>
RaisedHandWithFingersSplayed_2 = 0xf049,
/// <summary>
/// White Smiling Face.
/// </summary>
WhiteSmilingFace_2 = 0xf04a,
/// <summary>
/// Neutral Face.
/// </summary>
NeutralFace_2 = 0xf04b,
/// <summary>
/// White Frowning Face.
/// </summary>
WhiteFrowningFace_2 = 0xf04c,
/// <summary>
/// Bomb.
/// </summary>
Bomb_2 = 0xf04d,
/// <summary>
/// Skull And Crossbones.
/// </summary>
SkullAndCrossbones_2 = 0xf04e,
/// <summary>
/// Waving White Flag.
/// </summary>
WavingWhiteFlag_2 = 0xf04f,
/// <summary>
/// White Pennant.
/// </summary>
WhitePennant_2 = 0xf050,
/// <summary>
/// Airplane.
/// </summary>
Airplane_2 = 0xf051,
/// <summary>
/// White Sun With Rays.
/// </summary>
WhiteSunWithRays_2 = 0xf052,
/// <summary>
/// Droplet.
/// </summary>
Droplet_2 = 0xf053,
/// <summary>
/// Snowflake.
/// </summary>
Snowflake_2 = 0xf054,
/// <summary>
/// White Latin Cross.
/// </summary>
WhiteLatinCross_2 = 0xf055,
/// <summary>
/// Shadowed White Latin Cross.
/// </summary>
ShadowedWhiteLatinCross_2 = 0xf056,
/// <summary>
/// Celtic Cross.
/// </summary>
CelticCross_2 = 0xf057,
/// <summary>
/// Maltese Cross.
/// </summary>
MalteseCross_2 = 0xf058,
/// <summary>
/// Star Of David.
/// </summary>
StarOfDavid_2 = 0xf059,
/// <summary>
/// Star And Crescent.
/// </summary>
StarAndCrescent_2 = 0xf05a,
/// <summary>
/// Yin Yang.
/// </summary>
YinYang_2 = 0xf05b,
/// <summary>
/// Devanagari Om.
/// </summary>
DevanagariOm_2 = 0xf05c,
/// <summary>
/// Wheel Of Dharma.
/// </summary>
WheelOfDharma_2 = 0xf05d,
/// <summary>
/// Aries.
/// </summary>
Aries_2 = 0xf05e,
/// <summary>
/// Taurus.
/// </summary>
Taurus_2 = 0xf05f,
/// <summary>
/// Gemini.
/// </summary>
Gemini_2 = 0xf060,
/// <summary>
/// Cancer.
/// </summary>
Cancer_2 = 0xf061,
/// <summary>
/// Leo.
/// </summary>
Leo_2 = 0xf062,
/// <summary>
/// Virgo.
/// </summary>
Virgo_2 = 0xf063,
/// <summary>
/// Libra.
/// </summary>
Libra_2 = 0xf064,
/// <summary>
/// Scorpius.
/// </summary>
Scorpius_2 = 0xf065,
/// <summary>
/// Sagittarius.
/// </summary>
Sagittarius_2 = 0xf066,
/// <summary>
/// Capricorn.
/// </summary>
Capricorn_2 = 0xf067,
/// <summary>
/// Aquarius.
/// </summary>
Aquarius_2 = 0xf068,
/// <summary>
/// Pisces.
/// </summary>
Pisces_2 = 0xf069,
/// <summary>
/// Script Ligature Et Ornament.
/// </summary>
ScriptLigatureEtOrnament_2 = 0xf06a,
/// <summary>
/// Swash Ampersand Ornament.
/// </summary>
SwashAmpersandOrnament_2 = 0xf06b,
/// <summary>
/// Black Circle.
/// </summary>
BlackCircle_2 = 0xf06c,
/// <summary>
/// Lower Right Shadowed White Circle.
/// </summary>
LowerRightShadowedWhiteCircle_2 = 0xf06d,
/// <summary>
/// Black Square.
/// </summary>
BlackSquare_2 = 0xf06e,
/// <summary>
/// White Square.
/// </summary>
WhiteSquare_2 = 0xf06f,
/// <summary>
/// Bold White Square.
/// </summary>
BoldWhiteSquare_2 = 0xf070,
/// <summary>
/// Lower Right Shadowed White Square.
/// </summary>
LowerRightShadowedWhiteSquare_2 = 0xf071,
/// <summary>
/// Upper Right Shadowed White Square.
/// </summary>
UpperRightShadowedWhiteSquare_2 = 0xf072,
/// <summary>
/// Black Medium Lozenge.
/// </summary>
BlackMediumLozenge_2 = 0xf073,
/// <summary>
/// Black Lozenge.
/// </summary>
BlackLozenge_2 = 0xf074,
/// <summary>
/// Black Diamond.
/// </summary>
BlackDiamond_2 = 0xf075,
/// <summary>
/// Black Diamond Minus White X.
/// </summary>
BlackDiamondMinusWhiteX_2 = 0xf076,
/// <summary>
/// Black Medium Diamond.
/// </summary>
BlackMediumDiamond_2 = 0xf077,
/// <summary>
/// X In A Rectangle Box.
/// </summary>
XInARectangleBox_2 = 0xf078,
/// <summary>
/// Up Arrowhead In A Rectangle Box.
/// </summary>
UpArrowheadInARectangleBox_2 = 0xf079,
/// <summary>
/// Place Of Interest Sign.
/// </summary>
PlaceOfInterestSign_2 = 0xf07a,
/// <summary>
/// Rosette.
/// </summary>
Rosette_2 = 0xf07b,
/// <summary>
/// Black Rosette.
/// </summary>
BlackRosette_2 = 0xf07c,
/// <summary>
/// Sans-Serif Heavy Double Turned Comma Quotation Mark Ornament.
/// </summary>
SansSerifHeavyDoubleTurnedCommaQuotationMarkOrnament_2 = 0xf07d,
/// <summary>
/// Sans-Serif Heavy Double Comma Quotation Mark Ornament.
/// </summary>
SansSerifHeavyDoubleCommaQuotationMarkOrnament_2 = 0xf07e,
/// <summary>
/// Circled Digit Zero.
/// </summary>
CircledDigitZero_2 = 0xf080,
/// <summary>
/// Circled Digit One.
/// </summary>
CircledDigitOne_2 = 0xf081,
/// <summary>
/// Circled Digit Two.
/// </summary>
CircledDigitTwo_2 = 0xf082,
/// <summary>
/// Circled Digit Three.
/// </summary>
CircledDigitThree_2 = 0xf083,
/// <summary>
/// Circled Digit Four.
/// </summary>
CircledDigitFour_2 = 0xf084,
/// <summary>
/// Circled Digit Five.
/// </summary>
CircledDigitFive_2 = 0xf085,
/// <summary>
/// Circled Digit Six.
/// </summary>
CircledDigitSix_2 = 0xf086,
/// <summary>
/// Circled Digit Seven.
/// </summary>
CircledDigitSeven_2 = 0xf087,
/// <summary>
/// Circled Digit Eight.
/// </summary>
CircledDigitEight_2 = 0xf088,
/// <summary>
/// Circled Digit Nine.
/// </summary>
CircledDigitNine_2 = 0xf089,
/// <summary>
/// Circled Number Ten.
/// </summary>
CircledNumberTen_2 = 0xf08a,
/// <summary>
/// Negative Circled Digit Zero.
/// </summary>
NegativeCircledDigitZero_2 = 0xf08b,
/// <summary>
/// Dingbat Negative Circled Digit One.
/// </summary>
DingbatNegativeCircledDigitOne_2 = 0xf08c,
/// <summary>
/// Dingbat Negative Circled Digit Two.
/// </summary>
DingbatNegativeCircledDigitTwo_2 = 0xf08d,
/// <summary>
/// Dingbat Negative Circled Digit Three.
/// </summary>
DingbatNegativeCircledDigitThree_2 = 0xf08e,
/// <summary>
/// Dingbat Negative Circled Digit Four.
/// </summary>
DingbatNegativeCircledDigitFour_2 = 0xf08f,
/// <summary>
/// Dingbat Negative Circled Digit Five.
/// </summary>
DingbatNegativeCircledDigitFive_2 = 0xf090,
/// <summary>
/// Dingbat Negative Circled Digit Six.
/// </summary>
DingbatNegativeCircledDigitSix_2 = 0xf091,
/// <summary>
/// Dingbat Negative Circled Digit Seven.
/// </summary>
DingbatNegativeCircledDigitSeven_2 = 0xf092,
/// <summary>
/// Dingbat Negative Circled Digit Eight.
/// </summary>
DingbatNegativeCircledDigitEight_2 = 0xf093,
/// <summary>
/// Dingbat Negative Circled Digit Nine.
/// </summary>
DingbatNegativeCircledDigitNine_2 = 0xf094,
/// <summary>
/// Dingbat Negative Circled Number Ten.
/// </summary>
DingbatNegativeCircledNumberTen_2 = 0xf095,
/// <summary>
/// North East Pointing Bud.
/// </summary>
NorthEastPointingBud_2 = 0xf096,
/// <summary>
/// North West Pointing Bud.
/// </summary>
NorthWestPointingBud_2 = 0xf097,
/// <summary>
/// South West Pointing Bud.
/// </summary>
SouthWestPointingBud_2 = 0xf098,
/// <summary>
/// South East Pointing Bud.
/// </summary>
SouthEastPointingBud_2 = 0xf099,
/// <summary>
/// Heavy North East Pointing Vine Leaf.
/// </summary>
HeavyNorthEastPointingVineLeaf_2 = 0xf09a,
/// <summary>
/// Heavy North West Pointing Vine Leaf.
/// </summary>
HeavyNorthWestPointingVineLeaf_2 = 0xf09b,
/// <summary>
/// Heavy South West Pointing Vine Leaf.
/// </summary>
HeavySouthWestPointingVineLeaf_2 = 0xf09c,
/// <summary>
/// Heavy South East Pointing Vine Leaf.
/// </summary>
HeavySouthEastPointingVineLeaf_2 = 0xf09d,
/// <summary>
/// Middle Dot.
/// </summary>
MiddleDot_2 = 0xf09e,
/// <summary>
/// Bullet.
/// </summary>
Bullet_2 = 0xf09f,
/// <summary>
/// Black Small Square.
/// </summary>
BlackSmallSquare_3 = 0xf0a0,
/// <summary>
/// Medium White Circle.
/// </summary>
MediumWhiteCircle_2 = 0xf0a1,
/// <summary>
/// Bold White Circle.
/// </summary>
BoldWhiteCircle_2 = 0xf0a2,
/// <summary>
/// Very Heavy White Circle.
/// </summary>
VeryHeavyWhiteCircle_2 = 0xf0a3,
/// <summary>
/// Fisheye.
/// </summary>
Fisheye_2 = 0xf0a4,
/// <summary>
/// Bullseye.
/// </summary>
Bullseye_2 = 0xf0a5,
/// <summary>
/// Upper Right Shadowed White Circle.
/// </summary>
UpperRightShadowedWhiteCircle_2 = 0xf0a6,
/// <summary>
/// Black Small Square.
/// </summary>
BlackSmallSquare_4 = 0xf0a7,
/// <summary>
/// White Medium Square.
/// </summary>
WhiteMediumSquare_2 = 0xf0a8,
/// <summary>
/// Three Pointed Black Star.
/// </summary>
ThreePointedBlackStar_2 = 0xf0a9,
/// <summary>
/// Black Four Pointed Star.
/// </summary>
BlackFourPointedStar_2 = 0xf0aa,
/// <summary>
/// Black Star.
/// </summary>
BlackStar_2 = 0xf0ab,
/// <summary>
/// Six Pointed Black Star.
/// </summary>
SixPointedBlackStar_2 = 0xf0ac,
/// <summary>
/// Eight Pointed Black Star.
/// </summary>
EightPointedBlackStar_2 = 0xf0ad,
/// <summary>
/// Twelve Pointed Black Star.
/// </summary>
TwelvePointedBlackStar_2 = 0xf0ae,
/// <summary>
/// Eight Pointed Pinwheel Star.
/// </summary>
EightPointedPinwheelStar_2 = 0xf0af,
/// <summary>
/// Square Position Indicator.
/// </summary>
SquarePositionIndicator_2 = 0xf0b0,
/// <summary>
/// Position Indicator.
/// </summary>
PositionIndicator_2 = 0xf0b1,
/// <summary>
/// White Concave-Sided Diamond.
/// </summary>
WhiteConcaveSidedDiamond_2 = 0xf0b2,
/// <summary>
/// Square Lozenge.
/// </summary>
SquareLozenge_2 = 0xf0b3,
/// <summary>
/// Uncertainty Sign.
/// </summary>
UncertaintySign_2 = 0xf0b4,
/// <summary>
/// Circled White Star.
/// </summary>
CircledWhiteStar_2 = 0xf0b5,
/// <summary>
/// Shadowed White Star.
/// </summary>
ShadowedWhiteStar_2 = 0xf0b6,
/// <summary>
/// Clock Face One Oclock.
/// </summary>
ClockFaceOneOclock_2 = 0xf0b7,
/// <summary>
/// Clock Face Two Oclock.
/// </summary>
ClockFaceTwoOclock_2 = 0xf0b8,
/// <summary>
/// Clock Face Three Oclock.
/// </summary>
ClockFaceThreeOclock_2 = 0xf0b9,
/// <summary>
/// Clock Face Four Oclock.
/// </summary>
ClockFaceFourOclock_2 = 0xf0ba,
/// <summary>
/// Clock Face Five Oclock.
/// </summary>
ClockFaceFiveOclock_2 = 0xf0bb,
/// <summary>
/// Clock Face Six Oclock.
/// </summary>
ClockFaceSixOclock_2 = 0xf0bc,
/// <summary>
/// Clock Face Seven Oclock.
/// </summary>
ClockFaceSevenOclock_2 = 0xf0bd,
/// <summary>
/// Clock Face Eight Oclock.
/// </summary>
ClockFaceEightOclock_2 = 0xf0be,
/// <summary>
/// Clock Face Nine Oclock.
/// </summary>
ClockFaceNineOclock_2 = 0xf0bf,
/// <summary>
/// Clock Face Ten Oclock.
/// </summary>
ClockFaceTenOclock_2 = 0xf0c0,
/// <summary>
/// Clock Face Eleven Oclock.
/// </summary>
ClockFaceElevenOclock_2 = 0xf0c1,
/// <summary>
/// Clock Face Twelve Oclock.
/// </summary>
ClockFaceTwelveOclock_2 = 0xf0c2,
/// <summary>
/// Ribbon Arrow Down Left.
/// </summary>
RibbonArrowDownLeft_2 = 0xf0c3,
/// <summary>
/// Ribbon Arrow Down Right.
/// </summary>
RibbonArrowDownRight_2 = 0xf0c4,
/// <summary>
/// Ribbon Arrow Up Left.
/// </summary>
RibbonArrowUpLeft_2 = 0xf0c5,
/// <summary>
/// Ribbon Arrow Up Right.
/// </summary>
RibbonArrowUpRight_2 = 0xf0c6,
/// <summary>
/// Ribbon Arrow Left Up.
/// </summary>
RibbonArrowLeftUp_2 = 0xf0c7,
/// <summary>
/// Ribbon Arrow Right Up.
/// </summary>
RibbonArrowRightUp_2 = 0xf0c8,
/// <summary>
/// Ribbon Arrow Left Down.
/// </summary>
RibbonArrowLeftDown_2 = 0xf0c9,
/// <summary>
/// Ribbon Arrow Right Down.
/// </summary>
RibbonArrowRightDown_2 = 0xf0ca,
/// <summary>
/// Solid Quilt Square Ornament.
/// </summary>
SolidQuiltSquareOrnament_2 = 0xf0cb,
/// <summary>
/// Solid Quilt Square Ornament In Black Square.
/// </summary>
SolidQuiltSquareOrnamentInBlackSquare_2 = 0xf0cc,
/// <summary>
/// Turned South West Pointing Leaf.
/// </summary>
TurnedSouthWestPointingLeaf_2 = 0xf0cd,
/// <summary>
/// Turned North West Pointing Leaf.
/// </summary>
TurnedNorthWestPointingLeaf_2 = 0xf0ce,
/// <summary>
/// Turned South East Pointing Leaf.
/// </summary>
TurnedSouthEastPointingLeaf_2 = 0xf0cf,
/// <summary>
/// Turned North East Pointing Leaf.
/// </summary>
TurnedNorthEastPointingLeaf_2 = 0xf0d0,
/// <summary>
/// North West Pointing Leaf.
/// </summary>
NorthWestPointingLeaf_2 = 0xf0d1,
/// <summary>
/// South West Pointing Leaf.
/// </summary>
SouthWestPointingLeaf_2 = 0xf0d2,
/// <summary>
/// North East Pointing Leaf.
/// </summary>
NorthEastPointingLeaf_2 = 0xf0d3,
/// <summary>
/// South East Pointing Leaf.
/// </summary>
SouthEastPointingLeaf_2 = 0xf0d4,
/// <summary>
/// Erase To The Left.
/// </summary>
EraseToTheLeft_2 = 0xf0d5,
/// <summary>
/// Erase To The Right.
/// </summary>
EraseToTheRight_2 = 0xf0d6,
/// <summary>
/// Three-D Top-Lighted Leftwards Equilateral Arrowhead.
/// </summary>
ThreeDTopLightedLeftwardsEquilateralArrowhead_2 = 0xf0d7,
/// <summary>
/// Three-D Top-Lighted Rightwards Equilateral Arrowhead.
/// </summary>
ThreeDTopLightedRightwardsEquilateralArrowhead_2 = 0xf0d8,
/// <summary>
/// Three-D Right-Lighted Upwards Equilateral Arrowhead.
/// </summary>
ThreeDRightLightedUpwardsEquilateralArrowhead_2 = 0xf0d9,
/// <summary>
/// Three-D Left-Lighted Downwards Equilateral Arrowhead.
/// </summary>
ThreeDLeftLightedDownwardsEquilateralArrowhead_2 = 0xf0da,
/// <summary>
/// Leftwards Black Circled White Arrow.
/// </summary>
LeftwardsBlackCircledWhiteArrow_2 = 0xf0db,
/// <summary>
/// Rightwards Black Circled White Arrow.
/// </summary>
RightwardsBlackCircledWhiteArrow_2 = 0xf0dc,
/// <summary>
/// Upwards Black Circled White Arrow.
/// </summary>
UpwardsBlackCircledWhiteArrow_2 = 0xf0dd,
/// <summary>
/// Downwards Black Circled White Arrow.
/// </summary>
DownwardsBlackCircledWhiteArrow_2 = 0xf0de,
/// <summary>
/// Wide-Headed Leftwards Barb Arrow.
/// </summary>
WideHeadedLeftwardsBarbArrow_2 = 0xf0df,
/// <summary>
/// Wide-Headed Rightwards Barb Arrow.
/// </summary>
WideHeadedRightwardsBarbArrow_2 = 0xf0e0,
/// <summary>
/// Wide-Headed Upwards Barb Arrow.
/// </summary>
WideHeadedUpwardsBarbArrow_2 = 0xf0e1,
/// <summary>
/// Wide-Headed Downwards Barb Arrow.
/// </summary>
WideHeadedDownwardsBarbArrow_2 = 0xf0e2,
/// <summary>
/// Wide-Headed North West Barb Arrow.
/// </summary>
WideHeadedNorthWestBarbArrow_2 = 0xf0e3,
/// <summary>
/// Wide-Headed North East Barb Arrow.
/// </summary>
WideHeadedNorthEastBarbArrow_2 = 0xf0e4,
/// <summary>
/// Wide-Headed South West Barb Arrow.
/// </summary>
WideHeadedSouthWestBarbArrow_2 = 0xf0e5,
/// <summary>
/// Wide-Headed South East Barb Arrow.
/// </summary>
WideHeadedSouthEastBarbArrow_2 = 0xf0e6,
/// <summary>
/// Wide-Headed Leftwards Heavy Barb Arrow.
/// </summary>
WideHeadedLeftwardsHeavyBarbArrow_2 = 0xf0e7,
/// <summary>
/// Wide-Headed Rightwards Heavy Barb Arrow.
/// </summary>
WideHeadedRightwardsHeavyBarbArrow_2 = 0xf0e8,
/// <summary>
/// Wide-Headed Upwards Heavy Barb Arrow.
/// </summary>
WideHeadedUpwardsHeavyBarbArrow_2 = 0xf0e9,
/// <summary>
/// Wide-Headed Downwards Heavy Barb Arrow.
/// </summary>
WideHeadedDownwardsHeavyBarbArrow_2 = 0xf0ea,
/// <summary>
/// Wide-Headed North West Heavy Barb Arrow.
/// </summary>
WideHeadedNorthWestHeavyBarbArrow_2 = 0xf0eb,
/// <summary>
/// Wide-Headed North East Heavy Barb Arrow.
/// </summary>
WideHeadedNorthEastHeavyBarbArrow_2 = 0xf0ec,
/// <summary>
/// Wide-Headed South West Heavy Barb Arrow.
/// </summary>
WideHeadedSouthWestHeavyBarbArrow_2 = 0xf0ed,
/// <summary>
/// Wide-Headed South East Heavy Barb Arrow.
/// </summary>
WideHeadedSouthEastHeavyBarbArrow_2 = 0xf0ee,
/// <summary>
/// Leftwards White Arrow.
/// </summary>
LeftwardsWhiteArrow_2 = 0xf0ef,
/// <summary>
/// Rightwards White Arrow.
/// </summary>
RightwardsWhiteArrow_2 = 0xf0f0,
/// <summary>
/// Upwards White Arrow.
/// </summary>
UpwardsWhiteArrow_2 = 0xf0f1,
/// <summary>
/// Downwards White Arrow.
/// </summary>
DownwardsWhiteArrow_2 = 0xf0f2,
/// <summary>
/// Left Right White Arrow.
/// </summary>
LeftRightWhiteArrow_2 = 0xf0f3,
/// <summary>
/// Up Down White Arrow.
/// </summary>
UpDownWhiteArrow_2 = 0xf0f4,
/// <summary>
/// North East White Arrow.
/// </summary>
NorthEastWhiteArrow_2 = 0xf0f5,
/// <summary>
/// North West White Arrow.
/// </summary>
NorthWestWhiteArrow_2 = 0xf0f6,
/// <summary>
/// South West White Arrow.
/// </summary>
SouthWestWhiteArrow_2 = 0xf0f7,
/// <summary>
/// South East White Arrow.
/// </summary>
SouthEastWhiteArrow_2 = 0xf0f8,
/// <summary>
/// White Arrow Shaft Width One.
/// </summary>
WhiteArrowShaftWidthOne_2 = 0xf0f9,
/// <summary>
/// White Arrow Shaft Width Two Thirds.
/// </summary>
WhiteArrowShaftWidthTwoThirds_2 = 0xf0fa,
/// <summary>
/// Ballot Bold Script X.
/// </summary>
BallotBoldScriptX_2 = 0xf0fb,
/// <summary>
/// Heavy Check Mark.
/// </summary>
HeavyCheckMark_2 = 0xf0fc,
/// <summary>
/// Ballot Box With Bold Script X.
/// </summary>
BallotBoxWithBoldScriptX_2 = 0xf0fd,
/// <summary>
/// Ballot Box With Bold Check.
/// </summary>
BallotBoxWithBoldCheck_2 = 0xf0fe,
/// <summary>
/// Windows Flag.
/// </summary>
WindowsFlag_2 = 0xf0ff
}
/// <summary>
/// WingdingsGlyph Enums.
/// </summary>
public static partial class WingdingsGlyphResource
{
/// <summary>
/// Device Control Four.
/// </summary>
public const string DeviceControlFour = "\u0014";
/// <summary>
/// Lower Left Pencil.
/// </summary>
public const string LowerLeftPencil = "\u0021";
/// <summary>
/// Black Scissors.
/// </summary>
public const string BlackScissors = "\u0022";
/// <summary>
/// Upper Blade Scissors.
/// </summary>
public const string UpperBladeScissors = "\u0023";
/// <summary>
/// Eyeglasses.
/// </summary>
public const string Eyeglasses = "\u0024";
/// <summary>
/// Ringing Bell.
/// </summary>
public const string RingingBell = "\u0025";
/// <summary>
/// Book.
/// </summary>
public const string Book = "\u0026";
/// <summary>
/// Candle.
/// </summary>
public const string Candle = "\u0027";
/// <summary>
/// Black Touchtone Telephone.
/// </summary>
public const string BlackTouchtoneTelephone = "\u0028";
/// <summary>
/// Telephone Location Sign.
/// </summary>
public const string TelephoneLocationSign = "\u0029";
/// <summary>
/// Back Of Envelope.
/// </summary>
public const string BackOfEnvelope = "\u002a";
/// <summary>
/// Stamped Envelope.
/// </summary>
public const string StampedEnvelope = "\u002b";
/// <summary>
/// Closed Mailbox With Lowered Flag.
/// </summary>
public const string ClosedMailboxWithLoweredFlag = "\u002c";
/// <summary>
/// Closed Mailbox With Raised Flag.
/// </summary>
public const string ClosedMailboxWithRaisedFlag = "\u002d";
/// <summary>
/// Open Mailbox With Raised Flag.
/// </summary>
public const string OpenMailboxWithRaisedFlag = "\u002e";
/// <summary>
/// Open Mailbox With Lowered Flag.
/// </summary>
public const string OpenMailboxWithLoweredFlag = "\u002f";
/// <summary>
/// File Folder.
/// </summary>
public const string FileFolder = "\u0030";
/// <summary>
/// Open File Folder.
/// </summary>
public const string OpenFileFolder = "\u0031";
/// <summary>
/// Page Facing Up.
/// </summary>
public const string PageFacingUp = "\u0032";
/// <summary>
/// Page.
/// </summary>
public const string Page = "\u0033";
/// <summary>
/// Pages.
/// </summary>
public const string Pages = "\u0034";
/// <summary>
/// File Cabinet.
/// </summary>
public const string FileCabinet = "\u0035";
/// <summary>
/// Hourglass.
/// </summary>
public const string Hourglass = "\u0036";
/// <summary>
/// Wired Keyboard.
/// </summary>
public const string WiredKeyboard = "\u0037";
/// <summary>
/// Two Button Mouse.
/// </summary>
public const string TwoButtonMouse = "\u0038";
/// <summary>
/// Trackball.
/// </summary>
public const string Trackball = "\u0039";
/// <summary>
/// Old Personal Computer.
/// </summary>
public const string OldPersonalComputer = "\u003a";
/// <summary>
/// Hard Disk.
/// </summary>
public const string HardDisk = "\u003b";
/// <summary>
/// White Hard Shell Floppy Disk.
/// </summary>
public const string WhiteHardShellFloppyDisk = "\u003c";
/// <summary>
/// Soft Shell Floppy Disk.
/// </summary>
public const string SoftShellFloppyDisk = "\u003d";
/// <summary>
/// Tape Drive.
/// </summary>
public const string TapeDrive = "\u003e";
/// <summary>
/// Writing Hand.
/// </summary>
public const string WritingHand = "\u003f";
/// <summary>
/// Left Writing Hand.
/// </summary>
public const string LeftWritingHand = "\u0040";
/// <summary>
/// Victory Hand.
/// </summary>
public const string VictoryHand = "\u0041";
/// <summary>
/// Ok Hand Sign.
/// </summary>
public const string OkHandSign = "\u0042";
/// <summary>
/// Thumbs Up Sign.
/// </summary>
public const string ThumbsUpSign = "\u0043";
/// <summary>
/// Thumbs Down Sign.
/// </summary>
public const string ThumbsDownSign = "\u0044";
/// <summary>
/// White Left Pointing Index.
/// </summary>
public const string WhiteLeftPointingIndex = "\u0045";
/// <summary>
/// White Right Pointing Index.
/// </summary>
public const string WhiteRightPointingIndex = "\u0046";
/// <summary>
/// White Up Pointing Index.
/// </summary>
public const string WhiteUpPointingIndex = "\u0047";
/// <summary>
/// White Down Pointing Index.
/// </summary>
public const string WhiteDownPointingIndex = "\u0048";
/// <summary>
/// Raised Hand With Fingers Splayed.
/// </summary>
public const string RaisedHandWithFingersSplayed = "\u0049";
/// <summary>
/// White Smiling Face.
/// </summary>
public const string WhiteSmilingFace = "\u004a";
/// <summary>
/// Neutral Face.
/// </summary>
public const string NeutralFace = "\u004b";
/// <summary>
/// White Frowning Face.
/// </summary>
public const string WhiteFrowningFace = "\u004c";
/// <summary>
/// Bomb.
/// </summary>
public const string Bomb = "\u004d";
/// <summary>
/// Skull And Crossbones.
/// </summary>
public const string SkullAndCrossbones = "\u004e";
/// <summary>
/// Waving White Flag.
/// </summary>
public const string WavingWhiteFlag = "\u004f";
/// <summary>
/// White Pennant.
/// </summary>
public const string WhitePennant = "\u0050";
/// <summary>
/// Airplane.
/// </summary>
public const string Airplane = "\u0051";
/// <summary>
/// White Sun With Rays.
/// </summary>
public const string WhiteSunWithRays = "\u0052";
/// <summary>
/// Droplet.
/// </summary>
public const string Droplet = "\u0053";
/// <summary>
/// Snowflake.
/// </summary>
public const string Snowflake = "\u0054";
/// <summary>
/// White Latin Cross.
/// </summary>
public const string WhiteLatinCross = "\u0055";
/// <summary>
/// Shadowed White Latin Cross.
/// </summary>
public const string ShadowedWhiteLatinCross = "\u0056";
/// <summary>
/// Celtic Cross.
/// </summary>
public const string CelticCross = "\u0057";
/// <summary>
/// Maltese Cross.
/// </summary>
public const string MalteseCross = "\u0058";
/// <summary>
/// Star Of David.
/// </summary>
public const string StarOfDavid = "\u0059";
/// <summary>
/// Star And Crescent.
/// </summary>
public const string StarAndCrescent = "\u005a";
/// <summary>
/// Yin Yang.
/// </summary>
public const string YinYang = "\u005b";
/// <summary>
/// Devanagari Om.
/// </summary>
public const string DevanagariOm = "\u005c";
/// <summary>
/// Wheel Of Dharma.
/// </summary>
public const string WheelOfDharma = "\u005d";
/// <summary>
/// Aries.
/// </summary>
public const string Aries = "\u005e";
/// <summary>
/// Taurus.
/// </summary>
public const string Taurus = "\u005f";
/// <summary>
/// Gemini.
/// </summary>
public const string Gemini = "\u0060";
/// <summary>
/// Cancer.
/// </summary>
public const string Cancer = "\u0061";
/// <summary>
/// Leo.
/// </summary>
public const string Leo = "\u0062";
/// <summary>
/// Virgo.
/// </summary>
public const string Virgo = "\u0063";
/// <summary>
/// Libra.
/// </summary>
public const string Libra = "\u0064";
/// <summary>
/// Scorpius.
/// </summary>
public const string Scorpius = "\u0065";
/// <summary>
/// Sagittarius.
/// </summary>
public const string Sagittarius = "\u0066";
/// <summary>
/// Capricorn.
/// </summary>
public const string Capricorn = "\u0067";
/// <summary>
/// Aquarius.
/// </summary>
public const string Aquarius = "\u0068";
/// <summary>
/// Pisces.
/// </summary>
public const string Pisces = "\u0069";
/// <summary>
/// Script Ligature Et Ornament.
/// </summary>
public const string ScriptLigatureEtOrnament = "\u006a";
/// <summary>
/// Swash Ampersand Ornament.
/// </summary>
public const string SwashAmpersandOrnament = "\u006b";
/// <summary>
/// Black Circle.
/// </summary>
public const string BlackCircle = "\u006c";
/// <summary>
/// Lower Right Shadowed White Circle.
/// </summary>
public const string LowerRightShadowedWhiteCircle = "\u006d";
/// <summary>
/// Black Square.
/// </summary>
public const string BlackSquare = "\u006e";
/// <summary>
/// White Square.
/// </summary>
public const string WhiteSquare = "\u006f";
/// <summary>
/// Bold White Square.
/// </summary>
public const string BoldWhiteSquare = "\u0070";
/// <summary>
/// Lower Right Shadowed White Square.
/// </summary>
public const string LowerRightShadowedWhiteSquare = "\u0071";
/// <summary>
/// Upper Right Shadowed White Square.
/// </summary>
public const string UpperRightShadowedWhiteSquare = "\u0072";
/// <summary>
/// Black Medium Lozenge.
/// </summary>
public const string BlackMediumLozenge = "\u0073";
/// <summary>
/// Black Lozenge.
/// </summary>
public const string BlackLozenge = "\u0074";
/// <summary>
/// Black Diamond.
/// </summary>
public const string BlackDiamond = "\u0075";
/// <summary>
/// Black Diamond Minus White X.
/// </summary>
public const string BlackDiamondMinusWhiteX = "\u0076";
/// <summary>
/// Black Medium Diamond.
/// </summary>
public const string BlackMediumDiamond = "\u0077";
/// <summary>
/// X In A Rectangle Box.
/// </summary>
public const string XInARectangleBox = "\u0078";
/// <summary>
/// Up Arrowhead In A Rectangle Box.
/// </summary>
public const string UpArrowheadInARectangleBox = "\u0079";
/// <summary>
/// Place Of Interest Sign.
/// </summary>
public const string PlaceOfInterestSign = "\u007a";
/// <summary>
/// Rosette.
/// </summary>
public const string Rosette = "\u007b";
/// <summary>
/// Black Rosette.
/// </summary>
public const string BlackRosette = "\u007c";
/// <summary>
/// Sans-Serif Heavy Double Turned Comma Quotation Mark Ornament.
/// </summary>
public const string SansSerifHeavyDoubleTurnedCommaQuotationMarkOrnament = "\u007d";
/// <summary>
/// Sans-Serif Heavy Double Comma Quotation Mark Ornament.
/// </summary>
public const string SansSerifHeavyDoubleCommaQuotationMarkOrnament = "\u007e";
/// <summary>
/// Circled Digit Zero.
/// </summary>
public const string CircledDigitZero = "\u0080";
/// <summary>
/// Circled Digit One.
/// </summary>
public const string CircledDigitOne = "\u0081";
/// <summary>
/// Circled Digit Two.
/// </summary>
public const string CircledDigitTwo = "\u0082";
/// <summary>
/// Circled Digit Three.
/// </summary>
public const string CircledDigitThree = "\u0083";
/// <summary>
/// Circled Digit Four.
/// </summary>
public const string CircledDigitFour = "\u0084";
/// <summary>
/// Circled Digit Five.
/// </summary>
public const string CircledDigitFive = "\u0085";
/// <summary>
/// Circled Digit Six.
/// </summary>
public const string CircledDigitSix = "\u0086";
/// <summary>
/// Circled Digit Seven.
/// </summary>
public const string CircledDigitSeven = "\u0087";
/// <summary>
/// Circled Digit Eight.
/// </summary>
public const string CircledDigitEight = "\u0088";
/// <summary>
/// Circled Digit Nine.
/// </summary>
public const string CircledDigitNine = "\u0089";
/// <summary>
/// Circled Number Ten.
/// </summary>
public const string CircledNumberTen = "\u008a";
/// <summary>
/// Negative Circled Digit Zero.
/// </summary>
public const string NegativeCircledDigitZero = "\u008b";
/// <summary>
/// Dingbat Negative Circled Digit One.
/// </summary>
public const string DingbatNegativeCircledDigitOne = "\u008c";
/// <summary>
/// Dingbat Negative Circled Digit Two.
/// </summary>
public const string DingbatNegativeCircledDigitTwo = "\u008d";
/// <summary>
/// Dingbat Negative Circled Digit Three.
/// </summary>
public const string DingbatNegativeCircledDigitThree = "\u008e";
/// <summary>
/// Dingbat Negative Circled Digit Four.
/// </summary>
public const string DingbatNegativeCircledDigitFour = "\u008f";
/// <summary>
/// Dingbat Negative Circled Digit Five.
/// </summary>
public const string DingbatNegativeCircledDigitFive = "\u0090";
/// <summary>
/// Dingbat Negative Circled Digit Six.
/// </summary>
public const string DingbatNegativeCircledDigitSix = "\u0091";
/// <summary>
/// Dingbat Negative Circled Digit Seven.
/// </summary>
public const string DingbatNegativeCircledDigitSeven = "\u0092";
/// <summary>
/// Dingbat Negative Circled Digit Eight.
/// </summary>
public const string DingbatNegativeCircledDigitEight = "\u0093";
/// <summary>
/// Dingbat Negative Circled Digit Nine.
/// </summary>
public const string DingbatNegativeCircledDigitNine = "\u0094";
/// <summary>
/// Dingbat Negative Circled Number Ten.
/// </summary>
public const string DingbatNegativeCircledNumberTen = "\u0095";
/// <summary>
/// North East Pointing Bud.
/// </summary>
public const string NorthEastPointingBud = "\u0096";
/// <summary>
/// North West Pointing Bud.
/// </summary>
public const string NorthWestPointingBud = "\u0097";
/// <summary>
/// South West Pointing Bud.
/// </summary>
public const string SouthWestPointingBud = "\u0098";
/// <summary>
/// South East Pointing Bud.
/// </summary>
public const string SouthEastPointingBud = "\u0099";
/// <summary>
/// Heavy North East Pointing Vine Leaf.
/// </summary>
public const string HeavyNorthEastPointingVineLeaf = "\u009a";
/// <summary>
/// Heavy North West Pointing Vine Leaf.
/// </summary>
public const string HeavyNorthWestPointingVineLeaf = "\u009b";
/// <summary>
/// Heavy South West Pointing Vine Leaf.
/// </summary>
public const string HeavySouthWestPointingVineLeaf = "\u009c";
/// <summary>
/// Heavy South East Pointing Vine Leaf.
/// </summary>
public const string HeavySouthEastPointingVineLeaf = "\u009d";
/// <summary>
/// Middle Dot.
/// </summary>
public const string MiddleDot = "\u009e";
/// <summary>
/// Bullet.
/// </summary>
public const string Bullet = "\u009f";
/// <summary>
/// Black Small Square.
/// </summary>
public const string BlackSmallSquare = "\u00a0";
/// <summary>
/// Medium White Circle.
/// </summary>
public const string MediumWhiteCircle = "\u00a1";
/// <summary>
/// Bold White Circle.
/// </summary>
public const string BoldWhiteCircle = "\u00a2";
/// <summary>
/// Very Heavy White Circle.
/// </summary>
public const string VeryHeavyWhiteCircle = "\u00a3";
/// <summary>
/// Fisheye.
/// </summary>
public const string Fisheye = "\u00a4";
/// <summary>
/// Bullseye.
/// </summary>
public const string Bullseye = "\u00a5";
/// <summary>
/// Upper Right Shadowed White Circle.
/// </summary>
public const string UpperRightShadowedWhiteCircle = "\u00a6";
/// <summary>
/// Black Small Square.
/// </summary>
public const string BlackSmallSquare_2 = "\u00a7";
/// <summary>
/// White Medium Square.
/// </summary>
public const string WhiteMediumSquare = "\u00a8";
/// <summary>
/// Three Pointed Black Star.
/// </summary>
public const string ThreePointedBlackStar = "\u00a9";
/// <summary>
/// Black Four Pointed Star.
/// </summary>
public const string BlackFourPointedStar = "\u00aa";
/// <summary>
/// Black Star.
/// </summary>
public const string BlackStar = "\u00ab";
/// <summary>
/// Six Pointed Black Star.
/// </summary>
public const string SixPointedBlackStar = "\u00ac";
/// <summary>
/// Eight Pointed Black Star.
/// </summary>
public const string EightPointedBlackStar = "\u00ad";
/// <summary>
/// Twelve Pointed Black Star.
/// </summary>
public const string TwelvePointedBlackStar = "\u00ae";
/// <summary>
/// Eight Pointed Pinwheel Star.
/// </summary>
public const string EightPointedPinwheelStar = "\u00af";
/// <summary>
/// Square Position Indicator.
/// </summary>
public const string SquarePositionIndicator = "\u00b0";
/// <summary>
/// Position Indicator.
/// </summary>
public const string PositionIndicator = "\u00b1";
/// <summary>
/// White Concave-Sided Diamond.
/// </summary>
public const string WhiteConcaveSidedDiamond = "\u00b2";
/// <summary>
/// Square Lozenge.
/// </summary>
public const string SquareLozenge = "\u00b3";
/// <summary>
/// Uncertainty Sign.
/// </summary>
public const string UncertaintySign = "\u00b4";
/// <summary>
/// Circled White Star.
/// </summary>
public const string CircledWhiteStar = "\u00b5";
/// <summary>
/// Shadowed White Star.
/// </summary>
public const string ShadowedWhiteStar = "\u00b6";
/// <summary>
/// Clock Face One Oclock.
/// </summary>
public const string ClockFaceOneOclock = "\u00b7";
/// <summary>
/// Clock Face Two Oclock.
/// </summary>
public const string ClockFaceTwoOclock = "\u00b8";
/// <summary>
/// Clock Face Three Oclock.
/// </summary>
public const string ClockFaceThreeOclock = "\u00b9";
/// <summary>
/// Clock Face Four Oclock.
/// </summary>
public const string ClockFaceFourOclock = "\u00ba";
/// <summary>
/// Clock Face Five Oclock.
/// </summary>
public const string ClockFaceFiveOclock = "\u00bb";
/// <summary>
/// Clock Face Six Oclock.
/// </summary>
public const string ClockFaceSixOclock = "\u00bc";
/// <summary>
/// Clock Face Seven Oclock.
/// </summary>
public const string ClockFaceSevenOclock = "\u00bd";
/// <summary>
/// Clock Face Eight Oclock.
/// </summary>
public const string ClockFaceEightOclock = "\u00be";
/// <summary>
/// Clock Face Nine Oclock.
/// </summary>
public const string ClockFaceNineOclock = "\u00bf";
/// <summary>
/// Clock Face Ten Oclock.
/// </summary>
public const string ClockFaceTenOclock = "\u00c0";
/// <summary>
/// Clock Face Eleven Oclock.
/// </summary>
public const string ClockFaceElevenOclock = "\u00c1";
/// <summary>
/// Clock Face Twelve Oclock.
/// </summary>
public const string ClockFaceTwelveOclock = "\u00c2";
/// <summary>
/// Ribbon Arrow Down Left.
/// </summary>
public const string RibbonArrowDownLeft = "\u00c3";
/// <summary>
/// Ribbon Arrow Down Right.
/// </summary>
public const string RibbonArrowDownRight = "\u00c4";
/// <summary>
/// Ribbon Arrow Up Left.
/// </summary>
public const string RibbonArrowUpLeft = "\u00c5";
/// <summary>
/// Ribbon Arrow Up Right.
/// </summary>
public const string RibbonArrowUpRight = "\u00c6";
/// <summary>
/// Ribbon Arrow Left Up.
/// </summary>
public const string RibbonArrowLeftUp = "\u00c7";
/// <summary>
/// Ribbon Arrow Right Up.
/// </summary>
public const string RibbonArrowRightUp = "\u00c8";
/// <summary>
/// Ribbon Arrow Left Down.
/// </summary>
public const string RibbonArrowLeftDown = "\u00c9";
/// <summary>
/// Ribbon Arrow Right Down.
/// </summary>
public const string RibbonArrowRightDown = "\u00ca";
/// <summary>
/// Solid Quilt Square Ornament.
/// </summary>
public const string SolidQuiltSquareOrnament = "\u00cb";
/// <summary>
/// Solid Quilt Square Ornament In Black Square.
/// </summary>
public const string SolidQuiltSquareOrnamentInBlackSquare = "\u00cc";
/// <summary>
/// Turned South West Pointing Leaf.
/// </summary>
public const string TurnedSouthWestPointingLeaf = "\u00cd";
/// <summary>
/// Turned North West Pointing Leaf.
/// </summary>
public const string TurnedNorthWestPointingLeaf = "\u00ce";
/// <summary>
/// Turned South East Pointing Leaf.
/// </summary>
public const string TurnedSouthEastPointingLeaf = "\u00cf";
/// <summary>
/// Turned North East Pointing Leaf.
/// </summary>
public const string TurnedNorthEastPointingLeaf = "\u00d0";
/// <summary>
/// North West Pointing Leaf.
/// </summary>
public const string NorthWestPointingLeaf = "\u00d1";
/// <summary>
/// South West Pointing Leaf.
/// </summary>
public const string SouthWestPointingLeaf = "\u00d2";
/// <summary>
/// North East Pointing Leaf.
/// </summary>
public const string NorthEastPointingLeaf = "\u00d3";
/// <summary>
/// South East Pointing Leaf.
/// </summary>
public const string SouthEastPointingLeaf = "\u00d4";
/// <summary>
/// Erase To The Left.
/// </summary>
public const string EraseToTheLeft = "\u00d5";
/// <summary>
/// Erase To The Right.
/// </summary>
public const string EraseToTheRight = "\u00d6";
/// <summary>
/// Three-D Top-Lighted Leftwards Equilateral Arrowhead.
/// </summary>
public const string ThreeDTopLightedLeftwardsEquilateralArrowhead = "\u00d7";
/// <summary>
/// Three-D Top-Lighted Rightwards Equilateral Arrowhead.
/// </summary>
public const string ThreeDTopLightedRightwardsEquilateralArrowhead = "\u00d8";
/// <summary>
/// Three-D Right-Lighted Upwards Equilateral Arrowhead.
/// </summary>
public const string ThreeDRightLightedUpwardsEquilateralArrowhead = "\u00d9";
/// <summary>
/// Three-D Left-Lighted Downwards Equilateral Arrowhead.
/// </summary>
public const string ThreeDLeftLightedDownwardsEquilateralArrowhead = "\u00da";
/// <summary>
/// Leftwards Black Circled White Arrow.
/// </summary>
public const string LeftwardsBlackCircledWhiteArrow = "\u00db";
/// <summary>
/// Rightwards Black Circled White Arrow.
/// </summary>
public const string RightwardsBlackCircledWhiteArrow = "\u00dc";
/// <summary>
/// Upwards Black Circled White Arrow.
/// </summary>
public const string UpwardsBlackCircledWhiteArrow = "\u00dd";
/// <summary>
/// Downwards Black Circled White Arrow.
/// </summary>
public const string DownwardsBlackCircledWhiteArrow = "\u00de";
/// <summary>
/// Wide-Headed Leftwards Barb Arrow.
/// </summary>
public const string WideHeadedLeftwardsBarbArrow = "\u00df";
/// <summary>
/// Wide-Headed Rightwards Barb Arrow.
/// </summary>
public const string WideHeadedRightwardsBarbArrow = "\u00e0";
/// <summary>
/// Wide-Headed Upwards Barb Arrow.
/// </summary>
public const string WideHeadedUpwardsBarbArrow = "\u00e1";
/// <summary>
/// Wide-Headed Downwards Barb Arrow.
/// </summary>
public const string WideHeadedDownwardsBarbArrow = "\u00e2";
/// <summary>
/// Wide-Headed North West Barb Arrow.
/// </summary>
public const string WideHeadedNorthWestBarbArrow = "\u00e3";
/// <summary>
/// Wide-Headed North East Barb Arrow.
/// </summary>
public const string WideHeadedNorthEastBarbArrow = "\u00e4";
/// <summary>
/// Wide-Headed South West Barb Arrow.
/// </summary>
public const string WideHeadedSouthWestBarbArrow = "\u00e5";
/// <summary>
/// Wide-Headed South East Barb Arrow.
/// </summary>
public const string WideHeadedSouthEastBarbArrow = "\u00e6";
/// <summary>
/// Wide-Headed Leftwards Heavy Barb Arrow.
/// </summary>
public const string WideHeadedLeftwardsHeavyBarbArrow = "\u00e7";
/// <summary>
/// Wide-Headed Rightwards Heavy Barb Arrow.
/// </summary>
public const string WideHeadedRightwardsHeavyBarbArrow = "\u00e8";
/// <summary>
/// Wide-Headed Upwards Heavy Barb Arrow.
/// </summary>
public const string WideHeadedUpwardsHeavyBarbArrow = "\u00e9";
/// <summary>
/// Wide-Headed Downwards Heavy Barb Arrow.
/// </summary>
public const string WideHeadedDownwardsHeavyBarbArrow = "\u00ea";
/// <summary>
/// Wide-Headed North West Heavy Barb Arrow.
/// </summary>
public const string WideHeadedNorthWestHeavyBarbArrow = "\u00eb";
/// <summary>
/// Wide-Headed North East Heavy Barb Arrow.
/// </summary>
public const string WideHeadedNorthEastHeavyBarbArrow = "\u00ec";
/// <summary>
/// Wide-Headed South West Heavy Barb Arrow.
/// </summary>
public const string WideHeadedSouthWestHeavyBarbArrow = "\u00ed";
/// <summary>
/// Wide-Headed South East Heavy Barb Arrow.
/// </summary>
public const string WideHeadedSouthEastHeavyBarbArrow = "\u00ee";
/// <summary>
/// Leftwards White Arrow.
/// </summary>
public const string LeftwardsWhiteArrow = "\u00ef";
/// <summary>
/// Rightwards White Arrow.
/// </summary>
public const string RightwardsWhiteArrow = "\u00f0";
/// <summary>
/// Upwards White Arrow.
/// </summary>
public const string UpwardsWhiteArrow = "\u00f1";
/// <summary>
/// Downwards White Arrow.
/// </summary>
public const string DownwardsWhiteArrow = "\u00f2";
/// <summary>
/// Left Right White Arrow.
/// </summary>
public const string LeftRightWhiteArrow = "\u00f3";
/// <summary>
/// Up Down White Arrow.
/// </summary>
public const string UpDownWhiteArrow = "\u00f4";
/// <summary>
/// North East White Arrow.
/// </summary>
public const string NorthEastWhiteArrow = "\u00f5";
/// <summary>
/// North West White Arrow.
/// </summary>
public const string NorthWestWhiteArrow = "\u00f6";
/// <summary>
/// South West White Arrow.
/// </summary>
public const string SouthWestWhiteArrow = "\u00f7";
/// <summary>
/// South East White Arrow.
/// </summary>
public const string SouthEastWhiteArrow = "\u00f8";
/// <summary>
/// White Arrow Shaft Width One.
/// </summary>
public const string WhiteArrowShaftWidthOne = "\u00f9";
/// <summary>
/// White Arrow Shaft Width Two Thirds.
/// </summary>
public const string WhiteArrowShaftWidthTwoThirds = "\u00fa";
/// <summary>
/// Ballot Bold Script X.
/// </summary>
public const string BallotBoldScriptX = "\u00fb";
/// <summary>
/// Heavy Check Mark.
/// </summary>
public const string HeavyCheckMark = "\u00fc";
/// <summary>
/// Ballot Box With Bold Script X.
/// </summary>
public const string BallotBoxWithBoldScriptX = "\u00fd";
/// <summary>
/// Ballot Box With Bold Check.
/// </summary>
public const string BallotBoxWithBoldCheck = "\u00fe";
/// <summary>
/// Windows Flag.
/// </summary>
public const string WindowsFlag = "\u00ff";
/// <summary>
/// Device Control Four.
/// </summary>
public const string DeviceControlFour_2 = "\uf014";
/// <summary>
/// Lower Left Pencil.
/// </summary>
public const string LowerLeftPencil_2 = "\uf021";
/// <summary>
/// Black Scissors.
/// </summary>
public const string BlackScissors_2 = "\uf022";
/// <summary>
/// Upper Blade Scissors.
/// </summary>
public const string UpperBladeScissors_2 = "\uf023";
/// <summary>
/// Eyeglasses.
/// </summary>
public const string Eyeglasses_2 = "\uf024";
/// <summary>
/// Ringing Bell.
/// </summary>
public const string RingingBell_2 = "\uf025";
/// <summary>
/// Book.
/// </summary>
public const string Book_2 = "\uf026";
/// <summary>
/// Candle.
/// </summary>
public const string Candle_2 = "\uf027";
/// <summary>
/// Black Touchtone Telephone.
/// </summary>
public const string BlackTouchtoneTelephone_2 = "\uf028";
/// <summary>
/// Telephone Location Sign.
/// </summary>
public const string TelephoneLocationSign_2 = "\uf029";
/// <summary>
/// Back Of Envelope.
/// </summary>
public const string BackOfEnvelope_2 = "\uf02a";
/// <summary>
/// Stamped Envelope.
/// </summary>
public const string StampedEnvelope_2 = "\uf02b";
/// <summary>
/// Closed Mailbox With Lowered Flag.
/// </summary>
public const string ClosedMailboxWithLoweredFlag_2 = "\uf02c";
/// <summary>
/// Closed Mailbox With Raised Flag.
/// </summary>
public const string ClosedMailboxWithRaisedFlag_2 = "\uf02d";
/// <summary>
/// Open Mailbox With Raised Flag.
/// </summary>
public const string OpenMailboxWithRaisedFlag_2 = "\uf02e";
/// <summary>
/// Open Mailbox With Lowered Flag.
/// </summary>
public const string OpenMailboxWithLoweredFlag_2 = "\uf02f";
/// <summary>
/// File Folder.
/// </summary>
public const string FileFolder_2 = "\uf030";
/// <summary>
/// Open File Folder.
/// </summary>
public const string OpenFileFolder_2 = "\uf031";
/// <summary>
/// Page Facing Up.
/// </summary>
public const string PageFacingUp_2 = "\uf032";
/// <summary>
/// Page.
/// </summary>
public const string Page_2 = "\uf033";
/// <summary>
/// Pages.
/// </summary>
public const string Pages_2 = "\uf034";
/// <summary>
/// File Cabinet.
/// </summary>
public const string FileCabinet_2 = "\uf035";
/// <summary>
/// Hourglass.
/// </summary>
public const string Hourglass_2 = "\uf036";
/// <summary>
/// Wired Keyboard.
/// </summary>
public const string WiredKeyboard_2 = "\uf037";
/// <summary>
/// Two Button Mouse.
/// </summary>
public const string TwoButtonMouse_2 = "\uf038";
/// <summary>
/// Trackball.
/// </summary>
public const string Trackball_2 = "\uf039";
/// <summary>
/// Old Personal Computer.
/// </summary>
public const string OldPersonalComputer_2 = "\uf03a";
/// <summary>
/// Hard Disk.
/// </summary>
public const string HardDisk_2 = "\uf03b";
/// <summary>
/// White Hard Shell Floppy Disk.
/// </summary>
public const string WhiteHardShellFloppyDisk_2 = "\uf03c";
/// <summary>
/// Soft Shell Floppy Disk.
/// </summary>
public const string SoftShellFloppyDisk_2 = "\uf03d";
/// <summary>
/// Tape Drive.
/// </summary>
public const string TapeDrive_2 = "\uf03e";
/// <summary>
/// Writing Hand.
/// </summary>
public const string WritingHand_2 = "\uf03f";
/// <summary>
/// Left Writing Hand.
/// </summary>
public const string LeftWritingHand_2 = "\uf040";
/// <summary>
/// Victory Hand.
/// </summary>
public const string VictoryHand_2 = "\uf041";
/// <summary>
/// Ok Hand Sign.
/// </summary>
public const string OkHandSign_2 = "\uf042";
/// <summary>
/// Thumbs Up Sign.
/// </summary>
public const string ThumbsUpSign_2 = "\uf043";
/// <summary>
/// Thumbs Down Sign.
/// </summary>
public const string ThumbsDownSign_2 = "\uf044";
/// <summary>
/// White Left Pointing Index.
/// </summary>
public const string WhiteLeftPointingIndex_2 = "\uf045";
/// <summary>
/// White Right Pointing Index.
/// </summary>
public const string WhiteRightPointingIndex_2 = "\uf046";
/// <summary>
/// White Up Pointing Index.
/// </summary>
public const string WhiteUpPointingIndex_2 = "\uf047";
/// <summary>
/// White Down Pointing Index.
/// </summary>
public const string WhiteDownPointingIndex_2 = "\uf048";
/// <summary>
/// Raised Hand With Fingers Splayed.
/// </summary>
public const string RaisedHandWithFingersSplayed_2 = "\uf049";
/// <summary>
/// White Smiling Face.
/// </summary>
public const string WhiteSmilingFace_2 = "\uf04a";
/// <summary>
/// Neutral Face.
/// </summary>
public const string NeutralFace_2 = "\uf04b";
/// <summary>
/// White Frowning Face.
/// </summary>
public const string WhiteFrowningFace_2 = "\uf04c";
/// <summary>
/// Bomb.
/// </summary>
public const string Bomb_2 = "\uf04d";
/// <summary>
/// Skull And Crossbones.
/// </summary>
public const string SkullAndCrossbones_2 = "\uf04e";
/// <summary>
/// Waving White Flag.
/// </summary>
public const string WavingWhiteFlag_2 = "\uf04f";
/// <summary>
/// White Pennant.
/// </summary>
public const string WhitePennant_2 = "\uf050";
/// <summary>
/// Airplane.
/// </summary>
public const string Airplane_2 = "\uf051";
/// <summary>
/// White Sun With Rays.
/// </summary>
public const string WhiteSunWithRays_2 = "\uf052";
/// <summary>
/// Droplet.
/// </summary>
public const string Droplet_2 = "\uf053";
/// <summary>
/// Snowflake.
/// </summary>
public const string Snowflake_2 = "\uf054";
/// <summary>
/// White Latin Cross.
/// </summary>
public const string WhiteLatinCross_2 = "\uf055";
/// <summary>
/// Shadowed White Latin Cross.
/// </summary>
public const string ShadowedWhiteLatinCross_2 = "\uf056";
/// <summary>
/// Celtic Cross.
/// </summary>
public const string CelticCross_2 = "\uf057";
/// <summary>
/// Maltese Cross.
/// </summary>
public const string MalteseCross_2 = "\uf058";
/// <summary>
/// Star Of David.
/// </summary>
public const string StarOfDavid_2 = "\uf059";
/// <summary>
/// Star And Crescent.
/// </summary>
public const string StarAndCrescent_2 = "\uf05a";
/// <summary>
/// Yin Yang.
/// </summary>
public const string YinYang_2 = "\uf05b";
/// <summary>
/// Devanagari Om.
/// </summary>
public const string DevanagariOm_2 = "\uf05c";
/// <summary>
/// Wheel Of Dharma.
/// </summary>
public const string WheelOfDharma_2 = "\uf05d";
/// <summary>
/// Aries.
/// </summary>
public const string Aries_2 = "\uf05e";
/// <summary>
/// Taurus.
/// </summary>
public const string Taurus_2 = "\uf05f";
/// <summary>
/// Gemini.
/// </summary>
public const string Gemini_2 = "\uf060";
/// <summary>
/// Cancer.
/// </summary>
public const string Cancer_2 = "\uf061";
/// <summary>
/// Leo.
/// </summary>
public const string Leo_2 = "\uf062";
/// <summary>
/// Virgo.
/// </summary>
public const string Virgo_2 = "\uf063";
/// <summary>
/// Libra.
/// </summary>
public const string Libra_2 = "\uf064";
/// <summary>
/// Scorpius.
/// </summary>
public const string Scorpius_2 = "\uf065";
/// <summary>
/// Sagittarius.
/// </summary>
public const string Sagittarius_2 = "\uf066";
/// <summary>
/// Capricorn.
/// </summary>
public const string Capricorn_2 = "\uf067";
/// <summary>
/// Aquarius.
/// </summary>
public const string Aquarius_2 = "\uf068";
/// <summary>
/// Pisces.
/// </summary>
public const string Pisces_2 = "\uf069";
/// <summary>
/// Script Ligature Et Ornament.
/// </summary>
public const string ScriptLigatureEtOrnament_2 = "\uf06a";
/// <summary>
/// Swash Ampersand Ornament.
/// </summary>
public const string SwashAmpersandOrnament_2 = "\uf06b";
/// <summary>
/// Black Circle.
/// </summary>
public const string BlackCircle_2 = "\uf06c";
/// <summary>
/// Lower Right Shadowed White Circle.
/// </summary>
public const string LowerRightShadowedWhiteCircle_2 = "\uf06d";
/// <summary>
/// Black Square.
/// </summary>
public const string BlackSquare_2 = "\uf06e";
/// <summary>
/// White Square.
/// </summary>
public const string WhiteSquare_2 = "\uf06f";
/// <summary>
/// Bold White Square.
/// </summary>
public const string BoldWhiteSquare_2 = "\uf070";
/// <summary>
/// Lower Right Shadowed White Square.
/// </summary>
public const string LowerRightShadowedWhiteSquare_2 = "\uf071";
/// <summary>
/// Upper Right Shadowed White Square.
/// </summary>
public const string UpperRightShadowedWhiteSquare_2 = "\uf072";
/// <summary>
/// Black Medium Lozenge.
/// </summary>
public const string BlackMediumLozenge_2 = "\uf073";
/// <summary>
/// Black Lozenge.
/// </summary>
public const string BlackLozenge_2 = "\uf074";
/// <summary>
/// Black Diamond.
/// </summary>
public const string BlackDiamond_2 = "\uf075";
/// <summary>
/// Black Diamond Minus White X.
/// </summary>
public const string BlackDiamondMinusWhiteX_2 = "\uf076";
/// <summary>
/// Black Medium Diamond.
/// </summary>
public const string BlackMediumDiamond_2 = "\uf077";
/// <summary>
/// X In A Rectangle Box.
/// </summary>
public const string XInARectangleBox_2 = "\uf078";
/// <summary>
/// Up Arrowhead In A Rectangle Box.
/// </summary>
public const string UpArrowheadInARectangleBox_2 = "\uf079";
/// <summary>
/// Place Of Interest Sign.
/// </summary>
public const string PlaceOfInterestSign_2 = "\uf07a";
/// <summary>
/// Rosette.
/// </summary>
public const string Rosette_2 = "\uf07b";
/// <summary>
/// Black Rosette.
/// </summary>
public const string BlackRosette_2 = "\uf07c";
/// <summary>
/// Sans-Serif Heavy Double Turned Comma Quotation Mark Ornament.
/// </summary>
public const string SansSerifHeavyDoubleTurnedCommaQuotationMarkOrnament_2 = "\uf07d";
/// <summary>
/// Sans-Serif Heavy Double Comma Quotation Mark Ornament.
/// </summary>
public const string SansSerifHeavyDoubleCommaQuotationMarkOrnament_2 = "\uf07e";
/// <summary>
/// Circled Digit Zero.
/// </summary>
public const string CircledDigitZero_2 = "\uf080";
/// <summary>
/// Circled Digit One.
/// </summary>
public const string CircledDigitOne_2 = "\uf081";
/// <summary>
/// Circled Digit Two.
/// </summary>
public const string CircledDigitTwo_2 = "\uf082";
/// <summary>
/// Circled Digit Three.
/// </summary>
public const string CircledDigitThree_2 = "\uf083";
/// <summary>
/// Circled Digit Four.
/// </summary>
public const string CircledDigitFour_2 = "\uf084";
/// <summary>
/// Circled Digit Five.
/// </summary>
public const string CircledDigitFive_2 = "\uf085";
/// <summary>
/// Circled Digit Six.
/// </summary>
public const string CircledDigitSix_2 = "\uf086";
/// <summary>
/// Circled Digit Seven.
/// </summary>
public const string CircledDigitSeven_2 = "\uf087";
/// <summary>
/// Circled Digit Eight.
/// </summary>
public const string CircledDigitEight_2 = "\uf088";
/// <summary>
/// Circled Digit Nine.
/// </summary>
public const string CircledDigitNine_2 = "\uf089";
/// <summary>
/// Circled Number Ten.
/// </summary>
public const string CircledNumberTen_2 = "\uf08a";
/// <summary>
/// Negative Circled Digit Zero.
/// </summary>
public const string NegativeCircledDigitZero_2 = "\uf08b";
/// <summary>
/// Dingbat Negative Circled Digit One.
/// </summary>
public const string DingbatNegativeCircledDigitOne_2 = "\uf08c";
/// <summary>
/// Dingbat Negative Circled Digit Two.
/// </summary>
public const string DingbatNegativeCircledDigitTwo_2 = "\uf08d";
/// <summary>
/// Dingbat Negative Circled Digit Three.
/// </summary>
public const string DingbatNegativeCircledDigitThree_2 = "\uf08e";
/// <summary>
/// Dingbat Negative Circled Digit Four.
/// </summary>
public const string DingbatNegativeCircledDigitFour_2 = "\uf08f";
/// <summary>
/// Dingbat Negative Circled Digit Five.
/// </summary>
public const string DingbatNegativeCircledDigitFive_2 = "\uf090";
/// <summary>
/// Dingbat Negative Circled Digit Six.
/// </summary>
public const string DingbatNegativeCircledDigitSix_2 = "\uf091";
/// <summary>
/// Dingbat Negative Circled Digit Seven.
/// </summary>
public const string DingbatNegativeCircledDigitSeven_2 = "\uf092";
/// <summary>
/// Dingbat Negative Circled Digit Eight.
/// </summary>
public const string DingbatNegativeCircledDigitEight_2 = "\uf093";
/// <summary>
/// Dingbat Negative Circled Digit Nine.
/// </summary>
public const string DingbatNegativeCircledDigitNine_2 = "\uf094";
/// <summary>
/// Dingbat Negative Circled Number Ten.
/// </summary>
public const string DingbatNegativeCircledNumberTen_2 = "\uf095";
/// <summary>
/// North East Pointing Bud.
/// </summary>
public const string NorthEastPointingBud_2 = "\uf096";
/// <summary>
/// North West Pointing Bud.
/// </summary>
public const string NorthWestPointingBud_2 = "\uf097";
/// <summary>
/// South West Pointing Bud.
/// </summary>
public const string SouthWestPointingBud_2 = "\uf098";
/// <summary>
/// South East Pointing Bud.
/// </summary>
public const string SouthEastPointingBud_2 = "\uf099";
/// <summary>
/// Heavy North East Pointing Vine Leaf.
/// </summary>
public const string HeavyNorthEastPointingVineLeaf_2 = "\uf09a";
/// <summary>
/// Heavy North West Pointing Vine Leaf.
/// </summary>
public const string HeavyNorthWestPointingVineLeaf_2 = "\uf09b";
/// <summary>
/// Heavy South West Pointing Vine Leaf.
/// </summary>
public const string HeavySouthWestPointingVineLeaf_2 = "\uf09c";
/// <summary>
/// Heavy South East Pointing Vine Leaf.
/// </summary>
public const string HeavySouthEastPointingVineLeaf_2 = "\uf09d";
/// <summary>
/// Middle Dot.
/// </summary>
public const string MiddleDot_2 = "\uf09e";
/// <summary>
/// Bullet.
/// </summary>
public const string Bullet_2 = "\uf09f";
/// <summary>
/// Black Small Square.
/// </summary>
public const string BlackSmallSquare_3 = "\uf0a0";
/// <summary>
/// Medium White Circle.
/// </summary>
public const string MediumWhiteCircle_2 = "\uf0a1";
/// <summary>
/// Bold White Circle.
/// </summary>
public const string BoldWhiteCircle_2 = "\uf0a2";
/// <summary>
/// Very Heavy White Circle.
/// </summary>
public const string VeryHeavyWhiteCircle_2 = "\uf0a3";
/// <summary>
/// Fisheye.
/// </summary>
public const string Fisheye_2 = "\uf0a4";
/// <summary>
/// Bullseye.
/// </summary>
public const string Bullseye_2 = "\uf0a5";
/// <summary>
/// Upper Right Shadowed White Circle.
/// </summary>
public const string UpperRightShadowedWhiteCircle_2 = "\uf0a6";
/// <summary>
/// Black Small Square.
/// </summary>
public const string BlackSmallSquare_4 = "\uf0a7";
/// <summary>
/// White Medium Square.
/// </summary>
public const string WhiteMediumSquare_2 = "\uf0a8";
/// <summary>
/// Three Pointed Black Star.
/// </summary>
public const string ThreePointedBlackStar_2 = "\uf0a9";
/// <summary>
/// Black Four Pointed Star.
/// </summary>
public const string BlackFourPointedStar_2 = "\uf0aa";
/// <summary>
/// Black Star.
/// </summary>
public const string BlackStar_2 = "\uf0ab";
/// <summary>
/// Six Pointed Black Star.
/// </summary>
public const string SixPointedBlackStar_2 = "\uf0ac";
/// <summary>
/// Eight Pointed Black Star.
/// </summary>
public const string EightPointedBlackStar_2 = "\uf0ad";
/// <summary>
/// Twelve Pointed Black Star.
/// </summary>
public const string TwelvePointedBlackStar_2 = "\uf0ae";
/// <summary>
/// Eight Pointed Pinwheel Star.
/// </summary>
public const string EightPointedPinwheelStar_2 = "\uf0af";
/// <summary>
/// Square Position Indicator.
/// </summary>
public const string SquarePositionIndicator_2 = "\uf0b0";
/// <summary>
/// Position Indicator.
/// </summary>
public const string PositionIndicator_2 = "\uf0b1";
/// <summary>
/// White Concave-Sided Diamond.
/// </summary>
public const string WhiteConcaveSidedDiamond_2 = "\uf0b2";
/// <summary>
/// Square Lozenge.
/// </summary>
public const string SquareLozenge_2 = "\uf0b3";
/// <summary>
/// Uncertainty Sign.
/// </summary>
public const string UncertaintySign_2 = "\uf0b4";
/// <summary>
/// Circled White Star.
/// </summary>
public const string CircledWhiteStar_2 = "\uf0b5";
/// <summary>
/// Shadowed White Star.
/// </summary>
public const string ShadowedWhiteStar_2 = "\uf0b6";
/// <summary>
/// Clock Face One Oclock.
/// </summary>
public const string ClockFaceOneOclock_2 = "\uf0b7";
/// <summary>
/// Clock Face Two Oclock.
/// </summary>
public const string ClockFaceTwoOclock_2 = "\uf0b8";
/// <summary>
/// Clock Face Three Oclock.
/// </summary>
public const string ClockFaceThreeOclock_2 = "\uf0b9";
/// <summary>
/// Clock Face Four Oclock.
/// </summary>
public const string ClockFaceFourOclock_2 = "\uf0ba";
/// <summary>
/// Clock Face Five Oclock.
/// </summary>
public const string ClockFaceFiveOclock_2 = "\uf0bb";
/// <summary>
/// Clock Face Six Oclock.
/// </summary>
public const string ClockFaceSixOclock_2 = "\uf0bc";
/// <summary>
/// Clock Face Seven Oclock.
/// </summary>
public const string ClockFaceSevenOclock_2 = "\uf0bd";
/// <summary>
/// Clock Face Eight Oclock.
/// </summary>
public const string ClockFaceEightOclock_2 = "\uf0be";
/// <summary>
/// Clock Face Nine Oclock.
/// </summary>
public const string ClockFaceNineOclock_2 = "\uf0bf";
/// <summary>
/// Clock Face Ten Oclock.
/// </summary>
public const string ClockFaceTenOclock_2 = "\uf0c0";
/// <summary>
/// Clock Face Eleven Oclock.
/// </summary>
public const string ClockFaceElevenOclock_2 = "\uf0c1";
/// <summary>
/// Clock Face Twelve Oclock.
/// </summary>
public const string ClockFaceTwelveOclock_2 = "\uf0c2";
/// <summary>
/// Ribbon Arrow Down Left.
/// </summary>
public const string RibbonArrowDownLeft_2 = "\uf0c3";
/// <summary>
/// Ribbon Arrow Down Right.
/// </summary>
public const string RibbonArrowDownRight_2 = "\uf0c4";
/// <summary>
/// Ribbon Arrow Up Left.
/// </summary>
public const string RibbonArrowUpLeft_2 = "\uf0c5";
/// <summary>
/// Ribbon Arrow Up Right.
/// </summary>
public const string RibbonArrowUpRight_2 = "\uf0c6";
/// <summary>
/// Ribbon Arrow Left Up.
/// </summary>
public const string RibbonArrowLeftUp_2 = "\uf0c7";
/// <summary>
/// Ribbon Arrow Right Up.
/// </summary>
public const string RibbonArrowRightUp_2 = "\uf0c8";
/// <summary>
/// Ribbon Arrow Left Down.
/// </summary>
public const string RibbonArrowLeftDown_2 = "\uf0c9";
/// <summary>
/// Ribbon Arrow Right Down.
/// </summary>
public const string RibbonArrowRightDown_2 = "\uf0ca";
/// <summary>
/// Solid Quilt Square Ornament.
/// </summary>
public const string SolidQuiltSquareOrnament_2 = "\uf0cb";
/// <summary>
/// Solid Quilt Square Ornament In Black Square.
/// </summary>
public const string SolidQuiltSquareOrnamentInBlackSquare_2 = "\uf0cc";
/// <summary>
/// Turned South West Pointing Leaf.
/// </summary>
public const string TurnedSouthWestPointingLeaf_2 = "\uf0cd";
/// <summary>
/// Turned North West Pointing Leaf.
/// </summary>
public const string TurnedNorthWestPointingLeaf_2 = "\uf0ce";
/// <summary>
/// Turned South East Pointing Leaf.
/// </summary>
public const string TurnedSouthEastPointingLeaf_2 = "\uf0cf";
/// <summary>
/// Turned North East Pointing Leaf.
/// </summary>
public const string TurnedNorthEastPointingLeaf_2 = "\uf0d0";
/// <summary>
/// North West Pointing Leaf.
/// </summary>
public const string NorthWestPointingLeaf_2 = "\uf0d1";
/// <summary>
/// South West Pointing Leaf.
/// </summary>
public const string SouthWestPointingLeaf_2 = "\uf0d2";
/// <summary>
/// North East Pointing Leaf.
/// </summary>
public const string NorthEastPointingLeaf_2 = "\uf0d3";
/// <summary>
/// South East Pointing Leaf.
/// </summary>
public const string SouthEastPointingLeaf_2 = "\uf0d4";
/// <summary>
/// Erase To The Left.
/// </summary>
public const string EraseToTheLeft_2 = "\uf0d5";
/// <summary>
/// Erase To The Right.
/// </summary>
public const string EraseToTheRight_2 = "\uf0d6";
/// <summary>
/// Three-D Top-Lighted Leftwards Equilateral Arrowhead.
/// </summary>
public const string ThreeDTopLightedLeftwardsEquilateralArrowhead_2 = "\uf0d7";
/// <summary>
/// Three-D Top-Lighted Rightwards Equilateral Arrowhead.
/// </summary>
public const string ThreeDTopLightedRightwardsEquilateralArrowhead_2 = "\uf0d8";
/// <summary>
/// Three-D Right-Lighted Upwards Equilateral Arrowhead.
/// </summary>
public const string ThreeDRightLightedUpwardsEquilateralArrowhead_2 = "\uf0d9";
/// <summary>
/// Three-D Left-Lighted Downwards Equilateral Arrowhead.
/// </summary>
public const string ThreeDLeftLightedDownwardsEquilateralArrowhead_2 = "\uf0da";
/// <summary>
/// Leftwards Black Circled White Arrow.
/// </summary>
public const string LeftwardsBlackCircledWhiteArrow_2 = "\uf0db";
/// <summary>
/// Rightwards Black Circled White Arrow.
/// </summary>
public const string RightwardsBlackCircledWhiteArrow_2 = "\uf0dc";
/// <summary>
/// Upwards Black Circled White Arrow.
/// </summary>
public const string UpwardsBlackCircledWhiteArrow_2 = "\uf0dd";
/// <summary>
/// Downwards Black Circled White Arrow.
/// </summary>
public const string DownwardsBlackCircledWhiteArrow_2 = "\uf0de";
/// <summary>
/// Wide-Headed Leftwards Barb Arrow.
/// </summary>
public const string WideHeadedLeftwardsBarbArrow_2 = "\uf0df";
/// <summary>
/// Wide-Headed Rightwards Barb Arrow.
/// </summary>
public const string WideHeadedRightwardsBarbArrow_2 = "\uf0e0";
/// <summary>
/// Wide-Headed Upwards Barb Arrow.
/// </summary>
public const string WideHeadedUpwardsBarbArrow_2 = "\uf0e1";
/// <summary>
/// Wide-Headed Downwards Barb Arrow.
/// </summary>
public const string WideHeadedDownwardsBarbArrow_2 = "\uf0e2";
/// <summary>
/// Wide-Headed North West Barb Arrow.
/// </summary>
public const string WideHeadedNorthWestBarbArrow_2 = "\uf0e3";
/// <summary>
/// Wide-Headed North East Barb Arrow.
/// </summary>
public const string WideHeadedNorthEastBarbArrow_2 = "\uf0e4";
/// <summary>
/// Wide-Headed South West Barb Arrow.
/// </summary>
public const string WideHeadedSouthWestBarbArrow_2 = "\uf0e5";
/// <summary>
/// Wide-Headed South East Barb Arrow.
/// </summary>
public const string WideHeadedSouthEastBarbArrow_2 = "\uf0e6";
/// <summary>
/// Wide-Headed Leftwards Heavy Barb Arrow.
/// </summary>
public const string WideHeadedLeftwardsHeavyBarbArrow_2 = "\uf0e7";
/// <summary>
/// Wide-Headed Rightwards Heavy Barb Arrow.
/// </summary>
public const string WideHeadedRightwardsHeavyBarbArrow_2 = "\uf0e8";
/// <summary>
/// Wide-Headed Upwards Heavy Barb Arrow.
/// </summary>
public const string WideHeadedUpwardsHeavyBarbArrow_2 = "\uf0e9";
/// <summary>
/// Wide-Headed Downwards Heavy Barb Arrow.
/// </summary>
public const string WideHeadedDownwardsHeavyBarbArrow_2 = "\uf0ea";
/// <summary>
/// Wide-Headed North West Heavy Barb Arrow.
/// </summary>
public const string WideHeadedNorthWestHeavyBarbArrow_2 = "\uf0eb";
/// <summary>
/// Wide-Headed North East Heavy Barb Arrow.
/// </summary>
public const string WideHeadedNorthEastHeavyBarbArrow_2 = "\uf0ec";
/// <summary>
/// Wide-Headed South West Heavy Barb Arrow.
/// </summary>
public const string WideHeadedSouthWestHeavyBarbArrow_2 = "\uf0ed";
/// <summary>
/// Wide-Headed South East Heavy Barb Arrow.
/// </summary>
public const string WideHeadedSouthEastHeavyBarbArrow_2 = "\uf0ee";
/// <summary>
/// Leftwards White Arrow.
/// </summary>
public const string LeftwardsWhiteArrow_2 = "\uf0ef";
/// <summary>
/// Rightwards White Arrow.
/// </summary>
public const string RightwardsWhiteArrow_2 = "\uf0f0";
/// <summary>
/// Upwards White Arrow.
/// </summary>
public const string UpwardsWhiteArrow_2 = "\uf0f1";
/// <summary>
/// Downwards White Arrow.
/// </summary>
public const string DownwardsWhiteArrow_2 = "\uf0f2";
/// <summary>
/// Left Right White Arrow.
/// </summary>
public const string LeftRightWhiteArrow_2 = "\uf0f3";
/// <summary>
/// Up Down White Arrow.
/// </summary>
public const string UpDownWhiteArrow_2 = "\uf0f4";
/// <summary>
/// North East White Arrow.
/// </summary>
public const string NorthEastWhiteArrow_2 = "\uf0f5";
/// <summary>
/// North West White Arrow.
/// </summary>
public const string NorthWestWhiteArrow_2 = "\uf0f6";
/// <summary>
/// South West White Arrow.
/// </summary>
public const string SouthWestWhiteArrow_2 = "\uf0f7";
/// <summary>
/// South East White Arrow.
/// </summary>
public const string SouthEastWhiteArrow_2 = "\uf0f8";
/// <summary>
/// White Arrow Shaft Width One.
/// </summary>
public const string WhiteArrowShaftWidthOne_2 = "\uf0f9";
/// <summary>
/// White Arrow Shaft Width Two Thirds.
/// </summary>
public const string WhiteArrowShaftWidthTwoThirds_2 = "\uf0fa";
/// <summary>
/// Ballot Bold Script X.
/// </summary>
public const string BallotBoldScriptX_2 = "\uf0fb";
/// <summary>
/// Heavy Check Mark.
/// </summary>
public const string HeavyCheckMark_2 = "\uf0fc";
/// <summary>
/// Ballot Box With Bold Script X.
/// </summary>
public const string BallotBoxWithBoldScriptX_2 = "\uf0fd";
/// <summary>
/// Ballot Box With Bold Check.
/// </summary>
public const string BallotBoxWithBoldCheck_2 = "\uf0fe";
/// <summary>
/// Windows Flag.
/// </summary>
public const string WindowsFlag_2 = "\uf0ff";
}
}
| 21.696544 | 88 | 0.624403 | [
"MIT"
] | smourier/GlyphData | WingdingsGlyph.cs | 97,309 | C# |
namespace RediSearchSharp.Query
{
public enum SortingOrder
{
Ascending,
Descending
}
} | 14.375 | 32 | 0.608696 | [
"MIT"
] | ojji/RedisearchSharp | RediSearchSharp/Query/SortingOrder.cs | 117 | 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("15. Count of Capital Letters in Array")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("15. Count of Capital Letters in Array")]
[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("090f129b-2349-430e-811b-ee950b35aab2")]
// 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")]
| 39.108108 | 84 | 0.744299 | [
"MIT"
] | PavelIvanov96/Programming-Fundamentals-Extended-CSharp | 05.Arrays and Methods - Exercises/15. Count of Capital Letters in Array/Properties/AssemblyInfo.cs | 1,450 | 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;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Kerberos.NET.Configuration;
namespace Kerberos.NET.CommandLine
{
[CommandLineCommand("kconfig", Description = "KerberosConfig")]
public class KerberosConfigCommand : BaseCommand
{
public KerberosConfigCommand(CommandLineParameters parameters)
: base(parameters)
{
}
[CommandLineParameter("c|config", Description = "Config")]
public string Configuration { get; set; }
public override void DisplayHelp()
{
base.DisplayHelp();
var uses = new[]
{
("property=value", "CommandLine_Config_SetEquals"),
("property=", "CommandLine_Config_SetEqualsNull"),
("+property=value", "CommandLine_Config_SetEqualsPlus"),
("property value", "CommandLine_Config_SetEqualsSpace"),
("property", "CommandLine_Config_SetSpaceNull"),
("+property value", "CommandLine_Config_SetEqualsSpacePlus")
};
var max = uses.Max(u => u.Item1.Length) + 10;
foreach (var use in uses)
{
this.WriteUsage(use.Item1, use.Item2, max);
}
this.IO.Writer.WriteLine();
this.IO.Writer.WriteLine(SR.Resource("CommandLine_Config_DotHelp"));
this.IO.Writer.WriteLine(SR.Resource("CommandLine_Config_DotHelpEscaped"));
this.IO.Writer.WriteLine();
this.IO.Writer.WriteLine(SR.Resource("CommandLine_Example"));
this.IO.Writer.WriteLine();
this.IO.Writer.WriteLine("libdefaults.default_tgs_enctypes=aes");
this.IO.Writer.WriteLine("realms.\"EXAMPLE.COM\".kdc=server.example.com");
this.IO.Writer.WriteLine("+realms.\"EXAMPLE.COM\".kdc=server.example.com");
this.IO.Writer.WriteLine();
}
private void WriteUsage(string use, string desc, int padding)
{
var command = string.Format("{0} {1}", this.Parameters.Command, use);
this.IO.Writer.Write(command.PadLeft(10).PadRight(padding + 10));
this.IO.Writer.WriteLine(SR.Resource(desc));
}
public override async Task<bool> Execute()
{
if (await base.Execute())
{
return true;
}
if (this.Parameters.Parameters.Length > 0)
{
this.WriteConfiguration();
}
var client = this.CreateClient();
this.ListConfiguration(client.Configuration);
return true;
}
private void WriteConfiguration()
{
string configValue = null;
bool configSet = false;
if (!string.IsNullOrWhiteSpace(this.Configuration))
{
configValue = File.ReadAllText(this.Configuration);
configSet = true;
}
var client = this.CreateClient(configValue);
var config = ConfigurationSectionList.FromConfigObject(client.Configuration);
for (var i = 0; i < this.Parameters.Parameters.Length; i++)
{
var param = this.Parameters.Parameters[i];
if (configSet && IsConfigParam(param))
{
i++;
continue;
}
bool? append = null;
if (param.StartsWith("-"))
{
append = false;
}
else if (param.StartsWith("+"))
{
append = true;
}
if (append.HasValue)
{
param = param.Substring(1);
}
var split = param.Split('=');
if (param.Contains("="))
{
config.Set(split[0], split.Length > 1 ? split[1] : null, append ?? false);
}
else if (i < this.Parameters.Parameters.Length - 1)
{
var val = this.Parameters.Parameters[++i];
config.Set(param, val, append ?? false);
}
else
{
config.Set(param, null, append ?? false);
}
}
// sanity check
var verified = config.ToConfigObject();
if (verified == null)
{
throw new ArgumentException(SR.Resource("CommandLine_Config_Invalid"));
}
string path;
if (configSet)
{
path = this.Configuration;
}
else
{
path = Krb5Config.DefaultUserConfiguration;
}
File.WriteAllText(path, Krb5ConfigurationSerializer.Serialize(config));
}
private static bool IsConfigParam(string param)
{
if (IsParameter(param, out string designator))
{
param = param.Substring(designator.Length);
}
return "c".Equals(param, StringComparison.OrdinalIgnoreCase) ||
"config".Equals(param, StringComparison.OrdinalIgnoreCase);
}
private void ListConfiguration(Krb5Config config)
{
var configStr = config.Serialize();
this.IO.Writer.WriteLine();
this.IO.Writer.WriteLine(configStr);
}
}
}
| 31.063492 | 94 | 0.504514 | [
"MIT"
] | Hawkeye4040/Kerberos.NET | Bruce/CommandLine/KerberosConfigCommand.cs | 5,873 | C# |
using System;
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Xml.Serialization;
namespace Workday.PerformanceManagement
{
[GeneratedCode("System.Xml", "4.6.1590.0"), DesignerCategory("code"), DebuggerStepThrough, XmlType(Namespace = "urn:com.workday/bsvc")]
[Serializable]
public class Certification_Response_GroupType : INotifyPropertyChanged
{
private bool include_ReferenceField;
private bool include_ReferenceFieldSpecified;
private bool include_Certification_Issuer_Reference_OnlyField;
private bool include_Certification_Issuer_Reference_OnlyFieldSpecified;
[method: CompilerGenerated]
[CompilerGenerated]
public event PropertyChangedEventHandler PropertyChanged;
[XmlElement(Order = 0)]
public bool Include_Reference
{
get
{
return this.include_ReferenceField;
}
set
{
this.include_ReferenceField = value;
this.RaisePropertyChanged("Include_Reference");
}
}
[XmlIgnore]
public bool Include_ReferenceSpecified
{
get
{
return this.include_ReferenceFieldSpecified;
}
set
{
this.include_ReferenceFieldSpecified = value;
this.RaisePropertyChanged("Include_ReferenceSpecified");
}
}
[XmlElement(Order = 1)]
public bool Include_Certification_Issuer_Reference_Only
{
get
{
return this.include_Certification_Issuer_Reference_OnlyField;
}
set
{
this.include_Certification_Issuer_Reference_OnlyField = value;
this.RaisePropertyChanged("Include_Certification_Issuer_Reference_Only");
}
}
[XmlIgnore]
public bool Include_Certification_Issuer_Reference_OnlySpecified
{
get
{
return this.include_Certification_Issuer_Reference_OnlyFieldSpecified;
}
set
{
this.include_Certification_Issuer_Reference_OnlyFieldSpecified = value;
this.RaisePropertyChanged("Include_Certification_Issuer_Reference_OnlySpecified");
}
}
protected void RaisePropertyChanged(string propertyName)
{
PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
if (propertyChanged != null)
{
propertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
}
}
| 24.271739 | 136 | 0.772056 | [
"MIT"
] | matteofabbri/Workday.WebServices | Workday.PerformanceManagement/Certification_Response_GroupType.cs | 2,233 | C# |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Cmdlets
{
using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.Extensions;
/// <summary>API to enumerate registered connected K8s clusters under a Resource Group</summary>
/// <remarks>
/// [OpenAPI] ConnectedCluster_ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters"
/// </remarks>
[global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConnectedKubernetes_List")]
[global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20210301.IConnectedCluster))]
[global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Description(@"API to enumerate registered connected K8s clusters under a Resource Group")]
[global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Generated]
public partial class GetAzConnectedKubernetes_List : global::System.Management.Automation.PSCmdlet,
Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.IEventListener
{
/// <summary>A unique id generatd for the this cmdlet when it is instantiated.</summary>
private string __correlationId = System.Guid.NewGuid().ToString();
/// <summary>A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet)</summary>
private global::System.Management.Automation.InvocationInfo __invocationInfo;
/// <summary>A unique id generatd for the this cmdlet when ProcessRecord() is called.</summary>
private string __processRecordId;
/// <summary>
/// The <see cref="global::System.Threading.CancellationTokenSource" /> for this operation.
/// </summary>
private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource();
/// <summary>Wait for .NET debugger to attach</summary>
[global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")]
[global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.ParameterCategory.Runtime)]
public global::System.Management.Automation.SwitchParameter Break { get; set; }
/// <summary>The reference to the client API class.</summary>
public Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.ConnectedKubernetes Client => Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Module.Instance.ClientAPI;
/// <summary>
/// The credentials, account, tenant, and subscription used for communication with Azure
/// </summary>
[global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")]
[global::System.Management.Automation.ValidateNotNull]
[global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")]
[global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.ParameterCategory.Azure)]
public global::System.Management.Automation.PSObject DefaultProfile { get; set; }
/// <summary>SendAsync Pipeline Steps to be appended to the front of the pipeline</summary>
[global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")]
[global::System.Management.Automation.ValidateNotNull]
[global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.ParameterCategory.Runtime)]
public Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; }
/// <summary>SendAsync Pipeline Steps to be prepended to the front of the pipeline</summary>
[global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")]
[global::System.Management.Automation.ValidateNotNull]
[global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.ParameterCategory.Runtime)]
public Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; }
/// <summary>Accessor for our copy of the InvocationInfo.</summary>
public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } }
/// <summary>
/// <see cref="IEventListener" /> cancellation delegate. Stops the cmdlet when called.
/// </summary>
global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel;
/// <summary><see cref="IEventListener" /> cancellation token.</summary>
global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.IEventListener.Token => _cancellationTokenSource.Token;
/// <summary>
/// The instance of the <see cref="Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.HttpPipeline" /> that the remote call will use.
/// </summary>
private Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.HttpPipeline Pipeline { get; set; }
/// <summary>The URI for the proxy server to use</summary>
[global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")]
[global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.ParameterCategory.Runtime)]
public global::System.Uri Proxy { get; set; }
/// <summary>Credentials for a proxy server to use for the remote call</summary>
[global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")]
[global::System.Management.Automation.ValidateNotNull]
[global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.ParameterCategory.Runtime)]
public global::System.Management.Automation.PSCredential ProxyCredential { get; set; }
/// <summary>Use the default credentials for the proxy</summary>
[global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")]
[global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.ParameterCategory.Runtime)]
public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; }
/// <summary>Backing field for <see cref="ResourceGroupName" /> property.</summary>
private string _resourceGroupName;
/// <summary>The name of the resource group. The name is case insensitive.</summary>
[global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")]
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.Info(
Required = true,
ReadOnly = false,
Description = @"The name of the resource group. The name is case insensitive.",
SerializedName = @"resourceGroupName",
PossibleTypes = new [] { typeof(string) })]
[global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.ParameterCategory.Path)]
public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; }
/// <summary>Backing field for <see cref="SubscriptionId" /> property.</summary>
private string[] _subscriptionId;
/// <summary>The ID of the target subscription.</summary>
[global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")]
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.Info(
Required = true,
ReadOnly = false,
Description = @"The ID of the target subscription.",
SerializedName = @"subscriptionId",
PossibleTypes = new [] { typeof(string) })]
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.DefaultInfo(
Name = @"",
Description =@"",
Script = @"(Get-AzContext).Subscription.Id")]
[global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.ParameterCategory.Path)]
public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; }
/// <summary>
/// <c>overrideOnDefault</c> will be called before the regular onDefault has been processed, allowing customization of what
/// happens on that response. Implement this method in a partial class to enable this behavior
/// </summary>
/// <param name="responseMessage">the raw response message as an global::System.Net.Http.HttpResponseMessage.</param>
/// <param name="response">the body result as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20.IErrorResponse"
/// /> from the remote call</param>
/// <param name="returnNow">/// Determines if the rest of the onDefault method should be processed, or if the method should
/// return immediately (set to true to skip further processing )</param>
partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task<Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20.IErrorResponse> response, ref global::System.Threading.Tasks.Task<bool> returnNow);
/// <summary>
/// <c>overrideOnOk</c> will be called before the regular onOk has been processed, allowing customization of what happens
/// on that response. Implement this method in a partial class to enable this behavior
/// </summary>
/// <param name="responseMessage">the raw response message as an global::System.Net.Http.HttpResponseMessage.</param>
/// <param name="response">the body result as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20210301.IConnectedClusterList"
/// /> from the remote call</param>
/// <param name="returnNow">/// Determines if the rest of the onOk method should be processed, or if the method should return
/// immediately (set to true to skip further processing )</param>
partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task<Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20210301.IConnectedClusterList> response, ref global::System.Threading.Tasks.Task<bool> returnNow);
/// <summary>
/// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet)
/// </summary>
protected override void BeginProcessing()
{
Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials);
if (Break)
{
Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.AttachDebugger.Break();
}
((Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
}
/// <summary>Performs clean-up after the command execution</summary>
protected override void EndProcessing()
{
((Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.Events.CmdletEndProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
}
/// <summary>
/// Intializes a new instance of the <see cref="GetAzConnectedKubernetes_List" /> cmdlet class.
/// </summary>
public GetAzConnectedKubernetes_List()
{
}
/// <summary>Handles/Dispatches events during the call to the REST service.</summary>
/// <param name="id">The message id</param>
/// <param name="token">The message cancellation token. When this call is cancelled, this should be <c>true</c></param>
/// <param name="messageData">Detailed message data for the message event.</param>
/// <returns>
/// A <see cref="global::System.Threading.Tasks.Task" /> that will be complete when handling of the message is completed.
/// </returns>
async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func<Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.EventData> messageData)
{
using( NoSynchronizationContext )
{
if (token.IsCancellationRequested)
{
return ;
}
switch ( id )
{
case Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.Events.Verbose:
{
WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}");
return ;
}
case Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.Events.Warning:
{
WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}");
return ;
}
case Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.Events.Information:
{
var data = messageData();
WriteInformation(data, new[] { data.Message });
return ;
}
case Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.Events.Debug:
{
WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}");
return ;
}
case Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.Events.Error:
{
WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) );
return ;
}
}
await Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null );
if (token.IsCancellationRequested)
{
return ;
}
WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}");
}
}
/// <summary>Performs execution of the command.</summary>
protected override void ProcessRecord()
{
((Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
__processRecordId = System.Guid.NewGuid().ToString();
try
{
// work
using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.IEventListener)this).Token) )
{
asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.IEventListener)this).Token);
}
}
catch (global::System.AggregateException aggregateException)
{
// unroll the inner exceptions to get the root cause
foreach( var innerException in aggregateException.Flatten().InnerExceptions )
{
((Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
// Write exception out to error channel.
WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) );
}
}
catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null)
{
((Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
// Write exception out to error channel.
WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) );
}
finally
{
((Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.Events.CmdletProcessRecordEnd).Wait();
}
}
/// <summary>Performs execution of the command, working asynchronously if required.</summary>
/// <returns>
/// A <see cref="global::System.Threading.Tasks.Task" /> that will be complete when handling of the method is completed.
/// </returns>
protected async global::System.Threading.Tasks.Task ProcessRecordAsync()
{
using( NoSynchronizationContext )
{
await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.Events.CmdletProcessRecordAsyncStart); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName);
if (null != HttpPipelinePrepend)
{
Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend);
}
if (null != HttpPipelineAppend)
{
Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend);
}
// get the client instance
try
{
foreach( var SubscriptionId in this.SubscriptionId )
{
await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
await this.Client.ConnectedClusterListByResourceGroup(SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline);
await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
}
}
catch (Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.UndeclaredResponseException urexception)
{
WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName})
{
ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action }
});
}
finally
{
await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.Events.CmdletProcessRecordAsyncEnd);
}
}
}
/// <summary>Interrupts currently running code within the command.</summary>
protected override void StopProcessing()
{
((Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.IEventListener)this).Cancel();
base.StopProcessing();
}
/// <summary>
/// a delegate that is called when the remote service returns default (any response code not handled elsewhere).
/// </summary>
/// <param name="responseMessage">the raw response message as an global::System.Net.Http.HttpResponseMessage.</param>
/// <param name="response">the body result as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20.IErrorResponse"
/// /> from the remote call</param>
/// <returns>
/// A <see cref="global::System.Threading.Tasks.Task" /> that will be complete when handling of the method is completed.
/// </returns>
private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task<Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20.IErrorResponse> response)
{
using( NoSynchronizationContext )
{
var _returnNow = global::System.Threading.Tasks.Task<bool>.FromResult(false);
overrideOnDefault(responseMessage, response, ref _returnNow);
// if overrideOnDefault has returned true, then return right away.
if ((null != _returnNow && await _returnNow))
{
return ;
}
// Error Response : default
var code = (await response)?.Code;
var message = (await response)?.Message;
if ((null == code || null == message))
{
// Unrecognized Response. Create an error record based on what we have.
var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.RestException<Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20.IErrorResponse>(responseMessage, await response);
WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName })
{
ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action }
});
}
else
{
WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName })
{
ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty }
});
}
}
}
/// <summary>a delegate that is called when the remote service returns 200 (OK).</summary>
/// <param name="responseMessage">the raw response message as an global::System.Net.Http.HttpResponseMessage.</param>
/// <param name="response">the body result as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20210301.IConnectedClusterList"
/// /> from the remote call</param>
/// <returns>
/// A <see cref="global::System.Threading.Tasks.Task" /> that will be complete when handling of the method is completed.
/// </returns>
private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task<Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20210301.IConnectedClusterList> response)
{
using( NoSynchronizationContext )
{
var _returnNow = global::System.Threading.Tasks.Task<bool>.FromResult(false);
overrideOnOk(responseMessage, response, ref _returnNow);
// if overrideOnOk has returned true, then return right away.
if ((null != _returnNow && await _returnNow))
{
return ;
}
// onOk - response for 200 / application/json
// response should be returning an array of some kind. +Pageable
// pageable / value / nextLink
var result = await response;
WriteObject(result.Value,true);
if (result.NextLink != null)
{
if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage )
{
requestMessage = requestMessage.Clone(new global::System.Uri( result.NextLink ),Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.Method.Get );
await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
await this.Client.ConnectedClusterListByResourceGroup_Call(requestMessage, onOk, onDefault, this, Pipeline);
}
}
}
}
}
} | 76.491139 | 507 | 0.68091 | [
"MIT"
] | Amrinder-Singh29/azure-powershell | src/ConnectedKubernetes/generated/cmdlets/GetAzConnectedKubernetes_List.cs | 29,820 | C# |
using System;
using System.Text.RegularExpressions;
namespace _2._94_RegularExpression
{
class Program
{
static void Main(string[] args)
{
string pattern = "(Mr\\.? |Mrs\\.? |Miss |Ms\\.? )";
string[] names = { "Mr. Henry Hunt", "Ms. Sara Samuels", "Abraham Adams", "Ms. Nicole Norris" };
foreach (var name in names)
Console.WriteLine(Regex.Replace(name, pattern, string.Empty));
Console.ReadLine();
}
}
}
| 25.5 | 108 | 0.554902 | [
"MIT"
] | GoFightNguyen/programming-in-csharp | 2.CreateAndUseTypes/2.94_RegularExpression/Program.cs | 512 | 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 synthetics-2017-10-11.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.Synthetics.Model
{
/// <summary>
/// This structure contains all information about one canary in your account.
/// </summary>
public partial class Canary
{
private string _artifactS3Location;
private CanaryCodeOutput _code;
private string _engineArn;
private string _executionRoleArn;
private int? _failureRetentionPeriodInDays;
private string _id;
private string _name;
private CanaryRunConfigOutput _runConfig;
private string _runtimeVersion;
private CanaryScheduleOutput _schedule;
private CanaryStatus _status;
private int? _successRetentionPeriodInDays;
private Dictionary<string, string> _tags = new Dictionary<string, string>();
private CanaryTimeline _timeline;
private VpcConfigOutput _vpcConfig;
/// <summary>
/// Gets and sets the property ArtifactS3Location.
/// <para>
/// The location in Amazon S3 where Synthetics stores artifacts from the runs of this
/// canary. Artifacts include the log file, screenshots, and HAR files.
/// </para>
/// </summary>
[AWSProperty(Min=1, Max=1024)]
public string ArtifactS3Location
{
get { return this._artifactS3Location; }
set { this._artifactS3Location = value; }
}
// Check to see if ArtifactS3Location property is set
internal bool IsSetArtifactS3Location()
{
return this._artifactS3Location != null;
}
/// <summary>
/// Gets and sets the property Code.
/// </summary>
public CanaryCodeOutput Code
{
get { return this._code; }
set { this._code = value; }
}
// Check to see if Code property is set
internal bool IsSetCode()
{
return this._code != null;
}
/// <summary>
/// Gets and sets the property EngineArn.
/// <para>
/// The ARN of the Lambda function that is used as your canary's engine. For more information
/// about Lambda ARN format, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/lambda-api-permissions-ref.html">Resources
/// and Conditions for Lambda Actions</a>.
/// </para>
/// </summary>
public string EngineArn
{
get { return this._engineArn; }
set { this._engineArn = value; }
}
// Check to see if EngineArn property is set
internal bool IsSetEngineArn()
{
return this._engineArn != null;
}
/// <summary>
/// Gets and sets the property ExecutionRoleArn.
/// <para>
/// The ARN of the IAM role used to run the canary. This role must include <code>lambda.amazonaws.com</code>
/// as a principal in the trust policy.
/// </para>
/// </summary>
public string ExecutionRoleArn
{
get { return this._executionRoleArn; }
set { this._executionRoleArn = value; }
}
// Check to see if ExecutionRoleArn property is set
internal bool IsSetExecutionRoleArn()
{
return this._executionRoleArn != null;
}
/// <summary>
/// Gets and sets the property FailureRetentionPeriodInDays.
/// <para>
/// The number of days to retain data about failed runs of this canary.
/// </para>
/// </summary>
[AWSProperty(Min=1, Max=1024)]
public int FailureRetentionPeriodInDays
{
get { return this._failureRetentionPeriodInDays.GetValueOrDefault(); }
set { this._failureRetentionPeriodInDays = value; }
}
// Check to see if FailureRetentionPeriodInDays property is set
internal bool IsSetFailureRetentionPeriodInDays()
{
return this._failureRetentionPeriodInDays.HasValue;
}
/// <summary>
/// Gets and sets the property Id.
/// <para>
/// The unique ID of this canary.
/// </para>
/// </summary>
public string Id
{
get { return this._id; }
set { this._id = value; }
}
// Check to see if Id property is set
internal bool IsSetId()
{
return this._id != null;
}
/// <summary>
/// Gets and sets the property Name.
/// <para>
/// The name of the canary.
/// </para>
/// </summary>
[AWSProperty(Min=1, Max=21)]
public string Name
{
get { return this._name; }
set { this._name = value; }
}
// Check to see if Name property is set
internal bool IsSetName()
{
return this._name != null;
}
/// <summary>
/// Gets and sets the property RunConfig.
/// </summary>
public CanaryRunConfigOutput RunConfig
{
get { return this._runConfig; }
set { this._runConfig = value; }
}
// Check to see if RunConfig property is set
internal bool IsSetRunConfig()
{
return this._runConfig != null;
}
/// <summary>
/// Gets and sets the property RuntimeVersion.
/// <para>
/// Specifies the runtime version to use for the canary. Currently, the only valid value
/// is <code>syn-1.0</code>. For more information about runtime versions, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Library.html">
/// Canary Runtime Versions</a>.
/// </para>
/// </summary>
[AWSProperty(Min=1, Max=1024)]
public string RuntimeVersion
{
get { return this._runtimeVersion; }
set { this._runtimeVersion = value; }
}
// Check to see if RuntimeVersion property is set
internal bool IsSetRuntimeVersion()
{
return this._runtimeVersion != null;
}
/// <summary>
/// Gets and sets the property Schedule.
/// <para>
/// A structure that contains information about how often the canary is to run, and when
/// these runs are to stop.
/// </para>
/// </summary>
public CanaryScheduleOutput Schedule
{
get { return this._schedule; }
set { this._schedule = value; }
}
// Check to see if Schedule property is set
internal bool IsSetSchedule()
{
return this._schedule != null;
}
/// <summary>
/// Gets and sets the property Status.
/// <para>
/// A structure that contains information about the canary's status.
/// </para>
/// </summary>
public CanaryStatus Status
{
get { return this._status; }
set { this._status = value; }
}
// Check to see if Status property is set
internal bool IsSetStatus()
{
return this._status != null;
}
/// <summary>
/// Gets and sets the property SuccessRetentionPeriodInDays.
/// <para>
/// The number of days to retain data about successful runs of this canary.
/// </para>
/// </summary>
[AWSProperty(Min=1, Max=1024)]
public int SuccessRetentionPeriodInDays
{
get { return this._successRetentionPeriodInDays.GetValueOrDefault(); }
set { this._successRetentionPeriodInDays = value; }
}
// Check to see if SuccessRetentionPeriodInDays property is set
internal bool IsSetSuccessRetentionPeriodInDays()
{
return this._successRetentionPeriodInDays.HasValue;
}
/// <summary>
/// Gets and sets the property Tags.
/// <para>
/// The list of key-value pairs that are associated with the canary.
/// </para>
/// </summary>
[AWSProperty(Min=1, Max=50)]
public Dictionary<string, string> Tags
{
get { return this._tags; }
set { this._tags = value; }
}
// Check to see if Tags property is set
internal bool IsSetTags()
{
return this._tags != null && this._tags.Count > 0;
}
/// <summary>
/// Gets and sets the property Timeline.
/// <para>
/// A structure that contains information about when the canary was created, modified,
/// and most recently run.
/// </para>
/// </summary>
public CanaryTimeline Timeline
{
get { return this._timeline; }
set { this._timeline = value; }
}
// Check to see if Timeline property is set
internal bool IsSetTimeline()
{
return this._timeline != null;
}
/// <summary>
/// Gets and sets the property VpcConfig.
/// </summary>
public VpcConfigOutput VpcConfig
{
get { return this._vpcConfig; }
set { this._vpcConfig = value; }
}
// Check to see if VpcConfig property is set
internal bool IsSetVpcConfig()
{
return this._vpcConfig != null;
}
}
} | 31.661585 | 203 | 0.566683 | [
"Apache-2.0"
] | DetlefGolze/aws-sdk-net | sdk/src/Services/Synthetics/Generated/Model/Canary.cs | 10,385 | C# |
// SPDX-FileCopyrightText: 2021 smdn <smdn@smdn.jp>
// SPDX-License-Identifier: MIT
using System;
using System.Buffers;
using System.Diagnostics.CodeAnalysis;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
namespace Smdn.Devices.MCP2221;
#pragma warning disable IDE0040
partial class MCP2221 {
#pragma warning restore IDE0040
public I2CFunctionality I2C { get; }
public sealed partial class I2CFunctionality {
public const int MaxBlockLength = 0xFFFF;
private const int MaxTransferLengthPerCommand = 64 - 4;
private readonly MCP2221 device;
public I2CBusSpeed BusSpeed { get; set; } = I2CBusSpeed.Default;
internal I2CFunctionality(MCP2221 device)
{
this.device = device;
}
private static readonly EventId eventIdI2CCommand = new(10, "I2C command");
private static readonly EventId eventIdI2CEngineState = new(11, "I2C engine state");
private static class CancelTransferCommand {
[SuppressMessage("StyleCop.CSharp.NamingRules", "SA1316:TupleElementNamesShouldUseCorrectCasing", Justification = "Not a publicly-exposed type or member.")]
#pragma warning disable IDE0060 // [IDE0060] Remove unused parameter
public static void ConstructCommand(Span<byte> comm, ReadOnlySpan<byte> userData, (I2CAddress address, Exception exceptionCauseOfCancellation) args)
#pragma warning restore IDE0060
{
// [MCP2221A] 3.1.1 STATUS/SET PARAMATERS
comm[0] = 0x10; // Status/Set Parameters
comm[1] = 0x00; // Don't care
comm[2] = 0x10; // Cancel current I2C/SMBus transfer
}
[SuppressMessage("StyleCop.CSharp.NamingRules", "SA1316:TupleElementNamesShouldUseCorrectCasing", Justification = "Not a publicly-exposed type or member.")]
public static I2CEngineState ParseResponse(ReadOnlySpan<byte> resp, (I2CAddress address, Exception exceptionCauseOfCancellation) args)
{
if (resp[1] != 0x00) // Command completed successfully
throw new CommandException($"unexpected response (0x{resp[1]:X2})", args.exceptionCauseOfCancellation);
var state = I2CEngineState.Parse(resp);
var isBusStatusDefined =
#if NET5_0_OR_GREATER
Enum.IsDefined<I2CEngineState.TransferStatus>(state.BusStatus);
#else
Enum.IsDefined(typeof(I2CEngineState.TransferStatus), state.BusStatus);
#endif
if (!isBusStatusDefined) {
throw new I2CCommandException(
args.address,
$"unexpected response while transfer cancellation (0x{resp[2]:X2})",
args.exceptionCauseOfCancellation
);
}
return state;
}
}
private static async ValueTask CancelAsync(MCP2221 device, I2CAddress address, Exception exceptionCauseOfCancellation)
{
var engineState = await device.CommandAsync(
userData: default,
arg: (address, exceptionCauseOfCancellation),
cancellationToken: default,
constructCommand: CancelTransferCommand.ConstructCommand,
parseResponse: CancelTransferCommand.ParseResponse
).ConfigureAwait(false);
device.logger?.LogWarning(eventIdI2CEngineState, $"CANCEL TRANSFER: {engineState}");
}
private static void Cancel(MCP2221 device, I2CAddress address, Exception exceptionCauseOfCancellation)
{
var engineState = device.Command(
userData: default,
arg: (address, exceptionCauseOfCancellation),
cancellationToken: default,
constructCommand: CancelTransferCommand.ConstructCommand,
parseResponse: CancelTransferCommand.ParseResponse
);
device.logger?.LogWarning(eventIdI2CEngineState, $"CANCEL TRANSFER: {engineState}");
}
public ValueTask WriteAsync(
I2CAddress address,
byte[] buffer,
int offset,
int count,
CancellationToken cancellationToken = default
)
=> WriteAsync(
address,
(buffer ?? throw new ArgumentNullException(nameof(buffer))).AsMemory(offset, count),
cancellationToken
);
/// <remarks>An empty buffer can be specified to <paramref name="buffer"/>. This method issues writing command with 0-length in this case.</remarks>
public async ValueTask WriteAsync(
I2CAddress address,
ReadOnlyMemory<byte> buffer,
CancellationToken cancellationToken = default
)
{
if (MaxBlockLength < buffer.Length)
throw new ArgumentException($"transfer length must be up to {MaxBlockLength} bytes", nameof(buffer));
try {
device.logger?.LogInformation(eventIdI2CCommand, $"I2C Write {buffer.Length} bytes to 0x{address}");
for (; ; ) {
var lengthToTransfer = Math.Min(buffer.Length, MaxTransferLengthPerCommand);
foreach (var (constructCommand, parseResponse) in new OperationContext(device.logger, BusSpeed).IterateWriteCommands()) {
await device.CommandAsync(
userData: buffer.Slice(0, lengthToTransfer),
arg: (address, Memory<byte>.Empty),
cancellationToken: cancellationToken,
constructCommand: constructCommand,
parseResponse: parseResponse
).ConfigureAwait(false);
}
buffer = buffer.Slice(lengthToTransfer);
if (buffer.IsEmpty)
break;
}
}
catch (Exception ex) {
device.logger?.LogError(eventIdI2CCommand, $"I2C Write to 0x{address} failed: {ex.Message}");
if (ex is not I2CNAckException)
await CancelAsync(device, address, ex).ConfigureAwait(false);
throw;
}
}
public void Write(
I2CAddress address,
byte[] buffer,
int offset,
int count,
CancellationToken cancellationToken = default
)
=> Write(
address,
(buffer ?? throw new ArgumentNullException(nameof(buffer))).AsSpan(offset, count),
cancellationToken
);
/// <remarks>An empty buffer can be specified to <paramref name="buffer"/>. This method issues writing command with 0-length in this case.</remarks>
public void Write(
I2CAddress address,
ReadOnlySpan<byte> buffer,
CancellationToken cancellationToken = default
)
{
if (MaxBlockLength < buffer.Length)
throw new ArgumentException($"transfer length must be up to {MaxBlockLength} bytes", nameof(buffer));
try {
device.logger?.LogInformation(eventIdI2CCommand, $"I2C Write {buffer.Length} bytes to 0x{address}");
for (; ; ) {
var lengthToTransfer = Math.Min(buffer.Length, MaxTransferLengthPerCommand);
foreach (var (constructCommand, parseResponse) in new OperationContext(device.logger, BusSpeed).IterateWriteCommands()) {
device.Command(
userData: buffer.Slice(0, lengthToTransfer),
arg: (address, Memory<byte>.Empty),
cancellationToken: cancellationToken,
constructCommand: constructCommand,
parseResponse: parseResponse
);
}
buffer = buffer.Slice(lengthToTransfer);
if (buffer.IsEmpty)
break;
}
}
catch (Exception ex) {
device.logger?.LogError(eventIdI2CCommand, $"I2C Write to 0x{address} failed: {ex.Message}");
if (ex is not I2CNAckException)
Cancel(device, address, ex);
throw;
}
}
public ValueTask<int> ReadAsync(
I2CAddress address,
byte[] buffer,
int offset,
int count,
CancellationToken cancellationToken = default
)
=> ReadAsync(
address,
(buffer ?? throw new ArgumentNullException(nameof(buffer))).AsMemory(offset, count),
cancellationToken
);
/// <remarks>An empty buffer can be specified to <paramref name="buffer"/>. This method issues reading command with 0-length in this case.</remarks>
public async ValueTask<int> ReadAsync(
I2CAddress address,
Memory<byte> buffer,
CancellationToken cancellationToken = default
)
{
if (MaxBlockLength < buffer.Length)
throw new ArgumentException($"transfer length must be up to {MaxBlockLength} bytes", nameof(buffer));
try {
device.logger?.LogInformation(eventIdI2CCommand, $"I2C Read {buffer.Length} bytes from 0x{address}");
var readBuffer = ArrayPool<byte>.Shared.Rent(MaxTransferLengthPerCommand);
try {
var totalReadLength = 0;
for (; ; ) {
var lengthToTransfer = Math.Min(buffer.Length, MaxTransferLengthPerCommand);
var readBufferMemory = readBuffer.AsMemory(0, lengthToTransfer);
var context = new OperationContext(device.logger, BusSpeed);
foreach (var (constructCommand, parseResponse) in context.IterateReadCommands()) {
await device.CommandAsync(
userData: buffer.Slice(0, lengthToTransfer),
arg: (address, readBufferMemory),
cancellationToken: cancellationToken,
constructCommand: constructCommand,
parseResponse: parseResponse
).ConfigureAwait(false);
}
if (context.ReadLength < 0)
break;
readBufferMemory.Slice(0, context.ReadLength).CopyTo(buffer);
buffer = buffer.Slice(context.ReadLength);
if (context.ReadLength < lengthToTransfer)
break;
if (buffer.IsEmpty)
break;
}
return totalReadLength;
}
finally {
ArrayPool<byte>.Shared.Return(readBuffer);
}
}
catch (Exception ex) {
device.logger?.LogError(eventIdI2CCommand, $"I2C Read from 0x{address} failed: {ex.Message}");
if (ex is not I2CReadException)
await CancelAsync(device, address, ex).ConfigureAwait(false);
throw;
}
}
public int Read(
I2CAddress address,
byte[] buffer,
int offset,
int count,
CancellationToken cancellationToken = default
)
=> Read(
address,
(buffer ?? throw new ArgumentNullException(nameof(buffer))).AsSpan(offset, count),
cancellationToken
);
/// <remarks>An empty buffer can be specified to <paramref name="buffer"/>. This method issues reading command with 0-length in this case.</remarks>
public int Read(
I2CAddress address,
Span<byte> buffer,
CancellationToken cancellationToken = default
)
{
if (MaxBlockLength < buffer.Length)
throw new ArgumentException($"transfer length must be up to {MaxBlockLength} bytes", nameof(buffer));
try {
device.logger?.LogInformation(eventIdI2CCommand, $"I2C Read {buffer.Length} bytes from 0x{address}");
var readBuffer = ArrayPool<byte>.Shared.Rent(MaxTransferLengthPerCommand);
try {
var totalReadLength = 0;
for (; ; ) {
var lengthToTransfer = Math.Min(buffer.Length, MaxTransferLengthPerCommand);
var readBufferMemory = readBuffer.AsMemory(0, lengthToTransfer);
var context = new OperationContext(device.logger, BusSpeed);
foreach (var (constructCommand, parseResponse) in context.IterateReadCommands()) {
device.Command(
userData: buffer.Slice(0, lengthToTransfer),
arg: (address, readBufferMemory),
cancellationToken: cancellationToken,
constructCommand: constructCommand,
parseResponse: parseResponse
);
}
if (context.ReadLength < 0)
break;
readBufferMemory.Span.Slice(0, context.ReadLength).CopyTo(buffer);
buffer = buffer.Slice(context.ReadLength);
if (context.ReadLength < lengthToTransfer)
break;
if (buffer.IsEmpty)
break;
}
return totalReadLength;
}
finally {
ArrayPool<byte>.Shared.Return(readBuffer);
}
}
catch (Exception ex) {
device.logger?.LogError(eventIdI2CCommand, $"I2C Read from 0x{address} failed: {ex.Message}");
if (ex is not I2CReadException)
Cancel(device, address, ex);
throw;
}
}
public async ValueTask WriteByteAsync(
I2CAddress address,
byte value,
CancellationToken cancellationToken = default
)
{
var buffer = ArrayPool<byte>.Shared.Rent(1);
try {
buffer[0] = value;
await WriteAsync(address, buffer.AsMemory(0, 1), cancellationToken).ConfigureAwait(false);
}
finally {
ArrayPool<byte>.Shared.Return(buffer);
}
}
public unsafe void WriteByte(
I2CAddress address,
byte value,
CancellationToken cancellationToken = default
)
=> Write(address, stackalloc byte[1] { value }, cancellationToken);
public async ValueTask<int> ReadByteAsync(
I2CAddress address,
CancellationToken cancellationToken = default
)
{
var buffer = ArrayPool<byte>.Shared.Rent(1);
try {
if (0 == await ReadAsync(address, buffer.AsMemory(0, 1), cancellationToken).ConfigureAwait(false))
return -1;
else
return buffer[0];
}
finally {
ArrayPool<byte>.Shared.Return(buffer);
}
}
public unsafe int ReadByte(
I2CAddress address,
CancellationToken cancellationToken = default
)
{
Span<byte> buffer = stackalloc byte[1];
if (0 == Read(address, buffer, cancellationToken))
return -1;
else
return buffer[0];
}
}
}
| 33.582927 | 162 | 0.64115 | [
"MIT"
] | smdn/Smdn.Devices.MCP2221 | src/Smdn.Devices.MCP2221/Smdn.Devices.MCP2221/MCP2221.I2C.cs | 13,769 | C# |
// Lucene version compatibility level 4.8.1
using Lucene.Net.Analysis.Util;
using System;
using System.Collections.Generic;
namespace Lucene.Net.Analysis.Lv
{
/*
* 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>
/// Factory for <see cref="LatvianStemFilter"/>.
/// <code>
/// <fieldType name="text_lvstem" class="solr.TextField" positionIncrementGap="100">
/// <analyzer>
/// <tokenizer class="solr.StandardTokenizerFactory"/>
/// <filter class="solr.LowerCaseFilterFactory"/>
/// <filter class="solr.LatvianStemFilterFactory"/>
/// </analyzer>
/// </fieldType></code>
/// </summary>
public class LatvianStemFilterFactory : TokenFilterFactory
{
/// <summary>
/// Creates a new <see cref="LatvianStemFilterFactory"/> </summary>
public LatvianStemFilterFactory(IDictionary<string, string> args)
: base(args)
{
if (args.Count > 0)
{
throw new ArgumentException(string.Format(J2N.Text.StringFormatter.CurrentCulture, "Unknown parameters: {0}", args));
}
}
public override TokenStream Create(TokenStream input)
{
return new LatvianStemFilter(input);
}
}
} | 39.574074 | 133 | 0.648573 | [
"Apache-2.0"
] | 10088/lucenenet | src/Lucene.Net.Analysis.Common/Analysis/Lv/LatvianStemFilterFactory.cs | 2,137 | C# |
// <copyright file="MetricProcessor.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System.Collections.Generic;
namespace OpenTelemetry.Metrics.Export
{
/// <summary>
/// MetricProcessor base class.
/// </summary>
public abstract class MetricProcessor
{
/// <summary>
/// Finish the current collection cycle and return the metrics it holds.
/// This is called at the end of one collection cycle by the Controller.
/// MetricProcessor can use this to clear its Metrics (in case of stateless).
/// </summary>
/// <param name="metrics">The list of metrics from this cycle, which are to be exported.</param>
public abstract void FinishCollectionCycle(out IEnumerable<Metric> metrics);
/// <summary>
/// Process the metric. This method is called once every collection interval.
/// </summary>
/// <param name="metric">the metric record.</param>
public abstract void Process(Metric metric);
}
}
| 39.512195 | 104 | 0.690123 | [
"Apache-2.0"
] | TopSwagCode/opentelemetry-dotnet | src/OpenTelemetry/Metrics/Export/MetricProcessor.cs | 1,620 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Terraria.ID;
namespace Starvers.Enemies.Npcs
{
using Dropping = Terraria.GameContent.ItemDropRules.CommonCode;
public class FloatingSkeleton : StarverNPC
{
private static SpawnChecker sChecker = SpawnChecker.Night;
private int timer;
public FloatingSkeleton() : base(new Vector(30, 45))
{
noTileCollide = true;
noGravity = true;
}
public override void AI()
{
timer++;
if (TNPC.HasPlayerTarget)
{
switch (timer % 180)
{
case 139:
case 159:
case 179:
var target = Starver.Instance.Players[TNPC.target];
var velocity = target.Center - Center;
velocity.Length(rand.NextFloat(12.5f, 15f));
var damage = rand.Next(20, 40) * DamageIndex;
NewProj(Velocity, ProjectileID.SkeletonBone, (int)damage);
break;
}
}
if (timer % 3 == 0)
{
TNPC.SendData();
}
}
public override bool CheckSpawn(StarverPlayer player)
{
return false;
timer++;
bool success = timer % sChecker.SpawnRate == 0 && rand.NextDouble() < sChecker.SpawnChance;
return success && sChecker.Match(player.GetNPCSpawnChecker());
}
public override void DropItems()
{
if (rand.NextDouble() < 0.5)
{
Dropping.DropItemFromNPC(TNPC, ItemID.Gel, rand.Next(3, 8));
}
}
public override void Initialize()
{
TNPC.type = NPCID.Skeleton;
TNPC.life = 4000;
TNPC.lifeMax = 4000;
TNPC.defense = 800;
TNPC.aiStyle = 2;
TNPC.damage = 88;
}
}
}
| 21.930556 | 94 | 0.658645 | [
"MIT"
] | ArkeyDarz/Starver | Enemies/Npcs/FloatingSkeleton.cs | 1,581 | C# |
////////////////////////////////////////////////////////////////////////////////
//NUnit tests for "EF Core Provider for LCPI OLE DB"
// IBProvider and Contributors. 08.05.2021.
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using Microsoft.EntityFrameworkCore;
using NUnit.Framework;
using xdb=lcpi.data.oledb;
namespace EFCore_LcpiOleDb_Tests.General.Work.DBMS.Firebird.V03_0_0.D3.Query.Operators.SET_001.NotEqual.Complete2__objs.NullableDateTime.String{
////////////////////////////////////////////////////////////////////////////////
using T_DATA1 =System.Nullable<System.DateTime>;
using T_DATA2 =System.String;
using T_DATA1_U=System.DateTime;
using T_DATA2_U=System.String;
////////////////////////////////////////////////////////////////////////////////
//class TestSet_001__fields__02__VN
public static class TestSet_001__fields__02__VN
{
private const string c_NameOf__TABLE ="TEST_MODIFY_ROW2";
private const string c_NameOf__COL_DATA1 ="COL_TIMESTAMP";
private const string c_NameOf__COL_DATA2 ="COL2_VARCHAR_32";
private sealed class MyContext:TestBaseDbContext
{
[Table(c_NameOf__TABLE)]
public sealed class TEST_RECORD
{
[Key]
[Column("TEST_ID")]
public System.Int64? TEST_ID { get; set; }
[Column(c_NameOf__COL_DATA1)]
public T_DATA1 COL_DATA1 { get; set; }
[Column(c_NameOf__COL_DATA2, TypeName="VARCHAR(32)")]
public T_DATA2 COL_DATA2 { get; set; }
};//class TEST_RECORD
//----------------------------------------------------------------------
public DbSet<TEST_RECORD> testTable { get; set; }
//----------------------------------------------------------------------
public MyContext(xdb.OleDbTransaction tr)
:base(tr)
{
}//MyContext
};//class MyContext
//-----------------------------------------------------------------------
[Test]
public static void Test_001()
{
using(var cn=LocalCnHelper.CreateCn())
{
cn.Open();
using(var tr=cn.BeginTransaction())
{
//insert new record in external transaction
using(var db=new MyContext(tr))
{
T_DATA1 c_value1=new T_DATA1_U(2021,05,11,12,14,34).AddTicks(1000*1234).AddTicks(900);
System.Int64? testID=Helper__InsertRow(db,c_value1,null);
var recs=db.testTable.Where(r => (((object)r.COL_DATA1) /*OP{*/ != /*}OP*/ ((object)r.COL_DATA2)) && r.TEST_ID==testID);
int nRecs=0;
foreach(var r in recs)
{
Assert.AreEqual
(0,
nRecs);
++nRecs;
Assert.IsTrue
(r.TEST_ID.HasValue);
Assert.AreEqual
(testID,
r.TEST_ID.Value);
Assert.AreEqual
(c_value1,
r.COL_DATA1);
Assert.AreEqual
(null,
r.COL_DATA2);
}//foreach r
db.CheckTextOfLastExecutedCommand
(new TestSqlTemplate()
.T("SELECT ").N("t","TEST_ID").T(", ").N("t",c_NameOf__COL_DATA1).T(", ").N("t",c_NameOf__COL_DATA2).EOL()
.T("FROM ").N(c_NameOf__TABLE).T(" AS ").N("t").EOL()
.T("WHERE ((").N("t",c_NameOf__COL_DATA1).T(" <> ").N("t",c_NameOf__COL_DATA2).T(") OR (").N("t",c_NameOf__COL_DATA1).IS_NULL().T(") OR (").N("t",c_NameOf__COL_DATA2).IS_NULL().T(")) AND ((").N("t",c_NameOf__COL_DATA1).IS_NOT_NULL().T(") OR (").N("t",c_NameOf__COL_DATA2).IS_NOT_NULL().T(")) AND (").N("t","TEST_ID").T(" = ").P_ID("__testID_0").T(")"));
Assert.AreEqual
(1,
nRecs);
}//using db
tr.Rollback();
}//using tr
}//using cn
}//Test_001
//-----------------------------------------------------------------------
[Test]
public static void Test_002()
{
using(var cn=LocalCnHelper.CreateCn())
{
cn.Open();
using(var tr=cn.BeginTransaction())
{
//insert new record in external transaction
using(var db=new MyContext(tr))
{
T_DATA1 c_value1=new T_DATA1_U(2021,05,11,12,14,34).AddTicks(1000*1234).AddTicks(900);
System.Int64? testID=Helper__InsertRow(db,c_value1,null);
var recs=db.testTable.Where(r => !(((object)r.COL_DATA1) /*OP{*/ != /*}OP*/ ((object)r.COL_DATA2)) && r.TEST_ID==testID);
foreach(var r in recs)
{
TestServices.ThrowSelectedRow();
}//foreach r
db.CheckTextOfLastExecutedCommand
(new TestSqlTemplate()
.T("SELECT ").N("t","TEST_ID").T(", ").N("t",c_NameOf__COL_DATA1).T(", ").N("t",c_NameOf__COL_DATA2).EOL()
.T("FROM ").N(c_NameOf__TABLE).T(" AS ").N("t").EOL()
.T("WHERE (((").N("t",c_NameOf__COL_DATA1).T(" = ").N("t",c_NameOf__COL_DATA2).T(") AND (").N("t",c_NameOf__COL_DATA1).IS_NOT_NULL().T(") AND (").N("t",c_NameOf__COL_DATA2).IS_NOT_NULL().T(")) OR ((").N("t",c_NameOf__COL_DATA1).IS_NULL().T(") AND (").N("t",c_NameOf__COL_DATA2).IS_NULL().T("))) AND (").N("t","TEST_ID").T(" = ").P_ID("__testID_0").T(")"));
}//using db
tr.Rollback();
}//using tr
}//using cn
}//Test_002
//Helper methods --------------------------------------------------------
private static System.Int64 Helper__InsertRow(MyContext db,
T_DATA1 valueForColData1,
T_DATA2 valueForColData2)
{
var newRecord=new MyContext.TEST_RECORD();
newRecord.COL_DATA1 =valueForColData1;
newRecord.COL_DATA2 =valueForColData2;
db.testTable.Add(newRecord);
db.SaveChanges();
db.CheckTextOfLastExecutedCommand
(new TestSqlTemplate()
.T("INSERT INTO ").N(c_NameOf__TABLE).T(" (").N(c_NameOf__COL_DATA1).T(", ").N(c_NameOf__COL_DATA2).T(")").EOL()
.T("VALUES (").P("p0").T(", ").P("p1").T(")").EOL()
.T("RETURNING ").N("TEST_ID").EOL()
.T("INTO ").P("p2").T(";"));
Assert.IsTrue
(newRecord.TEST_ID.HasValue);
Console.WriteLine("TEST_ID: {0}",newRecord.TEST_ID.Value);
return newRecord.TEST_ID.Value;
}//Helper__InsertRow
};//class TestSet_001__fields__02__VN
////////////////////////////////////////////////////////////////////////////////
}//namespace EFCore_LcpiOleDb_Tests.General.Work.DBMS.Firebird.V03_0_0.D3.Query.Operators.SET_001.NotEqual.Complete2__objs.NullableDateTime.String
| 33.236559 | 364 | 0.572954 | [
"MIT"
] | ibprovider/Lcpi.EFCore.LcpiOleDb | Tests/General/Source/Work/DBMS/Firebird/V03_0_0/D3/Query/Operators/SET_001/NotEqual/Complete2__objs/NullableDateTime/String/TestSet_001__fields__02__VN.cs | 6,184 | 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.DirectoryServices.Interop
{
using System;
using System.Text;
using System.Security;
using System.Security.Permissions;
using System.Runtime.InteropServices;
[
SuppressUnmanagedCodeSecurityAttribute()
]
internal class SafeNativeMethods
{
[DllImport(ExternDll.Oleaut32, PreserveSig = false)]
public static extern void VariantClear(IntPtr pObject);
[DllImport(ExternDll.Oleaut32)]
public static extern void VariantInit(IntPtr pObject);
[DllImport(ExternDll.Activeds)]
public static extern bool FreeADsMem(IntPtr pVoid);
public const int FORMAT_MESSAGE_ALLOCATE_BUFFER = 0x00000100,
FORMAT_MESSAGE_IGNORE_INSERTS = 0x00000200,
FORMAT_MESSAGE_FROM_STRING = 0x00000400,
FORMAT_MESSAGE_FROM_HMODULE = 0x00000800,
FORMAT_MESSAGE_FROM_SYSTEM = 0x00001000,
FORMAT_MESSAGE_ARGUMENT_ARRAY = 0x00002000,
FORMAT_MESSAGE_MAX_WIDTH_MASK = 0x000000FF,
ERROR_MORE_DATA = 234,
ERROR_SUCCESS = 0;
[DllImport(ExternDll.Activeds, CharSet = System.Runtime.InteropServices.CharSet.Unicode)]
public static extern int ADsGetLastError(out int error, StringBuilder errorBuffer,
int errorBufferLength, StringBuilder nameBuffer, int nameBufferLength);
[DllImport(ExternDll.Activeds, CharSet = System.Runtime.InteropServices.CharSet.Unicode)]
public static extern int ADsSetLastError(int error, string errorString, string provider);
[DllImport(ExternDll.Kernel32, CharSet = System.Runtime.InteropServices.CharSet.Unicode)]
public static extern int FormatMessageW(int dwFlags, int lpSource, int dwMessageId,
int dwLanguageId, StringBuilder lpBuffer, int nSize, int arguments);
public class EnumVariant
{
private static readonly object s_noMoreValues = new object();
private Object _currentValue = s_noMoreValues;
private IEnumVariant _enumerator;
public EnumVariant(IEnumVariant en)
{
if (en == null)
throw new ArgumentNullException("en");
_enumerator = en;
}
/// <include file='doc\SafeNativeMethods.uex' path='docs/doc[@for="SafeNativeMethods.EnumVariant.GetNext"]/*' />
/// <devdoc>
/// Moves the enumerator to the next value In the list.
/// </devdoc>
public bool GetNext()
{
Advance();
return _currentValue != s_noMoreValues;
}
/// <include file='doc\SafeNativeMethods.uex' path='docs/doc[@for="SafeNativeMethods.EnumVariant.GetValue"]/*' />
/// <devdoc>
/// Returns the current value of the enumerator. If GetNext() has never been called,
/// or if it has been called but it returned false, will throw an exception.
/// </devdoc>
public Object GetValue()
{
if (_currentValue == s_noMoreValues)
throw new InvalidOperationException(Res.GetString(Res.DSEnumerator));
return _currentValue;
}
/// <include file='doc\SafeNativeMethods.uex' path='docs/doc[@for="SafeNativeMethods.EnumVariant.Reset"]/*' />
/// <devdoc>
/// Returns the enumerator to the start of the sequence.
/// </devdoc>
public void Reset()
{
_enumerator.Reset();
_currentValue = s_noMoreValues;
}
/// <include file='doc\SafeNativeMethods.uex' path='docs/doc[@for="SafeNativeMethods.EnumVariant.Advance"]/*' />
/// <devdoc>
/// Moves the pointer to the next value In the contained IEnumVariant, and
/// stores the current value In currentValue.
/// </devdoc>
private void Advance()
{
_currentValue = s_noMoreValues;
IntPtr addr = Marshal.AllocCoTaskMem(Marshal.SizeOf(typeof(Variant)));
try
{
int[] numRead = new int[] { 0 };
SafeNativeMethods.VariantInit(addr);
_enumerator.Next(1, addr, numRead);
try
{
if (numRead[0] > 0)
{
_currentValue = Marshal.GetObjectForNativeVariant(addr);
}
}
finally
{
SafeNativeMethods.VariantClear(addr);
}
}
finally
{
Marshal.FreeCoTaskMem(addr);
}
}
}
[ComImport(), Guid("00020404-0000-0000-C000-000000000046"), System.Runtime.InteropServices.InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)]
public interface IEnumVariant
{
[SuppressUnmanagedCodeSecurityAttribute()]
void Next(
[In, MarshalAs(UnmanagedType.U4)]
int celt,
[In, Out]
IntPtr rgvar,
[Out, MarshalAs(UnmanagedType.LPArray)]
int[] pceltFetched);
[SuppressUnmanagedCodeSecurityAttribute()]
void Skip(
[In, MarshalAs(UnmanagedType.U4)]
int celt);
[SuppressUnmanagedCodeSecurityAttribute()]
void Reset();
[SuppressUnmanagedCodeSecurityAttribute()]
void Clone(
[Out, MarshalAs(UnmanagedType.LPArray)]
IEnumVariant[] ppenum);
}
}
}
| 40.743421 | 191 | 0.562248 | [
"MIT"
] | FrancisFYK/corefx | src/System.DirectoryServices/src/Interop/SafeNativeMethods.cs | 6,193 | C# |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System.Collections.Generic;
namespace System.Management.Automation
{
/// <summary>
/// An object that represents a stack of paths.
/// </summary>
public sealed class PathInfoStack : Stack<PathInfo>
{
/// <summary>
/// Constructor for the PathInfoStack class.
/// </summary>
/// <param name="stackName">
/// The name of the stack.
/// </param>
/// <param name="locationStack">
/// A stack object containing PathInfo objects
/// </param>
/// <exception cref="ArgumentNullException">
/// If <paramref name="locationStack"/> is null.
/// </exception>
/// <exception cref="ArgumentException">
/// If <paramref name="stackName"/> is null or empty.
/// </exception>
internal PathInfoStack(string stackName, Stack<PathInfo> locationStack) : base()
{
if (locationStack == null)
{
throw PSTraceSource.NewArgumentNullException("locationStack");
}
if (string.IsNullOrEmpty(stackName))
{
throw PSTraceSource.NewArgumentException("stackName");
}
Name = stackName;
// Since the Stack<T> constructor takes an IEnumerable and
// not a Stack<T> the stack actually gets enumerated in the
// wrong order. I have to push them on manually in the
// appropriate order.
PathInfo[] stackContents = new PathInfo[locationStack.Count];
locationStack.CopyTo(stackContents, 0);
for (int index = stackContents.Length - 1; index >= 0; --index)
{
this.Push(stackContents[index]);
}
}
/// <summary>
/// Gets the name of the stack
/// </summary>
public string Name { get; } = null;
}
}
| 32.290323 | 88 | 0.558941 | [
"MIT"
] | renovate-mirrors/PowerShell | src/System.Management.Automation/namespaces/StackInfo.cs | 2,002 | C# |
// <auto-generated>
// automatically generated by the FlatBuffers compiler, do not modify
// </auto-generated>
namespace cfg
{
public enum ItemEItemFunctionType : int
{
ItemEItemFunctionType_REPLACE_HANDHELD = 0,
ItemEItemFunctionType_USE_DESIGN_DRAWING = 1,
};
}
| 17.0625 | 70 | 0.765568 | [
"MIT"
] | HFX-93/luban_examples | Projects/Flatbuffers_bin/Gen/cfg/ItemEItemFunctionType.cs | 273 | C# |
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.SpaServices.Webpack;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using corevue.Providers;
namespace corevue
{
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public IConfiguration Configuration { get; }
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
// Add framework services.
services.AddMvc()
.SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
// Simple example with dependency injection for a data provider.
services.AddSingleton<IWeatherProvider, WeatherProviderFake>();
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
// Webpack initialization with hot-reload.
app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions
{
HotModuleReplacement = true,
});
}
else
{
app.UseExceptionHandler("/Home/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
routes.MapSpaFallbackRoute(
name: "spa-fallback",
defaults: new { controller = "Home", action = "Index" });
});
}
}
}
| 33.132353 | 143 | 0.586773 | [
"MIT"
] | aszx20056/test | Startup.cs | 2,253 | C# |
using Microsoft.VisualStudio.TestTools.UnitTesting;
using VendorOrder.Models;
using System.Collections.Generic;
using System;
namespace VendorOrder.Tests
{
[TestClass]
public class VendorTests : IDisposable
{
public void Dispose()
{
Vendor.ClearAll();
}
[TestMethod]
public void VendorConstructor_CreatesInstancesOfVendor_Vendor()
{
Vendor newVendor = new Vendor("test vendor");
Assert.AreEqual(typeof(Vendor), newVendor.GetType());
}
[TestMethod]
public void GetName_ReturnsName_String()
{
string name = "Test Vendor";
Vendor newVendor = new Vendor(name);
string result = newVendor.Name;
Assert.AreEqual(name, result);
}
[TestMethod]
public void GetId_ReturnsVendorId_Int()
{
string name = "Test Vendor";
Vendor newVendor = new Vendor(name);
int result = newVendor.Id;
Assert.AreEqual(1, result);
}
[TestMethod]
public void GetAll_ReturnAllVendorsObjects_VendorList()
{
string name01 = "Suzie's Cafe";
string name02 = "Epicodus Canteen";
Vendor newVendor1 = new Vendor(name01);
Vendor newVendor2 = new Vendor(name02);
List<Vendor> newList = new List<Vendor> { newVendor1, newVendor2 };
List<Vendor> result = Vendor.GetAll();
CollectionAssert.AreEqual(newList, result);
}
[TestMethod]
public void Find_ReturnsCorrectVendor_Vendor()
{
string name01 = "Suzie's Cafe";
string name02 = "Epicodus Canteen";
Vendor newVendor1 = new Vendor(name01);
Vendor newVendor2 = new Vendor(name02);
Vendor result = Vendor.Find(2);
Assert.AreEqual(newVendor2, result);
}
[TestMethod]
public void AddOrder_LinkOrderWithVendor_OrderList()
{
string description = "mild spiced pepperoni pizza";
Order newOrder = new Order(description);
List<Order> newList = new List<Order> {newOrder};
string name = "Suzie's Cafe";
Vendor newVendor = new Vendor(name);
newVendor.AddOrder(newOrder);
List<Order> result = newVendor.Orders;
CollectionAssert.AreEqual(newList, result);
}
}
} | 27.463415 | 74 | 0.638544 | [
"MIT"
] | godfreyowidi/vendor-order-Tracker | VendorOrder.Tests/ModelTests/VendorTests.cs | 2,252 | C# |
using Microsoft.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;
namespace Fooww.Research.EntityFrameworkCore
{
public class MyProjectHttpApiHostMigrationsDbContext : AbpDbContext<MyProjectHttpApiHostMigrationsDbContext>
{
public MyProjectHttpApiHostMigrationsDbContext(DbContextOptions<MyProjectHttpApiHostMigrationsDbContext> options)
: base(options)
{
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.ConfigureResearch();
}
}
}
| 28.136364 | 121 | 0.717286 | [
"MIT"
] | PowerDG/Hundred-Micro | dgHundred/Research(1)/host/Fooww.Research.HttpApi.Host/EntityFrameworkCore/MyProjectHttpApiHostMigrationsDbContext.cs | 621 | C# |
using System;
namespace Goal.Seedwork.Domain.Aggregates
{
public interface IEntity : IEntity<Guid>
{
}
}
| 13.111111 | 44 | 0.686441 | [
"MIT"
] | ritter-ti/goal | src/Seedwork/Domain/Aggregates/IEntity.cs | 118 | C# |
/*
*
* (c) Copyright Ascensio System Limited 2010-2020
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
using System;
using System.Collections.Generic;
using System.Web;
using ASC.FederatedLogin.Helpers;
using ASC.FederatedLogin.Profile;
using Newtonsoft.Json.Linq;
namespace ASC.FederatedLogin.LoginProviders
{
public class GoogleLoginProvider : BaseLoginProvider<GoogleLoginProvider>
{
public const string GoogleScopeContacts = "https://www.googleapis.com/auth/contacts.readonly";
public const string GoogleScopeDrive = "https://www.googleapis.com/auth/drive";
//https://developers.google.com/gmail/imap/xoauth2-protocol
public const string GoogleScopeMail = "https://mail.google.com/";
public const string GoogleUrlContacts = "https://www.google.com/m8/feeds/contacts/default/full/";
public const string GoogleUrlFile = "https://www.googleapis.com/drive/v3/files/";
public const string GoogleUrlFileUpload = "https://www.googleapis.com/upload/drive/v3/files";
public const string GoogleUrlProfile = "https://people.googleapis.com/v1/people/me";
public static readonly string[] GoogleDriveExt = new[] { ".gdoc", ".gsheet", ".gslides", ".gdraw" };
public static string GoogleDriveMimeTypeFolder = "application/vnd.google-apps.folder";
public static string FilesFields = "id,name,mimeType,parents,createdTime,modifiedTime,owners/displayName,lastModifyingUser/displayName,capabilities/canEdit,size";
public static string ProfileFields = "emailAddresses,genders,names";
public override string AccessTokenUrl { get { return "https://www.googleapis.com/oauth2/v4/token"; } }
public override string CodeUrl { get { return "https://accounts.google.com/o/oauth2/v2/auth"; } }
public override string RedirectUri { get { return this["googleRedirectUrl"]; } }
public override string ClientID { get { return this["googleClientId"]; } }
public override string ClientSecret { get { return this["googleClientSecret"]; } }
public override string Scopes { get { return "https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email"; } }
public GoogleLoginProvider() { }
public GoogleLoginProvider(string name, int order, Dictionary<string, string> props, Dictionary<string, string> additional = null) : base(name, order, props, additional) { }
public override LoginProfile GetLoginProfile(string accessToken)
{
if (string.IsNullOrEmpty(accessToken))
throw new Exception("Login failed");
return RequestProfile(accessToken);
}
public OAuth20Token Auth(HttpContext context)
{
return Auth(context, GoogleScopeContacts, (context.Request["access_type"] ?? "") == "offline"
? new Dictionary<string, string>
{
{ "access_type", "offline" },
{ "prompt", "consent" }
}
: null);
}
private static LoginProfile RequestProfile(string accessToken)
{
var googleProfile = RequestHelper.PerformRequest(GoogleUrlProfile + "?personFields=" + HttpUtility.UrlEncode(ProfileFields), headers: new Dictionary<string, string> { { "Authorization", "Bearer " + accessToken } });
var loginProfile = ProfileFromGoogle(googleProfile);
return loginProfile;
}
private static LoginProfile ProfileFromGoogle(string googleProfile)
{
var jProfile = JObject.Parse(googleProfile);
if (jProfile == null) throw new Exception("Failed to correctly process the response");
var profile = new LoginProfile
{
Id = jProfile.Value<string>("resourceName").Replace("people/", ""),
Provider = ProviderConstants.Google,
};
var emailsArr = jProfile.Value<JArray>("emailAddresses");
if (emailsArr != null)
{
var emailsList = emailsArr.ToObject<List<GoogleEmailAddress>>();
if (emailsList.Count > 0)
{
var ind = emailsList.FindIndex(googleEmail => googleEmail.metadata.primary);
profile.EMail = emailsList[ind > -1 ? ind : 0].value;
}
}
var namesArr = jProfile.Value<JArray>("names");
if (namesArr != null)
{
var namesList = namesArr.ToObject<List<GoogleName>>();
if (namesList.Count > 0)
{
var ind = namesList.FindIndex(googleName => googleName.metadata.primary);
var name = namesList[ind > -1 ? ind : 0];
profile.DisplayName = name.displayName;
profile.FirstName = name.givenName;
profile.LastName = name.familyName;
}
}
var gendersArr = jProfile.Value<JArray>("genders");
if (gendersArr != null)
{
var gendersList = gendersArr.ToObject<List<GoogleGender>>();
if (gendersList.Count > 0)
{
var ind = gendersList.FindIndex(googleGender => googleGender.metadata.primary);
profile.Gender = gendersList[ind > -1 ? ind : 0].value;
}
}
return profile;
}
private class GoogleEmailAddress
{
public GoogleMetadata metadata = new GoogleMetadata();
public string value = null;
}
private class GoogleGender
{
public GoogleMetadata metadata = new GoogleMetadata();
public string value = null;
}
private class GoogleName
{
public GoogleMetadata metadata = new GoogleMetadata();
public string displayName = null;
public string familyName = null;
public string givenName = null;
}
private class GoogleMetadata
{
public bool primary = false;
}
}
} | 45.096774 | 227 | 0.592704 | [
"Apache-2.0"
] | Ektai-Solution-Pty-Ltd/CommunityServer | module/ASC.Thrdparty/ASC.FederatedLogin/LoginProviders/GoogleLoginProvider.cs | 6,990 | C# |
using System;
using System.Collections.Generic;
using System.Text;
using Robust.Client.Graphics;
using Robust.Client.ResourceManagement;
using Robust.Client.Utility;
using Robust.Shared.IoC;
using Robust.Shared.Maths;
using Robust.Shared.ViewVariables;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.PixelFormats;
namespace Content.Client.Clickable
{
internal class ClickMapManager : IClickMapManager, IPostInjectInit
{
private const float Threshold = 0.25f;
private const int ClickRadius = 2;
[Dependency] private readonly IResourceCache _resourceCache = default!;
[ViewVariables]
private readonly Dictionary<Texture, ClickMap> _textureMaps = new();
[ViewVariables] private readonly Dictionary<RSI, RsiClickMapData> _rsiMaps =
new();
public void PostInject()
{
_resourceCache.OnRawTextureLoaded += OnRawTextureLoaded;
_resourceCache.OnRsiLoaded += OnOnRsiLoaded;
}
private void OnOnRsiLoaded(RsiLoadedEventArgs obj)
{
if (obj.Atlas is Image<Rgba32> rgba)
{
var clickMap = ClickMap.FromImage(rgba, Threshold);
var rsiData = new RsiClickMapData(clickMap, obj.AtlasOffsets);
_rsiMaps[obj.Resource.RSI] = rsiData;
}
}
private void OnRawTextureLoaded(TextureLoadedEventArgs obj)
{
if (obj.Image is Image<Rgba32> rgba)
{
_textureMaps[obj.Resource] = ClickMap.FromImage(rgba, Threshold);
}
}
public bool IsOccluding(Texture texture, Vector2i pos)
{
if (!_textureMaps.TryGetValue(texture, out var clickMap))
{
return false;
}
return SampleClickMap(clickMap, pos, clickMap.Size, Vector2i.Zero);
}
public bool IsOccluding(RSI rsi, RSI.StateId state, RSI.State.Direction dir, int frame, Vector2i pos)
{
if (!_rsiMaps.TryGetValue(rsi, out var rsiData))
{
return false;
}
if (!rsiData.Offsets.TryGetValue(state, out var stateDat) || stateDat.Length <= (int) dir)
{
return false;
}
var dirDat = stateDat[(int) dir];
if (dirDat.Length <= frame)
{
return false;
}
var offset = dirDat[frame];
return SampleClickMap(rsiData.ClickMap, pos, rsi.Size, offset);
}
private static bool SampleClickMap(ClickMap map, Vector2i pos, Vector2i bounds, Vector2i offset)
{
var (width, height) = bounds;
var (px, py) = pos;
for (var x = -ClickRadius; x <= ClickRadius; x++)
{
var ox = px + x;
if (ox < 0 || ox >= width)
{
continue;
}
for (var y = -ClickRadius; y <= ClickRadius; y++)
{
var oy = py + y;
if (oy < 0 || oy >= height)
{
continue;
}
if (map.IsOccluded((ox, oy) + offset))
{
return true;
}
}
}
return false;
}
private sealed class RsiClickMapData
{
public readonly ClickMap ClickMap;
public readonly Dictionary<RSI.StateId, Vector2i[][]> Offsets;
public RsiClickMapData(ClickMap clickMap, Dictionary<RSI.StateId, Vector2i[][]> offsets)
{
ClickMap = clickMap;
Offsets = offsets;
}
}
internal sealed class ClickMap
{
[ViewVariables] private readonly byte[] _data;
public int Width { get; }
public int Height { get; }
[ViewVariables] public Vector2i Size => (Width, Height);
public bool IsOccluded(int x, int y)
{
var i = y * Width + x;
return (_data[i / 8] & (1 << (i % 8))) != 0;
}
public bool IsOccluded(Vector2i vector)
{
var (x, y) = vector;
return IsOccluded(x, y);
}
private ClickMap(byte[] data, int width, int height)
{
Width = width;
Height = height;
_data = data;
}
public static ClickMap FromImage<T>(Image<T> image, float threshold) where T : unmanaged, IPixel<T>
{
var threshByte = (byte) (threshold * 255);
var width = image.Width;
var height = image.Height;
var dataSize = (int) Math.Ceiling(width * height / 8f);
var data = new byte[dataSize];
var pixelSpan = image.GetPixelSpan();
for (var i = 0; i < pixelSpan.Length; i++)
{
Rgba32 rgba = default;
pixelSpan[i].ToRgba32(ref rgba);
if (rgba.A >= threshByte)
{
data[i / 8] |= (byte) (1 << (i % 8));
}
}
return new ClickMap(data, width, height);
}
public string DumpText()
{
var sb = new StringBuilder();
for (var y = 0; y < Height; y++)
{
for (var x = 0; x < Width; x++)
{
sb.Append(IsOccluded(x, y) ? "1" : "0");
}
sb.AppendLine();
}
return sb.ToString();
}
}
}
public interface IClickMapManager
{
public bool IsOccluding(Texture texture, Vector2i pos);
public bool IsOccluding(RSI rsi, RSI.StateId state, RSI.State.Direction dir, int frame, Vector2i pos);
}
}
| 30 | 111 | 0.487642 | [
"MIT"
] | A-Box-12/space-station-14 | Content.Client/Clickable/ClickMapManager.cs | 6,150 | C# |
using BasonManagement.Application.DTOs.Settings;
using BasonManagement.Application.Interfaces.Shared;
using BasonManagement.Infrastructure.DbContexts;
using BasonManagement.Infrastructure.Identity.Models;
using BasonManagement.Infrastructure.Shared.Services;
using BasonManagement.Web.Services;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc.Authorization;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using System.Collections.Generic;
using System.Globalization;
namespace BasonManagement.Web.Extensions
{
public static class ServiceCollectionExtensions
{
public static void AddMultiLingualSupport(this IServiceCollection services)
{
#region Registering ResourcesPath
services.AddLocalization(options => options.ResourcesPath = "Resources");
#endregion Registering ResourcesPath
services.AddMvc()
.AddViewLocalization(Microsoft.AspNetCore.Mvc.Razor.LanguageViewLocationExpanderFormat.Suffix)
.AddDataAnnotationsLocalization(options =>
{
options.DataAnnotationLocalizerProvider = (type, factory) =>
factory.Create(typeof(SharedResource));
});
services.AddRouting(o => o.LowercaseUrls = true);
services.AddHttpContextAccessor();
services.Configure<RequestLocalizationOptions>(options =>
{
var cultures = new List<CultureInfo> {
new CultureInfo("en"),
new CultureInfo("ar"),
new CultureInfo("fr")
};
options.DefaultRequestCulture = new Microsoft.AspNetCore.Localization.RequestCulture("en");
options.SupportedCultures = cultures;
options.SupportedUICultures = cultures;
});
}
public static void AddInfrastructure(this IServiceCollection services, IConfiguration configuration)
{
services.AddRouting(options => options.LowercaseUrls = true);
services.AddPersistenceContexts(configuration);
services.AddAuthenticationScheme(configuration);
}
private static void AddAuthenticationScheme(this IServiceCollection services, IConfiguration configuration)
{
services.AddMvc(o =>
{
//Add Authentication to all Controllers by default.
var policy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().Build();
o.Filters.Add(new AuthorizeFilter(policy));
});
}
private static void AddPersistenceContexts(this IServiceCollection services, IConfiguration configuration)
{
if (configuration.GetValue<bool>("UseInMemoryDatabase"))
{
services.AddDbContext<IdentityContext>(options =>
options.UseInMemoryDatabase("IdentityDb"));
services.AddDbContext<ApplicationDbContext>(options =>
options.UseInMemoryDatabase("ApplicationDb"));
}
else
{
services.AddDbContext<IdentityContext>(options => options.UseNpgsql(configuration.GetConnectionString("IdentityConnection")));
services.AddDbContext<ApplicationDbContext>(options => options.UseNpgsql(configuration.GetConnectionString("ApplicationConnection")));
}
services.AddIdentity<ApplicationUser, IdentityRole>(options =>
{
options.SignIn.RequireConfirmedAccount = true;
options.Password.RequireNonAlphanumeric = false;
}).AddEntityFrameworkStores<IdentityContext>().AddDefaultUI().AddDefaultTokenProviders();
}
public static void AddSharedInfrastructure(this IServiceCollection services, IConfiguration configuration)
{
services.Configure<MailSettings>(configuration.GetSection("MailSettings"));
services.Configure<CacheSettings>(configuration.GetSection("CacheSettings"));
services.AddTransient<IDateTimeService, SystemDateTimeService>();
services.AddTransient<IMailService, SMTPMailService>();
services.AddTransient<IAuthenticatedUserService, AuthenticatedUserService>();
}
}
} | 45.653061 | 150 | 0.675011 | [
"MIT"
] | chougule-lalit/PrismCement | BasonManagement.Web/Extensions/ServiceCollectionExtensions.cs | 4,476 | C# |
using System;
using System.Collections.Generic;
using System.Net;
using System.Text;
namespace LibDHCPServer.VolatilePool
{
public class LeaseOptions
{
public string DomainName { get; set; }
public List<IPAddress> DNSServers { get; set; }
public List<string> TFTPServers { get; set; }
public string BootFile { get; set; }
public string Hostname { get; set; }
}
}
| 24.529412 | 55 | 0.657074 | [
"MIT"
] | pixey/Pixey.DhcpClient | LibDHCPServer/VolatilePool/LeaseOptions.cs | 419 | C# |
using MahApps.Metro;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Web.Script.Serialization;
using System.Windows;
namespace KTReports
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
public DatabaseManager databaseManager;
protected override void OnStartup(StartupEventArgs e)
{
ThemeManager.AddAccent("AppAccent", new Uri("pack://application:,,,/AppAccent.xaml"));
// get the current app style (theme and accent) from the application
Tuple<AppTheme, Accent> theme = ThemeManager.DetectAppStyle(Application.Current);
// now change app style to the custom accent and current theme
ThemeManager.ChangeAppStyle(Application.Current,
ThemeManager.GetAccent("AppAccent"),
ThemeManager.GetAppTheme("BaseLight"));
// Gets a singleton for database manager
//databaseManager = DatabaseManager.GetDBManager();
// Run tests on insertions and queries for a test database
//TestDB test = new TestDB();
//test.TestInsertions();
//test.RemoveDB();
}
}
}
| 33.511628 | 99 | 0.612075 | [
"MIT"
] | Zach076/KitsapTransitReports | project/KTReports/KTReports/App.xaml.cs | 1,441 | C# |
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.3603
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Mediachase.Ibn.Web.UI.ProjectManagement.Modules {
public partial class ProjectList {
/// <summary>
/// DockTop control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Mediachase.Ibn.Web.UI.WebControls.McDock DockTop;
/// <summary>
/// BlockHeaderMain control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Mediachase.Ibn.Web.UI.Common.Design.BlockHeader2 BlockHeaderMain;
/// <summary>
/// upFilters control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.UpdatePanel upFilters;
/// <summary>
/// txtSearch control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtSearch;
/// <summary>
/// btnSearch control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.ImageButton btnSearch;
/// <summary>
/// btnClear control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.ImageButton btnClear;
/// <summary>
/// ddFilters control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Mediachase.Ibn.Web.UI.WebControls.IndentedDropDownList ddFilters;
/// <summary>
/// ibEditInfo control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.ImageButton ibEditInfo;
/// <summary>
/// ibDeleteInfo control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.ImageButton ibDeleteInfo;
/// <summary>
/// spanFilters control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlGenericControl spanFilters;
/// <summary>
/// FilterIsSet control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label FilterIsSet;
/// <summary>
/// MainMetaToolbar control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Mediachase.Ibn.Web.UI.MetaUI.Toolbar.MetaToolbar MainMetaToolbar;
/// <summary>
/// DockLeft control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Mediachase.Ibn.Web.UI.WebControls.McDock DockLeft;
/// <summary>
/// ddGrouping control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.DropDownList ddGrouping;
/// <summary>
/// upLeftArea control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.UpdatePanel upLeftArea;
/// <summary>
/// lblGroupName control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblGroupName;
/// <summary>
/// divLeftSearchContainer control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divLeftSearchContainer;
/// <summary>
/// txtGroupSearch control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtGroupSearch;
/// <summary>
/// ibGroupSearch control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.ImageButton ibGroupSearch;
/// <summary>
/// ibGroupClear control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.ImageButton ibGroupClear;
/// <summary>
/// groupList control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.DataList groupList;
/// <summary>
/// grdMainPanel control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.UpdatePanel grdMainPanel;
/// <summary>
/// grdMain control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Mediachase.Ibn.Web.UI.MCGrid grdMain;
/// <summary>
/// ctrlGridEventUpdater control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Mediachase.UI.Web.Apps.MetaUI.Grid.MetaGridServerEventAction ctrlGridEventUpdater;
/// <summary>
/// dgExport control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.DataGrid dgExport;
/// <summary>
/// hfFilterValue control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.HiddenField hfFilterValue;
/// <summary>
/// lbViewChange control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton lbViewChange;
}
}
| 36.161538 | 108 | 0.553393 | [
"MIT"
] | InstantBusinessNetwork/IBN | Source/Server/WebPortal/Apps/ProjectManagement/Modules/ProjectList.ascx.designer.cs | 9,402 | C# |
using System;
namespace Zoo
{
public class StartUp
{
public static void Main(string[] args)
{
}
}
} | 12.5 | 46 | 0.473333 | [
"MIT"
] | DaniHristov/SoftUni | C#-OOP/InheritanceExercise-HW/Zoo/StartUp.cs | 152 | C# |
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
#nullable enable
#pragma warning disable CS1591
#pragma warning disable CS0108
#pragma warning disable 618
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using System.Linq;
using System.Runtime.Serialization;
using System.Text.Json.Serialization;
using System.Threading;
using System.Threading.Tasks;
using JetBrains.Space.Common;
using JetBrains.Space.Common.Json.Serialization;
using JetBrains.Space.Common.Json.Serialization.Polymorphism;
using JetBrains.Space.Common.Types;
namespace JetBrains.Space.Client;
public sealed class M2PackageDeletedDetails
: M2PackageContentDetails, IClassNameConvertible, IPropagatePropertyAccessPath
{
[JsonPropertyName("className")]
public string? ClassName => "M2PackageDeletedDetails";
public M2PackageDeletedDetails() { }
public M2PackageDeletedDetails(PackageVersionInfo pkg)
{
Pkg = pkg;
}
private PropertyValue<PackageVersionInfo> _pkg = new PropertyValue<PackageVersionInfo>(nameof(M2PackageDeletedDetails), nameof(Pkg));
[Required]
[JsonPropertyName("pkg")]
public PackageVersionInfo Pkg
{
get => _pkg.GetValue();
set => _pkg.SetValue(value);
}
public void SetAccessPath(string path, bool validateHasBeenSet)
{
_pkg.SetAccessPath(path, validateHasBeenSet);
}
}
| 29.080645 | 137 | 0.677759 | [
"Apache-2.0"
] | JetBrains/space-dotnet-sdk | src/JetBrains.Space.Client/Generated/Dtos/M2PackageDeletedDetails.generated.cs | 1,803 | C# |
// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
// Ported from um/d2d1effects.h in the Windows SDK for Windows 10.0.20348.0
// Original source is Copyright © Microsoft. All rights reserved.
namespace TerraFX.Interop
{
public enum D2D1_COLORMANAGEMENT_QUALITY : uint
{
D2D1_COLORMANAGEMENT_QUALITY_PROOF = 0,
D2D1_COLORMANAGEMENT_QUALITY_NORMAL = 1,
D2D1_COLORMANAGEMENT_QUALITY_BEST = 2,
D2D1_COLORMANAGEMENT_QUALITY_FORCE_DWORD = 0xffffffff,
}
}
| 36.9375 | 145 | 0.751269 | [
"MIT"
] | DaZombieKiller/terrafx.interop.windows | sources/Interop/Windows/um/d2d1effects/D2D1_COLORMANAGEMENT_QUALITY.cs | 593 | C# |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.