content
stringlengths 5
1.04M
| avg_line_length
float64 1.75
12.9k
| max_line_length
int64 2
244k
| alphanum_fraction
float64 0
0.98
| licenses
list | repository_name
stringlengths 7
92
| path
stringlengths 3
249
| size
int64 5
1.04M
| lang
stringclasses 2
values |
|---|---|---|---|---|---|---|---|---|
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace SolsticeMod.Items.Weapons
{
public class DarknessBow : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Darkness Bow");
Tooltip.SetDefault("Has a 20% chance to shoot Darkness arrows instead of Wooden arrows.");
}
public override void SetDefaults()
{
item.damage = 12;
item.ranged = true;
item.width = 18;
item.height = 40;
item.maxStack = 1;
item.useTime = 30;
item.useAnimation = 28;
item.useStyle = 5;
item.knockBack = 2;
item.value = 5000;
item.rare = 1;
item.UseSound = SoundID.Item5;
item.noMelee = true;
item.shoot = 1;
item.useAmmo = AmmoID.Arrow;
item.shootSpeed = 10f;
item.autoReuse = false;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(null, "DarknessDrop", 6);
recipe.AddIngredient(null, "DarknessShard", 2);
recipe.AddTile(TileID.Anvils);
recipe.SetResult(this);
recipe.AddRecipe();
}
// What if I wanted this gun to have a 38% chance not to consume ammo?
/*public override bool ConsumeAmmo(Player player)
{
return Main.rand.NextFloat() >= .38f;
}*/
// What if I wanted it to work like Uzi, replacing regular bullets with High Velocity Bullets?
// Uzi/Molten Fury style: Replace normal Bullets with Highvelocity
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
if (type == ProjectileID.WoodenArrowFriendly && Main.rand.Next(1, 5) == 1) // or ProjectileID.WoodenArrowFriendly
{
type = mod.ProjectileType("DarknessArrowP"); // or ProjectileID.FireArrow;
}
return true; // return true to allow tmodloader to call Projectile.NewProjectile as normal
}
// What if I wanted it to shoot like a shotgun?
// Shotgun style: Multiple Projectiles, Random spread
/*public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
int numberProjectiles = 4 + Main.rand.Next(2); // 4 or 5 shots
for (int i = 0; i < numberProjectiles; i++)
{
Vector2 perturbedSpeed = new Vector2(speedX, speedY).RotatedByRandom(MathHelper.ToRadians(30)); // 30 degree spread.
// If you want to randomize the speed to stagger the projectiles
// float scale = 1f - (Main.rand.NextFloat() * .3f);
// perturbedSpeed = perturbedSpeed * scale;
Projectile.NewProjectile(position.X, position.Y, perturbedSpeed.X, perturbedSpeed.Y, type, damage, knockBack, player.whoAmI);
}
return false; // return false because we don't want tmodloader to shoot projectile
}*/
// What if I wanted an inaccurate gun? (Chain Gun)
// Inaccurate Gun style: Single Projectile, Random spread
/*public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Vector2 perturbedSpeed = new Vector2(speedX, speedY).RotatedByRandom(MathHelper.ToRadians(30));
speedX = perturbedSpeed.X;
speedY = perturbedSpeed.Y;
return true;
}*/
// What if I wanted multiple projectiles in a even spread? (Vampire Knives)
// Even Arc style: Multiple Projectile, Even Spread
/*public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
float numberProjectiles = 3 + Main.rand.Next(3); // 3, 4, or 5 shots
float rotation = MathHelper.ToRadians(45);
position += Vector2.Normalize(new Vector2(speedX, speedY)) * 45f;
for (int i = 0; i < numberProjectiles; i++)
{
Vector2 perturbedSpeed = new Vector2(speedX, speedY).RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numberProjectiles - 1))) * .2f; // Watch out for dividing by 0 if there is only 1 projectile.
Projectile.NewProjectile(position.X, position.Y, perturbedSpeed.X, perturbedSpeed.Y, type, damage, knockBack, player.whoAmI);
}
return false;
}*/
// Help, my gun isn't being held at the handle! Adjust these 2 numbers until it looks right.
/*public override Vector2? HoldoutOffset()
{
return new Vector2(10, 0);
}*/
// How can I make the shots appear out of the muzzle exactly?
// Also, when I do this, how do I prevent shooting through tiles?
/*public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Vector2 muzzleOffset = Vector2.Normalize(new Vector2(speedX, speedY)) * 25f;
if (Collision.CanHit(position, 0, 0, position + muzzleOffset, 0, 0))
{
position += muzzleOffset;
}
return true;
}*/
// How can I get a "Clockwork Assault Riffle" effect?
// 3 round burst, only consume 1 ammo for burst. Delay between bursts, use reuseDelay
/* The following changes to SetDefaults()
item.useAnimation = 12;
item.useTime = 4;
item.reuseDelay = 14;
public override bool ConsumeAmmo(Player player)
{
// Because of how the game works, player.itemAnimation will be 11, 7, and finally 3. (UseAmination - 1, then - useTime until less than 0.)
// We can get the Clockwork Assault Riffle Effect by not consuming ammo when itemAnimation is lower than the first shot.
return !(player.itemAnimation < item.useAnimation - 2);
}*/
// How can I shoot 2 different projectiles at the same time?
/*public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
// Here we manually spawn the 2nd projectile, manually specifying the projectile type that we wish to shoot.
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ProjectileID.GrenadeI, damage, knockBack, player.whoAmI);
// By returning true, the vanilla behavior will take place, which will shoot the 1st projectile, the one determined by the ammo.
return true;
}*/
}
}
| 43.527397
| 202
| 0.682927
|
[
"MIT"
] |
Caveweasel/SolsticeMod
|
Items/Weapons/DarknessBow.cs
| 6,355
|
C#
|
using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OlympUI {
public partial class Group : Element {
public const int WHFalse = -1;
public const int WHTrue = -2;
public const int WHInit = -3;
protected Style.Entry StylePadding = new(0);
protected Style.Entry StyleSpacing = new(0);
public override Padding Padding => StylePadding.GetCurrent<Padding>();
public override Point InnerWH {
get {
Padding padding = StylePadding.GetCurrent<Padding>();
Point wh = WH;
return new(wh.X - padding.W, wh.Y - padding.H);
}
}
#region Min, Max, Auto width and height
public Point MinWH = new(WHFalse, WHFalse);
public int MinW {
get => MinWH.X;
set => MinWH.X = value;
}
public int MinH {
get => MinWH.Y;
set => MinWH.Y = value;
}
public Point MaxWH = new(WHFalse, WHFalse);
public int MaxW {
get => MaxWH.X;
set => MaxWH.X = value;
}
public int MaxH {
get => MaxWH.Y;
set => MaxWH.Y = value;
}
public Point AutoWH = new(WHInit, WHInit);
public int AutoW {
get => AutoWH.X;
set => AutoWH.X = value;
}
public int AutoH {
get => AutoWH.Y;
set => AutoWH.Y = value;
}
public Point ForceWH = new(WHFalse, WHFalse);
public int ForceW {
get => ForceWH.X;
set => ForceWH.X = value;
}
public int ForceH {
get => ForceWH.Y;
set => ForceWH.Y = value;
}
#endregion
public Group() {
}
public virtual void Resize(Point wh) {
Point manualWH = WH;
Point autoWH = AutoWH;
if (autoWH.X == WHInit)
autoWH.X = manualWH.X == default ? WHTrue : WHFalse;
if (autoWH.Y == WHInit)
autoWH.Y = manualWH.Y == default ? WHTrue : WHFalse;
// The following is mostly ported from the Lua version of Olympus with slight modifications.
Point forceWH = new();
if (autoWH.X == WHTrue) {
forceWH.X = WHFalse;
} else if (autoWH.X == WHFalse || autoWH.X != manualWH.X) {
ForceWH.X = forceWH.X = manualWH.X;
} else {
forceWH.X = ForceWH.X;
}
if (autoWH.Y == WHTrue) {
forceWH.Y = WHFalse;
} else if (autoWH.Y == WHFalse || autoWH.Y != manualWH.Y) {
ForceWH.Y = forceWH.Y = manualWH.Y;
} else {
forceWH.Y = ForceWH.Y;
}
if (forceWH.X >= 0)
wh.X = forceWH.X;
if (forceWH.Y >= 0)
wh.Y = forceWH.Y;
Padding padding = Padding;
if (wh.X < 0 && wh.Y < 0) {
foreach (Element child in Children) {
Point childMax = child.RealXY.ToPoint() - padding.LT + child.WH;
wh.X = Math.Max(wh.X, childMax.X);
wh.Y = Math.Max(wh.Y, childMax.Y);
}
} else if (wh.X < 0) {
foreach (Element child in Children) {
wh.X = Math.Max(wh.X, (int) child.RealX - padding.L + child.W);
}
} else if (wh.Y < 0) {
foreach (Element child in Children) {
wh.Y = Math.Max(wh.Y, (int) child.RealY - padding.T + child.H);
}
}
Point minWH = MinWH;
minWH = new(
Math.Max(minWH.X, padding.W),
Math.Max(minWH.Y, padding.H)
);
Point maxWH = MaxWH;
if (minWH.X >= 0 && wh.X < minWH.X)
wh.X = minWH.X;
if (maxWH.X >= 0 && maxWH.X < wh.X)
wh.X = maxWH.X;
if (minWH.Y >= 0 && wh.Y < minWH.Y)
wh.Y = minWH.Y;
if (maxWH.Y >= 0 && maxWH.Y < wh.Y)
wh.Y = maxWH.Y;
wh.X += padding.W;
wh.Y += padding.H;
AutoWH = WH = wh;
}
public virtual void RepositionChildren() {
Vector2 padding = Padding.LT.ToVector2();
foreach (Element child in Children) {
child.RealXY = child.XY + padding;
}
}
[LayoutPass(LayoutPass.Normal, LayoutSubpass.Late)]
private void LayoutRepositionChildren(LayoutEvent e) {
RepositionChildren();
}
[LayoutPass(LayoutPass.Normal, LayoutSubpass.Pre)]
private void LayoutResize(LayoutEvent e) {
Resize(new(WHFalse, WHFalse));
}
}
}
| 30.08982
| 104
| 0.471841
|
[
"MIT"
] |
0x0ade/Olympus.FNA
|
Olympus.FNA/UI/Elements/Group.cs
| 5,027
|
C#
|
using System;
using System.Collections.Generic;
using System.Text;
using FlubuCore.Context;
using FlubuCore.Tasks;
using FlubuCore.Tasks.Process;
namespace FlubuCore.Azure.Tasks.Consumption
{
public partial class AzureConsumptionReservationSummaryTask : ExternalProcessTaskBase<AzureConsumptionReservationSummaryTask>
{
/// <summary>
/// List reservation summaries.
/// </summary>
public AzureConsumptionReservationSummaryTask()
{
WithArguments("az consumption reservation summary");
}
protected override string Description { get; set; }
}
}
| 24.846154
| 130
| 0.685759
|
[
"MIT"
] |
flubu-core/FlubuCore.Azure
|
FlubuCore.Azure/Tasks/Consumption/AzureConsumptionReservationSummaryTask.cs
| 646
|
C#
|
using System.Collections.Generic;
using System.Linq;
using Esfa.Poc.Matching.Common;
using Esfa.Poc.Matching.Domain;
namespace Esfa.Poc.Matching.Application.Employer
{
public class EmployerDataValidator
{
public Result Validate(List<FileUploadEmployer> fileData)
{
var validator = new EmployerValidator();
var errors = new List<string>();
foreach (var v in fileData)
{
var results = validator.Validate(v);
if (results.IsValid)
continue;
var errorMessage = $"{v.Account} failed because {string.Join(", ", results.Errors.Select(e => e.ErrorMessage))}";
errors.Add(errorMessage);
}
if (errors.Count > 0)
{
var error = string.Join("\r", errors.Select(e => e));
return Result.Fail(error);
}
return Result.Ok();
}
}
}
| 28.735294
| 129
| 0.542477
|
[
"MIT"
] |
SkillsFundingAgency/das-poc-matching
|
sfa.poc.matching.fileupload/Esfa.Poc.Matching.Application/Employer/EmployerDataValidator.cs
| 979
|
C#
|
namespace Plus.Communication.Packets.Outgoing.Rooms.Notifications
{
internal class RoomErrorNotifComposer : ServerPacket
{
public RoomErrorNotifComposer(int error)
: base(ServerPacketHeader.RoomErrorNotifMessageComposer)
{
WriteInteger(error);
}
}
}
| 28.181818
| 68
| 0.677419
|
[
"Apache-2.0"
] |
dotsudo/plus-clean
|
Communication/Packets/Outgoing/Rooms/Notifications/RoomErrorNotifComposer.cs
| 312
|
C#
|
using FluentAssertions;
using MyWarehouse.Application.Products.ProductStockValue;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MyWarehouse.Application.IntegrationTests.Products
{
class ProductStockValue : TestBase
{
[Test]
public async Task ShouldReturnStockCount()
{
var products = await TestFramework.DataFactory.AddProducts(25);
var result = await TestFramework.SendAsync(new ProductStockValueQuery());
result.Should().NotBeNull();
result.Amount.Should().Be(products
.Sum(x => x.Price.Amount * x.NumberInStock));
result.CurrencyCode.Should().Be(products.GroupBy(x =>
x.Price.Currency.Code).Single().Key);
}
}
}
| 28.666667
| 85
| 0.668605
|
[
"MIT"
] |
aleh807/MyWarehouse
|
tests/Application.IntegrationTests/Products/ProductStockValue.cs
| 862
|
C#
|
using System.Collections.Generic;
using UnityEngine;
// Thanks to https://www.youtube.com/watch?v=mXTxQko-JH0, https://www.youtube.com/watch?v=QN39W020LqU, https://www.youtube.com/watch?v=YueAtA_YnSY
namespace QuadTree {
public class Chunk {
public int depth;
private Chunk parentChunk;
private GameObject gameObject;
private MeshFilter meshFilter;
private PlanetChunks handler;
private BoundingBox bounds;
private Chunk[] cells;
private string name;
private bool subdivided;
// First digit : Id, Second digit : direction : R : 0, L : 1, D : 2, U : 3, RU : 4, RD : 5, LD : 6, LU : 7, 8 : halt
private int[,,] neighborArray = {
// Quadrant 0 : Top left
{{1, 8}, {1, 1}, {2, 8}, {2, 3}, {3, 3}, {3, 8}, {3, 1}, {3, 7}},
// Quadrant 1 : Top right
{{0, 0}, {0, 8}, {3, 8}, {3, 3}, {2, 4}, {2, 0}, {2, 8}, {2, 3}},
// Quadrant 2 : Bottom left
{{3, 8}, {3, 1}, {0, 2}, {0, 8}, {1, 8}, {1, 2}, {1, 6}, {1, 1}},
// Quadrant 3 : Bottom right
{{2, 0}, {2, 8}, {1, 2}, {1, 8}, {0, 0}, {0, 5}, {0, 2}, {0, 8}}
};
public Chunk(PlanetChunks handler, BoundingBox bounds, int depth, int id, GameObject parent, Chunk parentChunk, string name) {
this.parentChunk = parentChunk;
this.handler = handler;
this.bounds = bounds;
this.cells = new Chunk[4];
this.depth = depth;
this.name = name;
this.subdivided = false;
this.generateMesh(id, parent);
}
public void subdivide() {
if (this.subdivided)
return;
// Subdivides chunks
float x = this.bounds.pos.x;
float y = this.bounds.pos.y;
float subWidth = this.bounds.dim / 2f;
float subHeight = this.bounds.dim / 2f;
// 0 = top left
this.cells[0] = new Chunk(handler, new BoundingBox(x, y, subWidth), this.depth + 1, 0, this.gameObject, this, this.name + 0);
// 1 = top right
this.cells[1] = new Chunk(handler, new BoundingBox(x + subWidth, y, subWidth), this.depth + 1, 1, this.gameObject, this, this.name + 1);
// 2 = bottom left
this.cells[2] = new Chunk(handler, new BoundingBox(x, y + subHeight, subWidth), this.depth + 1, 2, this.gameObject, this, this.name + 2);
// 3 = bottom right
this.cells[3] = new Chunk(handler, new BoundingBox(x + subWidth, y + subHeight, subWidth), this.depth + 1, 3, this.gameObject, this, this.name + 3);
// Clear Mesh
this.gameObject.GetComponent<MeshRenderer>().enabled = false;
this.gameObject.GetComponent<MeshCollider>().enabled = false;
this.subdivided = true;
}
private void generateMesh(int id, GameObject parentGo) {
// GameObject
GameObject chunkGo = new GameObject(this.name);
chunkGo.transform.parent = parentGo.transform;
chunkGo.transform.localPosition = Vector3.zero;
chunkGo.tag = "Chunk";
// Renderer & Material
MeshRenderer renderer = chunkGo.AddComponent<MeshRenderer>();
Material mat = new Material(Shader.Find("Shader Graphs/TerrainShader")); // Shader.Find("Standard")
renderer.sharedMaterial = mat;
// Mesh
Mesh mesh = this.constructMesh();
MeshFilter meshFilter = chunkGo.AddComponent<MeshFilter>();
meshFilter.sharedMesh = mesh;
// Colliders
MeshCollider meshCollider = chunkGo.AddComponent<MeshCollider>();
try {
meshCollider.convex = true;
}
catch {}
meshCollider.sharedMesh = mesh;
this.gameObject = chunkGo;
this.meshFilter = meshFilter;
}
private Mesh constructMesh() {
Mesh mesh = new Mesh();
float s = this.bounds.dim;
float globalS = handler.getScale();
int density = handler.planet.chunkDensity;
Vector3 trans = handler.getTranslation();
Vector3 off = new Vector3(globalS / 2, -globalS / 2, globalS / 2);
Vector3[] vertices = new Vector3[(density + 1) * (density + 1)];
Vector3[] normals = new Vector3[(density + 1) * (density + 1)];
Color[] colors = new Color[vertices.Length];
int[] triangles = new int[6 * (density - 1) * (density - 1)];
// Fix edges problems
/* GameObject neighbor1 = null;
GameObject neighbor2 = null;
if (!name.Substring(1).Equals("hunk ")) {
char[] numberDigits = name.Substring(6).ToCharArray();
int[] targetReverseID1 = new int[numberDigits.Length];
int[] targetReverseID2 = new int[numberDigits.Length];
int direction1 = 0;
int direction2 = 0;
int digit = int.Parse(numberDigits[numberDigits.Length - 1].ToString());
if (digit == 0) { // Top left quadrant
direction1 = 1; // L
direction2 = 3; // U
}
else if (digit == 1) { // Top right quadrant
direction1 = 0; // R
direction2 = 3; // U
}
else if (digit == 2) { // Bottom left quadrant
direction1 = 1; // L
direction2 = 2; // D
}
else if (digit == 3) { // Bottom right quadrant
direction1 = 0; // R
direction2 = 2; // D
}
targetReverseID1[numberDigits.Length - 1] = direction1;
targetReverseID2[numberDigits.Length - 1] = direction2;
for (int i = numberDigits.Length - 2; i > 0; i--) {
digit = int.Parse(numberDigits[i].ToString());
if (direction1 != 8) {
targetReverseID1[i] = neighborArray[digit, direction1, 0];
direction1 = neighborArray[digit, direction1, 1];
}
if (direction2 != 8) {
targetReverseID2[i] = neighborArray[digit, direction2, 0];
direction2 = neighborArray[digit, direction2, 1];
}
if (direction1 == 8 && direction2 == 8)
break;
}
string val1 = "";
string val2 = "";
for (int i = 0; i < numberDigits.Length; i++) {
val1 += targetReverseID1[i];
val2 += targetReverseID2[i];
}
// Suppose object in same Main Chunk
val1 += " ";
val2 += " ";
string initStr = this.name.Substring(0, 1) + "hunk "; // e.g. : 0hunk
for (int i = 0; i < val1.Length; i++) {
if (neighbor1 == null) {
val1 = val1.Substring(0, val1.Length - 1); // remove last digit
neighbor1 = GameObject.Find(initStr + val1);
}
if (neighbor2 == null) {
val2 = val2.Substring(0, val2.Length - 2); // remove last digit
neighbor2 = GameObject.Find(initStr + val2);
}
if (neighbor1 != null && neighbor2 != null) // Found neighbor
break;
} // Else : TODO
if (neighbor1 != null) {
Debug.Log("Neighbor 1 : " + neighbor1.name);
neighbor1.GetComponent<MeshRenderer>().sharedMaterial.color = Color.red;
}
if (neighbor2 != null) {
Debug.Log("Neighbor 2 : " + neighbor2.name);
neighbor2.GetComponent<MeshRenderer>().sharedMaterial.color = Color.red;
}
} */
int indexTr = 0;
for (int j = 0; j < density; j++) {
for (int i = 0; i < density; i++) {
float x = this.bounds.pos.x + s / (density - 1) * i;
float y = this.bounds.pos.y + s / (density - 1) * j;
float z = 0;
Vector3 sphereUnitPosition = this.handler.localRotation * (new Vector3(x, z, y) - off).normalized;
// Default
z = this.handler.planet.getAltitudeAt(sphereUnitPosition);
vertices[i + j * density] = sphereUnitPosition * (this.handler.planet.getScale() + z) + trans;
normals [i + j * density] = vertices[i + j * density].normalized;
if (i != density - 1 && j != density - 1) {
triangles[indexTr + 0] = i + (j + 1) * density;
triangles[indexTr + 1] = i + j * density + 1;
triangles[indexTr + 2] = i + j * density;
indexTr += 3;
}
if (i != 0 && j != density - 1) {
triangles[indexTr + 0] = i + j * density;
triangles[indexTr + 1] = i - 1 + (j + 1) * density;
triangles[indexTr + 2] = i + (j + 1) * density;
indexTr += 3;
}
// Color
colors[i + j * density] = this.handler.getColorAtAltitude(z);
}
}
// Generate Mesh
mesh.Clear();
mesh.vertices = vertices;
mesh.colors = colors;
mesh.triangles = triangles;
mesh.normals = normals;
return mesh;
}
public RecursiveTree getDividedChunksFromCenter(Vector3 playerPos, Vector3 collisionPos, float collisionDist, ref RecursiveTree parent) {
float[] threshold = this.handler.planet.threshold;
float globalS = handler.getScale();
Vector3 trans = handler.getTranslation();
Vector3 off = new Vector3(globalS / 2, -globalS / 2, globalS / 2);
float x = this.bounds.pos.x + this.bounds.dim / 2;
float y = this.bounds.pos.y + this.bounds.dim / 2;
Vector3 pos = this.handler.localRotation * ((new Vector3(x, 0, y) - off).normalized * globalS) + trans;
// Test distance btw this chunk and projected player point
float distancePlayerCenter = Vector3.Distance(playerPos, pos);
if (
(this.handler.planet.useLOD && depth < threshold.Length && distancePlayerCenter < threshold[depth] * this.handler.getScale())
|| (!this.handler.planet.useLOD && depth < this.handler.planet.chunkTargetLevel)
) {
// Divide
parent.divide();
this.subdivide();
for (int i = 0; i < this.cells.Length; i++) {
parent.childrens[i] = this.cells[i].getDividedChunksFromCenter(playerPos, collisionPos, collisionDist, ref parent.childrens[i]);
}
}
return parent;
}
public void killUnreferencedChunks(RecursiveTree parent) {
if (parent.hasChildren) {
for (int i = 0; i < this.cells.Length; i++) {
this.cells[i].killUnreferencedChunks(parent.childrens[i]);
}
}
else if (this.subdivided && !parent.hasChildren) {
for (int i = 0; i < this.cells.Length; i++) {
this.cells[i].killChildren();
}
this.subdivided = false;
this.gameObject.GetComponent<MeshRenderer>().enabled = true;
this.gameObject.GetComponent<MeshCollider>().enabled = true;
}
}
public void kill() {
// KILLS HIMSELF
this.subdivided = false;
this.gameObject.GetComponent<MeshRenderer>().enabled = false;
this.gameObject.GetComponent<MeshCollider>().enabled = false;
this.handler.destroyGameObject(this.gameObject);
}
public void killChildren() {
if (this.subdivided) {
for (int i = 0; i < this.cells.Length; i++) {
this.cells[i].killChildren();
}
}
this.kill();
}
public void drawDebug() {
float globalS = handler.getScale();
Vector3 trans = handler.getTranslation();
Vector3 off = new Vector3(globalS / 2, -globalS / 2, globalS / 2);
float x = this.bounds.pos.x + this.bounds.dim / 2;
float y = this.bounds.pos.y + this.bounds.dim / 2;
Vector3 pos = this.handler.localRotation * ((new Vector3(x, 0, y) - off).normalized * globalS) + trans;
Gizmos.DrawSphere(pos, 1);
}
public Chunk getChunkWithName(string name) {
if (name.Equals(this.name.Substring(6)))
return this;
if (this.name.Substring(6).Equals(""))
return this.cells[int.Parse(name.ToCharArray()[this.depth].ToString())].getChunkWithName(name);
return this.cells[int.Parse(name.ToCharArray()[this.depth].ToString())].getChunkWithName(name);
}
public Chunk getChunk(int id) {
if (cells[id] != null) {
return cells[id];
}
return null;
}
public string getName() {
return this.name;
}
public int getDepth() {
return this.depth;
}
}
public struct RecursiveTree {
public bool hasChildren;
public RecursiveTree[] childrens;
public RecursiveTree(bool hasChildren) {
this.hasChildren = hasChildren;
this.childrens = new RecursiveTree[4];
}
public void divide() {
this.hasChildren = true;
for (int i = 0; i < childrens.Length; i++) {
childrens[i] = new RecursiveTree(false);
}
}
}
public struct BoundingBox {
public Vector3 pos;
public float dim;
public BoundingBox(float x, float y, float dimension) {
this.pos = new Vector3(x, y);
this.dim = dimension;
}
}
}
| 33.994695
| 151
| 0.56726
|
[
"MIT"
] |
xam4lor/PlanetarySpaceSimulation
|
Assets/Scripts/Universe/Body/Planet/Structure/Chunk.cs
| 12,816
|
C#
|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using UsbHid.USB.Classes;
using UsbHid.USB.Classes.Messaging;
using UsbHid.USB.Structures;
namespace UsbHid
{
public class UsbHidDevice : IDisposable
{
#region Variables
private DeviceInformationStructure _deviceInformation;
public int VID { get { return _deviceInformation.TargetVendorId; } }
public int PID { get { return _deviceInformation.TargetProductId; } }
public int MI { get { return _deviceInformation.TargetMultiInterface; } }
public List<string> DevicePaths { get { return _deviceInformation.Paths; } } // in case more same devices are attached
public string DevicePath { get { return _deviceInformation.DevicePathName; } }
public bool IsDeviceConnected { get { return _deviceInformation.IsDeviceAttached; } }
public byte InputReportSize { get { return (byte) (_deviceInformation.Capabilities.InputReportByteLength -1 ); } }
public byte OutputReportSize { get { return (byte)(_deviceInformation.Capabilities.OutputReportByteLength - 1); } }
private readonly BackgroundWorker _worker;
private FileStream _fsDeviceRead;
#endregion
#region Events
public event EventHandler<EventArgs<byte[]>> DataReceived;
public event EventHandler OnConnected;
public event EventHandler OnDisconnected;
#endregion
#region Constructor
public UsbHidDevice(int vendorId, int productId)
{
_worker = new BackgroundWorker();
_worker.DoWork += WorkerDoWork;
_deviceInformation.TargetVendorId = vendorId;
_deviceInformation.TargetProductId = productId;
_deviceInformation.ConnectedChanged += DeviceConnectedChanged;
DeviceChangeNotifier.DeviceAttached += DeviceChangeNotifierDeviceAttached;
DeviceChangeNotifier.DeviceDetached += DeviceChangeNotifierDeviceDetached;
}
public UsbHidDevice(int vendorId, int productId, int mInterface, string caption)
{
_worker = new BackgroundWorker();
_worker.DoWork += WorkerDoWork;
_deviceInformation.TargetVendorId = vendorId;
_deviceInformation.TargetProductId = productId;
_deviceInformation.TargetMultiInterface = mInterface;
_deviceInformation.TargetCaption = caption;
_deviceInformation.ConnectedChanged += DeviceConnectedChanged;
DeviceChangeNotifier.DeviceAttached += DeviceChangeNotifierDeviceAttached;
DeviceChangeNotifier.DeviceDetached += DeviceChangeNotifierDeviceDetached;
}
~UsbHidDevice()
{
Disconnect();
}
#endregion
#region Event Handlers
private void ReadCompleted(IAsyncResult iResult)
{
// Retrieve the stream and read buffer.
var syncObj = (SyncObjT)iResult.AsyncState;
try
{
// call end read : this throws any exceptions that happened during the read
syncObj.Fs.EndRead(iResult);
try
{
if (DataReceived != null) DataReceived(this, new EventArgs<byte[]>(syncObj.Buf));
}
finally
{
// when all that is done, kick off another read for the next report
BeginAsyncRead(ref syncObj.Fs, syncObj.Buf.Length);
}
}
catch (IOException ex) // if we got an IO exception, the device was removed
{
Debug.WriteLine(ex.ToString());
}
}
private void DeviceConnectedChanged(object sender, EventArgs<bool> e)
{
if (e.Value)
{
ReportConnected();
_worker.RunWorkerAsync();
}
else
{
ReportDisConnected();
}
}
private void DeviceChangeNotifierDeviceDetached(object sender, EventArgs e)
{
Disconnect();
}
private void DeviceChangeNotifierDeviceAttached(object sender, EventArgs e)
{
if (IsDeviceConnected) Disconnect();
}
#endregion
#region Methods
#region Public
public bool Connect(string Path = "")
{
DeviceDiscovery.FindTargetDevices(ref _deviceInformation, Path);
Debug.WriteLine("Connect() -> Method called");
return IsDeviceConnected;
}
public void Disconnect()
{
Debug.WriteLine("usbGenericHidCommunication:detachUsbDevice() -> Method called");
if (_fsDeviceRead != null)
{
_fsDeviceRead.Close();
}
// Is a device currently attached?
if (IsDeviceConnected)
{
Debug.WriteLine("usbGenericHidCommunication:detachUsbDevice() -> Detaching device and closing file handles");
// Close the readHandle, writeHandle and hidHandle
if (!_deviceInformation.HidHandle.IsInvalid) _deviceInformation.HidHandle.Close();
if (!_deviceInformation.ReadHandle.IsInvalid) _deviceInformation.ReadHandle.Close();
if (!_deviceInformation.WriteHandle.IsInvalid) _deviceInformation.WriteHandle.Close();
// Set the device status to detached;
_deviceInformation.IsDeviceAttached = false;
}
else Debug.WriteLine("usbGenericHidCommunication:detachUsbDevice() -> No device attached");
}
public bool SendMessage(IMesage message)
{
return DeviceCommunication.WriteRawReportToDevice(message.MessageData, ref _deviceInformation);
}
public bool SendCommandMessage(byte command)
{
var message = new CommandMessage((byte)_deviceInformation.Capabilities.InputReportByteLength, command);
return DeviceCommunication.WriteRawReportToDevice(message.MessageData, ref _deviceInformation);
}
#endregion
#region Private
private void BeginAsyncRead(ref FileStream fs, int iBufLen)
{
var syncObj = new SyncObjT { Fs = fs, Buf = new Byte[iBufLen] };
try
{
fs.BeginRead(syncObj.Buf, 0, iBufLen, ReadCompleted, syncObj);
}
catch (Exception ex)
{
Debug.WriteLine(ex.Message);
}
}
private void WorkerDoWork(object sender, DoWorkEventArgs e)
{
_fsDeviceRead = new FileStream(_deviceInformation.ReadHandle, FileAccess.Read, 0x1000, true);
BeginAsyncRead(ref _fsDeviceRead, _deviceInformation.Capabilities.InputReportByteLength);
}
private void ReportConnected()
{
OnConnected?.Invoke(this, null);
}
private void ReportDisConnected()
{
OnDisconnected?.Invoke(this, null);
}
#endregion
#endregion
#region IDisposable Members
public void Dispose()
{
Disconnect();
GC.SuppressFinalize(this);
}
#endregion
}
}
| 34.398148
| 126
| 0.607672
|
[
"MIT"
] |
etfovac/hid
|
UsbHid/UsbHidDevice.cs
| 7,430
|
C#
|
using System;
using System.Linq;
namespace _03_FoldAndSum
{
public class FoldAndSum
{
public static void Main()
{
string input = Console.ReadLine();
int[] inputNumbers = input.Split(' ').Select(int.Parse).ToArray();
int k = inputNumbers.Length / 4;
int[] nums = new int[2 * k];
int index = 0;
for (int i = k - 1; i >= 0; i--)
{
nums[index] = inputNumbers[i];
index++;
}
for (int i = 4 * k - 1; i >= 3 * k; i--)
{
nums[index] = inputNumbers[i];
index++;
}
index = 0;
for (int i = k; i < 3 * k; i++)
{
nums[index] += inputNumbers[i];
index++;
}
Console.WriteLine(String.Join(" ", nums));
}
}
}
| 22.536585
| 78
| 0.393939
|
[
"MIT"
] |
nellypeneva/SoftUniProjects
|
01_ProgrFundamentalsMay/16_Arrays-Exercises/03_FoldAndSum/FoldAndSum.cs
| 926
|
C#
|
using CSharpSpeed;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
namespace InstrumentedLibrary
{
/// <summary>
///
/// </summary>
public static class MultiplyHorizontalVector2DByMatrix2x2Tests
{
/// <summary>
/// Tests the harness.
/// </summary>
/// <returns>
/// The <see cref="List{T}" />.
/// </returns>
[DisplayName(nameof(MatrixDeterminant2x2Tests))]
public static List<SpeedTester> TestHarness()
{
var trials = 10000;
var a = MatrixTestCases.Matrix2x2ElevensTuple;
var b = MatrixTestCases.Matrix2x2IncrementalTuple;
var c = MatrixTestCases.Matrix2x2IdentityTuple;
var tests = new Dictionary<object[], TestCaseResults> {
{ new object[] { a.m1x1, a.m1x2, a.m2x1, a.m2x2 }, new TestCaseResults(description: "Matrix2x2 Elevens Tuple", trials: trials, expectedReturnValue:-2d, epsilon: double.Epsilon) },
{ new object[] { b.m1x1, b.m1x2, b.m2x1, b.m2x2 }, new TestCaseResults(description: "Matrix2x2 Incremental Tuple", trials: trials, expectedReturnValue:-2d, epsilon: double.Epsilon) },
{ new object[] { c.m1x1, c.m1x2, c.m2x1, c.m2x2 }, new TestCaseResults(description: "Matrix2x2 Identity Tuple", trials: trials, expectedReturnValue:-2d, epsilon: double.Epsilon) },
};
var results = new List<SpeedTester>();
foreach (var method in HelperExtensions.ListStaticMethodsWithAttribute(MethodBase.GetCurrentMethod().DeclaringType, typeof(SourceCodeLocationProviderAttribute)))
{
var methodDescription = ((DescriptionAttribute)method.GetCustomAttribute(typeof(DescriptionAttribute)))?.Description;
results.Add(new SpeedTester(method, methodDescription, tests));
}
return results;
}
/// <summary>
/// Multiplies the horizontal vector2 d by matrix2x2.
/// </summary>
/// <param name="x">The x.</param>
/// <param name="y">The y.</param>
/// <param name="m1x1">The M1X1.</param>
/// <param name="m1x2">The M1X2.</param>
/// <param name="m2x1">The M2X1.</param>
/// <param name="m2x2">The M2X2.</param>
/// <returns></returns>
/// <acknowledgment>
/// http://matrixmultiplication.xyz/
/// </acknowledgment>
[DebuggerStepThrough]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static (double X, double Y) MultiplyHorizontalVector2DByMatrix2x2(
double x, double y,
double m1x1, double m1x2,
double m2x1, double m2x2)
=> (
(x * m1x1) + (y * m2x1),
(x * m1x2) + (y * m2x2)
);
}
}
| 43.073529
| 199
| 0.604302
|
[
"MIT"
] |
Shkyrockett/CSharpSpeed
|
InstrumentedLibrary/Mathmatics/Matrix/MatrixMultiplyVector/MultiplyHorizontalVector2DByMatrix2x2Tests.cs
| 2,931
|
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 sms-2016-10-24.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.ServerMigrationService.Model
{
/// <summary>
/// This is the response object from the CreateReplicationJob operation.
/// </summary>
public partial class CreateReplicationJobResponse : AmazonWebServiceResponse
{
private string _replicationJobId;
/// <summary>
/// Gets and sets the property ReplicationJobId.
/// <para>
/// The unique identifier of the replication job.
/// </para>
/// </summary>
public string ReplicationJobId
{
get { return this._replicationJobId; }
set { this._replicationJobId = value; }
}
// Check to see if ReplicationJobId property is set
internal bool IsSetReplicationJobId()
{
return this._replicationJobId != null;
}
}
}
| 30.517857
| 101
| 0.673493
|
[
"Apache-2.0"
] |
Bio2hazard/aws-sdk-net
|
sdk/src/Services/ServerMigrationService/Generated/Model/CreateReplicationJobResponse.cs
| 1,709
|
C#
|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
namespace LanguageExt
{
internal class SeqEmptyInternal<A> : ISeqInternal<A>
{
public static ISeqInternal<A> Default = new SeqEmptyInternal<A>();
public A this[int index] =>
throw new IndexOutOfRangeException();
public A Head =>
throw new InvalidOperationException("Sequence is empty");
public ISeqInternal<A> Tail =>
this;
public bool IsEmpty =>
true;
public A Last =>
throw new InvalidOperationException("Sequence is empty");
public int Count =>
0;
public ISeqInternal<A> Add(A value) =>
SeqStrict<A>.FromSingleValue(value);
public ISeqInternal<A> Cons(A value) =>
SeqStrict<A>.FromSingleValue(value);
public S Fold<S>(S state, Func<S, A, S> f) =>
state;
public S FoldBack<S>(S state, Func<S, A, S> f) =>
state;
public ISeqInternal<A> Skip(int amount) =>
this;
public ISeqInternal<A> Strict() =>
this;
public ISeqInternal<A> Take(int amount) =>
this;
public IEnumerator<A> GetEnumerator()
{
yield break;
}
IEnumerator IEnumerable.GetEnumerator()
{
yield break;
}
public ISeqInternal<A> Filter(Func<A, bool> f) =>
this;
public ISeqInternal<B> Map<B>(Func<A, B> f) =>
SeqEmptyInternal<B>.Default;
public Unit Iter(Action<A> f) =>
default;
public bool Exists(Func<A, bool> f) =>
false;
public bool ForAll(Func<A, bool> f) =>
true;
}
}
| 23.307692
| 74
| 0.537404
|
[
"MIT"
] |
arialdomartini/language-ext
|
LanguageExt.Core/DataTypes/Seq/SeqEmptyInternal.cs
| 1,820
|
C#
|
using System.Collections.Generic;
using MvcContrib.UI.InputBuilder.Conventions;
namespace MvcContrib.UI.InputBuilder
{
public class DefaultConventionsFactory : List<IPropertyViewModelFactory>
{
public DefaultConventionsFactory()
{
Add(new GuidPropertyConvention());
Add(new EnumPropertyConvention());
Add(new DateTimePropertyConvention());
Add(new DefaultProperyConvention());
}
}
}
| 25.25
| 73
| 0.782178
|
[
"Apache-2.0"
] |
ignatandrei/MvcContrib
|
src/MVCContrib/UI/InputBuilder/DefaultConventionsFactory.cs
| 404
|
C#
|
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
namespace Chinchulines.Graphics
{
public class Trench
{
public Trench()
{
LoadFloorPlan();
}
public void LoadContent(string texturePath, string effect, ContentManager Content, GraphicsDeviceManager graphics)
{
_texture = Content.Load<Texture2D>(texturePath);
_effect = Content.Load<Effect>(effect);
SetUpVertices(graphics);
SetUpBoundingBoxes();
}
public void Draw(Matrix view, Matrix projection, Vector3 lightDirection, GraphicsDeviceManager graphics)
{
DrawTrench(view, projection, lightDirection, graphics);
}
private int[,] _floorPlan;
private int[] _wallHeights = new int[] { 0, 2, 2, 3, 2 };
private Texture2D _texture;
private Effect _effect;
private VertexBuffer _wallVertexBuffer;
private void LoadFloorPlan()
{
_floorPlan = new int[,]
{
{1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
{1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
{1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
{1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,1,1},
{1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,1,1},
{1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0,1,1},
{1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0,1,1},
{1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0,1,1},
{1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0,1,1},
{1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0,1,1},
{1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0,1,1},
{1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0,1,1},
{1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0,1,1},
{1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0,1,1},
{1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0,1,1},
{1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0,1,1},
{1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0,1,1},
{1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0,1,1},
{1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0,1,1},
{1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0,1,1},
{1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0,1,1},
{1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0,1,1},
{1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0,1,1},
{1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0,1,1},
{1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0,1,1},
{1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0,1,1},
{1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0,1,1},
{1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0,1,1},
{1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0,1,1},
{1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0,1,1},
{1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0,1,1},
{1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0,1,1},
{1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0,1,1},
{1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0,1,1},
{1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0,1,1},
{1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0,1,1},
{1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0,1,1},
{1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0,1,1},
{1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0,1,1},
{1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0,1,1},
{1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0,1,1},
{1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1},
{1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1},
{1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1},
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
};
Random random = new Random();
int differentBuildings = _wallHeights.Length - 1;
for (int x = 0; x < _floorPlan.GetLength(0); x++)
{
for (int y = 0; y < _floorPlan.GetLength(1); y++)
{
if (_floorPlan[x, y] == 1)
{
_floorPlan[x, y] = random.Next(differentBuildings) + 1;
}
}
}
}
private void SetUpVertices(GraphicsDeviceManager graphics)
{
int differentBuildings = _wallHeights.Length - 1;
float imagesInTexture = 1 + differentBuildings * 2;
int wallWidth = _floorPlan.GetLength(0);
int wallLength = _floorPlan.GetLength(1);
List<VertexPositionNormalTexture> verticesList = new List<VertexPositionNormalTexture>();
for (int x = 0; x < wallWidth; x++)
{
for (int z = 0; z < wallLength; z++)
{
int currentBuilding = _floorPlan[x, z];
//floor or ceiling
verticesList.Add(new VertexPositionNormalTexture(new Vector3(x, _wallHeights[currentBuilding], -z), new Vector3(0, 1, 0), new Vector2(currentBuilding * 2 / imagesInTexture, 1)));
verticesList.Add(new VertexPositionNormalTexture(new Vector3(x, _wallHeights[currentBuilding], -z - 1), new Vector3(0, 1, 0), new Vector2((currentBuilding * 2) / imagesInTexture, 0)));
verticesList.Add(new VertexPositionNormalTexture(new Vector3(x + 1, _wallHeights[currentBuilding], -z), new Vector3(0, 1, 0), new Vector2((currentBuilding * 2 + 1) / imagesInTexture, 1)));
verticesList.Add(new VertexPositionNormalTexture(new Vector3(x, _wallHeights[currentBuilding], -z - 1), new Vector3(0, 1, 0), new Vector2((currentBuilding * 2) / imagesInTexture, 0)));
verticesList.Add(new VertexPositionNormalTexture(new Vector3(x + 1, _wallHeights[currentBuilding], -z - 1), new Vector3(0, 1, 0), new Vector2((currentBuilding * 2 + 1) / imagesInTexture, 0)));
verticesList.Add(new VertexPositionNormalTexture(new Vector3(x + 1, _wallHeights[currentBuilding], -z), new Vector3(0, 1, 0), new Vector2((currentBuilding * 2 + 1) / imagesInTexture, 1)));
if (currentBuilding != 0)
{
//front wall
verticesList.Add(new VertexPositionNormalTexture(new Vector3(x + 1, 0, -z - 1), new Vector3(0, 0, -1), new Vector2((currentBuilding * 2) / imagesInTexture, 1)));
verticesList.Add(new VertexPositionNormalTexture(new Vector3(x, _wallHeights[currentBuilding], -z - 1), new Vector3(0, 0, -1), new Vector2((currentBuilding * 2 - 1) / imagesInTexture, 0)));
verticesList.Add(new VertexPositionNormalTexture(new Vector3(x, 0, -z - 1), new Vector3(0, 0, -1), new Vector2((currentBuilding * 2 - 1) / imagesInTexture, 1)));
verticesList.Add(new VertexPositionNormalTexture(new Vector3(x, _wallHeights[currentBuilding], -z - 1), new Vector3(0, 0, -1), new Vector2((currentBuilding * 2 - 1) / imagesInTexture, 0)));
verticesList.Add(new VertexPositionNormalTexture(new Vector3(x + 1, 0, -z - 1), new Vector3(0, 0, -1), new Vector2((currentBuilding * 2) / imagesInTexture, 1)));
verticesList.Add(new VertexPositionNormalTexture(new Vector3(x + 1, _wallHeights[currentBuilding], -z - 1), new Vector3(0, 0, -1), new Vector2((currentBuilding * 2) / imagesInTexture, 0)));
//back wall
verticesList.Add(new VertexPositionNormalTexture(new Vector3(x + 1, 0, -z), new Vector3(0, 0, 1), new Vector2((currentBuilding * 2) / imagesInTexture, 1)));
verticesList.Add(new VertexPositionNormalTexture(new Vector3(x, 0, -z), new Vector3(0, 0, 1), new Vector2((currentBuilding * 2 - 1) / imagesInTexture, 1)));
verticesList.Add(new VertexPositionNormalTexture(new Vector3(x, _wallHeights[currentBuilding], -z), new Vector3(0, 0, 1), new Vector2((currentBuilding * 2 - 1) / imagesInTexture, 0)));
verticesList.Add(new VertexPositionNormalTexture(new Vector3(x, _wallHeights[currentBuilding], -z), new Vector3(0, 0, 1), new Vector2((currentBuilding * 2 - 1) / imagesInTexture, 0)));
verticesList.Add(new VertexPositionNormalTexture(new Vector3(x + 1, _wallHeights[currentBuilding], -z), new Vector3(0, 0, 1), new Vector2((currentBuilding * 2) / imagesInTexture, 0)));
verticesList.Add(new VertexPositionNormalTexture(new Vector3(x + 1, 0, -z), new Vector3(0, 0, 1), new Vector2((currentBuilding * 2) / imagesInTexture, 1)));
//left wall
verticesList.Add(new VertexPositionNormalTexture(new Vector3(x, 0, -z), new Vector3(-1, 0, 0), new Vector2((currentBuilding * 2) / imagesInTexture, 1)));
verticesList.Add(new VertexPositionNormalTexture(new Vector3(x, 0, -z - 1), new Vector3(-1, 0, 0), new Vector2((currentBuilding * 2 - 1) / imagesInTexture, 1)));
verticesList.Add(new VertexPositionNormalTexture(new Vector3(x, _wallHeights[currentBuilding], -z - 1), new Vector3(-1, 0, 0), new Vector2((currentBuilding * 2 - 1) / imagesInTexture, 0)));
verticesList.Add(new VertexPositionNormalTexture(new Vector3(x, _wallHeights[currentBuilding], -z - 1), new Vector3(-1, 0, 0), new Vector2((currentBuilding * 2 - 1) / imagesInTexture, 0)));
verticesList.Add(new VertexPositionNormalTexture(new Vector3(x, _wallHeights[currentBuilding], -z), new Vector3(-1, 0, 0), new Vector2((currentBuilding * 2) / imagesInTexture, 0)));
verticesList.Add(new VertexPositionNormalTexture(new Vector3(x, 0, -z), new Vector3(-1, 0, 0), new Vector2((currentBuilding * 2) / imagesInTexture, 1)));
//right wall
verticesList.Add(new VertexPositionNormalTexture(new Vector3(x + 1, 0, -z), new Vector3(1, 0, 0), new Vector2((currentBuilding * 2) / imagesInTexture, 1)));
verticesList.Add(new VertexPositionNormalTexture(new Vector3(x + 1, _wallHeights[currentBuilding], -z - 1), new Vector3(1, 0, 0), new Vector2((currentBuilding * 2 - 1) / imagesInTexture, 0)));
verticesList.Add(new VertexPositionNormalTexture(new Vector3(x + 1, 0, -z - 1), new Vector3(1, 0, 0), new Vector2((currentBuilding * 2 - 1) / imagesInTexture, 1)));
verticesList.Add(new VertexPositionNormalTexture(new Vector3(x + 1, _wallHeights[currentBuilding], -z - 1), new Vector3(1, 0, 0), new Vector2((currentBuilding * 2 - 1) / imagesInTexture, 0)));
verticesList.Add(new VertexPositionNormalTexture(new Vector3(x + 1, 0, -z), new Vector3(1, 0, 0), new Vector2((currentBuilding * 2) / imagesInTexture, 1)));
verticesList.Add(new VertexPositionNormalTexture(new Vector3(x + 1, _wallHeights[currentBuilding], -z), new Vector3(1, 0, 0), new Vector2((currentBuilding * 2) / imagesInTexture, 0)));
}
}
}
_wallVertexBuffer = new VertexBuffer(graphics.GraphicsDevice, VertexPositionNormalTexture.VertexDeclaration, verticesList.Count, BufferUsage.WriteOnly);
_wallVertexBuffer.SetData<VertexPositionNormalTexture>(verticesList.ToArray());
}
private void DrawTrench(Matrix view, Matrix projection, Vector3 lightDirection, GraphicsDeviceManager graphics)
{
_effect.CurrentTechnique = _effect.Techniques["Textured"];
_effect.Parameters["xWorld"].SetValue(Matrix.Identity);
_effect.Parameters["xView"].SetValue(view);
_effect.Parameters["xProjection"].SetValue(projection);
_effect.Parameters["xTexture"].SetValue(_texture);
_effect.Parameters["xEnableLighting"].SetValue(true);
_effect.Parameters["xLightDirection"].SetValue(lightDirection);
_effect.Parameters["xAmbient"].SetValue(0.5f);
foreach (EffectPass pass in _effect.CurrentTechnique.Passes)
{
pass.Apply();
graphics.GraphicsDevice.SetVertexBuffer(_wallVertexBuffer);
graphics.GraphicsDevice.DrawPrimitives(PrimitiveType.TriangleList, 0, _wallVertexBuffer.VertexCount / 3);
}
}
private BoundingBox[] _trenchBoundingBoxes;
public BoundingBox[] TrenchBoundingBoxes { get => _trenchBoundingBoxes; }
private BoundingBox _completeTrenchBox;
public BoundingBox CompleteTrenchBox { get => _completeTrenchBox; }
private void SetUpBoundingBoxes()
{
int wallWidth = _floorPlan.GetLength(0);
int wallLength = _floorPlan.GetLength(1);
List<BoundingBox> bbList = new List<BoundingBox>();
for (int x = 0; x < wallWidth; x++)
{
for (int z = 0; z < wallLength; z++)
{
int floorType = _floorPlan[x, z];
if (floorType != 0)
{
int wallHeight = _wallHeights[floorType];
Vector3[] trenchPoints = new Vector3[2];
trenchPoints[0] = new Vector3(x, 0, -z);
trenchPoints[1] = new Vector3(x + 1, wallHeight, -z - 1);
BoundingBox trenchBox = BoundingBox.CreateFromPoints(trenchPoints);
bbList.Add(trenchBox);
}
}
}
_trenchBoundingBoxes = bbList.ToArray();
Vector3[] boundaryPoints = new Vector3[2];
boundaryPoints[0] = new Vector3(0, 0, 0);
boundaryPoints[1] = new Vector3(wallWidth, 20, -wallLength);
_completeTrenchBox = BoundingBox.CreateFromPoints(boundaryPoints);
}
}
}
| 71.679825
| 216
| 0.546717
|
[
"MIT"
] |
EstebanMellado/2020-2C-3571-Chinchulines
|
Chinchulines/Graphics/Trench.cs
| 16,345
|
C#
|
using Attention.UWP.Models;
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command;
using PixabaySharp.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Input;
using Orientation = PixabaySharp.Enums.Orientation;
namespace Attention.UWP.ViewModels
{
public class SearchViewModel : ViewModelBase
{
public IEnumerable<Order> Orders => Enum.GetValues(typeof(Order)).Cast<Order>();
public IEnumerable<Orientation> Orientations => Enum.GetValues(typeof(Orientation)).Cast<Orientation>();
public IEnumerable<ImageType> ImageTypes => Enum.GetValues(typeof(ImageType)).Cast<ImageType>();
public IEnumerable<Category> Categories => Enum.GetValues(typeof(Category)).Cast<Category>();
public Filter Filter { get; private set; } = App.Settings.Filter;
private ICommand _primaryButtonCommand;
public ICommand PrimaryButtonCommand
{
get
{
if (_primaryButtonCommand == null)
{
_primaryButtonCommand = new RelayCommand(() =>
{
App.Settings.Filter = Filter;
ViewModelLocator.Current.Main.PhotoGridViewModel.RefreshCommand.Execute(null);
});
}
return _primaryButtonCommand;
}
}
private ICommand _closeButtonCommand;
public ICommand CloseButtonCommand
{
get
{
if (_closeButtonCommand == null)
{
_closeButtonCommand = new RelayCommand(() =>
{
});
}
return _closeButtonCommand;
}
}
}
}
| 32.196429
| 112
| 0.577926
|
[
"MIT"
] |
hippieZhou/Attention
|
src/Attention.UWP/ViewModels/SearchViewModel.cs
| 1,805
|
C#
|
// PermissionApprover
Decompiled was cancelled.
| 12.25
| 25
| 0.816327
|
[
"MIT"
] |
smdx24/CPI-Source-Code
|
Disney.Mix.SDK.Internal/PermissionApprover.cs
| 49
|
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("WebApplication1")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("WebApplication1")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[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("958413c3-6bb2-4ba2-8d30-86f5aa8ca3d5")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| 37.722222
| 84
| 0.752577
|
[
"Apache-2.0"
] |
IdentityManager/IdentityManager.AspNetIdentity
|
samples/IdMgr_with_AspId/WebApplication1/Properties/AssemblyInfo.cs
| 1,361
|
C#
|
using System;
using System.Collections.Generic;
using System.Text;
namespace ValveMultitool.Models.Formats.Steam.Distribution.Apps
{
public class AppInfoLaunchEntry
{
/// <summary>
/// Path to the app executable within the app's root directory
/// </summary>
public string Executable { get; set; }
/// <summary>
/// Arguments to run the executable with
/// </summary>
public string Arguments { get; set; }
/// <summary>
/// TODO
/// </summary>
public string Description { get; set; }
/// <summary>
/// TODO
/// </summary>
public string Type { get; set; } // none
/// <summary>
/// Path to the VAC2 platform specific library.
/// </summary>
public string VacModuleFileName { get; set; }
/// <summary>
/// Extended configuration.
/// </summary>
public AppInfoSysReqsEntryConfig Config { get; set; }
}
}
| 25.3
| 70
| 0.550395
|
[
"MIT"
] |
ChaosInitiative/ValveMultitool
|
ValveMultitool/Models/Formats/Steam/Distribution/Apps/AppInfoLaunchEntry.cs
| 1,014
|
C#
|
#region LICENSE
/*
MIT License
Copyright (c) 2018 Software free CAS Sharp
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;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
namespace CASSharp.Core.Exprs
{
[DebuggerDisplay("TypeExpr : {TypeExpr} Constant : {Constant}")]
public sealed class StringExpr : CteExpr<string>
{
public StringExpr(string s) : base(ETypeExpr.String, s) { }
public StringExpr(StringExpr e) : base(e) { }
public override Expr Clone() => new StringExpr(this);
public override string ToString() => $"\"{Constant}\"";
}
}
| 37.26087
| 82
| 0.728121
|
[
"MIT"
] |
bugbit/CASSharp
|
CASSharp/CASSharp.Core/Exprs/StringExpr.cs
| 1,716
|
C#
|
//-----------------------------------------------------------------------
// <copyright file="ChildInterfaceTests.cs" company="Marimer LLC">
// Copyright (c) Marimer LLC. All rights reserved.
// Website: http://www.lhotka.net/cslanet/
// </copyright>
// <summary>no summary</summary>
//-----------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Text;
#if !NUNIT
using Microsoft.VisualStudio.TestTools.UnitTesting;
#else
using NUnit.Framework;
using TestClass = NUnit.Framework.TestFixtureAttribute;
using TestInitialize = NUnit.Framework.SetUpAttribute;
using TestCleanup = NUnit.Framework.TearDownAttribute;
using TestMethod = NUnit.Framework.TestAttribute;
#endif
namespace Csla.Test.ChildrenByInterface
{
[TestClass]
public class ChildInterfaceTests
{
[TestMethod]
public void AddItems()
{
ItemList list = new ItemList();
list.Add(new Item1());
list.Add(new Item2());
Assert.IsTrue(list[0] is Item1, "First element should be Item1");
Assert.IsTrue(list[1] is Item2, "Second element should be Item2");
}
}
public interface IItem : Csla.Core.IEditableBusinessObject
{ }
[Serializable]
public class Item1 : Csla.BusinessBase<Item1>, IItem
{
public Item1()
{
MarkAsChild();
}
protected override object GetIdValue()
{
return 0;
}
}
[Serializable]
public class Item2 : Csla.BusinessBase<Item2>, IItem
{
public Item2()
{
MarkAsChild();
}
protected override object GetIdValue()
{
return 0;
}
}
[Serializable]
public class ItemList : Csla.BusinessBindingListBase<ItemList, IItem>
{
}
}
| 23.08
| 73
| 0.623339
|
[
"MIT"
] |
angtianqiang/csla
|
Source/Csla.test/ChildrenByInterface/ChildInterfaceTests.cs
| 1,731
|
C#
|
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Windows.Forms.VisualStyles;
namespace DB338Core
{
public class DB338
{
private SQLParser sqlParser;
private DB338TransactionMgr transactionMgr;
public DB338()
{
sqlParser = new SQLParser();
sqlParser.Setup();
transactionMgr = new DB338TransactionMgr();
}
public QueryResult SubmitQuery(string query)
{
TextReader scriptText = new StringReader(query);
List<string> tokens = sqlParser.Parse(scriptText);
//sqlParser.Parse will always return the tokens of the query if accepted
//the TYPE of the query is passed into the transaction manager, so you know what to check
string queryType = tokens[tokens.Count - 4];
string done = tokens[tokens.Count - 3];
string accepted = tokens[tokens.Count - 2];
string error = tokens[tokens.Count - 1];
tokens.RemoveAt(tokens.Count - 1);
tokens.RemoveAt(tokens.Count - 1);
tokens.RemoveAt(tokens.Count - 1);
tokens.RemoveAt(tokens.Count - 1);
if (accepted == "True")
{
string[,] results = transactionMgr.Process(tokens, queryType);
QueryResult queryResult = new QueryResult(queryType, done, accepted, error);
queryResult.Results = results;
return queryResult;
}
else
{
//error
QueryResult queryResult = new QueryResult(queryType, done, accepted, error);
queryResult.Results = null;
return queryResult;
}
}
}
}
| 31.118644
| 101
| 0.577887
|
[
"MIT"
] |
brogly-zz/DB338
|
DB338Core/DB338.cs
| 1,838
|
C#
|
using System.Resources;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("PCLCache.UnitTests")]
[assembly: AssemblyDescription("")]
| 23.666667
| 47
| 0.812207
|
[
"MIT"
] |
davidturneruk/PCLCache
|
PCLCache/PCLCache.UnitTests/Properties/AssemblyInfo.cs
| 215
|
C#
|
using System.Text.Json.Serialization;
using VeilleConcurrentielle.Infrastructure.Core.Models;
namespace VeilleConcurrentielle.EventOrchestrator.Lib.Servers.Models
{
public class Event
{
public string Id { get; set; }
[JsonConverter(typeof(JsonStringEnumConverter))]
public EventNames Name { get; set; }
public DateTime CreatedAt { get; set; }
[JsonConverter(typeof(JsonStringEnumConverter))]
public EventSources Source { get; set; }
public string SerializedPayload { get; set; }
public bool IsConsumed { get; set; }
public List<EventConsumer> Consumers { get; set; }
public List<EventSubscriber> Subscribers { get; set; }
}
}
| 36
| 68
| 0.681944
|
[
"MIT"
] |
d605-upjv/veille-concurrentielle
|
EventOrchestrator/VeilleConcurrentielle.EventOrchestrator.Lib/Servers/Models/Event.cs
| 722
|
C#
|
using System;
using Moq;
using Xunit;
using WholeKitAndCaboodle;
using Shouldly;
using System.Linq;
using WholeKitAndCaboodle.Common;
using WholeKitAndCaboodle.Models;
using WholeKitAndCaboodle.Services;
namespace WholeKitAndCaboodleTest
{
public class VehicleDataServiceHarness
{
private Mock<IDataManager> _dataManager = new Mock<IDataManager>();
private IRandomNumberGenerator _randomNumberGenerator = new RandomNumberGenerator();
public VehicleDataServiceHarness()
{
}
[Fact]
public void ShouldBeAbleToGenerateVehicleData()
{
var service = new VehicleDataService(new DataManager(), new RandomNumberGenerator(), new PaddedValueGenerator(new RandomNumberGenerator()));
var actual = service.GetVehicleData();
actual.ShouldNotBeNull();
actual.Vin.ShouldNotBeEmpty();
}
[Fact]
public void ShouldGetAListOfVehicles()
{
const string data = "\"Y6966Y5387050F976\",172307,2008,\"Subaru\",\"Tribeca\",10061.44,13582.95,1.47,\"Limited 5-Pass 4dr SUV AWD w/Nav (3.6L 6cyl 5A)\",\"Bad Underhood Belts/Hoses/\"";
_dataManager.Setup(x => x.GetData(It.IsAny<DataType>())).Returns(data);
var service = new VehicleDataService(_dataManager.Object, _randomNumberGenerator, new PaddedValueGenerator(new RandomNumberGenerator()));
service.GetListOfVehicleData(1).ShouldNotBeEmpty();
}
[Fact]
public void ShouldReturnAListOfUniqueVinNumbers()
{
var service = new VehicleDataService(new DataManager(), new RandomNumberGenerator(),new PaddedValueGenerator(new RandomNumberGenerator()));
var actual = service.GetListOfVehicleData(100);
actual.Count.ShouldBe(100);
}
[Fact]
public void ShouldReturnACompleteSetOfVehicleData()
{
var service = new VehicleDataService(new DataManager(), new RandomNumberGenerator(),new PaddedValueGenerator(new RandomNumberGenerator()));
var actual = service.GetVehicleData();
actual.Make.ShouldNotBeNull();
actual.Model.ShouldNotBeNull();
actual.Vin.ShouldNotBeNull();
actual.Milage.ShouldNotBeNull();
actual.Year.ShouldNotBeNull();
actual.RetailPrice.ShouldNotBeNull();
}
[Fact]
public void ShouldHandleVehicleFacade()
{
var actual = Vehicle.GetVehicleData();
actual.Make.ShouldNotBeNull();
actual.Model.ShouldNotBeNull();
actual.Vin.ShouldNotBeNull();
actual.Milage.ShouldNotBeNull();
actual.Year.ShouldNotBeNull();
actual.RetailPrice.ShouldNotBeNull();
}
}
}
| 37.394737
| 197
| 0.643913
|
[
"MIT"
] |
ahatch1490/WholeKitAndCaboodle
|
WholeKitAndCaboodle/WholeKitAndCaboodleTest/VehicleDataServiceHarness.cs
| 2,844
|
C#
|
/*
* Copyright 2017 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 : KpHttpNotif
* Summary : Device library user interface
*
* Author : Mikhail Shiryaev
* Created : 2016
* Modified : 2017
*/
using Scada.Comm.Devices.AB;
using Scada.Comm.Devices.HttpNotif.UI;
using Scada.Data.Configuration;
using Scada.Data.Tables;
using Scada.UI;
namespace Scada.Comm.Devices
{
/// <summary>
/// Device library user interface
/// <para>Пользовательский интерфейс библиотеки КП</para>
/// </summary>
public class KpHttpNotifView : KPView
{
/// <summary>
/// Версия библиотеки КП
/// </summary>
internal const string KpVersion = "5.0.0.2";
/// <summary>
/// Конструктор для общей настройки библиотеки КП
/// </summary>
public KpHttpNotifView()
: this(0)
{
}
/// <summary>
/// Конструктор для настройки конкретного КП
/// </summary>
public KpHttpNotifView(int number)
: base(number)
{
CanShowProps = true;
}
/// <summary>
/// Описание библиотеки КП
/// </summary>
public override string KPDescr
{
get
{
return Localization.UseRussian ?
"Отправка уведомлений с помощью HTTP-запросов.\n\n" +
"Параметр командной строки:\n" +
"URL запроса, содержащее опциональные параметры {phone}, {email} и {text}.\n\n" +
"Команды ТУ:\n" +
"1 (бинарная) - отправка уведомления.\n\n" +
"Примеры текста команды:\n" +
"имя_группы;сообщение\n" +
"имя_контакта;сообщение\n" +
"эл_почта;сообщение" :
"Sending notifications via HTTP requests.\n\n" +
"Command line parameter:\n" +
"Request URL with optional parameters {phone}, {email} and {text}.\n\n" +
"Commands:\n" +
"1 (binary) - send the notification.\n\n" +
"Command text examples:\n" +
"group_name;message\n" +
"contact_name;message\n" +
"email;message";
}
}
/// <summary>
/// Получить версию библиотеки КП
/// </summary>
public override string Version
{
get
{
return KpVersion;
}
}
/// <summary>
/// Получить прототипы каналов КП по умолчанию
/// </summary>
public override KPCnlPrototypes DefaultCnls
{
get
{
KPCnlPrototypes prototypes = new KPCnlPrototypes();
prototypes.CtrlCnls.Add(new CtrlCnlPrototype(
Localization.UseRussian ? "Отправка уведомления" : "Send notification",
BaseValues.CmdTypes.Binary)
{
CmdNum = 1
});
prototypes.InCnls.Add(new InCnlPrototype(
Localization.UseRussian ? "Отправлено уведомлений" : "Sent notifications",
BaseValues.CnlTypes.TI)
{
Signal = 1,
DecDigits = 0,
UnitName = BaseValues.UnitNames.Pcs,
CtrlCnlProps = prototypes.CtrlCnls[0]
});
return prototypes;
}
}
/// <summary>
/// Получить параметры опроса КП по умолчанию
/// </summary>
public override KPReqParams DefaultReqParams
{
get
{
return new KPReqParams(10000, 200);
}
}
/// <summary>
/// Отобразить свойства КП
/// </summary>
public override void ShowProps()
{
// загрузка словарей
string errMsg;
if (!Localization.LoadDictionaries(AppDirs.LangDir, "KpHttpNotif", out errMsg))
ScadaUiUtils.ShowError(errMsg);
if (Number > 0)
// отображение формы свойств КП
FrmDevProps.ShowDialog(Number, KPProps, AppDirs);
else
// отображение адресной книги
FrmAddressBook.ShowDialog(AppDirs);
}
}
}
| 30.50303
| 101
| 0.51818
|
[
"Apache-2.0"
] |
carquiza/scada
|
ScadaComm/OpenKPs/KpHttpNotif/KpHttpNotifView.cs
| 5,617
|
C#
|
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text.RegularExpressions;
using System.Web.Mvc;
using Microsoft.Web.Mvc.Properties;
namespace Microsoft.Web.Mvc
{
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
public sealed class UrlAttribute : DataTypeAttribute, IClientValidatable
{
private static Regex _regex = new Regex(@"^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture);
public UrlAttribute()
: base(DataType.Url)
{
ErrorMessage = MvcResources.UrlAttribute_Invalid;
}
public IEnumerable<ModelClientValidationRule> GetClientValidationRules(ModelMetadata metadata, ControllerContext context)
{
yield return new ModelClientValidationRule
{
ValidationType = "url",
ErrorMessage = FormatErrorMessage(metadata.GetDisplayName())
};
}
public override bool IsValid(object value)
{
if (value == null)
{
return true;
}
string valueAsString = value as string;
return valueAsString != null && _regex.Match(valueAsString).Length > 0;
}
}
}
| 59.244444
| 1,319
| 0.564141
|
[
"Apache-2.0"
] |
1508553303/AspNetWebStack
|
src/Microsoft.Web.Mvc/UrlAttribute.cs
| 2,668
|
C#
|
using System.Runtime.CompilerServices;
[assembly: InternalsVisibleTo("SecByte.Xunit.Gherkin.UnitTests")]
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]
| 41.25
| 65
| 0.836364
|
[
"MIT"
] |
Secbyte/SecByte.Xunit.Gherkin
|
source/SecByte.Xunit.Gherkin/AssemblyInfo.cs
| 167
|
C#
|
using System;
namespace Mighty.Dynamic.Tests.SqlServer.TableClasses
{
public class ContactType : MightyOrm
{
public ContactType() : this(true)
{
}
public ContactType(bool includeSchema) :
base(string.Format(TestConstants.ReadTestConnection, TestConstants.ProviderName), includeSchema ? "Person.ContactType" : "ContactType", "ContactTypeID", "Name")
{
}
}
}
| 24.055556
| 172
| 0.644342
|
[
"BSD-3-Clause"
] |
MightyORM/MightyORM
|
tests/Dynamic/SqlServer/TableClasses/ContactType.cs
| 435
|
C#
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine($"{1}");
}
}
}
| 16.058824
| 39
| 0.615385
|
[
"MIT"
] |
aamirWasi/DCP-320
|
ConsoleApp1/ConsoleApp1/Program.cs
| 275
|
C#
|
/*
* Copyright (c) 2019 Google LLC.
*
* 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 Google.Cloud.Diagnostics.AspNetCore;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using System;
using System.Data.Common;
using System.Data;
using Polly;
using System.Data.SqlClient;
namespace CloudSql
{
public class Startup
{
public IConfiguration Configuration { get; }
IServiceCollection _services;
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
// This method gets called by the runtime. Use this method to add
// services to the container.
// For more information on how to configure your application, visit
// http://go.microsoft.com/fwlink/?LinkID=398940
public void ConfigureServices(IServiceCollection services)
{
string projectId = Google.Api.Gax.Platform.Instance().ProjectId;
if (!string.IsNullOrEmpty(projectId))
{
services.AddGoogleExceptionLogging(options =>
{
options.ProjectId = projectId;
options.ServiceName = "CloudSqlSample";
options.Version = "Test";
});
}
services.AddSingleton(typeof(DbConnection), (IServiceProvider) =>
InitializeDatabase());
services.AddMvc(options =>
{
options.Filters.Add(typeof(DbExceptionFilterAttribute));
});
_services = services;
}
DbConnection InitializeDatabase()
{
DbConnection connection;
string database = Configuration["CloudSQL:Database"];
connection = GetSqlServerConnection();
connection.Open();
using (var createTableCommand = connection.CreateCommand())
{
// Create the 'votes' table if it does not already exist.
createTableCommand.CommandText = @"
IF OBJECT_ID(N'dbo.votes', N'U') IS NULL
BEGIN
CREATE TABLE dbo.votes(
vote_id INT NOT NULL IDENTITY(1, 1) PRIMARY KEY,
time_cast datetime NOT NULL,
candidate CHAR(6) NOT NULL)
END";
createTableCommand.ExecuteNonQuery();
}
return connection;
}
DbConnection NewSqlServerConnection()
{
// [START cloud_sql_server_dotnet_ado_connection_tcp]
// Equivalent connection string:
// "User Id=<DB_USER>;Password=<DB_PASS>;Server=<DB_HOST>;Database=<DB_NAME>;"
var connectionString = new SqlConnectionStringBuilder()
{
// Remember - storing secrets in plaintext is potentially unsafe. Consider using
// something like https://cloud.google.com/secret-manager/docs/overview to help keep
// secrets secret.
DataSource = Environment.GetEnvironmentVariable("DB_HOST"), // e.g. '127.0.0.1'
// Set Host to 'cloudsql' when deploying to App Engine Flexible environment
UserID = Environment.GetEnvironmentVariable("DB_USER"), // e.g. 'my-db-user'
Password = Environment.GetEnvironmentVariable("DB_PASS"), // e.g. 'my-db-password'
InitialCatalog = Environment.GetEnvironmentVariable("DB_NAME"), // e.g. 'my-database'
// The Cloud SQL proxy provides encryption between the proxy and instance
Encrypt = false,
};
connectionString.Pooling = true;
// [START_EXCLUDE]
// [START cloud_sql_server_dotnet_ado_limit]
// MaximumPoolSize sets maximum number of connections allowed in the pool.
connectionString.MaxPoolSize = 5;
// MinimumPoolSize sets the minimum number of connections in the pool.
connectionString.MinPoolSize = 0;
// [END cloud_sql_server_dotnet_ado_limit]
// [START cloud_sql_server_dotnet_ado_timeout]
// ConnectionTimeout sets the time to wait (in seconds) while
// trying to establish a connection before terminating the attempt.
connectionString.ConnectTimeout = 15;
// [END cloud_sql_server_dotnet_ado_timeout]
// [START cloud_sql_server_dotnet_ado_lifetime]
// ADO.NET connection pooler removes a connection
// from the pool after it's been idle for approximately
// 4-8 minutes, or if the pooler detects that the
// connection with the server no longer exists.
// [END cloud_sql_server_dotnet_ado_lifetime]
// [END_EXCLUDE]
DbConnection connection =
new SqlConnection(connectionString.ConnectionString);
// [END cloud_sql_server_dotnet_ado_connection_tcp]
return connection;
}
DbConnection GetSqlServerConnection()
{
// [START cloud_sql_server_dotnet_ado_backoff]
var connection = Policy
.HandleResult<DbConnection>(conn => conn.State != ConnectionState.Open)
.WaitAndRetry(new[]
{
TimeSpan.FromSeconds(1),
TimeSpan.FromSeconds(2),
TimeSpan.FromSeconds(5)
}, (result, timeSpan, retryCount, context) =>
{
// Log any warnings here.
})
.Execute(() => NewSqlServerConnection());
// [END cloud_sql_server_dotnet_ado_backoff]
return connection;
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env,
ILoggerFactory loggerFactory)
{
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
// Configure error reporting service.
app.UseGoogleExceptionLogging();
app.UseExceptionHandler("/Home/Error");
}
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
});
}
}
}
| 42.140449
| 107
| 0.574857
|
[
"ECL-2.0",
"Apache-2.0"
] |
GauravQ/dotnet-docs-samples
|
cloud-sql/sql-server/Startup.cs
| 7,503
|
C#
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
using Hangman.View;
using Hangman.Model;
namespace Hangman
{
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
sealed partial class App : Application
{
public static Game CurrentGame = new Game();
/// <summary>
/// Initializes the singleton application object. This is the first line of authored code
/// executed, and as such is the logical equivalent of main() or WinMain().
/// </summary>
public App()
{
this.InitializeComponent();
this.Suspending += OnSuspending;
}
/// <summary>
/// Invoked when the application is launched normally by the end user. Other entry points
/// will be used such as when the application is launched to open a specific file.
/// </summary>
/// <param name="e">Details about the launch request and process.</param>
protected override void OnLaunched(LaunchActivatedEventArgs e)
{
// Do not repeat app initialization when the Window already has content,
// just ensure that the window is active
if (!(Window.Current.Content is Frame rootFrame))
{
// Create a Frame to act as the navigation context and navigate to the first page
rootFrame = new Frame();
rootFrame.NavigationFailed += OnNavigationFailed;
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
//TODO: Load state from previously suspended application
}
// Place the frame in the current Window
Window.Current.Content = rootFrame;
}
if (e.PrelaunchActivated == false)
{
if (rootFrame.Content == null)
{
// When the navigation stack isn't restored navigate to the first page,
// configuring the new page by passing required information as a navigation
// parameter
rootFrame.Navigate(typeof(MainPage), e.Arguments);
}
// Ensure the current window is active
Window.Current.Activate();
}
}
/// <summary>
/// Invoked when Navigation to a certain page fails
/// </summary>
/// <param name="sender">The Frame which failed navigation</param>
/// <param name="e">Details about the navigation failure</param>
void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
{
throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
}
/// <summary>
/// Invoked when application execution is being suspended. Application state is saved
/// without knowing whether the application will be terminated or resumed with the contents
/// of memory still intact.
/// </summary>
/// <param name="sender">The source of the suspend request.</param>
/// <param name="e">Details about the suspend request.</param>
private void OnSuspending(object sender, SuspendingEventArgs e)
{
var deferral = e.SuspendingOperation.GetDeferral();
//TODO: Save application state and stop any background activity
deferral.Complete();
}
}
}
| 38.61165
| 99
| 0.617299
|
[
"MIT"
] |
sam9116/Hangman
|
Hangman/Hangman/App.xaml.cs
| 3,979
|
C#
|
// Copyright (c) Duende Software. All rights reserved.
// See LICENSE in the project root for license information.
// Original file: https://github.com/DuendeSoftware/IdentityServer.Quickstart.UI
// Modified by Jan Škoruba
using System.ComponentModel.DataAnnotations;
namespace SkorubaDuende.IdentityServerAdmin.STS.Identity.ViewModels.Account
{
public class LoginInputModel
{
[Required]
public string Username { get; set; }
[Required]
public string Password { get; set; }
public bool RememberLogin { get; set; }
public string ReturnUrl { get; set; }
}
}
| 22.357143
| 80
| 0.691693
|
[
"Apache-2.0"
] |
CentauriConsulting/Duende.IdentityServer.Admin
|
templates/template-publish/content/src/SkorubaDuende.IdentityServerAdmin.STS.Identity/ViewModels/Account/LoginInputModel.cs
| 629
|
C#
|
using Microsoft.Extensions.Hosting;
using SFA.DAS.EmployerFinance.Configuration;
using StructureMap;
namespace SFA.DAS.EmployerFinance.Api.DependencyResolution
{
public class DefaultRegistry : Registry
{
public DefaultRegistry()
{
For<IHostingEnvironment>().Use<HostingEnvironmentAdapter>();
}
}
}
| 24.714286
| 72
| 0.708092
|
[
"MIT"
] |
SkillsFundingAgency/das-employerfinance
|
src/SFA.DAS.EmployerFinance.Api/DependencyResolution/DefaultRegistry.cs
| 346
|
C#
|
using Microsoft.Maui.Controls.CustomAttributes;
using Microsoft.Maui.Controls.Internals;
using NUnit.Framework;
namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues
{
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Github, 9355, "ScrollViewRenderer renderer dispose crash", PlatformAffected.Android)]
public class Issue9355 : TestNavigationPage
{
const string TestOk = "Test Ok";
protected override void Init()
{
PushAsync(new ContentPage());
var stacklayout = new StackLayout
{
Children =
{
new ScrollView
{
HorizontalOptions = LayoutOptions.FillAndExpand,
VerticalOptions = LayoutOptions.FillAndExpand,
Orientation = ScrollOrientation.Both,
Content = new Label
{
Text = "Label"
}
}
}
};
Microsoft.Maui.Controls.CompressedLayout.SetIsHeadless(stacklayout, true);
var page = new ContentPage
{
Content = stacklayout
};
Device.BeginInvokeOnMainThread(async () =>
{
await Navigation.PushModalAsync(page);
await Navigation.PopModalAsync();
await PushAsync(new ContentPage
{
Content = new Label
{
Text = TestOk
}
});
});
}
#if UITEST
[Test]
public void Issue9355Test()
{
RunningApp.WaitForElement(TestOk);
}
#endif
}
}
| 20.809524
| 106
| 0.678108
|
[
"MIT"
] |
10088/maui
|
src/Compatibility/ControlGallery/src/Issues.Shared/Issue9355.cs
| 1,311
|
C#
|
using System;
namespace Qkmaxware.Units.Energy {
/// <summary>
/// Static class housing si-prefix conversions for the unit "JouleEnergy"
/// </summary>
public static class JouleEnergyConversions {
/// <summary>
/// Extension method to convert Joule to YottaJoule
/// </summary>
/// <param name="val">quantity measured in Joule</param>
/// <returns>quantity measured in YottaJoule</returns>
public static Quantity<double, YottaJoule> ToYottaJoule<T>(this BaseQuantity<T, Joule> val) where T:IConvertible {
return new Quantity<double, YottaJoule>(
Convert.ToDouble(val.Value) * 1E-24
);
}
/// <summary>
/// Extension method to convert YottaJoule to Joule
/// </summary>
/// <param name="val">quantity measured in YottaJoule</param>
/// <returns>quantity measured in Joule</returns>
public static Quantity<double, Joule> ToJoule<T>(this BaseQuantity<T, YottaJoule> val) where T:IConvertible {
return new Quantity<double, Joule>(
Convert.ToDouble(val.Value) * 1E24
);
}
/// <summary>
/// Extension method to convert Joule to ZettaJoule
/// </summary>
/// <param name="val">quantity measured in Joule</param>
/// <returns>quantity measured in ZettaJoule</returns>
public static Quantity<double, ZettaJoule> ToZettaJoule<T>(this BaseQuantity<T, Joule> val) where T:IConvertible {
return new Quantity<double, ZettaJoule>(
Convert.ToDouble(val.Value) * 1E-21
);
}
/// <summary>
/// Extension method to convert ZettaJoule to Joule
/// </summary>
/// <param name="val">quantity measured in ZettaJoule</param>
/// <returns>quantity measured in Joule</returns>
public static Quantity<double, Joule> ToJoule<T>(this BaseQuantity<T, ZettaJoule> val) where T:IConvertible {
return new Quantity<double, Joule>(
Convert.ToDouble(val.Value) * 1E21
);
}
/// <summary>
/// Extension method to convert Joule to ExaJoule
/// </summary>
/// <param name="val">quantity measured in Joule</param>
/// <returns>quantity measured in ExaJoule</returns>
public static Quantity<double, ExaJoule> ToExaJoule<T>(this BaseQuantity<T, Joule> val) where T:IConvertible {
return new Quantity<double, ExaJoule>(
Convert.ToDouble(val.Value) * 1E-18
);
}
/// <summary>
/// Extension method to convert ExaJoule to Joule
/// </summary>
/// <param name="val">quantity measured in ExaJoule</param>
/// <returns>quantity measured in Joule</returns>
public static Quantity<double, Joule> ToJoule<T>(this BaseQuantity<T, ExaJoule> val) where T:IConvertible {
return new Quantity<double, Joule>(
Convert.ToDouble(val.Value) * 1E18
);
}
/// <summary>
/// Extension method to convert Joule to PetaJoule
/// </summary>
/// <param name="val">quantity measured in Joule</param>
/// <returns>quantity measured in PetaJoule</returns>
public static Quantity<double, PetaJoule> ToPetaJoule<T>(this BaseQuantity<T, Joule> val) where T:IConvertible {
return new Quantity<double, PetaJoule>(
Convert.ToDouble(val.Value) * 1E-15
);
}
/// <summary>
/// Extension method to convert PetaJoule to Joule
/// </summary>
/// <param name="val">quantity measured in PetaJoule</param>
/// <returns>quantity measured in Joule</returns>
public static Quantity<double, Joule> ToJoule<T>(this BaseQuantity<T, PetaJoule> val) where T:IConvertible {
return new Quantity<double, Joule>(
Convert.ToDouble(val.Value) * 1E15
);
}
/// <summary>
/// Extension method to convert Joule to TeraJoule
/// </summary>
/// <param name="val">quantity measured in Joule</param>
/// <returns>quantity measured in TeraJoule</returns>
public static Quantity<double, TeraJoule> ToTeraJoule<T>(this BaseQuantity<T, Joule> val) where T:IConvertible {
return new Quantity<double, TeraJoule>(
Convert.ToDouble(val.Value) * 1E-12
);
}
/// <summary>
/// Extension method to convert TeraJoule to Joule
/// </summary>
/// <param name="val">quantity measured in TeraJoule</param>
/// <returns>quantity measured in Joule</returns>
public static Quantity<double, Joule> ToJoule<T>(this BaseQuantity<T, TeraJoule> val) where T:IConvertible {
return new Quantity<double, Joule>(
Convert.ToDouble(val.Value) * 1E12
);
}
/// <summary>
/// Extension method to convert Joule to GigaJoule
/// </summary>
/// <param name="val">quantity measured in Joule</param>
/// <returns>quantity measured in GigaJoule</returns>
public static Quantity<double, GigaJoule> ToGigaJoule<T>(this BaseQuantity<T, Joule> val) where T:IConvertible {
return new Quantity<double, GigaJoule>(
Convert.ToDouble(val.Value) * 1E-9
);
}
/// <summary>
/// Extension method to convert GigaJoule to Joule
/// </summary>
/// <param name="val">quantity measured in GigaJoule</param>
/// <returns>quantity measured in Joule</returns>
public static Quantity<double, Joule> ToJoule<T>(this BaseQuantity<T, GigaJoule> val) where T:IConvertible {
return new Quantity<double, Joule>(
Convert.ToDouble(val.Value) * 1E9
);
}
/// <summary>
/// Extension method to convert Joule to MegaJoule
/// </summary>
/// <param name="val">quantity measured in Joule</param>
/// <returns>quantity measured in MegaJoule</returns>
public static Quantity<double, MegaJoule> ToMegaJoule<T>(this BaseQuantity<T, Joule> val) where T:IConvertible {
return new Quantity<double, MegaJoule>(
Convert.ToDouble(val.Value) * 1E-6
);
}
/// <summary>
/// Extension method to convert MegaJoule to Joule
/// </summary>
/// <param name="val">quantity measured in MegaJoule</param>
/// <returns>quantity measured in Joule</returns>
public static Quantity<double, Joule> ToJoule<T>(this BaseQuantity<T, MegaJoule> val) where T:IConvertible {
return new Quantity<double, Joule>(
Convert.ToDouble(val.Value) * 1E6
);
}
/// <summary>
/// Extension method to convert Joule to KiloJoule
/// </summary>
/// <param name="val">quantity measured in Joule</param>
/// <returns>quantity measured in KiloJoule</returns>
public static Quantity<double, KiloJoule> ToKiloJoule<T>(this BaseQuantity<T, Joule> val) where T:IConvertible {
return new Quantity<double, KiloJoule>(
Convert.ToDouble(val.Value) * 1E-3
);
}
/// <summary>
/// Extension method to convert KiloJoule to Joule
/// </summary>
/// <param name="val">quantity measured in KiloJoule</param>
/// <returns>quantity measured in Joule</returns>
public static Quantity<double, Joule> ToJoule<T>(this BaseQuantity<T, KiloJoule> val) where T:IConvertible {
return new Quantity<double, Joule>(
Convert.ToDouble(val.Value) * 1E3
);
}
/// <summary>
/// Extension method to convert Joule to HectoJoule
/// </summary>
/// <param name="val">quantity measured in Joule</param>
/// <returns>quantity measured in HectoJoule</returns>
public static Quantity<double, HectoJoule> ToHectoJoule<T>(this BaseQuantity<T, Joule> val) where T:IConvertible {
return new Quantity<double, HectoJoule>(
Convert.ToDouble(val.Value) * 1E-2
);
}
/// <summary>
/// Extension method to convert HectoJoule to Joule
/// </summary>
/// <param name="val">quantity measured in HectoJoule</param>
/// <returns>quantity measured in Joule</returns>
public static Quantity<double, Joule> ToJoule<T>(this BaseQuantity<T, HectoJoule> val) where T:IConvertible {
return new Quantity<double, Joule>(
Convert.ToDouble(val.Value) * 1E2
);
}
/// <summary>
/// Extension method to convert Joule to DekaJoule
/// </summary>
/// <param name="val">quantity measured in Joule</param>
/// <returns>quantity measured in DekaJoule</returns>
public static Quantity<double, DekaJoule> ToDekaJoule<T>(this BaseQuantity<T, Joule> val) where T:IConvertible {
return new Quantity<double, DekaJoule>(
Convert.ToDouble(val.Value) * 1E-1
);
}
/// <summary>
/// Extension method to convert DekaJoule to Joule
/// </summary>
/// <param name="val">quantity measured in DekaJoule</param>
/// <returns>quantity measured in Joule</returns>
public static Quantity<double, Joule> ToJoule<T>(this BaseQuantity<T, DekaJoule> val) where T:IConvertible {
return new Quantity<double, Joule>(
Convert.ToDouble(val.Value) * 1E1
);
}
/// <summary>
/// Extension method to convert Joule to DeciJoule
/// </summary>
/// <param name="val">quantity measured in Joule</param>
/// <returns>quantity measured in DeciJoule</returns>
public static Quantity<double, DeciJoule> ToDeciJoule<T>(this BaseQuantity<T, Joule> val) where T:IConvertible {
return new Quantity<double, DeciJoule>(
Convert.ToDouble(val.Value) * 1E1
);
}
/// <summary>
/// Extension method to convert DeciJoule to Joule
/// </summary>
/// <param name="val">quantity measured in DeciJoule</param>
/// <returns>quantity measured in Joule</returns>
public static Quantity<double, Joule> ToJoule<T>(this BaseQuantity<T, DeciJoule> val) where T:IConvertible {
return new Quantity<double, Joule>(
Convert.ToDouble(val.Value) * 1E-1
);
}
/// <summary>
/// Extension method to convert Joule to CentiJoule
/// </summary>
/// <param name="val">quantity measured in Joule</param>
/// <returns>quantity measured in CentiJoule</returns>
public static Quantity<double, CentiJoule> ToCentiJoule<T>(this BaseQuantity<T, Joule> val) where T:IConvertible {
return new Quantity<double, CentiJoule>(
Convert.ToDouble(val.Value) * 1E2
);
}
/// <summary>
/// Extension method to convert CentiJoule to Joule
/// </summary>
/// <param name="val">quantity measured in CentiJoule</param>
/// <returns>quantity measured in Joule</returns>
public static Quantity<double, Joule> ToJoule<T>(this BaseQuantity<T, CentiJoule> val) where T:IConvertible {
return new Quantity<double, Joule>(
Convert.ToDouble(val.Value) * 1E-2
);
}
/// <summary>
/// Extension method to convert Joule to MilliJoule
/// </summary>
/// <param name="val">quantity measured in Joule</param>
/// <returns>quantity measured in MilliJoule</returns>
public static Quantity<double, MilliJoule> ToMilliJoule<T>(this BaseQuantity<T, Joule> val) where T:IConvertible {
return new Quantity<double, MilliJoule>(
Convert.ToDouble(val.Value) * 1E3
);
}
/// <summary>
/// Extension method to convert MilliJoule to Joule
/// </summary>
/// <param name="val">quantity measured in MilliJoule</param>
/// <returns>quantity measured in Joule</returns>
public static Quantity<double, Joule> ToJoule<T>(this BaseQuantity<T, MilliJoule> val) where T:IConvertible {
return new Quantity<double, Joule>(
Convert.ToDouble(val.Value) * 1E-3
);
}
/// <summary>
/// Extension method to convert Joule to MicroJoule
/// </summary>
/// <param name="val">quantity measured in Joule</param>
/// <returns>quantity measured in MicroJoule</returns>
public static Quantity<double, MicroJoule> ToMicroJoule<T>(this BaseQuantity<T, Joule> val) where T:IConvertible {
return new Quantity<double, MicroJoule>(
Convert.ToDouble(val.Value) * 1E6
);
}
/// <summary>
/// Extension method to convert MicroJoule to Joule
/// </summary>
/// <param name="val">quantity measured in MicroJoule</param>
/// <returns>quantity measured in Joule</returns>
public static Quantity<double, Joule> ToJoule<T>(this BaseQuantity<T, MicroJoule> val) where T:IConvertible {
return new Quantity<double, Joule>(
Convert.ToDouble(val.Value) * 1E-6
);
}
/// <summary>
/// Extension method to convert Joule to NanoJoule
/// </summary>
/// <param name="val">quantity measured in Joule</param>
/// <returns>quantity measured in NanoJoule</returns>
public static Quantity<double, NanoJoule> ToNanoJoule<T>(this BaseQuantity<T, Joule> val) where T:IConvertible {
return new Quantity<double, NanoJoule>(
Convert.ToDouble(val.Value) * 1E9
);
}
/// <summary>
/// Extension method to convert NanoJoule to Joule
/// </summary>
/// <param name="val">quantity measured in NanoJoule</param>
/// <returns>quantity measured in Joule</returns>
public static Quantity<double, Joule> ToJoule<T>(this BaseQuantity<T, NanoJoule> val) where T:IConvertible {
return new Quantity<double, Joule>(
Convert.ToDouble(val.Value) * 1E-9
);
}
/// <summary>
/// Extension method to convert Joule to PicoJoule
/// </summary>
/// <param name="val">quantity measured in Joule</param>
/// <returns>quantity measured in PicoJoule</returns>
public static Quantity<double, PicoJoule> ToPicoJoule<T>(this BaseQuantity<T, Joule> val) where T:IConvertible {
return new Quantity<double, PicoJoule>(
Convert.ToDouble(val.Value) * 1E12
);
}
/// <summary>
/// Extension method to convert PicoJoule to Joule
/// </summary>
/// <param name="val">quantity measured in PicoJoule</param>
/// <returns>quantity measured in Joule</returns>
public static Quantity<double, Joule> ToJoule<T>(this BaseQuantity<T, PicoJoule> val) where T:IConvertible {
return new Quantity<double, Joule>(
Convert.ToDouble(val.Value) * 1E-12
);
}
/// <summary>
/// Extension method to convert Joule to FemtoJoule
/// </summary>
/// <param name="val">quantity measured in Joule</param>
/// <returns>quantity measured in FemtoJoule</returns>
public static Quantity<double, FemtoJoule> ToFemtoJoule<T>(this BaseQuantity<T, Joule> val) where T:IConvertible {
return new Quantity<double, FemtoJoule>(
Convert.ToDouble(val.Value) * 1E15
);
}
/// <summary>
/// Extension method to convert FemtoJoule to Joule
/// </summary>
/// <param name="val">quantity measured in FemtoJoule</param>
/// <returns>quantity measured in Joule</returns>
public static Quantity<double, Joule> ToJoule<T>(this BaseQuantity<T, FemtoJoule> val) where T:IConvertible {
return new Quantity<double, Joule>(
Convert.ToDouble(val.Value) * 1E-15
);
}
/// <summary>
/// Extension method to convert Joule to AttoJoule
/// </summary>
/// <param name="val">quantity measured in Joule</param>
/// <returns>quantity measured in AttoJoule</returns>
public static Quantity<double, AttoJoule> ToAttoJoule<T>(this BaseQuantity<T, Joule> val) where T:IConvertible {
return new Quantity<double, AttoJoule>(
Convert.ToDouble(val.Value) * 1E18
);
}
/// <summary>
/// Extension method to convert AttoJoule to Joule
/// </summary>
/// <param name="val">quantity measured in AttoJoule</param>
/// <returns>quantity measured in Joule</returns>
public static Quantity<double, Joule> ToJoule<T>(this BaseQuantity<T, AttoJoule> val) where T:IConvertible {
return new Quantity<double, Joule>(
Convert.ToDouble(val.Value) * 1E-18
);
}
/// <summary>
/// Extension method to convert Joule to ZeptoJoule
/// </summary>
/// <param name="val">quantity measured in Joule</param>
/// <returns>quantity measured in ZeptoJoule</returns>
public static Quantity<double, ZeptoJoule> ToZeptoJoule<T>(this BaseQuantity<T, Joule> val) where T:IConvertible {
return new Quantity<double, ZeptoJoule>(
Convert.ToDouble(val.Value) * 1E21
);
}
/// <summary>
/// Extension method to convert ZeptoJoule to Joule
/// </summary>
/// <param name="val">quantity measured in ZeptoJoule</param>
/// <returns>quantity measured in Joule</returns>
public static Quantity<double, Joule> ToJoule<T>(this BaseQuantity<T, ZeptoJoule> val) where T:IConvertible {
return new Quantity<double, Joule>(
Convert.ToDouble(val.Value) * 1E-21
);
}
/// <summary>
/// Extension method to convert Joule to YoctoJoule
/// </summary>
/// <param name="val">quantity measured in Joule</param>
/// <returns>quantity measured in YoctoJoule</returns>
public static Quantity<double, YoctoJoule> ToYoctoJoule<T>(this BaseQuantity<T, Joule> val) where T:IConvertible {
return new Quantity<double, YoctoJoule>(
Convert.ToDouble(val.Value) * 1E24
);
}
/// <summary>
/// Extension method to convert YoctoJoule to Joule
/// </summary>
/// <param name="val">quantity measured in YoctoJoule</param>
/// <returns>quantity measured in Joule</returns>
public static Quantity<double, Joule> ToJoule<T>(this BaseQuantity<T, YoctoJoule> val) where T:IConvertible {
return new Quantity<double, Joule>(
Convert.ToDouble(val.Value) * 1E-24
);
}
/// <summary>
/// Extension method to convert YottaJoule to ZettaJoule
/// </summary>
/// <param name="val">quantity measured in YottaJoule</param>
/// <returns>quantity measured in ZettaJoule</returns>
public static Quantity<double, ZettaJoule> ToZettaJoule<T>(this BaseQuantity<T, YottaJoule> val) where T:IConvertible {
return new Quantity<double, ZettaJoule>(
Convert.ToDouble(val.Value) * 1E-24
);
}
/// <summary>
/// Extension method to convert YottaJoule to ExaJoule
/// </summary>
/// <param name="val">quantity measured in YottaJoule</param>
/// <returns>quantity measured in ExaJoule</returns>
public static Quantity<double, ExaJoule> ToExaJoule<T>(this BaseQuantity<T, YottaJoule> val) where T:IConvertible {
return new Quantity<double, ExaJoule>(
Convert.ToDouble(val.Value) * 1E-24
);
}
/// <summary>
/// Extension method to convert YottaJoule to PetaJoule
/// </summary>
/// <param name="val">quantity measured in YottaJoule</param>
/// <returns>quantity measured in PetaJoule</returns>
public static Quantity<double, PetaJoule> ToPetaJoule<T>(this BaseQuantity<T, YottaJoule> val) where T:IConvertible {
return new Quantity<double, PetaJoule>(
Convert.ToDouble(val.Value) * 1E-24
);
}
/// <summary>
/// Extension method to convert YottaJoule to TeraJoule
/// </summary>
/// <param name="val">quantity measured in YottaJoule</param>
/// <returns>quantity measured in TeraJoule</returns>
public static Quantity<double, TeraJoule> ToTeraJoule<T>(this BaseQuantity<T, YottaJoule> val) where T:IConvertible {
return new Quantity<double, TeraJoule>(
Convert.ToDouble(val.Value) * 1E-24
);
}
/// <summary>
/// Extension method to convert YottaJoule to GigaJoule
/// </summary>
/// <param name="val">quantity measured in YottaJoule</param>
/// <returns>quantity measured in GigaJoule</returns>
public static Quantity<double, GigaJoule> ToGigaJoule<T>(this BaseQuantity<T, YottaJoule> val) where T:IConvertible {
return new Quantity<double, GigaJoule>(
Convert.ToDouble(val.Value) * 1E-24
);
}
/// <summary>
/// Extension method to convert YottaJoule to MegaJoule
/// </summary>
/// <param name="val">quantity measured in YottaJoule</param>
/// <returns>quantity measured in MegaJoule</returns>
public static Quantity<double, MegaJoule> ToMegaJoule<T>(this BaseQuantity<T, YottaJoule> val) where T:IConvertible {
return new Quantity<double, MegaJoule>(
Convert.ToDouble(val.Value) * 1E-24
);
}
/// <summary>
/// Extension method to convert YottaJoule to KiloJoule
/// </summary>
/// <param name="val">quantity measured in YottaJoule</param>
/// <returns>quantity measured in KiloJoule</returns>
public static Quantity<double, KiloJoule> ToKiloJoule<T>(this BaseQuantity<T, YottaJoule> val) where T:IConvertible {
return new Quantity<double, KiloJoule>(
Convert.ToDouble(val.Value) * 1E-24
);
}
/// <summary>
/// Extension method to convert YottaJoule to HectoJoule
/// </summary>
/// <param name="val">quantity measured in YottaJoule</param>
/// <returns>quantity measured in HectoJoule</returns>
public static Quantity<double, HectoJoule> ToHectoJoule<T>(this BaseQuantity<T, YottaJoule> val) where T:IConvertible {
return new Quantity<double, HectoJoule>(
Convert.ToDouble(val.Value) * 1E-24
);
}
/// <summary>
/// Extension method to convert YottaJoule to DekaJoule
/// </summary>
/// <param name="val">quantity measured in YottaJoule</param>
/// <returns>quantity measured in DekaJoule</returns>
public static Quantity<double, DekaJoule> ToDekaJoule<T>(this BaseQuantity<T, YottaJoule> val) where T:IConvertible {
return new Quantity<double, DekaJoule>(
Convert.ToDouble(val.Value) * 1E-24
);
}
/// <summary>
/// Extension method to convert YottaJoule to DeciJoule
/// </summary>
/// <param name="val">quantity measured in YottaJoule</param>
/// <returns>quantity measured in DeciJoule</returns>
public static Quantity<double, DeciJoule> ToDeciJoule<T>(this BaseQuantity<T, YottaJoule> val) where T:IConvertible {
return new Quantity<double, DeciJoule>(
Convert.ToDouble(val.Value) * 1E-24
);
}
/// <summary>
/// Extension method to convert YottaJoule to CentiJoule
/// </summary>
/// <param name="val">quantity measured in YottaJoule</param>
/// <returns>quantity measured in CentiJoule</returns>
public static Quantity<double, CentiJoule> ToCentiJoule<T>(this BaseQuantity<T, YottaJoule> val) where T:IConvertible {
return new Quantity<double, CentiJoule>(
Convert.ToDouble(val.Value) * 1E-24
);
}
/// <summary>
/// Extension method to convert YottaJoule to MilliJoule
/// </summary>
/// <param name="val">quantity measured in YottaJoule</param>
/// <returns>quantity measured in MilliJoule</returns>
public static Quantity<double, MilliJoule> ToMilliJoule<T>(this BaseQuantity<T, YottaJoule> val) where T:IConvertible {
return new Quantity<double, MilliJoule>(
Convert.ToDouble(val.Value) * 1E-24
);
}
/// <summary>
/// Extension method to convert YottaJoule to MicroJoule
/// </summary>
/// <param name="val">quantity measured in YottaJoule</param>
/// <returns>quantity measured in MicroJoule</returns>
public static Quantity<double, MicroJoule> ToMicroJoule<T>(this BaseQuantity<T, YottaJoule> val) where T:IConvertible {
return new Quantity<double, MicroJoule>(
Convert.ToDouble(val.Value) * 1E-24
);
}
/// <summary>
/// Extension method to convert YottaJoule to NanoJoule
/// </summary>
/// <param name="val">quantity measured in YottaJoule</param>
/// <returns>quantity measured in NanoJoule</returns>
public static Quantity<double, NanoJoule> ToNanoJoule<T>(this BaseQuantity<T, YottaJoule> val) where T:IConvertible {
return new Quantity<double, NanoJoule>(
Convert.ToDouble(val.Value) * 1E-24
);
}
/// <summary>
/// Extension method to convert YottaJoule to PicoJoule
/// </summary>
/// <param name="val">quantity measured in YottaJoule</param>
/// <returns>quantity measured in PicoJoule</returns>
public static Quantity<double, PicoJoule> ToPicoJoule<T>(this BaseQuantity<T, YottaJoule> val) where T:IConvertible {
return new Quantity<double, PicoJoule>(
Convert.ToDouble(val.Value) * 1E-24
);
}
/// <summary>
/// Extension method to convert YottaJoule to FemtoJoule
/// </summary>
/// <param name="val">quantity measured in YottaJoule</param>
/// <returns>quantity measured in FemtoJoule</returns>
public static Quantity<double, FemtoJoule> ToFemtoJoule<T>(this BaseQuantity<T, YottaJoule> val) where T:IConvertible {
return new Quantity<double, FemtoJoule>(
Convert.ToDouble(val.Value) * 1E-24
);
}
/// <summary>
/// Extension method to convert YottaJoule to AttoJoule
/// </summary>
/// <param name="val">quantity measured in YottaJoule</param>
/// <returns>quantity measured in AttoJoule</returns>
public static Quantity<double, AttoJoule> ToAttoJoule<T>(this BaseQuantity<T, YottaJoule> val) where T:IConvertible {
return new Quantity<double, AttoJoule>(
Convert.ToDouble(val.Value) * 1E-24
);
}
/// <summary>
/// Extension method to convert YottaJoule to ZeptoJoule
/// </summary>
/// <param name="val">quantity measured in YottaJoule</param>
/// <returns>quantity measured in ZeptoJoule</returns>
public static Quantity<double, ZeptoJoule> ToZeptoJoule<T>(this BaseQuantity<T, YottaJoule> val) where T:IConvertible {
return new Quantity<double, ZeptoJoule>(
Convert.ToDouble(val.Value) * 1E-24
);
}
/// <summary>
/// Extension method to convert YottaJoule to YoctoJoule
/// </summary>
/// <param name="val">quantity measured in YottaJoule</param>
/// <returns>quantity measured in YoctoJoule</returns>
public static Quantity<double, YoctoJoule> ToYoctoJoule<T>(this BaseQuantity<T, YottaJoule> val) where T:IConvertible {
return new Quantity<double, YoctoJoule>(
Convert.ToDouble(val.Value) * 1E-24
);
}
/// <summary>
/// Extension method to convert ZettaJoule to YottaJoule
/// </summary>
/// <param name="val">quantity measured in ZettaJoule</param>
/// <returns>quantity measured in YottaJoule</returns>
public static Quantity<double, YottaJoule> ToYottaJoule<T>(this BaseQuantity<T, ZettaJoule> val) where T:IConvertible {
return new Quantity<double, YottaJoule>(
Convert.ToDouble(val.Value) * 1E-21
);
}
/// <summary>
/// Extension method to convert ZettaJoule to ExaJoule
/// </summary>
/// <param name="val">quantity measured in ZettaJoule</param>
/// <returns>quantity measured in ExaJoule</returns>
public static Quantity<double, ExaJoule> ToExaJoule<T>(this BaseQuantity<T, ZettaJoule> val) where T:IConvertible {
return new Quantity<double, ExaJoule>(
Convert.ToDouble(val.Value) * 1E-21
);
}
/// <summary>
/// Extension method to convert ZettaJoule to PetaJoule
/// </summary>
/// <param name="val">quantity measured in ZettaJoule</param>
/// <returns>quantity measured in PetaJoule</returns>
public static Quantity<double, PetaJoule> ToPetaJoule<T>(this BaseQuantity<T, ZettaJoule> val) where T:IConvertible {
return new Quantity<double, PetaJoule>(
Convert.ToDouble(val.Value) * 1E-21
);
}
/// <summary>
/// Extension method to convert ZettaJoule to TeraJoule
/// </summary>
/// <param name="val">quantity measured in ZettaJoule</param>
/// <returns>quantity measured in TeraJoule</returns>
public static Quantity<double, TeraJoule> ToTeraJoule<T>(this BaseQuantity<T, ZettaJoule> val) where T:IConvertible {
return new Quantity<double, TeraJoule>(
Convert.ToDouble(val.Value) * 1E-21
);
}
/// <summary>
/// Extension method to convert ZettaJoule to GigaJoule
/// </summary>
/// <param name="val">quantity measured in ZettaJoule</param>
/// <returns>quantity measured in GigaJoule</returns>
public static Quantity<double, GigaJoule> ToGigaJoule<T>(this BaseQuantity<T, ZettaJoule> val) where T:IConvertible {
return new Quantity<double, GigaJoule>(
Convert.ToDouble(val.Value) * 1E-21
);
}
/// <summary>
/// Extension method to convert ZettaJoule to MegaJoule
/// </summary>
/// <param name="val">quantity measured in ZettaJoule</param>
/// <returns>quantity measured in MegaJoule</returns>
public static Quantity<double, MegaJoule> ToMegaJoule<T>(this BaseQuantity<T, ZettaJoule> val) where T:IConvertible {
return new Quantity<double, MegaJoule>(
Convert.ToDouble(val.Value) * 1E-21
);
}
/// <summary>
/// Extension method to convert ZettaJoule to KiloJoule
/// </summary>
/// <param name="val">quantity measured in ZettaJoule</param>
/// <returns>quantity measured in KiloJoule</returns>
public static Quantity<double, KiloJoule> ToKiloJoule<T>(this BaseQuantity<T, ZettaJoule> val) where T:IConvertible {
return new Quantity<double, KiloJoule>(
Convert.ToDouble(val.Value) * 1E-21
);
}
/// <summary>
/// Extension method to convert ZettaJoule to HectoJoule
/// </summary>
/// <param name="val">quantity measured in ZettaJoule</param>
/// <returns>quantity measured in HectoJoule</returns>
public static Quantity<double, HectoJoule> ToHectoJoule<T>(this BaseQuantity<T, ZettaJoule> val) where T:IConvertible {
return new Quantity<double, HectoJoule>(
Convert.ToDouble(val.Value) * 1E-21
);
}
/// <summary>
/// Extension method to convert ZettaJoule to DekaJoule
/// </summary>
/// <param name="val">quantity measured in ZettaJoule</param>
/// <returns>quantity measured in DekaJoule</returns>
public static Quantity<double, DekaJoule> ToDekaJoule<T>(this BaseQuantity<T, ZettaJoule> val) where T:IConvertible {
return new Quantity<double, DekaJoule>(
Convert.ToDouble(val.Value) * 1E-21
);
}
/// <summary>
/// Extension method to convert ZettaJoule to DeciJoule
/// </summary>
/// <param name="val">quantity measured in ZettaJoule</param>
/// <returns>quantity measured in DeciJoule</returns>
public static Quantity<double, DeciJoule> ToDeciJoule<T>(this BaseQuantity<T, ZettaJoule> val) where T:IConvertible {
return new Quantity<double, DeciJoule>(
Convert.ToDouble(val.Value) * 1E-21
);
}
/// <summary>
/// Extension method to convert ZettaJoule to CentiJoule
/// </summary>
/// <param name="val">quantity measured in ZettaJoule</param>
/// <returns>quantity measured in CentiJoule</returns>
public static Quantity<double, CentiJoule> ToCentiJoule<T>(this BaseQuantity<T, ZettaJoule> val) where T:IConvertible {
return new Quantity<double, CentiJoule>(
Convert.ToDouble(val.Value) * 1E-21
);
}
/// <summary>
/// Extension method to convert ZettaJoule to MilliJoule
/// </summary>
/// <param name="val">quantity measured in ZettaJoule</param>
/// <returns>quantity measured in MilliJoule</returns>
public static Quantity<double, MilliJoule> ToMilliJoule<T>(this BaseQuantity<T, ZettaJoule> val) where T:IConvertible {
return new Quantity<double, MilliJoule>(
Convert.ToDouble(val.Value) * 1E-21
);
}
/// <summary>
/// Extension method to convert ZettaJoule to MicroJoule
/// </summary>
/// <param name="val">quantity measured in ZettaJoule</param>
/// <returns>quantity measured in MicroJoule</returns>
public static Quantity<double, MicroJoule> ToMicroJoule<T>(this BaseQuantity<T, ZettaJoule> val) where T:IConvertible {
return new Quantity<double, MicroJoule>(
Convert.ToDouble(val.Value) * 1E-21
);
}
/// <summary>
/// Extension method to convert ZettaJoule to NanoJoule
/// </summary>
/// <param name="val">quantity measured in ZettaJoule</param>
/// <returns>quantity measured in NanoJoule</returns>
public static Quantity<double, NanoJoule> ToNanoJoule<T>(this BaseQuantity<T, ZettaJoule> val) where T:IConvertible {
return new Quantity<double, NanoJoule>(
Convert.ToDouble(val.Value) * 1E-21
);
}
/// <summary>
/// Extension method to convert ZettaJoule to PicoJoule
/// </summary>
/// <param name="val">quantity measured in ZettaJoule</param>
/// <returns>quantity measured in PicoJoule</returns>
public static Quantity<double, PicoJoule> ToPicoJoule<T>(this BaseQuantity<T, ZettaJoule> val) where T:IConvertible {
return new Quantity<double, PicoJoule>(
Convert.ToDouble(val.Value) * 1E-21
);
}
/// <summary>
/// Extension method to convert ZettaJoule to FemtoJoule
/// </summary>
/// <param name="val">quantity measured in ZettaJoule</param>
/// <returns>quantity measured in FemtoJoule</returns>
public static Quantity<double, FemtoJoule> ToFemtoJoule<T>(this BaseQuantity<T, ZettaJoule> val) where T:IConvertible {
return new Quantity<double, FemtoJoule>(
Convert.ToDouble(val.Value) * 1E-21
);
}
/// <summary>
/// Extension method to convert ZettaJoule to AttoJoule
/// </summary>
/// <param name="val">quantity measured in ZettaJoule</param>
/// <returns>quantity measured in AttoJoule</returns>
public static Quantity<double, AttoJoule> ToAttoJoule<T>(this BaseQuantity<T, ZettaJoule> val) where T:IConvertible {
return new Quantity<double, AttoJoule>(
Convert.ToDouble(val.Value) * 1E-21
);
}
/// <summary>
/// Extension method to convert ZettaJoule to ZeptoJoule
/// </summary>
/// <param name="val">quantity measured in ZettaJoule</param>
/// <returns>quantity measured in ZeptoJoule</returns>
public static Quantity<double, ZeptoJoule> ToZeptoJoule<T>(this BaseQuantity<T, ZettaJoule> val) where T:IConvertible {
return new Quantity<double, ZeptoJoule>(
Convert.ToDouble(val.Value) * 1E-21
);
}
/// <summary>
/// Extension method to convert ZettaJoule to YoctoJoule
/// </summary>
/// <param name="val">quantity measured in ZettaJoule</param>
/// <returns>quantity measured in YoctoJoule</returns>
public static Quantity<double, YoctoJoule> ToYoctoJoule<T>(this BaseQuantity<T, ZettaJoule> val) where T:IConvertible {
return new Quantity<double, YoctoJoule>(
Convert.ToDouble(val.Value) * 1E-21
);
}
/// <summary>
/// Extension method to convert ExaJoule to YottaJoule
/// </summary>
/// <param name="val">quantity measured in ExaJoule</param>
/// <returns>quantity measured in YottaJoule</returns>
public static Quantity<double, YottaJoule> ToYottaJoule<T>(this BaseQuantity<T, ExaJoule> val) where T:IConvertible {
return new Quantity<double, YottaJoule>(
Convert.ToDouble(val.Value) * 1E-18
);
}
/// <summary>
/// Extension method to convert ExaJoule to ZettaJoule
/// </summary>
/// <param name="val">quantity measured in ExaJoule</param>
/// <returns>quantity measured in ZettaJoule</returns>
public static Quantity<double, ZettaJoule> ToZettaJoule<T>(this BaseQuantity<T, ExaJoule> val) where T:IConvertible {
return new Quantity<double, ZettaJoule>(
Convert.ToDouble(val.Value) * 1E-18
);
}
/// <summary>
/// Extension method to convert ExaJoule to PetaJoule
/// </summary>
/// <param name="val">quantity measured in ExaJoule</param>
/// <returns>quantity measured in PetaJoule</returns>
public static Quantity<double, PetaJoule> ToPetaJoule<T>(this BaseQuantity<T, ExaJoule> val) where T:IConvertible {
return new Quantity<double, PetaJoule>(
Convert.ToDouble(val.Value) * 1E-18
);
}
/// <summary>
/// Extension method to convert ExaJoule to TeraJoule
/// </summary>
/// <param name="val">quantity measured in ExaJoule</param>
/// <returns>quantity measured in TeraJoule</returns>
public static Quantity<double, TeraJoule> ToTeraJoule<T>(this BaseQuantity<T, ExaJoule> val) where T:IConvertible {
return new Quantity<double, TeraJoule>(
Convert.ToDouble(val.Value) * 1E-18
);
}
/// <summary>
/// Extension method to convert ExaJoule to GigaJoule
/// </summary>
/// <param name="val">quantity measured in ExaJoule</param>
/// <returns>quantity measured in GigaJoule</returns>
public static Quantity<double, GigaJoule> ToGigaJoule<T>(this BaseQuantity<T, ExaJoule> val) where T:IConvertible {
return new Quantity<double, GigaJoule>(
Convert.ToDouble(val.Value) * 1E-18
);
}
/// <summary>
/// Extension method to convert ExaJoule to MegaJoule
/// </summary>
/// <param name="val">quantity measured in ExaJoule</param>
/// <returns>quantity measured in MegaJoule</returns>
public static Quantity<double, MegaJoule> ToMegaJoule<T>(this BaseQuantity<T, ExaJoule> val) where T:IConvertible {
return new Quantity<double, MegaJoule>(
Convert.ToDouble(val.Value) * 1E-18
);
}
/// <summary>
/// Extension method to convert ExaJoule to KiloJoule
/// </summary>
/// <param name="val">quantity measured in ExaJoule</param>
/// <returns>quantity measured in KiloJoule</returns>
public static Quantity<double, KiloJoule> ToKiloJoule<T>(this BaseQuantity<T, ExaJoule> val) where T:IConvertible {
return new Quantity<double, KiloJoule>(
Convert.ToDouble(val.Value) * 1E-18
);
}
/// <summary>
/// Extension method to convert ExaJoule to HectoJoule
/// </summary>
/// <param name="val">quantity measured in ExaJoule</param>
/// <returns>quantity measured in HectoJoule</returns>
public static Quantity<double, HectoJoule> ToHectoJoule<T>(this BaseQuantity<T, ExaJoule> val) where T:IConvertible {
return new Quantity<double, HectoJoule>(
Convert.ToDouble(val.Value) * 1E-18
);
}
/// <summary>
/// Extension method to convert ExaJoule to DekaJoule
/// </summary>
/// <param name="val">quantity measured in ExaJoule</param>
/// <returns>quantity measured in DekaJoule</returns>
public static Quantity<double, DekaJoule> ToDekaJoule<T>(this BaseQuantity<T, ExaJoule> val) where T:IConvertible {
return new Quantity<double, DekaJoule>(
Convert.ToDouble(val.Value) * 1E-18
);
}
/// <summary>
/// Extension method to convert ExaJoule to DeciJoule
/// </summary>
/// <param name="val">quantity measured in ExaJoule</param>
/// <returns>quantity measured in DeciJoule</returns>
public static Quantity<double, DeciJoule> ToDeciJoule<T>(this BaseQuantity<T, ExaJoule> val) where T:IConvertible {
return new Quantity<double, DeciJoule>(
Convert.ToDouble(val.Value) * 1E-18
);
}
/// <summary>
/// Extension method to convert ExaJoule to CentiJoule
/// </summary>
/// <param name="val">quantity measured in ExaJoule</param>
/// <returns>quantity measured in CentiJoule</returns>
public static Quantity<double, CentiJoule> ToCentiJoule<T>(this BaseQuantity<T, ExaJoule> val) where T:IConvertible {
return new Quantity<double, CentiJoule>(
Convert.ToDouble(val.Value) * 1E-18
);
}
/// <summary>
/// Extension method to convert ExaJoule to MilliJoule
/// </summary>
/// <param name="val">quantity measured in ExaJoule</param>
/// <returns>quantity measured in MilliJoule</returns>
public static Quantity<double, MilliJoule> ToMilliJoule<T>(this BaseQuantity<T, ExaJoule> val) where T:IConvertible {
return new Quantity<double, MilliJoule>(
Convert.ToDouble(val.Value) * 1E-18
);
}
/// <summary>
/// Extension method to convert ExaJoule to MicroJoule
/// </summary>
/// <param name="val">quantity measured in ExaJoule</param>
/// <returns>quantity measured in MicroJoule</returns>
public static Quantity<double, MicroJoule> ToMicroJoule<T>(this BaseQuantity<T, ExaJoule> val) where T:IConvertible {
return new Quantity<double, MicroJoule>(
Convert.ToDouble(val.Value) * 1E-18
);
}
/// <summary>
/// Extension method to convert ExaJoule to NanoJoule
/// </summary>
/// <param name="val">quantity measured in ExaJoule</param>
/// <returns>quantity measured in NanoJoule</returns>
public static Quantity<double, NanoJoule> ToNanoJoule<T>(this BaseQuantity<T, ExaJoule> val) where T:IConvertible {
return new Quantity<double, NanoJoule>(
Convert.ToDouble(val.Value) * 1E-18
);
}
/// <summary>
/// Extension method to convert ExaJoule to PicoJoule
/// </summary>
/// <param name="val">quantity measured in ExaJoule</param>
/// <returns>quantity measured in PicoJoule</returns>
public static Quantity<double, PicoJoule> ToPicoJoule<T>(this BaseQuantity<T, ExaJoule> val) where T:IConvertible {
return new Quantity<double, PicoJoule>(
Convert.ToDouble(val.Value) * 1E-18
);
}
/// <summary>
/// Extension method to convert ExaJoule to FemtoJoule
/// </summary>
/// <param name="val">quantity measured in ExaJoule</param>
/// <returns>quantity measured in FemtoJoule</returns>
public static Quantity<double, FemtoJoule> ToFemtoJoule<T>(this BaseQuantity<T, ExaJoule> val) where T:IConvertible {
return new Quantity<double, FemtoJoule>(
Convert.ToDouble(val.Value) * 1E-18
);
}
/// <summary>
/// Extension method to convert ExaJoule to AttoJoule
/// </summary>
/// <param name="val">quantity measured in ExaJoule</param>
/// <returns>quantity measured in AttoJoule</returns>
public static Quantity<double, AttoJoule> ToAttoJoule<T>(this BaseQuantity<T, ExaJoule> val) where T:IConvertible {
return new Quantity<double, AttoJoule>(
Convert.ToDouble(val.Value) * 1E-18
);
}
/// <summary>
/// Extension method to convert ExaJoule to ZeptoJoule
/// </summary>
/// <param name="val">quantity measured in ExaJoule</param>
/// <returns>quantity measured in ZeptoJoule</returns>
public static Quantity<double, ZeptoJoule> ToZeptoJoule<T>(this BaseQuantity<T, ExaJoule> val) where T:IConvertible {
return new Quantity<double, ZeptoJoule>(
Convert.ToDouble(val.Value) * 1E-18
);
}
/// <summary>
/// Extension method to convert ExaJoule to YoctoJoule
/// </summary>
/// <param name="val">quantity measured in ExaJoule</param>
/// <returns>quantity measured in YoctoJoule</returns>
public static Quantity<double, YoctoJoule> ToYoctoJoule<T>(this BaseQuantity<T, ExaJoule> val) where T:IConvertible {
return new Quantity<double, YoctoJoule>(
Convert.ToDouble(val.Value) * 1E-18
);
}
/// <summary>
/// Extension method to convert PetaJoule to YottaJoule
/// </summary>
/// <param name="val">quantity measured in PetaJoule</param>
/// <returns>quantity measured in YottaJoule</returns>
public static Quantity<double, YottaJoule> ToYottaJoule<T>(this BaseQuantity<T, PetaJoule> val) where T:IConvertible {
return new Quantity<double, YottaJoule>(
Convert.ToDouble(val.Value) * 1E-15
);
}
/// <summary>
/// Extension method to convert PetaJoule to ZettaJoule
/// </summary>
/// <param name="val">quantity measured in PetaJoule</param>
/// <returns>quantity measured in ZettaJoule</returns>
public static Quantity<double, ZettaJoule> ToZettaJoule<T>(this BaseQuantity<T, PetaJoule> val) where T:IConvertible {
return new Quantity<double, ZettaJoule>(
Convert.ToDouble(val.Value) * 1E-15
);
}
/// <summary>
/// Extension method to convert PetaJoule to ExaJoule
/// </summary>
/// <param name="val">quantity measured in PetaJoule</param>
/// <returns>quantity measured in ExaJoule</returns>
public static Quantity<double, ExaJoule> ToExaJoule<T>(this BaseQuantity<T, PetaJoule> val) where T:IConvertible {
return new Quantity<double, ExaJoule>(
Convert.ToDouble(val.Value) * 1E-15
);
}
/// <summary>
/// Extension method to convert PetaJoule to TeraJoule
/// </summary>
/// <param name="val">quantity measured in PetaJoule</param>
/// <returns>quantity measured in TeraJoule</returns>
public static Quantity<double, TeraJoule> ToTeraJoule<T>(this BaseQuantity<T, PetaJoule> val) where T:IConvertible {
return new Quantity<double, TeraJoule>(
Convert.ToDouble(val.Value) * 1E-15
);
}
/// <summary>
/// Extension method to convert PetaJoule to GigaJoule
/// </summary>
/// <param name="val">quantity measured in PetaJoule</param>
/// <returns>quantity measured in GigaJoule</returns>
public static Quantity<double, GigaJoule> ToGigaJoule<T>(this BaseQuantity<T, PetaJoule> val) where T:IConvertible {
return new Quantity<double, GigaJoule>(
Convert.ToDouble(val.Value) * 1E-15
);
}
/// <summary>
/// Extension method to convert PetaJoule to MegaJoule
/// </summary>
/// <param name="val">quantity measured in PetaJoule</param>
/// <returns>quantity measured in MegaJoule</returns>
public static Quantity<double, MegaJoule> ToMegaJoule<T>(this BaseQuantity<T, PetaJoule> val) where T:IConvertible {
return new Quantity<double, MegaJoule>(
Convert.ToDouble(val.Value) * 1E-15
);
}
/// <summary>
/// Extension method to convert PetaJoule to KiloJoule
/// </summary>
/// <param name="val">quantity measured in PetaJoule</param>
/// <returns>quantity measured in KiloJoule</returns>
public static Quantity<double, KiloJoule> ToKiloJoule<T>(this BaseQuantity<T, PetaJoule> val) where T:IConvertible {
return new Quantity<double, KiloJoule>(
Convert.ToDouble(val.Value) * 1E-15
);
}
/// <summary>
/// Extension method to convert PetaJoule to HectoJoule
/// </summary>
/// <param name="val">quantity measured in PetaJoule</param>
/// <returns>quantity measured in HectoJoule</returns>
public static Quantity<double, HectoJoule> ToHectoJoule<T>(this BaseQuantity<T, PetaJoule> val) where T:IConvertible {
return new Quantity<double, HectoJoule>(
Convert.ToDouble(val.Value) * 1E-15
);
}
/// <summary>
/// Extension method to convert PetaJoule to DekaJoule
/// </summary>
/// <param name="val">quantity measured in PetaJoule</param>
/// <returns>quantity measured in DekaJoule</returns>
public static Quantity<double, DekaJoule> ToDekaJoule<T>(this BaseQuantity<T, PetaJoule> val) where T:IConvertible {
return new Quantity<double, DekaJoule>(
Convert.ToDouble(val.Value) * 1E-15
);
}
/// <summary>
/// Extension method to convert PetaJoule to DeciJoule
/// </summary>
/// <param name="val">quantity measured in PetaJoule</param>
/// <returns>quantity measured in DeciJoule</returns>
public static Quantity<double, DeciJoule> ToDeciJoule<T>(this BaseQuantity<T, PetaJoule> val) where T:IConvertible {
return new Quantity<double, DeciJoule>(
Convert.ToDouble(val.Value) * 1E-15
);
}
/// <summary>
/// Extension method to convert PetaJoule to CentiJoule
/// </summary>
/// <param name="val">quantity measured in PetaJoule</param>
/// <returns>quantity measured in CentiJoule</returns>
public static Quantity<double, CentiJoule> ToCentiJoule<T>(this BaseQuantity<T, PetaJoule> val) where T:IConvertible {
return new Quantity<double, CentiJoule>(
Convert.ToDouble(val.Value) * 1E-15
);
}
/// <summary>
/// Extension method to convert PetaJoule to MilliJoule
/// </summary>
/// <param name="val">quantity measured in PetaJoule</param>
/// <returns>quantity measured in MilliJoule</returns>
public static Quantity<double, MilliJoule> ToMilliJoule<T>(this BaseQuantity<T, PetaJoule> val) where T:IConvertible {
return new Quantity<double, MilliJoule>(
Convert.ToDouble(val.Value) * 1E-15
);
}
/// <summary>
/// Extension method to convert PetaJoule to MicroJoule
/// </summary>
/// <param name="val">quantity measured in PetaJoule</param>
/// <returns>quantity measured in MicroJoule</returns>
public static Quantity<double, MicroJoule> ToMicroJoule<T>(this BaseQuantity<T, PetaJoule> val) where T:IConvertible {
return new Quantity<double, MicroJoule>(
Convert.ToDouble(val.Value) * 1E-15
);
}
/// <summary>
/// Extension method to convert PetaJoule to NanoJoule
/// </summary>
/// <param name="val">quantity measured in PetaJoule</param>
/// <returns>quantity measured in NanoJoule</returns>
public static Quantity<double, NanoJoule> ToNanoJoule<T>(this BaseQuantity<T, PetaJoule> val) where T:IConvertible {
return new Quantity<double, NanoJoule>(
Convert.ToDouble(val.Value) * 1E-15
);
}
/// <summary>
/// Extension method to convert PetaJoule to PicoJoule
/// </summary>
/// <param name="val">quantity measured in PetaJoule</param>
/// <returns>quantity measured in PicoJoule</returns>
public static Quantity<double, PicoJoule> ToPicoJoule<T>(this BaseQuantity<T, PetaJoule> val) where T:IConvertible {
return new Quantity<double, PicoJoule>(
Convert.ToDouble(val.Value) * 1E-15
);
}
/// <summary>
/// Extension method to convert PetaJoule to FemtoJoule
/// </summary>
/// <param name="val">quantity measured in PetaJoule</param>
/// <returns>quantity measured in FemtoJoule</returns>
public static Quantity<double, FemtoJoule> ToFemtoJoule<T>(this BaseQuantity<T, PetaJoule> val) where T:IConvertible {
return new Quantity<double, FemtoJoule>(
Convert.ToDouble(val.Value) * 1E-15
);
}
/// <summary>
/// Extension method to convert PetaJoule to AttoJoule
/// </summary>
/// <param name="val">quantity measured in PetaJoule</param>
/// <returns>quantity measured in AttoJoule</returns>
public static Quantity<double, AttoJoule> ToAttoJoule<T>(this BaseQuantity<T, PetaJoule> val) where T:IConvertible {
return new Quantity<double, AttoJoule>(
Convert.ToDouble(val.Value) * 1E-15
);
}
/// <summary>
/// Extension method to convert PetaJoule to ZeptoJoule
/// </summary>
/// <param name="val">quantity measured in PetaJoule</param>
/// <returns>quantity measured in ZeptoJoule</returns>
public static Quantity<double, ZeptoJoule> ToZeptoJoule<T>(this BaseQuantity<T, PetaJoule> val) where T:IConvertible {
return new Quantity<double, ZeptoJoule>(
Convert.ToDouble(val.Value) * 1E-15
);
}
/// <summary>
/// Extension method to convert PetaJoule to YoctoJoule
/// </summary>
/// <param name="val">quantity measured in PetaJoule</param>
/// <returns>quantity measured in YoctoJoule</returns>
public static Quantity<double, YoctoJoule> ToYoctoJoule<T>(this BaseQuantity<T, PetaJoule> val) where T:IConvertible {
return new Quantity<double, YoctoJoule>(
Convert.ToDouble(val.Value) * 1E-15
);
}
/// <summary>
/// Extension method to convert TeraJoule to YottaJoule
/// </summary>
/// <param name="val">quantity measured in TeraJoule</param>
/// <returns>quantity measured in YottaJoule</returns>
public static Quantity<double, YottaJoule> ToYottaJoule<T>(this BaseQuantity<T, TeraJoule> val) where T:IConvertible {
return new Quantity<double, YottaJoule>(
Convert.ToDouble(val.Value) * 1E-12
);
}
/// <summary>
/// Extension method to convert TeraJoule to ZettaJoule
/// </summary>
/// <param name="val">quantity measured in TeraJoule</param>
/// <returns>quantity measured in ZettaJoule</returns>
public static Quantity<double, ZettaJoule> ToZettaJoule<T>(this BaseQuantity<T, TeraJoule> val) where T:IConvertible {
return new Quantity<double, ZettaJoule>(
Convert.ToDouble(val.Value) * 1E-12
);
}
/// <summary>
/// Extension method to convert TeraJoule to ExaJoule
/// </summary>
/// <param name="val">quantity measured in TeraJoule</param>
/// <returns>quantity measured in ExaJoule</returns>
public static Quantity<double, ExaJoule> ToExaJoule<T>(this BaseQuantity<T, TeraJoule> val) where T:IConvertible {
return new Quantity<double, ExaJoule>(
Convert.ToDouble(val.Value) * 1E-12
);
}
/// <summary>
/// Extension method to convert TeraJoule to PetaJoule
/// </summary>
/// <param name="val">quantity measured in TeraJoule</param>
/// <returns>quantity measured in PetaJoule</returns>
public static Quantity<double, PetaJoule> ToPetaJoule<T>(this BaseQuantity<T, TeraJoule> val) where T:IConvertible {
return new Quantity<double, PetaJoule>(
Convert.ToDouble(val.Value) * 1E-12
);
}
/// <summary>
/// Extension method to convert TeraJoule to GigaJoule
/// </summary>
/// <param name="val">quantity measured in TeraJoule</param>
/// <returns>quantity measured in GigaJoule</returns>
public static Quantity<double, GigaJoule> ToGigaJoule<T>(this BaseQuantity<T, TeraJoule> val) where T:IConvertible {
return new Quantity<double, GigaJoule>(
Convert.ToDouble(val.Value) * 1E-12
);
}
/// <summary>
/// Extension method to convert TeraJoule to MegaJoule
/// </summary>
/// <param name="val">quantity measured in TeraJoule</param>
/// <returns>quantity measured in MegaJoule</returns>
public static Quantity<double, MegaJoule> ToMegaJoule<T>(this BaseQuantity<T, TeraJoule> val) where T:IConvertible {
return new Quantity<double, MegaJoule>(
Convert.ToDouble(val.Value) * 1E-12
);
}
/// <summary>
/// Extension method to convert TeraJoule to KiloJoule
/// </summary>
/// <param name="val">quantity measured in TeraJoule</param>
/// <returns>quantity measured in KiloJoule</returns>
public static Quantity<double, KiloJoule> ToKiloJoule<T>(this BaseQuantity<T, TeraJoule> val) where T:IConvertible {
return new Quantity<double, KiloJoule>(
Convert.ToDouble(val.Value) * 1E-12
);
}
/// <summary>
/// Extension method to convert TeraJoule to HectoJoule
/// </summary>
/// <param name="val">quantity measured in TeraJoule</param>
/// <returns>quantity measured in HectoJoule</returns>
public static Quantity<double, HectoJoule> ToHectoJoule<T>(this BaseQuantity<T, TeraJoule> val) where T:IConvertible {
return new Quantity<double, HectoJoule>(
Convert.ToDouble(val.Value) * 1E-12
);
}
/// <summary>
/// Extension method to convert TeraJoule to DekaJoule
/// </summary>
/// <param name="val">quantity measured in TeraJoule</param>
/// <returns>quantity measured in DekaJoule</returns>
public static Quantity<double, DekaJoule> ToDekaJoule<T>(this BaseQuantity<T, TeraJoule> val) where T:IConvertible {
return new Quantity<double, DekaJoule>(
Convert.ToDouble(val.Value) * 1E-12
);
}
/// <summary>
/// Extension method to convert TeraJoule to DeciJoule
/// </summary>
/// <param name="val">quantity measured in TeraJoule</param>
/// <returns>quantity measured in DeciJoule</returns>
public static Quantity<double, DeciJoule> ToDeciJoule<T>(this BaseQuantity<T, TeraJoule> val) where T:IConvertible {
return new Quantity<double, DeciJoule>(
Convert.ToDouble(val.Value) * 1E-12
);
}
/// <summary>
/// Extension method to convert TeraJoule to CentiJoule
/// </summary>
/// <param name="val">quantity measured in TeraJoule</param>
/// <returns>quantity measured in CentiJoule</returns>
public static Quantity<double, CentiJoule> ToCentiJoule<T>(this BaseQuantity<T, TeraJoule> val) where T:IConvertible {
return new Quantity<double, CentiJoule>(
Convert.ToDouble(val.Value) * 1E-12
);
}
/// <summary>
/// Extension method to convert TeraJoule to MilliJoule
/// </summary>
/// <param name="val">quantity measured in TeraJoule</param>
/// <returns>quantity measured in MilliJoule</returns>
public static Quantity<double, MilliJoule> ToMilliJoule<T>(this BaseQuantity<T, TeraJoule> val) where T:IConvertible {
return new Quantity<double, MilliJoule>(
Convert.ToDouble(val.Value) * 1E-12
);
}
/// <summary>
/// Extension method to convert TeraJoule to MicroJoule
/// </summary>
/// <param name="val">quantity measured in TeraJoule</param>
/// <returns>quantity measured in MicroJoule</returns>
public static Quantity<double, MicroJoule> ToMicroJoule<T>(this BaseQuantity<T, TeraJoule> val) where T:IConvertible {
return new Quantity<double, MicroJoule>(
Convert.ToDouble(val.Value) * 1E-12
);
}
/// <summary>
/// Extension method to convert TeraJoule to NanoJoule
/// </summary>
/// <param name="val">quantity measured in TeraJoule</param>
/// <returns>quantity measured in NanoJoule</returns>
public static Quantity<double, NanoJoule> ToNanoJoule<T>(this BaseQuantity<T, TeraJoule> val) where T:IConvertible {
return new Quantity<double, NanoJoule>(
Convert.ToDouble(val.Value) * 1E-12
);
}
/// <summary>
/// Extension method to convert TeraJoule to PicoJoule
/// </summary>
/// <param name="val">quantity measured in TeraJoule</param>
/// <returns>quantity measured in PicoJoule</returns>
public static Quantity<double, PicoJoule> ToPicoJoule<T>(this BaseQuantity<T, TeraJoule> val) where T:IConvertible {
return new Quantity<double, PicoJoule>(
Convert.ToDouble(val.Value) * 1E-12
);
}
/// <summary>
/// Extension method to convert TeraJoule to FemtoJoule
/// </summary>
/// <param name="val">quantity measured in TeraJoule</param>
/// <returns>quantity measured in FemtoJoule</returns>
public static Quantity<double, FemtoJoule> ToFemtoJoule<T>(this BaseQuantity<T, TeraJoule> val) where T:IConvertible {
return new Quantity<double, FemtoJoule>(
Convert.ToDouble(val.Value) * 1E-12
);
}
/// <summary>
/// Extension method to convert TeraJoule to AttoJoule
/// </summary>
/// <param name="val">quantity measured in TeraJoule</param>
/// <returns>quantity measured in AttoJoule</returns>
public static Quantity<double, AttoJoule> ToAttoJoule<T>(this BaseQuantity<T, TeraJoule> val) where T:IConvertible {
return new Quantity<double, AttoJoule>(
Convert.ToDouble(val.Value) * 1E-12
);
}
/// <summary>
/// Extension method to convert TeraJoule to ZeptoJoule
/// </summary>
/// <param name="val">quantity measured in TeraJoule</param>
/// <returns>quantity measured in ZeptoJoule</returns>
public static Quantity<double, ZeptoJoule> ToZeptoJoule<T>(this BaseQuantity<T, TeraJoule> val) where T:IConvertible {
return new Quantity<double, ZeptoJoule>(
Convert.ToDouble(val.Value) * 1E-12
);
}
/// <summary>
/// Extension method to convert TeraJoule to YoctoJoule
/// </summary>
/// <param name="val">quantity measured in TeraJoule</param>
/// <returns>quantity measured in YoctoJoule</returns>
public static Quantity<double, YoctoJoule> ToYoctoJoule<T>(this BaseQuantity<T, TeraJoule> val) where T:IConvertible {
return new Quantity<double, YoctoJoule>(
Convert.ToDouble(val.Value) * 1E-12
);
}
/// <summary>
/// Extension method to convert GigaJoule to YottaJoule
/// </summary>
/// <param name="val">quantity measured in GigaJoule</param>
/// <returns>quantity measured in YottaJoule</returns>
public static Quantity<double, YottaJoule> ToYottaJoule<T>(this BaseQuantity<T, GigaJoule> val) where T:IConvertible {
return new Quantity<double, YottaJoule>(
Convert.ToDouble(val.Value) * 1E-9
);
}
/// <summary>
/// Extension method to convert GigaJoule to ZettaJoule
/// </summary>
/// <param name="val">quantity measured in GigaJoule</param>
/// <returns>quantity measured in ZettaJoule</returns>
public static Quantity<double, ZettaJoule> ToZettaJoule<T>(this BaseQuantity<T, GigaJoule> val) where T:IConvertible {
return new Quantity<double, ZettaJoule>(
Convert.ToDouble(val.Value) * 1E-9
);
}
/// <summary>
/// Extension method to convert GigaJoule to ExaJoule
/// </summary>
/// <param name="val">quantity measured in GigaJoule</param>
/// <returns>quantity measured in ExaJoule</returns>
public static Quantity<double, ExaJoule> ToExaJoule<T>(this BaseQuantity<T, GigaJoule> val) where T:IConvertible {
return new Quantity<double, ExaJoule>(
Convert.ToDouble(val.Value) * 1E-9
);
}
/// <summary>
/// Extension method to convert GigaJoule to PetaJoule
/// </summary>
/// <param name="val">quantity measured in GigaJoule</param>
/// <returns>quantity measured in PetaJoule</returns>
public static Quantity<double, PetaJoule> ToPetaJoule<T>(this BaseQuantity<T, GigaJoule> val) where T:IConvertible {
return new Quantity<double, PetaJoule>(
Convert.ToDouble(val.Value) * 1E-9
);
}
/// <summary>
/// Extension method to convert GigaJoule to TeraJoule
/// </summary>
/// <param name="val">quantity measured in GigaJoule</param>
/// <returns>quantity measured in TeraJoule</returns>
public static Quantity<double, TeraJoule> ToTeraJoule<T>(this BaseQuantity<T, GigaJoule> val) where T:IConvertible {
return new Quantity<double, TeraJoule>(
Convert.ToDouble(val.Value) * 1E-9
);
}
/// <summary>
/// Extension method to convert GigaJoule to MegaJoule
/// </summary>
/// <param name="val">quantity measured in GigaJoule</param>
/// <returns>quantity measured in MegaJoule</returns>
public static Quantity<double, MegaJoule> ToMegaJoule<T>(this BaseQuantity<T, GigaJoule> val) where T:IConvertible {
return new Quantity<double, MegaJoule>(
Convert.ToDouble(val.Value) * 1E-9
);
}
/// <summary>
/// Extension method to convert GigaJoule to KiloJoule
/// </summary>
/// <param name="val">quantity measured in GigaJoule</param>
/// <returns>quantity measured in KiloJoule</returns>
public static Quantity<double, KiloJoule> ToKiloJoule<T>(this BaseQuantity<T, GigaJoule> val) where T:IConvertible {
return new Quantity<double, KiloJoule>(
Convert.ToDouble(val.Value) * 1E-9
);
}
/// <summary>
/// Extension method to convert GigaJoule to HectoJoule
/// </summary>
/// <param name="val">quantity measured in GigaJoule</param>
/// <returns>quantity measured in HectoJoule</returns>
public static Quantity<double, HectoJoule> ToHectoJoule<T>(this BaseQuantity<T, GigaJoule> val) where T:IConvertible {
return new Quantity<double, HectoJoule>(
Convert.ToDouble(val.Value) * 1E-9
);
}
/// <summary>
/// Extension method to convert GigaJoule to DekaJoule
/// </summary>
/// <param name="val">quantity measured in GigaJoule</param>
/// <returns>quantity measured in DekaJoule</returns>
public static Quantity<double, DekaJoule> ToDekaJoule<T>(this BaseQuantity<T, GigaJoule> val) where T:IConvertible {
return new Quantity<double, DekaJoule>(
Convert.ToDouble(val.Value) * 1E-9
);
}
/// <summary>
/// Extension method to convert GigaJoule to DeciJoule
/// </summary>
/// <param name="val">quantity measured in GigaJoule</param>
/// <returns>quantity measured in DeciJoule</returns>
public static Quantity<double, DeciJoule> ToDeciJoule<T>(this BaseQuantity<T, GigaJoule> val) where T:IConvertible {
return new Quantity<double, DeciJoule>(
Convert.ToDouble(val.Value) * 1E-9
);
}
/// <summary>
/// Extension method to convert GigaJoule to CentiJoule
/// </summary>
/// <param name="val">quantity measured in GigaJoule</param>
/// <returns>quantity measured in CentiJoule</returns>
public static Quantity<double, CentiJoule> ToCentiJoule<T>(this BaseQuantity<T, GigaJoule> val) where T:IConvertible {
return new Quantity<double, CentiJoule>(
Convert.ToDouble(val.Value) * 1E-9
);
}
/// <summary>
/// Extension method to convert GigaJoule to MilliJoule
/// </summary>
/// <param name="val">quantity measured in GigaJoule</param>
/// <returns>quantity measured in MilliJoule</returns>
public static Quantity<double, MilliJoule> ToMilliJoule<T>(this BaseQuantity<T, GigaJoule> val) where T:IConvertible {
return new Quantity<double, MilliJoule>(
Convert.ToDouble(val.Value) * 1E-9
);
}
/// <summary>
/// Extension method to convert GigaJoule to MicroJoule
/// </summary>
/// <param name="val">quantity measured in GigaJoule</param>
/// <returns>quantity measured in MicroJoule</returns>
public static Quantity<double, MicroJoule> ToMicroJoule<T>(this BaseQuantity<T, GigaJoule> val) where T:IConvertible {
return new Quantity<double, MicroJoule>(
Convert.ToDouble(val.Value) * 1E-9
);
}
/// <summary>
/// Extension method to convert GigaJoule to NanoJoule
/// </summary>
/// <param name="val">quantity measured in GigaJoule</param>
/// <returns>quantity measured in NanoJoule</returns>
public static Quantity<double, NanoJoule> ToNanoJoule<T>(this BaseQuantity<T, GigaJoule> val) where T:IConvertible {
return new Quantity<double, NanoJoule>(
Convert.ToDouble(val.Value) * 1E-9
);
}
/// <summary>
/// Extension method to convert GigaJoule to PicoJoule
/// </summary>
/// <param name="val">quantity measured in GigaJoule</param>
/// <returns>quantity measured in PicoJoule</returns>
public static Quantity<double, PicoJoule> ToPicoJoule<T>(this BaseQuantity<T, GigaJoule> val) where T:IConvertible {
return new Quantity<double, PicoJoule>(
Convert.ToDouble(val.Value) * 1E-9
);
}
/// <summary>
/// Extension method to convert GigaJoule to FemtoJoule
/// </summary>
/// <param name="val">quantity measured in GigaJoule</param>
/// <returns>quantity measured in FemtoJoule</returns>
public static Quantity<double, FemtoJoule> ToFemtoJoule<T>(this BaseQuantity<T, GigaJoule> val) where T:IConvertible {
return new Quantity<double, FemtoJoule>(
Convert.ToDouble(val.Value) * 1E-9
);
}
/// <summary>
/// Extension method to convert GigaJoule to AttoJoule
/// </summary>
/// <param name="val">quantity measured in GigaJoule</param>
/// <returns>quantity measured in AttoJoule</returns>
public static Quantity<double, AttoJoule> ToAttoJoule<T>(this BaseQuantity<T, GigaJoule> val) where T:IConvertible {
return new Quantity<double, AttoJoule>(
Convert.ToDouble(val.Value) * 1E-9
);
}
/// <summary>
/// Extension method to convert GigaJoule to ZeptoJoule
/// </summary>
/// <param name="val">quantity measured in GigaJoule</param>
/// <returns>quantity measured in ZeptoJoule</returns>
public static Quantity<double, ZeptoJoule> ToZeptoJoule<T>(this BaseQuantity<T, GigaJoule> val) where T:IConvertible {
return new Quantity<double, ZeptoJoule>(
Convert.ToDouble(val.Value) * 1E-9
);
}
/// <summary>
/// Extension method to convert GigaJoule to YoctoJoule
/// </summary>
/// <param name="val">quantity measured in GigaJoule</param>
/// <returns>quantity measured in YoctoJoule</returns>
public static Quantity<double, YoctoJoule> ToYoctoJoule<T>(this BaseQuantity<T, GigaJoule> val) where T:IConvertible {
return new Quantity<double, YoctoJoule>(
Convert.ToDouble(val.Value) * 1E-9
);
}
/// <summary>
/// Extension method to convert MegaJoule to YottaJoule
/// </summary>
/// <param name="val">quantity measured in MegaJoule</param>
/// <returns>quantity measured in YottaJoule</returns>
public static Quantity<double, YottaJoule> ToYottaJoule<T>(this BaseQuantity<T, MegaJoule> val) where T:IConvertible {
return new Quantity<double, YottaJoule>(
Convert.ToDouble(val.Value) * 1E-6
);
}
/// <summary>
/// Extension method to convert MegaJoule to ZettaJoule
/// </summary>
/// <param name="val">quantity measured in MegaJoule</param>
/// <returns>quantity measured in ZettaJoule</returns>
public static Quantity<double, ZettaJoule> ToZettaJoule<T>(this BaseQuantity<T, MegaJoule> val) where T:IConvertible {
return new Quantity<double, ZettaJoule>(
Convert.ToDouble(val.Value) * 1E-6
);
}
/// <summary>
/// Extension method to convert MegaJoule to ExaJoule
/// </summary>
/// <param name="val">quantity measured in MegaJoule</param>
/// <returns>quantity measured in ExaJoule</returns>
public static Quantity<double, ExaJoule> ToExaJoule<T>(this BaseQuantity<T, MegaJoule> val) where T:IConvertible {
return new Quantity<double, ExaJoule>(
Convert.ToDouble(val.Value) * 1E-6
);
}
/// <summary>
/// Extension method to convert MegaJoule to PetaJoule
/// </summary>
/// <param name="val">quantity measured in MegaJoule</param>
/// <returns>quantity measured in PetaJoule</returns>
public static Quantity<double, PetaJoule> ToPetaJoule<T>(this BaseQuantity<T, MegaJoule> val) where T:IConvertible {
return new Quantity<double, PetaJoule>(
Convert.ToDouble(val.Value) * 1E-6
);
}
/// <summary>
/// Extension method to convert MegaJoule to TeraJoule
/// </summary>
/// <param name="val">quantity measured in MegaJoule</param>
/// <returns>quantity measured in TeraJoule</returns>
public static Quantity<double, TeraJoule> ToTeraJoule<T>(this BaseQuantity<T, MegaJoule> val) where T:IConvertible {
return new Quantity<double, TeraJoule>(
Convert.ToDouble(val.Value) * 1E-6
);
}
/// <summary>
/// Extension method to convert MegaJoule to GigaJoule
/// </summary>
/// <param name="val">quantity measured in MegaJoule</param>
/// <returns>quantity measured in GigaJoule</returns>
public static Quantity<double, GigaJoule> ToGigaJoule<T>(this BaseQuantity<T, MegaJoule> val) where T:IConvertible {
return new Quantity<double, GigaJoule>(
Convert.ToDouble(val.Value) * 1E-6
);
}
/// <summary>
/// Extension method to convert MegaJoule to KiloJoule
/// </summary>
/// <param name="val">quantity measured in MegaJoule</param>
/// <returns>quantity measured in KiloJoule</returns>
public static Quantity<double, KiloJoule> ToKiloJoule<T>(this BaseQuantity<T, MegaJoule> val) where T:IConvertible {
return new Quantity<double, KiloJoule>(
Convert.ToDouble(val.Value) * 1E-6
);
}
/// <summary>
/// Extension method to convert MegaJoule to HectoJoule
/// </summary>
/// <param name="val">quantity measured in MegaJoule</param>
/// <returns>quantity measured in HectoJoule</returns>
public static Quantity<double, HectoJoule> ToHectoJoule<T>(this BaseQuantity<T, MegaJoule> val) where T:IConvertible {
return new Quantity<double, HectoJoule>(
Convert.ToDouble(val.Value) * 1E-6
);
}
/// <summary>
/// Extension method to convert MegaJoule to DekaJoule
/// </summary>
/// <param name="val">quantity measured in MegaJoule</param>
/// <returns>quantity measured in DekaJoule</returns>
public static Quantity<double, DekaJoule> ToDekaJoule<T>(this BaseQuantity<T, MegaJoule> val) where T:IConvertible {
return new Quantity<double, DekaJoule>(
Convert.ToDouble(val.Value) * 1E-6
);
}
/// <summary>
/// Extension method to convert MegaJoule to DeciJoule
/// </summary>
/// <param name="val">quantity measured in MegaJoule</param>
/// <returns>quantity measured in DeciJoule</returns>
public static Quantity<double, DeciJoule> ToDeciJoule<T>(this BaseQuantity<T, MegaJoule> val) where T:IConvertible {
return new Quantity<double, DeciJoule>(
Convert.ToDouble(val.Value) * 1E-6
);
}
/// <summary>
/// Extension method to convert MegaJoule to CentiJoule
/// </summary>
/// <param name="val">quantity measured in MegaJoule</param>
/// <returns>quantity measured in CentiJoule</returns>
public static Quantity<double, CentiJoule> ToCentiJoule<T>(this BaseQuantity<T, MegaJoule> val) where T:IConvertible {
return new Quantity<double, CentiJoule>(
Convert.ToDouble(val.Value) * 1E-6
);
}
/// <summary>
/// Extension method to convert MegaJoule to MilliJoule
/// </summary>
/// <param name="val">quantity measured in MegaJoule</param>
/// <returns>quantity measured in MilliJoule</returns>
public static Quantity<double, MilliJoule> ToMilliJoule<T>(this BaseQuantity<T, MegaJoule> val) where T:IConvertible {
return new Quantity<double, MilliJoule>(
Convert.ToDouble(val.Value) * 1E-6
);
}
/// <summary>
/// Extension method to convert MegaJoule to MicroJoule
/// </summary>
/// <param name="val">quantity measured in MegaJoule</param>
/// <returns>quantity measured in MicroJoule</returns>
public static Quantity<double, MicroJoule> ToMicroJoule<T>(this BaseQuantity<T, MegaJoule> val) where T:IConvertible {
return new Quantity<double, MicroJoule>(
Convert.ToDouble(val.Value) * 1E-6
);
}
/// <summary>
/// Extension method to convert MegaJoule to NanoJoule
/// </summary>
/// <param name="val">quantity measured in MegaJoule</param>
/// <returns>quantity measured in NanoJoule</returns>
public static Quantity<double, NanoJoule> ToNanoJoule<T>(this BaseQuantity<T, MegaJoule> val) where T:IConvertible {
return new Quantity<double, NanoJoule>(
Convert.ToDouble(val.Value) * 1E-6
);
}
/// <summary>
/// Extension method to convert MegaJoule to PicoJoule
/// </summary>
/// <param name="val">quantity measured in MegaJoule</param>
/// <returns>quantity measured in PicoJoule</returns>
public static Quantity<double, PicoJoule> ToPicoJoule<T>(this BaseQuantity<T, MegaJoule> val) where T:IConvertible {
return new Quantity<double, PicoJoule>(
Convert.ToDouble(val.Value) * 1E-6
);
}
/// <summary>
/// Extension method to convert MegaJoule to FemtoJoule
/// </summary>
/// <param name="val">quantity measured in MegaJoule</param>
/// <returns>quantity measured in FemtoJoule</returns>
public static Quantity<double, FemtoJoule> ToFemtoJoule<T>(this BaseQuantity<T, MegaJoule> val) where T:IConvertible {
return new Quantity<double, FemtoJoule>(
Convert.ToDouble(val.Value) * 1E-6
);
}
/// <summary>
/// Extension method to convert MegaJoule to AttoJoule
/// </summary>
/// <param name="val">quantity measured in MegaJoule</param>
/// <returns>quantity measured in AttoJoule</returns>
public static Quantity<double, AttoJoule> ToAttoJoule<T>(this BaseQuantity<T, MegaJoule> val) where T:IConvertible {
return new Quantity<double, AttoJoule>(
Convert.ToDouble(val.Value) * 1E-6
);
}
/// <summary>
/// Extension method to convert MegaJoule to ZeptoJoule
/// </summary>
/// <param name="val">quantity measured in MegaJoule</param>
/// <returns>quantity measured in ZeptoJoule</returns>
public static Quantity<double, ZeptoJoule> ToZeptoJoule<T>(this BaseQuantity<T, MegaJoule> val) where T:IConvertible {
return new Quantity<double, ZeptoJoule>(
Convert.ToDouble(val.Value) * 1E-6
);
}
/// <summary>
/// Extension method to convert MegaJoule to YoctoJoule
/// </summary>
/// <param name="val">quantity measured in MegaJoule</param>
/// <returns>quantity measured in YoctoJoule</returns>
public static Quantity<double, YoctoJoule> ToYoctoJoule<T>(this BaseQuantity<T, MegaJoule> val) where T:IConvertible {
return new Quantity<double, YoctoJoule>(
Convert.ToDouble(val.Value) * 1E-6
);
}
/// <summary>
/// Extension method to convert KiloJoule to YottaJoule
/// </summary>
/// <param name="val">quantity measured in KiloJoule</param>
/// <returns>quantity measured in YottaJoule</returns>
public static Quantity<double, YottaJoule> ToYottaJoule<T>(this BaseQuantity<T, KiloJoule> val) where T:IConvertible {
return new Quantity<double, YottaJoule>(
Convert.ToDouble(val.Value) * 1E-3
);
}
/// <summary>
/// Extension method to convert KiloJoule to ZettaJoule
/// </summary>
/// <param name="val">quantity measured in KiloJoule</param>
/// <returns>quantity measured in ZettaJoule</returns>
public static Quantity<double, ZettaJoule> ToZettaJoule<T>(this BaseQuantity<T, KiloJoule> val) where T:IConvertible {
return new Quantity<double, ZettaJoule>(
Convert.ToDouble(val.Value) * 1E-3
);
}
/// <summary>
/// Extension method to convert KiloJoule to ExaJoule
/// </summary>
/// <param name="val">quantity measured in KiloJoule</param>
/// <returns>quantity measured in ExaJoule</returns>
public static Quantity<double, ExaJoule> ToExaJoule<T>(this BaseQuantity<T, KiloJoule> val) where T:IConvertible {
return new Quantity<double, ExaJoule>(
Convert.ToDouble(val.Value) * 1E-3
);
}
/// <summary>
/// Extension method to convert KiloJoule to PetaJoule
/// </summary>
/// <param name="val">quantity measured in KiloJoule</param>
/// <returns>quantity measured in PetaJoule</returns>
public static Quantity<double, PetaJoule> ToPetaJoule<T>(this BaseQuantity<T, KiloJoule> val) where T:IConvertible {
return new Quantity<double, PetaJoule>(
Convert.ToDouble(val.Value) * 1E-3
);
}
/// <summary>
/// Extension method to convert KiloJoule to TeraJoule
/// </summary>
/// <param name="val">quantity measured in KiloJoule</param>
/// <returns>quantity measured in TeraJoule</returns>
public static Quantity<double, TeraJoule> ToTeraJoule<T>(this BaseQuantity<T, KiloJoule> val) where T:IConvertible {
return new Quantity<double, TeraJoule>(
Convert.ToDouble(val.Value) * 1E-3
);
}
/// <summary>
/// Extension method to convert KiloJoule to GigaJoule
/// </summary>
/// <param name="val">quantity measured in KiloJoule</param>
/// <returns>quantity measured in GigaJoule</returns>
public static Quantity<double, GigaJoule> ToGigaJoule<T>(this BaseQuantity<T, KiloJoule> val) where T:IConvertible {
return new Quantity<double, GigaJoule>(
Convert.ToDouble(val.Value) * 1E-3
);
}
/// <summary>
/// Extension method to convert KiloJoule to MegaJoule
/// </summary>
/// <param name="val">quantity measured in KiloJoule</param>
/// <returns>quantity measured in MegaJoule</returns>
public static Quantity<double, MegaJoule> ToMegaJoule<T>(this BaseQuantity<T, KiloJoule> val) where T:IConvertible {
return new Quantity<double, MegaJoule>(
Convert.ToDouble(val.Value) * 1E-3
);
}
/// <summary>
/// Extension method to convert KiloJoule to HectoJoule
/// </summary>
/// <param name="val">quantity measured in KiloJoule</param>
/// <returns>quantity measured in HectoJoule</returns>
public static Quantity<double, HectoJoule> ToHectoJoule<T>(this BaseQuantity<T, KiloJoule> val) where T:IConvertible {
return new Quantity<double, HectoJoule>(
Convert.ToDouble(val.Value) * 1E-3
);
}
/// <summary>
/// Extension method to convert KiloJoule to DekaJoule
/// </summary>
/// <param name="val">quantity measured in KiloJoule</param>
/// <returns>quantity measured in DekaJoule</returns>
public static Quantity<double, DekaJoule> ToDekaJoule<T>(this BaseQuantity<T, KiloJoule> val) where T:IConvertible {
return new Quantity<double, DekaJoule>(
Convert.ToDouble(val.Value) * 1E-3
);
}
/// <summary>
/// Extension method to convert KiloJoule to DeciJoule
/// </summary>
/// <param name="val">quantity measured in KiloJoule</param>
/// <returns>quantity measured in DeciJoule</returns>
public static Quantity<double, DeciJoule> ToDeciJoule<T>(this BaseQuantity<T, KiloJoule> val) where T:IConvertible {
return new Quantity<double, DeciJoule>(
Convert.ToDouble(val.Value) * 1E-3
);
}
/// <summary>
/// Extension method to convert KiloJoule to CentiJoule
/// </summary>
/// <param name="val">quantity measured in KiloJoule</param>
/// <returns>quantity measured in CentiJoule</returns>
public static Quantity<double, CentiJoule> ToCentiJoule<T>(this BaseQuantity<T, KiloJoule> val) where T:IConvertible {
return new Quantity<double, CentiJoule>(
Convert.ToDouble(val.Value) * 1E-3
);
}
/// <summary>
/// Extension method to convert KiloJoule to MilliJoule
/// </summary>
/// <param name="val">quantity measured in KiloJoule</param>
/// <returns>quantity measured in MilliJoule</returns>
public static Quantity<double, MilliJoule> ToMilliJoule<T>(this BaseQuantity<T, KiloJoule> val) where T:IConvertible {
return new Quantity<double, MilliJoule>(
Convert.ToDouble(val.Value) * 1E-3
);
}
/// <summary>
/// Extension method to convert KiloJoule to MicroJoule
/// </summary>
/// <param name="val">quantity measured in KiloJoule</param>
/// <returns>quantity measured in MicroJoule</returns>
public static Quantity<double, MicroJoule> ToMicroJoule<T>(this BaseQuantity<T, KiloJoule> val) where T:IConvertible {
return new Quantity<double, MicroJoule>(
Convert.ToDouble(val.Value) * 1E-3
);
}
/// <summary>
/// Extension method to convert KiloJoule to NanoJoule
/// </summary>
/// <param name="val">quantity measured in KiloJoule</param>
/// <returns>quantity measured in NanoJoule</returns>
public static Quantity<double, NanoJoule> ToNanoJoule<T>(this BaseQuantity<T, KiloJoule> val) where T:IConvertible {
return new Quantity<double, NanoJoule>(
Convert.ToDouble(val.Value) * 1E-3
);
}
/// <summary>
/// Extension method to convert KiloJoule to PicoJoule
/// </summary>
/// <param name="val">quantity measured in KiloJoule</param>
/// <returns>quantity measured in PicoJoule</returns>
public static Quantity<double, PicoJoule> ToPicoJoule<T>(this BaseQuantity<T, KiloJoule> val) where T:IConvertible {
return new Quantity<double, PicoJoule>(
Convert.ToDouble(val.Value) * 1E-3
);
}
/// <summary>
/// Extension method to convert KiloJoule to FemtoJoule
/// </summary>
/// <param name="val">quantity measured in KiloJoule</param>
/// <returns>quantity measured in FemtoJoule</returns>
public static Quantity<double, FemtoJoule> ToFemtoJoule<T>(this BaseQuantity<T, KiloJoule> val) where T:IConvertible {
return new Quantity<double, FemtoJoule>(
Convert.ToDouble(val.Value) * 1E-3
);
}
/// <summary>
/// Extension method to convert KiloJoule to AttoJoule
/// </summary>
/// <param name="val">quantity measured in KiloJoule</param>
/// <returns>quantity measured in AttoJoule</returns>
public static Quantity<double, AttoJoule> ToAttoJoule<T>(this BaseQuantity<T, KiloJoule> val) where T:IConvertible {
return new Quantity<double, AttoJoule>(
Convert.ToDouble(val.Value) * 1E-3
);
}
/// <summary>
/// Extension method to convert KiloJoule to ZeptoJoule
/// </summary>
/// <param name="val">quantity measured in KiloJoule</param>
/// <returns>quantity measured in ZeptoJoule</returns>
public static Quantity<double, ZeptoJoule> ToZeptoJoule<T>(this BaseQuantity<T, KiloJoule> val) where T:IConvertible {
return new Quantity<double, ZeptoJoule>(
Convert.ToDouble(val.Value) * 1E-3
);
}
/// <summary>
/// Extension method to convert KiloJoule to YoctoJoule
/// </summary>
/// <param name="val">quantity measured in KiloJoule</param>
/// <returns>quantity measured in YoctoJoule</returns>
public static Quantity<double, YoctoJoule> ToYoctoJoule<T>(this BaseQuantity<T, KiloJoule> val) where T:IConvertible {
return new Quantity<double, YoctoJoule>(
Convert.ToDouble(val.Value) * 1E-3
);
}
/// <summary>
/// Extension method to convert HectoJoule to YottaJoule
/// </summary>
/// <param name="val">quantity measured in HectoJoule</param>
/// <returns>quantity measured in YottaJoule</returns>
public static Quantity<double, YottaJoule> ToYottaJoule<T>(this BaseQuantity<T, HectoJoule> val) where T:IConvertible {
return new Quantity<double, YottaJoule>(
Convert.ToDouble(val.Value) * 1E-2
);
}
/// <summary>
/// Extension method to convert HectoJoule to ZettaJoule
/// </summary>
/// <param name="val">quantity measured in HectoJoule</param>
/// <returns>quantity measured in ZettaJoule</returns>
public static Quantity<double, ZettaJoule> ToZettaJoule<T>(this BaseQuantity<T, HectoJoule> val) where T:IConvertible {
return new Quantity<double, ZettaJoule>(
Convert.ToDouble(val.Value) * 1E-2
);
}
/// <summary>
/// Extension method to convert HectoJoule to ExaJoule
/// </summary>
/// <param name="val">quantity measured in HectoJoule</param>
/// <returns>quantity measured in ExaJoule</returns>
public static Quantity<double, ExaJoule> ToExaJoule<T>(this BaseQuantity<T, HectoJoule> val) where T:IConvertible {
return new Quantity<double, ExaJoule>(
Convert.ToDouble(val.Value) * 1E-2
);
}
/// <summary>
/// Extension method to convert HectoJoule to PetaJoule
/// </summary>
/// <param name="val">quantity measured in HectoJoule</param>
/// <returns>quantity measured in PetaJoule</returns>
public static Quantity<double, PetaJoule> ToPetaJoule<T>(this BaseQuantity<T, HectoJoule> val) where T:IConvertible {
return new Quantity<double, PetaJoule>(
Convert.ToDouble(val.Value) * 1E-2
);
}
/// <summary>
/// Extension method to convert HectoJoule to TeraJoule
/// </summary>
/// <param name="val">quantity measured in HectoJoule</param>
/// <returns>quantity measured in TeraJoule</returns>
public static Quantity<double, TeraJoule> ToTeraJoule<T>(this BaseQuantity<T, HectoJoule> val) where T:IConvertible {
return new Quantity<double, TeraJoule>(
Convert.ToDouble(val.Value) * 1E-2
);
}
/// <summary>
/// Extension method to convert HectoJoule to GigaJoule
/// </summary>
/// <param name="val">quantity measured in HectoJoule</param>
/// <returns>quantity measured in GigaJoule</returns>
public static Quantity<double, GigaJoule> ToGigaJoule<T>(this BaseQuantity<T, HectoJoule> val) where T:IConvertible {
return new Quantity<double, GigaJoule>(
Convert.ToDouble(val.Value) * 1E-2
);
}
/// <summary>
/// Extension method to convert HectoJoule to MegaJoule
/// </summary>
/// <param name="val">quantity measured in HectoJoule</param>
/// <returns>quantity measured in MegaJoule</returns>
public static Quantity<double, MegaJoule> ToMegaJoule<T>(this BaseQuantity<T, HectoJoule> val) where T:IConvertible {
return new Quantity<double, MegaJoule>(
Convert.ToDouble(val.Value) * 1E-2
);
}
/// <summary>
/// Extension method to convert HectoJoule to KiloJoule
/// </summary>
/// <param name="val">quantity measured in HectoJoule</param>
/// <returns>quantity measured in KiloJoule</returns>
public static Quantity<double, KiloJoule> ToKiloJoule<T>(this BaseQuantity<T, HectoJoule> val) where T:IConvertible {
return new Quantity<double, KiloJoule>(
Convert.ToDouble(val.Value) * 1E-2
);
}
/// <summary>
/// Extension method to convert HectoJoule to DekaJoule
/// </summary>
/// <param name="val">quantity measured in HectoJoule</param>
/// <returns>quantity measured in DekaJoule</returns>
public static Quantity<double, DekaJoule> ToDekaJoule<T>(this BaseQuantity<T, HectoJoule> val) where T:IConvertible {
return new Quantity<double, DekaJoule>(
Convert.ToDouble(val.Value) * 1E-2
);
}
/// <summary>
/// Extension method to convert HectoJoule to DeciJoule
/// </summary>
/// <param name="val">quantity measured in HectoJoule</param>
/// <returns>quantity measured in DeciJoule</returns>
public static Quantity<double, DeciJoule> ToDeciJoule<T>(this BaseQuantity<T, HectoJoule> val) where T:IConvertible {
return new Quantity<double, DeciJoule>(
Convert.ToDouble(val.Value) * 1E-2
);
}
/// <summary>
/// Extension method to convert HectoJoule to CentiJoule
/// </summary>
/// <param name="val">quantity measured in HectoJoule</param>
/// <returns>quantity measured in CentiJoule</returns>
public static Quantity<double, CentiJoule> ToCentiJoule<T>(this BaseQuantity<T, HectoJoule> val) where T:IConvertible {
return new Quantity<double, CentiJoule>(
Convert.ToDouble(val.Value) * 1E-2
);
}
/// <summary>
/// Extension method to convert HectoJoule to MilliJoule
/// </summary>
/// <param name="val">quantity measured in HectoJoule</param>
/// <returns>quantity measured in MilliJoule</returns>
public static Quantity<double, MilliJoule> ToMilliJoule<T>(this BaseQuantity<T, HectoJoule> val) where T:IConvertible {
return new Quantity<double, MilliJoule>(
Convert.ToDouble(val.Value) * 1E-2
);
}
/// <summary>
/// Extension method to convert HectoJoule to MicroJoule
/// </summary>
/// <param name="val">quantity measured in HectoJoule</param>
/// <returns>quantity measured in MicroJoule</returns>
public static Quantity<double, MicroJoule> ToMicroJoule<T>(this BaseQuantity<T, HectoJoule> val) where T:IConvertible {
return new Quantity<double, MicroJoule>(
Convert.ToDouble(val.Value) * 1E-2
);
}
/// <summary>
/// Extension method to convert HectoJoule to NanoJoule
/// </summary>
/// <param name="val">quantity measured in HectoJoule</param>
/// <returns>quantity measured in NanoJoule</returns>
public static Quantity<double, NanoJoule> ToNanoJoule<T>(this BaseQuantity<T, HectoJoule> val) where T:IConvertible {
return new Quantity<double, NanoJoule>(
Convert.ToDouble(val.Value) * 1E-2
);
}
/// <summary>
/// Extension method to convert HectoJoule to PicoJoule
/// </summary>
/// <param name="val">quantity measured in HectoJoule</param>
/// <returns>quantity measured in PicoJoule</returns>
public static Quantity<double, PicoJoule> ToPicoJoule<T>(this BaseQuantity<T, HectoJoule> val) where T:IConvertible {
return new Quantity<double, PicoJoule>(
Convert.ToDouble(val.Value) * 1E-2
);
}
/// <summary>
/// Extension method to convert HectoJoule to FemtoJoule
/// </summary>
/// <param name="val">quantity measured in HectoJoule</param>
/// <returns>quantity measured in FemtoJoule</returns>
public static Quantity<double, FemtoJoule> ToFemtoJoule<T>(this BaseQuantity<T, HectoJoule> val) where T:IConvertible {
return new Quantity<double, FemtoJoule>(
Convert.ToDouble(val.Value) * 1E-2
);
}
/// <summary>
/// Extension method to convert HectoJoule to AttoJoule
/// </summary>
/// <param name="val">quantity measured in HectoJoule</param>
/// <returns>quantity measured in AttoJoule</returns>
public static Quantity<double, AttoJoule> ToAttoJoule<T>(this BaseQuantity<T, HectoJoule> val) where T:IConvertible {
return new Quantity<double, AttoJoule>(
Convert.ToDouble(val.Value) * 1E-2
);
}
/// <summary>
/// Extension method to convert HectoJoule to ZeptoJoule
/// </summary>
/// <param name="val">quantity measured in HectoJoule</param>
/// <returns>quantity measured in ZeptoJoule</returns>
public static Quantity<double, ZeptoJoule> ToZeptoJoule<T>(this BaseQuantity<T, HectoJoule> val) where T:IConvertible {
return new Quantity<double, ZeptoJoule>(
Convert.ToDouble(val.Value) * 1E-2
);
}
/// <summary>
/// Extension method to convert HectoJoule to YoctoJoule
/// </summary>
/// <param name="val">quantity measured in HectoJoule</param>
/// <returns>quantity measured in YoctoJoule</returns>
public static Quantity<double, YoctoJoule> ToYoctoJoule<T>(this BaseQuantity<T, HectoJoule> val) where T:IConvertible {
return new Quantity<double, YoctoJoule>(
Convert.ToDouble(val.Value) * 1E-2
);
}
/// <summary>
/// Extension method to convert DekaJoule to YottaJoule
/// </summary>
/// <param name="val">quantity measured in DekaJoule</param>
/// <returns>quantity measured in YottaJoule</returns>
public static Quantity<double, YottaJoule> ToYottaJoule<T>(this BaseQuantity<T, DekaJoule> val) where T:IConvertible {
return new Quantity<double, YottaJoule>(
Convert.ToDouble(val.Value) * 1E-1
);
}
/// <summary>
/// Extension method to convert DekaJoule to ZettaJoule
/// </summary>
/// <param name="val">quantity measured in DekaJoule</param>
/// <returns>quantity measured in ZettaJoule</returns>
public static Quantity<double, ZettaJoule> ToZettaJoule<T>(this BaseQuantity<T, DekaJoule> val) where T:IConvertible {
return new Quantity<double, ZettaJoule>(
Convert.ToDouble(val.Value) * 1E-1
);
}
/// <summary>
/// Extension method to convert DekaJoule to ExaJoule
/// </summary>
/// <param name="val">quantity measured in DekaJoule</param>
/// <returns>quantity measured in ExaJoule</returns>
public static Quantity<double, ExaJoule> ToExaJoule<T>(this BaseQuantity<T, DekaJoule> val) where T:IConvertible {
return new Quantity<double, ExaJoule>(
Convert.ToDouble(val.Value) * 1E-1
);
}
/// <summary>
/// Extension method to convert DekaJoule to PetaJoule
/// </summary>
/// <param name="val">quantity measured in DekaJoule</param>
/// <returns>quantity measured in PetaJoule</returns>
public static Quantity<double, PetaJoule> ToPetaJoule<T>(this BaseQuantity<T, DekaJoule> val) where T:IConvertible {
return new Quantity<double, PetaJoule>(
Convert.ToDouble(val.Value) * 1E-1
);
}
/// <summary>
/// Extension method to convert DekaJoule to TeraJoule
/// </summary>
/// <param name="val">quantity measured in DekaJoule</param>
/// <returns>quantity measured in TeraJoule</returns>
public static Quantity<double, TeraJoule> ToTeraJoule<T>(this BaseQuantity<T, DekaJoule> val) where T:IConvertible {
return new Quantity<double, TeraJoule>(
Convert.ToDouble(val.Value) * 1E-1
);
}
/// <summary>
/// Extension method to convert DekaJoule to GigaJoule
/// </summary>
/// <param name="val">quantity measured in DekaJoule</param>
/// <returns>quantity measured in GigaJoule</returns>
public static Quantity<double, GigaJoule> ToGigaJoule<T>(this BaseQuantity<T, DekaJoule> val) where T:IConvertible {
return new Quantity<double, GigaJoule>(
Convert.ToDouble(val.Value) * 1E-1
);
}
/// <summary>
/// Extension method to convert DekaJoule to MegaJoule
/// </summary>
/// <param name="val">quantity measured in DekaJoule</param>
/// <returns>quantity measured in MegaJoule</returns>
public static Quantity<double, MegaJoule> ToMegaJoule<T>(this BaseQuantity<T, DekaJoule> val) where T:IConvertible {
return new Quantity<double, MegaJoule>(
Convert.ToDouble(val.Value) * 1E-1
);
}
/// <summary>
/// Extension method to convert DekaJoule to KiloJoule
/// </summary>
/// <param name="val">quantity measured in DekaJoule</param>
/// <returns>quantity measured in KiloJoule</returns>
public static Quantity<double, KiloJoule> ToKiloJoule<T>(this BaseQuantity<T, DekaJoule> val) where T:IConvertible {
return new Quantity<double, KiloJoule>(
Convert.ToDouble(val.Value) * 1E-1
);
}
/// <summary>
/// Extension method to convert DekaJoule to HectoJoule
/// </summary>
/// <param name="val">quantity measured in DekaJoule</param>
/// <returns>quantity measured in HectoJoule</returns>
public static Quantity<double, HectoJoule> ToHectoJoule<T>(this BaseQuantity<T, DekaJoule> val) where T:IConvertible {
return new Quantity<double, HectoJoule>(
Convert.ToDouble(val.Value) * 1E-1
);
}
/// <summary>
/// Extension method to convert DekaJoule to DeciJoule
/// </summary>
/// <param name="val">quantity measured in DekaJoule</param>
/// <returns>quantity measured in DeciJoule</returns>
public static Quantity<double, DeciJoule> ToDeciJoule<T>(this BaseQuantity<T, DekaJoule> val) where T:IConvertible {
return new Quantity<double, DeciJoule>(
Convert.ToDouble(val.Value) * 1E-1
);
}
/// <summary>
/// Extension method to convert DekaJoule to CentiJoule
/// </summary>
/// <param name="val">quantity measured in DekaJoule</param>
/// <returns>quantity measured in CentiJoule</returns>
public static Quantity<double, CentiJoule> ToCentiJoule<T>(this BaseQuantity<T, DekaJoule> val) where T:IConvertible {
return new Quantity<double, CentiJoule>(
Convert.ToDouble(val.Value) * 1E-1
);
}
/// <summary>
/// Extension method to convert DekaJoule to MilliJoule
/// </summary>
/// <param name="val">quantity measured in DekaJoule</param>
/// <returns>quantity measured in MilliJoule</returns>
public static Quantity<double, MilliJoule> ToMilliJoule<T>(this BaseQuantity<T, DekaJoule> val) where T:IConvertible {
return new Quantity<double, MilliJoule>(
Convert.ToDouble(val.Value) * 1E-1
);
}
/// <summary>
/// Extension method to convert DekaJoule to MicroJoule
/// </summary>
/// <param name="val">quantity measured in DekaJoule</param>
/// <returns>quantity measured in MicroJoule</returns>
public static Quantity<double, MicroJoule> ToMicroJoule<T>(this BaseQuantity<T, DekaJoule> val) where T:IConvertible {
return new Quantity<double, MicroJoule>(
Convert.ToDouble(val.Value) * 1E-1
);
}
/// <summary>
/// Extension method to convert DekaJoule to NanoJoule
/// </summary>
/// <param name="val">quantity measured in DekaJoule</param>
/// <returns>quantity measured in NanoJoule</returns>
public static Quantity<double, NanoJoule> ToNanoJoule<T>(this BaseQuantity<T, DekaJoule> val) where T:IConvertible {
return new Quantity<double, NanoJoule>(
Convert.ToDouble(val.Value) * 1E-1
);
}
/// <summary>
/// Extension method to convert DekaJoule to PicoJoule
/// </summary>
/// <param name="val">quantity measured in DekaJoule</param>
/// <returns>quantity measured in PicoJoule</returns>
public static Quantity<double, PicoJoule> ToPicoJoule<T>(this BaseQuantity<T, DekaJoule> val) where T:IConvertible {
return new Quantity<double, PicoJoule>(
Convert.ToDouble(val.Value) * 1E-1
);
}
/// <summary>
/// Extension method to convert DekaJoule to FemtoJoule
/// </summary>
/// <param name="val">quantity measured in DekaJoule</param>
/// <returns>quantity measured in FemtoJoule</returns>
public static Quantity<double, FemtoJoule> ToFemtoJoule<T>(this BaseQuantity<T, DekaJoule> val) where T:IConvertible {
return new Quantity<double, FemtoJoule>(
Convert.ToDouble(val.Value) * 1E-1
);
}
/// <summary>
/// Extension method to convert DekaJoule to AttoJoule
/// </summary>
/// <param name="val">quantity measured in DekaJoule</param>
/// <returns>quantity measured in AttoJoule</returns>
public static Quantity<double, AttoJoule> ToAttoJoule<T>(this BaseQuantity<T, DekaJoule> val) where T:IConvertible {
return new Quantity<double, AttoJoule>(
Convert.ToDouble(val.Value) * 1E-1
);
}
/// <summary>
/// Extension method to convert DekaJoule to ZeptoJoule
/// </summary>
/// <param name="val">quantity measured in DekaJoule</param>
/// <returns>quantity measured in ZeptoJoule</returns>
public static Quantity<double, ZeptoJoule> ToZeptoJoule<T>(this BaseQuantity<T, DekaJoule> val) where T:IConvertible {
return new Quantity<double, ZeptoJoule>(
Convert.ToDouble(val.Value) * 1E-1
);
}
/// <summary>
/// Extension method to convert DekaJoule to YoctoJoule
/// </summary>
/// <param name="val">quantity measured in DekaJoule</param>
/// <returns>quantity measured in YoctoJoule</returns>
public static Quantity<double, YoctoJoule> ToYoctoJoule<T>(this BaseQuantity<T, DekaJoule> val) where T:IConvertible {
return new Quantity<double, YoctoJoule>(
Convert.ToDouble(val.Value) * 1E-1
);
}
/// <summary>
/// Extension method to convert DeciJoule to YottaJoule
/// </summary>
/// <param name="val">quantity measured in DeciJoule</param>
/// <returns>quantity measured in YottaJoule</returns>
public static Quantity<double, YottaJoule> ToYottaJoule<T>(this BaseQuantity<T, DeciJoule> val) where T:IConvertible {
return new Quantity<double, YottaJoule>(
Convert.ToDouble(val.Value) * 1E1
);
}
/// <summary>
/// Extension method to convert DeciJoule to ZettaJoule
/// </summary>
/// <param name="val">quantity measured in DeciJoule</param>
/// <returns>quantity measured in ZettaJoule</returns>
public static Quantity<double, ZettaJoule> ToZettaJoule<T>(this BaseQuantity<T, DeciJoule> val) where T:IConvertible {
return new Quantity<double, ZettaJoule>(
Convert.ToDouble(val.Value) * 1E1
);
}
/// <summary>
/// Extension method to convert DeciJoule to ExaJoule
/// </summary>
/// <param name="val">quantity measured in DeciJoule</param>
/// <returns>quantity measured in ExaJoule</returns>
public static Quantity<double, ExaJoule> ToExaJoule<T>(this BaseQuantity<T, DeciJoule> val) where T:IConvertible {
return new Quantity<double, ExaJoule>(
Convert.ToDouble(val.Value) * 1E1
);
}
/// <summary>
/// Extension method to convert DeciJoule to PetaJoule
/// </summary>
/// <param name="val">quantity measured in DeciJoule</param>
/// <returns>quantity measured in PetaJoule</returns>
public static Quantity<double, PetaJoule> ToPetaJoule<T>(this BaseQuantity<T, DeciJoule> val) where T:IConvertible {
return new Quantity<double, PetaJoule>(
Convert.ToDouble(val.Value) * 1E1
);
}
/// <summary>
/// Extension method to convert DeciJoule to TeraJoule
/// </summary>
/// <param name="val">quantity measured in DeciJoule</param>
/// <returns>quantity measured in TeraJoule</returns>
public static Quantity<double, TeraJoule> ToTeraJoule<T>(this BaseQuantity<T, DeciJoule> val) where T:IConvertible {
return new Quantity<double, TeraJoule>(
Convert.ToDouble(val.Value) * 1E1
);
}
/// <summary>
/// Extension method to convert DeciJoule to GigaJoule
/// </summary>
/// <param name="val">quantity measured in DeciJoule</param>
/// <returns>quantity measured in GigaJoule</returns>
public static Quantity<double, GigaJoule> ToGigaJoule<T>(this BaseQuantity<T, DeciJoule> val) where T:IConvertible {
return new Quantity<double, GigaJoule>(
Convert.ToDouble(val.Value) * 1E1
);
}
/// <summary>
/// Extension method to convert DeciJoule to MegaJoule
/// </summary>
/// <param name="val">quantity measured in DeciJoule</param>
/// <returns>quantity measured in MegaJoule</returns>
public static Quantity<double, MegaJoule> ToMegaJoule<T>(this BaseQuantity<T, DeciJoule> val) where T:IConvertible {
return new Quantity<double, MegaJoule>(
Convert.ToDouble(val.Value) * 1E1
);
}
/// <summary>
/// Extension method to convert DeciJoule to KiloJoule
/// </summary>
/// <param name="val">quantity measured in DeciJoule</param>
/// <returns>quantity measured in KiloJoule</returns>
public static Quantity<double, KiloJoule> ToKiloJoule<T>(this BaseQuantity<T, DeciJoule> val) where T:IConvertible {
return new Quantity<double, KiloJoule>(
Convert.ToDouble(val.Value) * 1E1
);
}
/// <summary>
/// Extension method to convert DeciJoule to HectoJoule
/// </summary>
/// <param name="val">quantity measured in DeciJoule</param>
/// <returns>quantity measured in HectoJoule</returns>
public static Quantity<double, HectoJoule> ToHectoJoule<T>(this BaseQuantity<T, DeciJoule> val) where T:IConvertible {
return new Quantity<double, HectoJoule>(
Convert.ToDouble(val.Value) * 1E1
);
}
/// <summary>
/// Extension method to convert DeciJoule to DekaJoule
/// </summary>
/// <param name="val">quantity measured in DeciJoule</param>
/// <returns>quantity measured in DekaJoule</returns>
public static Quantity<double, DekaJoule> ToDekaJoule<T>(this BaseQuantity<T, DeciJoule> val) where T:IConvertible {
return new Quantity<double, DekaJoule>(
Convert.ToDouble(val.Value) * 1E1
);
}
/// <summary>
/// Extension method to convert DeciJoule to CentiJoule
/// </summary>
/// <param name="val">quantity measured in DeciJoule</param>
/// <returns>quantity measured in CentiJoule</returns>
public static Quantity<double, CentiJoule> ToCentiJoule<T>(this BaseQuantity<T, DeciJoule> val) where T:IConvertible {
return new Quantity<double, CentiJoule>(
Convert.ToDouble(val.Value) * 1E1
);
}
/// <summary>
/// Extension method to convert DeciJoule to MilliJoule
/// </summary>
/// <param name="val">quantity measured in DeciJoule</param>
/// <returns>quantity measured in MilliJoule</returns>
public static Quantity<double, MilliJoule> ToMilliJoule<T>(this BaseQuantity<T, DeciJoule> val) where T:IConvertible {
return new Quantity<double, MilliJoule>(
Convert.ToDouble(val.Value) * 1E1
);
}
/// <summary>
/// Extension method to convert DeciJoule to MicroJoule
/// </summary>
/// <param name="val">quantity measured in DeciJoule</param>
/// <returns>quantity measured in MicroJoule</returns>
public static Quantity<double, MicroJoule> ToMicroJoule<T>(this BaseQuantity<T, DeciJoule> val) where T:IConvertible {
return new Quantity<double, MicroJoule>(
Convert.ToDouble(val.Value) * 1E1
);
}
/// <summary>
/// Extension method to convert DeciJoule to NanoJoule
/// </summary>
/// <param name="val">quantity measured in DeciJoule</param>
/// <returns>quantity measured in NanoJoule</returns>
public static Quantity<double, NanoJoule> ToNanoJoule<T>(this BaseQuantity<T, DeciJoule> val) where T:IConvertible {
return new Quantity<double, NanoJoule>(
Convert.ToDouble(val.Value) * 1E1
);
}
/// <summary>
/// Extension method to convert DeciJoule to PicoJoule
/// </summary>
/// <param name="val">quantity measured in DeciJoule</param>
/// <returns>quantity measured in PicoJoule</returns>
public static Quantity<double, PicoJoule> ToPicoJoule<T>(this BaseQuantity<T, DeciJoule> val) where T:IConvertible {
return new Quantity<double, PicoJoule>(
Convert.ToDouble(val.Value) * 1E1
);
}
/// <summary>
/// Extension method to convert DeciJoule to FemtoJoule
/// </summary>
/// <param name="val">quantity measured in DeciJoule</param>
/// <returns>quantity measured in FemtoJoule</returns>
public static Quantity<double, FemtoJoule> ToFemtoJoule<T>(this BaseQuantity<T, DeciJoule> val) where T:IConvertible {
return new Quantity<double, FemtoJoule>(
Convert.ToDouble(val.Value) * 1E1
);
}
/// <summary>
/// Extension method to convert DeciJoule to AttoJoule
/// </summary>
/// <param name="val">quantity measured in DeciJoule</param>
/// <returns>quantity measured in AttoJoule</returns>
public static Quantity<double, AttoJoule> ToAttoJoule<T>(this BaseQuantity<T, DeciJoule> val) where T:IConvertible {
return new Quantity<double, AttoJoule>(
Convert.ToDouble(val.Value) * 1E1
);
}
/// <summary>
/// Extension method to convert DeciJoule to ZeptoJoule
/// </summary>
/// <param name="val">quantity measured in DeciJoule</param>
/// <returns>quantity measured in ZeptoJoule</returns>
public static Quantity<double, ZeptoJoule> ToZeptoJoule<T>(this BaseQuantity<T, DeciJoule> val) where T:IConvertible {
return new Quantity<double, ZeptoJoule>(
Convert.ToDouble(val.Value) * 1E1
);
}
/// <summary>
/// Extension method to convert DeciJoule to YoctoJoule
/// </summary>
/// <param name="val">quantity measured in DeciJoule</param>
/// <returns>quantity measured in YoctoJoule</returns>
public static Quantity<double, YoctoJoule> ToYoctoJoule<T>(this BaseQuantity<T, DeciJoule> val) where T:IConvertible {
return new Quantity<double, YoctoJoule>(
Convert.ToDouble(val.Value) * 1E1
);
}
/// <summary>
/// Extension method to convert CentiJoule to YottaJoule
/// </summary>
/// <param name="val">quantity measured in CentiJoule</param>
/// <returns>quantity measured in YottaJoule</returns>
public static Quantity<double, YottaJoule> ToYottaJoule<T>(this BaseQuantity<T, CentiJoule> val) where T:IConvertible {
return new Quantity<double, YottaJoule>(
Convert.ToDouble(val.Value) * 1E2
);
}
/// <summary>
/// Extension method to convert CentiJoule to ZettaJoule
/// </summary>
/// <param name="val">quantity measured in CentiJoule</param>
/// <returns>quantity measured in ZettaJoule</returns>
public static Quantity<double, ZettaJoule> ToZettaJoule<T>(this BaseQuantity<T, CentiJoule> val) where T:IConvertible {
return new Quantity<double, ZettaJoule>(
Convert.ToDouble(val.Value) * 1E2
);
}
/// <summary>
/// Extension method to convert CentiJoule to ExaJoule
/// </summary>
/// <param name="val">quantity measured in CentiJoule</param>
/// <returns>quantity measured in ExaJoule</returns>
public static Quantity<double, ExaJoule> ToExaJoule<T>(this BaseQuantity<T, CentiJoule> val) where T:IConvertible {
return new Quantity<double, ExaJoule>(
Convert.ToDouble(val.Value) * 1E2
);
}
/// <summary>
/// Extension method to convert CentiJoule to PetaJoule
/// </summary>
/// <param name="val">quantity measured in CentiJoule</param>
/// <returns>quantity measured in PetaJoule</returns>
public static Quantity<double, PetaJoule> ToPetaJoule<T>(this BaseQuantity<T, CentiJoule> val) where T:IConvertible {
return new Quantity<double, PetaJoule>(
Convert.ToDouble(val.Value) * 1E2
);
}
/// <summary>
/// Extension method to convert CentiJoule to TeraJoule
/// </summary>
/// <param name="val">quantity measured in CentiJoule</param>
/// <returns>quantity measured in TeraJoule</returns>
public static Quantity<double, TeraJoule> ToTeraJoule<T>(this BaseQuantity<T, CentiJoule> val) where T:IConvertible {
return new Quantity<double, TeraJoule>(
Convert.ToDouble(val.Value) * 1E2
);
}
/// <summary>
/// Extension method to convert CentiJoule to GigaJoule
/// </summary>
/// <param name="val">quantity measured in CentiJoule</param>
/// <returns>quantity measured in GigaJoule</returns>
public static Quantity<double, GigaJoule> ToGigaJoule<T>(this BaseQuantity<T, CentiJoule> val) where T:IConvertible {
return new Quantity<double, GigaJoule>(
Convert.ToDouble(val.Value) * 1E2
);
}
/// <summary>
/// Extension method to convert CentiJoule to MegaJoule
/// </summary>
/// <param name="val">quantity measured in CentiJoule</param>
/// <returns>quantity measured in MegaJoule</returns>
public static Quantity<double, MegaJoule> ToMegaJoule<T>(this BaseQuantity<T, CentiJoule> val) where T:IConvertible {
return new Quantity<double, MegaJoule>(
Convert.ToDouble(val.Value) * 1E2
);
}
/// <summary>
/// Extension method to convert CentiJoule to KiloJoule
/// </summary>
/// <param name="val">quantity measured in CentiJoule</param>
/// <returns>quantity measured in KiloJoule</returns>
public static Quantity<double, KiloJoule> ToKiloJoule<T>(this BaseQuantity<T, CentiJoule> val) where T:IConvertible {
return new Quantity<double, KiloJoule>(
Convert.ToDouble(val.Value) * 1E2
);
}
/// <summary>
/// Extension method to convert CentiJoule to HectoJoule
/// </summary>
/// <param name="val">quantity measured in CentiJoule</param>
/// <returns>quantity measured in HectoJoule</returns>
public static Quantity<double, HectoJoule> ToHectoJoule<T>(this BaseQuantity<T, CentiJoule> val) where T:IConvertible {
return new Quantity<double, HectoJoule>(
Convert.ToDouble(val.Value) * 1E2
);
}
/// <summary>
/// Extension method to convert CentiJoule to DekaJoule
/// </summary>
/// <param name="val">quantity measured in CentiJoule</param>
/// <returns>quantity measured in DekaJoule</returns>
public static Quantity<double, DekaJoule> ToDekaJoule<T>(this BaseQuantity<T, CentiJoule> val) where T:IConvertible {
return new Quantity<double, DekaJoule>(
Convert.ToDouble(val.Value) * 1E2
);
}
/// <summary>
/// Extension method to convert CentiJoule to DeciJoule
/// </summary>
/// <param name="val">quantity measured in CentiJoule</param>
/// <returns>quantity measured in DeciJoule</returns>
public static Quantity<double, DeciJoule> ToDeciJoule<T>(this BaseQuantity<T, CentiJoule> val) where T:IConvertible {
return new Quantity<double, DeciJoule>(
Convert.ToDouble(val.Value) * 1E2
);
}
/// <summary>
/// Extension method to convert CentiJoule to MilliJoule
/// </summary>
/// <param name="val">quantity measured in CentiJoule</param>
/// <returns>quantity measured in MilliJoule</returns>
public static Quantity<double, MilliJoule> ToMilliJoule<T>(this BaseQuantity<T, CentiJoule> val) where T:IConvertible {
return new Quantity<double, MilliJoule>(
Convert.ToDouble(val.Value) * 1E2
);
}
/// <summary>
/// Extension method to convert CentiJoule to MicroJoule
/// </summary>
/// <param name="val">quantity measured in CentiJoule</param>
/// <returns>quantity measured in MicroJoule</returns>
public static Quantity<double, MicroJoule> ToMicroJoule<T>(this BaseQuantity<T, CentiJoule> val) where T:IConvertible {
return new Quantity<double, MicroJoule>(
Convert.ToDouble(val.Value) * 1E2
);
}
/// <summary>
/// Extension method to convert CentiJoule to NanoJoule
/// </summary>
/// <param name="val">quantity measured in CentiJoule</param>
/// <returns>quantity measured in NanoJoule</returns>
public static Quantity<double, NanoJoule> ToNanoJoule<T>(this BaseQuantity<T, CentiJoule> val) where T:IConvertible {
return new Quantity<double, NanoJoule>(
Convert.ToDouble(val.Value) * 1E2
);
}
/// <summary>
/// Extension method to convert CentiJoule to PicoJoule
/// </summary>
/// <param name="val">quantity measured in CentiJoule</param>
/// <returns>quantity measured in PicoJoule</returns>
public static Quantity<double, PicoJoule> ToPicoJoule<T>(this BaseQuantity<T, CentiJoule> val) where T:IConvertible {
return new Quantity<double, PicoJoule>(
Convert.ToDouble(val.Value) * 1E2
);
}
/// <summary>
/// Extension method to convert CentiJoule to FemtoJoule
/// </summary>
/// <param name="val">quantity measured in CentiJoule</param>
/// <returns>quantity measured in FemtoJoule</returns>
public static Quantity<double, FemtoJoule> ToFemtoJoule<T>(this BaseQuantity<T, CentiJoule> val) where T:IConvertible {
return new Quantity<double, FemtoJoule>(
Convert.ToDouble(val.Value) * 1E2
);
}
/// <summary>
/// Extension method to convert CentiJoule to AttoJoule
/// </summary>
/// <param name="val">quantity measured in CentiJoule</param>
/// <returns>quantity measured in AttoJoule</returns>
public static Quantity<double, AttoJoule> ToAttoJoule<T>(this BaseQuantity<T, CentiJoule> val) where T:IConvertible {
return new Quantity<double, AttoJoule>(
Convert.ToDouble(val.Value) * 1E2
);
}
/// <summary>
/// Extension method to convert CentiJoule to ZeptoJoule
/// </summary>
/// <param name="val">quantity measured in CentiJoule</param>
/// <returns>quantity measured in ZeptoJoule</returns>
public static Quantity<double, ZeptoJoule> ToZeptoJoule<T>(this BaseQuantity<T, CentiJoule> val) where T:IConvertible {
return new Quantity<double, ZeptoJoule>(
Convert.ToDouble(val.Value) * 1E2
);
}
/// <summary>
/// Extension method to convert CentiJoule to YoctoJoule
/// </summary>
/// <param name="val">quantity measured in CentiJoule</param>
/// <returns>quantity measured in YoctoJoule</returns>
public static Quantity<double, YoctoJoule> ToYoctoJoule<T>(this BaseQuantity<T, CentiJoule> val) where T:IConvertible {
return new Quantity<double, YoctoJoule>(
Convert.ToDouble(val.Value) * 1E2
);
}
/// <summary>
/// Extension method to convert MilliJoule to YottaJoule
/// </summary>
/// <param name="val">quantity measured in MilliJoule</param>
/// <returns>quantity measured in YottaJoule</returns>
public static Quantity<double, YottaJoule> ToYottaJoule<T>(this BaseQuantity<T, MilliJoule> val) where T:IConvertible {
return new Quantity<double, YottaJoule>(
Convert.ToDouble(val.Value) * 1E3
);
}
/// <summary>
/// Extension method to convert MilliJoule to ZettaJoule
/// </summary>
/// <param name="val">quantity measured in MilliJoule</param>
/// <returns>quantity measured in ZettaJoule</returns>
public static Quantity<double, ZettaJoule> ToZettaJoule<T>(this BaseQuantity<T, MilliJoule> val) where T:IConvertible {
return new Quantity<double, ZettaJoule>(
Convert.ToDouble(val.Value) * 1E3
);
}
/// <summary>
/// Extension method to convert MilliJoule to ExaJoule
/// </summary>
/// <param name="val">quantity measured in MilliJoule</param>
/// <returns>quantity measured in ExaJoule</returns>
public static Quantity<double, ExaJoule> ToExaJoule<T>(this BaseQuantity<T, MilliJoule> val) where T:IConvertible {
return new Quantity<double, ExaJoule>(
Convert.ToDouble(val.Value) * 1E3
);
}
/// <summary>
/// Extension method to convert MilliJoule to PetaJoule
/// </summary>
/// <param name="val">quantity measured in MilliJoule</param>
/// <returns>quantity measured in PetaJoule</returns>
public static Quantity<double, PetaJoule> ToPetaJoule<T>(this BaseQuantity<T, MilliJoule> val) where T:IConvertible {
return new Quantity<double, PetaJoule>(
Convert.ToDouble(val.Value) * 1E3
);
}
/// <summary>
/// Extension method to convert MilliJoule to TeraJoule
/// </summary>
/// <param name="val">quantity measured in MilliJoule</param>
/// <returns>quantity measured in TeraJoule</returns>
public static Quantity<double, TeraJoule> ToTeraJoule<T>(this BaseQuantity<T, MilliJoule> val) where T:IConvertible {
return new Quantity<double, TeraJoule>(
Convert.ToDouble(val.Value) * 1E3
);
}
/// <summary>
/// Extension method to convert MilliJoule to GigaJoule
/// </summary>
/// <param name="val">quantity measured in MilliJoule</param>
/// <returns>quantity measured in GigaJoule</returns>
public static Quantity<double, GigaJoule> ToGigaJoule<T>(this BaseQuantity<T, MilliJoule> val) where T:IConvertible {
return new Quantity<double, GigaJoule>(
Convert.ToDouble(val.Value) * 1E3
);
}
/// <summary>
/// Extension method to convert MilliJoule to MegaJoule
/// </summary>
/// <param name="val">quantity measured in MilliJoule</param>
/// <returns>quantity measured in MegaJoule</returns>
public static Quantity<double, MegaJoule> ToMegaJoule<T>(this BaseQuantity<T, MilliJoule> val) where T:IConvertible {
return new Quantity<double, MegaJoule>(
Convert.ToDouble(val.Value) * 1E3
);
}
/// <summary>
/// Extension method to convert MilliJoule to KiloJoule
/// </summary>
/// <param name="val">quantity measured in MilliJoule</param>
/// <returns>quantity measured in KiloJoule</returns>
public static Quantity<double, KiloJoule> ToKiloJoule<T>(this BaseQuantity<T, MilliJoule> val) where T:IConvertible {
return new Quantity<double, KiloJoule>(
Convert.ToDouble(val.Value) * 1E3
);
}
/// <summary>
/// Extension method to convert MilliJoule to HectoJoule
/// </summary>
/// <param name="val">quantity measured in MilliJoule</param>
/// <returns>quantity measured in HectoJoule</returns>
public static Quantity<double, HectoJoule> ToHectoJoule<T>(this BaseQuantity<T, MilliJoule> val) where T:IConvertible {
return new Quantity<double, HectoJoule>(
Convert.ToDouble(val.Value) * 1E3
);
}
/// <summary>
/// Extension method to convert MilliJoule to DekaJoule
/// </summary>
/// <param name="val">quantity measured in MilliJoule</param>
/// <returns>quantity measured in DekaJoule</returns>
public static Quantity<double, DekaJoule> ToDekaJoule<T>(this BaseQuantity<T, MilliJoule> val) where T:IConvertible {
return new Quantity<double, DekaJoule>(
Convert.ToDouble(val.Value) * 1E3
);
}
/// <summary>
/// Extension method to convert MilliJoule to DeciJoule
/// </summary>
/// <param name="val">quantity measured in MilliJoule</param>
/// <returns>quantity measured in DeciJoule</returns>
public static Quantity<double, DeciJoule> ToDeciJoule<T>(this BaseQuantity<T, MilliJoule> val) where T:IConvertible {
return new Quantity<double, DeciJoule>(
Convert.ToDouble(val.Value) * 1E3
);
}
/// <summary>
/// Extension method to convert MilliJoule to CentiJoule
/// </summary>
/// <param name="val">quantity measured in MilliJoule</param>
/// <returns>quantity measured in CentiJoule</returns>
public static Quantity<double, CentiJoule> ToCentiJoule<T>(this BaseQuantity<T, MilliJoule> val) where T:IConvertible {
return new Quantity<double, CentiJoule>(
Convert.ToDouble(val.Value) * 1E3
);
}
/// <summary>
/// Extension method to convert MilliJoule to MicroJoule
/// </summary>
/// <param name="val">quantity measured in MilliJoule</param>
/// <returns>quantity measured in MicroJoule</returns>
public static Quantity<double, MicroJoule> ToMicroJoule<T>(this BaseQuantity<T, MilliJoule> val) where T:IConvertible {
return new Quantity<double, MicroJoule>(
Convert.ToDouble(val.Value) * 1E3
);
}
/// <summary>
/// Extension method to convert MilliJoule to NanoJoule
/// </summary>
/// <param name="val">quantity measured in MilliJoule</param>
/// <returns>quantity measured in NanoJoule</returns>
public static Quantity<double, NanoJoule> ToNanoJoule<T>(this BaseQuantity<T, MilliJoule> val) where T:IConvertible {
return new Quantity<double, NanoJoule>(
Convert.ToDouble(val.Value) * 1E3
);
}
/// <summary>
/// Extension method to convert MilliJoule to PicoJoule
/// </summary>
/// <param name="val">quantity measured in MilliJoule</param>
/// <returns>quantity measured in PicoJoule</returns>
public static Quantity<double, PicoJoule> ToPicoJoule<T>(this BaseQuantity<T, MilliJoule> val) where T:IConvertible {
return new Quantity<double, PicoJoule>(
Convert.ToDouble(val.Value) * 1E3
);
}
/// <summary>
/// Extension method to convert MilliJoule to FemtoJoule
/// </summary>
/// <param name="val">quantity measured in MilliJoule</param>
/// <returns>quantity measured in FemtoJoule</returns>
public static Quantity<double, FemtoJoule> ToFemtoJoule<T>(this BaseQuantity<T, MilliJoule> val) where T:IConvertible {
return new Quantity<double, FemtoJoule>(
Convert.ToDouble(val.Value) * 1E3
);
}
/// <summary>
/// Extension method to convert MilliJoule to AttoJoule
/// </summary>
/// <param name="val">quantity measured in MilliJoule</param>
/// <returns>quantity measured in AttoJoule</returns>
public static Quantity<double, AttoJoule> ToAttoJoule<T>(this BaseQuantity<T, MilliJoule> val) where T:IConvertible {
return new Quantity<double, AttoJoule>(
Convert.ToDouble(val.Value) * 1E3
);
}
/// <summary>
/// Extension method to convert MilliJoule to ZeptoJoule
/// </summary>
/// <param name="val">quantity measured in MilliJoule</param>
/// <returns>quantity measured in ZeptoJoule</returns>
public static Quantity<double, ZeptoJoule> ToZeptoJoule<T>(this BaseQuantity<T, MilliJoule> val) where T:IConvertible {
return new Quantity<double, ZeptoJoule>(
Convert.ToDouble(val.Value) * 1E3
);
}
/// <summary>
/// Extension method to convert MilliJoule to YoctoJoule
/// </summary>
/// <param name="val">quantity measured in MilliJoule</param>
/// <returns>quantity measured in YoctoJoule</returns>
public static Quantity<double, YoctoJoule> ToYoctoJoule<T>(this BaseQuantity<T, MilliJoule> val) where T:IConvertible {
return new Quantity<double, YoctoJoule>(
Convert.ToDouble(val.Value) * 1E3
);
}
/// <summary>
/// Extension method to convert MicroJoule to YottaJoule
/// </summary>
/// <param name="val">quantity measured in MicroJoule</param>
/// <returns>quantity measured in YottaJoule</returns>
public static Quantity<double, YottaJoule> ToYottaJoule<T>(this BaseQuantity<T, MicroJoule> val) where T:IConvertible {
return new Quantity<double, YottaJoule>(
Convert.ToDouble(val.Value) * 1E6
);
}
/// <summary>
/// Extension method to convert MicroJoule to ZettaJoule
/// </summary>
/// <param name="val">quantity measured in MicroJoule</param>
/// <returns>quantity measured in ZettaJoule</returns>
public static Quantity<double, ZettaJoule> ToZettaJoule<T>(this BaseQuantity<T, MicroJoule> val) where T:IConvertible {
return new Quantity<double, ZettaJoule>(
Convert.ToDouble(val.Value) * 1E6
);
}
/// <summary>
/// Extension method to convert MicroJoule to ExaJoule
/// </summary>
/// <param name="val">quantity measured in MicroJoule</param>
/// <returns>quantity measured in ExaJoule</returns>
public static Quantity<double, ExaJoule> ToExaJoule<T>(this BaseQuantity<T, MicroJoule> val) where T:IConvertible {
return new Quantity<double, ExaJoule>(
Convert.ToDouble(val.Value) * 1E6
);
}
/// <summary>
/// Extension method to convert MicroJoule to PetaJoule
/// </summary>
/// <param name="val">quantity measured in MicroJoule</param>
/// <returns>quantity measured in PetaJoule</returns>
public static Quantity<double, PetaJoule> ToPetaJoule<T>(this BaseQuantity<T, MicroJoule> val) where T:IConvertible {
return new Quantity<double, PetaJoule>(
Convert.ToDouble(val.Value) * 1E6
);
}
/// <summary>
/// Extension method to convert MicroJoule to TeraJoule
/// </summary>
/// <param name="val">quantity measured in MicroJoule</param>
/// <returns>quantity measured in TeraJoule</returns>
public static Quantity<double, TeraJoule> ToTeraJoule<T>(this BaseQuantity<T, MicroJoule> val) where T:IConvertible {
return new Quantity<double, TeraJoule>(
Convert.ToDouble(val.Value) * 1E6
);
}
/// <summary>
/// Extension method to convert MicroJoule to GigaJoule
/// </summary>
/// <param name="val">quantity measured in MicroJoule</param>
/// <returns>quantity measured in GigaJoule</returns>
public static Quantity<double, GigaJoule> ToGigaJoule<T>(this BaseQuantity<T, MicroJoule> val) where T:IConvertible {
return new Quantity<double, GigaJoule>(
Convert.ToDouble(val.Value) * 1E6
);
}
/// <summary>
/// Extension method to convert MicroJoule to MegaJoule
/// </summary>
/// <param name="val">quantity measured in MicroJoule</param>
/// <returns>quantity measured in MegaJoule</returns>
public static Quantity<double, MegaJoule> ToMegaJoule<T>(this BaseQuantity<T, MicroJoule> val) where T:IConvertible {
return new Quantity<double, MegaJoule>(
Convert.ToDouble(val.Value) * 1E6
);
}
/// <summary>
/// Extension method to convert MicroJoule to KiloJoule
/// </summary>
/// <param name="val">quantity measured in MicroJoule</param>
/// <returns>quantity measured in KiloJoule</returns>
public static Quantity<double, KiloJoule> ToKiloJoule<T>(this BaseQuantity<T, MicroJoule> val) where T:IConvertible {
return new Quantity<double, KiloJoule>(
Convert.ToDouble(val.Value) * 1E6
);
}
/// <summary>
/// Extension method to convert MicroJoule to HectoJoule
/// </summary>
/// <param name="val">quantity measured in MicroJoule</param>
/// <returns>quantity measured in HectoJoule</returns>
public static Quantity<double, HectoJoule> ToHectoJoule<T>(this BaseQuantity<T, MicroJoule> val) where T:IConvertible {
return new Quantity<double, HectoJoule>(
Convert.ToDouble(val.Value) * 1E6
);
}
/// <summary>
/// Extension method to convert MicroJoule to DekaJoule
/// </summary>
/// <param name="val">quantity measured in MicroJoule</param>
/// <returns>quantity measured in DekaJoule</returns>
public static Quantity<double, DekaJoule> ToDekaJoule<T>(this BaseQuantity<T, MicroJoule> val) where T:IConvertible {
return new Quantity<double, DekaJoule>(
Convert.ToDouble(val.Value) * 1E6
);
}
/// <summary>
/// Extension method to convert MicroJoule to DeciJoule
/// </summary>
/// <param name="val">quantity measured in MicroJoule</param>
/// <returns>quantity measured in DeciJoule</returns>
public static Quantity<double, DeciJoule> ToDeciJoule<T>(this BaseQuantity<T, MicroJoule> val) where T:IConvertible {
return new Quantity<double, DeciJoule>(
Convert.ToDouble(val.Value) * 1E6
);
}
/// <summary>
/// Extension method to convert MicroJoule to CentiJoule
/// </summary>
/// <param name="val">quantity measured in MicroJoule</param>
/// <returns>quantity measured in CentiJoule</returns>
public static Quantity<double, CentiJoule> ToCentiJoule<T>(this BaseQuantity<T, MicroJoule> val) where T:IConvertible {
return new Quantity<double, CentiJoule>(
Convert.ToDouble(val.Value) * 1E6
);
}
/// <summary>
/// Extension method to convert MicroJoule to MilliJoule
/// </summary>
/// <param name="val">quantity measured in MicroJoule</param>
/// <returns>quantity measured in MilliJoule</returns>
public static Quantity<double, MilliJoule> ToMilliJoule<T>(this BaseQuantity<T, MicroJoule> val) where T:IConvertible {
return new Quantity<double, MilliJoule>(
Convert.ToDouble(val.Value) * 1E6
);
}
/// <summary>
/// Extension method to convert MicroJoule to NanoJoule
/// </summary>
/// <param name="val">quantity measured in MicroJoule</param>
/// <returns>quantity measured in NanoJoule</returns>
public static Quantity<double, NanoJoule> ToNanoJoule<T>(this BaseQuantity<T, MicroJoule> val) where T:IConvertible {
return new Quantity<double, NanoJoule>(
Convert.ToDouble(val.Value) * 1E6
);
}
/// <summary>
/// Extension method to convert MicroJoule to PicoJoule
/// </summary>
/// <param name="val">quantity measured in MicroJoule</param>
/// <returns>quantity measured in PicoJoule</returns>
public static Quantity<double, PicoJoule> ToPicoJoule<T>(this BaseQuantity<T, MicroJoule> val) where T:IConvertible {
return new Quantity<double, PicoJoule>(
Convert.ToDouble(val.Value) * 1E6
);
}
/// <summary>
/// Extension method to convert MicroJoule to FemtoJoule
/// </summary>
/// <param name="val">quantity measured in MicroJoule</param>
/// <returns>quantity measured in FemtoJoule</returns>
public static Quantity<double, FemtoJoule> ToFemtoJoule<T>(this BaseQuantity<T, MicroJoule> val) where T:IConvertible {
return new Quantity<double, FemtoJoule>(
Convert.ToDouble(val.Value) * 1E6
);
}
/// <summary>
/// Extension method to convert MicroJoule to AttoJoule
/// </summary>
/// <param name="val">quantity measured in MicroJoule</param>
/// <returns>quantity measured in AttoJoule</returns>
public static Quantity<double, AttoJoule> ToAttoJoule<T>(this BaseQuantity<T, MicroJoule> val) where T:IConvertible {
return new Quantity<double, AttoJoule>(
Convert.ToDouble(val.Value) * 1E6
);
}
/// <summary>
/// Extension method to convert MicroJoule to ZeptoJoule
/// </summary>
/// <param name="val">quantity measured in MicroJoule</param>
/// <returns>quantity measured in ZeptoJoule</returns>
public static Quantity<double, ZeptoJoule> ToZeptoJoule<T>(this BaseQuantity<T, MicroJoule> val) where T:IConvertible {
return new Quantity<double, ZeptoJoule>(
Convert.ToDouble(val.Value) * 1E6
);
}
/// <summary>
/// Extension method to convert MicroJoule to YoctoJoule
/// </summary>
/// <param name="val">quantity measured in MicroJoule</param>
/// <returns>quantity measured in YoctoJoule</returns>
public static Quantity<double, YoctoJoule> ToYoctoJoule<T>(this BaseQuantity<T, MicroJoule> val) where T:IConvertible {
return new Quantity<double, YoctoJoule>(
Convert.ToDouble(val.Value) * 1E6
);
}
/// <summary>
/// Extension method to convert NanoJoule to YottaJoule
/// </summary>
/// <param name="val">quantity measured in NanoJoule</param>
/// <returns>quantity measured in YottaJoule</returns>
public static Quantity<double, YottaJoule> ToYottaJoule<T>(this BaseQuantity<T, NanoJoule> val) where T:IConvertible {
return new Quantity<double, YottaJoule>(
Convert.ToDouble(val.Value) * 1E9
);
}
/// <summary>
/// Extension method to convert NanoJoule to ZettaJoule
/// </summary>
/// <param name="val">quantity measured in NanoJoule</param>
/// <returns>quantity measured in ZettaJoule</returns>
public static Quantity<double, ZettaJoule> ToZettaJoule<T>(this BaseQuantity<T, NanoJoule> val) where T:IConvertible {
return new Quantity<double, ZettaJoule>(
Convert.ToDouble(val.Value) * 1E9
);
}
/// <summary>
/// Extension method to convert NanoJoule to ExaJoule
/// </summary>
/// <param name="val">quantity measured in NanoJoule</param>
/// <returns>quantity measured in ExaJoule</returns>
public static Quantity<double, ExaJoule> ToExaJoule<T>(this BaseQuantity<T, NanoJoule> val) where T:IConvertible {
return new Quantity<double, ExaJoule>(
Convert.ToDouble(val.Value) * 1E9
);
}
/// <summary>
/// Extension method to convert NanoJoule to PetaJoule
/// </summary>
/// <param name="val">quantity measured in NanoJoule</param>
/// <returns>quantity measured in PetaJoule</returns>
public static Quantity<double, PetaJoule> ToPetaJoule<T>(this BaseQuantity<T, NanoJoule> val) where T:IConvertible {
return new Quantity<double, PetaJoule>(
Convert.ToDouble(val.Value) * 1E9
);
}
/// <summary>
/// Extension method to convert NanoJoule to TeraJoule
/// </summary>
/// <param name="val">quantity measured in NanoJoule</param>
/// <returns>quantity measured in TeraJoule</returns>
public static Quantity<double, TeraJoule> ToTeraJoule<T>(this BaseQuantity<T, NanoJoule> val) where T:IConvertible {
return new Quantity<double, TeraJoule>(
Convert.ToDouble(val.Value) * 1E9
);
}
/// <summary>
/// Extension method to convert NanoJoule to GigaJoule
/// </summary>
/// <param name="val">quantity measured in NanoJoule</param>
/// <returns>quantity measured in GigaJoule</returns>
public static Quantity<double, GigaJoule> ToGigaJoule<T>(this BaseQuantity<T, NanoJoule> val) where T:IConvertible {
return new Quantity<double, GigaJoule>(
Convert.ToDouble(val.Value) * 1E9
);
}
/// <summary>
/// Extension method to convert NanoJoule to MegaJoule
/// </summary>
/// <param name="val">quantity measured in NanoJoule</param>
/// <returns>quantity measured in MegaJoule</returns>
public static Quantity<double, MegaJoule> ToMegaJoule<T>(this BaseQuantity<T, NanoJoule> val) where T:IConvertible {
return new Quantity<double, MegaJoule>(
Convert.ToDouble(val.Value) * 1E9
);
}
/// <summary>
/// Extension method to convert NanoJoule to KiloJoule
/// </summary>
/// <param name="val">quantity measured in NanoJoule</param>
/// <returns>quantity measured in KiloJoule</returns>
public static Quantity<double, KiloJoule> ToKiloJoule<T>(this BaseQuantity<T, NanoJoule> val) where T:IConvertible {
return new Quantity<double, KiloJoule>(
Convert.ToDouble(val.Value) * 1E9
);
}
/// <summary>
/// Extension method to convert NanoJoule to HectoJoule
/// </summary>
/// <param name="val">quantity measured in NanoJoule</param>
/// <returns>quantity measured in HectoJoule</returns>
public static Quantity<double, HectoJoule> ToHectoJoule<T>(this BaseQuantity<T, NanoJoule> val) where T:IConvertible {
return new Quantity<double, HectoJoule>(
Convert.ToDouble(val.Value) * 1E9
);
}
/// <summary>
/// Extension method to convert NanoJoule to DekaJoule
/// </summary>
/// <param name="val">quantity measured in NanoJoule</param>
/// <returns>quantity measured in DekaJoule</returns>
public static Quantity<double, DekaJoule> ToDekaJoule<T>(this BaseQuantity<T, NanoJoule> val) where T:IConvertible {
return new Quantity<double, DekaJoule>(
Convert.ToDouble(val.Value) * 1E9
);
}
/// <summary>
/// Extension method to convert NanoJoule to DeciJoule
/// </summary>
/// <param name="val">quantity measured in NanoJoule</param>
/// <returns>quantity measured in DeciJoule</returns>
public static Quantity<double, DeciJoule> ToDeciJoule<T>(this BaseQuantity<T, NanoJoule> val) where T:IConvertible {
return new Quantity<double, DeciJoule>(
Convert.ToDouble(val.Value) * 1E9
);
}
/// <summary>
/// Extension method to convert NanoJoule to CentiJoule
/// </summary>
/// <param name="val">quantity measured in NanoJoule</param>
/// <returns>quantity measured in CentiJoule</returns>
public static Quantity<double, CentiJoule> ToCentiJoule<T>(this BaseQuantity<T, NanoJoule> val) where T:IConvertible {
return new Quantity<double, CentiJoule>(
Convert.ToDouble(val.Value) * 1E9
);
}
/// <summary>
/// Extension method to convert NanoJoule to MilliJoule
/// </summary>
/// <param name="val">quantity measured in NanoJoule</param>
/// <returns>quantity measured in MilliJoule</returns>
public static Quantity<double, MilliJoule> ToMilliJoule<T>(this BaseQuantity<T, NanoJoule> val) where T:IConvertible {
return new Quantity<double, MilliJoule>(
Convert.ToDouble(val.Value) * 1E9
);
}
/// <summary>
/// Extension method to convert NanoJoule to MicroJoule
/// </summary>
/// <param name="val">quantity measured in NanoJoule</param>
/// <returns>quantity measured in MicroJoule</returns>
public static Quantity<double, MicroJoule> ToMicroJoule<T>(this BaseQuantity<T, NanoJoule> val) where T:IConvertible {
return new Quantity<double, MicroJoule>(
Convert.ToDouble(val.Value) * 1E9
);
}
/// <summary>
/// Extension method to convert NanoJoule to PicoJoule
/// </summary>
/// <param name="val">quantity measured in NanoJoule</param>
/// <returns>quantity measured in PicoJoule</returns>
public static Quantity<double, PicoJoule> ToPicoJoule<T>(this BaseQuantity<T, NanoJoule> val) where T:IConvertible {
return new Quantity<double, PicoJoule>(
Convert.ToDouble(val.Value) * 1E9
);
}
/// <summary>
/// Extension method to convert NanoJoule to FemtoJoule
/// </summary>
/// <param name="val">quantity measured in NanoJoule</param>
/// <returns>quantity measured in FemtoJoule</returns>
public static Quantity<double, FemtoJoule> ToFemtoJoule<T>(this BaseQuantity<T, NanoJoule> val) where T:IConvertible {
return new Quantity<double, FemtoJoule>(
Convert.ToDouble(val.Value) * 1E9
);
}
/// <summary>
/// Extension method to convert NanoJoule to AttoJoule
/// </summary>
/// <param name="val">quantity measured in NanoJoule</param>
/// <returns>quantity measured in AttoJoule</returns>
public static Quantity<double, AttoJoule> ToAttoJoule<T>(this BaseQuantity<T, NanoJoule> val) where T:IConvertible {
return new Quantity<double, AttoJoule>(
Convert.ToDouble(val.Value) * 1E9
);
}
/// <summary>
/// Extension method to convert NanoJoule to ZeptoJoule
/// </summary>
/// <param name="val">quantity measured in NanoJoule</param>
/// <returns>quantity measured in ZeptoJoule</returns>
public static Quantity<double, ZeptoJoule> ToZeptoJoule<T>(this BaseQuantity<T, NanoJoule> val) where T:IConvertible {
return new Quantity<double, ZeptoJoule>(
Convert.ToDouble(val.Value) * 1E9
);
}
/// <summary>
/// Extension method to convert NanoJoule to YoctoJoule
/// </summary>
/// <param name="val">quantity measured in NanoJoule</param>
/// <returns>quantity measured in YoctoJoule</returns>
public static Quantity<double, YoctoJoule> ToYoctoJoule<T>(this BaseQuantity<T, NanoJoule> val) where T:IConvertible {
return new Quantity<double, YoctoJoule>(
Convert.ToDouble(val.Value) * 1E9
);
}
/// <summary>
/// Extension method to convert PicoJoule to YottaJoule
/// </summary>
/// <param name="val">quantity measured in PicoJoule</param>
/// <returns>quantity measured in YottaJoule</returns>
public static Quantity<double, YottaJoule> ToYottaJoule<T>(this BaseQuantity<T, PicoJoule> val) where T:IConvertible {
return new Quantity<double, YottaJoule>(
Convert.ToDouble(val.Value) * 1E12
);
}
/// <summary>
/// Extension method to convert PicoJoule to ZettaJoule
/// </summary>
/// <param name="val">quantity measured in PicoJoule</param>
/// <returns>quantity measured in ZettaJoule</returns>
public static Quantity<double, ZettaJoule> ToZettaJoule<T>(this BaseQuantity<T, PicoJoule> val) where T:IConvertible {
return new Quantity<double, ZettaJoule>(
Convert.ToDouble(val.Value) * 1E12
);
}
/// <summary>
/// Extension method to convert PicoJoule to ExaJoule
/// </summary>
/// <param name="val">quantity measured in PicoJoule</param>
/// <returns>quantity measured in ExaJoule</returns>
public static Quantity<double, ExaJoule> ToExaJoule<T>(this BaseQuantity<T, PicoJoule> val) where T:IConvertible {
return new Quantity<double, ExaJoule>(
Convert.ToDouble(val.Value) * 1E12
);
}
/// <summary>
/// Extension method to convert PicoJoule to PetaJoule
/// </summary>
/// <param name="val">quantity measured in PicoJoule</param>
/// <returns>quantity measured in PetaJoule</returns>
public static Quantity<double, PetaJoule> ToPetaJoule<T>(this BaseQuantity<T, PicoJoule> val) where T:IConvertible {
return new Quantity<double, PetaJoule>(
Convert.ToDouble(val.Value) * 1E12
);
}
/// <summary>
/// Extension method to convert PicoJoule to TeraJoule
/// </summary>
/// <param name="val">quantity measured in PicoJoule</param>
/// <returns>quantity measured in TeraJoule</returns>
public static Quantity<double, TeraJoule> ToTeraJoule<T>(this BaseQuantity<T, PicoJoule> val) where T:IConvertible {
return new Quantity<double, TeraJoule>(
Convert.ToDouble(val.Value) * 1E12
);
}
/// <summary>
/// Extension method to convert PicoJoule to GigaJoule
/// </summary>
/// <param name="val">quantity measured in PicoJoule</param>
/// <returns>quantity measured in GigaJoule</returns>
public static Quantity<double, GigaJoule> ToGigaJoule<T>(this BaseQuantity<T, PicoJoule> val) where T:IConvertible {
return new Quantity<double, GigaJoule>(
Convert.ToDouble(val.Value) * 1E12
);
}
/// <summary>
/// Extension method to convert PicoJoule to MegaJoule
/// </summary>
/// <param name="val">quantity measured in PicoJoule</param>
/// <returns>quantity measured in MegaJoule</returns>
public static Quantity<double, MegaJoule> ToMegaJoule<T>(this BaseQuantity<T, PicoJoule> val) where T:IConvertible {
return new Quantity<double, MegaJoule>(
Convert.ToDouble(val.Value) * 1E12
);
}
/// <summary>
/// Extension method to convert PicoJoule to KiloJoule
/// </summary>
/// <param name="val">quantity measured in PicoJoule</param>
/// <returns>quantity measured in KiloJoule</returns>
public static Quantity<double, KiloJoule> ToKiloJoule<T>(this BaseQuantity<T, PicoJoule> val) where T:IConvertible {
return new Quantity<double, KiloJoule>(
Convert.ToDouble(val.Value) * 1E12
);
}
/// <summary>
/// Extension method to convert PicoJoule to HectoJoule
/// </summary>
/// <param name="val">quantity measured in PicoJoule</param>
/// <returns>quantity measured in HectoJoule</returns>
public static Quantity<double, HectoJoule> ToHectoJoule<T>(this BaseQuantity<T, PicoJoule> val) where T:IConvertible {
return new Quantity<double, HectoJoule>(
Convert.ToDouble(val.Value) * 1E12
);
}
/// <summary>
/// Extension method to convert PicoJoule to DekaJoule
/// </summary>
/// <param name="val">quantity measured in PicoJoule</param>
/// <returns>quantity measured in DekaJoule</returns>
public static Quantity<double, DekaJoule> ToDekaJoule<T>(this BaseQuantity<T, PicoJoule> val) where T:IConvertible {
return new Quantity<double, DekaJoule>(
Convert.ToDouble(val.Value) * 1E12
);
}
/// <summary>
/// Extension method to convert PicoJoule to DeciJoule
/// </summary>
/// <param name="val">quantity measured in PicoJoule</param>
/// <returns>quantity measured in DeciJoule</returns>
public static Quantity<double, DeciJoule> ToDeciJoule<T>(this BaseQuantity<T, PicoJoule> val) where T:IConvertible {
return new Quantity<double, DeciJoule>(
Convert.ToDouble(val.Value) * 1E12
);
}
/// <summary>
/// Extension method to convert PicoJoule to CentiJoule
/// </summary>
/// <param name="val">quantity measured in PicoJoule</param>
/// <returns>quantity measured in CentiJoule</returns>
public static Quantity<double, CentiJoule> ToCentiJoule<T>(this BaseQuantity<T, PicoJoule> val) where T:IConvertible {
return new Quantity<double, CentiJoule>(
Convert.ToDouble(val.Value) * 1E12
);
}
/// <summary>
/// Extension method to convert PicoJoule to MilliJoule
/// </summary>
/// <param name="val">quantity measured in PicoJoule</param>
/// <returns>quantity measured in MilliJoule</returns>
public static Quantity<double, MilliJoule> ToMilliJoule<T>(this BaseQuantity<T, PicoJoule> val) where T:IConvertible {
return new Quantity<double, MilliJoule>(
Convert.ToDouble(val.Value) * 1E12
);
}
/// <summary>
/// Extension method to convert PicoJoule to MicroJoule
/// </summary>
/// <param name="val">quantity measured in PicoJoule</param>
/// <returns>quantity measured in MicroJoule</returns>
public static Quantity<double, MicroJoule> ToMicroJoule<T>(this BaseQuantity<T, PicoJoule> val) where T:IConvertible {
return new Quantity<double, MicroJoule>(
Convert.ToDouble(val.Value) * 1E12
);
}
/// <summary>
/// Extension method to convert PicoJoule to NanoJoule
/// </summary>
/// <param name="val">quantity measured in PicoJoule</param>
/// <returns>quantity measured in NanoJoule</returns>
public static Quantity<double, NanoJoule> ToNanoJoule<T>(this BaseQuantity<T, PicoJoule> val) where T:IConvertible {
return new Quantity<double, NanoJoule>(
Convert.ToDouble(val.Value) * 1E12
);
}
/// <summary>
/// Extension method to convert PicoJoule to FemtoJoule
/// </summary>
/// <param name="val">quantity measured in PicoJoule</param>
/// <returns>quantity measured in FemtoJoule</returns>
public static Quantity<double, FemtoJoule> ToFemtoJoule<T>(this BaseQuantity<T, PicoJoule> val) where T:IConvertible {
return new Quantity<double, FemtoJoule>(
Convert.ToDouble(val.Value) * 1E12
);
}
/// <summary>
/// Extension method to convert PicoJoule to AttoJoule
/// </summary>
/// <param name="val">quantity measured in PicoJoule</param>
/// <returns>quantity measured in AttoJoule</returns>
public static Quantity<double, AttoJoule> ToAttoJoule<T>(this BaseQuantity<T, PicoJoule> val) where T:IConvertible {
return new Quantity<double, AttoJoule>(
Convert.ToDouble(val.Value) * 1E12
);
}
/// <summary>
/// Extension method to convert PicoJoule to ZeptoJoule
/// </summary>
/// <param name="val">quantity measured in PicoJoule</param>
/// <returns>quantity measured in ZeptoJoule</returns>
public static Quantity<double, ZeptoJoule> ToZeptoJoule<T>(this BaseQuantity<T, PicoJoule> val) where T:IConvertible {
return new Quantity<double, ZeptoJoule>(
Convert.ToDouble(val.Value) * 1E12
);
}
/// <summary>
/// Extension method to convert PicoJoule to YoctoJoule
/// </summary>
/// <param name="val">quantity measured in PicoJoule</param>
/// <returns>quantity measured in YoctoJoule</returns>
public static Quantity<double, YoctoJoule> ToYoctoJoule<T>(this BaseQuantity<T, PicoJoule> val) where T:IConvertible {
return new Quantity<double, YoctoJoule>(
Convert.ToDouble(val.Value) * 1E12
);
}
/// <summary>
/// Extension method to convert FemtoJoule to YottaJoule
/// </summary>
/// <param name="val">quantity measured in FemtoJoule</param>
/// <returns>quantity measured in YottaJoule</returns>
public static Quantity<double, YottaJoule> ToYottaJoule<T>(this BaseQuantity<T, FemtoJoule> val) where T:IConvertible {
return new Quantity<double, YottaJoule>(
Convert.ToDouble(val.Value) * 1E15
);
}
/// <summary>
/// Extension method to convert FemtoJoule to ZettaJoule
/// </summary>
/// <param name="val">quantity measured in FemtoJoule</param>
/// <returns>quantity measured in ZettaJoule</returns>
public static Quantity<double, ZettaJoule> ToZettaJoule<T>(this BaseQuantity<T, FemtoJoule> val) where T:IConvertible {
return new Quantity<double, ZettaJoule>(
Convert.ToDouble(val.Value) * 1E15
);
}
/// <summary>
/// Extension method to convert FemtoJoule to ExaJoule
/// </summary>
/// <param name="val">quantity measured in FemtoJoule</param>
/// <returns>quantity measured in ExaJoule</returns>
public static Quantity<double, ExaJoule> ToExaJoule<T>(this BaseQuantity<T, FemtoJoule> val) where T:IConvertible {
return new Quantity<double, ExaJoule>(
Convert.ToDouble(val.Value) * 1E15
);
}
/// <summary>
/// Extension method to convert FemtoJoule to PetaJoule
/// </summary>
/// <param name="val">quantity measured in FemtoJoule</param>
/// <returns>quantity measured in PetaJoule</returns>
public static Quantity<double, PetaJoule> ToPetaJoule<T>(this BaseQuantity<T, FemtoJoule> val) where T:IConvertible {
return new Quantity<double, PetaJoule>(
Convert.ToDouble(val.Value) * 1E15
);
}
/// <summary>
/// Extension method to convert FemtoJoule to TeraJoule
/// </summary>
/// <param name="val">quantity measured in FemtoJoule</param>
/// <returns>quantity measured in TeraJoule</returns>
public static Quantity<double, TeraJoule> ToTeraJoule<T>(this BaseQuantity<T, FemtoJoule> val) where T:IConvertible {
return new Quantity<double, TeraJoule>(
Convert.ToDouble(val.Value) * 1E15
);
}
/// <summary>
/// Extension method to convert FemtoJoule to GigaJoule
/// </summary>
/// <param name="val">quantity measured in FemtoJoule</param>
/// <returns>quantity measured in GigaJoule</returns>
public static Quantity<double, GigaJoule> ToGigaJoule<T>(this BaseQuantity<T, FemtoJoule> val) where T:IConvertible {
return new Quantity<double, GigaJoule>(
Convert.ToDouble(val.Value) * 1E15
);
}
/// <summary>
/// Extension method to convert FemtoJoule to MegaJoule
/// </summary>
/// <param name="val">quantity measured in FemtoJoule</param>
/// <returns>quantity measured in MegaJoule</returns>
public static Quantity<double, MegaJoule> ToMegaJoule<T>(this BaseQuantity<T, FemtoJoule> val) where T:IConvertible {
return new Quantity<double, MegaJoule>(
Convert.ToDouble(val.Value) * 1E15
);
}
/// <summary>
/// Extension method to convert FemtoJoule to KiloJoule
/// </summary>
/// <param name="val">quantity measured in FemtoJoule</param>
/// <returns>quantity measured in KiloJoule</returns>
public static Quantity<double, KiloJoule> ToKiloJoule<T>(this BaseQuantity<T, FemtoJoule> val) where T:IConvertible {
return new Quantity<double, KiloJoule>(
Convert.ToDouble(val.Value) * 1E15
);
}
/// <summary>
/// Extension method to convert FemtoJoule to HectoJoule
/// </summary>
/// <param name="val">quantity measured in FemtoJoule</param>
/// <returns>quantity measured in HectoJoule</returns>
public static Quantity<double, HectoJoule> ToHectoJoule<T>(this BaseQuantity<T, FemtoJoule> val) where T:IConvertible {
return new Quantity<double, HectoJoule>(
Convert.ToDouble(val.Value) * 1E15
);
}
/// <summary>
/// Extension method to convert FemtoJoule to DekaJoule
/// </summary>
/// <param name="val">quantity measured in FemtoJoule</param>
/// <returns>quantity measured in DekaJoule</returns>
public static Quantity<double, DekaJoule> ToDekaJoule<T>(this BaseQuantity<T, FemtoJoule> val) where T:IConvertible {
return new Quantity<double, DekaJoule>(
Convert.ToDouble(val.Value) * 1E15
);
}
/// <summary>
/// Extension method to convert FemtoJoule to DeciJoule
/// </summary>
/// <param name="val">quantity measured in FemtoJoule</param>
/// <returns>quantity measured in DeciJoule</returns>
public static Quantity<double, DeciJoule> ToDeciJoule<T>(this BaseQuantity<T, FemtoJoule> val) where T:IConvertible {
return new Quantity<double, DeciJoule>(
Convert.ToDouble(val.Value) * 1E15
);
}
/// <summary>
/// Extension method to convert FemtoJoule to CentiJoule
/// </summary>
/// <param name="val">quantity measured in FemtoJoule</param>
/// <returns>quantity measured in CentiJoule</returns>
public static Quantity<double, CentiJoule> ToCentiJoule<T>(this BaseQuantity<T, FemtoJoule> val) where T:IConvertible {
return new Quantity<double, CentiJoule>(
Convert.ToDouble(val.Value) * 1E15
);
}
/// <summary>
/// Extension method to convert FemtoJoule to MilliJoule
/// </summary>
/// <param name="val">quantity measured in FemtoJoule</param>
/// <returns>quantity measured in MilliJoule</returns>
public static Quantity<double, MilliJoule> ToMilliJoule<T>(this BaseQuantity<T, FemtoJoule> val) where T:IConvertible {
return new Quantity<double, MilliJoule>(
Convert.ToDouble(val.Value) * 1E15
);
}
/// <summary>
/// Extension method to convert FemtoJoule to MicroJoule
/// </summary>
/// <param name="val">quantity measured in FemtoJoule</param>
/// <returns>quantity measured in MicroJoule</returns>
public static Quantity<double, MicroJoule> ToMicroJoule<T>(this BaseQuantity<T, FemtoJoule> val) where T:IConvertible {
return new Quantity<double, MicroJoule>(
Convert.ToDouble(val.Value) * 1E15
);
}
/// <summary>
/// Extension method to convert FemtoJoule to NanoJoule
/// </summary>
/// <param name="val">quantity measured in FemtoJoule</param>
/// <returns>quantity measured in NanoJoule</returns>
public static Quantity<double, NanoJoule> ToNanoJoule<T>(this BaseQuantity<T, FemtoJoule> val) where T:IConvertible {
return new Quantity<double, NanoJoule>(
Convert.ToDouble(val.Value) * 1E15
);
}
/// <summary>
/// Extension method to convert FemtoJoule to PicoJoule
/// </summary>
/// <param name="val">quantity measured in FemtoJoule</param>
/// <returns>quantity measured in PicoJoule</returns>
public static Quantity<double, PicoJoule> ToPicoJoule<T>(this BaseQuantity<T, FemtoJoule> val) where T:IConvertible {
return new Quantity<double, PicoJoule>(
Convert.ToDouble(val.Value) * 1E15
);
}
/// <summary>
/// Extension method to convert FemtoJoule to AttoJoule
/// </summary>
/// <param name="val">quantity measured in FemtoJoule</param>
/// <returns>quantity measured in AttoJoule</returns>
public static Quantity<double, AttoJoule> ToAttoJoule<T>(this BaseQuantity<T, FemtoJoule> val) where T:IConvertible {
return new Quantity<double, AttoJoule>(
Convert.ToDouble(val.Value) * 1E15
);
}
/// <summary>
/// Extension method to convert FemtoJoule to ZeptoJoule
/// </summary>
/// <param name="val">quantity measured in FemtoJoule</param>
/// <returns>quantity measured in ZeptoJoule</returns>
public static Quantity<double, ZeptoJoule> ToZeptoJoule<T>(this BaseQuantity<T, FemtoJoule> val) where T:IConvertible {
return new Quantity<double, ZeptoJoule>(
Convert.ToDouble(val.Value) * 1E15
);
}
/// <summary>
/// Extension method to convert FemtoJoule to YoctoJoule
/// </summary>
/// <param name="val">quantity measured in FemtoJoule</param>
/// <returns>quantity measured in YoctoJoule</returns>
public static Quantity<double, YoctoJoule> ToYoctoJoule<T>(this BaseQuantity<T, FemtoJoule> val) where T:IConvertible {
return new Quantity<double, YoctoJoule>(
Convert.ToDouble(val.Value) * 1E15
);
}
/// <summary>
/// Extension method to convert AttoJoule to YottaJoule
/// </summary>
/// <param name="val">quantity measured in AttoJoule</param>
/// <returns>quantity measured in YottaJoule</returns>
public static Quantity<double, YottaJoule> ToYottaJoule<T>(this BaseQuantity<T, AttoJoule> val) where T:IConvertible {
return new Quantity<double, YottaJoule>(
Convert.ToDouble(val.Value) * 1E18
);
}
/// <summary>
/// Extension method to convert AttoJoule to ZettaJoule
/// </summary>
/// <param name="val">quantity measured in AttoJoule</param>
/// <returns>quantity measured in ZettaJoule</returns>
public static Quantity<double, ZettaJoule> ToZettaJoule<T>(this BaseQuantity<T, AttoJoule> val) where T:IConvertible {
return new Quantity<double, ZettaJoule>(
Convert.ToDouble(val.Value) * 1E18
);
}
/// <summary>
/// Extension method to convert AttoJoule to ExaJoule
/// </summary>
/// <param name="val">quantity measured in AttoJoule</param>
/// <returns>quantity measured in ExaJoule</returns>
public static Quantity<double, ExaJoule> ToExaJoule<T>(this BaseQuantity<T, AttoJoule> val) where T:IConvertible {
return new Quantity<double, ExaJoule>(
Convert.ToDouble(val.Value) * 1E18
);
}
/// <summary>
/// Extension method to convert AttoJoule to PetaJoule
/// </summary>
/// <param name="val">quantity measured in AttoJoule</param>
/// <returns>quantity measured in PetaJoule</returns>
public static Quantity<double, PetaJoule> ToPetaJoule<T>(this BaseQuantity<T, AttoJoule> val) where T:IConvertible {
return new Quantity<double, PetaJoule>(
Convert.ToDouble(val.Value) * 1E18
);
}
/// <summary>
/// Extension method to convert AttoJoule to TeraJoule
/// </summary>
/// <param name="val">quantity measured in AttoJoule</param>
/// <returns>quantity measured in TeraJoule</returns>
public static Quantity<double, TeraJoule> ToTeraJoule<T>(this BaseQuantity<T, AttoJoule> val) where T:IConvertible {
return new Quantity<double, TeraJoule>(
Convert.ToDouble(val.Value) * 1E18
);
}
/// <summary>
/// Extension method to convert AttoJoule to GigaJoule
/// </summary>
/// <param name="val">quantity measured in AttoJoule</param>
/// <returns>quantity measured in GigaJoule</returns>
public static Quantity<double, GigaJoule> ToGigaJoule<T>(this BaseQuantity<T, AttoJoule> val) where T:IConvertible {
return new Quantity<double, GigaJoule>(
Convert.ToDouble(val.Value) * 1E18
);
}
/// <summary>
/// Extension method to convert AttoJoule to MegaJoule
/// </summary>
/// <param name="val">quantity measured in AttoJoule</param>
/// <returns>quantity measured in MegaJoule</returns>
public static Quantity<double, MegaJoule> ToMegaJoule<T>(this BaseQuantity<T, AttoJoule> val) where T:IConvertible {
return new Quantity<double, MegaJoule>(
Convert.ToDouble(val.Value) * 1E18
);
}
/// <summary>
/// Extension method to convert AttoJoule to KiloJoule
/// </summary>
/// <param name="val">quantity measured in AttoJoule</param>
/// <returns>quantity measured in KiloJoule</returns>
public static Quantity<double, KiloJoule> ToKiloJoule<T>(this BaseQuantity<T, AttoJoule> val) where T:IConvertible {
return new Quantity<double, KiloJoule>(
Convert.ToDouble(val.Value) * 1E18
);
}
/// <summary>
/// Extension method to convert AttoJoule to HectoJoule
/// </summary>
/// <param name="val">quantity measured in AttoJoule</param>
/// <returns>quantity measured in HectoJoule</returns>
public static Quantity<double, HectoJoule> ToHectoJoule<T>(this BaseQuantity<T, AttoJoule> val) where T:IConvertible {
return new Quantity<double, HectoJoule>(
Convert.ToDouble(val.Value) * 1E18
);
}
/// <summary>
/// Extension method to convert AttoJoule to DekaJoule
/// </summary>
/// <param name="val">quantity measured in AttoJoule</param>
/// <returns>quantity measured in DekaJoule</returns>
public static Quantity<double, DekaJoule> ToDekaJoule<T>(this BaseQuantity<T, AttoJoule> val) where T:IConvertible {
return new Quantity<double, DekaJoule>(
Convert.ToDouble(val.Value) * 1E18
);
}
/// <summary>
/// Extension method to convert AttoJoule to DeciJoule
/// </summary>
/// <param name="val">quantity measured in AttoJoule</param>
/// <returns>quantity measured in DeciJoule</returns>
public static Quantity<double, DeciJoule> ToDeciJoule<T>(this BaseQuantity<T, AttoJoule> val) where T:IConvertible {
return new Quantity<double, DeciJoule>(
Convert.ToDouble(val.Value) * 1E18
);
}
/// <summary>
/// Extension method to convert AttoJoule to CentiJoule
/// </summary>
/// <param name="val">quantity measured in AttoJoule</param>
/// <returns>quantity measured in CentiJoule</returns>
public static Quantity<double, CentiJoule> ToCentiJoule<T>(this BaseQuantity<T, AttoJoule> val) where T:IConvertible {
return new Quantity<double, CentiJoule>(
Convert.ToDouble(val.Value) * 1E18
);
}
/// <summary>
/// Extension method to convert AttoJoule to MilliJoule
/// </summary>
/// <param name="val">quantity measured in AttoJoule</param>
/// <returns>quantity measured in MilliJoule</returns>
public static Quantity<double, MilliJoule> ToMilliJoule<T>(this BaseQuantity<T, AttoJoule> val) where T:IConvertible {
return new Quantity<double, MilliJoule>(
Convert.ToDouble(val.Value) * 1E18
);
}
/// <summary>
/// Extension method to convert AttoJoule to MicroJoule
/// </summary>
/// <param name="val">quantity measured in AttoJoule</param>
/// <returns>quantity measured in MicroJoule</returns>
public static Quantity<double, MicroJoule> ToMicroJoule<T>(this BaseQuantity<T, AttoJoule> val) where T:IConvertible {
return new Quantity<double, MicroJoule>(
Convert.ToDouble(val.Value) * 1E18
);
}
/// <summary>
/// Extension method to convert AttoJoule to NanoJoule
/// </summary>
/// <param name="val">quantity measured in AttoJoule</param>
/// <returns>quantity measured in NanoJoule</returns>
public static Quantity<double, NanoJoule> ToNanoJoule<T>(this BaseQuantity<T, AttoJoule> val) where T:IConvertible {
return new Quantity<double, NanoJoule>(
Convert.ToDouble(val.Value) * 1E18
);
}
/// <summary>
/// Extension method to convert AttoJoule to PicoJoule
/// </summary>
/// <param name="val">quantity measured in AttoJoule</param>
/// <returns>quantity measured in PicoJoule</returns>
public static Quantity<double, PicoJoule> ToPicoJoule<T>(this BaseQuantity<T, AttoJoule> val) where T:IConvertible {
return new Quantity<double, PicoJoule>(
Convert.ToDouble(val.Value) * 1E18
);
}
/// <summary>
/// Extension method to convert AttoJoule to FemtoJoule
/// </summary>
/// <param name="val">quantity measured in AttoJoule</param>
/// <returns>quantity measured in FemtoJoule</returns>
public static Quantity<double, FemtoJoule> ToFemtoJoule<T>(this BaseQuantity<T, AttoJoule> val) where T:IConvertible {
return new Quantity<double, FemtoJoule>(
Convert.ToDouble(val.Value) * 1E18
);
}
/// <summary>
/// Extension method to convert AttoJoule to ZeptoJoule
/// </summary>
/// <param name="val">quantity measured in AttoJoule</param>
/// <returns>quantity measured in ZeptoJoule</returns>
public static Quantity<double, ZeptoJoule> ToZeptoJoule<T>(this BaseQuantity<T, AttoJoule> val) where T:IConvertible {
return new Quantity<double, ZeptoJoule>(
Convert.ToDouble(val.Value) * 1E18
);
}
/// <summary>
/// Extension method to convert AttoJoule to YoctoJoule
/// </summary>
/// <param name="val">quantity measured in AttoJoule</param>
/// <returns>quantity measured in YoctoJoule</returns>
public static Quantity<double, YoctoJoule> ToYoctoJoule<T>(this BaseQuantity<T, AttoJoule> val) where T:IConvertible {
return new Quantity<double, YoctoJoule>(
Convert.ToDouble(val.Value) * 1E18
);
}
/// <summary>
/// Extension method to convert ZeptoJoule to YottaJoule
/// </summary>
/// <param name="val">quantity measured in ZeptoJoule</param>
/// <returns>quantity measured in YottaJoule</returns>
public static Quantity<double, YottaJoule> ToYottaJoule<T>(this BaseQuantity<T, ZeptoJoule> val) where T:IConvertible {
return new Quantity<double, YottaJoule>(
Convert.ToDouble(val.Value) * 1E21
);
}
/// <summary>
/// Extension method to convert ZeptoJoule to ZettaJoule
/// </summary>
/// <param name="val">quantity measured in ZeptoJoule</param>
/// <returns>quantity measured in ZettaJoule</returns>
public static Quantity<double, ZettaJoule> ToZettaJoule<T>(this BaseQuantity<T, ZeptoJoule> val) where T:IConvertible {
return new Quantity<double, ZettaJoule>(
Convert.ToDouble(val.Value) * 1E21
);
}
/// <summary>
/// Extension method to convert ZeptoJoule to ExaJoule
/// </summary>
/// <param name="val">quantity measured in ZeptoJoule</param>
/// <returns>quantity measured in ExaJoule</returns>
public static Quantity<double, ExaJoule> ToExaJoule<T>(this BaseQuantity<T, ZeptoJoule> val) where T:IConvertible {
return new Quantity<double, ExaJoule>(
Convert.ToDouble(val.Value) * 1E21
);
}
/// <summary>
/// Extension method to convert ZeptoJoule to PetaJoule
/// </summary>
/// <param name="val">quantity measured in ZeptoJoule</param>
/// <returns>quantity measured in PetaJoule</returns>
public static Quantity<double, PetaJoule> ToPetaJoule<T>(this BaseQuantity<T, ZeptoJoule> val) where T:IConvertible {
return new Quantity<double, PetaJoule>(
Convert.ToDouble(val.Value) * 1E21
);
}
/// <summary>
/// Extension method to convert ZeptoJoule to TeraJoule
/// </summary>
/// <param name="val">quantity measured in ZeptoJoule</param>
/// <returns>quantity measured in TeraJoule</returns>
public static Quantity<double, TeraJoule> ToTeraJoule<T>(this BaseQuantity<T, ZeptoJoule> val) where T:IConvertible {
return new Quantity<double, TeraJoule>(
Convert.ToDouble(val.Value) * 1E21
);
}
/// <summary>
/// Extension method to convert ZeptoJoule to GigaJoule
/// </summary>
/// <param name="val">quantity measured in ZeptoJoule</param>
/// <returns>quantity measured in GigaJoule</returns>
public static Quantity<double, GigaJoule> ToGigaJoule<T>(this BaseQuantity<T, ZeptoJoule> val) where T:IConvertible {
return new Quantity<double, GigaJoule>(
Convert.ToDouble(val.Value) * 1E21
);
}
/// <summary>
/// Extension method to convert ZeptoJoule to MegaJoule
/// </summary>
/// <param name="val">quantity measured in ZeptoJoule</param>
/// <returns>quantity measured in MegaJoule</returns>
public static Quantity<double, MegaJoule> ToMegaJoule<T>(this BaseQuantity<T, ZeptoJoule> val) where T:IConvertible {
return new Quantity<double, MegaJoule>(
Convert.ToDouble(val.Value) * 1E21
);
}
/// <summary>
/// Extension method to convert ZeptoJoule to KiloJoule
/// </summary>
/// <param name="val">quantity measured in ZeptoJoule</param>
/// <returns>quantity measured in KiloJoule</returns>
public static Quantity<double, KiloJoule> ToKiloJoule<T>(this BaseQuantity<T, ZeptoJoule> val) where T:IConvertible {
return new Quantity<double, KiloJoule>(
Convert.ToDouble(val.Value) * 1E21
);
}
/// <summary>
/// Extension method to convert ZeptoJoule to HectoJoule
/// </summary>
/// <param name="val">quantity measured in ZeptoJoule</param>
/// <returns>quantity measured in HectoJoule</returns>
public static Quantity<double, HectoJoule> ToHectoJoule<T>(this BaseQuantity<T, ZeptoJoule> val) where T:IConvertible {
return new Quantity<double, HectoJoule>(
Convert.ToDouble(val.Value) * 1E21
);
}
/// <summary>
/// Extension method to convert ZeptoJoule to DekaJoule
/// </summary>
/// <param name="val">quantity measured in ZeptoJoule</param>
/// <returns>quantity measured in DekaJoule</returns>
public static Quantity<double, DekaJoule> ToDekaJoule<T>(this BaseQuantity<T, ZeptoJoule> val) where T:IConvertible {
return new Quantity<double, DekaJoule>(
Convert.ToDouble(val.Value) * 1E21
);
}
/// <summary>
/// Extension method to convert ZeptoJoule to DeciJoule
/// </summary>
/// <param name="val">quantity measured in ZeptoJoule</param>
/// <returns>quantity measured in DeciJoule</returns>
public static Quantity<double, DeciJoule> ToDeciJoule<T>(this BaseQuantity<T, ZeptoJoule> val) where T:IConvertible {
return new Quantity<double, DeciJoule>(
Convert.ToDouble(val.Value) * 1E21
);
}
/// <summary>
/// Extension method to convert ZeptoJoule to CentiJoule
/// </summary>
/// <param name="val">quantity measured in ZeptoJoule</param>
/// <returns>quantity measured in CentiJoule</returns>
public static Quantity<double, CentiJoule> ToCentiJoule<T>(this BaseQuantity<T, ZeptoJoule> val) where T:IConvertible {
return new Quantity<double, CentiJoule>(
Convert.ToDouble(val.Value) * 1E21
);
}
/// <summary>
/// Extension method to convert ZeptoJoule to MilliJoule
/// </summary>
/// <param name="val">quantity measured in ZeptoJoule</param>
/// <returns>quantity measured in MilliJoule</returns>
public static Quantity<double, MilliJoule> ToMilliJoule<T>(this BaseQuantity<T, ZeptoJoule> val) where T:IConvertible {
return new Quantity<double, MilliJoule>(
Convert.ToDouble(val.Value) * 1E21
);
}
/// <summary>
/// Extension method to convert ZeptoJoule to MicroJoule
/// </summary>
/// <param name="val">quantity measured in ZeptoJoule</param>
/// <returns>quantity measured in MicroJoule</returns>
public static Quantity<double, MicroJoule> ToMicroJoule<T>(this BaseQuantity<T, ZeptoJoule> val) where T:IConvertible {
return new Quantity<double, MicroJoule>(
Convert.ToDouble(val.Value) * 1E21
);
}
/// <summary>
/// Extension method to convert ZeptoJoule to NanoJoule
/// </summary>
/// <param name="val">quantity measured in ZeptoJoule</param>
/// <returns>quantity measured in NanoJoule</returns>
public static Quantity<double, NanoJoule> ToNanoJoule<T>(this BaseQuantity<T, ZeptoJoule> val) where T:IConvertible {
return new Quantity<double, NanoJoule>(
Convert.ToDouble(val.Value) * 1E21
);
}
/// <summary>
/// Extension method to convert ZeptoJoule to PicoJoule
/// </summary>
/// <param name="val">quantity measured in ZeptoJoule</param>
/// <returns>quantity measured in PicoJoule</returns>
public static Quantity<double, PicoJoule> ToPicoJoule<T>(this BaseQuantity<T, ZeptoJoule> val) where T:IConvertible {
return new Quantity<double, PicoJoule>(
Convert.ToDouble(val.Value) * 1E21
);
}
/// <summary>
/// Extension method to convert ZeptoJoule to FemtoJoule
/// </summary>
/// <param name="val">quantity measured in ZeptoJoule</param>
/// <returns>quantity measured in FemtoJoule</returns>
public static Quantity<double, FemtoJoule> ToFemtoJoule<T>(this BaseQuantity<T, ZeptoJoule> val) where T:IConvertible {
return new Quantity<double, FemtoJoule>(
Convert.ToDouble(val.Value) * 1E21
);
}
/// <summary>
/// Extension method to convert ZeptoJoule to AttoJoule
/// </summary>
/// <param name="val">quantity measured in ZeptoJoule</param>
/// <returns>quantity measured in AttoJoule</returns>
public static Quantity<double, AttoJoule> ToAttoJoule<T>(this BaseQuantity<T, ZeptoJoule> val) where T:IConvertible {
return new Quantity<double, AttoJoule>(
Convert.ToDouble(val.Value) * 1E21
);
}
/// <summary>
/// Extension method to convert ZeptoJoule to YoctoJoule
/// </summary>
/// <param name="val">quantity measured in ZeptoJoule</param>
/// <returns>quantity measured in YoctoJoule</returns>
public static Quantity<double, YoctoJoule> ToYoctoJoule<T>(this BaseQuantity<T, ZeptoJoule> val) where T:IConvertible {
return new Quantity<double, YoctoJoule>(
Convert.ToDouble(val.Value) * 1E21
);
}
/// <summary>
/// Extension method to convert YoctoJoule to YottaJoule
/// </summary>
/// <param name="val">quantity measured in YoctoJoule</param>
/// <returns>quantity measured in YottaJoule</returns>
public static Quantity<double, YottaJoule> ToYottaJoule<T>(this BaseQuantity<T, YoctoJoule> val) where T:IConvertible {
return new Quantity<double, YottaJoule>(
Convert.ToDouble(val.Value) * 1E24
);
}
/// <summary>
/// Extension method to convert YoctoJoule to ZettaJoule
/// </summary>
/// <param name="val">quantity measured in YoctoJoule</param>
/// <returns>quantity measured in ZettaJoule</returns>
public static Quantity<double, ZettaJoule> ToZettaJoule<T>(this BaseQuantity<T, YoctoJoule> val) where T:IConvertible {
return new Quantity<double, ZettaJoule>(
Convert.ToDouble(val.Value) * 1E24
);
}
/// <summary>
/// Extension method to convert YoctoJoule to ExaJoule
/// </summary>
/// <param name="val">quantity measured in YoctoJoule</param>
/// <returns>quantity measured in ExaJoule</returns>
public static Quantity<double, ExaJoule> ToExaJoule<T>(this BaseQuantity<T, YoctoJoule> val) where T:IConvertible {
return new Quantity<double, ExaJoule>(
Convert.ToDouble(val.Value) * 1E24
);
}
/// <summary>
/// Extension method to convert YoctoJoule to PetaJoule
/// </summary>
/// <param name="val">quantity measured in YoctoJoule</param>
/// <returns>quantity measured in PetaJoule</returns>
public static Quantity<double, PetaJoule> ToPetaJoule<T>(this BaseQuantity<T, YoctoJoule> val) where T:IConvertible {
return new Quantity<double, PetaJoule>(
Convert.ToDouble(val.Value) * 1E24
);
}
/// <summary>
/// Extension method to convert YoctoJoule to TeraJoule
/// </summary>
/// <param name="val">quantity measured in YoctoJoule</param>
/// <returns>quantity measured in TeraJoule</returns>
public static Quantity<double, TeraJoule> ToTeraJoule<T>(this BaseQuantity<T, YoctoJoule> val) where T:IConvertible {
return new Quantity<double, TeraJoule>(
Convert.ToDouble(val.Value) * 1E24
);
}
/// <summary>
/// Extension method to convert YoctoJoule to GigaJoule
/// </summary>
/// <param name="val">quantity measured in YoctoJoule</param>
/// <returns>quantity measured in GigaJoule</returns>
public static Quantity<double, GigaJoule> ToGigaJoule<T>(this BaseQuantity<T, YoctoJoule> val) where T:IConvertible {
return new Quantity<double, GigaJoule>(
Convert.ToDouble(val.Value) * 1E24
);
}
/// <summary>
/// Extension method to convert YoctoJoule to MegaJoule
/// </summary>
/// <param name="val">quantity measured in YoctoJoule</param>
/// <returns>quantity measured in MegaJoule</returns>
public static Quantity<double, MegaJoule> ToMegaJoule<T>(this BaseQuantity<T, YoctoJoule> val) where T:IConvertible {
return new Quantity<double, MegaJoule>(
Convert.ToDouble(val.Value) * 1E24
);
}
/// <summary>
/// Extension method to convert YoctoJoule to KiloJoule
/// </summary>
/// <param name="val">quantity measured in YoctoJoule</param>
/// <returns>quantity measured in KiloJoule</returns>
public static Quantity<double, KiloJoule> ToKiloJoule<T>(this BaseQuantity<T, YoctoJoule> val) where T:IConvertible {
return new Quantity<double, KiloJoule>(
Convert.ToDouble(val.Value) * 1E24
);
}
/// <summary>
/// Extension method to convert YoctoJoule to HectoJoule
/// </summary>
/// <param name="val">quantity measured in YoctoJoule</param>
/// <returns>quantity measured in HectoJoule</returns>
public static Quantity<double, HectoJoule> ToHectoJoule<T>(this BaseQuantity<T, YoctoJoule> val) where T:IConvertible {
return new Quantity<double, HectoJoule>(
Convert.ToDouble(val.Value) * 1E24
);
}
/// <summary>
/// Extension method to convert YoctoJoule to DekaJoule
/// </summary>
/// <param name="val">quantity measured in YoctoJoule</param>
/// <returns>quantity measured in DekaJoule</returns>
public static Quantity<double, DekaJoule> ToDekaJoule<T>(this BaseQuantity<T, YoctoJoule> val) where T:IConvertible {
return new Quantity<double, DekaJoule>(
Convert.ToDouble(val.Value) * 1E24
);
}
/// <summary>
/// Extension method to convert YoctoJoule to DeciJoule
/// </summary>
/// <param name="val">quantity measured in YoctoJoule</param>
/// <returns>quantity measured in DeciJoule</returns>
public static Quantity<double, DeciJoule> ToDeciJoule<T>(this BaseQuantity<T, YoctoJoule> val) where T:IConvertible {
return new Quantity<double, DeciJoule>(
Convert.ToDouble(val.Value) * 1E24
);
}
/// <summary>
/// Extension method to convert YoctoJoule to CentiJoule
/// </summary>
/// <param name="val">quantity measured in YoctoJoule</param>
/// <returns>quantity measured in CentiJoule</returns>
public static Quantity<double, CentiJoule> ToCentiJoule<T>(this BaseQuantity<T, YoctoJoule> val) where T:IConvertible {
return new Quantity<double, CentiJoule>(
Convert.ToDouble(val.Value) * 1E24
);
}
/// <summary>
/// Extension method to convert YoctoJoule to MilliJoule
/// </summary>
/// <param name="val">quantity measured in YoctoJoule</param>
/// <returns>quantity measured in MilliJoule</returns>
public static Quantity<double, MilliJoule> ToMilliJoule<T>(this BaseQuantity<T, YoctoJoule> val) where T:IConvertible {
return new Quantity<double, MilliJoule>(
Convert.ToDouble(val.Value) * 1E24
);
}
/// <summary>
/// Extension method to convert YoctoJoule to MicroJoule
/// </summary>
/// <param name="val">quantity measured in YoctoJoule</param>
/// <returns>quantity measured in MicroJoule</returns>
public static Quantity<double, MicroJoule> ToMicroJoule<T>(this BaseQuantity<T, YoctoJoule> val) where T:IConvertible {
return new Quantity<double, MicroJoule>(
Convert.ToDouble(val.Value) * 1E24
);
}
/// <summary>
/// Extension method to convert YoctoJoule to NanoJoule
/// </summary>
/// <param name="val">quantity measured in YoctoJoule</param>
/// <returns>quantity measured in NanoJoule</returns>
public static Quantity<double, NanoJoule> ToNanoJoule<T>(this BaseQuantity<T, YoctoJoule> val) where T:IConvertible {
return new Quantity<double, NanoJoule>(
Convert.ToDouble(val.Value) * 1E24
);
}
/// <summary>
/// Extension method to convert YoctoJoule to PicoJoule
/// </summary>
/// <param name="val">quantity measured in YoctoJoule</param>
/// <returns>quantity measured in PicoJoule</returns>
public static Quantity<double, PicoJoule> ToPicoJoule<T>(this BaseQuantity<T, YoctoJoule> val) where T:IConvertible {
return new Quantity<double, PicoJoule>(
Convert.ToDouble(val.Value) * 1E24
);
}
/// <summary>
/// Extension method to convert YoctoJoule to FemtoJoule
/// </summary>
/// <param name="val">quantity measured in YoctoJoule</param>
/// <returns>quantity measured in FemtoJoule</returns>
public static Quantity<double, FemtoJoule> ToFemtoJoule<T>(this BaseQuantity<T, YoctoJoule> val) where T:IConvertible {
return new Quantity<double, FemtoJoule>(
Convert.ToDouble(val.Value) * 1E24
);
}
/// <summary>
/// Extension method to convert YoctoJoule to AttoJoule
/// </summary>
/// <param name="val">quantity measured in YoctoJoule</param>
/// <returns>quantity measured in AttoJoule</returns>
public static Quantity<double, AttoJoule> ToAttoJoule<T>(this BaseQuantity<T, YoctoJoule> val) where T:IConvertible {
return new Quantity<double, AttoJoule>(
Convert.ToDouble(val.Value) * 1E24
);
}
/// <summary>
/// Extension method to convert YoctoJoule to ZeptoJoule
/// </summary>
/// <param name="val">quantity measured in YoctoJoule</param>
/// <returns>quantity measured in ZeptoJoule</returns>
public static Quantity<double, ZeptoJoule> ToZeptoJoule<T>(this BaseQuantity<T, YoctoJoule> val) where T:IConvertible {
return new Quantity<double, ZeptoJoule>(
Convert.ToDouble(val.Value) * 1E24
);
}
}
}
| 44.714829
| 120
| 0.663802
|
[
"MIT"
] |
qkmaxware/CsUnits
|
Units/src/Qkmaxware/Units/Energy/JouleEnergyConversions.cs
| 188,160
|
C#
|
using System;
using Xamarin.Forms;
using SkiaSharp;
using SkiaSharp.Views.Forms;
namespace SkiaSharpFormsDemos.Effects
{
public partial class BitmapTileFlipModesPage : ContentPage
{
SKBitmap bitmap;
public BitmapTileFlipModesPage ()
{
InitializeComponent ();
SKBitmap origBitmap = BitmapExtensions.LoadBitmapResource(
GetType(), "SkiaSharpFormsDemos.Media.SeatedMonkey.jpg");
// Define cropping rect
SKRectI cropRect = new SKRectI(5, 27, 296, 260);
// Get the cropped bitmap
SKBitmap croppedBitmap = new SKBitmap(cropRect.Width, cropRect.Height);
origBitmap.ExtractSubset(croppedBitmap, cropRect);
// Resize to half the width and height
SKImageInfo info = new SKImageInfo(cropRect.Width / 2, cropRect.Height / 2);
bitmap = croppedBitmap.Resize(info, SKBitmapResizeMethod.Box);
}
void OnPickerSelectedIndexChanged(object sender, EventArgs args)
{
canvasView.InvalidateSurface();
}
void OnCanvasViewPaintSurface(object sender, SKPaintSurfaceEventArgs args)
{
SKImageInfo info = args.Info;
SKSurface surface = args.Surface;
SKCanvas canvas = surface.Canvas;
canvas.Clear();
// Get tile modes from Pickers
SKShaderTileMode xTileMode =
(SKShaderTileMode)(xModePicker.SelectedIndex == -1 ?
0 : xModePicker.SelectedItem);
SKShaderTileMode yTileMode =
(SKShaderTileMode)(yModePicker.SelectedIndex == -1 ?
0 : yModePicker.SelectedItem);
using (SKPaint paint = new SKPaint())
{
paint.Shader = SKShader.CreateBitmap(bitmap, xTileMode, yTileMode);
canvas.DrawRect(info.Rect, paint);
}
}
}
}
| 32.096774
| 88
| 0.591457
|
[
"Apache-2.0"
] |
15217711253/xamarin-forms-samples
|
SkiaSharpForms/Demos/Demos/SkiaSharpFormsDemos/Effects/BitmapTileFlipModesPage.xaml.cs
| 1,992
|
C#
|
using System.IdentityModel.Tokens.Jwt;
using System.Net.Http;
using IdentityServer4.EntityFramework.DbContexts;
using IdentityServer4.EntityFramework.Storage;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.IdentityModel.Logging;
namespace Auth.Admin
{
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
private IConfiguration Configuration { get; }
public void ConfigureServices(IServiceCollection services)
{
JwtSecurityTokenHandler.DefaultMapInboundClaims = false;
IdentityModelEventSource.ShowPII = true;
services.AddConfigurationDbContext<ConfigurationDbContext>(
options => options.ConfigureDbContext = builder =>
builder.UseSqlServer(Configuration.GetConnectionString("auth-db")));
services
.AddAuthentication(options =>
{
options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
options.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme;
})
.AddCookie(CookieAuthenticationDefaults.AuthenticationScheme)
.AddOpenIdConnect(OpenIdConnectDefaults.AuthenticationScheme, options =>
{
options.Authority = Configuration.GetServiceUri("auth")!.ToString().TrimEnd('/');
options.ClientId = "auth-admin-client";
options.ClientSecret = "secret";
options.ResponseType = "code";
options.BackchannelHttpHandler = new HttpClientHandler
{
ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator
};
options.SaveTokens = true;
options.Scope.Add("offline_access");
});
services
.AddRazorPages()
.AddRazorPagesOptions(
options =>
{
options.Conventions
.AuthorizePage("/Index")
.AuthorizeFolder("/ApiResources")
.AuthorizeFolder("/Clients")
.AuthorizeFolder("/IdentityResources");
});
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment() || env.IsEnvironment("Docker"))
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseExceptionHandler("/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.UseRouting();
app.UseAuthentication();
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
endpoints
.MapRazorPages()
.RequireAuthorization();
});
}
}
}
| 35.660194
| 143
| 0.578818
|
[
"MIT"
] |
miroslavpopovic/auth-microservice-sample
|
src/Auth.Admin/Startup.cs
| 3,673
|
C#
|
// <copyright file="BingMainPage.cs" company="Automate The Planet Ltd.">
// Copyright 2021 Automate The Planet Ltd.
// Licensed under the Apache License, Version 2.0 (the "License");
// You may not use this file except in compliance with the License.
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
// <author>Anton Angelov</author>
// <site>http://automatetheplanet.com/</site>
using SingletonDesignPattern.Core;
namespace SingletonDesignPattern.Pages.BingMainPage
{
public class BingMainPage : BasePage<BingMainPageElementMap, BingMainPageValidator>
{
public BingMainPage() : base(@"http://www.bing.com/")
{
}
public void Search(string textToType)
{
Map.SearchBox.Clear();
Map.SearchBox.SendKeys(textToType);
Map.GoButton.Click();
}
}
}
| 37.90625
| 87
| 0.702391
|
[
"Apache-2.0"
] |
AutomateThePlanet/AutomateThePlanet-Learning-Series
|
dotnet/Design-Architecture-Series/SingletonDesignPattern/Pages/BingMainPage/BingMainPage.cs
| 1,215
|
C#
|
using System;
using System.Linq;
using GemBox.Document;
using GemBox.Document.Tables;
class Program
{
static void Main(string[] args)
{
// If using Professional version, put your serial key below.
ComponentInfo.SetLicense("FREE-LIMITED-KEY");
DocumentModel document = DocumentModel.Load("Invoice.docx");
int numberOfItems = 10;
// Document contains 4 tables. Each table contains some set of information.
Table[] tables = document.GetChildElements(true, ElementType.Table).Cast<Table>().ToArray();
// First table contains invoice number and date.
Table invoiceTable = tables[0];
int invoiceNumber = 14;
// We can get and cast first paragraph using:
// a) Linq
invoiceTable.Rows[0].Cells[1].Blocks.Cast<Paragraph>().First().Inlines.Add(new Run(document, invoiceNumber.ToString()));
// b) ElementCollection.Cast<TElement>(int index)
invoiceTable.Rows[1].Cells[1].Blocks.Cast<Paragraph>(0).Inlines.Add(new Run(document, DateTime.Now.ToShortDateString()));
// Second table contains customer data.
Table customerTable = tables[1];
customerTable.Rows[0].Cells[1].Blocks.Add(new Paragraph(document, "ACME Corp"));
customerTable.Rows[1].Cells[1].Blocks.Add(new Paragraph(document, "240 Old Country Road, Springfield, IL"));
customerTable.Rows[2].Cells[1].Blocks.Add(new Paragraph(document, "USA"));
customerTable.Rows[3].Cells[1].Blocks.Add(new Paragraph(document, "Joe Smith"));
// Third table contains amount and prices.
Table mainTable = tables[2];
// Our main table contains only one row (for one item). If we have more items then we need to clone it.
for (int i = 1; i < numberOfItems; i++)
mainTable.Rows.Insert(1, mainTable.Rows[1].Clone(true));
DateTime startDate = DateTime.Now.AddDays(-numberOfItems);
int total = 0;
int rowIndex;
for (rowIndex = 1; rowIndex < numberOfItems + 1; rowIndex++)
{
mainTable.Rows[rowIndex].Cells[0].Blocks.Add(new Paragraph(document, startDate.AddDays(rowIndex - 1).ToString("dddd, MMMM d, yyyy")));
// We worked between 6 and 8 hours per day.
int workHours = rowIndex % 3 + 6;
int price = workHours * 35;
total += price;
mainTable.Rows[rowIndex].Cells[1].Blocks.Cast<Paragraph>(0).Inlines.Add(new Run(document, workHours.ToString()));
mainTable.Rows[rowIndex].Cells[2].Blocks.Cast<Paragraph>(0).Inlines.Add(new Run(document, "35.00"));
mainTable.Rows[rowIndex].Cells[3].Blocks.Cast<Paragraph>(0).Inlines.Add(new Run(document, price.ToString("0.00")));
}
mainTable.Rows[rowIndex].Cells[3].Blocks.Cast<Paragraph>(0).Inlines.Add(new Run(document, total.ToString("0.00")));
// Fourth table contains notes
Table notesTable = tables[3];
notesTable.Rows[1].Cells[0].Blocks.Add(new Paragraph(document, "Payment via check."));
document.Save("Template Use.docx");
}
}
| 46.283582
| 146
| 0.649468
|
[
"MIT"
] |
nojkhieppso/GemBox.Document
|
Template Use/TemplateUseCs/Program.cs
| 3,101
|
C#
|
using System;
using System.Threading;
using System.Threading.Tasks;
namespace Dunk.Tools.Foundation.Collections
{
/// <summary>
/// A <see cref="IThrottledProcessingQueue"/> implementation that manages the number
/// of concurrent operations that can be processed at once.
/// </summary>
public sealed class ThrottledProcessingQueue : ThrottledProcessingQueueBase
{
private long _operationsInProcess = 0;
/// <summary>
/// Initialises a new default instance of <see cref="ThrottledProcessingQueue"/> that
/// supports up to 50 concurrent operations.
/// </summary>
public ThrottledProcessingQueue()
: this(50)
{
}
/// <summary>
/// Initialises a new instance of <see cref="ThrottledProcessingQueue"/> that supports
/// a specified number of concurrent operations.
/// </summary>
/// <param name="maxOperations">The maximum numer of operations processed by this queue at once.</param>
public ThrottledProcessingQueue(int maxOperations)
:base(maxOperations)
{
}
#region ThrottledProcessingQueueBase Overrides
/// <inheritdoc />
public override long OperationsInProcess { get { return _operationsInProcess; } }
/// <inheritdoc />
public override void RegisterOperation(Task operation, TaskScheduler scheduler)
{
if (operation == null)
{
throw new ArgumentNullException(nameof(operation), $"{nameof(operation)} parameter cannot be null.");
}
if (scheduler == null)
{
throw new ArgumentNullException(nameof(scheduler), $"{nameof(scheduler)} parameter cannot be null.");
}
if (operation.Status != TaskStatus.Created)
{
throw new ArgumentException(
$"{nameof(operation)} has already been started and cannot be registerd in Processing Queue. Expected Task status is {TaskStatus.Created} but was {operation.Status}",
nameof(operation));
}
if (Interlocked.Read(ref _operationsInProcess) >= MaxOperations)
{
//processing queue is currently full, so enqueue operation for later processing
QueuedOperations.Enqueue(operation);
}
else
{
//queue is not full, so start operation and increment number of tasks in process
Interlocked.Increment(ref _operationsInProcess);
operation.Start(scheduler);
}
}
#endregion ThrottledProcessingQueueBase Overrides
/// <summary>
/// Updates the processing queue after an operation finishes (either due to success or failure)
/// and attempts to process the next enqueued operation.
/// </summary>
public void UpdateProcessingQueue()
{
//decrement number of tasks in process
Interlocked.Decrement(ref _operationsInProcess);
//ensure in process never drops below 0
Interlocked.CompareExchange(ref _operationsInProcess, 0, -1);
//Attempt to remove and register the next enqueued operation
Task operation;
if (QueuedOperations.TryDequeue(out operation))
{
RegisterOperation(operation);
}
}
}
}
| 39.224719
| 185
| 0.604984
|
[
"MIT"
] |
c1gdoyle/Dunk.Tools.Foundation
|
Dunk.Tools.Foundation/Collections/ThrottledProcessingQueue.cs
| 3,493
|
C#
|
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace TatumPlatform.Model.Requests
{
public class TransactionFilterAccount
{
[Required]
[StringLength(24, MinimumLength = 24)]
[JsonPropertyName("id")]
public string Id { get; set; }
[StringLength(24, MinimumLength = 24)]
[JsonPropertyName("counterAccount")]
public string CounterAccount { get; set; }
[JsonPropertyName("from")]
public ulong From { get; set; }
[JsonPropertyName("to")]
public ulong To { get; set; }
[StringLength(50, MinimumLength = 1)]
[JsonPropertyName("currency")]
public string Currency { get; set; }
[JsonPropertyName("transactionType")]
public string TransactionType { get; set; }
[JsonPropertyName("opType")]
public string OpType { get; set; }
[StringLength(100, MinimumLength = 1)]
[JsonPropertyName("transactionCode")]
public string TransactionCode { get; set; }
[StringLength(100, MinimumLength = 1)]
[JsonPropertyName("paymentId")]
public string PaymentId { get; set; }
[StringLength(500, MinimumLength = 1)]
[JsonPropertyName("recipientNote")]
public string RecipientNote { get; set; }
[StringLength(500, MinimumLength = 1)]
[JsonPropertyName("senderNote")]
public string SenderNote { get; set; }
}
}
| 29.62
| 51
| 0.621202
|
[
"MIT"
] |
saman-hosseini/tatum-csharp
|
src/Tatum/Model/Requests/Ledger/TransactionFilterAccount.cs
| 1,483
|
C#
|
#if UNITY_EDITOR
using System;
using UnityEditor;
using UnityEngine.Experimental.Input.Editor.Lists;
using UnityEngine.Experimental.Input.Utilities;
namespace UnityEngine.Experimental.Input.Editor
{
/// <summary>
/// Base class for views that show the properties of actions or bindings.
/// </summary>
internal abstract class PropertiesViewBase
{
protected PropertiesViewBase(string label, SerializedProperty bindingOrAction, Action<FourCC> onChange, string expectedControlLayout = null)
{
if (bindingOrAction == null)
throw new ArgumentNullException(nameof(bindingOrAction));
m_InteractionsProperty = bindingOrAction.FindPropertyRelative("m_Interactions");
m_ProcessorsProperty = bindingOrAction.FindPropertyRelative("m_Processors");
m_InteractionsList = new InteractionsListView(m_InteractionsProperty, OnInteractionsModified, null);
m_ProcessorsList = new ProcessorsListView(m_ProcessorsProperty, OnProcessorsModified, expectedControlLayout);
m_OnChange = onChange;
m_GeneralFoldoutLabel = EditorGUIUtility.TrTextContent(label);
}
public void OnGUI()
{
EditorGUILayout.BeginVertical();
DrawGeneralGroup();
EditorGUILayout.Space();
DrawInteractionsGroup();
EditorGUILayout.Space();
DrawProcessorsGroup();
GUILayout.FlexibleSpace();
EditorGUILayout.EndVertical();
}
protected abstract void DrawGeneralProperties();
private void DrawGeneralGroup()
{
m_GeneralFoldout = DrawFoldout(m_GeneralFoldoutLabel, m_GeneralFoldout);
if (m_GeneralFoldout)
{
EditorGUI.indentLevel++;
DrawGeneralProperties();
EditorGUI.indentLevel--;
}
}
private void DrawProcessorsGroup()
{
m_ProcessorsFoldout = DrawFoldout(s_ProcessorsFoldoutLabel, m_ProcessorsFoldout);
if (m_ProcessorsFoldout)
{
EditorGUI.indentLevel++;
m_ProcessorsList.OnGUI();
EditorGUI.indentLevel--;
}
}
private void DrawInteractionsGroup()
{
m_InteractionsFoldout = DrawFoldout(s_InteractionsFoldoutLabel, m_InteractionsFoldout);
if (m_InteractionsFoldout)
{
EditorGUI.indentLevel++;
m_InteractionsList.OnGUI();
EditorGUI.indentLevel--;
}
}
private static bool DrawFoldout(GUIContent content, bool folded)
{
var bgRect = GUILayoutUtility.GetRect(content, Styles.s_FoldoutBackgroundStyle);
EditorGUI.LabelField(bgRect, GUIContent.none, Styles.s_FoldoutBackgroundStyle);
return EditorGUI.Foldout(bgRect, folded, content, Styles.s_FoldoutStyle);
}
private void OnProcessorsModified()
{
m_ProcessorsProperty.stringValue = m_ProcessorsList.ToSerializableString();
m_OnChange(k_ProcessorsChanged);
}
private void OnInteractionsModified()
{
m_InteractionsProperty.stringValue = m_InteractionsList.ToSerializableString();
m_OnChange(k_InteractionsChanged);
}
public Action<FourCC> onChange => m_OnChange;
private bool m_GeneralFoldout = true;
private bool m_InteractionsFoldout = true;
private bool m_ProcessorsFoldout = true;
private Action<FourCC> m_OnChange;
private readonly InteractionsListView m_InteractionsList;
private readonly ProcessorsListView m_ProcessorsList;
private readonly SerializedProperty m_InteractionsProperty;
private readonly SerializedProperty m_ProcessorsProperty;
private readonly GUIContent m_GeneralFoldoutLabel;
private static readonly GUIContent s_ProcessorsFoldoutLabel = EditorGUIUtility.TrTextContent("Processors");
private static readonly GUIContent s_InteractionsFoldoutLabel = EditorGUIUtility.TrTextContent("Interactions");
public static FourCC k_InteractionsChanged => new FourCC("IACT");
public static FourCC k_ProcessorsChanged => new FourCC("PROC");
private static class Styles
{
public static readonly GUIStyle s_FoldoutBackgroundStyle = new GUIStyle("Label");
public static readonly GUIStyle s_FoldoutStyle = new GUIStyle("foldout");
static Styles()
{
var darkGreyBackgroundWithBorderTexture =
AssetDatabase.LoadAssetAtPath<Texture2D>(
InputActionTreeView.ResourcesPath + "foldoutBackground.png");
s_FoldoutBackgroundStyle.normal.background = darkGreyBackgroundWithBorderTexture;
s_FoldoutBackgroundStyle.border = new RectOffset(3, 3, 3, 3);
s_FoldoutBackgroundStyle.margin = new RectOffset(1, 1, 3, 3);
}
}
}
}
#endif // UNITY_EDITOR
| 37.794118
| 148
| 0.653891
|
[
"MIT"
] |
ToadsworthLP/Millenium
|
Library/PackageCache/com.unity.inputsystem@0.2.6-preview/InputSystem/Editor/AssetEditor/PropertiesViewBase.cs
| 5,140
|
C#
|
using System.Collections.Generic;
namespace Material.Styles.Internal
{
internal static class IconsDataSet
{
internal const string UnknownIconData =
"M11,15H13V17H11V15M11,7H13V13H11V7M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20Z";
internal static IDictionary<string, string> CreateDataSet() => new Dictionary<string, string>
{
{"Calendar", "M19,19H5V8H19M16,1V3H8V1H6V3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3H18V1M17,12H12V17H17V12Z"},
{"ChevronLeft", "M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z"},
{"ChevronRight", "M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z"},
{"EyeOutline", "M12,9A3,3 0 0,1 15,12A3,3 0 0,1 12,15A3,3 0 0,1 9,12A3,3 0 0,1 12,9M12,4.5C17,4.5 21.27,7.61 23,12C21.27,16.39 17,19.5 12,19.5C7,19.5 2.73,16.39 1,12C2.73,7.61 7,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C15.76,17.5 19.17,15.36 20.82,12C19.17,8.64 15.76,6.5 12,6.5C8.24,6.5 4.83,8.64 3.18,12Z"},
{"EyeOffOutline", "M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z"},
{"Close", "M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"},
// Context menu -- For TextBox context menu use
{"MaterialContentCut", "M19 3L13 9L15 11L22 4V3M12 12.5A0.5 0.5 0 0 1 11.5 12A0.5 0.5 0 0 1 12 11.5A0.5 0.5 0 0 1 12.5 12A0.5 0.5 0 0 1 12 12.5M6 20A2 2 0 0 1 4 18C4 16.89 4.9 16 6 16A2 2 0 0 1 8 18C8 19.11 7.1 20 6 20M6 8A2 2 0 0 1 4 6C4 4.89 4.9 4 6 4A2 2 0 0 1 8 6C8 7.11 7.1 8 6 8M9.64 7.64C9.87 7.14 10 6.59 10 6A4 4 0 0 0 6 2A4 4 0 0 0 2 6A4 4 0 0 0 6 10C6.59 10 7.14 9.87 7.64 9.64L10 12L7.64 14.36C7.14 14.13 6.59 14 6 14A4 4 0 0 0 2 18A4 4 0 0 0 6 22A4 4 0 0 0 10 18C10 17.41 9.87 16.86 9.64 16.36L12 14L19 21H22V20L9.64 7.64Z"},
{"MaterialContentCopy", "M19 21H8V7H19M19 5H8A2 2 0 0 0 6 7V21A2 2 0 0 0 8 23H19A2 2 0 0 0 21 21V7A2 2 0 0 0 19 5M16 1H4A2 2 0 0 0 2 3V17H4V3H16V1Z"},
{"MaterialContentPaste", "M19 20H5V4H7V7H17V4H19M12 2A1 1 0 0 1 13 3A1 1 0 0 1 12 4A1 1 0 0 1 11 3A1 1 0 0 1 12 2M19 2H14.82C14.4 0.84 13.3 0 12 0C10.7 0 9.6 0.84 9.18 2H5A2 2 0 0 0 3 4V20A2 2 0 0 0 5 22H19A2 2 0 0 0 21 20V4A2 2 0 0 0 19 2Z"},
{"MaterialSelectAll", "M9 9H15V15H9M7 17H17V7H7M15 5H17V3H15M15 21H17V19H15M19 17H21V15H19M19 9H21V7H19M19 21A2 2 0 0 0 21 19H19M19 13H21V11H19M11 21H13V19H11M9 3H7V5H9M3 17H5V15H3M5 21V19H3A2 2 0 0 0 5 21M19 3V5H21A2 2 0 0 0 19 3M13 3H11V5H13M3 9H5V7H3M7 21H9V19H7M3 13H5V11H3M3 5H5V3A2 2 0 0 0 3 5Z"},
};
}
}
| 130.56
| 599
| 0.658395
|
[
"MIT"
] |
Al-Dyachkov/Material.Avalonia
|
Material.Styles/Internal/IconsDataSet.cs
| 3,266
|
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.V20200601.Outputs
{
/// <summary>
/// The IIS handler mappings used to define which handler processes HTTP requests with certain extension.
/// For example, it is used to configure php-cgi.exe process to handle all HTTP requests with *.php extension.
/// </summary>
[OutputType]
public sealed class HandlerMappingResponse
{
/// <summary>
/// Command-line arguments to be passed to the script processor.
/// </summary>
public readonly string? Arguments;
/// <summary>
/// Requests with this extension will be handled using the specified FastCGI application.
/// </summary>
public readonly string? Extension;
/// <summary>
/// The absolute path to the FastCGI application.
/// </summary>
public readonly string? ScriptProcessor;
[OutputConstructor]
private HandlerMappingResponse(
string? arguments,
string? extension,
string? scriptProcessor)
{
Arguments = arguments;
Extension = extension;
ScriptProcessor = scriptProcessor;
}
}
}
| 31.914894
| 114
| 0.641333
|
[
"Apache-2.0"
] |
polivbr/pulumi-azure-native
|
sdk/dotnet/Web/V20200601/Outputs/HandlerMappingResponse.cs
| 1,500
|
C#
|
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
namespace NuGet.Versioning
{
/// <summary>
/// A strict SemVer implementation
/// </summary>
[TypeConverter(typeof(SemanticVersionConverter))]
public partial class SemanticVersion
{
// store as array to avoid enumerator allocations
internal readonly string[] _releaseLabels;
internal readonly string _metadata;
internal readonly Version _version;
/// <summary>
/// Creates a SemanticVersion from an existing SemanticVersion
/// </summary>
/// <param name="version">Version to clone.</param>
public SemanticVersion(SemanticVersion version)
: this(version.Major, version.Minor, version.Patch, version.ReleaseLabels, version.Metadata)
{
}
/// <summary>
/// Creates a SemanticVersion X.Y.Z
/// </summary>
/// <param name="major">X.y.z</param>
/// <param name="minor">x.Y.z</param>
/// <param name="patch">x.y.Z</param>
public SemanticVersion(int major, int minor, int patch)
: this(major, minor, patch, Enumerable.Empty<string>(), null)
{
}
/// <summary>
/// Creates a NuGetVersion X.Y.Z-alpha
/// </summary>
/// <param name="major">X.y.z</param>
/// <param name="minor">x.Y.z</param>
/// <param name="patch">x.y.Z</param>
/// <param name="releaseLabel">Prerelease label</param>
public SemanticVersion(int major, int minor, int patch, string releaseLabel)
: this(major, minor, patch, ParseReleaseLabels(releaseLabel), null)
{
}
/// <summary>
/// Creates a NuGetVersion X.Y.Z-alpha#build01
/// </summary>
/// <param name="major">X.y.z</param>
/// <param name="minor">x.Y.z</param>
/// <param name="patch">x.y.Z</param>
/// <param name="releaseLabel">Prerelease label</param>
/// <param name="metadata">Build metadata</param>
public SemanticVersion(int major, int minor, int patch, string releaseLabel, string metadata)
: this(major, minor, patch, ParseReleaseLabels(releaseLabel), metadata)
{
}
/// <summary>
/// Creates a NuGetVersion X.Y.Z-alpha.1.2#build01
/// </summary>
/// <param name="major">X.y.z</param>
/// <param name="minor">x.Y.z</param>
/// <param name="patch">x.y.Z</param>
/// <param name="releaseLabels">Release labels that have been split by the dot separator</param>
/// <param name="metadata">Build metadata</param>
public SemanticVersion(int major, int minor, int patch, IEnumerable<string> releaseLabels, string metadata)
: this(new Version(major, minor, patch, 0), releaseLabels, metadata)
{
}
/// <summary>
/// Internal constructor.
/// </summary>
/// <param name="version">Version</param>
/// <param name="releaseLabel">Full release label</param>
/// <param name="metadata">Build metadata</param>
protected SemanticVersion(Version version, string releaseLabel = null, string metadata = null)
: this(version, ParseReleaseLabels(releaseLabel), metadata)
{
}
/// <summary>
/// Internal constructor.
/// </summary>
/// <param name="major">X.y.z</param>
/// <param name="minor">x.Y.z</param>
/// <param name="patch">x.y.Z</param>
/// <param name="revision">x.y.z.R</param>
/// <param name="releaseLabel">Prerelease label</param>
/// <param name="metadata">Build metadata</param>
protected SemanticVersion(int major, int minor, int patch, int revision, string releaseLabel, string metadata)
: this(major, minor, patch, revision, ParseReleaseLabels(releaseLabel), metadata)
{
}
/// <summary>
/// Internal constructor.
/// </summary>
/// <param name="major"></param>
/// <param name="minor"></param>
/// <param name="patch"></param>
/// <param name="revision"></param>
/// <param name="releaseLabels"></param>
/// <param name="metadata"></param>
protected SemanticVersion(int major, int minor, int patch, int revision, IEnumerable<string> releaseLabels, string metadata)
: this(new Version(major, minor, patch, revision), releaseLabels, metadata)
{
}
/// <summary>
/// Internal constructor.
/// </summary>
/// <param name="version">Version</param>
/// <param name="releaseLabels">Release labels</param>
/// <param name="metadata">Build metadata</param>
protected SemanticVersion(Version version, IEnumerable<string> releaseLabels, string metadata)
{
if (version == null)
{
throw new ArgumentNullException(nameof(version));
}
_version = NormalizeVersionValue(version);
_metadata = metadata;
if (releaseLabels != null)
{
// If the labels are already an array use it
var asArray = releaseLabels as string[];
if (asArray != null)
{
_releaseLabels = asArray;
}
else
{
// enumerate the list
_releaseLabels = releaseLabels.ToArray();
}
if (_releaseLabels.Length < 1)
{
// Avoid storing an empty array of labels, this field is checked for null everywhere
_releaseLabels = null;
}
}
}
/// <summary>
/// Major version X (X.y.z)
/// </summary>
public int Major
{
get { return _version.Major; }
}
/// <summary>
/// Minor version Y (x.Y.z)
/// </summary>
public int Minor
{
get { return _version.Minor; }
}
/// <summary>
/// Patch version Z (x.y.Z)
/// </summary>
public int Patch
{
get { return _version.Build; }
}
/// <summary>
/// A collection of pre-release labels attached to the version.
/// </summary>
public IEnumerable<string> ReleaseLabels
{
get { return _releaseLabels ?? EmptyReleaseLabels; }
}
/// <summary>
/// The full pre-release label for the version.
/// </summary>
public string Release
{
get
{
if (_releaseLabels != null)
{
if (_releaseLabels.Length == 1)
{
// There is exactly 1 label
return _releaseLabels[0];
}
else
{
// Join all labels
return string.Join(".", _releaseLabels);
}
}
return string.Empty;
}
}
/// <summary>
/// True if pre-release labels exist for the version.
/// </summary>
public virtual bool IsPrerelease
{
get
{
if (_releaseLabels != null)
{
for (int i = 0; i < _releaseLabels.Length; i++)
{
if (!string.IsNullOrEmpty(_releaseLabels[i]))
{
return true;
}
}
}
return false;
}
}
/// <summary>
/// True if metadata exists for the version.
/// </summary>
public virtual bool HasMetadata
{
get { return !string.IsNullOrEmpty(Metadata); }
}
/// <summary>
/// Build metadata attached to the version.
/// </summary>
public virtual string Metadata
{
get { return _metadata; }
}
}
}
| 33.456693
| 132
| 0.512944
|
[
"Apache-2.0"
] |
0xced/NuGet.Client
|
src/NuGet.Core/NuGet.Versioning/SemanticVersion.cs
| 8,498
|
C#
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace UIP.GDM.HW5.OOP.Classes.Factory
{
class Country
{
public List<Order> GetOrders()
{
List<Order> orders = new List<Order>();
foreach (var order in orders)
{
order.
}
}
}
}
| 18.952381
| 51
| 0.555276
|
[
"MIT"
] |
watchbot23/GDM.UIP.HW
|
UIP.GDM.HW5.OOP.Classes.Factory/Country.cs
| 400
|
C#
|
// MonsterRecordUtilitiesMenu.cs
// Copyright (c) 2014+ by Michael Penner. All rights reserved.
using System;
using System.Collections.Generic;
using Eamon.Framework.Menus;
using Eamon.Game.Attributes;
using Eamon.Game.Menus;
using EamonDD.Framework.Menus.ActionMenus;
using EamonDD.Framework.Menus.HierarchicalMenus;
using static EamonDD.Game.Plugin.PluginContext;
namespace EamonDD.Game.Menus.HierarchicalMenus
{
[ClassMappings]
public class MonsterRecordUtilitiesMenu : Menu, IMonsterRecordUtilitiesMenu
{
public override void PrintSubtitle()
{
Globals.DdMenu.PrintMonsterMenuSubtitle();
}
public MonsterRecordUtilitiesMenu()
{
Title = "MONSTER RECORD UTILITIES MENU";
Buf = Globals.Buf;
MenuItemList = new List<IMenuItem>();
MenuItemList.Add(Globals.CreateInstance<IMenuItem>(x =>
{
x.SelectChar = (char)('1' + MenuItemList.Count);
x.LineText = string.Format("{0}{1}. Generate dead body Artifact records.", Environment.NewLine, MenuItemList.Count + 1);
x.SubMenu = Globals.CreateInstance<IGenerateDeadBodyArtifactRecordsMenu>();
}));
if (gEngine.IsAdventureFilesetLoaded())
{
MenuItemList.Add(Globals.CreateInstance<IMenuItem>(x =>
{
x.SelectChar = (char)('1' + MenuItemList.Count);
x.LineText = string.Format("{0}{1}. Analyse Monster record interdependencies.", Environment.NewLine, MenuItemList.Count + 1);
x.SubMenu = Globals.CreateInstance<IAnalyseMonsterRecordInterdependenciesMenu>();
}));
}
MenuItemList.Add(Globals.CreateInstance<IMenuItem>(x =>
{
x.SelectChar = 'X';
x.LineText = string.Format("{0}X. Exit.{0}", Environment.NewLine);
x.SubMenu = null;
}));
}
}
}
| 29.694915
| 131
| 0.699772
|
[
"MIT"
] |
TheRealEamonCS/Eamon-CS
|
System/EamonDD/Game/Menus/HierarchicalMenus/MonsterMenus/MonsterRecordUtilitiesMenu.cs
| 1,754
|
C#
|
namespace Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview
{
using Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.PowerShell;
/// <summary>Class representing the servers project summary.</summary>
[System.ComponentModel.TypeConverter(typeof(ServersProjectSummaryTypeConverter))]
public partial class ServersProjectSummary
{
/// <summary>
/// <c>AfterDeserializeDictionary</c> will be called after the deserialization has finished, allowing customization of the
/// object before it is returned. Implement this method in a partial class to enable this behavior
/// </summary>
/// <param name="content">The global::System.Collections.IDictionary content that should be used.</param>
partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content);
/// <summary>
/// <c>AfterDeserializePSObject</c> will be called after the deserialization has finished, allowing customization of the object
/// before it is returned. Implement this method in a partial class to enable this behavior
/// </summary>
/// <param name="content">The global::System.Management.Automation.PSObject content that should be used.</param>
partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content);
/// <summary>
/// <c>BeforeDeserializeDictionary</c> will be called before the deserialization has commenced, allowing complete customization
/// of the object before it is deserialized.
/// If you wish to disable the default deserialization entirely, return <c>true</c> in the <see "returnNow" /> output parameter.
/// Implement this method in a partial class to enable this behavior.
/// </summary>
/// <param name="content">The global::System.Collections.IDictionary content that should be used.</param>
/// <param name="returnNow">Determines if the rest of the serialization should be processed, or if the method should return
/// instantly.</param>
partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow);
/// <summary>
/// <c>BeforeDeserializePSObject</c> will be called before the deserialization has commenced, allowing complete customization
/// of the object before it is deserialized.
/// If you wish to disable the default deserialization entirely, return <c>true</c> in the <see "returnNow" /> output parameter.
/// Implement this method in a partial class to enable this behavior.
/// </summary>
/// <param name="content">The global::System.Management.Automation.PSObject content that should be used.</param>
/// <param name="returnNow">Determines if the rest of the serialization should be processed, or if the method should return
/// instantly.</param>
partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow);
/// <summary>
/// Deserializes a <see cref="global::System.Collections.IDictionary" /> into an instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.ServersProjectSummary"
/// />.
/// </summary>
/// <param name="content">The global::System.Collections.IDictionary content that should be used.</param>
/// <returns>
/// an instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.IServersProjectSummary"
/// />.
/// </returns>
public static Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.IServersProjectSummary DeserializeFromDictionary(global::System.Collections.IDictionary content)
{
return new ServersProjectSummary(content);
}
/// <summary>
/// Deserializes a <see cref="global::System.Management.Automation.PSObject" /> into an instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.ServersProjectSummary"
/// />.
/// </summary>
/// <param name="content">The global::System.Management.Automation.PSObject content that should be used.</param>
/// <returns>
/// an instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.IServersProjectSummary"
/// />.
/// </returns>
public static Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.IServersProjectSummary DeserializeFromPSObject(global::System.Management.Automation.PSObject content)
{
return new ServersProjectSummary(content);
}
/// <summary>
/// Creates a new instance of <see cref="ServersProjectSummary" />, deserializing the content from a json string.
/// </summary>
/// <param name="jsonText">a string containing a JSON serialized instance of this model.</param>
/// <returns>an instance of the <see cref="className" /> model class.</returns>
public static Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.IServersProjectSummary FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.Json.JsonNode.Parse(jsonText));
/// <summary>
/// Deserializes a <see cref="global::System.Collections.IDictionary" /> into a new instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.ServersProjectSummary"
/// />.
/// </summary>
/// <param name="content">The global::System.Collections.IDictionary content that should be used.</param>
internal ServersProjectSummary(global::System.Collections.IDictionary content)
{
bool returnNow = false;
BeforeDeserializeDictionary(content, ref returnNow);
if (returnNow)
{
return;
}
// actually deserialize
((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.IServersProjectSummaryInternal)this).DiscoveredCount = (int?) content.GetValueForProperty("DiscoveredCount",((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.IServersProjectSummaryInternal)this).DiscoveredCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int)));
((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.IServersProjectSummaryInternal)this).AssessedCount = (int?) content.GetValueForProperty("AssessedCount",((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.IServersProjectSummaryInternal)this).AssessedCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int)));
((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.IServersProjectSummaryInternal)this).ReplicatingCount = (int?) content.GetValueForProperty("ReplicatingCount",((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.IServersProjectSummaryInternal)this).ReplicatingCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int)));
((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.IServersProjectSummaryInternal)this).TestMigratedCount = (int?) content.GetValueForProperty("TestMigratedCount",((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.IServersProjectSummaryInternal)this).TestMigratedCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int)));
((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.IServersProjectSummaryInternal)this).MigratedCount = (int?) content.GetValueForProperty("MigratedCount",((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.IServersProjectSummaryInternal)this).MigratedCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int)));
((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.IProjectSummaryInternal)this).InstanceType = (string) content.GetValueForProperty("InstanceType",((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.IProjectSummaryInternal)this).InstanceType, global::System.Convert.ToString);
((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.IProjectSummaryInternal)this).RefreshSummaryState = (string) content.GetValueForProperty("RefreshSummaryState",((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.IProjectSummaryInternal)this).RefreshSummaryState, global::System.Convert.ToString);
((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.IProjectSummaryInternal)this).LastSummaryRefreshedTime = (global::System.DateTime?) content.GetValueForProperty("LastSummaryRefreshedTime",((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.IProjectSummaryInternal)this).LastSummaryRefreshedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified));
((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.IProjectSummaryInternal)this).ExtendedSummary = (Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.IProjectSummaryExtendedSummary) content.GetValueForProperty("ExtendedSummary",((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.IProjectSummaryInternal)this).ExtendedSummary, Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.ProjectSummaryExtendedSummaryTypeConverter.ConvertFrom);
AfterDeserializeDictionary(content);
}
/// <summary>
/// Deserializes a <see cref="global::System.Management.Automation.PSObject" /> into a new instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.ServersProjectSummary"
/// />.
/// </summary>
/// <param name="content">The global::System.Management.Automation.PSObject content that should be used.</param>
internal ServersProjectSummary(global::System.Management.Automation.PSObject content)
{
bool returnNow = false;
BeforeDeserializePSObject(content, ref returnNow);
if (returnNow)
{
return;
}
// actually deserialize
((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.IServersProjectSummaryInternal)this).DiscoveredCount = (int?) content.GetValueForProperty("DiscoveredCount",((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.IServersProjectSummaryInternal)this).DiscoveredCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int)));
((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.IServersProjectSummaryInternal)this).AssessedCount = (int?) content.GetValueForProperty("AssessedCount",((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.IServersProjectSummaryInternal)this).AssessedCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int)));
((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.IServersProjectSummaryInternal)this).ReplicatingCount = (int?) content.GetValueForProperty("ReplicatingCount",((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.IServersProjectSummaryInternal)this).ReplicatingCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int)));
((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.IServersProjectSummaryInternal)this).TestMigratedCount = (int?) content.GetValueForProperty("TestMigratedCount",((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.IServersProjectSummaryInternal)this).TestMigratedCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int)));
((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.IServersProjectSummaryInternal)this).MigratedCount = (int?) content.GetValueForProperty("MigratedCount",((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.IServersProjectSummaryInternal)this).MigratedCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int)));
((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.IProjectSummaryInternal)this).InstanceType = (string) content.GetValueForProperty("InstanceType",((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.IProjectSummaryInternal)this).InstanceType, global::System.Convert.ToString);
((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.IProjectSummaryInternal)this).RefreshSummaryState = (string) content.GetValueForProperty("RefreshSummaryState",((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.IProjectSummaryInternal)this).RefreshSummaryState, global::System.Convert.ToString);
((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.IProjectSummaryInternal)this).LastSummaryRefreshedTime = (global::System.DateTime?) content.GetValueForProperty("LastSummaryRefreshedTime",((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.IProjectSummaryInternal)this).LastSummaryRefreshedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified));
((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.IProjectSummaryInternal)this).ExtendedSummary = (Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.IProjectSummaryExtendedSummary) content.GetValueForProperty("ExtendedSummary",((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.IProjectSummaryInternal)this).ExtendedSummary, Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20180901Preview.ProjectSummaryExtendedSummaryTypeConverter.ConvertFrom);
AfterDeserializePSObject(content);
}
/// <summary>Serializes this instance to a json string.</summary>
/// <returns>a <see cref="System.String" /> containing this model serialized to JSON text.</returns>
public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.SerializationMode.IncludeAll)?.ToString();
}
/// Class representing the servers project summary.
[System.ComponentModel.TypeConverter(typeof(ServersProjectSummaryTypeConverter))]
public partial interface IServersProjectSummary
{
}
}
| 99.691275
| 523
| 0.748957
|
[
"MIT"
] |
3quanfeng/azure-powershell
|
src/Migrate/generated/api/Models/Api20180901Preview/ServersProjectSummary.PowerShell.cs
| 14,706
|
C#
|
//-----------------------------------------------------------------------------
// Copyright : (c) Chris Moore, 2020
// License : MIT
//-----------------------------------------------------------------------------
namespace Z0
{
using System;
using static Root;
using static core;
public class t_bitcopy : t_bits<t_bitcopy>
{
public void bitcopy_check()
{
bitcopy_check<byte>();
bitcopy_check<ushort>();
bitcopy_check<uint>();
bitcopy_check<long>();
bitcopy_check<ulong>();
}
void bitcopy_check<T>()
where T : unmanaged
{
var zed = zero<T>();
var lit = ones<T>();
var min = byte.MinValue;
var max = (byte)width<T>();
void check()
{
for(var rep = 0; rep<RepCount; rep++)
{
var range = Random.Interval(min, max);
var count = (byte)range.Width;
var expect = gbits.enable(zed, range.Left, count);
var actual = gbits.bitcopy(lit, range.Left, count, zed);
if(gmath.neq(expect,actual))
{
Trace("expect", BitSpans32.from(expect).Format());
Trace("actual", BitSpans32.from(actual).Format());
Claim.eq(expect, actual);
}
}
}
CheckAction(check, CaseName(ApiIdentityBuilder.NumericOp<T>("bitcopy")));
}
}
}
| 31.509804
| 85
| 0.408214
|
[
"BSD-3-Clause"
] |
0xCM/z0
|
src/bits.test/units/t_bitcopy.cs
| 1,607
|
C#
|
// ***********************************************************************
// Copyright (c) 2013-2020 Charlie Poole, Terje Sandstrom
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ***********************************************************************
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestPlatform.ObjectModel;
using NUnit.VisualStudio.TestAdapter.NUnitEngine;
namespace NUnit.VisualStudio.TestAdapter
{
public static class TraitsFeature
{
public static void AddTrait(this TestCase testCase, string name, string value)
{
testCase?.Traits.Add(new Trait(name, value));
}
private const string NUnitTestCategoryLabel = "Category";
/// <summary>
/// Stores the information needed to initialize a <see cref="TestCase"/>
/// which can be inherited from an ancestor node during the conversion of test cases.
/// </summary>
public sealed class CachedTestCaseInfo
{
/// <summary>
/// Used to populate a test case’s <see cref="TestObject.Traits"/> collection.
/// Currently, the only effect this has is to add a Test Explorer grouping header
/// for each trait with the name “Name [Value]”, or for an empty value, “Name”.
/// </summary>
public List<Trait> Traits { get; } = new List<Trait>();
/// <summary>
/// Used by <see cref="VsTestFilter"/>; does not affect the Test Explorer UI.
/// </summary>
public bool Explicit { get; set; }
// Eventually, we might split out the Categories collection and make this
// an immutable struct. (https://github.com/nunit/nunit3-vs-adapter/pull/457)
}
public static void AddTraitsFromTestNode(this TestCase testCase, NUnitDiscoveryTestCase testNCase,
IDictionary<string, CachedTestCaseInfo> traitsCache, ITestLogger logger, IAdapterSettings adapterSettings)
{
var ancestor = testNCase.Parent;
var key = ancestor?.Id;
var categoryList = new CategoryList(testCase, adapterSettings);
// Reading ancestor properties of a test-case node. And adding to the cache.
while (ancestor != null && !string.IsNullOrEmpty(key))
{
AddingToCache(testCase, traitsCache, key, categoryList, ancestor, categoryList.ProcessTestCaseProperties);
ancestor = ancestor.Parent;
key = ancestor?.Id;
}
// No Need to store test-case properties in cache.
categoryList.ProcessTestCaseProperties(testNCase, false);
categoryList.UpdateCategoriesToVs();
}
private static void AddingToCache<T>(TestCase testCase, IDictionary<string, CachedTestCaseInfo> traitsCache, string key, CategoryList categoryList, T ancestor, Func<T, bool, string, IDictionary<string, CachedTestCaseInfo>, IEnumerable<string>> processTestCaseProperties)
{
if (traitsCache.ContainsKey(key))
{
categoryList.AddRange(traitsCache[key].Traits.Where(o => o.Name == NUnitTestCategoryLabel)
.Select(prop => prop.Value).ToList());
if (traitsCache[key].Explicit)
testCase.SetPropertyValue(CategoryList.NUnitExplicitProperty, true);
var traitsList = traitsCache[key].Traits.Where(o => o.Name != NUnitTestCategoryLabel).ToList();
if (traitsList.Count > 0)
testCase.Traits.AddRange(traitsList);
}
else
{
processTestCaseProperties(ancestor, true, key, traitsCache);
// Adding entry to dictionary, so that we will not make SelectNodes call again.
if (categoryList.LastNodeListCount == 0 && !traitsCache.ContainsKey(key))
{
traitsCache[key] = new CachedTestCaseInfo();
}
}
}
public static void AddTraitsFromXmlTestNode(this TestCase testCase, NUnitEventTestCase testNCase,
IDictionary<string, CachedTestCaseInfo> traitsCache, ITestLogger logger, IAdapterSettings adapterSettings)
{
var ancestor = testNCase.Parent;
var key = ancestor?.Id;
var categoryList = new CategoryList(testCase, adapterSettings);
// Reading ancestor properties of a test-case node. And adding to the cache.
while (ancestor != null && key != null)
{
AddingToCache(testCase, traitsCache, key, categoryList, ancestor, categoryList.ProcessTestCaseProperties);
ancestor = ancestor.Parent;
key = ancestor?.Id;
}
// No Need to store test-case properties in cache.
categoryList.ProcessTestCaseProperties(testNCase, false);
categoryList.UpdateCategoriesToVs();
}
public static IEnumerable<NTrait> GetTraits(this TestCase testCase)
{
var traits = new List<NTrait>();
if (testCase?.Traits != null)
{
traits.AddRange(from trait in testCase.Traits let name = trait.Name let value = trait.Value select new NTrait(name, value));
}
return traits;
}
public static IEnumerable<string> GetCategories(this TestCase testCase)
{
var categories = testCase.GetPropertyValue(CategoryList.NUnitTestCategoryProperty) as string[];
return categories;
}
}
public class NTrait
{
public string Name { get; }
public string Value { get; }
public NTrait(string name, string value)
{
Name = name;
Value = value;
}
}
}
| 44.121019
| 278
| 0.622059
|
[
"MIT"
] |
ashishdawale20/nunit3-vs-adapter
|
src/NUnitTestAdapter/TraitsFeature.cs
| 6,939
|
C#
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
public class MemoryUtils
{
[MenuItem("Utils/Memory/ClearCache")]
static void ClearCache()
{
//Clears all of the caches
bool success = Caching.ClearCache();
if (!success)
{
Debug.Log("Unable to clear cache");
}
}
[MenuItem("Utils/Memory/ClearPlayerPrefs")]
static void ClearPlayerPrefs()
{
PlayerPrefs.DeleteAll();
}
}
#endif
| 17.387097
| 47
| 0.625232
|
[
"MIT"
] |
makerhanoi/via-simulation-jeep
|
Assets/MapBuilder/Scripts/Utils/KoiUtils/Editor/MemoryUtils.cs
| 541
|
C#
|
using System;
namespace Magnesium.Vulkan
{
internal enum VkDebugReportObjectTypeExt : uint
{
DebugReportObjectTypeUnknown = 0,
DebugReportObjectTypeInstance = 1,
DebugReportObjectTypePhysicalDevice = 2,
DebugReportObjectTypeDevice = 3,
DebugReportObjectTypeQueue = 4,
DebugReportObjectTypeSemaphore = 5,
DebugReportObjectTypeCommandBuffer = 6,
DebugReportObjectTypeFence = 7,
DebugReportObjectTypeDeviceMemory = 8,
DebugReportObjectTypeBuffer = 9,
DebugReportObjectTypeImage = 10,
DebugReportObjectTypeEvent = 11,
DebugReportObjectTypeQueryPool = 12,
DebugReportObjectTypeBufferView = 13,
DebugReportObjectTypeImageView = 14,
DebugReportObjectTypeShaderModule = 15,
DebugReportObjectTypePipelineCache = 16,
DebugReportObjectTypePipelineLayout = 17,
DebugReportObjectTypeRenderPass = 18,
DebugReportObjectTypePipeline = 19,
DebugReportObjectTypeDescriptorSetLayout = 20,
DebugReportObjectTypeSampler = 21,
DebugReportObjectTypeDescriptorPool = 22,
DebugReportObjectTypeDescriptorSet = 23,
DebugReportObjectTypeFramebuffer = 24,
DebugReportObjectTypeCommandPool = 25,
DebugReportObjectTypeSurfaceKhr = 26,
DebugReportObjectTypeSwapchainKhr = 27,
DebugReportObjectTypeDebugReport = 28,
}
}
| 32.868421
| 48
| 0.818255
|
[
"MIT"
] |
tgsstdio/Mg
|
Magnesium.Vulkan/Enums/VkDebugReportObjectTypeExt.cs
| 1,249
|
C#
|
// Copyright (c) Suity by HuangWei(4477289@qq.com)
// Distributed under the MIT license. See the LICENSE.md file in the project root for more information.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Suity.Rex
{
public sealed class EmptyDisposable : IDisposable
{
public static readonly EmptyDisposable Empty = new EmptyDisposable();
private EmptyDisposable()
{
}
public void Dispose()
{
}
}
}
| 21.583333
| 103
| 0.667954
|
[
"MIT"
] |
simage3d/Suity.Engine.Runtime.V4
|
Source/Suity.Rex/Rex/EmptyDisposable.cs
| 520
|
C#
|
using System;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;
using NUnit.Framework;
using Spring.Context.Support;
namespace Spring.Remoting
{
public class BaseRemotingTestFixture
{
protected static TcpChannel channel;
private static object lockObject = new object();
[TestFixtureSetUp]
public virtual void FixtureSetUp()
{
lock (lockObject)
{
if (channel == null)
{
try
{
foreach (IChannel registeredChannel in ChannelServices.RegisteredChannels)
{
if (registeredChannel is TcpChannel)
{
((TcpChannel) registeredChannel).StopListening(null);
}
ChannelServices.UnregisterChannel(registeredChannel);
}
channel = new TcpChannel(8005);
ChannelServices.RegisterChannel(channel, false);
}
catch
{
// ignore duplicate registration exception if it occurs...
}
}
}
}
[TearDown]
public virtual void TearDown()
{
ContextRegistry.Clear();
}
}
}
| 30.959184
| 99
| 0.454186
|
[
"Apache-2.0"
] |
TerryRen/spring-net
|
test/Spring/Spring.Services.Tests/Remoting/BaseRemotingTestFixture.cs
| 1,517
|
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.Collections.Generic;
using System.IO;
using System.IO.Tests;
using System.Linq;
using System.Net.Quic;
using System.Net.Security;
using System.Net.Test.Common;
using System.Security.Authentication;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;
namespace System.Net.Http.Functional.Tests
{
public sealed class Http1CloseResponseStreamZeroByteReadTest : Http1ResponseStreamZeroByteReadTestBase
{
protected override string GetResponseHeaders() => "HTTP/1.1 200 OK\r\nConnection: close\r\n\r\n";
protected override async Task WriteAsync(Stream stream, byte[] data) => await stream.WriteAsync(data);
}
public sealed class Http1RawResponseStreamZeroByteReadTest : Http1ResponseStreamZeroByteReadTestBase
{
protected override string GetResponseHeaders() => "HTTP/1.1 101 Switching Protocols\r\n\r\n";
protected override async Task WriteAsync(Stream stream, byte[] data) => await stream.WriteAsync(data);
}
public sealed class Http1ContentLengthResponseStreamZeroByteReadTest : Http1ResponseStreamZeroByteReadTestBase
{
protected override string GetResponseHeaders() => "HTTP/1.1 200 OK\r\nContent-Length: 5\r\n\r\n";
protected override async Task WriteAsync(Stream stream, byte[] data) => await stream.WriteAsync(data);
}
public sealed class Http1SingleChunkResponseStreamZeroByteReadTest : Http1ResponseStreamZeroByteReadTestBase
{
protected override string GetResponseHeaders() => "HTTP/1.1 200 OK\r\nTransfer-Encoding: chunked\r\n\r\n";
protected override async Task WriteAsync(Stream stream, byte[] data)
{
await stream.WriteAsync(Encoding.ASCII.GetBytes($"{data.Length:X}\r\n"));
await stream.WriteAsync(data);
await stream.WriteAsync("\r\n"u8.ToArray());
}
}
public sealed class Http1MultiChunkResponseStreamZeroByteReadTest : Http1ResponseStreamZeroByteReadTestBase
{
protected override string GetResponseHeaders() => "HTTP/1.1 200 OK\r\nTransfer-Encoding: chunked\r\n\r\n";
protected override async Task WriteAsync(Stream stream, byte[] data)
{
for (int i = 0; i < data.Length; i++)
{
await stream.WriteAsync(Encoding.ASCII.GetBytes($"1\r\n"));
await stream.WriteAsync(data.AsMemory(i, 1));
await stream.WriteAsync("\r\n"u8.ToArray());
}
}
}
public abstract class Http1ResponseStreamZeroByteReadTestBase
{
protected abstract string GetResponseHeaders();
protected abstract Task WriteAsync(Stream stream, byte[] data);
public static IEnumerable<object[]> ZeroByteRead_IssuesZeroByteReadOnUnderlyingStream_MemberData() =>
from readMode in Enum.GetValues<StreamConformanceTests.ReadWriteMode>()
.Where(mode => mode != StreamConformanceTests.ReadWriteMode.SyncByte) // Can't test zero-byte reads with ReadByte
from useSsl in new[] { true, false }
select new object[] { readMode, useSsl };
[Theory]
[MemberData(nameof(ZeroByteRead_IssuesZeroByteReadOnUnderlyingStream_MemberData))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/69870", TestPlatforms.Android)]
[SkipOnPlatform(TestPlatforms.Browser, "ConnectCallback is not supported on Browser")]
public async Task ZeroByteRead_IssuesZeroByteReadOnUnderlyingStream(StreamConformanceTests.ReadWriteMode readMode, bool useSsl)
{
(Stream httpConnection, Stream server) = ConnectedStreams.CreateBidirectional(4096, int.MaxValue);
try
{
var sawZeroByteRead = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously);
httpConnection = new ReadInterceptStream(httpConnection, read =>
{
if (read == 0)
{
sawZeroByteRead.TrySetResult();
}
});
using var handler = new SocketsHttpHandler
{
ConnectCallback = delegate { return ValueTask.FromResult(httpConnection); }
};
handler.SslOptions.RemoteCertificateValidationCallback = delegate { return true; };
using var client = new HttpClient(handler);
Task<HttpResponseMessage> clientTask = client.GetAsync($"http{(useSsl ? "s" : "")}://doesntmatter", HttpCompletionOption.ResponseHeadersRead);
if (useSsl)
{
var sslStream = new SslStream(server, false, delegate { return true; });
server = sslStream;
using (X509Certificate2 cert = Test.Common.Configuration.Certificates.GetServerCertificate())
{
await ((SslStream)server).AuthenticateAsServerAsync(
cert,
clientCertificateRequired: true,
enabledSslProtocols: SslProtocols.Tls12,
checkCertificateRevocation: false).WaitAsync(TimeSpan.FromSeconds(10));
}
}
await ResponseConnectedStreamConformanceTests.ReadHeadersAsync(server).WaitAsync(TimeSpan.FromSeconds(10));
await server.WriteAsync(Encoding.ASCII.GetBytes(GetResponseHeaders()));
using HttpResponseMessage response = await clientTask.WaitAsync(TimeSpan.FromSeconds(10));
using Stream clientStream = response.Content.ReadAsStream();
Assert.False(sawZeroByteRead.Task.IsCompleted);
Task<int> zeroByteReadTask = Task.Run(() => StreamConformanceTests.ReadAsync(readMode, clientStream, Array.Empty<byte>(), 0, 0, CancellationToken.None));
Assert.False(zeroByteReadTask.IsCompleted);
// The zero-byte read should block until data is actually available
await sawZeroByteRead.Task.WaitAsync(TimeSpan.FromSeconds(10));
Assert.False(zeroByteReadTask.IsCompleted);
byte[] data = "Hello"u8.ToArray();
await WriteAsync(server, data);
await server.FlushAsync();
Assert.Equal(0, await zeroByteReadTask.WaitAsync(TimeSpan.FromSeconds(10)));
// Now that data is available, a zero-byte read should complete synchronously
zeroByteReadTask = StreamConformanceTests.ReadAsync(readMode, clientStream, Array.Empty<byte>(), 0, 0, CancellationToken.None);
Assert.True(zeroByteReadTask.IsCompleted);
Assert.Equal(0, await zeroByteReadTask);
var readBuffer = new byte[10];
int read = 0;
while (read < data.Length)
{
read += await StreamConformanceTests.ReadAsync(readMode, clientStream, readBuffer, read, readBuffer.Length - read, CancellationToken.None).WaitAsync(TimeSpan.FromSeconds(10));
}
Assert.Equal(data.Length, read);
Assert.Equal(data, readBuffer.AsSpan(0, read).ToArray());
}
finally
{
httpConnection.Dispose();
server.Dispose();
}
}
private sealed class ReadInterceptStream : DelegatingStream
{
private readonly Action<int> _readCallback;
public ReadInterceptStream(Stream innerStream, Action<int> readCallback)
: base(innerStream)
{
_readCallback = readCallback;
}
public override int Read(Span<byte> buffer)
{
_readCallback(buffer.Length);
return base.Read(buffer);
}
public override int Read(byte[] buffer, int offset, int count)
{
_readCallback(count);
return base.Read(buffer, offset, count);
}
public override ValueTask<int> ReadAsync(Memory<byte> buffer, CancellationToken cancellationToken = default)
{
_readCallback(buffer.Length);
return base.ReadAsync(buffer, cancellationToken);
}
}
}
public sealed class Http1ResponseStreamZeroByteReadTest : ResponseStreamZeroByteReadTestBase
{
public Http1ResponseStreamZeroByteReadTest(ITestOutputHelper output) : base(output) { }
protected override Version UseVersion => HttpVersion.Version11;
}
[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.SupportsAlpn))]
public sealed class Http2ResponseStreamZeroByteReadTest : ResponseStreamZeroByteReadTestBase
{
public Http2ResponseStreamZeroByteReadTest(ITestOutputHelper output) : base(output) { }
protected override Version UseVersion => HttpVersion.Version20;
}
[Collection(nameof(DisableParallelization))]
[ConditionalClass(typeof(HttpClientHandlerTestBase), nameof(IsQuicSupported))]
public sealed class Http3ResponseStreamZeroByteReadTest : ResponseStreamZeroByteReadTestBase
{
public Http3ResponseStreamZeroByteReadTest(ITestOutputHelper output) : base(output) { }
protected override Version UseVersion => HttpVersion.Version30;
}
[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))]
public abstract class ResponseStreamZeroByteReadTestBase : HttpClientHandlerTestBase
{
public ResponseStreamZeroByteReadTestBase(ITestOutputHelper output) : base(output) { }
[Theory]
[InlineData(true)]
[InlineData(false)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/69870", TestPlatforms.Android)]
public async Task ZeroByteRead_BlocksUntilDataIsAvailable(bool async)
{
var zeroByteReadIssued = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously);
await LoopbackServerFactory.CreateClientAndServerAsync(async uri =>
{
HttpRequestMessage request = CreateRequest(HttpMethod.Get, uri, UseVersion, exactVersion: true);
using HttpClient client = CreateHttpClient();
using HttpResponseMessage response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead);
using Stream responseStream = await response.Content.ReadAsStreamAsync();
var responseBuffer = new byte[1];
Assert.Equal(1, await ReadAsync(async, responseStream, responseBuffer));
Assert.Equal(42, responseBuffer[0]);
Task<int> zeroByteReadTask = ReadAsync(async, responseStream, Array.Empty<byte>());
Assert.False(zeroByteReadTask.IsCompleted);
zeroByteReadIssued.SetResult();
Assert.Equal(0, await zeroByteReadTask);
Assert.Equal(0, await ReadAsync(async, responseStream, Array.Empty<byte>()));
Assert.Equal(1, await ReadAsync(async, responseStream, responseBuffer));
Assert.Equal(1, responseBuffer[0]);
Assert.Equal(0, await ReadAsync(async, responseStream, Array.Empty<byte>()));
Assert.Equal(1, await ReadAsync(async, responseStream, responseBuffer));
Assert.Equal(2, responseBuffer[0]);
zeroByteReadTask = ReadAsync(async, responseStream, Array.Empty<byte>());
Assert.False(zeroByteReadTask.IsCompleted);
zeroByteReadIssued.SetResult();
Assert.Equal(0, await zeroByteReadTask);
Assert.Equal(0, await ReadAsync(async, responseStream, Array.Empty<byte>()));
Assert.Equal(1, await ReadAsync(async, responseStream, responseBuffer));
Assert.Equal(3, responseBuffer[0]);
Assert.Equal(0, await ReadAsync(async, responseStream, responseBuffer));
},
async server =>
{
await server.AcceptConnectionAsync(async connection =>
{
await connection.ReadRequestDataAsync();
await connection.SendResponseAsync(headers: new[] { new HttpHeaderData("Content-Length", "4") }, isFinal: false);
await connection.SendResponseBodyAsync(new byte[] { 42 }, isFinal: false);
await zeroByteReadIssued.Task;
zeroByteReadIssued = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously);
await connection.SendResponseBodyAsync(new byte[] { 1, 2 }, isFinal: false);
await zeroByteReadIssued.Task;
await connection.SendResponseBodyAsync(new byte[] { 3 }, isFinal: true);
});
});
static Task<int> ReadAsync(bool async, Stream stream, byte[] buffer)
{
if (async)
{
return stream.ReadAsync(buffer).AsTask();
}
else
{
return Task.Run(() => stream.Read(buffer));
}
}
}
}
}
| 44.188312
| 195
| 0.633872
|
[
"MIT"
] |
jtschuster/runtime
|
src/libraries/System.Net.Http/tests/FunctionalTests/ResponseStreamZeroByteReadTests.cs
| 13,612
|
C#
|
using System;
using System.Xml.Serialization;
using System.ComponentModel.DataAnnotations;
using BroadWorksConnector.Ocip.Validation;
using System.Collections.Generic;
namespace BroadWorksConnector.Ocip.Models
{
/// <summary>
/// Request to get all the information of a Auto Attendant instance.
/// The response is either GroupAutoAttendantGetInstanceResponse16 or ErrorResponse.
/// <see cref="GroupAutoAttendantGetInstanceResponse16"/>
/// <see cref="ErrorResponse"/>
/// </summary>
[Serializable]
[XmlRoot(Namespace = "")]
[Groups(@"[{""__type"":""Sequence:#BroadWorksConnector.Ocip.Validation"",""id"":""ab0042aa512abc10edb3c55e4b416b0b:3730""}]")]
public class GroupAutoAttendantGetInstanceRequest16 : BroadWorksConnector.Ocip.Models.C.OCIRequest
{
private string _serviceUserId;
[XmlElement(ElementName = "serviceUserId", IsNullable = false, Namespace = "")]
[Group(@"ab0042aa512abc10edb3c55e4b416b0b:3730")]
[MinLength(1)]
[MaxLength(161)]
public string ServiceUserId
{
get => _serviceUserId;
set
{
ServiceUserIdSpecified = true;
_serviceUserId = value;
}
}
[XmlIgnore]
protected bool ServiceUserIdSpecified { get; set; }
}
}
| 31.325581
| 130
| 0.657016
|
[
"MIT"
] |
Rogn/broadworks-connector-net
|
BroadworksConnector/Ocip/Models/GroupAutoAttendantGetInstanceRequest16.cs
| 1,347
|
C#
|
using System.Linq;
namespace ADTool.Extensions
{
public static class ByteArrayExtensions
{
public static string ToHex(this byte[] bytes)
{
return string.Join("", bytes.Select(x => string.Format("{0:x2}", x)));
}
}
}
| 22
| 82
| 0.590909
|
[
"MIT"
] |
bduman/ADTool
|
src/ADTool/Extensions/ByteArrayExtensions.cs
| 264
|
C#
|
using System;
namespace More.Net
{
/// <summary>
///
/// </summary>
public static class Endian
{
/// <summary>
///
/// </summary>
static Endian()
{
flippedBytes = new Byte[]
{
0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0,
0x10, 0x90, 0x50, 0xD0, 0x30, 0xB0, 0x70, 0xF0,
0x08, 0x88, 0x48, 0xC8, 0x28, 0xA8, 0x68, 0xE8,
0x18, 0x98, 0x58, 0xD8, 0x38, 0xB8, 0x78, 0xF8,
0x04, 0x84, 0x44, 0xC4, 0x24, 0xA4, 0x64, 0xE4,
0x14, 0x94, 0x54, 0xD4, 0x34, 0xB4, 0x74, 0xF4,
0x0C, 0x8C, 0x4C, 0xCC, 0x2C, 0xAC, 0x6C, 0xEC,
0x1C, 0x9C, 0x5C, 0xDC, 0x3C, 0xBC, 0x7C, 0xFC,
0x02, 0x82, 0x42, 0xC2, 0x22, 0xA2, 0x62, 0xE2,
0x12, 0x92, 0x52, 0xD2, 0x32, 0xB2, 0x72, 0xF2,
0x0A, 0x8A, 0x4A, 0xCA, 0x2A, 0xAA, 0x6A, 0xEA,
0x1A, 0x9A, 0x5A, 0xDA, 0x3A, 0xBA, 0x7A, 0xFA,
0x06, 0x86, 0x46, 0xC6, 0x26, 0xA6, 0x66, 0xE6,
0x16, 0x96, 0x56, 0xD6, 0x36, 0xB6, 0x76, 0xF6,
0x0E, 0x8E, 0x4E, 0xCE, 0x2E, 0xAE, 0x6E, 0xEE,
0x1E, 0x9E, 0x5E, 0xDE, 0x3E, 0xBE, 0x7E, 0xFE,
0x01, 0x81, 0x41, 0xC1, 0x21, 0xA1, 0x61, 0xE1,
0x11, 0x91, 0x51, 0xD1, 0x31, 0xB1, 0x71, 0xF1,
0x09, 0x89, 0x49, 0xC9, 0x29, 0xA9, 0x69, 0xE9,
0x19, 0x99, 0x59, 0xD9, 0x39, 0xB9, 0x79, 0xF9,
0x05, 0x85, 0x45, 0xC5, 0x25, 0xA5, 0x65, 0xE5,
0x15, 0x95, 0x55, 0xD5, 0x35, 0xB5, 0x75, 0xF5,
0x0D, 0x8D, 0x4D, 0xCD, 0x2D, 0xAD, 0x6D, 0xED,
0x1D, 0x9D, 0x5D, 0xDD, 0x3D, 0xBD, 0x7D, 0xFD,
0x03, 0x83, 0x43, 0xC3, 0x23, 0xA3, 0x63, 0xE3,
0x13, 0x93, 0x53, 0xD3, 0x33, 0xB3, 0x73, 0xF3,
0x0B, 0x8B, 0x4B, 0xCB, 0x2B, 0xAB, 0x6B, 0xEB,
0x1B, 0x9B, 0x5B, 0xDB, 0x3B, 0xBB, 0x7B, 0xFB,
0x07, 0x87, 0x47, 0xC7, 0x27, 0xA7, 0x67, 0xE7,
0x17, 0x97, 0x57, 0xD7, 0x37, 0xB7, 0x77, 0xF7,
0x0F, 0x8F, 0x4F, 0xCF, 0x2F, 0xAF, 0x6F, 0xEF,
0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFF
};
flippedWords = new UInt16[1 << 16];
for (Int32 i = 0; i < flippedWords.Length; i++)
flippedWords[i] = (UInt16)((flippedBytes[i & 0xff] << 8) | flippedBytes[(i >> 8)]);
}
/// <summary>
///
/// </summary>
/// <param name="x"></param>
/// <returns></returns>
public static Int16 Reverse(Int16 x)
{
Int16 z = 0;
z = (Int16)((z << 16) | flippedWords[x & 0xffff]);
x = (Int16)(x >> 16);
return z;
}
/// <summary>
///
/// </summary>
/// <param name="x"></param>
/// <returns></returns>
public static Int32 Reverse(Int32 x)
{
Int32 z = 0;
z = (z << 16) | flippedWords[x & 0xffff];
x = x >> 16;
z = (z << 16) | flippedWords[x & 0xffff];
x = x >> 16;
return z;
}
/// <summary>
///
/// </summary>
/// <param name="x"></param>
/// <returns></returns>
public static Int64 Reverse(Int64 x)
{
Int64 z = 0;
z = (z << 16) | flippedWords[x & 0xffff];
x = x >> 16;
z = (z << 16) | flippedWords[x & 0xffff];
x = x >> 16;
z = (z << 16) | flippedWords[x & 0xffff];
x = x >> 16;
z = (z << 16) | flippedWords[x & 0xffff];
x = x >> 16;
return z;
}
/// <summary>
///
/// </summary>
/// <param name="x"></param>
/// <param name="bits"></param>
/// <returns></returns>
public static Int64 Reverse(Int64 x, Int32 bits)
{
Int32 iter = (bits >> 4) + 1;
Int64 z = 0;
for (Int32 i = 0; i < iter; i++)
{
z = (z << 16) | flippedWords[x & 0xffff];
x = x >> 16;
}
return z >> 16 - (bits & 0xf);
}
private static readonly UInt16[] flippedWords;
private static readonly Byte[] flippedBytes;
}
}
| 33.864662
| 99
| 0.434059
|
[
"MIT"
] |
fallfromgrace/More.Net
|
More.Net/Endian.cs
| 4,506
|
C#
|
using System;
using System.IO;
using Xamarin.Forms;
using ImagenesMercadoLibre.Data;
using ImagenesMercadoLibre.Views;
using ImagenesMercadoLibre.Services.ML;
using ImagenesMercadoLibre.ViewModels.Base;
using ImagenesMercadoLibre.Services.Me;
using ImagenesMercadoLibre.Services;
using System.Net.Http;
namespace ImagenesMercadoLibre
{
public partial class App : Application
{
// HttpClient is intended to be instantiated once per application, rather than per-use. See Remarks.
public readonly HttpClient httpclient;
private static ViewModelLocator _locator;
public static ViewModelLocator Locator
{
get
{
return _locator = _locator ?? new ViewModelLocator();
}
}
public static MercadolibreManager Manager { get; private set; }
public static LoggerManager LoggerManager { get; private set; }
static int _userId;
public static int UserId
{
get
{
if (_userId == 0)
{
var _meRepository = new MeRepository();
var _me = _meRepository.GetAllMe();
_userId = _me[0].ID;
}
return _userId;
}
}
static string myPath;
public static string MyPath
{
get
{
if (myPath == null) myPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
return myPath;
}
}
static string pathImg;
public static string PathImg
{
get
{
if (pathImg == null)
{
//var settingR = new SettingRepository();
//var setting = settingR.SettingGet();
//if (setting != null) pathImg = setting.PathImage;
pathImg = App.LoggerManager.GetFolderPathAsync().Result;//DependencyService.Get<IPathPickerService>().GetFolderPathAsync().Result;
}
return pathImg;
}
//set
//{
// if (pathImg == value) return;
// pathImg = value;
// var settingR = new SettingRepository();
// var setting = new SettingModel();
// setting.PathImage = pathImg;
// settingR.SettingSet(setting);
// //OnPropertyChanged("PathImg");
//}
}
static MyDatabase database;
public static MyDatabase Database
{
get
{
if (database == null) database = new MyDatabase(Path.Combine(MyPath, "ImagenesMercadoLibre.db3"));
return database;
}
}
private static bool runGetItems;
public static bool RunGetItems
{
get
{
return runGetItems;
}
set
{
runGetItems = value;
}
}
private static bool runGetImages;
public static bool RunGetImages
{
get
{
return runGetImages;
}
set
{
runGetImages = value;
}
}
private static bool runUploadImages;
public static bool RunUploadImages
{
get
{
return runUploadImages;
}
set
{
runUploadImages = value;
}
}
//#region StartupProgress (decimal)
//private decimal _StartupProgress;
///// <summary>Decimal values of 0 - 1
/////
///// </summary>
//public decimal StartupProgress
//{
// get
// {
// return _StartupProgress;
// }
// set
// {
// if (_StartupProgress == value) return;
// _StartupProgress = value;
// OnPropertyChanged("StartupProgress");
// }
//}
//#endregion StartupProgress (decimal)
public App()
{
InitializeComponent();
Manager = new MercadolibreManager(new MercadolibreService());
LoggerManager = new LoggerManager(DependencyService.Get<IPathPickerService>());//LoggerService());
//MainPage = new MainPage();
MainPage = new NavigationPage(new MainPage());
}
protected override void OnStart()
{
// Handle when your app starts
}
protected override void OnSleep()
{
// Handle when your app sleeps
}
protected override void OnResume()
{
// Handle when your app resumes
}
}
}
| 29.099415
| 150
| 0.491359
|
[
"Apache-2.0"
] |
Civeloo/ImagenesMercadoLibre
|
ImagenesMercadoLibre/ImagenesMercadoLibre/App.xaml.cs
| 4,978
|
C#
|
//-----------------------------------------------------------------------
// <copyright file="GitHub.cs" company="https://github.com/jhueppauff/Dynamics365-Customizing-Downloader">
// Copyright 2018 Jhueppauff
// Mozilla Public License Version 2.0
// For licence details visit https://github.com/jhueppauff/Dynamics365-Customizing-Downloader/blob/master/LICENSE
// </copyright>
//-----------------------------------------------------------------------
namespace UnitTest
{
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
/// <summary>
/// Unit Test for GitHub related functions
/// </summary>
[TestClass]
public class GitHub
{
/// <summary>
/// GitHub API URL
/// </summary>
private const string GitHubApiUrl = "https://api.github.com/repos/jhueppauff/Dynamics365-Customizing-Downloader";
/// <summary>
/// Validates if the Release Information can be retrieved
/// </summary>
[TestMethod]
public void GithubRetrieveReleaseInfo()
{
Dynamics365CustomizingDownloader.Core.Update.UpdateChecker updateChecker = new Dynamics365CustomizingDownloader.Core.Update.UpdateChecker();
var release = updateChecker.GetReleaseInfo(GitHubApiUrl);
if (release == null || release.Name == null)
{
throw new Exception("Release retrieve failed.");
}
}
/// <summary>
/// Validates if the Update Check works
/// </summary>
[TestMethod]
public void GitHubUpdateCheck()
{
Dynamics365CustomizingDownloader.Core.Update.UpdateChecker updateChecker = new Dynamics365CustomizingDownloader.Core.Update.UpdateChecker();
bool updateAvailable = updateChecker.IsUpdateAvailable(GitHubApiUrl);
}
/// <summary>
/// Validates the Update Url retrieve
/// </summary>
[TestMethod]
public void GetUpdateUrl()
{
Dynamics365CustomizingDownloader.Core.Update.UpdateChecker updateChecker = new Dynamics365CustomizingDownloader.Core.Update.UpdateChecker();
Uri updateUrl = updateChecker.GetUpdateURL(GitHubApiUrl);
// ToDo validate Url/Output
}
}
}
| 37.080645
| 152
| 0.605481
|
[
"MPL-2.0"
] |
jhueppauff/Dynamics365-Customizing-Downloader
|
UnitTest/GitHub.cs
| 2,301
|
C#
|
using System.Collections.Generic;
using System.IO;
namespace GitNoob.Gui.Program.Action.Remedy
{
public class RenameExistingDirectory : Remedy
{
public RenameExistingDirectory(Step.Step Step, MessageWithLinks Message) :
base(Step, ref Message)
{
string RenameTo = Utils.FileUtils.DirectoryCopyRenameToDestinationName(StepsExecutor.Config.ProjectWorkingDirectory.Path.ToString());
VisualizerMessageButtons =
new Dictionary<string, System.Action<MessageInput>>()
{
{ "Cancel", (input) => {
Cancel();
} },
{ "Open Windows Explorer", (input) => {
StepsExecutor.StartExplorer();
} },
{ "Rename the directory \"" + StepsExecutor.Config.ProjectWorkingDirectory.Path + "\" to \"" + Path.GetFileName(RenameTo) + "\"", (input) => {
var step = new Step.RenameDirectory(RenameTo);
StepsExecutor.InjectSteps(new List<StepsExecutor.IExecutableByStepsExecutor>() { step, Step });
Done();
} }
};
}
}
}
| 39.84375
| 162
| 0.523137
|
[
"MIT"
] |
MircoBabin/GitNoob
|
src/GitNoob.Gui.Program/Action/Remedy/RenameExistingDirectory.cs
| 1,277
|
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.InteropServices;
using Microsoft.Win32.SafeHandles;
namespace System.Diagnostics
{
public static partial class Debug
{
// internal and not read only so that the tests can swap this out.
internal static IDebugLogger s_logger = new UnixDebugLogger();
// --------------
// PAL ENDS HERE
// --------------
internal sealed class UnixDebugLogger : IDebugLogger
{
public void ShowAssertDialog(string stackTrace, string message, string detailMessage)
{
// TODO: Implement this
throw new NotImplementedException();
}
public void WriteCore(string message)
{
WriteToSyslog(message);
WriteToFile(Interop.Devices.stderr, message);
}
private static void WriteToSyslog(string message)
{
Interop.libc.syslog(Interop.libc.LOG_USER | Interop.libc.LOG_DEBUG, "%s", message);
}
private static void WriteToFile(string filePath, string message)
{
// We don't want to write UTF-16 to a file like standard error. Ideally we would transcode this
// to UTF8, but the downside of that is it pulls in a bunch of stuff into what is ideally
// a path with minimal dependencies (as to prevent re-entrency), so we'll take the strategy
// of just throwing away any non ASCII characters from the message and writing the rest
const int BufferLength = 256;
unsafe
{
byte* buf = stackalloc byte[BufferLength];
int bufCount;
int i = 0;
using (SafeFileHandle fileHandle = SafeFileHandle.Open(filePath, Interop.libc.OpenFlags.O_WRONLY, 0))
{
while (i < message.Length)
{
for (bufCount = 0; bufCount < BufferLength && i < message.Length; i++)
{
if (message[i] <= 0x7F)
{
buf[bufCount] = (byte)message[i];
bufCount++;
}
}
while (bufCount > 0)
{
int bytesWritten;
while (Interop.CheckIo(bytesWritten = (int)Interop.libc.write((int)fileHandle.DangerousGetHandle(), buf, new IntPtr(bufCount)))) ;
bufCount -= bytesWritten;
buf += bytesWritten;
}
}
}
}
}
}
}
}
| 38.098765
| 162
| 0.481529
|
[
"MIT"
] |
josephwinston/corefx
|
src/System.Diagnostics.Debug/src/System/Diagnostics/Debug.Unix.cs
| 3,088
|
C#
|
using CloudNative.CloudEvents;
using Google.Cloud.Functions.Framework;
using Google.Events.Protobuf.Cloud.Storage.V1;
using System;
using System.Threading;
using System.Threading.Tasks;
namespace MyFunction
{
/// <summary>
/// A function that can be triggered in responses to changes in Google Cloud Storage.
/// The type argument (StorageObjectData in this case) determines how the event payload is deserialized.
/// The function must be deployed so that the trigger matches the expected payload type. (For example,
/// deploying a function expecting a StorageObject payload will not work for a trigger that provides
/// a FirestoreEvent.)
/// </summary>
public class Function : ICloudEventFunction<StorageObjectData>
{
/// <summary>
/// Logic for your function goes here. Note that a Cloud Event function just consumes an event;
/// it doesn't provide any response.
/// </summary>
/// <param name="cloudEvent">The Cloud Event your function should consume.</param>
/// <param name="data">The deserialized data within the Cloud Event.</param>
/// <param name="cancellationToken">A cancellation token that is notified if the request is aborted.</param>
/// <returns>A task representing the asynchronous operation.</returns>
public Task HandleAsync(CloudEvent cloudEvent, StorageObjectData data, CancellationToken cancellationToken)
{
Console.WriteLine("Storage object information:");
Console.WriteLine($" Name: {data.Name}");
Console.WriteLine($" Bucket: {data.Bucket}");
Console.WriteLine($" Size: {data.Size}");
Console.WriteLine($" Content type: {data.ContentType}");
Console.WriteLine("Cloud event information:");
Console.WriteLine($" ID: {cloudEvent.Id}");
Console.WriteLine($" Source: {cloudEvent.Source}");
Console.WriteLine($" Type: {cloudEvent.Type}");
Console.WriteLine($" Subject: {cloudEvent.Subject}");
Console.WriteLine($" DataSchema: {cloudEvent.DataSchema}");
Console.WriteLine($" DataContentType: {cloudEvent.DataContentType}");
Console.WriteLine($" Time: {cloudEvent.Time?.ToUniversalTime():yyyy-MM-dd'T'HH:mm:ss.fff'Z'}");
Console.WriteLine($" SpecVersion: {cloudEvent.SpecVersion}");
// In this example, we don't need to perform any asynchronous operations, so the
// method doesn't need to be declared async.
return Task.CompletedTask;
}
}
}
| 52.4
| 116
| 0.658015
|
[
"Apache-2.0"
] |
AshleyMedway/functions-framework-dotnet
|
src/Google.Cloud.Functions.Templates/templates/event-function-cs/Function.cs
| 2,620
|
C#
|
using Application.Auth.Commands.RegisterNewUser;
using Application.Common;
using Application.Common.Dtos;
using Application.Common.Interfaces;
using Application.User;
using Domain.Entities;
using MediatR;
using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore;
using Persistence;
using System.Threading;
using System.Threading.Tasks;
namespace Application.Auth {
/// <summary>
/// Registers a new user with Identity.
/// </summary>
public class RegisterNewUserCommandHandler : IRequestHandler<RegisterNewUserCommand, Result<UserAndTokenDto>> {
private readonly ApplicationContext _context;
private readonly UserManager<ApplicationUser> _userManager;
private readonly ITokenManager _tokenManager;
private readonly IHttpContextManager _httpContextManager;
public RegisterNewUserCommandHandler(ApplicationContext context, UserManager<ApplicationUser> userManager,
ITokenManager tokenManager, IHttpContextManager httpContextManager) {
_context = context;
_userManager = userManager;
_tokenManager = tokenManager;
_httpContextManager = httpContextManager;
}
public async Task<Result<UserAndTokenDto>> Handle(RegisterNewUserCommand request, CancellationToken cancellationToken) {
if (await _context.Users.AnyAsync(x => x.Email == request.Email)) {
return Result<UserAndTokenDto>.Failure("Email already exists.");
}
var newUser = await CreateAndLoginNewUser(request);
if (newUser is null) return Result<UserAndTokenDto>.Failure("Unable to create new user.");
var refreshToken = await CreateAndSaveRefreshToken(newUser);
if (refreshToken is null) return Result<UserAndTokenDto>.Failure("Unable to save new refresh token.");
return FinishRegister(newUser, refreshToken);
}
private async Task<ApplicationUser> CreateAndLoginNewUser(RegisterNewUserCommand request) {
var newUser = new ApplicationUser {
Name = request.Name,
UserName = request.Email,
Email = request.Email
};
var createUser = await _userManager.CreateAsync(newUser, request.Password);
if (!createUser.Succeeded) return null;
return newUser;
}
private async Task<RefreshToken> CreateAndSaveRefreshToken(ApplicationUser user) {
var refreshToken = new RefreshToken {
Token = _tokenManager.GenerateRefreshToken(),
ApplicationUser = user
};
_context.RefreshTokens.Add(refreshToken);
var success = await _context.SaveChangesAsync() > 0;
if (!success) return null;
return refreshToken;
}
private Result<UserAndTokenDto> FinishRegister(ApplicationUser user, RefreshToken refreshToken) {
_httpContextManager.SetHttpCookieRefreshToken(refreshToken);
var accessToken = _tokenManager.GenerateJWT(user);
var userDto = new UserDto {
Name = user.Name,
Email = user.Email
};
var userAndTokenDto = new UserAndTokenDto {
User = userDto,
AccessToken = accessToken,
ExpiresAt = _tokenManager.GetJWTExpirationDate(accessToken),
};
return Result<UserAndTokenDto>.Success(userAndTokenDto);
}
}
}
| 38.802198
| 128
| 0.662985
|
[
"MIT"
] |
mrodrigues95/ClassroomChat
|
api/Application/Auth/Commands/RegisterNewUser/RegisterNewUserCommandHandler.cs
| 3,533
|
C#
|
using System;
using System.Runtime.Serialization;
namespace _4charm.Models
{
[DataContract]
public class BoardID
{
[DataMember]
public string Name { get; set; }
[DataMember]
public string Description { get; set; }
[DataMember]
public bool IsNSFW { get; set; }
public BoardID(string name, string description, bool isNSFW)
{
Name = name;
Description = description;
IsNSFW = isNSFW;
}
}
}
| 22.333333
| 69
| 0.539179
|
[
"MIT"
] |
pantaloons/4charm
|
4charm/Models/BoardID.cs
| 538
|
C#
|
// Python Tools for Visual Studio
// Copyright(c) Microsoft Corporation
// 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
//
// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY
// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
// MERCHANTABLITY OR NON-INFRINGEMENT.
//
// See the Apache Version 2.0 License for specific language governing
// permissions and limitations under the License.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using Microsoft.PythonTools.Debugger;
using Microsoft.PythonTools.DkmDebugger.Proxies;
using Microsoft.VisualStudio.Debugger;
using Microsoft.VisualStudio.Debugger.Breakpoints;
using Microsoft.VisualStudio.Debugger.CallStack;
using Microsoft.VisualStudio.Debugger.Stepping;
namespace Microsoft.PythonTools.DkmDebugger {
internal unsafe class TraceManager : DkmDataItem {
// Layout of this struct must always remain in sync with DebuggerHelper/trace.cpp.
[StructLayout(LayoutKind.Sequential, Pack = 8)]
private struct DebuggerString {
public const int SizeOf = 4;
public int length;
public fixed char data[1];
}
// Layout of this struct must always remain in sync with DebuggerHelper/trace.cpp.
[StructLayout(LayoutKind.Sequential, Pack = 8)]
private struct BreakpointData {
public int maxLineNumber;
public ulong lineNumbers;
public ulong fileNamesOffsets;
public ulong strings;
}
// Layout of this struct must always remain in sync with DebuggerHelper/trace.cpp.
[StructLayout(LayoutKind.Sequential, Pack = 8)]
private struct CurrentSourceLocation {
public int lineNumber;
public ulong fileName;
}
private readonly DkmProcess _process;
private readonly PythonRuntimeInfo _pyrtInfo;
private readonly Dictionary<SourceLocation, List<DkmRuntimeBreakpoint>> _breakpoints = new Dictionary<SourceLocation, List<DkmRuntimeBreakpoint>>();
private readonly ArrayProxy<CliStructProxy<BreakpointData>> _breakpointData;
private readonly ByteProxy _currentBreakpointData, _breakpointDataInUseByTraceFunc;
private readonly CliStructProxy<CurrentSourceLocation> _currentSourceLocation;
private readonly Int32Proxy _stepKind, _steppingStackDepth;
private readonly UInt64Proxy _stepThreadId;
private readonly DkmRuntimeBreakpoint _onBreakpointHitBP, _onStepCompleteBP, _onStepFallThroughBP;
private DkmStepper _stepper;
public TraceManager(DkmProcess process) {
_process = process;
_pyrtInfo = process.GetPythonRuntimeInfo();
_breakpointData = _pyrtInfo.DLLs.DebuggerHelper.GetExportedStaticVariable<ArrayProxy<CliStructProxy<BreakpointData>>>("breakpointData");
_currentBreakpointData = _pyrtInfo.DLLs.DebuggerHelper.GetExportedStaticVariable<ByteProxy>("currentBreakpointData");
_breakpointDataInUseByTraceFunc = _pyrtInfo.DLLs.DebuggerHelper.GetExportedStaticVariable<ByteProxy>("breakpointDataInUseByTraceFunc");
_currentSourceLocation = _pyrtInfo.DLLs.DebuggerHelper.GetExportedStaticVariable<CliStructProxy<CurrentSourceLocation>>("currentSourceLocation");
_stepKind = _pyrtInfo.DLLs.DebuggerHelper.GetExportedStaticVariable<Int32Proxy>("stepKind");
_stepThreadId = _pyrtInfo.DLLs.DebuggerHelper.GetExportedStaticVariable<UInt64Proxy>("stepThreadId");
_steppingStackDepth = _pyrtInfo.DLLs.DebuggerHelper.GetExportedStaticVariable<Int32Proxy>("steppingStackDepth");
var onBreakpointHit = _pyrtInfo.DLLs.DebuggerHelper.FindExportName("OnBreakpointHit", true);
_onBreakpointHitBP = DkmRuntimeInstructionBreakpoint.Create(Guids.PythonTraceManagerSourceGuid, null, onBreakpointHit, false, null);
_onBreakpointHitBP.Enable();
var onStepComplete = _pyrtInfo.DLLs.DebuggerHelper.FindExportName("OnStepComplete", true);
_onStepCompleteBP = DkmRuntimeInstructionBreakpoint.Create(Guids.PythonTraceManagerSourceGuid, null, onStepComplete, false, null);
_onStepCompleteBP.Enable();
var onStepFallThrough = _pyrtInfo.DLLs.DebuggerHelper.FindExportName("OnStepFallThrough", true);
_onStepFallThroughBP = DkmRuntimeInstructionBreakpoint.Create(Guids.PythonTraceManagerSourceGuid, null, onStepFallThrough, false, null);
_onStepFallThroughBP.Enable();
WriteBreakpoints();
}
public void OnNativeBreakpointHit(DkmRuntimeBreakpoint nativeBP, DkmThread thread) {
if (nativeBP == _onBreakpointHitBP) {
OnBreakpointHit(thread);
} else if (nativeBP == _onStepCompleteBP) {
OnStepComplete(thread);
} else if (nativeBP == _onStepFallThroughBP) {
OnStepFallThrough(thread);
} else if (nativeBP.SourceId == Guids.PythonStepTargetSourceGuid) {
OnStepTargetBreakpoint(thread);
} else {
Debug.Fail("BreakpointManager notified about a native breakpoint that it didn't create.");
}
}
public void AddBreakpoint(DkmRuntimeBreakpoint bp) {
var loc = bp.GetDataItem<SourceLocation>();
List<DkmRuntimeBreakpoint> bpsAtLoc;
if (!_breakpoints.TryGetValue(loc, out bpsAtLoc)) {
_breakpoints[loc] = bpsAtLoc = new List<DkmRuntimeBreakpoint>();
}
bpsAtLoc.Add(bp);
WriteBreakpoints();
}
public void RemoveBreakpoint(DkmRuntimeBreakpoint bp) {
var loc = bp.GetDataItem<SourceLocation>();
List<DkmRuntimeBreakpoint> bpsAtLoc;
if (!_breakpoints.TryGetValue(loc, out bpsAtLoc)) {
return;
}
if (!bpsAtLoc.Remove(bp)) {
return;
}
if (bpsAtLoc.Count == 0) {
_breakpoints.Remove(loc);
}
WriteBreakpoints();
}
private class StructuralArrayEqualityComparer<T> : EqualityComparer<T[]> {
public override bool Equals(T[] x, T[] y) {
return StructuralComparisons.StructuralEqualityComparer.Equals(x, y);
}
public override int GetHashCode(T[] obj) {
return StructuralComparisons.StructuralEqualityComparer.GetHashCode(obj);
}
}
private void WriteBreakpoints() {
int maxLineNumber = _breakpoints.Keys.Select(loc => loc.LineNumber).DefaultIfEmpty().Max();
var lineNumbersStream = new MemoryStream((maxLineNumber + 1) * sizeof(int));
var lineNumbersWriter = new BinaryWriter(lineNumbersStream);
var stringsStream = new MemoryStream();
var stringsWriter = new BinaryWriter(stringsStream);
var stringOffsets = new Dictionary<string, int>();
stringsWriter.Write((int)0);
foreach (var s in _breakpoints.Keys.Select(loc => loc.FileName).Distinct()) {
stringOffsets[s] = (int)stringsStream.Position;
stringsWriter.Write((int)s.Length);
foreach (char c in s) {
stringsWriter.Write((ushort)c);
}
stringsWriter.Write((ushort)0);
}
var fileNamesOffsetsStream = new MemoryStream();
var fileNamesOffsetsWriter = new BinaryWriter(fileNamesOffsetsStream);
var fileNamesOffsetsIndices = new Dictionary<int[], int>(new StructuralArrayEqualityComparer<int>());
fileNamesOffsetsWriter.Write((int)0);
foreach (var g in _breakpoints.Keys.GroupBy(loc => loc.LineNumber)) {
var lineNumber = g.Key;
var fileNamesOffsets = g.Select(loc => stringOffsets[loc.FileName]).ToArray();
Array.Sort(fileNamesOffsets);
int fileNamesOffsetsIndex;
if (!fileNamesOffsetsIndices.TryGetValue(fileNamesOffsets, out fileNamesOffsetsIndex)) {
fileNamesOffsetsIndex = (int)fileNamesOffsetsStream.Position / sizeof(int);
foreach (int offset in fileNamesOffsets) {
fileNamesOffsetsWriter.Write(offset);
}
fileNamesOffsetsWriter.Write((int)0);
fileNamesOffsetsIndices.Add(fileNamesOffsets, fileNamesOffsetsIndex);
}
lineNumbersStream.Position = lineNumber * sizeof(int);
lineNumbersWriter.Write(fileNamesOffsetsIndex);
}
byte breakpointDataInUseByTraceFunc = _breakpointDataInUseByTraceFunc.Read();
byte currentBreakpointData = (breakpointDataInUseByTraceFunc == 0) ? (byte)1 : (byte)0;
_currentBreakpointData.Write(currentBreakpointData);
var bpDataProxy = _breakpointData[currentBreakpointData];
BreakpointData bpData = bpDataProxy.Read();
if (bpData.lineNumbers != 0) {
_process.FreeVirtualMemory(bpData.lineNumbers, 0, NativeMethods.MEM_RELEASE);
}
if (bpData.fileNamesOffsets != 0) {
_process.FreeVirtualMemory(bpData.fileNamesOffsets, 0, NativeMethods.MEM_RELEASE);
}
if (bpData.strings != 0) {
_process.FreeVirtualMemory(bpData.strings, 0, NativeMethods.MEM_RELEASE);
}
bpData.maxLineNumber = maxLineNumber;
if (lineNumbersStream.Length > 0) {
bpData.lineNumbers = _process.AllocateVirtualMemory(0, (int)lineNumbersStream.Length, NativeMethods.MEM_COMMIT | NativeMethods.MEM_RESERVE, NativeMethods.PAGE_READWRITE);
_process.WriteMemory(bpData.lineNumbers, lineNumbersStream.ToArray());
} else {
bpData.lineNumbers = 0;
}
bpData.fileNamesOffsets = _process.AllocateVirtualMemory(0, (int)fileNamesOffsetsStream.Length, NativeMethods.MEM_COMMIT | NativeMethods.MEM_RESERVE, NativeMethods.PAGE_READWRITE);
_process.WriteMemory(bpData.fileNamesOffsets, fileNamesOffsetsStream.ToArray());
bpData.strings = _process.AllocateVirtualMemory(0, (int)stringsStream.Length, NativeMethods.MEM_COMMIT | NativeMethods.MEM_RESERVE, NativeMethods.PAGE_READWRITE);
_process.WriteMemory(bpData.strings, stringsStream.ToArray());
bpDataProxy.Write(bpData);
}
private void OnBreakpointHit(DkmThread thread) {
CurrentSourceLocation cbp = _currentSourceLocation.Read();
DebuggerString fileNameDS;
_process.ReadMemory(cbp.fileName, DkmReadMemoryFlags.None, &fileNameDS, sizeof(DebuggerString));
char* fileNameBuf = stackalloc char[fileNameDS.length];
ulong dataOffset = (ulong)((byte*)fileNameDS.data - (byte*)&fileNameDS);
_process.ReadMemory(cbp.fileName + dataOffset, DkmReadMemoryFlags.None, fileNameBuf, fileNameDS.length * 2);
string fileName = new string(fileNameBuf, 0, fileNameDS.length);
var loc = new SourceLocation(fileName, cbp.lineNumber);
List<DkmRuntimeBreakpoint> bps;
if (!_breakpoints.TryGetValue(loc, out bps)) {
Debug.Fail("TraceFunc signalled a breakpoint at a location that BreakpointManager does not know about.");
return;
}
foreach (var bp in bps) {
bp.OnHit(thread, false);
}
}
private class StepBeginState : DkmDataItem {
public ulong FrameBase { get; set; }
}
public void BeforeEnableNewStepper(DkmRuntimeInstance runtimeInstance, DkmStepper stepper) {
ulong retAddr, frameBase, vframe;
stepper.Thread.GetCurrentFrameInfo(out retAddr, out frameBase, out vframe);
stepper.SetDataItem(DkmDataCreationDisposition.CreateAlways, new StepBeginState { FrameBase = frameBase });
}
public void Step(DkmStepper stepper, DkmStepArbitrationReason reason) {
var thread = stepper.Thread;
var process = thread.Process;
if (stepper.StepKind == DkmStepKind.StepIntoSpecific) {
throw new NotSupportedException();
} else if (_stepper != null) {
_stepper.CancelStepper(process.GetPythonRuntimeInstance());
_stepper = null;
}
// Check if this was a step out (or step over/in that fell through) from native to Python.
// If so, we consider the step done, since we can report the correct callstack at this point.
if (reason == DkmStepArbitrationReason.TransitionModule) {
var beginState = stepper.GetDataItem<StepBeginState>();
if (beginState != null) {
ulong retAddr, frameBase, vframe;
thread.GetCurrentFrameInfo(out retAddr, out frameBase, out vframe);
if (frameBase >= beginState.FrameBase) {
stepper.OnStepComplete(thread, false);
return;
}
}
}
if (stepper.StepKind == DkmStepKind.Into) {
new LocalComponent.BeginStepInNotification {
ThreadId = thread.UniqueId
}.SendHigher(process);
}
_stepper = stepper;
_stepKind.Write((int)stepper.StepKind + 1);
_stepThreadId.Write((uint)thread.SystemPart.Id);
_steppingStackDepth.Write(0);
}
public void CancelStep(DkmStepper stepper) {
if (_stepper == null) {
return;
} else if (stepper != _stepper) {
Debug.Fail("Trying to cancel a step while no step or another step is in progress.");
throw new InvalidOperationException();
}
StepDone(stepper.Thread);
}
private void OnStepComplete(DkmThread thread) {
if (_stepper != null) {
StepDone(thread).OnStepComplete(thread, false);
}
}
private void OnStepTargetBreakpoint(DkmThread thread) {
if (_stepper == null) {
Debug.Fail("OnStepTargetBreakpoint called but no step operation is in progress.");
throw new InvalidOperationException();
}
if (_stepper.StepKind == DkmStepKind.Into) {
StepDone(thread).OnStepArbitration(DkmStepArbitrationReason.ExitRuntime, _process.GetPythonRuntimeInstance());
} else {
// Just because we hit the return breakpoint doesn't mean that we've actually returned - it could be
// a recursive call. Check stack depth to distinguish this from an actual return.
var beginState = _stepper.GetDataItem<StepBeginState>();
if (beginState != null) {
ulong retAddr, frameBase, vframe;
thread.GetCurrentFrameInfo(out retAddr, out frameBase, out vframe);
if (frameBase > beginState.FrameBase) {
OnStepComplete(thread);
}
}
}
}
private DkmStepper StepDone(DkmThread thread) {
new LocalComponent.StepCompleteNotification().SendHigher(thread.Process);
new LocalStackWalkingComponent.StepCompleteNotification().SendHigher(thread.Process);
var stepper = _stepper;
_stepper = null;
_stepKind.Write(0);
return stepper;
}
private void OnStepFallThrough(DkmThread thread) {
// Step fell through the end of the frame in which it began - time to register the breakpoint for the return address.
new LocalStackWalkingComponent.BeginStepOutNotification {
ThreadId = thread.UniqueId
}.SendHigher(_process);
}
}
}
| 47.52149
| 192
| 0.642327
|
[
"Apache-2.0"
] |
Cellule/PTVS
|
Python/Product/Debugger/DkmDebugger/TraceManager.cs
| 16,585
|
C#
|
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System.Threading;
using System.Threading.Tasks;
using Azure.Core;
namespace Azure.Messaging.EventHubs.Producer
{
/// <summary>
/// A client responsible for publishing <see cref="EventData" /> to a specific Event Hub,
/// grouped together in batches. Depending on the options specified when sending, events may
/// be automatically assigned an available partition or may request a specific partition.
/// </summary>
///
/// <remarks>
/// <list type="bullet">
/// <listheader><description>Allowing automatic routing of partitions is recommended when:</description></listheader>
/// <item><description>The sending of events needs to be highly available.</description></item>
/// <item><description>The event data should be evenly distributed among all available partitions.</description></item>
/// </list>
///
/// <list type="number">
/// <listheader><description>If no partition is specified, the following rules are used for automatically selecting one:</description></listheader>
/// <item><description>Distribute the events equally amongst all available partitions using a round-robin approach.</description></item>
/// <item><description>If a partition becomes unavailable, the Event Hubs service will automatically detect it and forward the message to another available partition.</description></item>
/// </list>
///
/// <para>
/// The <see cref="IdempotentProducer" /> is safe to cache and use for the lifetime of an application, and that is best practice when the application
/// publishes events regularly or semi-regularly. The producer holds responsibility for efficient resource management, working to keep resource usage low during
/// periods of inactivity and manage health during periods of higher use. Calling either the <see cref="EventHubProducerClient.CloseAsync" /> or <see cref="EventHubProducerClient.DisposeAsync" />
/// method as the application is shutting down will ensure that network resources and other unmanaged objects are properly cleaned up.
/// </para>
/// </remarks>
///
public class IdempotentProducer : EventHubProducerClient
{
/// <summary>
/// Initializes a new instance of the <see cref="IdempotentProducer" /> class.
/// </summary>
///
/// <param name="connectionString">The connection string to use for connecting to the Event Hubs namespace; it is expected that the Event Hub name and the shared key properties are contained in this connection string.</param>
///
/// <remarks>
/// If the connection string is copied from the Event Hubs namespace, it will likely not contain the name of the desired Event Hub,
/// which is needed. In this case, the name can be added manually by adding ";EntityPath=[[ EVENT HUB NAME ]]" to the end of the
/// connection string. For example, ";EntityPath=telemetry-hub".
///
/// If you have defined a shared access policy directly on the Event Hub itself, then copying the connection string from that
/// Event Hub will result in a connection string that contains the name.
/// </remarks>
///
/// <seealso href="https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-get-connection-string">How to get an Event Hubs connection string</seealso>
///
public IdempotentProducer(string connectionString) : this(connectionString, null, null)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="IdempotentProducer" /> class.
/// </summary>
///
/// <param name="connectionString">The connection string to use for connecting to the Event Hubs namespace; it is expected that the Event Hub name and the shared key properties are contained in this connection string.</param>
/// <param name="clientOptions">The set of options to use for this consumer.</param>
///
/// <remarks>
/// If the connection string is copied from the Event Hubs namespace, it will likely not contain the name of the desired Event Hub,
/// which is needed. In this case, the name can be added manually by adding ";EntityPath=[[ EVENT HUB NAME ]]" to the end of the
/// connection string. For example, ";EntityPath=telemetry-hub".
///
/// If you have defined a shared access policy directly on the Event Hub itself, then copying the connection string from that
/// Event Hub will result in a connection string that contains the name.
/// </remarks>
///
/// <seealso href="https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-get-connection-string">How to get an Event Hubs connection string</seealso>
///
public IdempotentProducer(string connectionString,
IdempotentProducerOptions clientOptions) : this(connectionString, null, clientOptions)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="IdempotentProducer" /> class.
/// </summary>
///
/// <param name="connectionString">The connection string to use for connecting to the Event Hubs namespace; it is expected that the shared key properties are contained in this connection string, but not the Event Hub name.</param>
/// <param name="eventHubName">The name of the specific Event Hub to associate the producer with.</param>
///
/// <remarks>
/// If the connection string is copied from the Event Hub itself, it will contain the name of the desired Event Hub,
/// and can be used directly without passing the <paramref name="eventHubName" />. The name of the Event Hub should be
/// passed only once, either as part of the connection string or separately.
/// </remarks>
///
/// <seealso href="https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-get-connection-string">How to get an Event Hubs connection string</seealso>
///
public IdempotentProducer(string connectionString,
string eventHubName) : this(connectionString, eventHubName, null)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="IdempotentProducer" /> class.
/// </summary>
///
/// <param name="connectionString">The connection string to use for connecting to the Event Hubs namespace; it is expected that the shared key properties are contained in this connection string, but not the Event Hub name.</param>
/// <param name="eventHubName">The name of the specific Event Hub to associate the producer with.</param>
/// <param name="clientOptions">A set of options to apply when configuring the producer.</param>
///
/// <remarks>
/// If the connection string is copied from the Event Hub itself, it will contain the name of the desired Event Hub,
/// and can be used directly without passing the <paramref name="eventHubName" />. The name of the Event Hub should be
/// passed only once, either as part of the connection string or separately.
/// </remarks>
///
/// <seealso href="https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-get-connection-string">How to get an Event Hubs connection string</seealso>
///
public IdempotentProducer(string connectionString,
string eventHubName,
IdempotentProducerOptions clientOptions) : base(connectionString, eventHubName, clientOptions)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="IdempotentProducer" /> class.
/// </summary>
///
/// <param name="fullyQualifiedNamespace">The fully qualified Event Hubs namespace to connect to. This is likely to be similar to <c>{yournamespace}.servicebus.windows.net</c>.</param>
/// <param name="eventHubName">The name of the specific Event Hub to associate the producer with.</param>
/// <param name="credential">The shared access key credential to use for authorization. Access controls may be specified by the Event Hubs namespace or the requested Event Hub, depending on Azure configuration.</param>
/// <param name="clientOptions">A set of options to apply when configuring the producer.</param>
///
public IdempotentProducer(string fullyQualifiedNamespace,
string eventHubName,
AzureNamedKeyCredential credential,
IdempotentProducerOptions clientOptions = default) : base(fullyQualifiedNamespace, eventHubName, credential, clientOptions)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="IdempotentProducer" /> class.
/// </summary>
///
/// <param name="fullyQualifiedNamespace">The fully qualified Event Hubs namespace to connect to. This is likely to be similar to <c>{yournamespace}.servicebus.windows.net</c>.</param>
/// <param name="eventHubName">The name of the specific Event Hub to associate the producer with.</param>
/// <param name="credential">The shared access signature credential to use for authorization. Access controls may be specified by the Event Hubs namespace or the requested Event Hub, depending on Azure configuration.</param>
/// <param name="clientOptions">A set of options to apply when configuring the producer.</param>
///
public IdempotentProducer(string fullyQualifiedNamespace,
string eventHubName,
AzureSasCredential credential,
IdempotentProducerOptions clientOptions = default) : base(fullyQualifiedNamespace, eventHubName, credential, clientOptions)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="IdempotentProducer" /> class.
/// </summary>
///
/// <param name="fullyQualifiedNamespace">The fully qualified Event Hubs namespace to connect to. This is likely to be similar to <c>{yournamespace}.servicebus.windows.net</c>.</param>
/// <param name="eventHubName">The name of the specific Event Hub to associate the producer with.</param>
/// <param name="credential">The Azure managed identity credential to use for authorization. Access controls may be specified by the Event Hubs namespace or the requested Event Hub, depending on Azure configuration.</param>
/// <param name="clientOptions">A set of options to apply when configuring the producer.</param>
///
public IdempotentProducer(string fullyQualifiedNamespace,
string eventHubName,
TokenCredential credential,
IdempotentProducerOptions clientOptions = default): base(fullyQualifiedNamespace, eventHubName, credential, clientOptions)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="IdempotentProducer" /> class.
/// </summary>
///
/// <param name="connection">The <see cref="EventHubConnection" /> connection to use for communication with the Event Hubs service.</param>
/// <param name="clientOptions">A set of options to apply when configuring the producer.</param>
///
public IdempotentProducer(EventHubConnection connection,
IdempotentProducerOptions clientOptions = default) : base(connection, clientOptions)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="IdempotentProducer" /> class.
/// </summary>
///
protected IdempotentProducer() : base()
{
}
/// <summary>
/// A set of information about the state of publishing for a partition, as observed by the <see cref="EventHubProducerClient" />. This
/// data can always be read, but will only be populated with information relevant to the active features for the producer client.
/// </summary>
///
/// <param name="partitionId">The unique identifier of a partition associated with the Event Hub.</param>
/// <param name="cancellationToken">An optional <see cref="CancellationToken" /> instance to signal the request to cancel the operation.</param>
///
/// <returns>The set of information about the publishing state of the requested partition, within the context of this producer.</returns>
///
/// <remarks>
/// The state of a partition is only understood by the <see cref="EventHubProducerClient" /> after events have been published to that
/// partition; calling this method for a partition before events have been published to it will return an empty set of properties.
/// </remarks>
///
public virtual new async Task<PartitionPublishingProperties> GetPartitionPublishingPropertiesAsync(string partitionId,
CancellationToken cancellationToken = default) =>
await base.GetPartitionPublishingPropertiesAsync(partitionId, cancellationToken).ConfigureAwait(false);
}
}
| 64.676056
| 238
| 0.649245
|
[
"MIT"
] |
ChenTanyi/azure-sdk-for-net
|
sdk/eventhub/Azure.Messaging.EventHubs.Experimental/src/Producer/IdempotentProducer.cs
| 13,778
|
C#
|
// ***********************************************************************
// Copyright (c) 2018 Charlie Poole
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ***********************************************************************
using System;
using NUnit.Engine;
namespace TestCentric.Gui.Model.Settings
{
public class RecentProjectsSettings : SettingsGroup
{
public RecentProjectsSettings(ISettings settings)
: base(settings, "Gui.RecentProjects") { }
public int MaxFiles
{
get { return GetSetting(nameof(MaxFiles), 24); }
set { SaveSetting(nameof(MaxFiles), value); }
}
public bool CheckFilesExist
{
get { return GetSetting(nameof(CheckFilesExist), true); }
set { SaveSetting(nameof(CheckFilesExist), value); }
}
}
}
| 40.148936
| 75
| 0.651298
|
[
"MIT"
] |
drSte/testcentric-gui
|
src/TestModel/model/Settings/RecentProjectsSettings.cs
| 1,889
|
C#
|
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using Draco.Core.Hosting.Interfaces;
using Draco.Core.Models.Interfaces;
using Draco.Execution.Api.Interfaces;
using Draco.Execution.Api.Services;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
namespace Draco.Execution.Api.Modules
{
/// <summary>
/// This service module wires up all the core execution API-specific dependencies.
/// </summary>
public class CoreExecutionApiModule : IServiceModule
{
public void ConfigureServices(IServiceCollection services, IConfiguration configuration)
{
services.AddTransient<IExecutionRequestContextBuilder, ExecutionRequestContextBuilder>();
services.AddTransient<IExtensionObjectApiModelService, ExtensionObjectApiModelService>();
services.AddTransient<IExtensionRsaKeyProvider, TestExtensionRsaKeyProvider>();
}
}
}
| 37
| 101
| 0.760915
|
[
"MIT"
] |
timmyreilly/draco
|
src/draco/api/Execution.Api/Modules/CoreExecutionApiModule.cs
| 962
|
C#
|
/* Copyright (C) 2015 haha01haha01
* 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 http://mozilla.org/MPL/2.0/. */
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using System.IO;
using MapleLib.WzLib;
using MapleLib.WzLib.WzProperties;
using MapleLib.WzLib.Serialization;
using System.Threading;
using HaRepacker.GUI.Interaction;
using MapleLib.WzLib.Util;
using System.Net;
using System.Text;
using System.Diagnostics;
using System.IO.Pipes;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Threading;
using HaRepacker.GUI.Panels;
using HaRepacker.GUI.Input;
using System.Reflection;
using HaRepacker.GUI.Panels.SubPanels;
using MapleLib.PacketLib;
using System.Timers;
using static MapleLib.Configuration.UserSettings;
using HaSharedLibrary;
using MapleLib.MapleCryptoLib;
namespace HaRepacker.GUI
{
public partial class MainForm : Form
{
private bool mainFormLoaded = false;
private MainPanel MainPanel = null;
public MainForm(string wzToLoad, bool usingPipes, bool firstrun)
{
InitializeComponent();
AddTabsInternal("Default");
// Events
#if DEBUG
debugToolStripMenuItem.Visible = true;
#endif
// Sets theme color
SetThemeColor();
// encryptions
AddWzEncryptionTypesToComboBox(encryptionBox);
// Set encryption box
SetWzEncryptionBoxSelectionByWzMapleVersion(Program.ConfigurationManager.ApplicationSettings.MapleVersion);
WindowState = Program.ConfigurationManager.ApplicationSettings.WindowMaximized ? FormWindowState.Maximized : FormWindowState.Normal;
Size = new Size(
Program.ConfigurationManager.ApplicationSettings.Width,
Program.ConfigurationManager.ApplicationSettings.Height);
// Set default selected main panel
UpdateSelectedMainPanelTab();
if (usingPipes)
{
try
{
Program.pipe = new NamedPipeServerStream(Program.pipeName, PipeDirection.In);
Program.pipeThread = new Thread(new ThreadStart(PipeServer));
Program.pipeThread.IsBackground = true;
Program.pipeThread.Start();
}
catch (IOException)
{
if (wzToLoad != null)
{
try
{
using (NamedPipeClientStream clientPipe = new NamedPipeClientStream(".", Program.pipeName, PipeDirection.Out))
{
clientPipe.Connect(0);
using (StreamWriter sw = new StreamWriter(clientPipe))
{
sw.WriteLine(wzToLoad);
}
clientPipe.WaitForPipeDrain();
}
Environment.Exit(0);
}
catch (TimeoutException)
{
}
}
}
}
if (wzToLoad != null && File.Exists(wzToLoad))
{
short version;
WzMapleVersion encVersion = WzTool.DetectMapleVersion(wzToLoad, out version);
SetWzEncryptionBoxSelectionByWzMapleVersion(encVersion);
LoadWzFileThreadSafe(wzToLoad, MainPanel, false);
}
ContextMenuManager manager = new ContextMenuManager(MainPanel, MainPanel.UndoRedoMan);
WzNode.ContextMenuBuilder = new WzNode.ContextMenuBuilderDelegate(manager.CreateMenu);
// Focus on the tab control
tabControl_MainPanels.Focus();
// flag. loaded
mainFormLoaded = true;
}
public void Interop_AddLoadedWzFileToManager(WzFile f)
{
Program.WzFileManager.InsertWzFileUnsafe(f, MainPanel);
}
#region Theme colors
public void SetThemeColor()
{
if (Program.ConfigurationManager.UserSettings.ThemeColor == (int) UserSettingsThemeColor.Dark)//black
{
this.BackColor = Color.Black;
mainMenu.BackColor = Color.Black;
mainMenu.ForeColor = Color.White;
/*for (int i = 0; i < mainMenu.Items.Count; i++)
{
try
{
foreach (ToolStripMenuItem item in ((ToolStripMenuItem)mainMenu.Items[i]).DropDownItems)
{
item.BackColor = Color.Black;
item.ForeColor = Color.White;
MessageBox.Show(item.Name);
}
}
catch (Exception)
{
continue;
//throw;
}
}*/
button_addTab.ForeColor = Color.White;
button_addTab.BackColor = Color.Black;
}
else
{
this.BackColor = DefaultBackColor;
mainMenu.BackColor = DefaultBackColor;
mainMenu.ForeColor = Color.Black;
button_addTab.ForeColor = Color.Black;
button_addTab.BackColor = Color.White;
}
}
#endregion
#region Wz Encryption selection combobox
/// <summary>
/// Adds the WZ encryption types to ToolstripComboBox.
/// Shared code between WzMapleVersionInputBox.cs
/// </summary>
/// <param name="encryptionBox"></param>
public static void AddWzEncryptionTypesToComboBox(object encryptionBox)
{
string[] resources = {
HaRepacker.Properties.Resources.EncTypeGMS,
HaRepacker.Properties.Resources.EncTypeMSEA,
HaRepacker.Properties.Resources.EncTypeNone,
HaRepacker.Properties.Resources.EncTypeCustom,
HaRepacker.Properties.Resources.EncTypeGenerate,
};
bool isToolStripComboBox = encryptionBox is ToolStripComboBox;
int i = 0;
foreach (string res in resources)
{
if (isToolStripComboBox)
((ToolStripComboBox)encryptionBox).Items.Add(res); // in mainform
else
{
if (i != 4) // dont show bruteforce option in SaveForm
{
((ComboBox)encryptionBox).Items.Add(res); // in saveForm
}
}
i++;
}
}
/// <summary>
/// On encryption box selection changed
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void EncryptionBox_SelectedIndexChanged(object sender, EventArgs e)
{
if (!mainFormLoaded) // first run during app startup
{
return;
}
int selectedIndex = encryptionBox.SelectedIndex;
WzMapleVersion wzMapleVer = GetWzMapleVersionByWzEncryptionBoxSelection(selectedIndex);
Program.ConfigurationManager.ApplicationSettings.MapleVersion = wzMapleVer;
if (wzMapleVer == WzMapleVersion.CUSTOM)
{
CustomWZEncryptionInputBox customWzInputBox = new CustomWZEncryptionInputBox();
customWzInputBox.ShowDialog();
} else
{
MapleCryptoConstants.UserKey_WzLib = MapleCryptoConstants.MAPLESTORY_USERKEY_DEFAULT.ToArray();
}
}
/// <summary>
/// Gets the WzMapleVersion enum by encryptionBox selection index
/// </summary>
/// <param name="selectedIndex"></param>
/// <returns></returns>
public static WzMapleVersion GetWzMapleVersionByWzEncryptionBoxSelection(int selectedIndex)
{
WzMapleVersion wzMapleVer;
switch (selectedIndex)
{
case 0:
wzMapleVer = WzMapleVersion.GMS;
break;
case 1:
wzMapleVer = WzMapleVersion.EMS;
break;
case 2:
wzMapleVer = WzMapleVersion.BMS;
break;
case 3:
wzMapleVer = WzMapleVersion.CUSTOM;
break;
case 4:
wzMapleVer = WzMapleVersion.GENERATE;
break;
default: // hmm?
wzMapleVer = WzMapleVersion.BMS; // just default anyway to modern maplestory
break;
}
return wzMapleVer;
}
/// <summary>
/// Gets the Combobox selection index by WzMapleVersion
/// </summary>
/// <param name="versionSelected"></param>
/// <param name="fromNewForm">Called from NewForm.cs</param>
/// <returns></returns>
public static int GetIndexByWzMapleVersion(WzMapleVersion versionSelected, bool fromNewForm = false)
{
int setIndex = 0;
switch (versionSelected)
{
case WzMapleVersion.GMS:
setIndex = 0;
break;
case WzMapleVersion.EMS:
setIndex = 1;
break;
case WzMapleVersion.BMS:
setIndex = 2;
break;
case WzMapleVersion.CUSTOM:
setIndex = 3;
break;
case WzMapleVersion.GENERATE:
if (fromNewForm) // dont return GENERATE, as that option is unavailable when creating a new WZ via NewForm.
setIndex = 2; // BMS
else
setIndex = 4;
break;
}
return setIndex;
}
/// <summary>
/// Sets the ComboBox selection index by WzMapleVersion enum
/// on program init.
/// </summary>
/// <param name="versionSelected"></param>
private void SetWzEncryptionBoxSelectionByWzMapleVersion(WzMapleVersion versionSelected)
{
encryptionBox.SelectedIndex = GetIndexByWzMapleVersion(versionSelected);
if (versionSelected == WzMapleVersion.CUSTOM)
{
Program.ConfigurationManager.SetCustomWzUserKeyFromConfig();
}
}
#endregion
private delegate void LoadWzFileDelegate(string path, MainPanel panel, bool detectMapleVersion);
private void LoadWzFileCallback(string path, MainPanel panel, bool detectMapleVersion)
{
try
{
WzFile loadedWzFile;
if (detectMapleVersion)
loadedWzFile = Program.WzFileManager.LoadWzFile(path);
else
loadedWzFile = Program.WzFileManager.LoadWzFile(path, (WzMapleVersion) GetWzMapleVersionByWzEncryptionBoxSelection(encryptionBox.SelectedIndex));
if (loadedWzFile != null)
Program.WzFileManager.AddLoadedWzFileToMainPanel(loadedWzFile, panel);
}
catch
{
Warning.Error(string.Format(HaRepacker.Properties.Resources.MainCouldntOpenWZ, path));
}
}
private void LoadWzFileThreadSafe(string path, MainPanel panel, bool detectMapleVersion)
{
/* if (panel.InvokeRequired)
panel.Invoke(new LoadWzFileDelegate(LoadWzFileCallback), path, panel, detectMapleVersion);
else
LoadWzFileCallback(path, panel, detectMapleVersion);*/
panel.Dispatcher.Invoke(() =>
{
LoadWzFileCallback(path, panel, detectMapleVersion);
});
}
private delegate void SetWindowStateDelegate(FormWindowState state);
private void SetWindowStateCallback(FormWindowState state)
{
WindowState = state;
user32.SetWindowPos(Handle, user32.HWND_TOPMOST, 0, 0, 0, 0, user32.SWP_NOMOVE | user32.SWP_NOSIZE);
user32.SetWindowPos(Handle, user32.HWND_NOTOPMOST, 0, 0, 0, 0, user32.SWP_NOMOVE | user32.SWP_NOSIZE);
}
private void SetWindowStateThreadSafe(FormWindowState state)
{
if (InvokeRequired)
Invoke(new SetWindowStateDelegate(SetWindowStateCallback), state);
else
SetWindowStateCallback(state);
}
private string OnPipeRequest(string request)
{
if (File.Exists(request)) LoadWzFileThreadSafe(request, MainPanel, true);
SetWindowStateThreadSafe(FormWindowState.Normal);
return "OK";
}
private void PipeServer()
{
try
{
while (true)
{
Program.pipe.WaitForConnection();
StreamReader sr = new StreamReader(Program.pipe);
OnPipeRequest(sr.ReadLine());
Program.pipe.Disconnect();
}
}
catch { }
}
#region Handlers
private void MainForm_Load(object sender, EventArgs e)
{
}
/// <summary>
/// Redocks the list of controls on the panel
/// </summary>
private void RedockControls()
{
/* int mainControlHeight = this.Size.Height;
int mainControlWidth = this.Size.Width;
foreach (TabPage page in tabControl_MainPanels.TabPages)
{
page.Size = new Size(mainControlWidth, mainControlHeight);
}*/
}
private void MainForm_SizeChanged(object sender, EventArgs e)
{
if (!mainFormLoaded)
return;
if (this.Size.Width * this.Size.Height != 0)
{
RedockControls();
Program.ConfigurationManager.ApplicationSettings.Height = this.Size.Height;
Program.ConfigurationManager.ApplicationSettings.Width = this.Size.Width;
Program.ConfigurationManager.ApplicationSettings.WindowMaximized = WindowState == FormWindowState.Maximized;
}
}
/// <summary>
/// When the selected tab in the MainForm change
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void tabControl_MainPanels_TabIndexChanged(object sender, EventArgs e)
{
UpdateSelectedMainPanelTab();
}
/// <summary>
/// On key up event for hotkeys
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void tabControl_MainPanels_KeyUp(object sender, KeyEventArgs e)
{
byte countTabs = Convert.ToByte(tabControl_MainPanels.TabCount);
if (e.Control)
{
switch (e.KeyCode)
{
case Keys.T: // Open new tab
AddTabsInternal();
break;
case Keys.O: // Open new WZ file
openToolStripMenuItem_Click(null, null);
break;
case Keys.N: // New
newToolStripMenuItem_Click(null, null);
break;
case Keys.A:
MainPanel.StartAnimateSelectedCanvas();
break;
case Keys.P:
break;
// Switch between tabs
case Keys.NumPad1:
tabControl_MainPanels.SelectTab(0);
break;
case Keys.NumPad2:
if (countTabs < 2) return;
tabControl_MainPanels.SelectTab(1);
break;
case Keys.NumPad3:
if (countTabs < 3) return;
tabControl_MainPanels.SelectTab(2);
break;
case Keys.NumPad4:
if (countTabs < 4) return;
tabControl_MainPanels.SelectTab(3);
break;
case Keys.NumPad5:
if (countTabs < 5) return;
tabControl_MainPanels.SelectTab(4);
break;
case Keys.NumPad6:
if (countTabs < 6) return;
tabControl_MainPanels.SelectTab(5);
break;
case Keys.NumPad7:
if (countTabs < 7) return;
tabControl_MainPanels.SelectTab(6);
break;
case Keys.NumPad8:
if (countTabs < 8) return;
tabControl_MainPanels.SelectTab(7);
break;
case Keys.NumPad9:
if (countTabs < 9) return;
tabControl_MainPanels.SelectTab(8);
break;
case Keys.NumPad0:
if (countTabs < 10) return;
tabControl_MainPanels.SelectTab(9);
break;
}
}
}
private void UpdateSelectedMainPanelTab()
{
TabPage selectedTab = tabControl_MainPanels.SelectedTab;
if (selectedTab != null && selectedTab.Controls.Count > 0)
{
System.Windows.Forms.Integration.ElementHost elemntHost = (System.Windows.Forms.Integration.ElementHost)selectedTab.Controls[0];
MainPanel = (MainPanel)elemntHost?.Child;
}
}
/// <summary>
/// Add a new tab to the TabControl
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_addTab_Click(object sender, EventArgs e)
{
AddTabsInternal();
}
/// <summary>
/// Prompts a window to add a new tab
/// </summary>
private void AddTabsInternal(string defaultName = null)
{
if (tabControl_MainPanels.TabCount > 10)
{
return;
}
TabPage tabPage = new TabPage()
{
Margin = new Padding(1, 1, 1, 1)
};
System.Windows.Forms.Integration.ElementHost elemHost = new System.Windows.Forms.Integration.ElementHost
{
Dock = DockStyle.Fill,
Child = new MainPanel()
};
tabPage.Controls.Add(elemHost);
string tabName = null;
if (defaultName == null)
{
if (!NameInputBox.Show(Properties.Resources.MainAddTabTitle, 25, out tabName))
{
return;
}
defaultName = tabName;
} else
{
MainPanel = (MainPanel)elemHost.Child;
}
tabPage.Text = defaultName;
tabControl_MainPanels.TabPages.Add(tabPage);
// Focus on that tab control
tabControl_MainPanels.Focus();
}
#endregion
#region WZ IV Key bruteforcing
private ulong wzKeyBruteforceTries = 0;
private DateTime wzKeyBruteforceStartTime = DateTime.Now;
private bool wzKeyBruteforceCompleted = false;
private System.Timers.Timer aTimer_wzKeyBruteforce = null;
/// <summary>
/// Find needles in a haystack o_O
/// </summary>
/// <param name="currentDispatcher"></param>
private void StartWzKeyBruteforcing(Dispatcher currentDispatcher)
{
// Generate WZ keys via a test WZ file
using (OpenFileDialog dialog = new OpenFileDialog()
{
Title = HaRepacker.Properties.Resources.SelectWz,
Filter = string.Format("{0}|TamingMob.wz", HaRepacker.Properties.Resources.WzFilter), // Use the smallest possible file
Multiselect = false
})
{
if (dialog.ShowDialog() != DialogResult.OK)
return;
// Show splash screen
MainPanel.OnSetPanelLoading(currentDispatcher);
MainPanel.loadingPanel.SetWzIvBruteforceStackpanelVisiblity(System.Windows.Visibility.Visible);
// Reset variables
wzKeyBruteforceTries = 0;
wzKeyBruteforceStartTime = DateTime.Now;
wzKeyBruteforceCompleted = false;
int processorCount = Environment.ProcessorCount * 3; // 8 core = 16 (with ht, smt) , multiply by 3 seems to be the magic number. it falls off after 4
List<int> cpuIds = new List<int>();
for (int cpuId_ = 0; cpuId_ < processorCount; cpuId_++)
{
cpuIds.Add(cpuId_);
}
// UI update thread
if (aTimer_wzKeyBruteforce != null)
{
aTimer_wzKeyBruteforce.Stop();
aTimer_wzKeyBruteforce = null;
}
aTimer_wzKeyBruteforce = new System.Timers.Timer();
aTimer_wzKeyBruteforce.Elapsed += new ElapsedEventHandler(OnWzIVKeyUIUpdateEvent);
aTimer_wzKeyBruteforce.Interval = 5000;
aTimer_wzKeyBruteforce.Enabled = true;
// Key finder thread
Task.Run(() =>
{
Thread.Sleep(3000); // delay 3 seconds before starting
var parallelOption = new ParallelOptions
{
MaxDegreeOfParallelism = processorCount,
};
ParallelLoopResult loop = Parallel.ForEach(cpuIds, parallelOption, cpuId =>
{
WzKeyBruteforceComputeTask(cpuId, processorCount, dialog, currentDispatcher);
});
});
}
}
/// <summary>
/// UI Updating thread
/// </summary>
/// <param name="source"></param>
/// <param name="e"></param>
private void OnWzIVKeyUIUpdateEvent(object source, ElapsedEventArgs e)
{
if (aTimer_wzKeyBruteforce == null)
return;
if (wzKeyBruteforceCompleted)
{
aTimer_wzKeyBruteforce.Stop();
aTimer_wzKeyBruteforce = null;
MainPanel.loadingPanel.SetWzIvBruteforceStackpanelVisiblity(System.Windows.Visibility.Collapsed);
}
MainPanel.loadingPanel.WzIvKeyDuration = DateTime.Now.Ticks - wzKeyBruteforceStartTime.Ticks;
MainPanel.loadingPanel.WzIvKeyTries = wzKeyBruteforceTries;
}
/// <summary>
/// Internal compute task for figuring out the WzKey automaticagically
/// </summary>
/// <param name="cpuId_"></param>
/// <param name="processorCount"></param>
/// <param name="dialog"></param>
/// <param name="currentDispatcher"></param>
private void WzKeyBruteforceComputeTask(int cpuId_, int processorCount, OpenFileDialog dialog, Dispatcher currentDispatcher)
{
int cpuId = cpuId_;
// try bruteforce keys
const long startValue = int.MinValue;
const long endValue = int.MaxValue;
long lookupRangePerCPU = (endValue - startValue) / processorCount;
Debug.WriteLine("CPUID {0}. Looking up from {1} to {2}. [Range = {3}] TEST: {4} {5}",
cpuId,
(startValue + (lookupRangePerCPU * cpuId)),
(startValue + (lookupRangePerCPU * (cpuId + 1))),
lookupRangePerCPU,
(lookupRangePerCPU * cpuId), (lookupRangePerCPU * (cpuId + 1)));
for (long i = (startValue + (lookupRangePerCPU * cpuId)); i < (startValue + (lookupRangePerCPU * (cpuId + 1))); i++) // 2 bill key pairs? o_O
{
if (wzKeyBruteforceCompleted)
break;
byte[] bytes = new byte[4];
unsafe
{
fixed (byte* pbytes = &bytes[0])
{
*(int*)pbytes = (int) i;
}
}
bool tryDecrypt = WzTool.TryBruteforcingWzIVKey(dialog.FileName, bytes);
//Debug.WriteLine("{0} = {1}", cpuId, HexTool.ToString(new PacketWriter(bytes).ToArray()));
if (tryDecrypt)
{
wzKeyBruteforceCompleted = true;
// Hide panel splash sdcreen
Action action = () =>
{
MainPanel.OnSetPanelLoadingCompleted(currentDispatcher);
MainPanel.loadingPanel.SetWzIvBruteforceStackpanelVisiblity(System.Windows.Visibility.Collapsed);
};
currentDispatcher.BeginInvoke(action);
PacketWriter writer = new PacketWriter(4);
writer.WriteBytes(bytes);
MessageBox.Show("Found the encryption key to the WZ file:\r\n" + HexTool.ToString(writer.ToArray()), "Success");
Debug.WriteLine("Found key. Key = " + HexTool.ToString(writer.ToArray()));
break;
}
wzKeyBruteforceTries++;
}
}
#endregion
#region Toolstrip Menu items
/// <summary>
/// Open file
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private async void openToolStripMenuItem_Click(object sender, EventArgs e)
{
Dispatcher currentDispatcher = Dispatcher.CurrentDispatcher;
WzMapleVersion MapleVersionEncryptionSelected = GetWzMapleVersionByWzEncryptionBoxSelection(encryptionBox.SelectedIndex);
if (MapleVersionEncryptionSelected == WzMapleVersion.GENERATE)
{
StartWzKeyBruteforcing(currentDispatcher); // find needles in a haystack
return;
}
// Load WZ file
using (OpenFileDialog dialog = new OpenFileDialog()
{
Title = HaRepacker.Properties.Resources.SelectWz,
Filter = string.Format("{0}|*.wz;ZLZ.dll",
HaRepacker.Properties.Resources.WzFilter),
Multiselect = true,
})
{
if (dialog.ShowDialog() != DialogResult.OK)
return;
List<string> wzfilePathsToLoad = new List<string>();
foreach (string filePath in dialog.FileNames)
{
string filePathLowerCase = filePath.ToLower();
if (filePathLowerCase.EndsWith("zlz.dll")) // ZLZ.dll encryption keys
{
AssemblyName executingAssemblyName = Assembly.GetExecutingAssembly().GetName();
//similarly to find process architecture
var assemblyArchitecture = executingAssemblyName.ProcessorArchitecture;
if (assemblyArchitecture == ProcessorArchitecture.X86)
{
ZLZPacketEncryptionKeyForm form = new ZLZPacketEncryptionKeyForm();
bool opened = form.OpenZLZDllFile();
if (opened)
form.Show();
}
else
{
MessageBox.Show(HaRepacker.Properties.Resources.ExecutingAssemblyError, HaRepacker.Properties.Resources.Warning, MessageBoxButtons.OK);
}
return;
}
// Other WZs
else if (filePathLowerCase.EndsWith("data.wz") && WzTool.IsDataWzHotfixFile(filePath))
{
WzImage img = Program.WzFileManager.LoadDataWzHotfixFile(filePath, MapleVersionEncryptionSelected, MainPanel);
if (img == null)
{
MessageBox.Show(HaRepacker.Properties.Resources.MainFileOpenFail, HaRepacker.Properties.Resources.Error);
break;
}
}
else if (WzTool.IsListFile(filePath))
{
new ListEditor(filePath, MapleVersionEncryptionSelected).Show();
}
else
{
wzfilePathsToLoad.Add(filePath); // add to list, so we can load it concurrently
// Check if there are any related files
string[] wzsWithRelatedFiles = { "Map", "Mob", "Skill", "Sound" };
bool bWithRelated = false;
string relatedFileName = null;
foreach (string wz in wzsWithRelatedFiles)
{
if (filePathLowerCase.EndsWith(wz.ToLower() + ".wz"))
{
bWithRelated = true;
relatedFileName = wz;
break;
}
}
if (bWithRelated)
{
if (Program.ConfigurationManager.UserSettings.AutoloadRelatedWzFiles)
{
string[] otherMapWzFiles = Directory.GetFiles(filePath.Substring(0, filePath.LastIndexOf("\\")), relatedFileName + "*.wz");
foreach (string filePath_Others in otherMapWzFiles)
{
if (filePath_Others != filePath)
wzfilePathsToLoad.Add(filePath_Others);
}
}
}
}
}
// Show splash screen
MainPanel.OnSetPanelLoading();
// Try opening one, to see if the user is having the right priviledge
// Load all original WZ files
await Task.Run(() =>
{
List<WzFile> loadedWzFiles = new List<WzFile>();
ParallelLoopResult loop = Parallel.ForEach(wzfilePathsToLoad, filePath =>
{
WzFile f = Program.WzFileManager.LoadWzFile(filePath, MapleVersionEncryptionSelected);
if (f == null)
{
// error should be thrown
}
else
{
lock (loadedWzFiles)
{
loadedWzFiles.Add(f);
}
}
});
while (!loop.IsCompleted)
{
Thread.Sleep(100); //?
}
foreach (WzFile wzFile in loadedWzFiles) // add later, once everything is loaded to memory
{
Program.WzFileManager.AddLoadedWzFileToMainPanel(wzFile, MainPanel, currentDispatcher);
}
}); // load complete
// Hide panel splash sdcreen
MainPanel.OnSetPanelLoadingCompleted();
}
}
private void unloadAllToolStripMenuItem_Click(object sender, EventArgs e)
{
if (Warning.Warn(HaRepacker.Properties.Resources.MainUnloadAll))
Program.WzFileManager.UnloadAll();
}
private void reloadAllToolStripMenuItem_Click(object sender, EventArgs e)
{
if (Warning.Warn(HaRepacker.Properties.Resources.MainReloadAll))
Program.WzFileManager.ReloadAll(MainPanel);
}
/// <summary>
/// Field/ map rendering
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void renderMapToolStripMenuItem_Click(object sender, EventArgs e)
{
if (MainPanel.DataTree.SelectedNode == null)
return;
if (MainPanel.DataTree.SelectedNode.Tag is WzImage)
{
double zoomLevel = double.Parse(zoomTextBox.TextBox.Text);
WzImage img = (WzImage)MainPanel.DataTree.SelectedNode.Tag;
string mapName = img.Name.Substring(0, img.Name.Length - 4);
if (!Directory.Exists("Renders\\" + mapName))
{
Directory.CreateDirectory("Renders\\" + mapName);
}
try
{
List<string> renderErrorList = new List<string>();
FHMapper.FHMapper mapper = new FHMapper.FHMapper(MainPanel);
mapper.ParseSettings();
bool rendered = mapper.TryRenderMapAndSave(img, zoomLevel, ref renderErrorList);
if (!rendered)
{
StringBuilder sb = new StringBuilder();
int i = 1;
foreach (string error in renderErrorList)
{
sb.Append("[").Append(i).Append("] ").Append(error);
sb.AppendLine();
i++;
}
MessageBox.Show(sb.ToString(), "Error rendering map");
}
}
catch (ArgumentException argExp)
{
MessageBox.Show(argExp.Message, "Error rendering map");
}
}
}
private void settingsToolStripMenuItem_Click(object sender, EventArgs e)
{
FHMapper.FHMapper mapper = new FHMapper.FHMapper(MainPanel);
mapper.ParseSettings();
Settings settingsDialog = new Settings();
settingsDialog.settings = mapper.settings;
settingsDialog.main = mapper;
settingsDialog.ShowDialog();
}
private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
{
new AboutForm().ShowDialog();
}
private void optionsToolStripMenuItem_Click(object sender, EventArgs e)
{
new OptionsForm(MainPanel).ShowDialog();
}
/// <summary>
/// New WZ
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void newToolStripMenuItem_Click(object sender, EventArgs e)
{
new NewForm(MainPanel).ShowDialog();
}
/// <summary>
/// Save tool strip menu button clicked
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void SaveToolStripMenuItem_Click(object sender, EventArgs e)
{
WzNode node;
if (MainPanel.DataTree.SelectedNode == null)
{
if (MainPanel.DataTree.Nodes.Count == 1)
node = (WzNode)MainPanel.DataTree.Nodes[0];
else
{
MessageBox.Show(HaRepacker.Properties.Resources.MainSelectWzFolder, HaRepacker.Properties.Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}
else
{
if (MainPanel.DataTree.SelectedNode.Tag is WzFile)
node = (WzNode)MainPanel.DataTree.SelectedNode;
else
node = ((WzNode)MainPanel.DataTree.SelectedNode).TopLevelNode;
}
// Save to file.
if (node.Tag is WzFile || node.Tag is WzImage)
{
new SaveForm(MainPanel, node).ShowDialog();
}
}
/// <summary>
/// On closing
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
{
Program.ConfigurationManager.ApplicationSettings.WindowMaximized = WindowState == FormWindowState.Maximized;
e.Cancel = !Warning.Warn(HaRepacker.Properties.Resources.MainConfirmExit);
// Save app settings quickly
if (!e.Cancel)
{
Program.ConfigurationManager.Save();
}
}
private void RemoveToolStripMenuItem_Click(object sender, EventArgs e)
{
RemoveSelectedNodes();
}
private void RemoveSelectedNodes()
{
if (!Warning.Warn(HaRepacker.Properties.Resources.MainConfirmRemoveNode))
{
return;
}
MainPanel.PromptRemoveSelectedTreeNodes();
}
private void RunWzFilesExtraction(object param)
{
ChangeApplicationState(false);
string[] wzFilesToDump = (string[])((object[])param)[0];
string baseDir = (string)((object[])param)[1];
WzMapleVersion version = GetWzMapleVersionByWzEncryptionBoxSelection( ((int[])param)[2]);
IWzFileSerializer serializer = (IWzFileSerializer)((object[])param)[3];
UpdateProgressBar(MainPanel.mainProgressBar, 0, false, true);
UpdateProgressBar(MainPanel.mainProgressBar, wzFilesToDump.Length, true, true);
if (!Directory.Exists(baseDir))
{
Directory.CreateDirectory(baseDir);
}
foreach (string wzpath in wzFilesToDump)
{
if (WzTool.IsListFile(wzpath))
{
Warning.Error(string.Format(HaRepacker.Properties.Resources.MainListWzDetected, wzpath));
continue;
}
WzFile f = new WzFile(wzpath, version);
WzFileParseStatus parseStatus = f.ParseWzFile();
serializer.SerializeFile(f, Path.Combine(baseDir, f.Name));
f.Dispose();
UpdateProgressBar(MainPanel.mainProgressBar, 1, false, false);
}
MapleLib.Helpers.ErrorLogger.SaveToFile("WzExtract_Errors.txt");
threadDone = true;
}
private void RunWzImgDirsExtraction(object param)
{
ChangeApplicationState(false);
List<WzDirectory> dirsToDump = (List<WzDirectory>)((object[])param)[0];
List<WzImage> imgsToDump = (List<WzImage>)((object[])param)[1];
string baseDir = (string)((object[])param)[2];
IWzImageSerializer serializer = (IWzImageSerializer)((object[])param)[3];
UpdateProgressBar(MainPanel.mainProgressBar, 0, false, true);
UpdateProgressBar(MainPanel.mainProgressBar, dirsToDump.Count + imgsToDump.Count, true, true);
if (!Directory.Exists(baseDir))
{
Directory.CreateDirectory(baseDir);
}
foreach (WzImage img in imgsToDump)
{
string escapedPath = Path.Combine(baseDir, ProgressingWzSerializer.EscapeInvalidFilePathNames(img.Name));
serializer.SerializeImage(img, escapedPath);
UpdateProgressBar(MainPanel.mainProgressBar, 1, false, false);
}
foreach (WzDirectory dir in dirsToDump)
{
string escapedPath = Path.Combine(baseDir, ProgressingWzSerializer.EscapeInvalidFilePathNames(dir.Name));
serializer.SerializeDirectory(dir, escapedPath);
UpdateProgressBar(MainPanel.mainProgressBar, 1, false, false);
}
MapleLib.Helpers.ErrorLogger.SaveToFile("WzExtract_Errors.txt");
threadDone = true;
}
private void RunWzObjExtraction(object param)
{
ChangeApplicationState(false);
#if DEBUG
var watch = new System.Diagnostics.Stopwatch();
watch.Start();
#endif
List<WzObject> objsToDump = (List<WzObject>)((object[])param)[0];
string path = (string)((object[])param)[1];
ProgressingWzSerializer serializer = (ProgressingWzSerializer)((object[])param)[2];
UpdateProgressBar(MainPanel.mainProgressBar, 0, false, true);
if (serializer is IWzObjectSerializer)
{
UpdateProgressBar(MainPanel.mainProgressBar, objsToDump.Count, true, true);
foreach (WzObject obj in objsToDump)
{
((IWzObjectSerializer)serializer).SerializeObject(obj, path);
UpdateProgressBar(MainPanel.mainProgressBar, 1, false, false);
}
}
else if (serializer is WzNewXmlSerializer)
{
UpdateProgressBar(MainPanel.mainProgressBar, 1, true, true);
((WzNewXmlSerializer)serializer).ExportCombinedXml(objsToDump, path);
UpdateProgressBar(MainPanel.mainProgressBar, 1, false, false);
}
MapleLib.Helpers.ErrorLogger.SaveToFile("WzExtract_Errors.txt");
#if DEBUG
// test benchmark
watch.Stop();
Debug.WriteLine($"WZ files Extracted. Execution Time: {watch.ElapsedMilliseconds} ms");
#endif
threadDone = true;
}
//yes I know this is a stupid way to synchronize threads, I'm just too lazy to use events or locks
private bool threadDone = false;
private Thread runningThread = null;
private delegate void ChangeAppStateDelegate(bool enabled);
private void ChangeApplicationStateCallback(bool enabled)
{
mainMenu.Enabled = enabled;
MainPanel.IsEnabled = enabled;
button_addTab.Enabled = enabled;
tabControl_MainPanels.Enabled = enabled;
AbortButton.Visible = !enabled;
}
private void ChangeApplicationState(bool enabled)
{
Invoke(new ChangeAppStateDelegate(ChangeApplicationStateCallback), new object[] { enabled });
}
private void xMLToolStripMenuItem_Click(object sender, EventArgs e)
{
OpenFileDialog dialog = new OpenFileDialog()
{
Title = HaRepacker.Properties.Resources.SelectWz,
Filter = string.Format("{0}|*.wz", HaRepacker.Properties.Resources.WzFilter),
Multiselect = true
};
if (dialog.ShowDialog() != DialogResult.OK)
return;
FolderBrowserDialog folderDialog = new FolderBrowserDialog()
{
Description = HaRepacker.Properties.Resources.SelectOutDir
};
if (folderDialog.ShowDialog() != DialogResult.OK)
return;
WzClassicXmlSerializer serializer = new WzClassicXmlSerializer(
Program.ConfigurationManager.UserSettings.Indentation,
Program.ConfigurationManager.UserSettings.LineBreakType, false);
threadDone = false;
new Thread(new ParameterizedThreadStart(RunWzFilesExtraction)).Start((object)new object[] { dialog.FileNames, folderDialog.SelectedPath, encryptionBox.SelectedIndex, serializer });
new Thread(new ParameterizedThreadStart(ProgressBarThread)).Start(serializer);
}
private delegate void UpdateProgressBarDelegate(ToolStripProgressBar pbar, int value, bool max, bool absolute); //max for .Maximum, !max for .Value
private void UpdateProgressBarCallback(System.Windows.Controls.ProgressBar pbar, int value, bool max, bool absolute)
{
if (max)
{
if (absolute)
pbar.Maximum = value;
else pbar.Maximum += value;
}
else
{
if (absolute)
pbar.Value = value;
else pbar.Value += value;
}
}
private void UpdateProgressBar(System.Windows.Controls.ProgressBar pbar, int value, bool max, bool absolute)
{
pbar.Dispatcher.Invoke(() =>
{
UpdateProgressBarCallback(pbar, value, max, absolute);
});
/* if (pbar.ProgressBar.InvokeRequired)
pbar.ProgressBar.Invoke(new UpdateProgressBarDelegate(UpdateProgressBarCallback), new object[] { pbar, value, max, absolute });
else UpdateProgressBarCallback(pbar, value, max, absolute);*/
}
private void ProgressBarThread(object param)
{
ProgressingWzSerializer serializer = (ProgressingWzSerializer)param;
while (!threadDone)
{
int total = serializer.Total;
UpdateProgressBar(MainPanel.secondaryProgressBar, total, true, true);
UpdateProgressBar(MainPanel.secondaryProgressBar, Math.Min(total, serializer.Current), false, true);
Thread.Sleep(500);
}
UpdateProgressBar(MainPanel.mainProgressBar, 0, true, true);
UpdateProgressBar(MainPanel.secondaryProgressBar, 0, false, true);
ChangeApplicationState(true);
threadDone = false;
}
private string GetOutputDirectory()
{
return Program.ConfigurationManager.UserSettings.DefaultXmlFolder == "" ?
SavedFolderBrowser.Show(HaRepacker.Properties.Resources.SelectOutDir)
: Program.ConfigurationManager.UserSettings.DefaultXmlFolder;
}
private void rawDataToolStripMenuItem_Click(object sender, EventArgs e)
{
OpenFileDialog dialog = new OpenFileDialog() { Title = HaRepacker.Properties.Resources.SelectWz, Filter = string.Format("{0}|*.wz", HaRepacker.Properties.Resources.WzFilter), Multiselect = true };
if (dialog.ShowDialog() != DialogResult.OK)
return;
string outPath = GetOutputDirectory();
if (outPath == string.Empty)
{
MessageBox.Show(Properties.Resources.MainWzExportError, Properties.Resources.Warning, MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
WzPngMp3Serializer serializer = new WzPngMp3Serializer();
threadDone = false;
runningThread = new Thread(new ParameterizedThreadStart(RunWzFilesExtraction));
runningThread.Start((object)new object[] { dialog.FileNames, outPath, encryptionBox.SelectedIndex, serializer });
new Thread(new ParameterizedThreadStart(ProgressBarThread)).Start(serializer);
}
private void imgToolStripMenuItem_Click(object sender, EventArgs e)
{
OpenFileDialog dialog = new OpenFileDialog()
{
Title = HaRepacker.Properties.Resources.SelectWz,
Filter = string.Format("{0}|*.wz", HaRepacker.Properties.Resources.WzFilter),
Multiselect = true
};
if (dialog.ShowDialog() != DialogResult.OK)
return;
string outPath = GetOutputDirectory();
if (outPath == string.Empty)
{
MessageBox.Show(Properties.Resources.MainWzExportError, Properties.Resources.Warning, MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
WzImgSerializer serializer = new WzImgSerializer();
threadDone = false;
runningThread = new Thread(new ParameterizedThreadStart(RunWzFilesExtraction));
runningThread.Start((object)new object[] { dialog.FileNames, outPath, encryptionBox.SelectedIndex, serializer });
new Thread(new ParameterizedThreadStart(ProgressBarThread)).Start(serializer);
}
/// <summary>
/// Export IMG
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void imgToolStripMenuItem1_Click(object sender, EventArgs e)
{
string outPath = GetOutputDirectory();
if (outPath == string.Empty)
{
MessageBox.Show(Properties.Resources.MainWzExportError, Properties.Resources.Warning, MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
List<WzDirectory> dirs = new List<WzDirectory>();
List<WzImage> imgs = new List<WzImage>();
foreach (WzNode node in MainPanel.DataTree.SelectedNodes)
{
if (node.Tag is WzDirectory)
{
dirs.Add((WzDirectory)node.Tag);
}
else if (node.Tag is WzImage)
{
imgs.Add((WzImage)node.Tag);
}
}
WzImgSerializer serializer = new WzImgSerializer();
threadDone = false;
runningThread = new Thread(new ParameterizedThreadStart(RunWzImgDirsExtraction));
runningThread.Start((object)new object[] { dirs, imgs, outPath, serializer });
new Thread(new ParameterizedThreadStart(ProgressBarThread)).Start(serializer);
}
/// <summary>
/// Export PNG / MP3
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void pNGsToolStripMenuItem_Click(object sender, EventArgs e)
{
string outPath = GetOutputDirectory();
if (outPath == string.Empty)
{
MessageBox.Show(Properties.Resources.MainWzExportError, Properties.Resources.Warning, MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
List<WzObject> objs = new List<WzObject>();
foreach (WzNode node in MainPanel.DataTree.SelectedNodes)
{
if (node.Tag is WzObject)
{
objs.Add((WzObject)node.Tag);
}
}
WzPngMp3Serializer serializer = new WzPngMp3Serializer();
threadDone = false;
runningThread = new Thread(new ParameterizedThreadStart(RunWzObjExtraction));
runningThread.Start((object)new object[] { objs, outPath, serializer });
new Thread(new ParameterizedThreadStart(ProgressBarThread)).Start(serializer);
}
/// <summary>
/// Export as Json
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void jSONToolStripMenuItem_Click(object sender, EventArgs e)
{
ExportBsonJsonInternal(true);
}
/// <summary>
/// Export as BSON
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void bSONToolStripMenuItem_Click(object sender, EventArgs e)
{
ExportBsonJsonInternal(false);
}
/// <summary>
/// Export as Json or Bson
/// </summary>
/// <param name="isJson"></param>
private void ExportBsonJsonInternal(bool isJson)
{
string outPath = GetOutputDirectory();
if (outPath == string.Empty)
{
MessageBox.Show(Properties.Resources.MainWzExportError, Properties.Resources.Warning, MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
DialogResult dlgResult = MessageBox.Show(Properties.Resources.MainWzExportJson_IncludeBase64, Properties.Resources.MainWzExportJson_IncludeBase64_Title, MessageBoxButtons.YesNoCancel);
if (dlgResult == DialogResult.Cancel)
return;
bool bIncludeBase64BinData = dlgResult == DialogResult.Yes;
List<WzDirectory> dirs = new List<WzDirectory>();
List<WzImage> imgs = new List<WzImage>();
foreach (WzNode node in MainPanel.DataTree.SelectedNodes)
{
if (node.Tag is WzDirectory directory)
dirs.Add(directory);
else if (node.Tag is WzImage image)
imgs.Add(image);
else if (node.Tag is WzFile file)
{
dirs.Add(file.WzDirectory);
}
}
WzJsonBsonSerializer serializer = new WzJsonBsonSerializer(Program.ConfigurationManager.UserSettings.Indentation, Program.ConfigurationManager.UserSettings.LineBreakType, bIncludeBase64BinData, isJson);
threadDone = false;
runningThread = new Thread(new ParameterizedThreadStart(RunWzImgDirsExtraction));
runningThread.Start((object)new object[] { dirs, imgs, outPath, serializer });
new Thread(new ParameterizedThreadStart(ProgressBarThread)).Start(serializer);
}
/// <summary>
/// Export to private server toolstrip
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void privateServerToolStripMenuItem_Click(object sender, EventArgs e)
{
string outPath = GetOutputDirectory();
if (outPath == string.Empty)
{
MessageBox.Show(Properties.Resources.MainWzExportError, Properties.Resources.Warning, MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
List<WzDirectory> dirs = new List<WzDirectory>();
List<WzImage> imgs = new List<WzImage>();
foreach (WzNode node in MainPanel.DataTree.SelectedNodes)
{
if (node.Tag is WzDirectory directory)
dirs.Add(directory);
else if (node.Tag is WzImage image)
imgs.Add(image);
else if (node.Tag is WzFile file)
{
dirs.Add(file.WzDirectory);
}
}
WzClassicXmlSerializer serializer = new WzClassicXmlSerializer(
Program.ConfigurationManager.UserSettings.Indentation,
Program.ConfigurationManager.UserSettings.LineBreakType, false);
threadDone = false;
runningThread = new Thread(new ParameterizedThreadStart(RunWzImgDirsExtraction));
runningThread.Start((object)new object[] { dirs, imgs, outPath, serializer });
new Thread(new ParameterizedThreadStart(ProgressBarThread)).Start(serializer);
}
/// <summary>
/// Export as XML, classic
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void classicToolStripMenuItem_Click(object sender, EventArgs e)
{
string outPath = GetOutputDirectory();
if (outPath == string.Empty)
{
MessageBox.Show(Properties.Resources.MainWzExportError, Properties.Resources.Warning, MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
List<WzDirectory> dirs = new List<WzDirectory>();
List<WzImage> imgs = new List<WzImage>();
foreach (WzNode node in MainPanel.DataTree.SelectedNodes)
{
if (node.Tag is WzDirectory)
dirs.Add((WzDirectory)node.Tag);
else if (node.Tag is WzImage)
imgs.Add((WzImage)node.Tag);
else if (node.Tag is WzFile)
{
dirs.Add(((WzFile)node.Tag).WzDirectory);
}
}
WzClassicXmlSerializer serializer = new WzClassicXmlSerializer(
Program.ConfigurationManager.UserSettings.Indentation,
Program.ConfigurationManager.UserSettings.LineBreakType, true);
threadDone = false;
runningThread = new Thread(new ParameterizedThreadStart(RunWzImgDirsExtraction));
runningThread.Start((object)new object[] { dirs, imgs, outPath, serializer });
new Thread(new ParameterizedThreadStart(ProgressBarThread)).Start(serializer);
}
/// <summary>
/// Export as XML, new
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void newToolStripMenuItem1_Click(object sender, EventArgs e)
{
SaveFileDialog dialog = new SaveFileDialog()
{
Title = HaRepacker.Properties.Resources.SelectOutXml,
Filter = string.Format("{0}|*.xml", HaRepacker.Properties.Resources.XmlFilter)
};
if (dialog.ShowDialog() != DialogResult.OK)
return;
List<WzObject> objs = new List<WzObject>();
foreach (WzNode node in MainPanel.DataTree.SelectedNodes)
{
if (node.Tag is WzObject)
objs.Add((WzObject)node.Tag);
}
WzNewXmlSerializer serializer = new WzNewXmlSerializer(
Program.ConfigurationManager.UserSettings.Indentation,
Program.ConfigurationManager.UserSettings.LineBreakType);
threadDone = false;
runningThread = new Thread(new ParameterizedThreadStart(RunWzObjExtraction));
runningThread.Start((object)new object[] { objs, dialog.FileName, serializer });
new Thread(new ParameterizedThreadStart(ProgressBarThread)).Start(serializer);
}
private void expandAllToolStripMenuItem_Click(object sender, EventArgs e)
{
MainPanel.DataTree.BeginUpdate();
MainPanel.DataTree.ExpandAll();
MainPanel.DataTree.EndUpdate();
}
private void collapseAllToolStripMenuItem_Click(object sender, EventArgs e)
{
MainPanel.DataTree.BeginUpdate();
MainPanel.DataTree.CollapseAll();
MainPanel.DataTree.EndUpdate();
}
private void xMLToolStripMenuItem2_Click(object sender, EventArgs e)
{
if (MainPanel.DataTree.SelectedNode == null || (!(MainPanel.DataTree.SelectedNode.Tag is WzDirectory) && !(MainPanel.DataTree.SelectedNode.Tag is WzFile) && !(MainPanel.DataTree.SelectedNode.Tag is IPropertyContainer)))
return;
WzFile wzFile = ((WzObject)MainPanel.DataTree.SelectedNode.Tag).WzFileParent;
if (!(wzFile is WzFile))
return;
OpenFileDialog dialog = new OpenFileDialog()
{
Title = HaRepacker.Properties.Resources.SelectXml,
Filter = string.Format("{0}|*.xml", HaRepacker.Properties.Resources.XmlFilter),
Multiselect = true
};
if (dialog.ShowDialog() != DialogResult.OK)
return;
WzXmlDeserializer deserializer = new WzXmlDeserializer(true, WzTool.GetIvByMapleVersion(wzFile.MapleVersion));
yesToAll = false;
noToAll = false;
threadDone = false;
runningThread = new Thread(new ParameterizedThreadStart(WzImporterThread));
runningThread.Start(new object[]
{
deserializer, dialog.FileNames, MainPanel.DataTree.SelectedNode, null
});
new Thread(new ParameterizedThreadStart(ProgressBarThread)).Start(deserializer);
}
private void iMGToolStripMenuItem2_Click(object sender, EventArgs e)
{
if (MainPanel.DataTree.SelectedNode == null || (!(MainPanel.DataTree.SelectedNode.Tag is WzDirectory) && !(MainPanel.DataTree.SelectedNode.Tag is WzFile) && !(MainPanel.DataTree.SelectedNode.Tag is IPropertyContainer)))
return;
WzFile wzFile = ((WzObject)MainPanel.DataTree.SelectedNode.Tag).WzFileParent;
if (!(wzFile is WzFile))
return;
OpenFileDialog dialog = new OpenFileDialog()
{
Title = HaRepacker.Properties.Resources.SelectWzImg,
Filter = string.Format("{0}|*.img", HaRepacker.Properties.Resources.WzImgFilter),
Multiselect = true
};
if (dialog.ShowDialog() != System.Windows.Forms.DialogResult.OK)
return;
WzMapleVersion wzImageImportVersion = WzMapleVersion.BMS;
bool input = WzMapleVersionInputBox.Show(HaRepacker.Properties.Resources.InteractionWzMapleVersionTitle, out wzImageImportVersion);
if (!input)
return;
byte[] iv = WzTool.GetIvByMapleVersion(wzImageImportVersion);
WzImgDeserializer deserializer = new WzImgDeserializer(true);
yesToAll = false;
noToAll = false;
threadDone = false;
runningThread = new Thread(new ParameterizedThreadStart(WzImporterThread));
runningThread.Start(
new object[]
{
deserializer, dialog.FileNames, MainPanel.DataTree.SelectedNode, iv
});
new Thread(new ParameterizedThreadStart(ProgressBarThread)).Start(deserializer);
}
private void searchToolStripMenuItem_Click(object sender, EventArgs e)
{
//MainPanel.findStrip.Visible = true;
}
private static readonly string HelpFile = "Help.htm";
private void ViewHelpToolStripMenuItem_Click(object sender, EventArgs e)
{
string helpPath = Path.Combine(Application.StartupPath, HelpFile);
if (File.Exists(helpPath))
Help.ShowHelp(this, HelpFile);
else
Warning.Error(string.Format(HaRepacker.Properties.Resources.MainHelpOpenFail, HelpFile));
}
private void CopyToolStripMenuItem_Click(object sender, EventArgs e)
{
MainPanel.DoCopy();
}
private void PasteToolStripMenuItem_Click(object sender, EventArgs e)
{
MainPanel.DoPaste();
}
/// <summary>
/// Wz string searcher tool
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ToolStripMenuItem_searchWzStrings_Click(object sender, EventArgs e)
{
// Map name load
string loadedWzVersion;
WzStringSearchFormDataCache dataCache = new WzStringSearchFormDataCache(GetWzMapleVersionByWzEncryptionBoxSelection(encryptionBox.SelectedIndex));
if (dataCache.OpenBaseWZFile(out loadedWzVersion))
{
WzStringSearchForm form = new WzStringSearchForm(dataCache, loadedWzVersion);
form.Show();
}
}
#endregion
private void AbortButton_Click(object sender, EventArgs e)
{
if (Warning.Warn(HaRepacker.Properties.Resources.MainConfirmAbort))
{
threadDone = true;
runningThread.Abort();
}
}
#region Image directory add
/// <summary>
/// Add WzDirectory
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void WzDirectoryToolStripMenuItem_Click(object sender, EventArgs e)
{
MainPanel.AddWzDirectoryToSelectedNode(MainPanel.DataTree.SelectedNode);
}
/// <summary>
/// Add WzImage
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void WzImageToolStripMenuItem_Click(object sender, EventArgs e)
{
MainPanel.AddWzImageToSelectedNode(MainPanel.DataTree.SelectedNode);
}
/// <summary>
/// Add WzByte
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void WzByteFloatPropertyToolStripMenuItem_Click(object sender, EventArgs e)
{
MainPanel.AddWzByteFloatToSelectedNode(MainPanel.DataTree.SelectedNode);
}
/// <summary>
/// Add new canvas toolstrip
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void WzCanvasPropertyToolStripMenuItem_Click(object sender, EventArgs e)
{
MainPanel.AddWzCanvasToSelectedNode(MainPanel.DataTree.SelectedNode);
}
/// <summary>
/// Add WzIntProperty
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void WzCompressedIntPropertyToolStripMenuItem_Click(object sender, EventArgs e)
{
MainPanel.AddWzCompressedIntToSelectedNode(MainPanel.DataTree.SelectedNode);
}
/// <summary>
/// Add WzLongProperty
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void WzLongPropertyToolStripMenuItem_Click(object sender, EventArgs e)
{
MainPanel.AddWzLongToSelectedNode(MainPanel.DataTree.SelectedNode);
}
/// <summary>
/// Add WzConvexProperty
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void WzConvexPropertyToolStripMenuItem_Click(object sender, EventArgs e)
{
MainPanel.AddWzConvexPropertyToSelectedNode(MainPanel.DataTree.SelectedNode);
}
/// <summary>
/// Add WzDoubleProperty
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void WzDoublePropertyToolStripMenuItem_Click(object sender, EventArgs e)
{
MainPanel.AddWzDoublePropertyToSelectedNode(MainPanel.DataTree.SelectedNode);
}
/// <summary>
/// Add WzNullProperty
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void WzNullPropertyToolStripMenuItem_Click(object sender, EventArgs e)
{
MainPanel.AddWzNullPropertyToSelectedNode(MainPanel.DataTree.SelectedNode);
}
/// <summary>
/// Add WzSoundProperty
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void WzSoundPropertyToolStripMenuItem_Click(object sender, EventArgs e)
{
MainPanel.AddWzSoundPropertyToSelectedNode(MainPanel.DataTree.SelectedNode);
}
/// <summary>
/// Add WzStringProperty
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void WzStringPropertyToolStripMenuItem_Click(object sender, EventArgs e)
{
MainPanel.AddWzStringPropertyToSelectedIndex(MainPanel.DataTree.SelectedNode);
}
/// <summary>
/// Add WzSubProperty
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void WzSubPropertyToolStripMenuItem_Click(object sender, EventArgs e)
{
MainPanel.AddWzSubPropertyToSelectedIndex(MainPanel.DataTree.SelectedNode);
}
/// <summary>
/// Add WzShortProperty
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void WzUnsignedShortPropertyToolStripMenuItem_Click(object sender, EventArgs e)
{
MainPanel.AddWzUnsignedShortPropertyToSelectedIndex(MainPanel.DataTree.SelectedNode);
}
/// <summary>
/// Add WzUOLProperty
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void WzUolPropertyToolStripMenuItem_Click(object sender, EventArgs e)
{
MainPanel.AddWzUOLPropertyToSelectedIndex(MainPanel.DataTree.SelectedNode);
}
/// <summary>
/// Add WzVectorProperty
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void WzVectorPropertyToolStripMenuItem_Click(object sender, EventArgs e)
{
MainPanel.AddWzVectorPropertyToSelectedIndex(MainPanel.DataTree.SelectedNode);
}
/// <summary>
/// Add Lua script property
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void wzLuaPropertyToolStripMenuItem_Click(object sender, EventArgs e)
{
MainPanel.AddWzLuaPropertyToSelectedIndex(MainPanel.DataTree.SelectedNode);
}
#endregion
private delegate void InsertWzNode(WzNode node, WzNode parent);
private void InsertWzNodeCallback(WzNode node, WzNode parent)
{
WzNode child = WzNode.GetChildNode(parent, node.Text);
if (child != null)
{
if (ShowReplaceDialog(node.Text))
child.DeleteWzNode();
else return;
}
parent.AddNode(node, true);
}
private void InsertWzNodeThreadSafe(WzNode node, WzNode parent)
{
MainPanel.Dispatcher.Invoke(() =>
{
InsertWzNodeCallback(node, parent);
});
/* if (MainPanel.InvokeRequired)
MainPanel.Invoke(new InsertWzNode(InsertWzNodeCallback), node, parent);
else
InsertWzNodeCallback(node, parent);*/
}
private bool yesToAll = false;
private bool noToAll = false;
private ReplaceResult result;
private bool ShowReplaceDialog(string name)
{
if (yesToAll) return true;
else if (noToAll) return false;
else
{
ReplaceBox.Show(name, out result);
switch (result)
{
case ReplaceResult.NoToAll:
noToAll = true;
return false;
case ReplaceResult.No:
return false;
case ReplaceResult.YesToAll:
yesToAll = true;
return true;
case ReplaceResult.Yes:
return true;
}
}
throw new Exception("cant get here anyway");
}
private void WzImporterThread(object param)
{
ChangeApplicationState(false);
object[] arr = (object[])param;
ProgressingWzSerializer deserializer = (ProgressingWzSerializer)arr[0];
string[] files = (string[])arr[1];
WzNode parent = (WzNode)arr[2];
byte[] iv = (byte[])arr[3];
WzObject parentObj = (WzObject)parent.Tag;
if (parentObj is WzFile)
parentObj = ((WzFile)parentObj).WzDirectory;
UpdateProgressBar(MainPanel.mainProgressBar, files.Length, true, true);
foreach (string file in files)
{
List<WzObject> objs;
try
{
if (deserializer is WzXmlDeserializer)
objs = ((WzXmlDeserializer)deserializer).ParseXML(file);
else
{
bool successfullyParsedImage;
objs = new List<WzObject>
{
((WzImgDeserializer)deserializer).WzImageFromIMGFile(file, iv, Path.GetFileName(file), out successfullyParsedImage)
};
if (!successfullyParsedImage)
{
MessageBox.Show(
string.Format(HaRepacker.Properties.Resources.MainErrorImportingWzImageFile, file),
HaRepacker.Properties.Resources.Warning, MessageBoxButtons.OK, MessageBoxIcon.Warning);
continue;
}
}
}
catch (ThreadAbortException)
{
return;
}
catch (Exception e)
{
Warning.Error(string.Format(HaRepacker.Properties.Resources.MainInvalidFileError, file, e.Message));
UpdateProgressBar(MainPanel.mainProgressBar, 1, false, false);
continue;
}
foreach (WzObject obj in objs)
{
if (((obj is WzDirectory || obj is WzImage) && parentObj is WzDirectory) || (obj is WzImageProperty && parentObj is IPropertyContainer))
{
WzNode node = new WzNode(obj, true);
InsertWzNodeThreadSafe(node, parent);
}
}
UpdateProgressBar(MainPanel.mainProgressBar, 1, false, false);
}
MapleLib.Helpers.ErrorLogger.SaveToFile("WzImport_Errors.txt");
threadDone = true;
}
}
}
| 39.284365
| 231
| 0.541949
|
[
"MPL-2.0",
"MPL-2.0-no-copyleft-exception"
] |
Piezoelectric/Harepacker-resurrected
|
HaRepacker/GUI/MainForm.cs
| 74,878
|
C#
|
// ------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
// ------------------------------------------------------------
namespace PartyCluster.ApplicationDeployService
{
using System;
using System.Diagnostics;
using System.Threading;
using Microsoft.ServiceFabric.Data;
using Microsoft.ServiceFabric.Services.Runtime;
using Microsoft.Diagnostics.EventFlow.ServiceFabric;
internal static class Program
{
/// <summary>
/// This is the entry point of the service host process.
/// </summary>
private static void Main()
{
try
{
using (var pipeline = ServiceFabricDiagnosticPipelineFactory.CreatePipeline("PartyCluster.ApplicationDeployService"))
{
ServiceRuntime.RegisterServiceAsync(
"ApplicationDeployServiceType",
context =>
new ApplicationDeployService(new ReliableStateManager(context), new FabricClientApplicationOperator(context), context)
)
.GetAwaiter().GetResult();
ServiceEventSource.Current.ServiceTypeRegistered(Process.GetCurrentProcess().Id, typeof(ApplicationDeployService).Name);
Thread.Sleep(Timeout.Infinite); // Prevents this host process from terminating to keep the service host process running.
}
}
catch (Exception e)
{
ServiceEventSource.Current.ServiceHostInitializationFailed(e.ToString());
throw;
}
}
}
}
| 39.23913
| 142
| 0.572299
|
[
"MIT"
] |
LSTANCZYK/service-fabric-dotnet-management-party-cluster
|
src/PartyCluster.ApplicationDeployService/Program.cs
| 1,807
|
C#
|
using System;
using System.Threading;
using System.Threading.Tasks;
using HotChocolate;
using HotChocolate.Execution.Configuration;
using HotChocolate.Resolvers;
using HotChocolate.Types;
namespace Microsoft.Extensions.DependencyInjection;
public static partial class SchemaRequestExecutorBuilderExtensions
{
/// <summary>
/// Adds a resolver delegate for a specific field.
/// </summary>
/// <param name="builder">
/// The <see cref="IRequestExecutorBuilder"/>.
/// </param>
/// <param name="typeName">
/// The type to which the resolver is bound.
/// </param>
/// <param name="fieldName">
/// The field to which the resolver is bound.
/// </param>
/// <param name="resolver">
/// The resolver delegate.
/// </param>
/// <returns>
/// Returns the <see cref="IRequestExecutorBuilder"/> to allow configuration chaining.
/// </returns>
public static IRequestExecutorBuilder AddResolver(
this IRequestExecutorBuilder builder,
NameString typeName,
NameString fieldName,
Func<IResolverContext, object?> resolver)
{
if (builder is null)
{
throw new ArgumentNullException(nameof(builder));
}
if (resolver is null)
{
throw new ArgumentNullException(nameof(resolver));
}
return builder.ConfigureSchema(b => b.AddResolver(typeName, fieldName, resolver));
}
/// <summary>
/// Adds a resolver delegate for a specific field.
/// </summary>
/// <param name="builder">
/// The <see cref="IRequestExecutorBuilder"/>.
/// </param>
/// <param name="typeName">
/// The type to which the resolver is bound.
/// </param>
/// <param name="fieldName">
/// The field to which the resolver is bound.
/// </param>
/// <param name="resolver">
/// The resolver delegate.
/// </param>
/// <returns>
/// Returns the <see cref="IRequestExecutorBuilder"/> to allow configuration chaining.
/// </returns>
public static IRequestExecutorBuilder AddResolver(
this IRequestExecutorBuilder builder,
NameString typeName,
NameString fieldName,
Func<IResolverContext, ValueTask<object?>> resolver)
{
if (builder is null)
{
throw new ArgumentNullException(nameof(builder));
}
if (resolver is null)
{
throw new ArgumentNullException(nameof(resolver));
}
return builder.ConfigureSchema(b => b.AddResolver(typeName, fieldName, resolver));
}
/// <summary>
/// Adds a resolver delegate for a specific field.
/// </summary>
/// <param name="builder">
/// The <see cref="IRequestExecutorBuilder"/>.
/// </param>
/// <param name="typeName">
/// The type to which the resolver is bound.
/// </param>
/// <param name="fieldName">
/// The field to which the resolver is bound.
/// </param>
/// <param name="resolver">
/// The resolver delegate.
/// </param>
/// <returns>
/// Returns the <see cref="IRequestExecutorBuilder"/> to allow configuration chaining.
/// </returns>
public static IRequestExecutorBuilder AddResolver<TResult>(
this IRequestExecutorBuilder builder,
NameString typeName,
NameString fieldName,
Func<IResolverContext, TResult> resolver)
{
if (builder is null)
{
throw new ArgumentNullException(nameof(builder));
}
if (resolver is null)
{
throw new ArgumentNullException(nameof(resolver));
}
return builder.ConfigureSchema(b => b.AddResolver(typeName, fieldName, resolver));
}
/// <summary>
/// Adds a resolver delegate for a specific field.
/// </summary>
/// <param name="builder">
/// The <see cref="IRequestExecutorBuilder"/>.
/// </param>
/// <param name="typeName">
/// The type to which the resolver is bound.
/// </param>
/// <param name="fieldName">
/// The field to which the resolver is bound.
/// </param>
/// <param name="resolver">
/// The resolver delegate.
/// </param>
/// <returns>
/// Returns the <see cref="IRequestExecutorBuilder"/> to allow configuration chaining.
/// </returns>
public static IRequestExecutorBuilder AddResolver<TResult>(
this IRequestExecutorBuilder builder,
NameString typeName,
NameString fieldName,
Func<IResolverContext, ValueTask<TResult>> resolver)
{
if (builder is null)
{
throw new ArgumentNullException(nameof(builder));
}
if (resolver is null)
{
throw new ArgumentNullException(nameof(resolver));
}
return builder.ConfigureSchema(b => b.AddResolver(typeName, fieldName, resolver));
}
// Resolver()
/// <summary>
/// Adds a resolver delegate for a specific field.
/// </summary>
/// <param name="builder">
/// The <see cref="IRequestExecutorBuilder"/>.
/// </param>
/// <param name="typeName">
/// The type to which the resolver is bound.
/// </param>
/// <param name="fieldName">
/// The field to which the resolver is bound.
/// </param>
/// <param name="resolver">
/// The resolver delegate.
/// </param>
/// <returns>
/// Returns the <see cref="IRequestExecutorBuilder"/> to allow configuration chaining.
/// </returns>
public static IRequestExecutorBuilder AddResolver(
this IRequestExecutorBuilder builder,
NameString typeName,
NameString fieldName,
Func<object?> resolver)
{
if (builder is null)
{
throw new ArgumentNullException(nameof(builder));
}
if (resolver is null)
{
throw new ArgumentNullException(nameof(resolver));
}
return builder.ConfigureSchema(b => b.AddResolver(typeName, fieldName, resolver));
}
/// <summary>
/// Adds a resolver delegate for a specific field.
/// </summary>
/// <param name="builder">
/// The <see cref="IRequestExecutorBuilder"/>.
/// </param>
/// <param name="typeName">
/// The type to which the resolver is bound.
/// </param>
/// <param name="fieldName">
/// The field to which the resolver is bound.
/// </param>
/// <param name="resolver">
/// The resolver delegate.
/// </param>
/// <returns>
/// Returns the <see cref="IRequestExecutorBuilder"/> to allow configuration chaining.
/// </returns>
public static IRequestExecutorBuilder AddResolver(
this IRequestExecutorBuilder builder,
NameString typeName,
NameString fieldName,
Func<ValueTask<object?>> resolver)
{
if (builder is null)
{
throw new ArgumentNullException(nameof(builder));
}
if (resolver is null)
{
throw new ArgumentNullException(nameof(resolver));
}
return builder.ConfigureSchema(b => b.AddResolver(typeName, fieldName, resolver));
}
/// <summary>
/// Adds a resolver delegate for a specific field.
/// </summary>
/// <param name="builder">
/// The <see cref="IRequestExecutorBuilder"/>.
/// </param>
/// <param name="typeName">
/// The type to which the resolver is bound.
/// </param>
/// <param name="fieldName">
/// The field to which the resolver is bound.
/// </param>
/// <param name="resolver">
/// The resolver delegate.
/// </param>
/// <returns>
/// Returns the <see cref="IRequestExecutorBuilder"/> to allow configuration chaining.
/// </returns>
public static IRequestExecutorBuilder AddResolver<TResult>(
this IRequestExecutorBuilder builder,
NameString typeName,
NameString fieldName,
Func<TResult> resolver)
{
if (builder is null)
{
throw new ArgumentNullException(nameof(builder));
}
if (resolver is null)
{
throw new ArgumentNullException(nameof(resolver));
}
return builder.ConfigureSchema(b => b.AddResolver(typeName, fieldName, resolver));
}
/// <summary>
/// Adds a resolver delegate for a specific field.
/// </summary>
/// <param name="builder">
/// The <see cref="IRequestExecutorBuilder"/>.
/// </param>
/// <param name="typeName">
/// The type to which the resolver is bound.
/// </param>
/// <param name="fieldName">
/// The field to which the resolver is bound.
/// </param>
/// <param name="resolver">
/// The resolver delegate.
/// </param>
/// <returns>
/// Returns the <see cref="IRequestExecutorBuilder"/> to allow configuration chaining.
/// </returns>
public static IRequestExecutorBuilder AddResolver<TResult>(
this IRequestExecutorBuilder builder,
NameString typeName,
NameString fieldName,
Func<ValueTask<TResult>> resolver)
{
if (builder is null)
{
throw new ArgumentNullException(nameof(builder));
}
if (resolver is null)
{
throw new ArgumentNullException(nameof(resolver));
}
return builder.ConfigureSchema(b => b.AddResolver(typeName, fieldName, resolver));
}
// Resolver(IResolverContext, CancellationToken)
/// <summary>
/// Adds a resolver delegate for a specific field.
/// </summary>
/// <param name="builder">
/// The <see cref="IRequestExecutorBuilder"/>.
/// </param>
/// <param name="typeName">
/// The type to which the resolver is bound.
/// </param>
/// <param name="fieldName">
/// The field to which the resolver is bound.
/// </param>
/// <param name="resolver">
/// The resolver delegate.
/// </param>
/// <returns>
/// Returns the <see cref="IRequestExecutorBuilder"/> to allow configuration chaining.
/// </returns>
public static IRequestExecutorBuilder AddResolver(
this IRequestExecutorBuilder builder,
NameString typeName,
NameString fieldName,
Func<IResolverContext, CancellationToken, object?> resolver)
{
if (builder is null)
{
throw new ArgumentNullException(nameof(builder));
}
if (resolver is null)
{
throw new ArgumentNullException(nameof(resolver));
}
return builder.ConfigureSchema(b => b.AddResolver(typeName, fieldName, resolver));
}
/// <summary>
/// Adds a resolver delegate for a specific field.
/// </summary>
/// <param name="builder">
/// The <see cref="IRequestExecutorBuilder"/>.
/// </param>
/// <param name="typeName">
/// The type to which the resolver is bound.
/// </param>
/// <param name="fieldName">
/// The field to which the resolver is bound.
/// </param>
/// <param name="resolver">
/// The resolver delegate.
/// </param>
/// <returns>
/// Returns the <see cref="IRequestExecutorBuilder"/> to allow configuration chaining.
/// </returns>
public static IRequestExecutorBuilder AddResolver<TResult>(
this IRequestExecutorBuilder builder,
NameString typeName,
NameString fieldName,
Func<IResolverContext, CancellationToken, TResult> resolver)
{
if (builder is null)
{
throw new ArgumentNullException(nameof(builder));
}
if (resolver is null)
{
throw new ArgumentNullException(nameof(resolver));
}
return builder.ConfigureSchema(b => b.AddResolver(typeName, fieldName, resolver));
}
/// <summary>
/// Adds a resolver delegate for a specific field.
/// </summary>
/// <param name="builder">
/// The <see cref="IRequestExecutorBuilder"/>.
/// </param>
/// <param name="typeName">
/// The type to which the resolver is bound.
/// </param>
/// <param name="fieldName">
/// The field to which the resolver is bound.
/// </param>
/// <param name="resolver">
/// The resolver delegate.
/// </param>
/// <returns>
/// Returns the <see cref="IRequestExecutorBuilder"/> to allow configuration chaining.
/// </returns>
public static IRequestExecutorBuilder AddResolver<TResult>(
this IRequestExecutorBuilder builder,
NameString typeName,
NameString fieldName,
Func<IResolverContext, CancellationToken, ValueTask<TResult>> resolver)
{
if (builder is null)
{
throw new ArgumentNullException(nameof(builder));
}
if (resolver is null)
{
throw new ArgumentNullException(nameof(resolver));
}
return builder.ConfigureSchema(b => b.AddResolver(typeName, fieldName, resolver));
}
// Constant
/// <summary>
/// Adds a resolver delegate that returns a constant result.
/// </summary>
/// <param name="builder">
/// The <see cref="ISchemaBuilder"/>.
/// </param>
/// <param name="typeName">
/// The type to which the resolver is bound.
/// </param>
/// <param name="fieldName">
/// The field to which the resolver is bound.
/// </param>
/// <param name="constantResult">
/// The constant result that will be returned for the specified field.
/// </param>
/// <returns>
/// Returns the <see cref="ISchemaBuilder"/> to allow configuration chaining.
/// </returns>
public static IRequestExecutorBuilder AddResolver(
this IRequestExecutorBuilder builder,
NameString typeName,
NameString fieldName,
object? constantResult)
{
if (builder is null)
{
throw new ArgumentNullException(nameof(builder));
}
return builder.ConfigureSchema(b => b.AddResolver(typeName, fieldName, constantResult));
}
/// <summary>
/// Adds a resolver delegate that returns a constant result.
/// </summary>
/// <param name="builder">
/// The <see cref="ISchemaBuilder"/>.
/// </param>
/// <param name="typeName">
/// The type to which the resolver is bound.
/// </param>
/// <param name="fieldName">
/// The field to which the resolver is bound.
/// </param>
/// <param name="constantResult">
/// The constant result that will be returned for the specified field.
/// </param>
/// <returns>
/// Returns the <see cref="ISchemaBuilder"/> to allow configuration chaining.
/// </returns>
public static IRequestExecutorBuilder AddResolver<TResult>(
this IRequestExecutorBuilder builder,
NameString typeName,
NameString fieldName,
TResult constantResult)
{
if (builder is null)
{
throw new ArgumentNullException(nameof(builder));
}
return builder.ConfigureSchema(b => b.AddResolver(typeName, fieldName, constantResult));
}
/// <summary>
/// Adds a resolver delegate for a specific field.
/// </summary>
/// <param name="builder">
/// The <see cref="ISchemaBuilder"/>.
/// </param>
/// <typeparam name="TResolver">
/// The type that holds one or many resolvers
/// for the specified <paramref name="typeName"/>.
/// </typeparam>
/// <param name="typeName">
/// The type to which the resolver is bound.
/// </param>
/// <returns>
/// Returns the <see cref="ISchemaBuilder"/> to allow configuration chaining.
/// </returns>
public static IRequestExecutorBuilder AddResolver<TResolver>(
this IRequestExecutorBuilder builder,
NameString? typeName = null)
{
if (builder is null)
{
throw new ArgumentNullException(nameof(builder));
}
return builder.ConfigureSchema(b => b.AddResolver<TResolver>(typeName));
}
/// <summary>
/// Adds a resolver delegate for a specific field.
/// </summary>
/// <param name="builder">
/// The <see cref="ISchemaBuilder"/>.
/// </param>
/// <param name="resolverType">
/// The type that holds one or many resolvers
/// for the specified <paramref name="typeName"/>.
/// </param>
/// <param name="typeName">
/// The type to which the resolver is bound.
/// </param>
/// <returns>
/// Returns the <see cref="ISchemaBuilder"/> to allow configuration chaining.
/// </returns>
public static IRequestExecutorBuilder AddResolver(
this IRequestExecutorBuilder builder,
Type resolverType,
NameString? typeName = null)
{
if (builder is null)
{
throw new ArgumentNullException(nameof(builder));
}
if (resolverType is null)
{
throw new ArgumentNullException(nameof(builder));
}
return builder.ConfigureSchema(b => b.AddResolver(resolverType, typeName));
}
}
| 30.947464
| 96
| 0.599953
|
[
"MIT"
] |
AccountTechnologies/hotchocolate
|
src/HotChocolate/Core/src/Execution/DependencyInjection/SchemaRequestExecutorBuilderExtensions.Resolvers.cs
| 17,083
|
C#
|
using System;
namespace Appy.Play.Infrastructure.Utils
{
public interface ILogger
{
void Info(string message);
}
public class ConsoleLogger : ILogger
{
public void Info(string message) => Console.WriteLine(message);
}
}
| 18.714286
| 71
| 0.652672
|
[
"MIT"
] |
jrgcubano/play-azure-sdk
|
src/Appy.Play.Infrastructure/Utils/ConsoleLogger.cs
| 264
|
C#
|
/*
* Copyright (c) 2018 THL A29 Limited, a Tencent company. 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.
*/
namespace TencentCloud.Cdb.V20170320
{
using Newtonsoft.Json;
using System.Threading.Tasks;
using TencentCloud.Common;
using TencentCloud.Common.Profile;
using TencentCloud.Cdb.V20170320.Models;
public class CdbClient : AbstractClient{
private const string endpoint = "cdb.tencentcloudapi.com";
private const string version = "2017-03-20";
/// <summary>
/// Client constructor.
/// </summary>
/// <param name="credential">Credentials.</param>
/// <param name="region">Region name, such as "ap-guangzhou".</param>
public CdbClient(Credential credential, string region)
: this(credential, region, new ClientProfile())
{
}
/// <summary>
/// Client Constructor.
/// </summary>
/// <param name="credential">Credentials.</param>
/// <param name="region">Region name, such as "ap-guangzhou".</param>
/// <param name="profile">Client profiles.</param>
public CdbClient(Credential credential, string region, ClientProfile profile)
: base(endpoint, version, credential, region, profile)
{
}
/// <summary>
/// 本接口(AddTimeWindow)用于添加云数据库实例的维护时间窗口,以指定实例在哪些时间段可以自动执行切换访问操作。
/// </summary>
/// <param name="req"><see cref="AddTimeWindowRequest"/></param>
/// <returns><see cref="AddTimeWindowResponse"/></returns>
public async Task<AddTimeWindowResponse> AddTimeWindow(AddTimeWindowRequest req)
{
JsonResponseModel<AddTimeWindowResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "AddTimeWindow");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<AddTimeWindowResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(AddTimeWindow)用于添加云数据库实例的维护时间窗口,以指定实例在哪些时间段可以自动执行切换访问操作。
/// </summary>
/// <param name="req"><see cref="AddTimeWindowRequest"/></param>
/// <returns><see cref="AddTimeWindowResponse"/></returns>
public AddTimeWindowResponse AddTimeWindowSync(AddTimeWindowRequest req)
{
JsonResponseModel<AddTimeWindowResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "AddTimeWindow");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<AddTimeWindowResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(AssociateSecurityGroups)用于安全组批量绑定实例。
/// </summary>
/// <param name="req"><see cref="AssociateSecurityGroupsRequest"/></param>
/// <returns><see cref="AssociateSecurityGroupsResponse"/></returns>
public async Task<AssociateSecurityGroupsResponse> AssociateSecurityGroups(AssociateSecurityGroupsRequest req)
{
JsonResponseModel<AssociateSecurityGroupsResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "AssociateSecurityGroups");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<AssociateSecurityGroupsResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(AssociateSecurityGroups)用于安全组批量绑定实例。
/// </summary>
/// <param name="req"><see cref="AssociateSecurityGroupsRequest"/></param>
/// <returns><see cref="AssociateSecurityGroupsResponse"/></returns>
public AssociateSecurityGroupsResponse AssociateSecurityGroupsSync(AssociateSecurityGroupsRequest req)
{
JsonResponseModel<AssociateSecurityGroupsResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "AssociateSecurityGroups");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<AssociateSecurityGroupsResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(BalanceRoGroupLoad)用于重新均衡 RO 组内实例的负载。注意,RO 组内 RO 实例会有一次数据库连接瞬断,请确保应用程序能重连数据库,谨慎操作。
/// </summary>
/// <param name="req"><see cref="BalanceRoGroupLoadRequest"/></param>
/// <returns><see cref="BalanceRoGroupLoadResponse"/></returns>
public async Task<BalanceRoGroupLoadResponse> BalanceRoGroupLoad(BalanceRoGroupLoadRequest req)
{
JsonResponseModel<BalanceRoGroupLoadResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "BalanceRoGroupLoad");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<BalanceRoGroupLoadResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(BalanceRoGroupLoad)用于重新均衡 RO 组内实例的负载。注意,RO 组内 RO 实例会有一次数据库连接瞬断,请确保应用程序能重连数据库,谨慎操作。
/// </summary>
/// <param name="req"><see cref="BalanceRoGroupLoadRequest"/></param>
/// <returns><see cref="BalanceRoGroupLoadResponse"/></returns>
public BalanceRoGroupLoadResponse BalanceRoGroupLoadSync(BalanceRoGroupLoadRequest req)
{
JsonResponseModel<BalanceRoGroupLoadResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "BalanceRoGroupLoad");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<BalanceRoGroupLoadResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(CloseWanService)用于关闭云数据库实例的外网访问。关闭外网访问后,外网地址将不可访问。
/// </summary>
/// <param name="req"><see cref="CloseWanServiceRequest"/></param>
/// <returns><see cref="CloseWanServiceResponse"/></returns>
public async Task<CloseWanServiceResponse> CloseWanService(CloseWanServiceRequest req)
{
JsonResponseModel<CloseWanServiceResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "CloseWanService");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<CloseWanServiceResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(CloseWanService)用于关闭云数据库实例的外网访问。关闭外网访问后,外网地址将不可访问。
/// </summary>
/// <param name="req"><see cref="CloseWanServiceRequest"/></param>
/// <returns><see cref="CloseWanServiceResponse"/></returns>
public CloseWanServiceResponse CloseWanServiceSync(CloseWanServiceRequest req)
{
JsonResponseModel<CloseWanServiceResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "CloseWanService");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<CloseWanServiceResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(CreateAccounts)用于创建云数据库的账户,需要指定新的账户名和域名,以及所对应的密码,同时可以设置账号的备注信息。
/// </summary>
/// <param name="req"><see cref="CreateAccountsRequest"/></param>
/// <returns><see cref="CreateAccountsResponse"/></returns>
public async Task<CreateAccountsResponse> CreateAccounts(CreateAccountsRequest req)
{
JsonResponseModel<CreateAccountsResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "CreateAccounts");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<CreateAccountsResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(CreateAccounts)用于创建云数据库的账户,需要指定新的账户名和域名,以及所对应的密码,同时可以设置账号的备注信息。
/// </summary>
/// <param name="req"><see cref="CreateAccountsRequest"/></param>
/// <returns><see cref="CreateAccountsResponse"/></returns>
public CreateAccountsResponse CreateAccountsSync(CreateAccountsRequest req)
{
JsonResponseModel<CreateAccountsResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "CreateAccounts");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<CreateAccountsResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(CreateBackup)用于创建数据库备份。
/// </summary>
/// <param name="req"><see cref="CreateBackupRequest"/></param>
/// <returns><see cref="CreateBackupResponse"/></returns>
public async Task<CreateBackupResponse> CreateBackup(CreateBackupRequest req)
{
JsonResponseModel<CreateBackupResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "CreateBackup");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<CreateBackupResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(CreateBackup)用于创建数据库备份。
/// </summary>
/// <param name="req"><see cref="CreateBackupRequest"/></param>
/// <returns><see cref="CreateBackupResponse"/></returns>
public CreateBackupResponse CreateBackupSync(CreateBackupRequest req)
{
JsonResponseModel<CreateBackupResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "CreateBackup");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<CreateBackupResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(CreateDBImportJob)用于创建云数据库数据导入任务。
///
/// 注意,用户进行数据导入任务的文件,必须提前上传到腾讯云。用户须在控制台进行文件导入。
/// </summary>
/// <param name="req"><see cref="CreateDBImportJobRequest"/></param>
/// <returns><see cref="CreateDBImportJobResponse"/></returns>
public async Task<CreateDBImportJobResponse> CreateDBImportJob(CreateDBImportJobRequest req)
{
JsonResponseModel<CreateDBImportJobResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "CreateDBImportJob");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<CreateDBImportJobResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(CreateDBImportJob)用于创建云数据库数据导入任务。
///
/// 注意,用户进行数据导入任务的文件,必须提前上传到腾讯云。用户须在控制台进行文件导入。
/// </summary>
/// <param name="req"><see cref="CreateDBImportJobRequest"/></param>
/// <returns><see cref="CreateDBImportJobResponse"/></returns>
public CreateDBImportJobResponse CreateDBImportJobSync(CreateDBImportJobRequest req)
{
JsonResponseModel<CreateDBImportJobResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "CreateDBImportJob");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<CreateDBImportJobResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(CreateDBInstance)用于创建包年包月的云数据库实例(包括主实例、灾备实例和只读实例),可通过传入实例规格、MySQL 版本号、购买时长和数量等信息创建云数据库实例。
///
/// 该接口为异步接口,您还可以使用 [查询实例列表](https://cloud.tencent.com/document/api/236/15872) 接口查询该实例的详细信息。当该实例的 Status 为1,且 TaskStatus 为0,表示实例已经发货成功。
///
/// 1. 首先请使用 [获取云数据库可售卖规格](https://cloud.tencent.com/document/api/236/17229) 接口查询可创建的实例规格信息,然后请使用 [查询数据库价格](https://cloud.tencent.com/document/api/236/18566) 接口查询可创建实例的售卖价格;
/// 2. 单次创建实例最大支持 100 个,实例时长最大支持 36 个月;
/// 3. 支持创建 MySQL 5.5 、 MySQL 5.6 、 MySQL 5.7 版本;
/// 4. 支持创建主实例、只读实例、灾备实例;
/// 5. 当入参指定 Port,ParamList 或 Password 时,该实例会进行初始化操作;
/// </summary>
/// <param name="req"><see cref="CreateDBInstanceRequest"/></param>
/// <returns><see cref="CreateDBInstanceResponse"/></returns>
public async Task<CreateDBInstanceResponse> CreateDBInstance(CreateDBInstanceRequest req)
{
JsonResponseModel<CreateDBInstanceResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "CreateDBInstance");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<CreateDBInstanceResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(CreateDBInstance)用于创建包年包月的云数据库实例(包括主实例、灾备实例和只读实例),可通过传入实例规格、MySQL 版本号、购买时长和数量等信息创建云数据库实例。
///
/// 该接口为异步接口,您还可以使用 [查询实例列表](https://cloud.tencent.com/document/api/236/15872) 接口查询该实例的详细信息。当该实例的 Status 为1,且 TaskStatus 为0,表示实例已经发货成功。
///
/// 1. 首先请使用 [获取云数据库可售卖规格](https://cloud.tencent.com/document/api/236/17229) 接口查询可创建的实例规格信息,然后请使用 [查询数据库价格](https://cloud.tencent.com/document/api/236/18566) 接口查询可创建实例的售卖价格;
/// 2. 单次创建实例最大支持 100 个,实例时长最大支持 36 个月;
/// 3. 支持创建 MySQL 5.5 、 MySQL 5.6 、 MySQL 5.7 版本;
/// 4. 支持创建主实例、只读实例、灾备实例;
/// 5. 当入参指定 Port,ParamList 或 Password 时,该实例会进行初始化操作;
/// </summary>
/// <param name="req"><see cref="CreateDBInstanceRequest"/></param>
/// <returns><see cref="CreateDBInstanceResponse"/></returns>
public CreateDBInstanceResponse CreateDBInstanceSync(CreateDBInstanceRequest req)
{
JsonResponseModel<CreateDBInstanceResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "CreateDBInstance");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<CreateDBInstanceResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(CreateDBInstanceHour)用于创建按量计费的实例,可通过传入实例规格、MySQL 版本号和数量等信息创建云数据库实例,支持主实例、灾备实例和只读实例的创建。
///
/// 该接口为异步接口,您还可以使用 [查询实例列表](https://cloud.tencent.com/document/api/236/15872) 接口查询该实例的详细信息。当该实例的 Status 为 1,且 TaskStatus 为 0,表示实例已经发货成功。
///
/// 1. 首先请使用 [获取云数据库可售卖规格](https://cloud.tencent.com/document/api/236/17229) 接口查询可创建的实例规格信息,然后请使用 [查询数据库价格](https://cloud.tencent.com/document/api/236/18566) 接口查询可创建实例的售卖价格;
/// 2. 单次创建实例最大支持 100 个,实例时长最大支持 36 个月;
/// 3. 支持创建 MySQL 5.5、MySQL 5.6 和 MySQL 5.7 版本;
/// 4. 支持创建主实例、灾备实例和只读实例;
/// 5. 当入参指定 Port,ParamList 或 Password 时,该实例会进行初始化操作;
/// </summary>
/// <param name="req"><see cref="CreateDBInstanceHourRequest"/></param>
/// <returns><see cref="CreateDBInstanceHourResponse"/></returns>
public async Task<CreateDBInstanceHourResponse> CreateDBInstanceHour(CreateDBInstanceHourRequest req)
{
JsonResponseModel<CreateDBInstanceHourResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "CreateDBInstanceHour");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<CreateDBInstanceHourResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(CreateDBInstanceHour)用于创建按量计费的实例,可通过传入实例规格、MySQL 版本号和数量等信息创建云数据库实例,支持主实例、灾备实例和只读实例的创建。
///
/// 该接口为异步接口,您还可以使用 [查询实例列表](https://cloud.tencent.com/document/api/236/15872) 接口查询该实例的详细信息。当该实例的 Status 为 1,且 TaskStatus 为 0,表示实例已经发货成功。
///
/// 1. 首先请使用 [获取云数据库可售卖规格](https://cloud.tencent.com/document/api/236/17229) 接口查询可创建的实例规格信息,然后请使用 [查询数据库价格](https://cloud.tencent.com/document/api/236/18566) 接口查询可创建实例的售卖价格;
/// 2. 单次创建实例最大支持 100 个,实例时长最大支持 36 个月;
/// 3. 支持创建 MySQL 5.5、MySQL 5.6 和 MySQL 5.7 版本;
/// 4. 支持创建主实例、灾备实例和只读实例;
/// 5. 当入参指定 Port,ParamList 或 Password 时,该实例会进行初始化操作;
/// </summary>
/// <param name="req"><see cref="CreateDBInstanceHourRequest"/></param>
/// <returns><see cref="CreateDBInstanceHourResponse"/></returns>
public CreateDBInstanceHourResponse CreateDBInstanceHourSync(CreateDBInstanceHourRequest req)
{
JsonResponseModel<CreateDBInstanceHourResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "CreateDBInstanceHour");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<CreateDBInstanceHourResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(CreateDeployGroup)用于创建放置实例的置放群组
/// </summary>
/// <param name="req"><see cref="CreateDeployGroupRequest"/></param>
/// <returns><see cref="CreateDeployGroupResponse"/></returns>
public async Task<CreateDeployGroupResponse> CreateDeployGroup(CreateDeployGroupRequest req)
{
JsonResponseModel<CreateDeployGroupResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "CreateDeployGroup");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<CreateDeployGroupResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(CreateDeployGroup)用于创建放置实例的置放群组
/// </summary>
/// <param name="req"><see cref="CreateDeployGroupRequest"/></param>
/// <returns><see cref="CreateDeployGroupResponse"/></returns>
public CreateDeployGroupResponse CreateDeployGroupSync(CreateDeployGroupRequest req)
{
JsonResponseModel<CreateDeployGroupResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "CreateDeployGroup");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<CreateDeployGroupResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 该接口(CreateParamTemplate)用于创建参数模板。
/// </summary>
/// <param name="req"><see cref="CreateParamTemplateRequest"/></param>
/// <returns><see cref="CreateParamTemplateResponse"/></returns>
public async Task<CreateParamTemplateResponse> CreateParamTemplate(CreateParamTemplateRequest req)
{
JsonResponseModel<CreateParamTemplateResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "CreateParamTemplate");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<CreateParamTemplateResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 该接口(CreateParamTemplate)用于创建参数模板。
/// </summary>
/// <param name="req"><see cref="CreateParamTemplateRequest"/></param>
/// <returns><see cref="CreateParamTemplateResponse"/></returns>
public CreateParamTemplateResponse CreateParamTemplateSync(CreateParamTemplateRequest req)
{
JsonResponseModel<CreateParamTemplateResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "CreateParamTemplate");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<CreateParamTemplateResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DeleteAccounts)用于删除云数据库的账户。
/// </summary>
/// <param name="req"><see cref="DeleteAccountsRequest"/></param>
/// <returns><see cref="DeleteAccountsResponse"/></returns>
public async Task<DeleteAccountsResponse> DeleteAccounts(DeleteAccountsRequest req)
{
JsonResponseModel<DeleteAccountsResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DeleteAccounts");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DeleteAccountsResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DeleteAccounts)用于删除云数据库的账户。
/// </summary>
/// <param name="req"><see cref="DeleteAccountsRequest"/></param>
/// <returns><see cref="DeleteAccountsResponse"/></returns>
public DeleteAccountsResponse DeleteAccountsSync(DeleteAccountsRequest req)
{
JsonResponseModel<DeleteAccountsResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DeleteAccounts");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DeleteAccountsResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DeleteBackup)用于删除数据库备份。本接口只支持删除手动发起的备份。
/// </summary>
/// <param name="req"><see cref="DeleteBackupRequest"/></param>
/// <returns><see cref="DeleteBackupResponse"/></returns>
public async Task<DeleteBackupResponse> DeleteBackup(DeleteBackupRequest req)
{
JsonResponseModel<DeleteBackupResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DeleteBackup");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DeleteBackupResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DeleteBackup)用于删除数据库备份。本接口只支持删除手动发起的备份。
/// </summary>
/// <param name="req"><see cref="DeleteBackupRequest"/></param>
/// <returns><see cref="DeleteBackupResponse"/></returns>
public DeleteBackupResponse DeleteBackupSync(DeleteBackupRequest req)
{
JsonResponseModel<DeleteBackupResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DeleteBackup");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DeleteBackupResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 根据置放群组ID删除置放群组(置放群组中有资源存在时不能删除该置放群组)
/// </summary>
/// <param name="req"><see cref="DeleteDeployGroupsRequest"/></param>
/// <returns><see cref="DeleteDeployGroupsResponse"/></returns>
public async Task<DeleteDeployGroupsResponse> DeleteDeployGroups(DeleteDeployGroupsRequest req)
{
JsonResponseModel<DeleteDeployGroupsResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DeleteDeployGroups");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DeleteDeployGroupsResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 根据置放群组ID删除置放群组(置放群组中有资源存在时不能删除该置放群组)
/// </summary>
/// <param name="req"><see cref="DeleteDeployGroupsRequest"/></param>
/// <returns><see cref="DeleteDeployGroupsResponse"/></returns>
public DeleteDeployGroupsResponse DeleteDeployGroupsSync(DeleteDeployGroupsRequest req)
{
JsonResponseModel<DeleteDeployGroupsResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DeleteDeployGroups");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DeleteDeployGroupsResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 该接口(DeleteParamTemplate)用于删除参数模板。
/// </summary>
/// <param name="req"><see cref="DeleteParamTemplateRequest"/></param>
/// <returns><see cref="DeleteParamTemplateResponse"/></returns>
public async Task<DeleteParamTemplateResponse> DeleteParamTemplate(DeleteParamTemplateRequest req)
{
JsonResponseModel<DeleteParamTemplateResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DeleteParamTemplate");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DeleteParamTemplateResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 该接口(DeleteParamTemplate)用于删除参数模板。
/// </summary>
/// <param name="req"><see cref="DeleteParamTemplateRequest"/></param>
/// <returns><see cref="DeleteParamTemplateResponse"/></returns>
public DeleteParamTemplateResponse DeleteParamTemplateSync(DeleteParamTemplateRequest req)
{
JsonResponseModel<DeleteParamTemplateResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DeleteParamTemplate");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DeleteParamTemplateResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DeleteTimeWindow)用于删除云数据库实例的维护时间窗口。删除实例维护时间窗口之后,默认的维护时间窗为 03:00-04:00,即当选择在维护时间窗口内切换访问新实例时,默认会在 03:00-04:00 点进行切换访问新实例。
/// </summary>
/// <param name="req"><see cref="DeleteTimeWindowRequest"/></param>
/// <returns><see cref="DeleteTimeWindowResponse"/></returns>
public async Task<DeleteTimeWindowResponse> DeleteTimeWindow(DeleteTimeWindowRequest req)
{
JsonResponseModel<DeleteTimeWindowResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DeleteTimeWindow");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DeleteTimeWindowResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DeleteTimeWindow)用于删除云数据库实例的维护时间窗口。删除实例维护时间窗口之后,默认的维护时间窗为 03:00-04:00,即当选择在维护时间窗口内切换访问新实例时,默认会在 03:00-04:00 点进行切换访问新实例。
/// </summary>
/// <param name="req"><see cref="DeleteTimeWindowRequest"/></param>
/// <returns><see cref="DeleteTimeWindowResponse"/></returns>
public DeleteTimeWindowResponse DeleteTimeWindowSync(DeleteTimeWindowRequest req)
{
JsonResponseModel<DeleteTimeWindowResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DeleteTimeWindow");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DeleteTimeWindowResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeAccountPrivileges)用于查询云数据库账户支持的权限信息。
/// </summary>
/// <param name="req"><see cref="DescribeAccountPrivilegesRequest"/></param>
/// <returns><see cref="DescribeAccountPrivilegesResponse"/></returns>
public async Task<DescribeAccountPrivilegesResponse> DescribeAccountPrivileges(DescribeAccountPrivilegesRequest req)
{
JsonResponseModel<DescribeAccountPrivilegesResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeAccountPrivileges");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeAccountPrivilegesResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeAccountPrivileges)用于查询云数据库账户支持的权限信息。
/// </summary>
/// <param name="req"><see cref="DescribeAccountPrivilegesRequest"/></param>
/// <returns><see cref="DescribeAccountPrivilegesResponse"/></returns>
public DescribeAccountPrivilegesResponse DescribeAccountPrivilegesSync(DescribeAccountPrivilegesRequest req)
{
JsonResponseModel<DescribeAccountPrivilegesResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeAccountPrivileges");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeAccountPrivilegesResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeAccounts)用于查询云数据库的所有账户信息。
/// </summary>
/// <param name="req"><see cref="DescribeAccountsRequest"/></param>
/// <returns><see cref="DescribeAccountsResponse"/></returns>
public async Task<DescribeAccountsResponse> DescribeAccounts(DescribeAccountsRequest req)
{
JsonResponseModel<DescribeAccountsResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeAccounts");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeAccountsResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeAccounts)用于查询云数据库的所有账户信息。
/// </summary>
/// <param name="req"><see cref="DescribeAccountsRequest"/></param>
/// <returns><see cref="DescribeAccountsResponse"/></returns>
public DescribeAccountsResponse DescribeAccountsSync(DescribeAccountsRequest req)
{
JsonResponseModel<DescribeAccountsResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeAccounts");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeAccountsResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeAsyncRequestInfo)用于查询云数据库实例异步任务的执行结果。
/// </summary>
/// <param name="req"><see cref="DescribeAsyncRequestInfoRequest"/></param>
/// <returns><see cref="DescribeAsyncRequestInfoResponse"/></returns>
public async Task<DescribeAsyncRequestInfoResponse> DescribeAsyncRequestInfo(DescribeAsyncRequestInfoRequest req)
{
JsonResponseModel<DescribeAsyncRequestInfoResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeAsyncRequestInfo");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeAsyncRequestInfoResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeAsyncRequestInfo)用于查询云数据库实例异步任务的执行结果。
/// </summary>
/// <param name="req"><see cref="DescribeAsyncRequestInfoRequest"/></param>
/// <returns><see cref="DescribeAsyncRequestInfoResponse"/></returns>
public DescribeAsyncRequestInfoResponse DescribeAsyncRequestInfoSync(DescribeAsyncRequestInfoRequest req)
{
JsonResponseModel<DescribeAsyncRequestInfoResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeAsyncRequestInfo");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeAsyncRequestInfoResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeBackupConfig)用于查询数据库备份配置信息。
/// </summary>
/// <param name="req"><see cref="DescribeBackupConfigRequest"/></param>
/// <returns><see cref="DescribeBackupConfigResponse"/></returns>
public async Task<DescribeBackupConfigResponse> DescribeBackupConfig(DescribeBackupConfigRequest req)
{
JsonResponseModel<DescribeBackupConfigResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeBackupConfig");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeBackupConfigResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeBackupConfig)用于查询数据库备份配置信息。
/// </summary>
/// <param name="req"><see cref="DescribeBackupConfigRequest"/></param>
/// <returns><see cref="DescribeBackupConfigResponse"/></returns>
public DescribeBackupConfigResponse DescribeBackupConfigSync(DescribeBackupConfigRequest req)
{
JsonResponseModel<DescribeBackupConfigResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeBackupConfig");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeBackupConfigResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeBackupDatabases)用于查询备份文件包含的库 (已废弃)。
/// 旧版本支持全量备份后,用户如果分库表下载逻辑备份文件,需要用到此接口。
/// 新版本支持(CreateBackup)创建逻辑备份的时候,直接发起指定库表备份,用户直接下载该备份文件即可。
/// </summary>
/// <param name="req"><see cref="DescribeBackupDatabasesRequest"/></param>
/// <returns><see cref="DescribeBackupDatabasesResponse"/></returns>
public async Task<DescribeBackupDatabasesResponse> DescribeBackupDatabases(DescribeBackupDatabasesRequest req)
{
JsonResponseModel<DescribeBackupDatabasesResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeBackupDatabases");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeBackupDatabasesResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeBackupDatabases)用于查询备份文件包含的库 (已废弃)。
/// 旧版本支持全量备份后,用户如果分库表下载逻辑备份文件,需要用到此接口。
/// 新版本支持(CreateBackup)创建逻辑备份的时候,直接发起指定库表备份,用户直接下载该备份文件即可。
/// </summary>
/// <param name="req"><see cref="DescribeBackupDatabasesRequest"/></param>
/// <returns><see cref="DescribeBackupDatabasesResponse"/></returns>
public DescribeBackupDatabasesResponse DescribeBackupDatabasesSync(DescribeBackupDatabasesRequest req)
{
JsonResponseModel<DescribeBackupDatabasesResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeBackupDatabases");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeBackupDatabasesResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeBackupOverview)用于查询用户的备份概览。返回用户当前备份总个数、备份总的占用容量、赠送的免费容量、计费容量(容量单位为字节)。
/// </summary>
/// <param name="req"><see cref="DescribeBackupOverviewRequest"/></param>
/// <returns><see cref="DescribeBackupOverviewResponse"/></returns>
public async Task<DescribeBackupOverviewResponse> DescribeBackupOverview(DescribeBackupOverviewRequest req)
{
JsonResponseModel<DescribeBackupOverviewResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeBackupOverview");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeBackupOverviewResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeBackupOverview)用于查询用户的备份概览。返回用户当前备份总个数、备份总的占用容量、赠送的免费容量、计费容量(容量单位为字节)。
/// </summary>
/// <param name="req"><see cref="DescribeBackupOverviewRequest"/></param>
/// <returns><see cref="DescribeBackupOverviewResponse"/></returns>
public DescribeBackupOverviewResponse DescribeBackupOverviewSync(DescribeBackupOverviewRequest req)
{
JsonResponseModel<DescribeBackupOverviewResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeBackupOverview");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeBackupOverviewResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeBackupSummaries)用于查询备份的统计情况,返回以实例为维度的备份占用容量,以及每个实例的数据备份和日志备份的个数和容量(容量单位为字节)。
/// </summary>
/// <param name="req"><see cref="DescribeBackupSummariesRequest"/></param>
/// <returns><see cref="DescribeBackupSummariesResponse"/></returns>
public async Task<DescribeBackupSummariesResponse> DescribeBackupSummaries(DescribeBackupSummariesRequest req)
{
JsonResponseModel<DescribeBackupSummariesResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeBackupSummaries");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeBackupSummariesResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeBackupSummaries)用于查询备份的统计情况,返回以实例为维度的备份占用容量,以及每个实例的数据备份和日志备份的个数和容量(容量单位为字节)。
/// </summary>
/// <param name="req"><see cref="DescribeBackupSummariesRequest"/></param>
/// <returns><see cref="DescribeBackupSummariesResponse"/></returns>
public DescribeBackupSummariesResponse DescribeBackupSummariesSync(DescribeBackupSummariesRequest req)
{
JsonResponseModel<DescribeBackupSummariesResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeBackupSummaries");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeBackupSummariesResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeBackupTables)用于查询指定的数据库的备份数据表名 (已废弃)。
/// 旧版本支持全量备份后,用户如果分库表下载逻辑备份文件,需要用到此接口。
/// 新版本支持(CreateBackup)创建逻辑备份的时候,直接发起指定库表备份,用户直接下载该备份文件即可。
/// </summary>
/// <param name="req"><see cref="DescribeBackupTablesRequest"/></param>
/// <returns><see cref="DescribeBackupTablesResponse"/></returns>
public async Task<DescribeBackupTablesResponse> DescribeBackupTables(DescribeBackupTablesRequest req)
{
JsonResponseModel<DescribeBackupTablesResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeBackupTables");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeBackupTablesResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeBackupTables)用于查询指定的数据库的备份数据表名 (已废弃)。
/// 旧版本支持全量备份后,用户如果分库表下载逻辑备份文件,需要用到此接口。
/// 新版本支持(CreateBackup)创建逻辑备份的时候,直接发起指定库表备份,用户直接下载该备份文件即可。
/// </summary>
/// <param name="req"><see cref="DescribeBackupTablesRequest"/></param>
/// <returns><see cref="DescribeBackupTablesResponse"/></returns>
public DescribeBackupTablesResponse DescribeBackupTablesSync(DescribeBackupTablesRequest req)
{
JsonResponseModel<DescribeBackupTablesResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeBackupTables");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeBackupTablesResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeBackups)用于查询云数据库实例的备份数据。
/// </summary>
/// <param name="req"><see cref="DescribeBackupsRequest"/></param>
/// <returns><see cref="DescribeBackupsResponse"/></returns>
public async Task<DescribeBackupsResponse> DescribeBackups(DescribeBackupsRequest req)
{
JsonResponseModel<DescribeBackupsResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeBackups");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeBackupsResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeBackups)用于查询云数据库实例的备份数据。
/// </summary>
/// <param name="req"><see cref="DescribeBackupsRequest"/></param>
/// <returns><see cref="DescribeBackupsResponse"/></returns>
public DescribeBackupsResponse DescribeBackupsSync(DescribeBackupsRequest req)
{
JsonResponseModel<DescribeBackupsResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeBackups");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeBackupsResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeBinlogBackupOverview)用于查询用户在当前地域总的日志备份概览。
/// </summary>
/// <param name="req"><see cref="DescribeBinlogBackupOverviewRequest"/></param>
/// <returns><see cref="DescribeBinlogBackupOverviewResponse"/></returns>
public async Task<DescribeBinlogBackupOverviewResponse> DescribeBinlogBackupOverview(DescribeBinlogBackupOverviewRequest req)
{
JsonResponseModel<DescribeBinlogBackupOverviewResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeBinlogBackupOverview");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeBinlogBackupOverviewResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeBinlogBackupOverview)用于查询用户在当前地域总的日志备份概览。
/// </summary>
/// <param name="req"><see cref="DescribeBinlogBackupOverviewRequest"/></param>
/// <returns><see cref="DescribeBinlogBackupOverviewResponse"/></returns>
public DescribeBinlogBackupOverviewResponse DescribeBinlogBackupOverviewSync(DescribeBinlogBackupOverviewRequest req)
{
JsonResponseModel<DescribeBinlogBackupOverviewResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeBinlogBackupOverview");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeBinlogBackupOverviewResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeBinlogs)用于查询云数据库实例的 binlog 文件列表。
/// </summary>
/// <param name="req"><see cref="DescribeBinlogsRequest"/></param>
/// <returns><see cref="DescribeBinlogsResponse"/></returns>
public async Task<DescribeBinlogsResponse> DescribeBinlogs(DescribeBinlogsRequest req)
{
JsonResponseModel<DescribeBinlogsResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeBinlogs");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeBinlogsResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeBinlogs)用于查询云数据库实例的 binlog 文件列表。
/// </summary>
/// <param name="req"><see cref="DescribeBinlogsRequest"/></param>
/// <returns><see cref="DescribeBinlogsResponse"/></returns>
public DescribeBinlogsResponse DescribeBinlogsSync(DescribeBinlogsRequest req)
{
JsonResponseModel<DescribeBinlogsResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeBinlogs");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeBinlogsResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeDBImportRecords)用于查询云数据库导入任务操作日志。
/// </summary>
/// <param name="req"><see cref="DescribeDBImportRecordsRequest"/></param>
/// <returns><see cref="DescribeDBImportRecordsResponse"/></returns>
public async Task<DescribeDBImportRecordsResponse> DescribeDBImportRecords(DescribeDBImportRecordsRequest req)
{
JsonResponseModel<DescribeDBImportRecordsResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeDBImportRecords");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeDBImportRecordsResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeDBImportRecords)用于查询云数据库导入任务操作日志。
/// </summary>
/// <param name="req"><see cref="DescribeDBImportRecordsRequest"/></param>
/// <returns><see cref="DescribeDBImportRecordsResponse"/></returns>
public DescribeDBImportRecordsResponse DescribeDBImportRecordsSync(DescribeDBImportRecordsRequest req)
{
JsonResponseModel<DescribeDBImportRecordsResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeDBImportRecords");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeDBImportRecordsResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeDBInstanceCharset)用于查询云数据库实例的字符集,获取字符集的名称。
/// </summary>
/// <param name="req"><see cref="DescribeDBInstanceCharsetRequest"/></param>
/// <returns><see cref="DescribeDBInstanceCharsetResponse"/></returns>
public async Task<DescribeDBInstanceCharsetResponse> DescribeDBInstanceCharset(DescribeDBInstanceCharsetRequest req)
{
JsonResponseModel<DescribeDBInstanceCharsetResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeDBInstanceCharset");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeDBInstanceCharsetResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeDBInstanceCharset)用于查询云数据库实例的字符集,获取字符集的名称。
/// </summary>
/// <param name="req"><see cref="DescribeDBInstanceCharsetRequest"/></param>
/// <returns><see cref="DescribeDBInstanceCharsetResponse"/></returns>
public DescribeDBInstanceCharsetResponse DescribeDBInstanceCharsetSync(DescribeDBInstanceCharsetRequest req)
{
JsonResponseModel<DescribeDBInstanceCharsetResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeDBInstanceCharset");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeDBInstanceCharsetResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeDBInstanceConfig)用于云数据库实例的配置信息,包括同步模式,部署模式等。
/// </summary>
/// <param name="req"><see cref="DescribeDBInstanceConfigRequest"/></param>
/// <returns><see cref="DescribeDBInstanceConfigResponse"/></returns>
public async Task<DescribeDBInstanceConfigResponse> DescribeDBInstanceConfig(DescribeDBInstanceConfigRequest req)
{
JsonResponseModel<DescribeDBInstanceConfigResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeDBInstanceConfig");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeDBInstanceConfigResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeDBInstanceConfig)用于云数据库实例的配置信息,包括同步模式,部署模式等。
/// </summary>
/// <param name="req"><see cref="DescribeDBInstanceConfigRequest"/></param>
/// <returns><see cref="DescribeDBInstanceConfigResponse"/></returns>
public DescribeDBInstanceConfigResponse DescribeDBInstanceConfigSync(DescribeDBInstanceConfigRequest req)
{
JsonResponseModel<DescribeDBInstanceConfigResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeDBInstanceConfig");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeDBInstanceConfigResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeDBInstanceGTID)用于查询云数据库实例是否开通了 GTID,不支持版本为 5.5 以及以下的实例。
/// </summary>
/// <param name="req"><see cref="DescribeDBInstanceGTIDRequest"/></param>
/// <returns><see cref="DescribeDBInstanceGTIDResponse"/></returns>
public async Task<DescribeDBInstanceGTIDResponse> DescribeDBInstanceGTID(DescribeDBInstanceGTIDRequest req)
{
JsonResponseModel<DescribeDBInstanceGTIDResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeDBInstanceGTID");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeDBInstanceGTIDResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeDBInstanceGTID)用于查询云数据库实例是否开通了 GTID,不支持版本为 5.5 以及以下的实例。
/// </summary>
/// <param name="req"><see cref="DescribeDBInstanceGTIDRequest"/></param>
/// <returns><see cref="DescribeDBInstanceGTIDResponse"/></returns>
public DescribeDBInstanceGTIDResponse DescribeDBInstanceGTIDSync(DescribeDBInstanceGTIDRequest req)
{
JsonResponseModel<DescribeDBInstanceGTIDResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeDBInstanceGTID");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeDBInstanceGTIDResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 查询实例基本信息(实例 ID ,实例名称,是否开通加密 )
/// </summary>
/// <param name="req"><see cref="DescribeDBInstanceInfoRequest"/></param>
/// <returns><see cref="DescribeDBInstanceInfoResponse"/></returns>
public async Task<DescribeDBInstanceInfoResponse> DescribeDBInstanceInfo(DescribeDBInstanceInfoRequest req)
{
JsonResponseModel<DescribeDBInstanceInfoResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeDBInstanceInfo");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeDBInstanceInfoResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 查询实例基本信息(实例 ID ,实例名称,是否开通加密 )
/// </summary>
/// <param name="req"><see cref="DescribeDBInstanceInfoRequest"/></param>
/// <returns><see cref="DescribeDBInstanceInfoResponse"/></returns>
public DescribeDBInstanceInfoResponse DescribeDBInstanceInfoSync(DescribeDBInstanceInfoRequest req)
{
JsonResponseModel<DescribeDBInstanceInfoResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeDBInstanceInfo");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeDBInstanceInfoResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeDBInstanceRebootTime)用于查询云数据库实例重启预计所需的时间。
/// </summary>
/// <param name="req"><see cref="DescribeDBInstanceRebootTimeRequest"/></param>
/// <returns><see cref="DescribeDBInstanceRebootTimeResponse"/></returns>
public async Task<DescribeDBInstanceRebootTimeResponse> DescribeDBInstanceRebootTime(DescribeDBInstanceRebootTimeRequest req)
{
JsonResponseModel<DescribeDBInstanceRebootTimeResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeDBInstanceRebootTime");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeDBInstanceRebootTimeResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeDBInstanceRebootTime)用于查询云数据库实例重启预计所需的时间。
/// </summary>
/// <param name="req"><see cref="DescribeDBInstanceRebootTimeRequest"/></param>
/// <returns><see cref="DescribeDBInstanceRebootTimeResponse"/></returns>
public DescribeDBInstanceRebootTimeResponse DescribeDBInstanceRebootTimeSync(DescribeDBInstanceRebootTimeRequest req)
{
JsonResponseModel<DescribeDBInstanceRebootTimeResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeDBInstanceRebootTime");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeDBInstanceRebootTimeResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeDBInstances)用于查询云数据库实例列表,支持通过项目 ID、实例 ID、访问地址、实例状态等过滤条件来筛选实例。支持查询主实例、灾备实例和只读实例信息列表。
/// </summary>
/// <param name="req"><see cref="DescribeDBInstancesRequest"/></param>
/// <returns><see cref="DescribeDBInstancesResponse"/></returns>
public async Task<DescribeDBInstancesResponse> DescribeDBInstances(DescribeDBInstancesRequest req)
{
JsonResponseModel<DescribeDBInstancesResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeDBInstances");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeDBInstancesResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeDBInstances)用于查询云数据库实例列表,支持通过项目 ID、实例 ID、访问地址、实例状态等过滤条件来筛选实例。支持查询主实例、灾备实例和只读实例信息列表。
/// </summary>
/// <param name="req"><see cref="DescribeDBInstancesRequest"/></param>
/// <returns><see cref="DescribeDBInstancesResponse"/></returns>
public DescribeDBInstancesResponse DescribeDBInstancesSync(DescribeDBInstancesRequest req)
{
JsonResponseModel<DescribeDBInstancesResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeDBInstances");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeDBInstancesResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeDBPrice)用于查询云数据库实例的价格,支持查询按量计费或者包年包月的价格。可传入实例类型、购买时长、购买数量、内存大小、硬盘大小和可用区信息等来查询实例价格。
///
/// 注意:对某个地域进行询价,请使用对应地域的接入点,接入点信息请参照 <a href="https://cloud.tencent.com/document/api/236/15832">服务地址</a> 文档。例如:对广州地域进行询价,请把请求发到:cdb.ap-guangzhou.tencentcloudapi.com。同理对上海地域询价,把请求发到:cdb.ap-shanghai.tencentcloudapi.com。
/// </summary>
/// <param name="req"><see cref="DescribeDBPriceRequest"/></param>
/// <returns><see cref="DescribeDBPriceResponse"/></returns>
public async Task<DescribeDBPriceResponse> DescribeDBPrice(DescribeDBPriceRequest req)
{
JsonResponseModel<DescribeDBPriceResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeDBPrice");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeDBPriceResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeDBPrice)用于查询云数据库实例的价格,支持查询按量计费或者包年包月的价格。可传入实例类型、购买时长、购买数量、内存大小、硬盘大小和可用区信息等来查询实例价格。
///
/// 注意:对某个地域进行询价,请使用对应地域的接入点,接入点信息请参照 <a href="https://cloud.tencent.com/document/api/236/15832">服务地址</a> 文档。例如:对广州地域进行询价,请把请求发到:cdb.ap-guangzhou.tencentcloudapi.com。同理对上海地域询价,把请求发到:cdb.ap-shanghai.tencentcloudapi.com。
/// </summary>
/// <param name="req"><see cref="DescribeDBPriceRequest"/></param>
/// <returns><see cref="DescribeDBPriceResponse"/></returns>
public DescribeDBPriceResponse DescribeDBPriceSync(DescribeDBPriceRequest req)
{
JsonResponseModel<DescribeDBPriceResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeDBPrice");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeDBPriceResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeDBSecurityGroups)用于查询实例的安全组详情。
/// </summary>
/// <param name="req"><see cref="DescribeDBSecurityGroupsRequest"/></param>
/// <returns><see cref="DescribeDBSecurityGroupsResponse"/></returns>
public async Task<DescribeDBSecurityGroupsResponse> DescribeDBSecurityGroups(DescribeDBSecurityGroupsRequest req)
{
JsonResponseModel<DescribeDBSecurityGroupsResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeDBSecurityGroups");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeDBSecurityGroupsResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeDBSecurityGroups)用于查询实例的安全组详情。
/// </summary>
/// <param name="req"><see cref="DescribeDBSecurityGroupsRequest"/></param>
/// <returns><see cref="DescribeDBSecurityGroupsResponse"/></returns>
public DescribeDBSecurityGroupsResponse DescribeDBSecurityGroupsSync(DescribeDBSecurityGroupsRequest req)
{
JsonResponseModel<DescribeDBSecurityGroupsResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeDBSecurityGroups");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeDBSecurityGroupsResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeDBSwitchRecords)用于查询云数据库实例切换记录。
/// </summary>
/// <param name="req"><see cref="DescribeDBSwitchRecordsRequest"/></param>
/// <returns><see cref="DescribeDBSwitchRecordsResponse"/></returns>
public async Task<DescribeDBSwitchRecordsResponse> DescribeDBSwitchRecords(DescribeDBSwitchRecordsRequest req)
{
JsonResponseModel<DescribeDBSwitchRecordsResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeDBSwitchRecords");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeDBSwitchRecordsResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeDBSwitchRecords)用于查询云数据库实例切换记录。
/// </summary>
/// <param name="req"><see cref="DescribeDBSwitchRecordsRequest"/></param>
/// <returns><see cref="DescribeDBSwitchRecordsResponse"/></returns>
public DescribeDBSwitchRecordsResponse DescribeDBSwitchRecordsSync(DescribeDBSwitchRecordsRequest req)
{
JsonResponseModel<DescribeDBSwitchRecordsResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeDBSwitchRecords");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeDBSwitchRecordsResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeDBZoneConfig)用于查询可创建的云数据库各地域可售卖的规格配置。
/// </summary>
/// <param name="req"><see cref="DescribeDBZoneConfigRequest"/></param>
/// <returns><see cref="DescribeDBZoneConfigResponse"/></returns>
public async Task<DescribeDBZoneConfigResponse> DescribeDBZoneConfig(DescribeDBZoneConfigRequest req)
{
JsonResponseModel<DescribeDBZoneConfigResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeDBZoneConfig");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeDBZoneConfigResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeDBZoneConfig)用于查询可创建的云数据库各地域可售卖的规格配置。
/// </summary>
/// <param name="req"><see cref="DescribeDBZoneConfigRequest"/></param>
/// <returns><see cref="DescribeDBZoneConfigResponse"/></returns>
public DescribeDBZoneConfigResponse DescribeDBZoneConfigSync(DescribeDBZoneConfigRequest req)
{
JsonResponseModel<DescribeDBZoneConfigResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeDBZoneConfig");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeDBZoneConfigResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeDataBackupOverview)用于查询用户在当前地域总的数据备份概览。
/// </summary>
/// <param name="req"><see cref="DescribeDataBackupOverviewRequest"/></param>
/// <returns><see cref="DescribeDataBackupOverviewResponse"/></returns>
public async Task<DescribeDataBackupOverviewResponse> DescribeDataBackupOverview(DescribeDataBackupOverviewRequest req)
{
JsonResponseModel<DescribeDataBackupOverviewResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeDataBackupOverview");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeDataBackupOverviewResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeDataBackupOverview)用于查询用户在当前地域总的数据备份概览。
/// </summary>
/// <param name="req"><see cref="DescribeDataBackupOverviewRequest"/></param>
/// <returns><see cref="DescribeDataBackupOverviewResponse"/></returns>
public DescribeDataBackupOverviewResponse DescribeDataBackupOverviewSync(DescribeDataBackupOverviewRequest req)
{
JsonResponseModel<DescribeDataBackupOverviewResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeDataBackupOverview");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeDataBackupOverviewResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeDatabases)用于查询云数据库实例的数据库信息。
/// </summary>
/// <param name="req"><see cref="DescribeDatabasesRequest"/></param>
/// <returns><see cref="DescribeDatabasesResponse"/></returns>
public async Task<DescribeDatabasesResponse> DescribeDatabases(DescribeDatabasesRequest req)
{
JsonResponseModel<DescribeDatabasesResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeDatabases");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeDatabasesResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeDatabases)用于查询云数据库实例的数据库信息。
/// </summary>
/// <param name="req"><see cref="DescribeDatabasesRequest"/></param>
/// <returns><see cref="DescribeDatabasesResponse"/></returns>
public DescribeDatabasesResponse DescribeDatabasesSync(DescribeDatabasesRequest req)
{
JsonResponseModel<DescribeDatabasesResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeDatabases");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeDatabasesResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 该接口(DescribeDefaultParams)用于查询默认的可设置参数列表。
/// </summary>
/// <param name="req"><see cref="DescribeDefaultParamsRequest"/></param>
/// <returns><see cref="DescribeDefaultParamsResponse"/></returns>
public async Task<DescribeDefaultParamsResponse> DescribeDefaultParams(DescribeDefaultParamsRequest req)
{
JsonResponseModel<DescribeDefaultParamsResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeDefaultParams");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeDefaultParamsResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 该接口(DescribeDefaultParams)用于查询默认的可设置参数列表。
/// </summary>
/// <param name="req"><see cref="DescribeDefaultParamsRequest"/></param>
/// <returns><see cref="DescribeDefaultParamsResponse"/></returns>
public DescribeDefaultParamsResponse DescribeDefaultParamsSync(DescribeDefaultParamsRequest req)
{
JsonResponseModel<DescribeDefaultParamsResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeDefaultParams");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeDefaultParamsResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeDeployGroupList)用于查询用户的置放群组列表,可以指定置放群组 ID 或置放群组名称。
/// </summary>
/// <param name="req"><see cref="DescribeDeployGroupListRequest"/></param>
/// <returns><see cref="DescribeDeployGroupListResponse"/></returns>
public async Task<DescribeDeployGroupListResponse> DescribeDeployGroupList(DescribeDeployGroupListRequest req)
{
JsonResponseModel<DescribeDeployGroupListResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeDeployGroupList");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeDeployGroupListResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeDeployGroupList)用于查询用户的置放群组列表,可以指定置放群组 ID 或置放群组名称。
/// </summary>
/// <param name="req"><see cref="DescribeDeployGroupListRequest"/></param>
/// <returns><see cref="DescribeDeployGroupListResponse"/></returns>
public DescribeDeployGroupListResponse DescribeDeployGroupListSync(DescribeDeployGroupListRequest req)
{
JsonResponseModel<DescribeDeployGroupListResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeDeployGroupList");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeDeployGroupListResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeDeviceMonitorInfo)用于查询云数据库物理机当天的监控信息,暂只支持内存488G、硬盘6T的实例查询。
/// </summary>
/// <param name="req"><see cref="DescribeDeviceMonitorInfoRequest"/></param>
/// <returns><see cref="DescribeDeviceMonitorInfoResponse"/></returns>
public async Task<DescribeDeviceMonitorInfoResponse> DescribeDeviceMonitorInfo(DescribeDeviceMonitorInfoRequest req)
{
JsonResponseModel<DescribeDeviceMonitorInfoResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeDeviceMonitorInfo");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeDeviceMonitorInfoResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeDeviceMonitorInfo)用于查询云数据库物理机当天的监控信息,暂只支持内存488G、硬盘6T的实例查询。
/// </summary>
/// <param name="req"><see cref="DescribeDeviceMonitorInfoRequest"/></param>
/// <returns><see cref="DescribeDeviceMonitorInfoResponse"/></returns>
public DescribeDeviceMonitorInfoResponse DescribeDeviceMonitorInfoSync(DescribeDeviceMonitorInfoRequest req)
{
JsonResponseModel<DescribeDeviceMonitorInfoResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeDeviceMonitorInfo");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeDeviceMonitorInfoResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 根据检索条件查询实例错误日志详情。只能查询一个月之内的错误日志。
/// </summary>
/// <param name="req"><see cref="DescribeErrorLogDataRequest"/></param>
/// <returns><see cref="DescribeErrorLogDataResponse"/></returns>
public async Task<DescribeErrorLogDataResponse> DescribeErrorLogData(DescribeErrorLogDataRequest req)
{
JsonResponseModel<DescribeErrorLogDataResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeErrorLogData");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeErrorLogDataResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 根据检索条件查询实例错误日志详情。只能查询一个月之内的错误日志。
/// </summary>
/// <param name="req"><see cref="DescribeErrorLogDataRequest"/></param>
/// <returns><see cref="DescribeErrorLogDataResponse"/></returns>
public DescribeErrorLogDataResponse DescribeErrorLogDataSync(DescribeErrorLogDataRequest req)
{
JsonResponseModel<DescribeErrorLogDataResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeErrorLogData");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeErrorLogDataResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 该接口(DescribeInstanceParamRecords)用于查询实例参数修改历史。
/// </summary>
/// <param name="req"><see cref="DescribeInstanceParamRecordsRequest"/></param>
/// <returns><see cref="DescribeInstanceParamRecordsResponse"/></returns>
public async Task<DescribeInstanceParamRecordsResponse> DescribeInstanceParamRecords(DescribeInstanceParamRecordsRequest req)
{
JsonResponseModel<DescribeInstanceParamRecordsResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeInstanceParamRecords");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeInstanceParamRecordsResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 该接口(DescribeInstanceParamRecords)用于查询实例参数修改历史。
/// </summary>
/// <param name="req"><see cref="DescribeInstanceParamRecordsRequest"/></param>
/// <returns><see cref="DescribeInstanceParamRecordsResponse"/></returns>
public DescribeInstanceParamRecordsResponse DescribeInstanceParamRecordsSync(DescribeInstanceParamRecordsRequest req)
{
JsonResponseModel<DescribeInstanceParamRecordsResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeInstanceParamRecords");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeInstanceParamRecordsResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 该接口(DescribeInstanceParams)用于查询实例的参数列表。
/// </summary>
/// <param name="req"><see cref="DescribeInstanceParamsRequest"/></param>
/// <returns><see cref="DescribeInstanceParamsResponse"/></returns>
public async Task<DescribeInstanceParamsResponse> DescribeInstanceParams(DescribeInstanceParamsRequest req)
{
JsonResponseModel<DescribeInstanceParamsResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeInstanceParams");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeInstanceParamsResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 该接口(DescribeInstanceParams)用于查询实例的参数列表。
/// </summary>
/// <param name="req"><see cref="DescribeInstanceParamsRequest"/></param>
/// <returns><see cref="DescribeInstanceParamsResponse"/></returns>
public DescribeInstanceParamsResponse DescribeInstanceParamsSync(DescribeInstanceParamsRequest req)
{
JsonResponseModel<DescribeInstanceParamsResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeInstanceParams");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeInstanceParamsResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 该接口(DescribeParamTemplateInfo)用于查询参数模板详情。
/// </summary>
/// <param name="req"><see cref="DescribeParamTemplateInfoRequest"/></param>
/// <returns><see cref="DescribeParamTemplateInfoResponse"/></returns>
public async Task<DescribeParamTemplateInfoResponse> DescribeParamTemplateInfo(DescribeParamTemplateInfoRequest req)
{
JsonResponseModel<DescribeParamTemplateInfoResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeParamTemplateInfo");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeParamTemplateInfoResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 该接口(DescribeParamTemplateInfo)用于查询参数模板详情。
/// </summary>
/// <param name="req"><see cref="DescribeParamTemplateInfoRequest"/></param>
/// <returns><see cref="DescribeParamTemplateInfoResponse"/></returns>
public DescribeParamTemplateInfoResponse DescribeParamTemplateInfoSync(DescribeParamTemplateInfoRequest req)
{
JsonResponseModel<DescribeParamTemplateInfoResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeParamTemplateInfo");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeParamTemplateInfoResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 该接口(DescribeParamTemplates)查询参数模板列表。
/// </summary>
/// <param name="req"><see cref="DescribeParamTemplatesRequest"/></param>
/// <returns><see cref="DescribeParamTemplatesResponse"/></returns>
public async Task<DescribeParamTemplatesResponse> DescribeParamTemplates(DescribeParamTemplatesRequest req)
{
JsonResponseModel<DescribeParamTemplatesResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeParamTemplates");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeParamTemplatesResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 该接口(DescribeParamTemplates)查询参数模板列表。
/// </summary>
/// <param name="req"><see cref="DescribeParamTemplatesRequest"/></param>
/// <returns><see cref="DescribeParamTemplatesResponse"/></returns>
public DescribeParamTemplatesResponse DescribeParamTemplatesSync(DescribeParamTemplatesRequest req)
{
JsonResponseModel<DescribeParamTemplatesResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeParamTemplates");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeParamTemplatesResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeProjectSecurityGroups)用于查询项目的安全组详情。
/// </summary>
/// <param name="req"><see cref="DescribeProjectSecurityGroupsRequest"/></param>
/// <returns><see cref="DescribeProjectSecurityGroupsResponse"/></returns>
public async Task<DescribeProjectSecurityGroupsResponse> DescribeProjectSecurityGroups(DescribeProjectSecurityGroupsRequest req)
{
JsonResponseModel<DescribeProjectSecurityGroupsResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeProjectSecurityGroups");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeProjectSecurityGroupsResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeProjectSecurityGroups)用于查询项目的安全组详情。
/// </summary>
/// <param name="req"><see cref="DescribeProjectSecurityGroupsRequest"/></param>
/// <returns><see cref="DescribeProjectSecurityGroupsResponse"/></returns>
public DescribeProjectSecurityGroupsResponse DescribeProjectSecurityGroupsSync(DescribeProjectSecurityGroupsRequest req)
{
JsonResponseModel<DescribeProjectSecurityGroupsResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeProjectSecurityGroups");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeProjectSecurityGroupsResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeRoGroups)用于查询云数据库实例的所有的RO组的信息。
/// </summary>
/// <param name="req"><see cref="DescribeRoGroupsRequest"/></param>
/// <returns><see cref="DescribeRoGroupsResponse"/></returns>
public async Task<DescribeRoGroupsResponse> DescribeRoGroups(DescribeRoGroupsRequest req)
{
JsonResponseModel<DescribeRoGroupsResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeRoGroups");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeRoGroupsResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeRoGroups)用于查询云数据库实例的所有的RO组的信息。
/// </summary>
/// <param name="req"><see cref="DescribeRoGroupsRequest"/></param>
/// <returns><see cref="DescribeRoGroupsResponse"/></returns>
public DescribeRoGroupsResponse DescribeRoGroupsSync(DescribeRoGroupsRequest req)
{
JsonResponseModel<DescribeRoGroupsResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeRoGroups");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeRoGroupsResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeRollbackRangeTime)用于查询云数据库实例可回档的时间范围。
/// </summary>
/// <param name="req"><see cref="DescribeRollbackRangeTimeRequest"/></param>
/// <returns><see cref="DescribeRollbackRangeTimeResponse"/></returns>
public async Task<DescribeRollbackRangeTimeResponse> DescribeRollbackRangeTime(DescribeRollbackRangeTimeRequest req)
{
JsonResponseModel<DescribeRollbackRangeTimeResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeRollbackRangeTime");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeRollbackRangeTimeResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeRollbackRangeTime)用于查询云数据库实例可回档的时间范围。
/// </summary>
/// <param name="req"><see cref="DescribeRollbackRangeTimeRequest"/></param>
/// <returns><see cref="DescribeRollbackRangeTimeResponse"/></returns>
public DescribeRollbackRangeTimeResponse DescribeRollbackRangeTimeSync(DescribeRollbackRangeTimeRequest req)
{
JsonResponseModel<DescribeRollbackRangeTimeResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeRollbackRangeTime");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeRollbackRangeTimeResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeRollbackTaskDetail)用于查询云数据库实例回档任务详情。
/// </summary>
/// <param name="req"><see cref="DescribeRollbackTaskDetailRequest"/></param>
/// <returns><see cref="DescribeRollbackTaskDetailResponse"/></returns>
public async Task<DescribeRollbackTaskDetailResponse> DescribeRollbackTaskDetail(DescribeRollbackTaskDetailRequest req)
{
JsonResponseModel<DescribeRollbackTaskDetailResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeRollbackTaskDetail");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeRollbackTaskDetailResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeRollbackTaskDetail)用于查询云数据库实例回档任务详情。
/// </summary>
/// <param name="req"><see cref="DescribeRollbackTaskDetailRequest"/></param>
/// <returns><see cref="DescribeRollbackTaskDetailResponse"/></returns>
public DescribeRollbackTaskDetailResponse DescribeRollbackTaskDetailSync(DescribeRollbackTaskDetailRequest req)
{
JsonResponseModel<DescribeRollbackTaskDetailResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeRollbackTaskDetail");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeRollbackTaskDetailResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 条件检索实例的慢日志。只允许查看一个月之内的慢日志
/// </summary>
/// <param name="req"><see cref="DescribeSlowLogDataRequest"/></param>
/// <returns><see cref="DescribeSlowLogDataResponse"/></returns>
public async Task<DescribeSlowLogDataResponse> DescribeSlowLogData(DescribeSlowLogDataRequest req)
{
JsonResponseModel<DescribeSlowLogDataResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeSlowLogData");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeSlowLogDataResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 条件检索实例的慢日志。只允许查看一个月之内的慢日志
/// </summary>
/// <param name="req"><see cref="DescribeSlowLogDataRequest"/></param>
/// <returns><see cref="DescribeSlowLogDataResponse"/></returns>
public DescribeSlowLogDataResponse DescribeSlowLogDataSync(DescribeSlowLogDataRequest req)
{
JsonResponseModel<DescribeSlowLogDataResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeSlowLogData");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeSlowLogDataResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeSlowLogs)用于获取云数据库实例的慢查询日志。
/// </summary>
/// <param name="req"><see cref="DescribeSlowLogsRequest"/></param>
/// <returns><see cref="DescribeSlowLogsResponse"/></returns>
public async Task<DescribeSlowLogsResponse> DescribeSlowLogs(DescribeSlowLogsRequest req)
{
JsonResponseModel<DescribeSlowLogsResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeSlowLogs");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeSlowLogsResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeSlowLogs)用于获取云数据库实例的慢查询日志。
/// </summary>
/// <param name="req"><see cref="DescribeSlowLogsRequest"/></param>
/// <returns><see cref="DescribeSlowLogsResponse"/></returns>
public DescribeSlowLogsResponse DescribeSlowLogsSync(DescribeSlowLogsRequest req)
{
JsonResponseModel<DescribeSlowLogsResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeSlowLogs");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeSlowLogsResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeSupportedPrivileges)用于查询云数据库的支持的权限信息,包括全局权限,数据库权限,表权限以及列权限。
/// </summary>
/// <param name="req"><see cref="DescribeSupportedPrivilegesRequest"/></param>
/// <returns><see cref="DescribeSupportedPrivilegesResponse"/></returns>
public async Task<DescribeSupportedPrivilegesResponse> DescribeSupportedPrivileges(DescribeSupportedPrivilegesRequest req)
{
JsonResponseModel<DescribeSupportedPrivilegesResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeSupportedPrivileges");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeSupportedPrivilegesResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeSupportedPrivileges)用于查询云数据库的支持的权限信息,包括全局权限,数据库权限,表权限以及列权限。
/// </summary>
/// <param name="req"><see cref="DescribeSupportedPrivilegesRequest"/></param>
/// <returns><see cref="DescribeSupportedPrivilegesResponse"/></returns>
public DescribeSupportedPrivilegesResponse DescribeSupportedPrivilegesSync(DescribeSupportedPrivilegesRequest req)
{
JsonResponseModel<DescribeSupportedPrivilegesResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeSupportedPrivileges");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeSupportedPrivilegesResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeTables)用于查询云数据库实例的数据库表信息。
/// </summary>
/// <param name="req"><see cref="DescribeTablesRequest"/></param>
/// <returns><see cref="DescribeTablesResponse"/></returns>
public async Task<DescribeTablesResponse> DescribeTables(DescribeTablesRequest req)
{
JsonResponseModel<DescribeTablesResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeTables");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeTablesResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeTables)用于查询云数据库实例的数据库表信息。
/// </summary>
/// <param name="req"><see cref="DescribeTablesRequest"/></param>
/// <returns><see cref="DescribeTablesResponse"/></returns>
public DescribeTablesResponse DescribeTablesSync(DescribeTablesRequest req)
{
JsonResponseModel<DescribeTablesResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeTables");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeTablesResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeTagsOfInstanceIds)用于获取云数据库实例的标签信息。
/// </summary>
/// <param name="req"><see cref="DescribeTagsOfInstanceIdsRequest"/></param>
/// <returns><see cref="DescribeTagsOfInstanceIdsResponse"/></returns>
public async Task<DescribeTagsOfInstanceIdsResponse> DescribeTagsOfInstanceIds(DescribeTagsOfInstanceIdsRequest req)
{
JsonResponseModel<DescribeTagsOfInstanceIdsResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeTagsOfInstanceIds");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeTagsOfInstanceIdsResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeTagsOfInstanceIds)用于获取云数据库实例的标签信息。
/// </summary>
/// <param name="req"><see cref="DescribeTagsOfInstanceIdsRequest"/></param>
/// <returns><see cref="DescribeTagsOfInstanceIdsResponse"/></returns>
public DescribeTagsOfInstanceIdsResponse DescribeTagsOfInstanceIdsSync(DescribeTagsOfInstanceIdsRequest req)
{
JsonResponseModel<DescribeTagsOfInstanceIdsResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeTagsOfInstanceIds");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeTagsOfInstanceIdsResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeTasks)用于查询云数据库实例任务列表。
/// </summary>
/// <param name="req"><see cref="DescribeTasksRequest"/></param>
/// <returns><see cref="DescribeTasksResponse"/></returns>
public async Task<DescribeTasksResponse> DescribeTasks(DescribeTasksRequest req)
{
JsonResponseModel<DescribeTasksResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeTasks");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeTasksResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeTasks)用于查询云数据库实例任务列表。
/// </summary>
/// <param name="req"><see cref="DescribeTasksRequest"/></param>
/// <returns><see cref="DescribeTasksResponse"/></returns>
public DescribeTasksResponse DescribeTasksSync(DescribeTasksRequest req)
{
JsonResponseModel<DescribeTasksResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeTasks");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeTasksResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeTimeWindow)用于查询云数据库实例的维护时间窗口。
/// </summary>
/// <param name="req"><see cref="DescribeTimeWindowRequest"/></param>
/// <returns><see cref="DescribeTimeWindowResponse"/></returns>
public async Task<DescribeTimeWindowResponse> DescribeTimeWindow(DescribeTimeWindowRequest req)
{
JsonResponseModel<DescribeTimeWindowResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeTimeWindow");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeTimeWindowResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeTimeWindow)用于查询云数据库实例的维护时间窗口。
/// </summary>
/// <param name="req"><see cref="DescribeTimeWindowRequest"/></param>
/// <returns><see cref="DescribeTimeWindowResponse"/></returns>
public DescribeTimeWindowResponse DescribeTimeWindowSync(DescribeTimeWindowRequest req)
{
JsonResponseModel<DescribeTimeWindowResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeTimeWindow");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeTimeWindowResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeUploadedFiles)用于查询用户导入的SQL文件列表。
/// </summary>
/// <param name="req"><see cref="DescribeUploadedFilesRequest"/></param>
/// <returns><see cref="DescribeUploadedFilesResponse"/></returns>
public async Task<DescribeUploadedFilesResponse> DescribeUploadedFiles(DescribeUploadedFilesRequest req)
{
JsonResponseModel<DescribeUploadedFilesResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeUploadedFiles");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeUploadedFilesResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DescribeUploadedFiles)用于查询用户导入的SQL文件列表。
/// </summary>
/// <param name="req"><see cref="DescribeUploadedFilesRequest"/></param>
/// <returns><see cref="DescribeUploadedFilesResponse"/></returns>
public DescribeUploadedFilesResponse DescribeUploadedFilesSync(DescribeUploadedFilesRequest req)
{
JsonResponseModel<DescribeUploadedFilesResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeUploadedFiles");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeUploadedFilesResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DisassociateSecurityGroups)用于安全组批量解绑实例。
/// </summary>
/// <param name="req"><see cref="DisassociateSecurityGroupsRequest"/></param>
/// <returns><see cref="DisassociateSecurityGroupsResponse"/></returns>
public async Task<DisassociateSecurityGroupsResponse> DisassociateSecurityGroups(DisassociateSecurityGroupsRequest req)
{
JsonResponseModel<DisassociateSecurityGroupsResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DisassociateSecurityGroups");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DisassociateSecurityGroupsResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(DisassociateSecurityGroups)用于安全组批量解绑实例。
/// </summary>
/// <param name="req"><see cref="DisassociateSecurityGroupsRequest"/></param>
/// <returns><see cref="DisassociateSecurityGroupsResponse"/></returns>
public DisassociateSecurityGroupsResponse DisassociateSecurityGroupsSync(DisassociateSecurityGroupsRequest req)
{
JsonResponseModel<DisassociateSecurityGroupsResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DisassociateSecurityGroups");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DisassociateSecurityGroupsResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(InitDBInstances)用于初始化云数据库实例,包括初始化密码、默认字符集、实例端口号等
/// </summary>
/// <param name="req"><see cref="InitDBInstancesRequest"/></param>
/// <returns><see cref="InitDBInstancesResponse"/></returns>
public async Task<InitDBInstancesResponse> InitDBInstances(InitDBInstancesRequest req)
{
JsonResponseModel<InitDBInstancesResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "InitDBInstances");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<InitDBInstancesResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(InitDBInstances)用于初始化云数据库实例,包括初始化密码、默认字符集、实例端口号等
/// </summary>
/// <param name="req"><see cref="InitDBInstancesRequest"/></param>
/// <returns><see cref="InitDBInstancesResponse"/></returns>
public InitDBInstancesResponse InitDBInstancesSync(InitDBInstancesRequest req)
{
JsonResponseModel<InitDBInstancesResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "InitDBInstances");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<InitDBInstancesResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(InquiryPriceUpgradeInstances)用于查询云数据库实例升级的价格,支持查询按量计费或者包年包月实例的升级价格,实例类型支持主实例、灾备实例和只读实例。
/// </summary>
/// <param name="req"><see cref="InquiryPriceUpgradeInstancesRequest"/></param>
/// <returns><see cref="InquiryPriceUpgradeInstancesResponse"/></returns>
public async Task<InquiryPriceUpgradeInstancesResponse> InquiryPriceUpgradeInstances(InquiryPriceUpgradeInstancesRequest req)
{
JsonResponseModel<InquiryPriceUpgradeInstancesResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "InquiryPriceUpgradeInstances");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<InquiryPriceUpgradeInstancesResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(InquiryPriceUpgradeInstances)用于查询云数据库实例升级的价格,支持查询按量计费或者包年包月实例的升级价格,实例类型支持主实例、灾备实例和只读实例。
/// </summary>
/// <param name="req"><see cref="InquiryPriceUpgradeInstancesRequest"/></param>
/// <returns><see cref="InquiryPriceUpgradeInstancesResponse"/></returns>
public InquiryPriceUpgradeInstancesResponse InquiryPriceUpgradeInstancesSync(InquiryPriceUpgradeInstancesRequest req)
{
JsonResponseModel<InquiryPriceUpgradeInstancesResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "InquiryPriceUpgradeInstances");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<InquiryPriceUpgradeInstancesResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(IsolateDBInstance)用于隔离云数据库实例,隔离后不能通过IP和端口访问数据库。隔离的实例可在回收站中进行开机。若为欠费隔离,请尽快进行充值。
/// </summary>
/// <param name="req"><see cref="IsolateDBInstanceRequest"/></param>
/// <returns><see cref="IsolateDBInstanceResponse"/></returns>
public async Task<IsolateDBInstanceResponse> IsolateDBInstance(IsolateDBInstanceRequest req)
{
JsonResponseModel<IsolateDBInstanceResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "IsolateDBInstance");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<IsolateDBInstanceResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(IsolateDBInstance)用于隔离云数据库实例,隔离后不能通过IP和端口访问数据库。隔离的实例可在回收站中进行开机。若为欠费隔离,请尽快进行充值。
/// </summary>
/// <param name="req"><see cref="IsolateDBInstanceRequest"/></param>
/// <returns><see cref="IsolateDBInstanceResponse"/></returns>
public IsolateDBInstanceResponse IsolateDBInstanceSync(IsolateDBInstanceRequest req)
{
JsonResponseModel<IsolateDBInstanceResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "IsolateDBInstance");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<IsolateDBInstanceResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(ModifyAccountDescription)用于修改云数据库账户的备注信息。
/// </summary>
/// <param name="req"><see cref="ModifyAccountDescriptionRequest"/></param>
/// <returns><see cref="ModifyAccountDescriptionResponse"/></returns>
public async Task<ModifyAccountDescriptionResponse> ModifyAccountDescription(ModifyAccountDescriptionRequest req)
{
JsonResponseModel<ModifyAccountDescriptionResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "ModifyAccountDescription");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<ModifyAccountDescriptionResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(ModifyAccountDescription)用于修改云数据库账户的备注信息。
/// </summary>
/// <param name="req"><see cref="ModifyAccountDescriptionRequest"/></param>
/// <returns><see cref="ModifyAccountDescriptionResponse"/></returns>
public ModifyAccountDescriptionResponse ModifyAccountDescriptionSync(ModifyAccountDescriptionRequest req)
{
JsonResponseModel<ModifyAccountDescriptionResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "ModifyAccountDescription");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<ModifyAccountDescriptionResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(ModifyAccountPassword)用于修改云数据库账户的密码。
/// </summary>
/// <param name="req"><see cref="ModifyAccountPasswordRequest"/></param>
/// <returns><see cref="ModifyAccountPasswordResponse"/></returns>
public async Task<ModifyAccountPasswordResponse> ModifyAccountPassword(ModifyAccountPasswordRequest req)
{
JsonResponseModel<ModifyAccountPasswordResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "ModifyAccountPassword");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<ModifyAccountPasswordResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(ModifyAccountPassword)用于修改云数据库账户的密码。
/// </summary>
/// <param name="req"><see cref="ModifyAccountPasswordRequest"/></param>
/// <returns><see cref="ModifyAccountPasswordResponse"/></returns>
public ModifyAccountPasswordResponse ModifyAccountPasswordSync(ModifyAccountPasswordRequest req)
{
JsonResponseModel<ModifyAccountPasswordResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "ModifyAccountPassword");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<ModifyAccountPasswordResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(ModifyAccountPrivileges)用于修改云数据库的账户的权限信息。
///
/// 注意,修改账号权限时,需要传入该账号下的全量权限信息。用户可以先通过 [查询云数据库账户的权限信息
/// ](https://cloud.tencent.com/document/api/236/17500) 查询该账号下的全量权限信息,然后进行权限修改。
/// </summary>
/// <param name="req"><see cref="ModifyAccountPrivilegesRequest"/></param>
/// <returns><see cref="ModifyAccountPrivilegesResponse"/></returns>
public async Task<ModifyAccountPrivilegesResponse> ModifyAccountPrivileges(ModifyAccountPrivilegesRequest req)
{
JsonResponseModel<ModifyAccountPrivilegesResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "ModifyAccountPrivileges");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<ModifyAccountPrivilegesResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(ModifyAccountPrivileges)用于修改云数据库的账户的权限信息。
///
/// 注意,修改账号权限时,需要传入该账号下的全量权限信息。用户可以先通过 [查询云数据库账户的权限信息
/// ](https://cloud.tencent.com/document/api/236/17500) 查询该账号下的全量权限信息,然后进行权限修改。
/// </summary>
/// <param name="req"><see cref="ModifyAccountPrivilegesRequest"/></param>
/// <returns><see cref="ModifyAccountPrivilegesResponse"/></returns>
public ModifyAccountPrivilegesResponse ModifyAccountPrivilegesSync(ModifyAccountPrivilegesRequest req)
{
JsonResponseModel<ModifyAccountPrivilegesResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "ModifyAccountPrivileges");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<ModifyAccountPrivilegesResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(ModifyAutoRenewFlag)用于修改云数据库实例的自动续费标记。仅支持包年包月的实例设置自动续费标记。
/// </summary>
/// <param name="req"><see cref="ModifyAutoRenewFlagRequest"/></param>
/// <returns><see cref="ModifyAutoRenewFlagResponse"/></returns>
public async Task<ModifyAutoRenewFlagResponse> ModifyAutoRenewFlag(ModifyAutoRenewFlagRequest req)
{
JsonResponseModel<ModifyAutoRenewFlagResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "ModifyAutoRenewFlag");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<ModifyAutoRenewFlagResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(ModifyAutoRenewFlag)用于修改云数据库实例的自动续费标记。仅支持包年包月的实例设置自动续费标记。
/// </summary>
/// <param name="req"><see cref="ModifyAutoRenewFlagRequest"/></param>
/// <returns><see cref="ModifyAutoRenewFlagResponse"/></returns>
public ModifyAutoRenewFlagResponse ModifyAutoRenewFlagSync(ModifyAutoRenewFlagRequest req)
{
JsonResponseModel<ModifyAutoRenewFlagResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "ModifyAutoRenewFlag");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<ModifyAutoRenewFlagResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(ModifyBackupConfig)用于修改数据库备份配置信息。
/// </summary>
/// <param name="req"><see cref="ModifyBackupConfigRequest"/></param>
/// <returns><see cref="ModifyBackupConfigResponse"/></returns>
public async Task<ModifyBackupConfigResponse> ModifyBackupConfig(ModifyBackupConfigRequest req)
{
JsonResponseModel<ModifyBackupConfigResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "ModifyBackupConfig");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<ModifyBackupConfigResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(ModifyBackupConfig)用于修改数据库备份配置信息。
/// </summary>
/// <param name="req"><see cref="ModifyBackupConfigRequest"/></param>
/// <returns><see cref="ModifyBackupConfigResponse"/></returns>
public ModifyBackupConfigResponse ModifyBackupConfigSync(ModifyBackupConfigRequest req)
{
JsonResponseModel<ModifyBackupConfigResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "ModifyBackupConfig");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<ModifyBackupConfigResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(ModifyDBInstanceName)用于修改云数据库实例的名称。
/// </summary>
/// <param name="req"><see cref="ModifyDBInstanceNameRequest"/></param>
/// <returns><see cref="ModifyDBInstanceNameResponse"/></returns>
public async Task<ModifyDBInstanceNameResponse> ModifyDBInstanceName(ModifyDBInstanceNameRequest req)
{
JsonResponseModel<ModifyDBInstanceNameResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "ModifyDBInstanceName");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<ModifyDBInstanceNameResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(ModifyDBInstanceName)用于修改云数据库实例的名称。
/// </summary>
/// <param name="req"><see cref="ModifyDBInstanceNameRequest"/></param>
/// <returns><see cref="ModifyDBInstanceNameResponse"/></returns>
public ModifyDBInstanceNameResponse ModifyDBInstanceNameSync(ModifyDBInstanceNameRequest req)
{
JsonResponseModel<ModifyDBInstanceNameResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "ModifyDBInstanceName");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<ModifyDBInstanceNameResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(ModifyDBInstanceProject)用于修改云数据库实例的所属项目。
/// </summary>
/// <param name="req"><see cref="ModifyDBInstanceProjectRequest"/></param>
/// <returns><see cref="ModifyDBInstanceProjectResponse"/></returns>
public async Task<ModifyDBInstanceProjectResponse> ModifyDBInstanceProject(ModifyDBInstanceProjectRequest req)
{
JsonResponseModel<ModifyDBInstanceProjectResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "ModifyDBInstanceProject");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<ModifyDBInstanceProjectResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(ModifyDBInstanceProject)用于修改云数据库实例的所属项目。
/// </summary>
/// <param name="req"><see cref="ModifyDBInstanceProjectRequest"/></param>
/// <returns><see cref="ModifyDBInstanceProjectResponse"/></returns>
public ModifyDBInstanceProjectResponse ModifyDBInstanceProjectSync(ModifyDBInstanceProjectRequest req)
{
JsonResponseModel<ModifyDBInstanceProjectResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "ModifyDBInstanceProject");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<ModifyDBInstanceProjectResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(ModifyDBInstanceSecurityGroups)用于修改实例绑定的安全组。
/// </summary>
/// <param name="req"><see cref="ModifyDBInstanceSecurityGroupsRequest"/></param>
/// <returns><see cref="ModifyDBInstanceSecurityGroupsResponse"/></returns>
public async Task<ModifyDBInstanceSecurityGroupsResponse> ModifyDBInstanceSecurityGroups(ModifyDBInstanceSecurityGroupsRequest req)
{
JsonResponseModel<ModifyDBInstanceSecurityGroupsResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "ModifyDBInstanceSecurityGroups");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<ModifyDBInstanceSecurityGroupsResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(ModifyDBInstanceSecurityGroups)用于修改实例绑定的安全组。
/// </summary>
/// <param name="req"><see cref="ModifyDBInstanceSecurityGroupsRequest"/></param>
/// <returns><see cref="ModifyDBInstanceSecurityGroupsResponse"/></returns>
public ModifyDBInstanceSecurityGroupsResponse ModifyDBInstanceSecurityGroupsSync(ModifyDBInstanceSecurityGroupsRequest req)
{
JsonResponseModel<ModifyDBInstanceSecurityGroupsResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "ModifyDBInstanceSecurityGroups");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<ModifyDBInstanceSecurityGroupsResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(ModifyDBInstanceVipVport)用于修改云数据库实例的IP和端口号,也可进行基础网络转 VPC 网络和 VPC 网络下的子网变更。
/// </summary>
/// <param name="req"><see cref="ModifyDBInstanceVipVportRequest"/></param>
/// <returns><see cref="ModifyDBInstanceVipVportResponse"/></returns>
public async Task<ModifyDBInstanceVipVportResponse> ModifyDBInstanceVipVport(ModifyDBInstanceVipVportRequest req)
{
JsonResponseModel<ModifyDBInstanceVipVportResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "ModifyDBInstanceVipVport");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<ModifyDBInstanceVipVportResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(ModifyDBInstanceVipVport)用于修改云数据库实例的IP和端口号,也可进行基础网络转 VPC 网络和 VPC 网络下的子网变更。
/// </summary>
/// <param name="req"><see cref="ModifyDBInstanceVipVportRequest"/></param>
/// <returns><see cref="ModifyDBInstanceVipVportResponse"/></returns>
public ModifyDBInstanceVipVportResponse ModifyDBInstanceVipVportSync(ModifyDBInstanceVipVportRequest req)
{
JsonResponseModel<ModifyDBInstanceVipVportResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "ModifyDBInstanceVipVport");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<ModifyDBInstanceVipVportResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(ModifyInstanceParam)用于修改云数据库实例的参数。
/// </summary>
/// <param name="req"><see cref="ModifyInstanceParamRequest"/></param>
/// <returns><see cref="ModifyInstanceParamResponse"/></returns>
public async Task<ModifyInstanceParamResponse> ModifyInstanceParam(ModifyInstanceParamRequest req)
{
JsonResponseModel<ModifyInstanceParamResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "ModifyInstanceParam");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<ModifyInstanceParamResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(ModifyInstanceParam)用于修改云数据库实例的参数。
/// </summary>
/// <param name="req"><see cref="ModifyInstanceParamRequest"/></param>
/// <returns><see cref="ModifyInstanceParamResponse"/></returns>
public ModifyInstanceParamResponse ModifyInstanceParamSync(ModifyInstanceParamRequest req)
{
JsonResponseModel<ModifyInstanceParamResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "ModifyInstanceParam");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<ModifyInstanceParamResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(ModifyInstanceTag)用于对实例标签进行添加、修改或者删除。
/// </summary>
/// <param name="req"><see cref="ModifyInstanceTagRequest"/></param>
/// <returns><see cref="ModifyInstanceTagResponse"/></returns>
public async Task<ModifyInstanceTagResponse> ModifyInstanceTag(ModifyInstanceTagRequest req)
{
JsonResponseModel<ModifyInstanceTagResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "ModifyInstanceTag");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<ModifyInstanceTagResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(ModifyInstanceTag)用于对实例标签进行添加、修改或者删除。
/// </summary>
/// <param name="req"><see cref="ModifyInstanceTagRequest"/></param>
/// <returns><see cref="ModifyInstanceTagResponse"/></returns>
public ModifyInstanceTagResponse ModifyInstanceTagSync(ModifyInstanceTagRequest req)
{
JsonResponseModel<ModifyInstanceTagResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "ModifyInstanceTag");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<ModifyInstanceTagResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 修改置放群组的名称或者描述
/// </summary>
/// <param name="req"><see cref="ModifyNameOrDescByDpIdRequest"/></param>
/// <returns><see cref="ModifyNameOrDescByDpIdResponse"/></returns>
public async Task<ModifyNameOrDescByDpIdResponse> ModifyNameOrDescByDpId(ModifyNameOrDescByDpIdRequest req)
{
JsonResponseModel<ModifyNameOrDescByDpIdResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "ModifyNameOrDescByDpId");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<ModifyNameOrDescByDpIdResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 修改置放群组的名称或者描述
/// </summary>
/// <param name="req"><see cref="ModifyNameOrDescByDpIdRequest"/></param>
/// <returns><see cref="ModifyNameOrDescByDpIdResponse"/></returns>
public ModifyNameOrDescByDpIdResponse ModifyNameOrDescByDpIdSync(ModifyNameOrDescByDpIdRequest req)
{
JsonResponseModel<ModifyNameOrDescByDpIdResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "ModifyNameOrDescByDpId");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<ModifyNameOrDescByDpIdResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 该接口(ModifyParamTemplate)用于修改参数模板。
/// </summary>
/// <param name="req"><see cref="ModifyParamTemplateRequest"/></param>
/// <returns><see cref="ModifyParamTemplateResponse"/></returns>
public async Task<ModifyParamTemplateResponse> ModifyParamTemplate(ModifyParamTemplateRequest req)
{
JsonResponseModel<ModifyParamTemplateResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "ModifyParamTemplate");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<ModifyParamTemplateResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 该接口(ModifyParamTemplate)用于修改参数模板。
/// </summary>
/// <param name="req"><see cref="ModifyParamTemplateRequest"/></param>
/// <returns><see cref="ModifyParamTemplateResponse"/></returns>
public ModifyParamTemplateResponse ModifyParamTemplateSync(ModifyParamTemplateRequest req)
{
JsonResponseModel<ModifyParamTemplateResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "ModifyParamTemplate");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<ModifyParamTemplateResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(ModifyRoGroupInfo)用于更新云数据库只读组的信息。包括设置实例延迟超限剔除策略,设置只读实例读权重等。
/// </summary>
/// <param name="req"><see cref="ModifyRoGroupInfoRequest"/></param>
/// <returns><see cref="ModifyRoGroupInfoResponse"/></returns>
public async Task<ModifyRoGroupInfoResponse> ModifyRoGroupInfo(ModifyRoGroupInfoRequest req)
{
JsonResponseModel<ModifyRoGroupInfoResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "ModifyRoGroupInfo");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<ModifyRoGroupInfoResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(ModifyRoGroupInfo)用于更新云数据库只读组的信息。包括设置实例延迟超限剔除策略,设置只读实例读权重等。
/// </summary>
/// <param name="req"><see cref="ModifyRoGroupInfoRequest"/></param>
/// <returns><see cref="ModifyRoGroupInfoResponse"/></returns>
public ModifyRoGroupInfoResponse ModifyRoGroupInfoSync(ModifyRoGroupInfoRequest req)
{
JsonResponseModel<ModifyRoGroupInfoResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "ModifyRoGroupInfo");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<ModifyRoGroupInfoResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(ModifyTimeWindow)用于更新云数据库实例的维护时间窗口。
/// </summary>
/// <param name="req"><see cref="ModifyTimeWindowRequest"/></param>
/// <returns><see cref="ModifyTimeWindowResponse"/></returns>
public async Task<ModifyTimeWindowResponse> ModifyTimeWindow(ModifyTimeWindowRequest req)
{
JsonResponseModel<ModifyTimeWindowResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "ModifyTimeWindow");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<ModifyTimeWindowResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(ModifyTimeWindow)用于更新云数据库实例的维护时间窗口。
/// </summary>
/// <param name="req"><see cref="ModifyTimeWindowRequest"/></param>
/// <returns><see cref="ModifyTimeWindowResponse"/></returns>
public ModifyTimeWindowResponse ModifyTimeWindowSync(ModifyTimeWindowRequest req)
{
JsonResponseModel<ModifyTimeWindowResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "ModifyTimeWindow");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<ModifyTimeWindowResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(OfflineIsolatedInstances)用于立即下线隔离状态的云数据库实例。进行操作的实例状态必须为隔离状态,即通过 [查询实例列表](https://cloud.tencent.com/document/api/236/15872) 接口查询到 Status 值为 5 的实例。
///
/// 该接口为异步操作,部分资源的回收可能存在延迟。您可以通过使用 [查询实例列表](https://cloud.tencent.com/document/api/236/15872) 接口,指定实例 InstanceId 和状态 Status 为 [5,6,7] 进行查询,若返回实例为空,则实例资源已全部释放。
///
/// 注意,实例下线后,相关资源和数据将无法找回,请谨慎操作。
/// </summary>
/// <param name="req"><see cref="OfflineIsolatedInstancesRequest"/></param>
/// <returns><see cref="OfflineIsolatedInstancesResponse"/></returns>
public async Task<OfflineIsolatedInstancesResponse> OfflineIsolatedInstances(OfflineIsolatedInstancesRequest req)
{
JsonResponseModel<OfflineIsolatedInstancesResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "OfflineIsolatedInstances");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<OfflineIsolatedInstancesResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(OfflineIsolatedInstances)用于立即下线隔离状态的云数据库实例。进行操作的实例状态必须为隔离状态,即通过 [查询实例列表](https://cloud.tencent.com/document/api/236/15872) 接口查询到 Status 值为 5 的实例。
///
/// 该接口为异步操作,部分资源的回收可能存在延迟。您可以通过使用 [查询实例列表](https://cloud.tencent.com/document/api/236/15872) 接口,指定实例 InstanceId 和状态 Status 为 [5,6,7] 进行查询,若返回实例为空,则实例资源已全部释放。
///
/// 注意,实例下线后,相关资源和数据将无法找回,请谨慎操作。
/// </summary>
/// <param name="req"><see cref="OfflineIsolatedInstancesRequest"/></param>
/// <returns><see cref="OfflineIsolatedInstancesResponse"/></returns>
public OfflineIsolatedInstancesResponse OfflineIsolatedInstancesSync(OfflineIsolatedInstancesRequest req)
{
JsonResponseModel<OfflineIsolatedInstancesResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "OfflineIsolatedInstances");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<OfflineIsolatedInstancesResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(OpenDBInstanceGTID)用于开启云数据库实例的 GTID,只支持版本为 5.6 以及以上的实例。
/// </summary>
/// <param name="req"><see cref="OpenDBInstanceGTIDRequest"/></param>
/// <returns><see cref="OpenDBInstanceGTIDResponse"/></returns>
public async Task<OpenDBInstanceGTIDResponse> OpenDBInstanceGTID(OpenDBInstanceGTIDRequest req)
{
JsonResponseModel<OpenDBInstanceGTIDResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "OpenDBInstanceGTID");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<OpenDBInstanceGTIDResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(OpenDBInstanceGTID)用于开启云数据库实例的 GTID,只支持版本为 5.6 以及以上的实例。
/// </summary>
/// <param name="req"><see cref="OpenDBInstanceGTIDRequest"/></param>
/// <returns><see cref="OpenDBInstanceGTIDResponse"/></returns>
public OpenDBInstanceGTIDResponse OpenDBInstanceGTIDSync(OpenDBInstanceGTIDRequest req)
{
JsonResponseModel<OpenDBInstanceGTIDResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "OpenDBInstanceGTID");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<OpenDBInstanceGTIDResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(OpenWanService)用于开通实例外网访问。
///
/// 注意,实例开通外网访问之前,需要先将实例进行 [实例初始化](https://cloud.tencent.com/document/api/236/15873) 操作。
/// </summary>
/// <param name="req"><see cref="OpenWanServiceRequest"/></param>
/// <returns><see cref="OpenWanServiceResponse"/></returns>
public async Task<OpenWanServiceResponse> OpenWanService(OpenWanServiceRequest req)
{
JsonResponseModel<OpenWanServiceResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "OpenWanService");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<OpenWanServiceResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(OpenWanService)用于开通实例外网访问。
///
/// 注意,实例开通外网访问之前,需要先将实例进行 [实例初始化](https://cloud.tencent.com/document/api/236/15873) 操作。
/// </summary>
/// <param name="req"><see cref="OpenWanServiceRequest"/></param>
/// <returns><see cref="OpenWanServiceResponse"/></returns>
public OpenWanServiceResponse OpenWanServiceSync(OpenWanServiceRequest req)
{
JsonResponseModel<OpenWanServiceResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "OpenWanService");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<OpenWanServiceResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(ReleaseIsolatedDBInstances)用于恢复已隔离云数据库实例。
/// </summary>
/// <param name="req"><see cref="ReleaseIsolatedDBInstancesRequest"/></param>
/// <returns><see cref="ReleaseIsolatedDBInstancesResponse"/></returns>
public async Task<ReleaseIsolatedDBInstancesResponse> ReleaseIsolatedDBInstances(ReleaseIsolatedDBInstancesRequest req)
{
JsonResponseModel<ReleaseIsolatedDBInstancesResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "ReleaseIsolatedDBInstances");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<ReleaseIsolatedDBInstancesResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(ReleaseIsolatedDBInstances)用于恢复已隔离云数据库实例。
/// </summary>
/// <param name="req"><see cref="ReleaseIsolatedDBInstancesRequest"/></param>
/// <returns><see cref="ReleaseIsolatedDBInstancesResponse"/></returns>
public ReleaseIsolatedDBInstancesResponse ReleaseIsolatedDBInstancesSync(ReleaseIsolatedDBInstancesRequest req)
{
JsonResponseModel<ReleaseIsolatedDBInstancesResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "ReleaseIsolatedDBInstances");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<ReleaseIsolatedDBInstancesResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(RenewDBInstance)用于续费云数据库实例,支持付费模式为包年包月的实例。按量计费实例可通过该接口续费为包年包月的实例。
/// </summary>
/// <param name="req"><see cref="RenewDBInstanceRequest"/></param>
/// <returns><see cref="RenewDBInstanceResponse"/></returns>
public async Task<RenewDBInstanceResponse> RenewDBInstance(RenewDBInstanceRequest req)
{
JsonResponseModel<RenewDBInstanceResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "RenewDBInstance");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<RenewDBInstanceResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(RenewDBInstance)用于续费云数据库实例,支持付费模式为包年包月的实例。按量计费实例可通过该接口续费为包年包月的实例。
/// </summary>
/// <param name="req"><see cref="RenewDBInstanceRequest"/></param>
/// <returns><see cref="RenewDBInstanceResponse"/></returns>
public RenewDBInstanceResponse RenewDBInstanceSync(RenewDBInstanceRequest req)
{
JsonResponseModel<RenewDBInstanceResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "RenewDBInstance");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<RenewDBInstanceResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(RestartDBInstances)用于重启云数据库实例。
///
/// 注意:
/// 1、本接口只支持主实例进行重启操作;
/// 2、实例状态必须为正常,并且没有其他异步任务在执行中。
/// </summary>
/// <param name="req"><see cref="RestartDBInstancesRequest"/></param>
/// <returns><see cref="RestartDBInstancesResponse"/></returns>
public async Task<RestartDBInstancesResponse> RestartDBInstances(RestartDBInstancesRequest req)
{
JsonResponseModel<RestartDBInstancesResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "RestartDBInstances");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<RestartDBInstancesResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(RestartDBInstances)用于重启云数据库实例。
///
/// 注意:
/// 1、本接口只支持主实例进行重启操作;
/// 2、实例状态必须为正常,并且没有其他异步任务在执行中。
/// </summary>
/// <param name="req"><see cref="RestartDBInstancesRequest"/></param>
/// <returns><see cref="RestartDBInstancesResponse"/></returns>
public RestartDBInstancesResponse RestartDBInstancesSync(RestartDBInstancesRequest req)
{
JsonResponseModel<RestartDBInstancesResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "RestartDBInstances");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<RestartDBInstancesResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 该接口(StartBatchRollback)用于批量回档云数据库实例的库表。
/// </summary>
/// <param name="req"><see cref="StartBatchRollbackRequest"/></param>
/// <returns><see cref="StartBatchRollbackResponse"/></returns>
public async Task<StartBatchRollbackResponse> StartBatchRollback(StartBatchRollbackRequest req)
{
JsonResponseModel<StartBatchRollbackResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "StartBatchRollback");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<StartBatchRollbackResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 该接口(StartBatchRollback)用于批量回档云数据库实例的库表。
/// </summary>
/// <param name="req"><see cref="StartBatchRollbackRequest"/></param>
/// <returns><see cref="StartBatchRollbackResponse"/></returns>
public StartBatchRollbackResponse StartBatchRollbackSync(StartBatchRollbackRequest req)
{
JsonResponseModel<StartBatchRollbackResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "StartBatchRollback");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<StartBatchRollbackResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(StopDBImportJob)用于终止数据导入任务。
/// </summary>
/// <param name="req"><see cref="StopDBImportJobRequest"/></param>
/// <returns><see cref="StopDBImportJobResponse"/></returns>
public async Task<StopDBImportJobResponse> StopDBImportJob(StopDBImportJobRequest req)
{
JsonResponseModel<StopDBImportJobResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "StopDBImportJob");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<StopDBImportJobResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(StopDBImportJob)用于终止数据导入任务。
/// </summary>
/// <param name="req"><see cref="StopDBImportJobRequest"/></param>
/// <returns><see cref="StopDBImportJobResponse"/></returns>
public StopDBImportJobResponse StopDBImportJobSync(StopDBImportJobRequest req)
{
JsonResponseModel<StopDBImportJobResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "StopDBImportJob");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<StopDBImportJobResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(SwitchForUpgrade)用于切换访问新实例,针对主升级中的实例处于待切换状态时,用户可主动发起该流程。
/// </summary>
/// <param name="req"><see cref="SwitchForUpgradeRequest"/></param>
/// <returns><see cref="SwitchForUpgradeResponse"/></returns>
public async Task<SwitchForUpgradeResponse> SwitchForUpgrade(SwitchForUpgradeRequest req)
{
JsonResponseModel<SwitchForUpgradeResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "SwitchForUpgrade");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<SwitchForUpgradeResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(SwitchForUpgrade)用于切换访问新实例,针对主升级中的实例处于待切换状态时,用户可主动发起该流程。
/// </summary>
/// <param name="req"><see cref="SwitchForUpgradeRequest"/></param>
/// <returns><see cref="SwitchForUpgradeResponse"/></returns>
public SwitchForUpgradeResponse SwitchForUpgradeSync(SwitchForUpgradeRequest req)
{
JsonResponseModel<SwitchForUpgradeResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "SwitchForUpgrade");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<SwitchForUpgradeResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(UpgradeDBInstance)用于升级或降级云数据库实例的配置,实例类型支持主实例、灾备实例和只读实例。
/// </summary>
/// <param name="req"><see cref="UpgradeDBInstanceRequest"/></param>
/// <returns><see cref="UpgradeDBInstanceResponse"/></returns>
public async Task<UpgradeDBInstanceResponse> UpgradeDBInstance(UpgradeDBInstanceRequest req)
{
JsonResponseModel<UpgradeDBInstanceResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "UpgradeDBInstance");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<UpgradeDBInstanceResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(UpgradeDBInstance)用于升级或降级云数据库实例的配置,实例类型支持主实例、灾备实例和只读实例。
/// </summary>
/// <param name="req"><see cref="UpgradeDBInstanceRequest"/></param>
/// <returns><see cref="UpgradeDBInstanceResponse"/></returns>
public UpgradeDBInstanceResponse UpgradeDBInstanceSync(UpgradeDBInstanceRequest req)
{
JsonResponseModel<UpgradeDBInstanceResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "UpgradeDBInstance");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<UpgradeDBInstanceResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(UpgradeDBInstanceEngineVersion)用于升级云数据库实例版本,实例类型支持主实例、灾备实例和只读实例。
/// </summary>
/// <param name="req"><see cref="UpgradeDBInstanceEngineVersionRequest"/></param>
/// <returns><see cref="UpgradeDBInstanceEngineVersionResponse"/></returns>
public async Task<UpgradeDBInstanceEngineVersionResponse> UpgradeDBInstanceEngineVersion(UpgradeDBInstanceEngineVersionRequest req)
{
JsonResponseModel<UpgradeDBInstanceEngineVersionResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "UpgradeDBInstanceEngineVersion");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<UpgradeDBInstanceEngineVersionResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(UpgradeDBInstanceEngineVersion)用于升级云数据库实例版本,实例类型支持主实例、灾备实例和只读实例。
/// </summary>
/// <param name="req"><see cref="UpgradeDBInstanceEngineVersionRequest"/></param>
/// <returns><see cref="UpgradeDBInstanceEngineVersionResponse"/></returns>
public UpgradeDBInstanceEngineVersionResponse UpgradeDBInstanceEngineVersionSync(UpgradeDBInstanceEngineVersionRequest req)
{
JsonResponseModel<UpgradeDBInstanceEngineVersionResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "UpgradeDBInstanceEngineVersion");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<UpgradeDBInstanceEngineVersionResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(VerifyRootAccount)用于校验云数据库实例的 ROOT 账号是否有足够的权限进行授权操作。
/// </summary>
/// <param name="req"><see cref="VerifyRootAccountRequest"/></param>
/// <returns><see cref="VerifyRootAccountResponse"/></returns>
public async Task<VerifyRootAccountResponse> VerifyRootAccount(VerifyRootAccountRequest req)
{
JsonResponseModel<VerifyRootAccountResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "VerifyRootAccount");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<VerifyRootAccountResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口(VerifyRootAccount)用于校验云数据库实例的 ROOT 账号是否有足够的权限进行授权操作。
/// </summary>
/// <param name="req"><see cref="VerifyRootAccountRequest"/></param>
/// <returns><see cref="VerifyRootAccountResponse"/></returns>
public VerifyRootAccountResponse VerifyRootAccountSync(VerifyRootAccountRequest req)
{
JsonResponseModel<VerifyRootAccountResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "VerifyRootAccount");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<VerifyRootAccountResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
}
}
| 44.617873
| 226
| 0.605281
|
[
"Apache-2.0"
] |
hapsyou/tencentcloud-sdk-dotnet
|
TencentCloud/Cdb/V20170320/CdbClient.cs
| 182,226
|
C#
|
#region License
// Moonpie
//
// Copyright (c) 2022 Stay
//
// MIT License
//
// 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.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using System.Threading.Tasks;
using Moonpie.Protocol.Packets;
using Moonpie.Protocol.Packets.c2s;
using Moonpie.Protocol.Packets.s2c;
using Moonpie.Protocol.Protocol;
using Moonpie.Utils.Protocol;
using Serilog;
namespace Moonpie.Protocol.Network;
public abstract class Connection : IDisposable
{
private const bool LOG = false;
private TcpClient _client;
private NetworkStream _stream;
private PacketMapper _packetMapper;
public bool IsConnected { get; private set; }
public bool CompressionEnabled
{
get => CompressionThreshold > 0;
}
public long CompressionThreshold { get; internal set; }
public EndPoint RemoteEndPoint { get; private protected set; }
public ProtocolVersion Version { get; internal set; }
public ProtocolState State { get; internal set; }
private CancellationTokenSource _cts;
public event EventHandler? Disconnected;
internal Connection(TcpClient client)
{
_cts = new CancellationTokenSource();
_client = client;
_stream = client.GetStream();
RemoteEndPoint = client.Client.RemoteEndPoint ?? throw new Exception("RemoteEndPoint is null");
_packetMapper = new PacketMapper();
IsConnected = true;
CompressionThreshold = -1;
Version = ProtocolVersion.v1_7_1_pre;
}
protected async Task<IC2SPacket?> ReadC2SPacketAsync()
{
if (!IsConnected || _cts.IsCancellationRequested)
{
return null;
}
try
{
var data = await ReadDataChunk();
if (LOG) Log.Debug("ReadC2SPacketAsync Chunk: {data}", data.Length);
if (data.Length == 0)
{
if (LOG) Log.Debug("ReadC2SPacketAsync: Disconnected");
await DisconnectAsync();
return null;
}
if (CompressionEnabled)
{
if (LOG) Log.Debug("ReadC2SPacketAsync: CompressionEnabled");
data = Decompress(data);
}
var buffer = new InByteBuffer(data, Version, State);
return _packetMapper.DeserializeC2SPacket(buffer);
}
catch (OperationCanceledException)
{
return null;
}
catch(Exception e)
{
Console.WriteLine(e);
Log.Error(e, "Error reading packet C2S");
await DisconnectAndCleanupAsync();
}
await DisconnectAndCleanupAsync();
return null;
}
protected async Task<IS2CPacket?> ReadS2CPacketAsync()
{
if (!IsConnected || _cts.IsCancellationRequested)
{
return null;
}
try
{
var data = await ReadDataChunk();
if (CompressionEnabled)
{
data = Decompress(data);
}
var buffer = new InByteBuffer(data, Version, State);
var packet = _packetMapper.DeserializeS2CPacket(buffer);
return packet;
}catch (OperationCanceledException)
{
return null;
}
catch(Exception e)
{
Log.Error(e, "Error reading packet S2C");
await DisconnectAndCleanupAsync();
}
await DisconnectAndCleanupAsync();
return null;
}
private List<byte> _previousBytes = new List<byte>();
byte[] _readBuffer = new byte[8192];
private async Task<byte[]> ReadDataChunk()
{
if (!IsConnected || _cts.IsCancellationRequested)
{
return Array.Empty<byte>();
}
bool Validate(byte[] data, out byte[] result, out int readLength)
{
if (data.Length < 1)
{
result = Array.Empty<byte>();
readLength = 0;
return false;
}
VarInt length = new VarInt(data);
if (length.Size + length.Value > data.Length)
{
result = Array.Empty<byte>();
readLength = 0;
return false;
}
result = new byte[length.Value];
readLength = length.Size + length.Value;
Array.Copy(data, length.Size, result, 0, length.Value);
return true;
}
var buffer = new List<byte>();
while (IsConnected && !_cts.IsCancellationRequested)
{
{
if (Validate(_previousBytes.ToArray(), out var data, out var readLength))
{
_previousBytes.RemoveRange(0, readLength);
return data;
}
}
int read = await _stream.ReadAsync(_readBuffer, 0, _readBuffer.Length, _cts.Token);
if (read == 0)
{
await DisconnectAndCleanupAsync();
Console.WriteLine("Disconnected from server (ReadDataChunk)");
return Array.Empty<byte>();
}
buffer.AddRange(_previousBytes);
_previousBytes.Clear();
buffer.AddRange(_readBuffer.Take(read));
{
if (Validate(buffer.ToArray(), out var data, out var readLength))
{
buffer.RemoveRange(0, readLength);
if (buffer.Count > 0)
{
_previousBytes.AddRange(buffer);
}
return data;
}
}
}
buffer.Clear();
return Array.Empty<byte>();
}
private byte[] Decompress(byte[] compressedPacket)
{
if (!CompressionEnabled) throw new Exception("Compression is not enabled");
//Get the uncompressed packet length
var dataLength = new VarInt(compressedPacket);
if (dataLength == 0) // Packet is below the compression threshold, data is uncompressed.
{
var uncompressed = new byte[compressedPacket.Length - dataLength.Size];
Array.Copy(compressedPacket, dataLength.Size, uncompressed, 0, uncompressed.Length);
return uncompressed;
}
var compressedData = new byte[compressedPacket.Length - dataLength.Size];
Array.Copy(compressedPacket, dataLength.Size, compressedData, 0, compressedData.Length);
var decompressed = ProtocolCompression.Decompress(compressedData);
return decompressed;
}
private async Task DisconnectAndCleanupAsync()
{
if (!IsConnected) return;
IsConnected = false;
_cts.Cancel();
await _stream.DisposeAsync();
_client.Dispose();
_previousBytes.Clear();
IsConnected = false;
try
{
Disconnected?.Invoke(this, new EventArgs());
}catch(Exception e)
{
Console.WriteLine(e);
}
}
public Task DisconnectAsync()
{
return DisconnectAndCleanupAsync();
}
public async Task WritePacketAsync(params IPacket[] packets)
{
foreach (var packet in packets)
{
await WritePacketAsync(packet);
}
}
public Task WritePacketAsync(IPacket packet)
{
if (!IsConnected) return Task.CompletedTask;
if (packet is IS2CPacket s2c)
{
return WriteS2CPacket(s2c);
}else if (packet is IC2SPacket c2s)
{
return WriteC2SPacket(c2s);
}else
{
throw new Exception("Invalid packet type");
}
}
private async Task WriteS2CPacket(IS2CPacket packet)
{
var stdId = _packetMapper.GetS2CPacket(packet);
if (stdId is null) throw new Exception("Packet is not registered");
var buffer = new OutByteBuffer(Version, State);
var vPacketId = _packetMapper.GetPacketId(stdId.Value, Version);
if (vPacketId is null) throw new Exception("Packet is not registered");
buffer.WriteVarInt(vPacketId.Value);
packet.Write(buffer);
var packetBytes = buffer.Data;
var serialized = SerializePacketData(packetBytes);
await _stream.WriteAsync(serialized, 0, serialized.Length, _cts.Token);
}
private async Task WriteC2SPacket(IC2SPacket packet)
{
var stdId = _packetMapper.GetC2SPacket(packet);
if (stdId is null) throw new Exception("Packet is not registered");
var buffer = new OutByteBuffer(Version, State);
var vPacketId = _packetMapper.GetPacketId(stdId.Value, Version);
if (vPacketId is null) throw new Exception("Packet is not registered");
buffer.WriteVarInt(vPacketId.Value);
packet.Write(buffer);
var packetBytes = buffer.Data;
var serialized = SerializePacketData(packetBytes);
await _stream.WriteAsync(serialized, 0, serialized.Length, _cts.Token);
}
private byte[] SerializePacketData(byte[] packetData)
{
var buffer = new List<byte>();
if (CompressionEnabled && packetData.Length >= CompressionThreshold)
{
buffer.AddRange(ProtocolCompression.Compress(packetData));
}
else
{
buffer.AddRange(packetData);
}
if (CompressionEnabled)
{
if (packetData.Length < CompressionThreshold)
{
buffer.InsertRange(0, new VarInt(0).ToBytes());
}
else
{
buffer.InsertRange(0, new VarInt(packetData.Length).ToBytes());
}
}
buffer.InsertRange(0, new VarInt(buffer.Count).ToBytes());
return buffer.ToArray();
}
public void Dispose()
{
DisconnectAndCleanupAsync().Wait();
}
}
| 30.45283
| 103
| 0.580634
|
[
"MIT"
] |
Stay1444/Moonpie
|
src/Moonpie/Protocol/Network/Connection.cs
| 11,300
|
C#
|
// <auto-generated />
using System;
using DatabaseInterface;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace DatabaseInterface.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
[Migration("20200413123843_RemovedDayMetric")]
partial class RemovedDayMetric
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "3.1.0")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("DatabaseInterface.Entities.ApplicationUser", b =>
{
b.Property<string>("Id")
.HasColumnType("varchar(255) CHARACTER SET utf8mb4");
b.Property<int>("AccessFailedCount")
.HasColumnType("int");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<string>("Email")
.HasColumnType("varchar(256) CHARACTER SET utf8mb4")
.HasMaxLength(256);
b.Property<bool>("EmailConfirmed")
.HasColumnType("tinyint(1)");
b.Property<bool>("LockoutEnabled")
.HasColumnType("tinyint(1)");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("datetime(6)");
b.Property<string>("NormalizedEmail")
.HasColumnType("varchar(256) CHARACTER SET utf8mb4")
.HasMaxLength(256);
b.Property<string>("NormalizedUserName")
.HasColumnType("varchar(256) CHARACTER SET utf8mb4")
.HasMaxLength(256);
b.Property<string>("PasswordHash")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<string>("PhoneNumber")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<bool>("PhoneNumberConfirmed")
.HasColumnType("tinyint(1)");
b.Property<string>("SecurityStamp")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<bool>("TwoFactorEnabled")
.HasColumnType("tinyint(1)");
b.Property<string>("UserName")
.HasColumnType("varchar(256) CHARACTER SET utf8mb4")
.HasMaxLength(256);
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasName("UserNameIndex");
b.ToTable("AspNetUsers");
});
modelBuilder.Entity("DatabaseInterface.Entities.HourMetric", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<DateTime>("Created")
.HasColumnType("datetime(6)");
b.Property<int>("Mode")
.HasColumnType("int");
b.Property<long>("RaspberryPiId")
.HasColumnType("bigint");
b.Property<int>("RedeliveryNow")
.HasColumnType("int");
b.Property<long>("RedeliveryTotalHigh")
.HasColumnType("bigint");
b.Property<long>("RedeliveryTotalLow")
.HasColumnType("bigint");
b.Property<int>("SolarNow")
.HasColumnType("int");
b.Property<long>("SolarTotal")
.HasColumnType("bigint");
b.Property<DateTime>("Updated")
.HasColumnType("datetime(6)");
b.Property<int>("UsageGasNow")
.HasColumnType("int");
b.Property<long>("UsageGasTotal")
.HasColumnType("bigint");
b.Property<int>("UsageNow")
.HasColumnType("int");
b.Property<long>("UsageTotalHigh")
.HasColumnType("bigint");
b.Property<long>("UsageTotalLow")
.HasColumnType("bigint");
b.HasKey("Id");
b.HasIndex("Created");
b.HasIndex("RaspberryPiId");
b.ToTable("HourMetrics");
});
modelBuilder.Entity("DatabaseInterface.Entities.MinuteMetric", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<DateTime>("Created")
.HasColumnType("datetime(6)");
b.Property<int>("Mode")
.HasColumnType("int");
b.Property<long>("RaspberryPiId")
.HasColumnType("bigint");
b.Property<int>("RedeliveryNow")
.HasColumnType("int");
b.Property<long>("RedeliveryTotalHigh")
.HasColumnType("bigint");
b.Property<long>("RedeliveryTotalLow")
.HasColumnType("bigint");
b.Property<int>("SolarNow")
.HasColumnType("int");
b.Property<long>("SolarTotal")
.HasColumnType("bigint");
b.Property<DateTime>("Updated")
.HasColumnType("datetime(6)");
b.Property<int>("UsageGasNow")
.HasColumnType("int");
b.Property<long>("UsageGasTotal")
.HasColumnType("bigint");
b.Property<int>("UsageNow")
.HasColumnType("int");
b.Property<long>("UsageTotalHigh")
.HasColumnType("bigint");
b.Property<long>("UsageTotalLow")
.HasColumnType("bigint");
b.HasKey("Id");
b.HasIndex("Created");
b.HasIndex("RaspberryPiId");
b.ToTable("MinuteMetrics");
});
modelBuilder.Entity("DatabaseInterface.Entities.RaspberryPi", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<DateTime>("Created")
.HasColumnType("datetime(6)");
b.Property<string>("RpiKey")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<DateTime>("Updated")
.HasColumnType("datetime(6)");
b.Property<string>("UserId")
.HasColumnType("varchar(255) CHARACTER SET utf8mb4");
b.HasKey("Id");
b.HasIndex("UserId")
.IsUnique();
b.ToTable("RaspberryPis");
});
modelBuilder.Entity("DatabaseInterface.Entities.TenSecondMetric", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<DateTime>("Created")
.HasColumnType("datetime(6)");
b.Property<int>("Mode")
.HasColumnType("int");
b.Property<long>("RaspberryPiId")
.HasColumnType("bigint");
b.Property<int>("RedeliveryNow")
.HasColumnType("int");
b.Property<long>("RedeliveryTotalHigh")
.HasColumnType("bigint");
b.Property<long>("RedeliveryTotalLow")
.HasColumnType("bigint");
b.Property<int>("SolarNow")
.HasColumnType("int");
b.Property<long>("SolarTotal")
.HasColumnType("bigint");
b.Property<DateTime>("Updated")
.HasColumnType("datetime(6)");
b.Property<int>("UsageGasNow")
.HasColumnType("int");
b.Property<long>("UsageGasTotal")
.HasColumnType("bigint");
b.Property<int>("UsageNow")
.HasColumnType("int");
b.Property<long>("UsageTotalHigh")
.HasColumnType("bigint");
b.Property<long>("UsageTotalLow")
.HasColumnType("bigint");
b.HasKey("Id");
b.HasIndex("Created");
b.HasIndex("RaspberryPiId");
b.ToTable("TenSecondMetrics");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{
b.Property<string>("Id")
.HasColumnType("varchar(255) CHARACTER SET utf8mb4");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<string>("Name")
.HasColumnType("varchar(256) CHARACTER SET utf8mb4")
.HasMaxLength(256);
b.Property<string>("NormalizedName")
.HasColumnType("varchar(256) CHARACTER SET utf8mb4")
.HasMaxLength(256);
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasName("RoleNameIndex");
b.ToTable("AspNetRoles");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("ClaimType")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<string>("ClaimValue")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<string>("RoleId")
.IsRequired()
.HasColumnType("varchar(255) CHARACTER SET utf8mb4");
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("ClaimType")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<string>("ClaimValue")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("varchar(255) CHARACTER SET utf8mb4");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AspNetUserClaims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.Property<string>("LoginProvider")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("ProviderDisplayName")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("varchar(255) CHARACTER SET utf8mb4");
b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId");
b.ToTable("AspNetUserLogins");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.Property<string>("UserId")
.HasColumnType("varchar(255) CHARACTER SET utf8mb4");
b.Property<string>("RoleId")
.HasColumnType("varchar(255) CHARACTER SET utf8mb4");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.ToTable("AspNetUserRoles");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.Property<string>("UserId")
.HasColumnType("varchar(255) CHARACTER SET utf8mb4");
b.Property<string>("LoginProvider")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("Name")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("Value")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens");
});
modelBuilder.Entity("DatabaseInterface.Entities.HourMetric", b =>
{
b.HasOne("DatabaseInterface.Entities.RaspberryPi", "RaspberryPi")
.WithMany("HourMetrics")
.HasForeignKey("RaspberryPiId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("DatabaseInterface.Entities.MinuteMetric", b =>
{
b.HasOne("DatabaseInterface.Entities.RaspberryPi", "RaspberryPi")
.WithMany("MinuteMetrics")
.HasForeignKey("RaspberryPiId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("DatabaseInterface.Entities.RaspberryPi", b =>
{
b.HasOne("DatabaseInterface.Entities.ApplicationUser", "User")
.WithOne("RaspberryPi")
.HasForeignKey("DatabaseInterface.Entities.RaspberryPi", "UserId");
});
modelBuilder.Entity("DatabaseInterface.Entities.TenSecondMetric", b =>
{
b.HasOne("DatabaseInterface.Entities.RaspberryPi", "RaspberryPi")
.WithMany("TenSecondMetrics")
.HasForeignKey("RaspberryPiId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.HasOne("DatabaseInterface.Entities.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.HasOne("DatabaseInterface.Entities.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("DatabaseInterface.Entities.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.HasOne("DatabaseInterface.Entities.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
#pragma warning restore 612, 618
}
}
}
| 37.013917
| 95
| 0.458964
|
[
"MIT"
] |
yokovaski/EnergyPortal
|
DatabaseInterface/Migrations/20200413123843_RemovedDayMetric.Designer.cs
| 18,620
|
C#
|
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
namespace Pulumi.Aws.WafV2.Inputs
{
public sealed class RuleGroupRuleActionCountCustomRequestHandlingInsertHeaderArgs : Pulumi.ResourceArgs
{
/// <summary>
/// The label string.
/// </summary>
[Input("name", required: true)]
public Input<string> Name { get; set; } = null!;
/// <summary>
/// The value of the custom header.
/// </summary>
[Input("value", required: true)]
public Input<string> Value { get; set; } = null!;
public RuleGroupRuleActionCountCustomRequestHandlingInsertHeaderArgs()
{
}
}
}
| 29.21875
| 107
| 0.64385
|
[
"ECL-2.0",
"Apache-2.0"
] |
RafalSumislawski/pulumi-aws
|
sdk/dotnet/WafV2/Inputs/RuleGroupRuleActionCountCustomRequestHandlingInsertHeaderArgs.cs
| 935
|
C#
|
// Copyright (c) 2014-2020 The Khronos Group Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and/or associated documentation files (the "Materials"),
// to deal in the Materials without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Materials, and to permit persons to whom the
// Materials are 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 Materials.
//
// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS
// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND
// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/
//
// THE MATERIALS ARE 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 MATERIALS OR THE USE OR OTHER DEALINGS
// IN THE MATERIALS.
// This header is automatically generated by the same tool that creates
// the Binary Section of the SPIR-V specification.
// Enumeration tokens for SPIR-V, in various styles:
// C, C++, C++11, JSON, Lua, Python, C#, D
//
// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL
// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL
// - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL
// - Lua will use tables, e.g.: spv.SourceLanguage.GLSL
// - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL']
// - C# will use enum classes in the Specification class located in the "Spv" namespace,
// e.g.: Spv.Specification.SourceLanguage.GLSL
// - D will have tokens under the "spv" module, e.g: spv.SourceLanguage.GLSL
//
// Some tokens act like mask values, which can be OR'd together,
// while others are mutually exclusive. The mask-like ones have
// "Mask" in their name, and a parallel enum that has the shift
// amount (1 << x) for each corresponding enumerant.
namespace Spv
{
public static class Specification
{
public const uint MagicNumber = 0x07230203;
public const uint Version = 0x00010500;
public const uint Revision = 3;
public const uint OpCodeMask = 0xffff;
public const uint WordCountShift = 16;
public enum SourceLanguage
{
Unknown = 0,
ESSL = 1,
GLSL = 2,
OpenCL_C = 3,
OpenCL_CPP = 4,
HLSL = 5,
}
public enum ExecutionModel
{
Vertex = 0,
TessellationControl = 1,
TessellationEvaluation = 2,
Geometry = 3,
Fragment = 4,
GLCompute = 5,
Kernel = 6,
TaskNV = 5267,
MeshNV = 5268,
RayGenerationKHR = 5313,
RayGenerationNV = 5313,
IntersectionKHR = 5314,
IntersectionNV = 5314,
AnyHitKHR = 5315,
AnyHitNV = 5315,
ClosestHitKHR = 5316,
ClosestHitNV = 5316,
MissKHR = 5317,
MissNV = 5317,
CallableKHR = 5318,
CallableNV = 5318,
}
public enum AddressingModel
{
Logical = 0,
Physical32 = 1,
Physical64 = 2,
PhysicalStorageBuffer64 = 5348,
PhysicalStorageBuffer64EXT = 5348,
}
public enum MemoryModel
{
Simple = 0,
GLSL450 = 1,
OpenCL = 2,
Vulkan = 3,
VulkanKHR = 3,
}
public enum ExecutionMode
{
Invocations = 0,
SpacingEqual = 1,
SpacingFractionalEven = 2,
SpacingFractionalOdd = 3,
VertexOrderCw = 4,
VertexOrderCcw = 5,
PixelCenterInteger = 6,
OriginUpperLeft = 7,
OriginLowerLeft = 8,
EarlyFragmentTests = 9,
PointMode = 10,
Xfb = 11,
DepthReplacing = 12,
DepthGreater = 14,
DepthLess = 15,
DepthUnchanged = 16,
LocalSize = 17,
LocalSizeHint = 18,
InputPoints = 19,
InputLines = 20,
InputLinesAdjacency = 21,
Triangles = 22,
InputTrianglesAdjacency = 23,
Quads = 24,
Isolines = 25,
OutputVertices = 26,
OutputPoints = 27,
OutputLineStrip = 28,
OutputTriangleStrip = 29,
VecTypeHint = 30,
ContractionOff = 31,
Initializer = 33,
Finalizer = 34,
SubgroupSize = 35,
SubgroupsPerWorkgroup = 36,
SubgroupsPerWorkgroupId = 37,
LocalSizeId = 38,
LocalSizeHintId = 39,
PostDepthCoverage = 4446,
DenormPreserve = 4459,
DenormFlushToZero = 4460,
SignedZeroInfNanPreserve = 4461,
RoundingModeRTE = 4462,
RoundingModeRTZ = 4463,
StencilRefReplacingEXT = 5027,
OutputLinesNV = 5269,
OutputPrimitivesNV = 5270,
DerivativeGroupQuadsNV = 5289,
DerivativeGroupLinearNV = 5290,
OutputTrianglesNV = 5298,
PixelInterlockOrderedEXT = 5366,
PixelInterlockUnorderedEXT = 5367,
SampleInterlockOrderedEXT = 5368,
SampleInterlockUnorderedEXT = 5369,
ShadingRateInterlockOrderedEXT = 5370,
ShadingRateInterlockUnorderedEXT = 5371,
MaxWorkgroupSizeINTEL = 5893,
MaxWorkDimINTEL = 5894,
NoGlobalOffsetINTEL = 5895,
NumSIMDWorkitemsINTEL = 5896,
}
public enum StorageClass
{
UniformConstant = 0,
Input = 1,
Uniform = 2,
Output = 3,
Workgroup = 4,
CrossWorkgroup = 5,
Private = 6,
Function = 7,
Generic = 8,
PushConstant = 9,
AtomicCounter = 10,
Image = 11,
StorageBuffer = 12,
CallableDataKHR = 5328,
CallableDataNV = 5328,
IncomingCallableDataKHR = 5329,
IncomingCallableDataNV = 5329,
RayPayloadKHR = 5338,
RayPayloadNV = 5338,
HitAttributeKHR = 5339,
HitAttributeNV = 5339,
IncomingRayPayloadKHR = 5342,
IncomingRayPayloadNV = 5342,
ShaderRecordBufferKHR = 5343,
ShaderRecordBufferNV = 5343,
PhysicalStorageBuffer = 5349,
PhysicalStorageBufferEXT = 5349,
CodeSectionINTEL = 5605,
}
public enum Dim
{
Dim1D = 0,
Dim2D = 1,
Dim3D = 2,
Cube = 3,
Rect = 4,
Buffer = 5,
SubpassData = 6,
}
public enum SamplerAddressingMode
{
None = 0,
ClampToEdge = 1,
Clamp = 2,
Repeat = 3,
RepeatMirrored = 4,
}
public enum SamplerFilterMode
{
Nearest = 0,
Linear = 1,
}
public enum ImageFormat
{
Unknown = 0,
Rgba32f = 1,
Rgba16f = 2,
R32f = 3,
Rgba8 = 4,
Rgba8Snorm = 5,
Rg32f = 6,
Rg16f = 7,
R11fG11fB10f = 8,
R16f = 9,
Rgba16 = 10,
Rgb10A2 = 11,
Rg16 = 12,
Rg8 = 13,
R16 = 14,
R8 = 15,
Rgba16Snorm = 16,
Rg16Snorm = 17,
Rg8Snorm = 18,
R16Snorm = 19,
R8Snorm = 20,
Rgba32i = 21,
Rgba16i = 22,
Rgba8i = 23,
R32i = 24,
Rg32i = 25,
Rg16i = 26,
Rg8i = 27,
R16i = 28,
R8i = 29,
Rgba32ui = 30,
Rgba16ui = 31,
Rgba8ui = 32,
R32ui = 33,
Rgb10a2ui = 34,
Rg32ui = 35,
Rg16ui = 36,
Rg8ui = 37,
R16ui = 38,
R8ui = 39,
}
public enum ImageChannelOrder
{
R = 0,
A = 1,
RG = 2,
RA = 3,
RGB = 4,
RGBA = 5,
BGRA = 6,
ARGB = 7,
Intensity = 8,
Luminance = 9,
Rx = 10,
RGx = 11,
RGBx = 12,
Depth = 13,
DepthStencil = 14,
sRGB = 15,
sRGBx = 16,
sRGBA = 17,
sBGRA = 18,
ABGR = 19,
}
public enum ImageChannelDataType
{
SnormInt8 = 0,
SnormInt16 = 1,
UnormInt8 = 2,
UnormInt16 = 3,
UnormShort565 = 4,
UnormShort555 = 5,
UnormInt101010 = 6,
SignedInt8 = 7,
SignedInt16 = 8,
SignedInt32 = 9,
UnsignedInt8 = 10,
UnsignedInt16 = 11,
UnsignedInt32 = 12,
HalfFloat = 13,
Float = 14,
UnormInt24 = 15,
UnormInt101010_2 = 16,
}
public enum ImageOperandsShift
{
Bias = 0,
Lod = 1,
Grad = 2,
ConstOffset = 3,
Offset = 4,
ConstOffsets = 5,
Sample = 6,
MinLod = 7,
MakeTexelAvailable = 8,
MakeTexelAvailableKHR = 8,
MakeTexelVisible = 9,
MakeTexelVisibleKHR = 9,
NonPrivateTexel = 10,
NonPrivateTexelKHR = 10,
VolatileTexel = 11,
VolatileTexelKHR = 11,
SignExtend = 12,
ZeroExtend = 13,
}
public enum ImageOperandsMask
{
MaskNone = 0,
Bias = 0x00000001,
Lod = 0x00000002,
Grad = 0x00000004,
ConstOffset = 0x00000008,
Offset = 0x00000010,
ConstOffsets = 0x00000020,
Sample = 0x00000040,
MinLod = 0x00000080,
MakeTexelAvailable = 0x00000100,
MakeTexelAvailableKHR = 0x00000100,
MakeTexelVisible = 0x00000200,
MakeTexelVisibleKHR = 0x00000200,
NonPrivateTexel = 0x00000400,
NonPrivateTexelKHR = 0x00000400,
VolatileTexel = 0x00000800,
VolatileTexelKHR = 0x00000800,
SignExtend = 0x00001000,
ZeroExtend = 0x00002000,
}
public enum FPFastMathModeShift
{
NotNaN = 0,
NotInf = 1,
NSZ = 2,
AllowRecip = 3,
Fast = 4,
}
public enum FPFastMathModeMask
{
MaskNone = 0,
NotNaN = 0x00000001,
NotInf = 0x00000002,
NSZ = 0x00000004,
AllowRecip = 0x00000008,
Fast = 0x00000010,
}
public enum FPRoundingMode
{
RTE = 0,
RTZ = 1,
RTP = 2,
RTN = 3,
}
public enum LinkageType
{
Export = 0,
Import = 1,
}
public enum AccessQualifier
{
ReadOnly = 0,
WriteOnly = 1,
ReadWrite = 2,
}
public enum FunctionParameterAttribute
{
Zext = 0,
Sext = 1,
ByVal = 2,
Sret = 3,
NoAlias = 4,
NoCapture = 5,
NoWrite = 6,
NoReadWrite = 7,
}
public enum Decoration
{
RelaxedPrecision = 0,
SpecId = 1,
Block = 2,
BufferBlock = 3,
RowMajor = 4,
ColMajor = 5,
ArrayStride = 6,
MatrixStride = 7,
GLSLShared = 8,
GLSLPacked = 9,
CPacked = 10,
BuiltIn = 11,
NoPerspective = 13,
Flat = 14,
Patch = 15,
Centroid = 16,
Sample = 17,
Invariant = 18,
Restrict = 19,
Aliased = 20,
Volatile = 21,
Constant = 22,
Coherent = 23,
NonWritable = 24,
NonReadable = 25,
Uniform = 26,
UniformId = 27,
SaturatedConversion = 28,
Stream = 29,
Location = 30,
Component = 31,
Index = 32,
Binding = 33,
DescriptorSet = 34,
Offset = 35,
XfbBuffer = 36,
XfbStride = 37,
FuncParamAttr = 38,
FPRoundingMode = 39,
FPFastMathMode = 40,
LinkageAttributes = 41,
NoContraction = 42,
InputAttachmentIndex = 43,
Alignment = 44,
MaxByteOffset = 45,
AlignmentId = 46,
MaxByteOffsetId = 47,
NoSignedWrap = 4469,
NoUnsignedWrap = 4470,
ExplicitInterpAMD = 4999,
OverrideCoverageNV = 5248,
PassthroughNV = 5250,
ViewportRelativeNV = 5252,
SecondaryViewportRelativeNV = 5256,
PerPrimitiveNV = 5271,
PerViewNV = 5272,
PerTaskNV = 5273,
PerVertexNV = 5285,
NonUniform = 5300,
NonUniformEXT = 5300,
RestrictPointer = 5355,
RestrictPointerEXT = 5355,
AliasedPointer = 5356,
AliasedPointerEXT = 5356,
ReferencedIndirectlyINTEL = 5602,
CounterBuffer = 5634,
HlslCounterBufferGOOGLE = 5634,
HlslSemanticGOOGLE = 5635,
UserSemantic = 5635,
UserTypeGOOGLE = 5636,
RegisterINTEL = 5825,
MemoryINTEL = 5826,
NumbanksINTEL = 5827,
BankwidthINTEL = 5828,
MaxPrivateCopiesINTEL = 5829,
SinglepumpINTEL = 5830,
DoublepumpINTEL = 5831,
MaxReplicatesINTEL = 5832,
SimpleDualPortINTEL = 5833,
MergeINTEL = 5834,
BankBitsINTEL = 5835,
ForcePow2DepthINTEL = 5836,
}
public enum BuiltIn
{
Position = 0,
PointSize = 1,
ClipDistance = 3,
CullDistance = 4,
VertexId = 5,
InstanceId = 6,
PrimitiveId = 7,
InvocationId = 8,
Layer = 9,
ViewportIndex = 10,
TessLevelOuter = 11,
TessLevelInner = 12,
TessCoord = 13,
PatchVertices = 14,
FragCoord = 15,
PointCoord = 16,
FrontFacing = 17,
SampleId = 18,
SamplePosition = 19,
SampleMask = 20,
FragDepth = 22,
HelperInvocation = 23,
NumWorkgroups = 24,
WorkgroupSize = 25,
WorkgroupId = 26,
LocalInvocationId = 27,
GlobalInvocationId = 28,
LocalInvocationIndex = 29,
WorkDim = 30,
GlobalSize = 31,
EnqueuedWorkgroupSize = 32,
GlobalOffset = 33,
GlobalLinearId = 34,
SubgroupSize = 36,
SubgroupMaxSize = 37,
NumSubgroups = 38,
NumEnqueuedSubgroups = 39,
SubgroupId = 40,
SubgroupLocalInvocationId = 41,
VertexIndex = 42,
InstanceIndex = 43,
SubgroupEqMask = 4416,
SubgroupEqMaskKHR = 4416,
SubgroupGeMask = 4417,
SubgroupGeMaskKHR = 4417,
SubgroupGtMask = 4418,
SubgroupGtMaskKHR = 4418,
SubgroupLeMask = 4419,
SubgroupLeMaskKHR = 4419,
SubgroupLtMask = 4420,
SubgroupLtMaskKHR = 4420,
BaseVertex = 4424,
BaseInstance = 4425,
DrawIndex = 4426,
DeviceIndex = 4438,
ViewIndex = 4440,
BaryCoordNoPerspAMD = 4992,
BaryCoordNoPerspCentroidAMD = 4993,
BaryCoordNoPerspSampleAMD = 4994,
BaryCoordSmoothAMD = 4995,
BaryCoordSmoothCentroidAMD = 4996,
BaryCoordSmoothSampleAMD = 4997,
BaryCoordPullModelAMD = 4998,
FragStencilRefEXT = 5014,
ViewportMaskNV = 5253,
SecondaryPositionNV = 5257,
SecondaryViewportMaskNV = 5258,
PositionPerViewNV = 5261,
ViewportMaskPerViewNV = 5262,
FullyCoveredEXT = 5264,
TaskCountNV = 5274,
PrimitiveCountNV = 5275,
PrimitiveIndicesNV = 5276,
ClipDistancePerViewNV = 5277,
CullDistancePerViewNV = 5278,
LayerPerViewNV = 5279,
MeshViewCountNV = 5280,
MeshViewIndicesNV = 5281,
BaryCoordNV = 5286,
BaryCoordNoPerspNV = 5287,
FragSizeEXT = 5292,
FragmentSizeNV = 5292,
FragInvocationCountEXT = 5293,
InvocationsPerPixelNV = 5293,
LaunchIdKHR = 5319,
LaunchIdNV = 5319,
LaunchSizeKHR = 5320,
LaunchSizeNV = 5320,
WorldRayOriginKHR = 5321,
WorldRayOriginNV = 5321,
WorldRayDirectionKHR = 5322,
WorldRayDirectionNV = 5322,
ObjectRayOriginKHR = 5323,
ObjectRayOriginNV = 5323,
ObjectRayDirectionKHR = 5324,
ObjectRayDirectionNV = 5324,
RayTminKHR = 5325,
RayTminNV = 5325,
RayTmaxKHR = 5326,
RayTmaxNV = 5326,
InstanceCustomIndexKHR = 5327,
InstanceCustomIndexNV = 5327,
ObjectToWorldKHR = 5330,
ObjectToWorldNV = 5330,
WorldToObjectKHR = 5331,
WorldToObjectNV = 5331,
HitTKHR = 5332,
HitTNV = 5332,
HitKindKHR = 5333,
HitKindNV = 5333,
IncomingRayFlagsKHR = 5351,
IncomingRayFlagsNV = 5351,
RayGeometryIndexKHR = 5352,
WarpsPerSMNV = 5374,
SMCountNV = 5375,
WarpIDNV = 5376,
SMIDNV = 5377,
}
public enum SelectionControlShift
{
Flatten = 0,
DontFlatten = 1,
}
public enum SelectionControlMask
{
MaskNone = 0,
Flatten = 0x00000001,
DontFlatten = 0x00000002,
}
public enum LoopControlShift
{
Unroll = 0,
DontUnroll = 1,
DependencyInfinite = 2,
DependencyLength = 3,
MinIterations = 4,
MaxIterations = 5,
IterationMultiple = 6,
PeelCount = 7,
PartialCount = 8,
InitiationIntervalINTEL = 16,
MaxConcurrencyINTEL = 17,
DependencyArrayINTEL = 18,
PipelineEnableINTEL = 19,
LoopCoalesceINTEL = 20,
MaxInterleavingINTEL = 21,
SpeculatedIterationsINTEL = 22,
}
public enum LoopControlMask
{
MaskNone = 0,
Unroll = 0x00000001,
DontUnroll = 0x00000002,
DependencyInfinite = 0x00000004,
DependencyLength = 0x00000008,
MinIterations = 0x00000010,
MaxIterations = 0x00000020,
IterationMultiple = 0x00000040,
PeelCount = 0x00000080,
PartialCount = 0x00000100,
InitiationIntervalINTEL = 0x00010000,
MaxConcurrencyINTEL = 0x00020000,
DependencyArrayINTEL = 0x00040000,
PipelineEnableINTEL = 0x00080000,
LoopCoalesceINTEL = 0x00100000,
MaxInterleavingINTEL = 0x00200000,
SpeculatedIterationsINTEL = 0x00400000,
}
public enum FunctionControlShift
{
Inline = 0,
DontInline = 1,
Pure = 2,
Const = 3,
}
public enum FunctionControlMask
{
MaskNone = 0,
Inline = 0x00000001,
DontInline = 0x00000002,
Pure = 0x00000004,
Const = 0x00000008,
}
public enum MemorySemanticsShift
{
Acquire = 1,
Release = 2,
AcquireRelease = 3,
SequentiallyConsistent = 4,
UniformMemory = 6,
SubgroupMemory = 7,
WorkgroupMemory = 8,
CrossWorkgroupMemory = 9,
AtomicCounterMemory = 10,
ImageMemory = 11,
OutputMemory = 12,
OutputMemoryKHR = 12,
MakeAvailable = 13,
MakeAvailableKHR = 13,
MakeVisible = 14,
MakeVisibleKHR = 14,
Volatile = 15,
}
public enum MemorySemanticsMask
{
MaskNone = 0,
Acquire = 0x00000002,
Release = 0x00000004,
AcquireRelease = 0x00000008,
SequentiallyConsistent = 0x00000010,
UniformMemory = 0x00000040,
SubgroupMemory = 0x00000080,
WorkgroupMemory = 0x00000100,
CrossWorkgroupMemory = 0x00000200,
AtomicCounterMemory = 0x00000400,
ImageMemory = 0x00000800,
OutputMemory = 0x00001000,
OutputMemoryKHR = 0x00001000,
MakeAvailable = 0x00002000,
MakeAvailableKHR = 0x00002000,
MakeVisible = 0x00004000,
MakeVisibleKHR = 0x00004000,
Volatile = 0x00008000,
}
public enum MemoryAccessShift
{
Volatile = 0,
Aligned = 1,
Nontemporal = 2,
MakePointerAvailable = 3,
MakePointerAvailableKHR = 3,
MakePointerVisible = 4,
MakePointerVisibleKHR = 4,
NonPrivatePointer = 5,
NonPrivatePointerKHR = 5,
}
public enum MemoryAccessMask
{
MaskNone = 0,
Volatile = 0x00000001,
Aligned = 0x00000002,
Nontemporal = 0x00000004,
MakePointerAvailable = 0x00000008,
MakePointerAvailableKHR = 0x00000008,
MakePointerVisible = 0x00000010,
MakePointerVisibleKHR = 0x00000010,
NonPrivatePointer = 0x00000020,
NonPrivatePointerKHR = 0x00000020,
}
public enum Scope
{
CrossDevice = 0,
Device = 1,
Workgroup = 2,
Subgroup = 3,
Invocation = 4,
QueueFamily = 5,
QueueFamilyKHR = 5,
ShaderCallKHR = 6,
}
public enum GroupOperation
{
Reduce = 0,
InclusiveScan = 1,
ExclusiveScan = 2,
ClusteredReduce = 3,
PartitionedReduceNV = 6,
PartitionedInclusiveScanNV = 7,
PartitionedExclusiveScanNV = 8,
}
public enum KernelEnqueueFlags
{
NoWait = 0,
WaitKernel = 1,
WaitWorkGroup = 2,
}
public enum KernelProfilingInfoShift
{
CmdExecTime = 0,
}
public enum KernelProfilingInfoMask
{
MaskNone = 0,
CmdExecTime = 0x00000001,
}
public enum Capability
{
Matrix = 0,
Shader = 1,
Geometry = 2,
Tessellation = 3,
Addresses = 4,
Linkage = 5,
Kernel = 6,
Vector16 = 7,
Float16Buffer = 8,
Float16 = 9,
Float64 = 10,
Int64 = 11,
Int64Atomics = 12,
ImageBasic = 13,
ImageReadWrite = 14,
ImageMipmap = 15,
Pipes = 17,
Groups = 18,
DeviceEnqueue = 19,
LiteralSampler = 20,
AtomicStorage = 21,
Int16 = 22,
TessellationPointSize = 23,
GeometryPointSize = 24,
ImageGatherExtended = 25,
StorageImageMultisample = 27,
UniformBufferArrayDynamicIndexing = 28,
SampledImageArrayDynamicIndexing = 29,
StorageBufferArrayDynamicIndexing = 30,
StorageImageArrayDynamicIndexing = 31,
ClipDistance = 32,
CullDistance = 33,
ImageCubeArray = 34,
SampleRateShading = 35,
ImageRect = 36,
SampledRect = 37,
GenericPointer = 38,
Int8 = 39,
InputAttachment = 40,
SparseResidency = 41,
MinLod = 42,
Sampled1D = 43,
Image1D = 44,
SampledCubeArray = 45,
SampledBuffer = 46,
ImageBuffer = 47,
ImageMSArray = 48,
StorageImageExtendedFormats = 49,
ImageQuery = 50,
DerivativeControl = 51,
InterpolationFunction = 52,
TransformFeedback = 53,
GeometryStreams = 54,
StorageImageReadWithoutFormat = 55,
StorageImageWriteWithoutFormat = 56,
MultiViewport = 57,
SubgroupDispatch = 58,
NamedBarrier = 59,
PipeStorage = 60,
GroupNonUniform = 61,
GroupNonUniformVote = 62,
GroupNonUniformArithmetic = 63,
GroupNonUniformBallot = 64,
GroupNonUniformShuffle = 65,
GroupNonUniformShuffleRelative = 66,
GroupNonUniformClustered = 67,
GroupNonUniformQuad = 68,
ShaderLayer = 69,
ShaderViewportIndex = 70,
SubgroupBallotKHR = 4423,
DrawParameters = 4427,
SubgroupVoteKHR = 4431,
StorageBuffer16BitAccess = 4433,
StorageUniformBufferBlock16 = 4433,
StorageUniform16 = 4434,
UniformAndStorageBuffer16BitAccess = 4434,
StoragePushConstant16 = 4435,
StorageInputOutput16 = 4436,
DeviceGroup = 4437,
MultiView = 4439,
VariablePointersStorageBuffer = 4441,
VariablePointers = 4442,
AtomicStorageOps = 4445,
SampleMaskPostDepthCoverage = 4447,
StorageBuffer8BitAccess = 4448,
UniformAndStorageBuffer8BitAccess = 4449,
StoragePushConstant8 = 4450,
DenormPreserve = 4464,
DenormFlushToZero = 4465,
SignedZeroInfNanPreserve = 4466,
RoundingModeRTE = 4467,
RoundingModeRTZ = 4468,
RayQueryProvisionalKHR = 4471,
RayTraversalPrimitiveCullingProvisionalKHR = 4478,
Float16ImageAMD = 5008,
ImageGatherBiasLodAMD = 5009,
FragmentMaskAMD = 5010,
StencilExportEXT = 5013,
ImageReadWriteLodAMD = 5015,
ShaderClockKHR = 5055,
SampleMaskOverrideCoverageNV = 5249,
GeometryShaderPassthroughNV = 5251,
ShaderViewportIndexLayerEXT = 5254,
ShaderViewportIndexLayerNV = 5254,
ShaderViewportMaskNV = 5255,
ShaderStereoViewNV = 5259,
PerViewAttributesNV = 5260,
FragmentFullyCoveredEXT = 5265,
MeshShadingNV = 5266,
ImageFootprintNV = 5282,
FragmentBarycentricNV = 5284,
ComputeDerivativeGroupQuadsNV = 5288,
FragmentDensityEXT = 5291,
ShadingRateNV = 5291,
GroupNonUniformPartitionedNV = 5297,
ShaderNonUniform = 5301,
ShaderNonUniformEXT = 5301,
RuntimeDescriptorArray = 5302,
RuntimeDescriptorArrayEXT = 5302,
InputAttachmentArrayDynamicIndexing = 5303,
InputAttachmentArrayDynamicIndexingEXT = 5303,
UniformTexelBufferArrayDynamicIndexing = 5304,
UniformTexelBufferArrayDynamicIndexingEXT = 5304,
StorageTexelBufferArrayDynamicIndexing = 5305,
StorageTexelBufferArrayDynamicIndexingEXT = 5305,
UniformBufferArrayNonUniformIndexing = 5306,
UniformBufferArrayNonUniformIndexingEXT = 5306,
SampledImageArrayNonUniformIndexing = 5307,
SampledImageArrayNonUniformIndexingEXT = 5307,
StorageBufferArrayNonUniformIndexing = 5308,
StorageBufferArrayNonUniformIndexingEXT = 5308,
StorageImageArrayNonUniformIndexing = 5309,
StorageImageArrayNonUniformIndexingEXT = 5309,
InputAttachmentArrayNonUniformIndexing = 5310,
InputAttachmentArrayNonUniformIndexingEXT = 5310,
UniformTexelBufferArrayNonUniformIndexing = 5311,
UniformTexelBufferArrayNonUniformIndexingEXT = 5311,
StorageTexelBufferArrayNonUniformIndexing = 5312,
StorageTexelBufferArrayNonUniformIndexingEXT = 5312,
RayTracingNV = 5340,
VulkanMemoryModel = 5345,
VulkanMemoryModelKHR = 5345,
VulkanMemoryModelDeviceScope = 5346,
VulkanMemoryModelDeviceScopeKHR = 5346,
PhysicalStorageBufferAddresses = 5347,
PhysicalStorageBufferAddressesEXT = 5347,
ComputeDerivativeGroupLinearNV = 5350,
RayTracingProvisionalKHR = 5353,
CooperativeMatrixNV = 5357,
FragmentShaderSampleInterlockEXT = 5363,
FragmentShaderShadingRateInterlockEXT = 5372,
ShaderSMBuiltinsNV = 5373,
FragmentShaderPixelInterlockEXT = 5378,
DemoteToHelperInvocationEXT = 5379,
SubgroupShuffleINTEL = 5568,
SubgroupBufferBlockIOINTEL = 5569,
SubgroupImageBlockIOINTEL = 5570,
SubgroupImageMediaBlockIOINTEL = 5579,
IntegerFunctions2INTEL = 5584,
FunctionPointersINTEL = 5603,
IndirectReferencesINTEL = 5604,
SubgroupAvcMotionEstimationINTEL = 5696,
SubgroupAvcMotionEstimationIntraINTEL = 5697,
SubgroupAvcMotionEstimationChromaINTEL = 5698,
FPGAMemoryAttributesINTEL = 5824,
UnstructuredLoopControlsINTEL = 5886,
FPGALoopControlsINTEL = 5888,
KernelAttributesINTEL = 5892,
FPGAKernelAttributesINTEL = 5897,
BlockingPipesINTEL = 5945,
FPGARegINTEL = 5948,
AtomicFloat32AddEXT = 6033,
AtomicFloat64AddEXT = 6034,
}
public enum RayFlagsShift
{
OpaqueKHR = 0,
NoOpaqueKHR = 1,
TerminateOnFirstHitKHR = 2,
SkipClosestHitShaderKHR = 3,
CullBackFacingTrianglesKHR = 4,
CullFrontFacingTrianglesKHR = 5,
CullOpaqueKHR = 6,
CullNoOpaqueKHR = 7,
SkipTrianglesKHR = 8,
SkipAABBsKHR = 9,
}
public enum RayFlagsMask
{
MaskNone = 0,
OpaqueKHR = 0x00000001,
NoOpaqueKHR = 0x00000002,
TerminateOnFirstHitKHR = 0x00000004,
SkipClosestHitShaderKHR = 0x00000008,
CullBackFacingTrianglesKHR = 0x00000010,
CullFrontFacingTrianglesKHR = 0x00000020,
CullOpaqueKHR = 0x00000040,
CullNoOpaqueKHR = 0x00000080,
SkipTrianglesKHR = 0x00000100,
SkipAABBsKHR = 0x00000200,
}
public enum RayQueryIntersection
{
RayQueryCandidateIntersectionKHR = 0,
RayQueryCommittedIntersectionKHR = 1,
}
public enum RayQueryCommittedIntersectionType
{
RayQueryCommittedIntersectionNoneKHR = 0,
RayQueryCommittedIntersectionTriangleKHR = 1,
RayQueryCommittedIntersectionGeneratedKHR = 2,
}
public enum RayQueryCandidateIntersectionType
{
RayQueryCandidateIntersectionTriangleKHR = 0,
RayQueryCandidateIntersectionAABBKHR = 1,
}
public enum Op
{
OpNop = 0,
OpUndef = 1,
OpSourceContinued = 2,
OpSource = 3,
OpSourceExtension = 4,
OpName = 5,
OpMemberName = 6,
OpString = 7,
OpLine = 8,
OpExtension = 10,
OpExtInstImport = 11,
OpExtInst = 12,
OpMemoryModel = 14,
OpEntryPoint = 15,
OpExecutionMode = 16,
OpCapability = 17,
OpTypeVoid = 19,
OpTypeBool = 20,
OpTypeInt = 21,
OpTypeFloat = 22,
OpTypeVector = 23,
OpTypeMatrix = 24,
OpTypeImage = 25,
OpTypeSampler = 26,
OpTypeSampledImage = 27,
OpTypeArray = 28,
OpTypeRuntimeArray = 29,
OpTypeStruct = 30,
OpTypeOpaque = 31,
OpTypePointer = 32,
OpTypeFunction = 33,
OpTypeEvent = 34,
OpTypeDeviceEvent = 35,
OpTypeReserveId = 36,
OpTypeQueue = 37,
OpTypePipe = 38,
OpTypeForwardPointer = 39,
OpConstantTrue = 41,
OpConstantFalse = 42,
OpConstant = 43,
OpConstantComposite = 44,
OpConstantSampler = 45,
OpConstantNull = 46,
OpSpecConstantTrue = 48,
OpSpecConstantFalse = 49,
OpSpecConstant = 50,
OpSpecConstantComposite = 51,
OpSpecConstantOp = 52,
OpFunction = 54,
OpFunctionParameter = 55,
OpFunctionEnd = 56,
OpFunctionCall = 57,
OpVariable = 59,
OpImageTexelPointer = 60,
OpLoad = 61,
OpStore = 62,
OpCopyMemory = 63,
OpCopyMemorySized = 64,
OpAccessChain = 65,
OpInBoundsAccessChain = 66,
OpPtrAccessChain = 67,
OpArrayLength = 68,
OpGenericPtrMemSemantics = 69,
OpInBoundsPtrAccessChain = 70,
OpDecorate = 71,
OpMemberDecorate = 72,
OpDecorationGroup = 73,
OpGroupDecorate = 74,
OpGroupMemberDecorate = 75,
OpVectorExtractDynamic = 77,
OpVectorInsertDynamic = 78,
OpVectorShuffle = 79,
OpCompositeConstruct = 80,
OpCompositeExtract = 81,
OpCompositeInsert = 82,
OpCopyObject = 83,
OpTranspose = 84,
OpSampledImage = 86,
OpImageSampleImplicitLod = 87,
OpImageSampleExplicitLod = 88,
OpImageSampleDrefImplicitLod = 89,
OpImageSampleDrefExplicitLod = 90,
OpImageSampleProjImplicitLod = 91,
OpImageSampleProjExplicitLod = 92,
OpImageSampleProjDrefImplicitLod = 93,
OpImageSampleProjDrefExplicitLod = 94,
OpImageFetch = 95,
OpImageGather = 96,
OpImageDrefGather = 97,
OpImageRead = 98,
OpImageWrite = 99,
OpImage = 100,
OpImageQueryFormat = 101,
OpImageQueryOrder = 102,
OpImageQuerySizeLod = 103,
OpImageQuerySize = 104,
OpImageQueryLod = 105,
OpImageQueryLevels = 106,
OpImageQuerySamples = 107,
OpConvertFToU = 109,
OpConvertFToS = 110,
OpConvertSToF = 111,
OpConvertUToF = 112,
OpUConvert = 113,
OpSConvert = 114,
OpFConvert = 115,
OpQuantizeToF16 = 116,
OpConvertPtrToU = 117,
OpSatConvertSToU = 118,
OpSatConvertUToS = 119,
OpConvertUToPtr = 120,
OpPtrCastToGeneric = 121,
OpGenericCastToPtr = 122,
OpGenericCastToPtrExplicit = 123,
OpBitcast = 124,
OpSNegate = 126,
OpFNegate = 127,
OpIAdd = 128,
OpFAdd = 129,
OpISub = 130,
OpFSub = 131,
OpIMul = 132,
OpFMul = 133,
OpUDiv = 134,
OpSDiv = 135,
OpFDiv = 136,
OpUMod = 137,
OpSRem = 138,
OpSMod = 139,
OpFRem = 140,
OpFMod = 141,
OpVectorTimesScalar = 142,
OpMatrixTimesScalar = 143,
OpVectorTimesMatrix = 144,
OpMatrixTimesVector = 145,
OpMatrixTimesMatrix = 146,
OpOuterProduct = 147,
OpDot = 148,
OpIAddCarry = 149,
OpISubBorrow = 150,
OpUMulExtended = 151,
OpSMulExtended = 152,
OpAny = 154,
OpAll = 155,
OpIsNan = 156,
OpIsInf = 157,
OpIsFinite = 158,
OpIsNormal = 159,
OpSignBitSet = 160,
OpLessOrGreater = 161,
OpOrdered = 162,
OpUnordered = 163,
OpLogicalEqual = 164,
OpLogicalNotEqual = 165,
OpLogicalOr = 166,
OpLogicalAnd = 167,
OpLogicalNot = 168,
OpSelect = 169,
OpIEqual = 170,
OpINotEqual = 171,
OpUGreaterThan = 172,
OpSGreaterThan = 173,
OpUGreaterThanEqual = 174,
OpSGreaterThanEqual = 175,
OpULessThan = 176,
OpSLessThan = 177,
OpULessThanEqual = 178,
OpSLessThanEqual = 179,
OpFOrdEqual = 180,
OpFUnordEqual = 181,
OpFOrdNotEqual = 182,
OpFUnordNotEqual = 183,
OpFOrdLessThan = 184,
OpFUnordLessThan = 185,
OpFOrdGreaterThan = 186,
OpFUnordGreaterThan = 187,
OpFOrdLessThanEqual = 188,
OpFUnordLessThanEqual = 189,
OpFOrdGreaterThanEqual = 190,
OpFUnordGreaterThanEqual = 191,
OpShiftRightLogical = 194,
OpShiftRightArithmetic = 195,
OpShiftLeftLogical = 196,
OpBitwiseOr = 197,
OpBitwiseXor = 198,
OpBitwiseAnd = 199,
OpNot = 200,
OpBitFieldInsert = 201,
OpBitFieldSExtract = 202,
OpBitFieldUExtract = 203,
OpBitReverse = 204,
OpBitCount = 205,
OpDPdx = 207,
OpDPdy = 208,
OpFwidth = 209,
OpDPdxFine = 210,
OpDPdyFine = 211,
OpFwidthFine = 212,
OpDPdxCoarse = 213,
OpDPdyCoarse = 214,
OpFwidthCoarse = 215,
OpEmitVertex = 218,
OpEndPrimitive = 219,
OpEmitStreamVertex = 220,
OpEndStreamPrimitive = 221,
OpControlBarrier = 224,
OpMemoryBarrier = 225,
OpAtomicLoad = 227,
OpAtomicStore = 228,
OpAtomicExchange = 229,
OpAtomicCompareExchange = 230,
OpAtomicCompareExchangeWeak = 231,
OpAtomicIIncrement = 232,
OpAtomicIDecrement = 233,
OpAtomicIAdd = 234,
OpAtomicISub = 235,
OpAtomicSMin = 236,
OpAtomicUMin = 237,
OpAtomicSMax = 238,
OpAtomicUMax = 239,
OpAtomicAnd = 240,
OpAtomicOr = 241,
OpAtomicXor = 242,
OpPhi = 245,
OpLoopMerge = 246,
OpSelectionMerge = 247,
OpLabel = 248,
OpBranch = 249,
OpBranchConditional = 250,
OpSwitch = 251,
OpKill = 252,
OpReturn = 253,
OpReturnValue = 254,
OpUnreachable = 255,
OpLifetimeStart = 256,
OpLifetimeStop = 257,
OpGroupAsyncCopy = 259,
OpGroupWaitEvents = 260,
OpGroupAll = 261,
OpGroupAny = 262,
OpGroupBroadcast = 263,
OpGroupIAdd = 264,
OpGroupFAdd = 265,
OpGroupFMin = 266,
OpGroupUMin = 267,
OpGroupSMin = 268,
OpGroupFMax = 269,
OpGroupUMax = 270,
OpGroupSMax = 271,
OpReadPipe = 274,
OpWritePipe = 275,
OpReservedReadPipe = 276,
OpReservedWritePipe = 277,
OpReserveReadPipePackets = 278,
OpReserveWritePipePackets = 279,
OpCommitReadPipe = 280,
OpCommitWritePipe = 281,
OpIsValidReserveId = 282,
OpGetNumPipePackets = 283,
OpGetMaxPipePackets = 284,
OpGroupReserveReadPipePackets = 285,
OpGroupReserveWritePipePackets = 286,
OpGroupCommitReadPipe = 287,
OpGroupCommitWritePipe = 288,
OpEnqueueMarker = 291,
OpEnqueueKernel = 292,
OpGetKernelNDrangeSubGroupCount = 293,
OpGetKernelNDrangeMaxSubGroupSize = 294,
OpGetKernelWorkGroupSize = 295,
OpGetKernelPreferredWorkGroupSizeMultiple = 296,
OpRetainEvent = 297,
OpReleaseEvent = 298,
OpCreateUserEvent = 299,
OpIsValidEvent = 300,
OpSetUserEventStatus = 301,
OpCaptureEventProfilingInfo = 302,
OpGetDefaultQueue = 303,
OpBuildNDRange = 304,
OpImageSparseSampleImplicitLod = 305,
OpImageSparseSampleExplicitLod = 306,
OpImageSparseSampleDrefImplicitLod = 307,
OpImageSparseSampleDrefExplicitLod = 308,
OpImageSparseSampleProjImplicitLod = 309,
OpImageSparseSampleProjExplicitLod = 310,
OpImageSparseSampleProjDrefImplicitLod = 311,
OpImageSparseSampleProjDrefExplicitLod = 312,
OpImageSparseFetch = 313,
OpImageSparseGather = 314,
OpImageSparseDrefGather = 315,
OpImageSparseTexelsResident = 316,
OpNoLine = 317,
OpAtomicFlagTestAndSet = 318,
OpAtomicFlagClear = 319,
OpImageSparseRead = 320,
OpSizeOf = 321,
OpTypePipeStorage = 322,
OpConstantPipeStorage = 323,
OpCreatePipeFromPipeStorage = 324,
OpGetKernelLocalSizeForSubgroupCount = 325,
OpGetKernelMaxNumSubgroups = 326,
OpTypeNamedBarrier = 327,
OpNamedBarrierInitialize = 328,
OpMemoryNamedBarrier = 329,
OpModuleProcessed = 330,
OpExecutionModeId = 331,
OpDecorateId = 332,
OpGroupNonUniformElect = 333,
OpGroupNonUniformAll = 334,
OpGroupNonUniformAny = 335,
OpGroupNonUniformAllEqual = 336,
OpGroupNonUniformBroadcast = 337,
OpGroupNonUniformBroadcastFirst = 338,
OpGroupNonUniformBallot = 339,
OpGroupNonUniformInverseBallot = 340,
OpGroupNonUniformBallotBitExtract = 341,
OpGroupNonUniformBallotBitCount = 342,
OpGroupNonUniformBallotFindLSB = 343,
OpGroupNonUniformBallotFindMSB = 344,
OpGroupNonUniformShuffle = 345,
OpGroupNonUniformShuffleXor = 346,
OpGroupNonUniformShuffleUp = 347,
OpGroupNonUniformShuffleDown = 348,
OpGroupNonUniformIAdd = 349,
OpGroupNonUniformFAdd = 350,
OpGroupNonUniformIMul = 351,
OpGroupNonUniformFMul = 352,
OpGroupNonUniformSMin = 353,
OpGroupNonUniformUMin = 354,
OpGroupNonUniformFMin = 355,
OpGroupNonUniformSMax = 356,
OpGroupNonUniformUMax = 357,
OpGroupNonUniformFMax = 358,
OpGroupNonUniformBitwiseAnd = 359,
OpGroupNonUniformBitwiseOr = 360,
OpGroupNonUniformBitwiseXor = 361,
OpGroupNonUniformLogicalAnd = 362,
OpGroupNonUniformLogicalOr = 363,
OpGroupNonUniformLogicalXor = 364,
OpGroupNonUniformQuadBroadcast = 365,
OpGroupNonUniformQuadSwap = 366,
OpCopyLogical = 400,
OpPtrEqual = 401,
OpPtrNotEqual = 402,
OpPtrDiff = 403,
OpTerminateInvocation = 4416,
OpSubgroupBallotKHR = 4421,
OpSubgroupFirstInvocationKHR = 4422,
OpSubgroupAllKHR = 4428,
OpSubgroupAnyKHR = 4429,
OpSubgroupAllEqualKHR = 4430,
OpSubgroupReadInvocationKHR = 4432,
OpTypeRayQueryProvisionalKHR = 4472,
OpRayQueryInitializeKHR = 4473,
OpRayQueryTerminateKHR = 4474,
OpRayQueryGenerateIntersectionKHR = 4475,
OpRayQueryConfirmIntersectionKHR = 4476,
OpRayQueryProceedKHR = 4477,
OpRayQueryGetIntersectionTypeKHR = 4479,
OpGroupIAddNonUniformAMD = 5000,
OpGroupFAddNonUniformAMD = 5001,
OpGroupFMinNonUniformAMD = 5002,
OpGroupUMinNonUniformAMD = 5003,
OpGroupSMinNonUniformAMD = 5004,
OpGroupFMaxNonUniformAMD = 5005,
OpGroupUMaxNonUniformAMD = 5006,
OpGroupSMaxNonUniformAMD = 5007,
OpFragmentMaskFetchAMD = 5011,
OpFragmentFetchAMD = 5012,
OpReadClockKHR = 5056,
OpImageSampleFootprintNV = 5283,
OpGroupNonUniformPartitionNV = 5296,
OpWritePackedPrimitiveIndices4x8NV = 5299,
OpReportIntersectionKHR = 5334,
OpReportIntersectionNV = 5334,
OpIgnoreIntersectionKHR = 5335,
OpIgnoreIntersectionNV = 5335,
OpTerminateRayKHR = 5336,
OpTerminateRayNV = 5336,
OpTraceNV = 5337,
OpTraceRayKHR = 5337,
OpTypeAccelerationStructureKHR = 5341,
OpTypeAccelerationStructureNV = 5341,
OpExecuteCallableKHR = 5344,
OpExecuteCallableNV = 5344,
OpTypeCooperativeMatrixNV = 5358,
OpCooperativeMatrixLoadNV = 5359,
OpCooperativeMatrixStoreNV = 5360,
OpCooperativeMatrixMulAddNV = 5361,
OpCooperativeMatrixLengthNV = 5362,
OpBeginInvocationInterlockEXT = 5364,
OpEndInvocationInterlockEXT = 5365,
OpDemoteToHelperInvocationEXT = 5380,
OpIsHelperInvocationEXT = 5381,
OpSubgroupShuffleINTEL = 5571,
OpSubgroupShuffleDownINTEL = 5572,
OpSubgroupShuffleUpINTEL = 5573,
OpSubgroupShuffleXorINTEL = 5574,
OpSubgroupBlockReadINTEL = 5575,
OpSubgroupBlockWriteINTEL = 5576,
OpSubgroupImageBlockReadINTEL = 5577,
OpSubgroupImageBlockWriteINTEL = 5578,
OpSubgroupImageMediaBlockReadINTEL = 5580,
OpSubgroupImageMediaBlockWriteINTEL = 5581,
OpUCountLeadingZerosINTEL = 5585,
OpUCountTrailingZerosINTEL = 5586,
OpAbsISubINTEL = 5587,
OpAbsUSubINTEL = 5588,
OpIAddSatINTEL = 5589,
OpUAddSatINTEL = 5590,
OpIAverageINTEL = 5591,
OpUAverageINTEL = 5592,
OpIAverageRoundedINTEL = 5593,
OpUAverageRoundedINTEL = 5594,
OpISubSatINTEL = 5595,
OpUSubSatINTEL = 5596,
OpIMul32x16INTEL = 5597,
OpUMul32x16INTEL = 5598,
OpFunctionPointerINTEL = 5600,
OpFunctionPointerCallINTEL = 5601,
OpDecorateString = 5632,
OpDecorateStringGOOGLE = 5632,
OpMemberDecorateString = 5633,
OpMemberDecorateStringGOOGLE = 5633,
OpVmeImageINTEL = 5699,
OpTypeVmeImageINTEL = 5700,
OpTypeAvcImePayloadINTEL = 5701,
OpTypeAvcRefPayloadINTEL = 5702,
OpTypeAvcSicPayloadINTEL = 5703,
OpTypeAvcMcePayloadINTEL = 5704,
OpTypeAvcMceResultINTEL = 5705,
OpTypeAvcImeResultINTEL = 5706,
OpTypeAvcImeResultSingleReferenceStreamoutINTEL = 5707,
OpTypeAvcImeResultDualReferenceStreamoutINTEL = 5708,
OpTypeAvcImeSingleReferenceStreaminINTEL = 5709,
OpTypeAvcImeDualReferenceStreaminINTEL = 5710,
OpTypeAvcRefResultINTEL = 5711,
OpTypeAvcSicResultINTEL = 5712,
OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL = 5713,
OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL = 5714,
OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL = 5715,
OpSubgroupAvcMceSetInterShapePenaltyINTEL = 5716,
OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL = 5717,
OpSubgroupAvcMceSetInterDirectionPenaltyINTEL = 5718,
OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL = 5719,
OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL = 5720,
OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL = 5721,
OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL = 5722,
OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL = 5723,
OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL = 5724,
OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL = 5725,
OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL = 5726,
OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL = 5727,
OpSubgroupAvcMceSetAcOnlyHaarINTEL = 5728,
OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL = 5729,
OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL = 5730,
OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL = 5731,
OpSubgroupAvcMceConvertToImePayloadINTEL = 5732,
OpSubgroupAvcMceConvertToImeResultINTEL = 5733,
OpSubgroupAvcMceConvertToRefPayloadINTEL = 5734,
OpSubgroupAvcMceConvertToRefResultINTEL = 5735,
OpSubgroupAvcMceConvertToSicPayloadINTEL = 5736,
OpSubgroupAvcMceConvertToSicResultINTEL = 5737,
OpSubgroupAvcMceGetMotionVectorsINTEL = 5738,
OpSubgroupAvcMceGetInterDistortionsINTEL = 5739,
OpSubgroupAvcMceGetBestInterDistortionsINTEL = 5740,
OpSubgroupAvcMceGetInterMajorShapeINTEL = 5741,
OpSubgroupAvcMceGetInterMinorShapeINTEL = 5742,
OpSubgroupAvcMceGetInterDirectionsINTEL = 5743,
OpSubgroupAvcMceGetInterMotionVectorCountINTEL = 5744,
OpSubgroupAvcMceGetInterReferenceIdsINTEL = 5745,
OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL = 5746,
OpSubgroupAvcImeInitializeINTEL = 5747,
OpSubgroupAvcImeSetSingleReferenceINTEL = 5748,
OpSubgroupAvcImeSetDualReferenceINTEL = 5749,
OpSubgroupAvcImeRefWindowSizeINTEL = 5750,
OpSubgroupAvcImeAdjustRefOffsetINTEL = 5751,
OpSubgroupAvcImeConvertToMcePayloadINTEL = 5752,
OpSubgroupAvcImeSetMaxMotionVectorCountINTEL = 5753,
OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL = 5754,
OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL = 5755,
OpSubgroupAvcImeSetWeightedSadINTEL = 5756,
OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL = 5757,
OpSubgroupAvcImeEvaluateWithDualReferenceINTEL = 5758,
OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL = 5759,
OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL = 5760,
OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL = 5761,
OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL = 5762,
OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL = 5763,
OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL = 5764,
OpSubgroupAvcImeConvertToMceResultINTEL = 5765,
OpSubgroupAvcImeGetSingleReferenceStreaminINTEL = 5766,
OpSubgroupAvcImeGetDualReferenceStreaminINTEL = 5767,
OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL = 5768,
OpSubgroupAvcImeStripDualReferenceStreamoutINTEL = 5769,
OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL = 5770,
OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL = 5771,
OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL = 5772,
OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL = 5773,
OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL = 5774,
OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL = 5775,
OpSubgroupAvcImeGetBorderReachedINTEL = 5776,
OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL = 5777,
OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL = 5778,
OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL = 5779,
OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL = 5780,
OpSubgroupAvcFmeInitializeINTEL = 5781,
OpSubgroupAvcBmeInitializeINTEL = 5782,
OpSubgroupAvcRefConvertToMcePayloadINTEL = 5783,
OpSubgroupAvcRefSetBidirectionalMixDisableINTEL = 5784,
OpSubgroupAvcRefSetBilinearFilterEnableINTEL = 5785,
OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL = 5786,
OpSubgroupAvcRefEvaluateWithDualReferenceINTEL = 5787,
OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL = 5788,
OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL = 5789,
OpSubgroupAvcRefConvertToMceResultINTEL = 5790,
OpSubgroupAvcSicInitializeINTEL = 5791,
OpSubgroupAvcSicConfigureSkcINTEL = 5792,
OpSubgroupAvcSicConfigureIpeLumaINTEL = 5793,
OpSubgroupAvcSicConfigureIpeLumaChromaINTEL = 5794,
OpSubgroupAvcSicGetMotionVectorMaskINTEL = 5795,
OpSubgroupAvcSicConvertToMcePayloadINTEL = 5796,
OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL = 5797,
OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL = 5798,
OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL = 5799,
OpSubgroupAvcSicSetBilinearFilterEnableINTEL = 5800,
OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL = 5801,
OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL = 5802,
OpSubgroupAvcSicEvaluateIpeINTEL = 5803,
OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL = 5804,
OpSubgroupAvcSicEvaluateWithDualReferenceINTEL = 5805,
OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL = 5806,
OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL = 5807,
OpSubgroupAvcSicConvertToMceResultINTEL = 5808,
OpSubgroupAvcSicGetIpeLumaShapeINTEL = 5809,
OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL = 5810,
OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL = 5811,
OpSubgroupAvcSicGetPackedIpeLumaModesINTEL = 5812,
OpSubgroupAvcSicGetIpeChromaModeINTEL = 5813,
OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL = 5814,
OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL = 5815,
OpSubgroupAvcSicGetInterRawSadsINTEL = 5816,
OpLoopControlINTEL = 5887,
OpReadPipeBlockingINTEL = 5946,
OpWritePipeBlockingINTEL = 5947,
OpFPGARegINTEL = 5949,
OpRayQueryGetRayTMinKHR = 6016,
OpRayQueryGetRayFlagsKHR = 6017,
OpRayQueryGetIntersectionTKHR = 6018,
OpRayQueryGetIntersectionInstanceCustomIndexKHR = 6019,
OpRayQueryGetIntersectionInstanceIdKHR = 6020,
OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR = 6021,
OpRayQueryGetIntersectionGeometryIndexKHR = 6022,
OpRayQueryGetIntersectionPrimitiveIndexKHR = 6023,
OpRayQueryGetIntersectionBarycentricsKHR = 6024,
OpRayQueryGetIntersectionFrontFaceKHR = 6025,
OpRayQueryGetIntersectionCandidateAABBOpaqueKHR = 6026,
OpRayQueryGetIntersectionObjectRayDirectionKHR = 6027,
OpRayQueryGetIntersectionObjectRayOriginKHR = 6028,
OpRayQueryGetWorldRayDirectionKHR = 6029,
OpRayQueryGetWorldRayOriginKHR = 6030,
OpRayQueryGetIntersectionObjectToWorldKHR = 6031,
OpRayQueryGetIntersectionWorldToObjectKHR = 6032,
OpAtomicFAddEXT = 6035,
}
}
}
| 37.18
| 92
| 0.546682
|
[
"MIT"
] |
IceSDK/IceSDK
|
third-party/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.cs
| 59,488
|
C#
|
using System;
using UnityEngine;
namespace UnityStandardAssets.ImageEffects
{
[ExecuteInEditMode]
[RequireComponent (typeof(Camera))]
public class PostEffectsBase : MonoBehaviour
{
protected bool supportHDRTextures = true;
protected bool supportDX11 = false;
protected bool isSupported = true;
protected Material CheckShaderAndCreateMaterial ( Shader s, Material m2Create)
{
if (!s)
{
Debug.Log("Missing shader in " + ToString ());
enabled = false;
return null;
}
if (s.isSupported && m2Create && m2Create.shader == s)
return m2Create;
if (!s.isSupported)
{
NotSupported ();
Debug.Log("The shader " + s.ToString() + " on effect "+ToString()+" is not supported on this platform!");
return null;
}
else
{
m2Create = new Material (s);
m2Create.hideFlags = HideFlags.DontSave;
if (m2Create)
return m2Create;
else return null;
}
}
protected Material CreateMaterial (Shader s, Material m2Create)
{
if (!s)
{
Debug.Log ("Missing shader in " + ToString ());
return null;
}
if (m2Create && (m2Create.shader == s) && (s.isSupported))
return m2Create;
if (!s.isSupported)
{
return null;
}
else
{
m2Create = new Material (s);
m2Create.hideFlags = HideFlags.DontSave;
if (m2Create)
return m2Create;
else return null;
}
}
void OnEnable ()
{
isSupported = true;
}
protected bool CheckSupport ()
{
return CheckSupport (false);
}
public virtual bool CheckResources ()
{
Debug.LogWarning ("CheckResources () for " + ToString() + " should be overwritten.");
return isSupported;
}
protected void Start ()
{
CheckResources ();
}
protected bool CheckSupport (bool needDepth)
{
isSupported = true;
supportHDRTextures = SystemInfo.SupportsRenderTextureFormat(RenderTextureFormat.ARGBHalf);
supportDX11 = SystemInfo.graphicsShaderLevel >= 50 && SystemInfo.supportsComputeShaders;
if (!SystemInfo.supportsImageEffects || !SystemInfo.supportsRenderTextures)
{
NotSupported ();
return false;
}
if (needDepth && !SystemInfo.SupportsRenderTextureFormat (RenderTextureFormat.Depth))
{
NotSupported ();
return false;
}
if (needDepth)
GetComponent<Camera>().depthTextureMode |= DepthTextureMode.Depth;
return true;
}
protected bool CheckSupport (bool needDepth, bool needHdr)
{
if (!CheckSupport(needDepth))
return false;
if (needHdr && !supportHDRTextures)
{
NotSupported ();
return false;
}
return true;
}
public bool Dx11Support ()
{
return supportDX11;
}
protected void ReportAutoDisable ()
{
Debug.LogWarning ("The image effect " + ToString() + " has been disabled as it's not supported on the current platform.");
}
// deprecated but needed for old effects to survive upgrading
bool CheckShader (Shader s)
{
Debug.Log("The shader " + s.ToString () + " on effect "+ ToString () + " is not part of the Unity 3.2+ effects suite anymore. For best performance and quality, please ensure you are using the latest Standard Assets Image Effects (Pro only) package.");
if (!s.isSupported)
{
NotSupported ();
return false;
}
else
{
return false;
}
}
protected void NotSupported ()
{
enabled = false;
isSupported = false;
return;
}
protected void DrawBorder (RenderTexture dest, Material material)
{
float x1;
float x2;
float y1;
float y2;
RenderTexture.active = dest;
bool invertY = true; // source.texelSize.y < 0.0ff;
// Set up the simple Matrix
GL.PushMatrix();
GL.LoadOrtho();
for (int i = 0; i < material.passCount; i++)
{
material.SetPass(i);
float y1_; float y2_;
if (invertY)
{
y1_ = 1.0f; y2_ = 0.0f;
}
else
{
y1_ = 0.0f; y2_ = 1.0f;
}
// left
x1 = 0.0f;
x2 = 0.0f + 1.0f/(dest.width*1.0f);
y1 = 0.0f;
y2 = 1.0f;
GL.Begin(GL.QUADS);
GL.TexCoord2(0.0f, y1_); GL.Vertex3(x1, y1, 0.1f);
GL.TexCoord2(1.0f, y1_); GL.Vertex3(x2, y1, 0.1f);
GL.TexCoord2(1.0f, y2_); GL.Vertex3(x2, y2, 0.1f);
GL.TexCoord2(0.0f, y2_); GL.Vertex3(x1, y2, 0.1f);
// right
x1 = 1.0f - 1.0f/(dest.width*1.0f);
x2 = 1.0f;
y1 = 0.0f;
y2 = 1.0f;
GL.TexCoord2(0.0f, y1_); GL.Vertex3(x1, y1, 0.1f);
GL.TexCoord2(1.0f, y1_); GL.Vertex3(x2, y1, 0.1f);
GL.TexCoord2(1.0f, y2_); GL.Vertex3(x2, y2, 0.1f);
GL.TexCoord2(0.0f, y2_); GL.Vertex3(x1, y2, 0.1f);
// top
x1 = 0.0f;
x2 = 1.0f;
y1 = 0.0f;
y2 = 0.0f + 1.0f/(dest.height*1.0f);
GL.TexCoord2(0.0f, y1_); GL.Vertex3(x1, y1, 0.1f);
GL.TexCoord2(1.0f, y1_); GL.Vertex3(x2, y1, 0.1f);
GL.TexCoord2(1.0f, y2_); GL.Vertex3(x2, y2, 0.1f);
GL.TexCoord2(0.0f, y2_); GL.Vertex3(x1, y2, 0.1f);
// bottom
x1 = 0.0f;
x2 = 1.0f;
y1 = 1.0f - 1.0f/(dest.height*1.0f);
y2 = 1.0f;
GL.TexCoord2(0.0f, y1_); GL.Vertex3(x1, y1, 0.1f);
GL.TexCoord2(1.0f, y1_); GL.Vertex3(x2, y1, 0.1f);
GL.TexCoord2(1.0f, y2_); GL.Vertex3(x2, y2, 0.1f);
GL.TexCoord2(0.0f, y2_); GL.Vertex3(x1, y2, 0.1f);
GL.End();
}
GL.PopMatrix();
}
}
}
| 28.32377
| 263
| 0.46795
|
[
"CC0-1.0"
] |
00010023/waifu.run
|
assets/NatureStarterKit2/Standard Assets/Effects/ImageEffects/Scripts/PostEffectsBase.cs
| 6,911
|
C#
|
using System;
using System.Web.Mvc;
using IBuyStuff.Application.InputModels.Order;
using IBuyStuff.Application.Services;
using IBuyStuff.Application.Services.Order;
using IBuyStuff.Application.ViewModels;
using IBuyStuff.Application.ViewModels.Orders;
namespace IBuyStuff.Server.Controllers.Business
{
[Authorize]
public class OrderController : Controller
{
private readonly IOrderControllerService _service;
public OrderController()
: this(new OrderControllerService())
{
}
public OrderController(IOrderControllerService service)
{
_service = service;
}
#region Search task
[Route("orders")]
[ActionName("SearchUi")]
public ActionResult SearchMain()
{
return View("search-ui", new ViewModelBase());
}
[HttpGet]
[ActionName("Search")]
public ActionResult SearchResults(int id)
{
var model = _service.RetrieveOrderForCustomer(id);
return View(model);
}
[HttpPost]
[ActionName("Search")]
public ActionResult SearchCommand(int id = 0)
{
// PRG (Post-Redirect-Get) pattern to avoid F5 refresh issues
// (and also key step to neatly separate Commands from Queries in the future)
return RedirectToAction("Search", new {id = id});
}
[HttpGet]
[ActionName("Last")]
public ActionResult LastOrderResults()
{
var customerId = User.Identity.Name;
var model = _service.RetrieveLastOrderForCustomer(customerId);
return View("Search", model);
}
[HttpPost]
[ActionName("Last")]
public ActionResult LastOrderCommand(int id = 0)
{
// PRG (Post-Redirect-Get) pattern to avoid F5 refresh issues
// (and also key step to neatly separate Commands from Queries in the future)
return RedirectToAction("Last"/*, new { id = id }*/);
}
#endregion
#region New Order task
[HttpGet]
public ActionResult New()
{
var customerId = User.Identity.Name;
var shoppingCartModel = _service.CreateShoppingCartForCustomer(customerId);
shoppingCartModel.EnableEditOnShoppingCart = true;
SaveCurrentShoppingCart(shoppingCartModel);
return View("shoppingcart", shoppingCartModel);
}
#endregion
#region Add Item task
[HttpPost]
[ActionName("AddTo")]
public ActionResult AddToShoppingCartCommand(int productId, int quantity=1)
{
var cart = RetrieveCurrentShoppingCart();
cart = _service.AddProductToShoppingCart(cart, productId, quantity);
SaveCurrentShoppingCart(cart);
// PRG (Post-Redirect-Get) pattern to avoid F5 refresh issues
// (and also key step to neatly separate Commands from Queries in the future)
return RedirectToAction("AddTo");
}
[HttpGet]
[ActionName("AddTo")]
public ActionResult DisplayShoppingCartCommand()
{
var cart = RetrieveCurrentShoppingCart();
cart.EnableEditOnShoppingCart = true;
return View("shoppingcart", cart);
}
#endregion
#region Remove Order Item task
[HttpGet]
[ActionName("Remove")]
public ActionResult RefreshShoppingCart(int itemIndex = -1)
{
return DisplayShoppingCartCommand();
}
[HttpPost]
[ActionName("Remove")]
public ActionResult RemoveItemFromShoppingCart(int itemIndex = -1)
{
if (itemIndex < 0)
return RedirectToAction("Remove");
var cart = RetrieveCurrentShoppingCart();
if (itemIndex >= cart.OrderRequest.Items.Count)
return RedirectToAction("Remove");
cart.OrderRequest.Items.RemoveAt(itemIndex);
SaveCurrentShoppingCart(cart);
// PRG (Post-Redirect-Get) pattern to avoid F5 refresh issues
// (and also key step to neatly separate Commands from Queries in the future)
return RedirectToAction("Remove");
}
#endregion
#region Checkout
[HttpGet]
[ActionName("Checkout")]
public ActionResult DisplayCheckoutPage()
{
// Get details: address, payment
var cart = RetrieveCurrentShoppingCart();
cart.EnableEditOnShoppingCart = false;
return View(cart);
}
[HttpPost]
[ActionName("Checkout")]
public ActionResult Checkout(CheckoutInputModel checkout)
{
// Pre-payment steps
var cart = RetrieveCurrentShoppingCart();
var response = _service.ProcessOrderBeforePayment(cart, checkout);
if (!response.Denied)
{
return Redirect(Url.Content("~/fake_payment.aspx?"));
}
TempData["ibuy-stuff:denied"] = response;
return RedirectToAction("Denied");
}
public ActionResult EndCheckout(string tid)
{
// Pre-payment steps
var cart = RetrieveCurrentShoppingCart();
var response = _service.ProcessOrderAfterPayment(cart, tid);
var action = response.Denied ? "denied" : "processed";
return View(action, response);
}
public ActionResult Denied()
{
var model = TempData["ibuy-stuff:denied"] ?? new OrderProcessingViewModel();
return View(model);
}
public ActionResult Processed()
{
return View(new OrderProcessedViewModel());
}
#endregion
#region Internal members
private static string GetShoppingCartName(string customerId)
{
return String.Format("I-Buy-Stuff-Cart:{0}", customerId);
}
private ShoppingCartViewModel RetrieveCurrentShoppingCart()
{
var customerId = User.Identity.Name;
var cartName = GetShoppingCartName(customerId);
var cart = Session[cartName] as ShoppingCartViewModel ?? _service.CreateShoppingCartForCustomer(customerId);
return cart;
}
private void SaveCurrentShoppingCart(ShoppingCartViewModel cart)
{
var customerId = User.Identity.Name;
var cartName = GetShoppingCartName(customerId);
Session[cartName] = cart;
}
#endregion
}
}
| 32.381643
| 120
| 0.591825
|
[
"MIT"
] |
nodashin/DDD-OnionArchitecture-Traning
|
Samples/IBuyStuff/IBuyStuff-dm/src/Site/IBuyStuff.Server/Controllers/Business/OrderController.cs
| 6,705
|
C#
|
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="DefaultRegistry.cs" company="Web Advanced">
// Copyright 2012 Web Advanced (www.webadvanced.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.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------
namespace SFA.Apprenticeship.Web.Api.DependencyResolution {
using System.Web;
using Apprenticeships.Application.Communication;
using Apprenticeships.Application.Communication.Strategies;
using Apprenticeships.Application.Employer;
using Apprenticeships.Application.Employer.Strategies;
using Apprenticeships.Application.Interfaces;
using Apprenticeships.Application.Interfaces.Communications;
using Apprenticeships.Application.Interfaces.Employers;
using Apprenticeships.Application.Interfaces.Organisations;
using Apprenticeships.Application.Organisation;
using Apprenticeships.Application.ReferenceData;
using Apprenticeships.Application.Vacancy;
using Apprenticeships.Application.VacancyPosting.Strategies;
using Apprenticeships.Infrastructure.Raa;
using Apprenticeships.Infrastructure.Raa.Mappers;
using Apprenticeships.Infrastructure.Raa.Strategies;
using Apprenticeships.Web.Raa.Common.Mappers;
using StructureMap.Configuration.DSL;
public class DefaultRegistry : Registry {
#region Constructors and Destructors
public DefaultRegistry()
{
For<HttpContextBase>().Use(ctx => new HttpContextWrapper(HttpContext.Current));
For<IMapper>().Singleton().Use<RaaCommonWebMappers>().Name = "RaaCommonWebMappers";
//For<IMapper>().Singleton().Use<RecruitMappers>().Name = "RecruitMappers";
For<IGetByIdStrategy>().Use<GetByIdStrategy>();
For<IGetByIdsStrategy>().Use<GetByIdsStrategy>();
For<IGetByEdsUrnStrategy>().Use<GetByEdsUrnStrategy>().Ctor<IMapper>().Named("EmployerMappers");
For<IVacancySummaryService>().Use<VacancySummaryService>().Ctor<IMapper>().Named("RaaCommonWebMappers");
For<IEmployerService>().Use<EmployerService>();
For<IOrganisationService>().Use<OrganisationService>();
For<IEmployerCommunicationService>().Use<EmployerCommunicationService>();
For<ISearchEmployersStrategy>().Use<SearchEmployersStrategy>().Ctor<IMapper>().Named("EmployerMappers");
For<ISaveEmployerStrategy>().Use<SaveEmployerStrategy>();
For<ISendEmployerLinksStrategy>().Use<SendEmployerLinksStrategy>();
For<ISendEmployerCommunicationStrategy>().Use<QueueEmployerCommunicationStrategy>();
For<IPublishVacancySummaryUpdateStrategy>().Use<PublishVacancySummaryUpdateStrategy>().Ctor<IMapper>().Is<VacancySummaryUpdateMapper>();
For<IReferenceDataProvider>().Use<ReferenceDataProvider>();
For<IGetReleaseNotesStrategy>().Use<GetReleaseNotesStrategy>();
}
#endregion
}
}
| 50.887324
| 148
| 0.687517
|
[
"MIT"
] |
BugsUK/FindApprenticeship
|
src/SFA.Apprenticeship.Web.Api/DependencyResolution/DefaultRegistry.cs
| 3,613
|
C#
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using maths.Distribution;
namespace maths.Helpers
{
public class Gamma
{
/// <summary>
/// Natural logarithm of the gamma function.
/// </summary>
///
public static double Log(double x)
{
double p, q, w, z;
double[] A =
{
8.11614167470508450300E-4,
-5.95061904284301438324E-4,
7.93650340457716943945E-4,
-2.77777777730099687205E-3,
8.33333333333331927722E-2
};
double[] B =
{
-1.37825152569120859100E3,
-3.88016315134637840924E4,
-3.31612992738871184744E5,
-1.16237097492762307383E6,
-1.72173700820839662146E6,
-8.53555664245765465627E5
};
double[] C =
{
-3.51815701436523470549E2,
-1.70642106651881159223E4,
-2.20528590553854454839E5,
-1.13933444367982507207E6,
-2.53252307177582951285E6,
-2.01889141433532773231E6
};
if (x < -34.0)
{
q = -x;
w = Log(q);
p = System.Math.Floor(q);
if (p == q)
throw new OverflowException();
z = q - p;
if (z > 0.5)
{
p += 1.0;
z = p - q;
}
z = q * System.Math.Sin(System.Math.PI * z);
if (z == 0.0)
throw new OverflowException();
z = Constants.LogPI - System.Math.Log(z) - w;
return z;
}
if (x < 13.0)
{
z = 1.0;
while (x >= 3.0)
{
x -= 1.0;
z *= x;
}
while (x < 2.0)
{
if (x == 0.0)
throw new OverflowException();
z /= x;
x += 1.0;
}
if (z < 0.0) z = -z;
if (x == 2.0) return System.Math.Log(z);
x -= 2.0;
p = x * PolynomialHelper.Polevl(x, B, 5) / PolynomialHelper.P1evl(x, C, 6);
return (System.Math.Log(z) + p);
}
if (x > 2.556348e305)
throw new OverflowException();
q = (x - 0.5) * System.Math.Log(x) - x + 0.91893853320467274178;
if (x > 1.0e8) return (q);
p = 1.0 / (x * x);
if (x >= 1000.0)
{
q += ((7.9365079365079365079365e-4 * p
- 2.7777777777777777777778e-3) * p
+ 0.0833333333333333333333) / x;
}
else
{
q += PolynomialHelper.Polevl(p, A, 4) / x;
}
return q;
}
/// <summary>
/// Digamma function.
/// </summary>
///
public static double Digamma(double x)
{
double s = 0;
double w = 0;
double y = 0;
double z = 0;
double nz = 0;
bool negative = false;
if (x <= 0.0)
{
negative = true;
double q = x;
double p = (int)System.Math.Floor(q);
if (p == q)
throw new OverflowException("Function computation resulted in arithmetic overflow.");
nz = q - p;
if (nz != 0.5)
{
if (nz > 0.5)
{
p = p + 1.0;
nz = q - p;
}
nz = System.Math.PI / System.Math.Tan(System.Math.PI * nz);
}
else
{
nz = 0.0;
}
x = 1.0 - x;
}
if (x <= 10.0 & x == System.Math.Floor(x))
{
y = 0.0;
var n = (int)System.Math.Floor(x);
for (var i = 1; i <= n - 1; i++)
{
w = i;
y = y + 1.0 / w;
}
y = y - 0.57721566490153286061;
}
else
{
s = x;
w = 0.0;
while (s < 10.0)
{
w = w + 1.0 / s;
s = s + 1.0;
}
if (s < 1.0E17)
{
z = 1.0 / (s * s);
var polv = 8.33333333333333333333E-2;
polv = polv * z - 2.10927960927960927961E-2;
polv = polv * z + 7.57575757575757575758E-3;
polv = polv * z - 4.16666666666666666667E-3;
polv = polv * z + 3.96825396825396825397E-3;
polv = polv * z - 8.33333333333333333333E-3;
polv = polv * z + 8.33333333333333333333E-2;
y = z * polv;
}
else
{
y = 0.0;
}
y = System.Math.Log(s) - 0.5 / s - y - w;
}
if (negative == true)
{
y = y - nz;
}
return y;
}
/// <summary>
/// Trigamma function.
/// </summary>
///
/// <remarks>
/// This code has been adapted from the FORTRAN77 and subsequent
/// C code by B. E. Schneider and John Burkardt. The code had been
/// made public under the GNU LGPL license.
/// </remarks>
///
public static double Trigamma(double x)
{
var a = 0.0001;
var b = 5.0;
var b2 = 0.1666666667;
var b4 = -0.03333333333;
var b6 = 0.02380952381;
var b8 = -0.03333333333;
double value;
double y;
double z;
// Check the input.
if (x <= 0.0)
{
throw new ArgumentException("The input parameter x must be positive.", "x");
}
z = x;
// Use small value approximation if X <= A.
if (x <= a)
{
value = 1.0 / x / x;
return value;
}
// Increase argument to ( X + I ) >= B.
value = 0.0;
while (z < b)
{
value = value + 1.0 / z / z;
z = z + 1.0;
}
// Apply asymptotic formula if argument is B or greater.
y = 1.0 / z / z;
value = value + 0.5 *
y + (1.0
+ y * (b2
+ y * (b4
+ y * (b6
+ y * b8)))) / z;
return value;
}
}
}
| 26.825926
| 105
| 0.346403
|
[
"MIT"
] |
cschen1205/cs-genetic-programming
|
lgp/Helpers/Gamma.cs
| 7,245
|
C#
|
using System.Threading.Tasks;
using Tweetinvi.Models;
namespace Tweetinvi
{
public static class RateLimitAsync
{
public static async Task<ICredentialsRateLimits> GetCurrentCredentialsRateLimits()
{
return await Sync.ExecuteTaskAsync(() => RateLimit.GetCurrentCredentialsRateLimits());
}
public static async Task<ICredentialsRateLimits> GetCredentialsRateLimits(ITwitterCredentials credentials)
{
return await Sync.ExecuteTaskAsync(() => RateLimit.GetCredentialsRateLimits(credentials));
}
}
}
| 31.473684
| 115
| 0.687291
|
[
"MIT"
] |
247GradLabs/tweetinvi
|
Tweetinvi/RateLimitAsync.cs
| 600
|
C#
|
namespace stellar_dotnet_sdk.responses.results
{
/// <summary>
/// No issuer for what we are selling.
/// </summary>
public class ManageSellOfferSellNoIssuer : ManageSellOfferResult
{
}
}
| 21.2
| 68
| 0.674528
|
[
"Apache-2.0"
] |
BlockForks/dotnet-stellar-sdk
|
stellar-dotnet-sdk/responses/results/ManageSellOfferSellNoIssuer.cs
| 212
|
C#
|
// ------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
// ------------------------------------------------------------------------------
// **NOTE** This file was generated by a tool and any changes will be overwritten.
// <auto-generated/>
// Template Source: Templates\CSharp\Requests\MethodRequest.cs.tt
namespace Microsoft.Graph
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Net.Http;
using System.Threading;
/// <summary>
/// The type WorkbookFunctionsReceivedRequest.
/// </summary>
public partial class WorkbookFunctionsReceivedRequest : BaseRequest, IWorkbookFunctionsReceivedRequest
{
/// <summary>
/// Constructs a new WorkbookFunctionsReceivedRequest.
/// </summary>
public WorkbookFunctionsReceivedRequest(
string requestUrl,
IBaseClient client,
IEnumerable<Option> options)
: base(requestUrl, client, options)
{
this.ContentType = "application/json";
this.RequestBody = new WorkbookFunctionsReceivedRequestBody();
}
/// <summary>
/// Gets the request body.
/// </summary>
public WorkbookFunctionsReceivedRequestBody RequestBody { get; private set; }
/// <summary>
/// Issues the POST request.
/// </summary>
public System.Threading.Tasks.Task<WorkbookFunctionResult> PostAsync()
{
return this.PostAsync(CancellationToken.None);
}
/// <summary>
/// Issues the POST request.
/// </summary>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
/// <returns>The task to await for async call.</returns>
public System.Threading.Tasks.Task<WorkbookFunctionResult> PostAsync(
CancellationToken cancellationToken)
{
this.Method = "POST";
return this.SendAsync<WorkbookFunctionResult>(this.RequestBody, cancellationToken);
}
/// <summary>
/// Adds the specified expand value to the request.
/// </summary>
/// <param name="value">The expand value.</param>
/// <returns>The request object to send.</returns>
public IWorkbookFunctionsReceivedRequest Expand(string value)
{
this.QueryOptions.Add(new QueryOption("$expand", value));
return this;
}
/// <summary>
/// Adds the specified select value to the request.
/// </summary>
/// <param name="value">The select value.</param>
/// <returns>The request object to send.</returns>
public IWorkbookFunctionsReceivedRequest Select(string value)
{
this.QueryOptions.Add(new QueryOption("$select", value));
return this;
}
}
}
| 35.321839
| 153
| 0.585421
|
[
"MIT"
] |
OfficeGlobal/msgraph-beta-sdk-dotnet
|
src/Microsoft.Graph/Requests/Generated/WorkbookFunctionsReceivedRequest.cs
| 3,073
|
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 dynamodb-2012-08-10.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.DynamoDBv2.Model
{
/// <summary>
/// Point in time recovery has not yet been enabled for this source table.
/// </summary>
#if !NETSTANDARD
[Serializable]
#endif
public partial class PointInTimeRecoveryUnavailableException : AmazonDynamoDBException
{
/// <summary>
/// Constructs a new PointInTimeRecoveryUnavailableException with the specified error
/// message.
/// </summary>
/// <param name="message">
/// Describes the error encountered.
/// </param>
public PointInTimeRecoveryUnavailableException(string message)
: base(message) {}
/// <summary>
/// Construct instance of PointInTimeRecoveryUnavailableException
/// </summary>
/// <param name="message"></param>
/// <param name="innerException"></param>
public PointInTimeRecoveryUnavailableException(string message, Exception innerException)
: base(message, innerException) {}
/// <summary>
/// Construct instance of PointInTimeRecoveryUnavailableException
/// </summary>
/// <param name="innerException"></param>
public PointInTimeRecoveryUnavailableException(Exception innerException)
: base(innerException) {}
/// <summary>
/// Construct instance of PointInTimeRecoveryUnavailableException
/// </summary>
/// <param name="message"></param>
/// <param name="innerException"></param>
/// <param name="errorType"></param>
/// <param name="errorCode"></param>
/// <param name="requestId"></param>
/// <param name="statusCode"></param>
public PointInTimeRecoveryUnavailableException(string message, Exception innerException, ErrorType errorType, string errorCode, string requestId, HttpStatusCode statusCode)
: base(message, innerException, errorType, errorCode, requestId, statusCode) {}
/// <summary>
/// Construct instance of PointInTimeRecoveryUnavailableException
/// </summary>
/// <param name="message"></param>
/// <param name="errorType"></param>
/// <param name="errorCode"></param>
/// <param name="requestId"></param>
/// <param name="statusCode"></param>
public PointInTimeRecoveryUnavailableException(string message, ErrorType errorType, string errorCode, string requestId, HttpStatusCode statusCode)
: base(message, errorType, errorCode, requestId, statusCode) {}
#if !NETSTANDARD
/// <summary>
/// Constructs a new instance of the PointInTimeRecoveryUnavailableException class with serialized data.
/// </summary>
/// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext" /> that contains contextual information about the source or destination.</param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="info" /> parameter is null. </exception>
/// <exception cref="T:System.Runtime.Serialization.SerializationException">The class name is null or <see cref="P:System.Exception.HResult" /> is zero (0). </exception>
protected PointInTimeRecoveryUnavailableException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
: base(info, context)
{
}
/// <summary>
/// Sets the <see cref="T:System.Runtime.Serialization.SerializationInfo" /> with information about the exception.
/// </summary>
/// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext" /> that contains contextual information about the source or destination.</param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="info" /> parameter is a null reference (Nothing in Visual Basic). </exception>
#if BCL35
[System.Security.Permissions.SecurityPermission(
System.Security.Permissions.SecurityAction.LinkDemand,
Flags = System.Security.Permissions.SecurityPermissionFlag.SerializationFormatter)]
#endif
[System.Security.SecurityCritical]
// These FxCop rules are giving false-positives for this method
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2134:MethodsMustOverrideWithConsistentTransparencyFxCopRule")]
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
{
base.GetObjectData(info, context);
}
#endif
}
}
| 48.741935
| 181
| 0.690437
|
[
"Apache-2.0"
] |
ChristopherButtars/aws-sdk-net
|
sdk/src/Services/DynamoDBv2/Generated/Model/PointInTimeRecoveryUnavailableException.cs
| 6,044
|
C#
|
//*******************************************************************************************//
// //
// Download Free Evaluation Version From: https://bytescout.com/download/web-installer //
// //
// Also available as Web API! Get Your Free API Key: https://app.pdf.co/signup //
// //
// Copyright © 2017-2020 ByteScout, Inc. All rights reserved. //
// https://www.bytescout.com //
// https://pdf.co //
// //
//*******************************************************************************************//
/// <summary>
/// https://github.com/Efferent-Health/HL7-dotnetcore
/// </summary>
namespace HL7.Dotnetcore
{
public abstract class MessageElement
{
protected string _value = string.Empty;
public string Value
{
get
{
return _value == Encoding.PresentButNull ? null : _value;
}
set
{
_value = value;
ProcessValue();
}
}
public HL7Encoding Encoding { get; protected set; }
protected abstract void ProcessValue();
}
}
| 40.714286
| 95
| 0.297076
|
[
"Apache-2.0"
] |
atkins126/ByteScout-SDK-SourceCode
|
Cloud API Server/Document Parser API/C#/Parse and Generate HL7 Output/Src/MessageElement.cs
| 1,711
|
C#
|
using UnityEngine;
using UnityEngine.UI;
namespace FallingBoxes
{
public class GameManager : MonoBehaviour
{
public GameObject box;
public GameObject platformPiece;
public GameObject character;
public GameObject laser;
public GameObject motivationArrow;
private Transform gameManager;
private int boxSpawnPeriodicity = 400;
private int laserSpawnPeriodicity = 50;
private static float maxHeightReached = 0f;
private int boxSpawnOffset = 40;
private int boxSpawnVariance = 0;
// public float minGravity = 0.75f;
// public float maxGravity = 1.25f;
private int difficulty = 1;
private int highestDifficulty = 1;
private int numLasers = 0;
private int boxDeltaX = 10;
private int laserDeltaX = 14;
public int maxTotalLasers = 5;
private int minArea = 2;
void Awake ()
{
InitGame ();
}
// Update is called once per frame
void Update ()
{
difficulty = ((int)Mathf.Abs (character.transform.position.y) / 100) + 1;
if (difficulty > highestDifficulty) {
highestDifficulty = difficulty;
numLasers = (int)Mathf.Ceil ((difficulty / 10f / (1f + difficulty / 10f)) * maxTotalLasers); // x / (1 + x) --> 1/11, 1/6, 3/7, 1/2, 5/9, 3/5, 2/3, 5/7, 3/4, 7/9
becomeMotivated();
}
if (Time.frameCount % boxSpawnPeriodicity == 0) {
int boxNum = Time.frameCount / boxSpawnPeriodicity;
box.name = "box" + boxNum.ToString ();
int randomWidth = Random.Range (0, 5);
int randomHeight = Random.Range (0, 5);
float boxX = Random.Range (-boxDeltaX, boxDeltaX);
float boxY = Random.Range (boxSpawnOffset - boxSpawnVariance, boxSpawnOffset + boxSpawnVariance) + character.transform.position.y;
GameObject newBox = Instantiate (box, new Vector3 (boxX, boxY, 0f), Quaternion.identity, gameManager);
// newBox.GetComponent<Rigidbody2D> ().gravityScale = Random.Range (minGravity, maxGravity);
newBox.transform.localScale += new Vector3 (randomWidth, randomHeight, 0f);
newBox.GetComponent<Uncollide> ().mainCharacter = character.GetComponent<MainCharacter> ();
}
if (maxHeightReached < character.transform.position.y) {
maxHeightReached = character.transform.position.y;
}
Text highScore = GameObject.Find ("HighScore").GetComponent<Text> ();
highScore.text = "High Score: " + Mathf.Round(maxHeightReached).ToString ();
Text currentScore = GameObject.Find ("CurrentScore").GetComponent<Text> ();
currentScore.text = "Current Score: " + Mathf.Round(character.transform.position.y).ToString ();
if ((Time.frameCount % laserSpawnPeriodicity == 0) && numLasers > 0) {
//GameObject newLaser = Instantiate(laser, new Vector3(laserDeltaX * (Mathf.Sign(Random.Range(-1,1))), character.transform.position.y + boxSpawnOffset, 0f), Quaternion.identity, gameManager);
Instantiate (laser, new Vector3 (laserDeltaX * (Mathf.Sign (Random.Range (-1, 1))), character.transform.position.y + boxSpawnOffset, 0f), Quaternion.identity, gameManager);
numLasers--;
}
SaveScore ();
}
void InitGame ()
{
if (PlayerPrefs.HasKey ("highscore")) {
maxHeightReached = PlayerPrefs.GetFloat ("highscore");
}
gameManager = new GameObject ("Game").transform;
GameObject startingPlatform = Instantiate (platformPiece, new Vector3 (-15, 3.866f, 0f), Quaternion.identity, gameManager) as GameObject;
GameObject startingCeiling = Instantiate (platformPiece, new Vector3 (-14.376f, -0.634f, 0f), Quaternion.Euler (new Vector3 (0, 0, 90)), gameManager) as GameObject;
GameObject startingNookWall = Instantiate (platformPiece, new Vector3 (-15, -0.634f, 0f), Quaternion.identity, gameManager) as GameObject;
startingCeiling.GetComponent<Uncollide> ().mainCharacter = character.GetComponent<MainCharacter> ();
startingNookWall.GetComponent<Uncollide> ().mainCharacter = character.GetComponent<MainCharacter> ();
startingPlatform.GetComponent<Uncollide> ().mainCharacter = character.GetComponent<MainCharacter> ();
Destroy (startingPlatform, 30f);
Destroy (startingCeiling, 30f);
Destroy (startingNookWall, 30f);
}
void SaveScore ()
{
PlayerPrefs.SetFloat ("highscore", Mathf.Round(maxHeightReached));
}
void becomeMotivated() {
GameObject newMotivation = Instantiate (motivationArrow, new Vector3 (0f, character.transform.position.y + boxSpawnOffset, 0f), Quaternion.identity, gameManager) as GameObject;
newMotivation.layer = 10;
}
}
}
| 39.810811
| 195
| 0.716904
|
[
"MIT"
] |
grahamallen/falling-boxes
|
Assets/Standard Assets/2D/Scripts/GameManager.cs
| 4,421
|
C#
|
#pragma warning disable 108 // new keyword hiding
#pragma warning disable 114 // new keyword hiding
namespace Windows.Devices.AllJoyn
{
#if __ANDROID__ || __IOS__ || NET46 || __WASM__ || __MACOS__
[global::Uno.NotImplemented]
#endif
public partial class AllJoynBusAttachmentStateChangedEventArgs
{
#if __ANDROID__ || __IOS__ || NET46 || __WASM__ || __MACOS__
[global::Uno.NotImplemented]
public global::Windows.Devices.AllJoyn.AllJoynBusAttachmentState State
{
get
{
throw new global::System.NotImplementedException("The member AllJoynBusAttachmentState AllJoynBusAttachmentStateChangedEventArgs.State is not implemented in Uno.");
}
}
#endif
#if __ANDROID__ || __IOS__ || NET46 || __WASM__ || __MACOS__
[global::Uno.NotImplemented]
public int Status
{
get
{
throw new global::System.NotImplementedException("The member int AllJoynBusAttachmentStateChangedEventArgs.Status is not implemented in Uno.");
}
}
#endif
// Forced skipping of method Windows.Devices.AllJoyn.AllJoynBusAttachmentStateChangedEventArgs.State.get
// Forced skipping of method Windows.Devices.AllJoyn.AllJoynBusAttachmentStateChangedEventArgs.Status.get
}
}
| 35.088235
| 168
| 0.765298
|
[
"Apache-2.0"
] |
AlexTrepanier/Uno
|
src/Uno.UWP/Generated/3.0.0.0/Windows.Devices.AllJoyn/AllJoynBusAttachmentStateChangedEventArgs.cs
| 1,193
|
C#
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Game.Rulesets.UI.Scrolling;
using osu.Game.Skinning;
using osuTK;
using osuTK.Graphics;
namespace osu.Game.Rulesets.Mania.Skinning.Legacy
{
public class LegacyHitTarget : CompositeDrawable
{
private readonly IBindable<ScrollingDirection> direction = new Bindable<ScrollingDirection>();
private Container directionContainer;
[BackgroundDependencyLoader]
private void load(ISkinSource skin, IScrollingInfo scrollingInfo)
{
string targetImage = skin.GetManiaSkinConfig<string>(LegacyManiaSkinConfigurationLookups.HitTargetImage)?.Value
?? "mania-stage-hint";
bool showJudgementLine = skin.GetManiaSkinConfig<bool>(LegacyManiaSkinConfigurationLookups.ShowJudgementLine)?.Value
?? true;
Color4 lineColour = skin.GetManiaSkinConfig<Color4>(LegacyManiaSkinConfigurationLookups.JudgementLineColour)?.Value
?? Color4.White;
InternalChild = directionContainer = new Container
{
Origin = Anchor.CentreLeft,
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Children = new Drawable[]
{
new Sprite
{
Texture = skin.GetTexture(targetImage),
Scale = new Vector2(1, 0.9f * 1.6025f),
RelativeSizeAxes = Axes.X,
Width = 1
},
new Box
{
Anchor = Anchor.CentreLeft,
RelativeSizeAxes = Axes.X,
Height = 1,
Colour = LegacyColourCompatibility.DisallowZeroAlpha(lineColour),
Alpha = showJudgementLine ? 0.9f : 0
}
}
};
direction.BindTo(scrollingInfo.Direction);
direction.BindValueChanged(onDirectionChanged, true);
}
private void onDirectionChanged(ValueChangedEvent<ScrollingDirection> direction)
{
if (direction.NewValue == ScrollingDirection.Up)
{
directionContainer.Anchor = Anchor.TopLeft;
directionContainer.Scale = new Vector2(1, -1);
}
else
{
directionContainer.Anchor = Anchor.BottomLeft;
directionContainer.Scale = Vector2.One;
}
}
}
}
| 38.316456
| 129
| 0.556326
|
[
"MIT"
] |
02Naitsirk/osu
|
osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyHitTarget.cs
| 2,949
|
C#
|
namespace Microsoft.CodeAnalysis.CSharp
{
internal static partial class ErrorFacts
{
public static bool IsWarning(ErrorCode code)
{
switch (code)
{
case ErrorCode.WRN_InvalidMainSig:
case ErrorCode.WRN_UnreferencedEvent:
case ErrorCode.WRN_LowercaseEllSuffix:
case ErrorCode.WRN_DuplicateUsing:
case ErrorCode.WRN_NewRequired:
case ErrorCode.WRN_NewNotRequired:
case ErrorCode.WRN_NewOrOverrideExpected:
case ErrorCode.WRN_UnreachableCode:
case ErrorCode.WRN_UnreferencedLabel:
case ErrorCode.WRN_UnreferencedVar:
case ErrorCode.WRN_UnreferencedField:
case ErrorCode.WRN_IsAlwaysTrue:
case ErrorCode.WRN_IsAlwaysFalse:
case ErrorCode.WRN_ByRefNonAgileField:
case ErrorCode.WRN_UnreferencedVarAssg:
case ErrorCode.WRN_NegativeArrayIndex:
case ErrorCode.WRN_BadRefCompareLeft:
case ErrorCode.WRN_BadRefCompareRight:
case ErrorCode.WRN_PatternIsAmbiguous:
case ErrorCode.WRN_PatternStaticOrInaccessible:
case ErrorCode.WRN_PatternBadSignature:
case ErrorCode.WRN_SequentialOnPartialClass:
case ErrorCode.WRN_MainCantBeGeneric:
case ErrorCode.WRN_UnreferencedFieldAssg:
case ErrorCode.WRN_AmbiguousXMLReference:
case ErrorCode.WRN_VolatileByRef:
case ErrorCode.WRN_SameFullNameThisNsAgg:
case ErrorCode.WRN_SameFullNameThisAggAgg:
case ErrorCode.WRN_SameFullNameThisAggNs:
case ErrorCode.WRN_GlobalAliasDefn:
case ErrorCode.WRN_AlwaysNull:
case ErrorCode.WRN_CmpAlwaysFalse:
case ErrorCode.WRN_FinalizeMethod:
case ErrorCode.WRN_GotoCaseShouldConvert:
case ErrorCode.WRN_NubExprIsConstBool:
case ErrorCode.WRN_ExplicitImplCollision:
case ErrorCode.WRN_DeprecatedSymbol:
case ErrorCode.WRN_DeprecatedSymbolStr:
case ErrorCode.WRN_ExternMethodNoImplementation:
case ErrorCode.WRN_ProtectedInSealed:
case ErrorCode.WRN_PossibleMistakenNullStatement:
case ErrorCode.WRN_UnassignedInternalField:
case ErrorCode.WRN_VacuousIntegralComp:
case ErrorCode.WRN_AttributeLocationOnBadDeclaration:
case ErrorCode.WRN_InvalidAttributeLocation:
case ErrorCode.WRN_EqualsWithoutGetHashCode:
case ErrorCode.WRN_EqualityOpWithoutEquals:
case ErrorCode.WRN_EqualityOpWithoutGetHashCode:
case ErrorCode.WRN_IncorrectBooleanAssg:
case ErrorCode.WRN_NonObsoleteOverridingObsolete:
case ErrorCode.WRN_BitwiseOrSignExtend:
case ErrorCode.WRN_CoClassWithoutComImport:
case ErrorCode.WRN_TypeParameterSameAsOuterTypeParameter:
case ErrorCode.WRN_AssignmentToLockOrDispose:
case ErrorCode.WRN_ObsoleteOverridingNonObsolete:
case ErrorCode.WRN_DebugFullNameTooLong:
case ErrorCode.WRN_ExternCtorNoImplementation:
case ErrorCode.WRN_WarningDirective:
case ErrorCode.WRN_UnreachableGeneralCatch:
case ErrorCode.WRN_DeprecatedCollectionInitAddStr:
case ErrorCode.WRN_DeprecatedCollectionInitAdd:
case ErrorCode.WRN_DefaultValueForUnconsumedLocation:
case ErrorCode.WRN_IdentifierOrNumericLiteralExpected:
case ErrorCode.WRN_EmptySwitch:
case ErrorCode.WRN_XMLParseError:
case ErrorCode.WRN_DuplicateParamTag:
case ErrorCode.WRN_UnmatchedParamTag:
case ErrorCode.WRN_MissingParamTag:
case ErrorCode.WRN_BadXMLRef:
case ErrorCode.WRN_BadXMLRefParamType:
case ErrorCode.WRN_BadXMLRefReturnType:
case ErrorCode.WRN_BadXMLRefSyntax:
case ErrorCode.WRN_UnprocessedXMLComment:
case ErrorCode.WRN_FailedInclude:
case ErrorCode.WRN_InvalidInclude:
case ErrorCode.WRN_MissingXMLComment:
case ErrorCode.WRN_XMLParseIncludeError:
case ErrorCode.WRN_ALinkWarn:
case ErrorCode.WRN_CmdOptionConflictsSource:
case ErrorCode.WRN_IllegalPragma:
case ErrorCode.WRN_IllegalPPWarning:
case ErrorCode.WRN_BadRestoreNumber:
case ErrorCode.WRN_NonECMAFeature:
case ErrorCode.WRN_ErrorOverride:
case ErrorCode.WRN_InvalidSearchPathDir:
case ErrorCode.WRN_MultiplePredefTypes:
case ErrorCode.WRN_TooManyLinesForDebugger:
case ErrorCode.WRN_CallOnNonAgileField:
case ErrorCode.WRN_InvalidNumber:
case ErrorCode.WRN_IllegalPPChecksum:
case ErrorCode.WRN_EndOfPPLineExpected:
case ErrorCode.WRN_ConflictingChecksum:
case ErrorCode.WRN_InvalidAssemblyName:
case ErrorCode.WRN_UnifyReferenceMajMin:
case ErrorCode.WRN_UnifyReferenceBldRev:
case ErrorCode.WRN_DuplicateTypeParamTag:
case ErrorCode.WRN_UnmatchedTypeParamTag:
case ErrorCode.WRN_MissingTypeParamTag:
case ErrorCode.WRN_AssignmentToSelf:
case ErrorCode.WRN_ComparisonToSelf:
case ErrorCode.WRN_DotOnDefault:
case ErrorCode.WRN_BadXMLRefTypeVar:
case ErrorCode.WRN_UnmatchedParamRefTag:
case ErrorCode.WRN_UnmatchedTypeParamRefTag:
case ErrorCode.WRN_ReferencedAssemblyReferencesLinkedPIA:
case ErrorCode.WRN_CantHaveManifestForModule:
case ErrorCode.WRN_MultipleRuntimeImplementationMatches:
case ErrorCode.WRN_MultipleRuntimeOverrideMatches:
case ErrorCode.WRN_DynamicDispatchToConditionalMethod:
case ErrorCode.WRN_IsDynamicIsConfusing:
case ErrorCode.WRN_AsyncLacksAwaits:
case ErrorCode.WRN_FileAlreadyIncluded:
case ErrorCode.WRN_NoSources:
case ErrorCode.WRN_NoConfigNotOnCommandLine:
case ErrorCode.WRN_DefineIdentifierRequired:
case ErrorCode.WRN_BadUILang:
case ErrorCode.WRN_CLS_NoVarArgs:
case ErrorCode.WRN_CLS_BadArgType:
case ErrorCode.WRN_CLS_BadReturnType:
case ErrorCode.WRN_CLS_BadFieldPropType:
case ErrorCode.WRN_CLS_BadIdentifierCase:
case ErrorCode.WRN_CLS_OverloadRefOut:
case ErrorCode.WRN_CLS_OverloadUnnamed:
case ErrorCode.WRN_CLS_BadIdentifier:
case ErrorCode.WRN_CLS_BadBase:
case ErrorCode.WRN_CLS_BadInterfaceMember:
case ErrorCode.WRN_CLS_NoAbstractMembers:
case ErrorCode.WRN_CLS_NotOnModules:
case ErrorCode.WRN_CLS_ModuleMissingCLS:
case ErrorCode.WRN_CLS_AssemblyNotCLS:
case ErrorCode.WRN_CLS_BadAttributeType:
case ErrorCode.WRN_CLS_ArrayArgumentToAttribute:
case ErrorCode.WRN_CLS_NotOnModules2:
case ErrorCode.WRN_CLS_IllegalTrueInFalse:
case ErrorCode.WRN_CLS_MeaninglessOnPrivateType:
case ErrorCode.WRN_CLS_AssemblyNotCLS2:
case ErrorCode.WRN_CLS_MeaninglessOnParam:
case ErrorCode.WRN_CLS_MeaninglessOnReturn:
case ErrorCode.WRN_CLS_BadTypeVar:
case ErrorCode.WRN_CLS_VolatileField:
case ErrorCode.WRN_CLS_BadInterface:
case ErrorCode.WRN_UnobservedAwaitableExpression:
case ErrorCode.WRN_CallerLineNumberParamForUnconsumedLocation:
case ErrorCode.WRN_CallerFilePathParamForUnconsumedLocation:
case ErrorCode.WRN_CallerMemberNameParamForUnconsumedLocation:
case ErrorCode.WRN_MainIgnored:
case ErrorCode.WRN_DelaySignButNoKey:
case ErrorCode.WRN_InvalidVersionFormat:
case ErrorCode.WRN_CallerFilePathPreferredOverCallerMemberName:
case ErrorCode.WRN_CallerLineNumberPreferredOverCallerMemberName:
case ErrorCode.WRN_CallerLineNumberPreferredOverCallerFilePath:
case ErrorCode.WRN_AssemblyAttributeFromModuleIsOverridden:
case ErrorCode.WRN_FilterIsConstantTrue:
case ErrorCode.WRN_UnimplementedCommandLineSwitch:
case ErrorCode.WRN_ReferencedAssemblyDoesNotHaveStrongName:
case ErrorCode.WRN_RefCultureMismatch:
case ErrorCode.WRN_ConflictingMachineAssembly:
case ErrorCode.WRN_UnqualifiedNestedTypeInCref:
case ErrorCode.WRN_NoRuntimeMetadataVersion:
case ErrorCode.WRN_PdbLocalNameTooLong:
case ErrorCode.WRN_AnalyzerCannotBeCreated:
case ErrorCode.WRN_NoAnalyzerInAssembly:
case ErrorCode.WRN_UnableToLoadAnalyzer:
case ErrorCode.WRN_NubExprIsConstBool2:
case ErrorCode.WRN_AlignmentMagnitude:
case ErrorCode.WRN_AttributeIgnoredWhenPublicSigning:
case ErrorCode.WRN_TupleLiteralNameMismatch:
case ErrorCode.WRN_Experimental:
case ErrorCode.WRN_UnreferencedLocalFunction:
case ErrorCode.WRN_FilterIsConstantFalse:
case ErrorCode.WRN_FilterIsConstantFalseRedundantTryCatch:
case ErrorCode.WRN_AttributesOnBackingFieldsNotAvailable:
case ErrorCode.WRN_TupleBinopLiteralNameMismatch:
case ErrorCode.WRN_TypeParameterSameAsOuterMethodTypeParameter:
case ErrorCode.WRN_UnconsumedEnumeratorCancellationAttributeUsage:
case ErrorCode.WRN_UndecoratedCancellationTokenParameter:
case ErrorCode.WRN_SwitchExpressionNotExhaustive:
case ErrorCode.WRN_CaseConstantNamedUnderscore:
case ErrorCode.WRN_IsTypeNamedUnderscore:
case ErrorCode.WRN_GivenExpressionNeverMatchesPattern:
case ErrorCode.WRN_GivenExpressionAlwaysMatchesConstant:
case ErrorCode.WRN_ThrowPossibleNull:
case ErrorCode.WRN_ConvertingNullableToNonNullable:
case ErrorCode.WRN_NullReferenceAssignment:
case ErrorCode.WRN_NullReferenceReceiver:
case ErrorCode.WRN_NullReferenceReturn:
case ErrorCode.WRN_NullReferenceArgument:
case ErrorCode.WRN_UnboxPossibleNull:
case ErrorCode.WRN_NullReferenceIterationVariable:
case ErrorCode.WRN_DisallowNullAttributeForbidsMaybeNullAssignment:
case ErrorCode.WRN_NullabilityMismatchInReturnTypeOnOverride:
case ErrorCode.WRN_NullabilityMismatchInParameterTypeOnOverride:
case ErrorCode.WRN_NullabilityMismatchInParameterTypeOnPartial:
case ErrorCode.WRN_NullabilityMismatchInTypeOnImplicitImplementation:
case ErrorCode.WRN_NullabilityMismatchInReturnTypeOnImplicitImplementation:
case ErrorCode.WRN_NullabilityMismatchInParameterTypeOnImplicitImplementation:
case ErrorCode.WRN_NullabilityMismatchInTypeOnExplicitImplementation:
case ErrorCode.WRN_NullabilityMismatchInReturnTypeOnExplicitImplementation:
case ErrorCode.WRN_NullabilityMismatchInParameterTypeOnExplicitImplementation:
case ErrorCode.WRN_UninitializedNonNullableField:
case ErrorCode.WRN_NullabilityMismatchInAssignment:
case ErrorCode.WRN_NullabilityMismatchInArgument:
case ErrorCode.WRN_NullabilityMismatchInReturnTypeOfTargetDelegate:
case ErrorCode.WRN_NullabilityMismatchInParameterTypeOfTargetDelegate:
case ErrorCode.WRN_NullabilityMismatchInArgumentForOutput:
case ErrorCode.WRN_NullAsNonNullable:
case ErrorCode.WRN_AsOperatorMayReturnNull:
case ErrorCode.WRN_NullableValueTypeMayBeNull:
case ErrorCode.WRN_NullabilityMismatchInTypeParameterConstraint:
case ErrorCode.WRN_MissingNonNullTypesContextForAnnotation:
case ErrorCode.WRN_NullabilityMismatchInConstraintsOnImplicitImplementation:
case ErrorCode.WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint:
case ErrorCode.WRN_ConditionalAccessMayReturnNull:
case ErrorCode.WRN_NullabilityMismatchInExplicitlyImplementedInterface:
case ErrorCode.WRN_NullabilityMismatchInInterfaceImplementedByBase:
case ErrorCode.WRN_DuplicateInterfaceWithNullabilityMismatchInBaseList:
case ErrorCode.WRN_DefaultExpressionMayIntroduceNullT:
case ErrorCode.WRN_NullLiteralMayIntroduceNullT:
case ErrorCode.WRN_SwitchExpressionNotExhaustiveForNull:
case ErrorCode.WRN_ImplicitCopyInReadOnlyMember:
case ErrorCode.WRN_NullabilityMismatchInConstraintsOnPartialImplementation:
case ErrorCode.WRN_NullabilityMismatchInTypeParameterNotNullConstraint:
return true;
default:
return false;
}
}
public static bool IsFatal(ErrorCode code)
{
switch (code)
{
case ErrorCode.FTL_MetadataCantOpenFile:
case ErrorCode.FTL_DebugEmitFailure:
case ErrorCode.FTL_BadCodepage:
case ErrorCode.FTL_InvalidTarget:
case ErrorCode.FTL_InvalidInputFileName:
case ErrorCode.FTL_OutputFileExists:
case ErrorCode.FTL_BadChecksumAlgorithm:
return true;
default:
return false;
}
}
public static bool IsInfo(ErrorCode code)
{
switch (code)
{
case ErrorCode.INF_UnableToLoadSomeTypesInAnalyzer:
return true;
default:
return false;
}
}
public static bool IsHidden(ErrorCode code)
{
switch (code)
{
case ErrorCode.HDN_UnusedUsingDirective:
case ErrorCode.HDN_UnusedExternAlias:
return true;
default:
return false;
}
}
}
}
| 54.805755
| 94
| 0.65575
|
[
"Apache-2.0"
] |
GovernessS/roslyn
|
src/Compilers/CSharp/Portable/Generated/ErrorFacts.Generated.cs
| 15,238
|
C#
|
using System;
using System.Collections.Generic;
using System.Text;
using PPDFramework;
namespace PPD
{
public class GameResultManager
{
const int MIN = 0;
const int MAX = 1023;
int combo;
int[] evacount = new int[5];
int currentlife = MAX / 2;
public GameResultManager()
{
CurrentLife = MAX / 2;
}
public void Retry()
{
MaxCombo = 0;
CurrentCombo = 0;
CurrentLife = MAX / 2;
CurrentScore = 0;
for (int i = 0; i < evacount.Length; i++)
{
evacount[i] = 0;
}
}
public int MaxCombo
{
get;
private set;
}
public int CurrentCombo
{
get { return combo; }
set
{
combo = value;
if (combo > MaxCombo) MaxCombo = combo;
}
}
public int CurrentLife
{
get
{
return currentlife;
}
set
{
currentlife = value;
if (currentlife >= MAX) currentlife = MAX;
else if (currentlife <= MIN) currentlife = MIN;
}
}
public float CurrentLifeAsFloat
{
get
{
return (float)currentlife / MAX * 100;
}
}
public int CurrentScore
{
get;
private set;
}
public int[] Evacount
{
get
{
return evacount;
}
}
private float ComboScale
{
get
{
float ret = 1;
if (combo > 20)
{
ret = 1.5f;
}
else if (combo > 50)
{
ret = 2f;
}
else if (combo > 100)
{
ret = 2.5f;
}
else if (combo > 500)
{
ret = 3f;
}
return ret;
}
}
private int ComboBonus
{
get
{
if (combo >= 50)
return 250;
else if (combo >= 40)
return 200;
else if (combo >= 30)
return 150;
else if (combo >= 20)
return 100;
else if (combo >= 10)
return 50;
else
return 0;
}
}
public void GainScore(MarkEvaluateType type, bool isMissPress)
{
int basescore = 0;
switch (type)
{
case MarkEvaluateType.Cool:
basescore = 500;
break;
case MarkEvaluateType.Fine:
basescore = 300;
break;
case MarkEvaluateType.Sad:
basescore = 100;
break;
case MarkEvaluateType.Safe:
basescore = 50;
break;
case MarkEvaluateType.Worst:
basescore = 0;
break;
}
CurrentScore += (isMissPress ? (int)Math.Round(basescore / 20.0) * 10 : basescore) + ComboBonus;
}
public void GainScore(int gain)
{
CurrentScore += gain;
}
public bool IfDeath
{
get
{
return CurrentLife <= 0;
}
}
}
}
| 24.113924
| 108
| 0.35643
|
[
"Apache-2.0"
] |
KHCmaster/PPD
|
Win/PPD/PPD/GameResultManager.cs
| 3,812
|
C#
|
// The MIT License (MIT)
//
// Copyright (c) 2015-2016 Rasmus Mikkelsen
// Copyright (c) 2015-2016 eBay Software Foundation
// https://github.com/rasmus/EventFlow
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
// the Software, and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Collections.Generic;
using System.Linq;
using EventFlow.Snapshots;
using EventFlow.TestHelpers.Aggregates.ValueObjects;
namespace EventFlow.TestHelpers.Aggregates.Snapshots
{
[SnapshotVersion("thingy", 3)]
public class ThingySnapshot : ISnapshot
{
public ThingySnapshot(
IEnumerable<PingId> pingsReceived,
IEnumerable<ThingySnapshotVersion> previousVersions)
{
PingsReceived = (pingsReceived ?? Enumerable.Empty<PingId>()).ToList();
PreviousVersions = (previousVersions ?? Enumerable.Empty<ThingySnapshotVersion>()).ToList();
}
public IReadOnlyCollection<PingId> PingsReceived { get; }
public IReadOnlyCollection<ThingySnapshotVersion> PreviousVersions { get; }
}
}
| 44.108696
| 104
| 0.738788
|
[
"MIT"
] |
AntoineGa/EventFlow
|
Source/EventFlow.TestHelpers/Aggregates/Snapshots/ThingySnapshot.cs
| 2,031
|
C#
|
// [[[[INFO>
// Copyright 2015 Epicycle (http://epicycle.org, https://github.com/open-epicycle)
//
// 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.
//
// For more information check https://github.com/open-epicycle/Epicycle.Math-cs
// ]]]]
using Epicycle.Math.Geometry.Differential;
using Epicycle.Math.LinearAlgebra;
namespace Epicycle.Math.Probability
{
// the fiber process is the integral of a property of the base process computed using the trapezoid rule
public abstract class IntegralStochasticProcess : ExtensionStochasticProcess
{
public IntegralStochasticProcess(IStochasticProcess baseProcess, IManifold fiber) : base(baseProcess, fiber) { }
protected abstract OVector Velocity(IManifoldPoint basePoint);
protected abstract OMatrix VelocityDifferential(IManifoldPoint basePoint);
protected sealed override StochasticFiberPoint FiberEvolution(State state, StochasticManifoldPoint basePoint2, double time)
{
var expectation = Fiber.Translate(state.FiberPoint, (time / 2) * (Velocity(state.BasePoint) + Velocity(basePoint2.Expectation)));
var differential = (time / 2) * VelocityDifferential(basePoint2.Expectation);
var mixedCovariance = differential * basePoint2.Covariance;
var covariance = (mixedCovariance * differential.Transposed()).AsSquare().AsSymmetric();
return new StochasticFiberPoint(new StochasticManifoldPoint(expectation, covariance), mixedCovariance);
}
protected sealed override OSquareMatrix FiberDifferential(State state, IManifoldPoint basePoint2, double time)
{
return SquareMatrix.Id(Fiber.Dimension);
}
protected sealed override OMatrix MixedDifferential(State state, IManifoldPoint basePoint2, OSquareMatrix baseDifferential, double time)
{
return (time / 2) * (VelocityDifferential(state.BasePoint) + VelocityDifferential(basePoint2) * baseDifferential);
}
}
}
| 44.857143
| 144
| 0.730892
|
[
"Apache-2.0"
] |
open-epicycle/Epicycle.Math-cs
|
projects/Epicycle.Math_cs/Probability/IntegralStochasticProcess.cs
| 2,514
|
C#
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace TicTacToe
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new LoginForm());
}
}
}
| 22.863636
| 66
| 0.574553
|
[
"Apache-2.0"
] |
ekade/tictactoe
|
TicTacToe/TicTacToe/TicTacToe/Program.cs
| 505
|
C#
|
using System;
namespace Aneejian.PowerPoint.Downsizer
{
public abstract class Response : IResponse
{
public bool IsSuccess { get; set; }
public string ResultMessage { get; set; } = "";
public Exception Exception { get; set; }
protected Response()
{
}
protected Response(bool isSuccess, string resultMessage, Exception exception)
{
IsSuccess = isSuccess;
ResultMessage = resultMessage;
Exception = exception;
}
protected Response(Exception e, string message)
{
IsSuccess = false;
ResultMessage = message + e.Message;
Exception = e;
}
}
}
| 24.862069
| 85
| 0.564494
|
[
"MIT"
] |
kannansuresh/PowerPoint-Downsizer-Add-In
|
src/Aneejian.PowerPoint.Downsizer/Response.cs
| 723
|
C#
|
namespace codewars;
using static String;
public class FakeBinarySolution
{
public static string Fake(string s) => Concat(s.Select(c => c / '5'));
}
public class FakeBinaryTests
{
[Theory]
[InlineData("45385593107843568", "01011110001100111")]
[InlineData("509321967506747", "101000111101101")]
[InlineData("366058562030849490134388085", "011011110000101010000011011")]
public void VerifyFakeWith(string s, string expectedFake) => FakeBinarySolution.Fake(s).Should().Be(expectedFake);
}
| 30.117647
| 118
| 0.742188
|
[
"Unlicense"
] |
MartinRL/codewars
|
codewars/FakeBinaryKata.cs
| 512
|
C#
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的常规信息通过以下
// 特性集控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("_Local.ConsoleApp")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("_Local.ConsoleApp")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 使此程序集中的类型
// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
// 则将该类型上的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("85235e3a-7daf-475c-812d-61b44354ec4b")]
// 程序集的版本信息由下面四个值组成:
//
// 主版本
// 次版本
// 内部版本号
// 修订号
//
// 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| 26.027027
| 56
| 0.717549
|
[
"Apache-2.0"
] |
yuanrui/Examples
|
_Local.ConsoleApp/Properties/AssemblyInfo.cs
| 1,330
|
C#
|
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Microsoft.AspNetCore.Mvc.ApplicationParts;
namespace Microsoft.AspNetCore.Mvc
{
public class TestApplicationPart : ApplicationPart, IApplicationPartTypeProvider
{
public TestApplicationPart()
{
Types = Enumerable.Empty<TypeInfo>();
}
public TestApplicationPart(params TypeInfo[] types)
{
Types = types;
}
public TestApplicationPart(IEnumerable<TypeInfo> types)
{
Types = types;
}
public TestApplicationPart(IEnumerable<Type> types)
: this(types.Select(t => t.GetTypeInfo())) { }
public TestApplicationPart(params Type[] types) : this(types.Select(t => t.GetTypeInfo()))
{ }
public override string Name => "Test part";
public IEnumerable<TypeInfo> Types { get; }
}
}
| 27.146341
| 111
| 0.649596
|
[
"Apache-2.0"
] |
belav/aspnetcore
|
src/Mvc/Mvc.Core/test/TestApplicationPart.cs
| 1,115
|
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.Synapse.V20210501.Outputs
{
/// <summary>
/// Library/package information of a Big Data pool powered by Apache Spark
/// </summary>
[OutputType]
public sealed class LibraryInfoResponse
{
/// <summary>
/// Storage blob container name.
/// </summary>
public readonly string? ContainerName;
/// <summary>
/// Creator Id of the library/package.
/// </summary>
public readonly string CreatorId;
/// <summary>
/// Name of the library.
/// </summary>
public readonly string? Name;
/// <summary>
/// Storage blob path of library.
/// </summary>
public readonly string? Path;
/// <summary>
/// Provisioning status of the library/package.
/// </summary>
public readonly string ProvisioningStatus;
/// <summary>
/// Type of the library.
/// </summary>
public readonly string? Type;
/// <summary>
/// The last update time of the library.
/// </summary>
public readonly string UploadedTimestamp;
[OutputConstructor]
private LibraryInfoResponse(
string? containerName,
string creatorId,
string? name,
string? path,
string provisioningStatus,
string? type,
string uploadedTimestamp)
{
ContainerName = containerName;
CreatorId = creatorId;
Name = name;
Path = path;
ProvisioningStatus = provisioningStatus;
Type = type;
UploadedTimestamp = uploadedTimestamp;
}
}
}
| 27.527027
| 81
| 0.57241
|
[
"Apache-2.0"
] |
polivbr/pulumi-azure-native
|
sdk/dotnet/Synapse/V20210501/Outputs/LibraryInfoResponse.cs
| 2,037
|
C#
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.