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 |
|---|---|---|---|---|---|---|---|---|
// MIT License - Copyright (C) The Mono.Xna Team
// This file is subject to the terms and conditions defined in
// file 'LICENSE.txt', which is part of this source code package.
using System;
using System.Diagnostics;
using System.Runtime.Serialization;
namespace Microsoft.Xna.Framework
{
/// <summary>
/// An efficient mathematical representation for three dimensional rotations.
/// </summary>
[DataContract]
[DebuggerDisplay("{DebugDisplayString,nq}")]
public struct Quaternion : IEquatable<Quaternion>
{
#region Private Fields
private static readonly Quaternion _identity = new Quaternion(0, 0, 0, 1);
#endregion
#region Public Fields
/// <summary>
/// The x coordinate of this <see cref="Quaternion"/>.
/// </summary>
[DataMember]
public float X;
/// <summary>
/// The y coordinate of this <see cref="Quaternion"/>.
/// </summary>
[DataMember]
public float Y;
/// <summary>
/// The z coordinate of this <see cref="Quaternion"/>.
/// </summary>
[DataMember]
public float Z;
/// <summary>
/// The rotation component of this <see cref="Quaternion"/>.
/// </summary>
[DataMember]
public float W;
#endregion
#region Constructors
/// <summary>
/// Constructs a quaternion with X, Y, Z and W from four values.
/// </summary>
/// <param name="x">The x coordinate in 3d-space.</param>
/// <param name="y">The y coordinate in 3d-space.</param>
/// <param name="z">The z coordinate in 3d-space.</param>
/// <param name="w">The rotation component.</param>
public Quaternion(float x, float y, float z, float w)
{
this.X = x;
this.Y = y;
this.Z = z;
this.W = w;
}
/// <summary>
/// Constructs a quaternion with X, Y, Z from <see cref="Vector3"/> and rotation component from a scalar.
/// </summary>
/// <param name="value">The x, y, z coordinates in 3d-space.</param>
/// <param name="w">The rotation component.</param>
public Quaternion(Vector3 value, float w)
{
this.X = value.X;
this.Y = value.Y;
this.Z = value.Z;
this.W = w;
}
/// <summary>
/// Constructs a quaternion from <see cref="Vector4"/>.
/// </summary>
/// <param name="value">The x, y, z coordinates in 3d-space and the rotation component.</param>
public Quaternion(Vector4 value)
{
this.X = value.X;
this.Y = value.Y;
this.Z = value.Z;
this.W = value.W;
}
#endregion
#region Public Properties
/// <summary>
/// Returns a quaternion representing no rotation.
/// </summary>
public static Quaternion Identity
{
get{ return _identity; }
}
#endregion
#region Internal Properties
internal string DebugDisplayString
{
get
{
if (this == Quaternion._identity)
{
return "Identity";
}
return string.Concat(
this.X.ToString(), " ",
this.Y.ToString(), " ",
this.Z.ToString(), " ",
this.W.ToString()
);
}
}
#endregion
#region Public Methods
#region Add
/// <summary>
/// Creates a new <see cref="Quaternion"/> that contains the sum of two quaternions.
/// </summary>
/// <param name="quaternion1">Source <see cref="Quaternion"/>.</param>
/// <param name="quaternion2">Source <see cref="Quaternion"/>.</param>
/// <returns>The result of the quaternion addition.</returns>
public static Quaternion Add(Quaternion quaternion1, Quaternion quaternion2)
{
Quaternion quaternion;
quaternion.X = quaternion1.X + quaternion2.X;
quaternion.Y = quaternion1.Y + quaternion2.Y;
quaternion.Z = quaternion1.Z + quaternion2.Z;
quaternion.W = quaternion1.W + quaternion2.W;
return quaternion;
}
/// <summary>
/// Creates a new <see cref="Quaternion"/> that contains the sum of two quaternions.
/// </summary>
/// <param name="quaternion1">Source <see cref="Quaternion"/>.</param>
/// <param name="quaternion2">Source <see cref="Quaternion"/>.</param>
/// <param name="result">The result of the quaternion addition as an output parameter.</param>
public static void Add(ref Quaternion quaternion1, ref Quaternion quaternion2, out Quaternion result)
{
result.X = quaternion1.X + quaternion2.X;
result.Y = quaternion1.Y + quaternion2.Y;
result.Z = quaternion1.Z + quaternion2.Z;
result.W = quaternion1.W + quaternion2.W;
}
#endregion
#region Concatenate
/// <summary>
/// Creates a new <see cref="Quaternion"/> that contains concatenation between two quaternion.
/// </summary>
/// <param name="value1">The first <see cref="Quaternion"/> to concatenate.</param>
/// <param name="value2">The second <see cref="Quaternion"/> to concatenate.</param>
/// <returns>The result of rotation of <paramref name="value1"/> followed by <paramref name="value2"/> rotation.</returns>
public static Quaternion Concatenate(Quaternion value1, Quaternion value2)
{
Quaternion quaternion;
float x1 = value1.X;
float y1 = value1.Y;
float z1 = value1.Z;
float w1 = value1.W;
float x2 = value2.X;
float y2 = value2.Y;
float z2 = value2.Z;
float w2 = value2.W;
quaternion.X = ((x2 * w1) + (x1 * w2)) + ((y2 * z1) - (z2 * y1));
quaternion.Y = ((y2 * w1) + (y1 * w2)) + ((z2 * x1) - (x2 * z1));
quaternion.Z = ((z2 * w1) + (z1 * w2)) + ((x2 * y1) - (y2 * x1));
quaternion.W = (w2 * w1) - (((x2 * x1) + (y2 * y1)) + (z2 * z1));
return quaternion;
}
/// <summary>
/// Creates a new <see cref="Quaternion"/> that contains concatenation between two quaternion.
/// </summary>
/// <param name="value1">The first <see cref="Quaternion"/> to concatenate.</param>
/// <param name="value2">The second <see cref="Quaternion"/> to concatenate.</param>
/// <param name="result">The result of rotation of <paramref name="value1"/> followed by <paramref name="value2"/> rotation as an output parameter.</param>
public static void Concatenate(ref Quaternion value1, ref Quaternion value2, out Quaternion result)
{
float x1 = value1.X;
float y1 = value1.Y;
float z1 = value1.Z;
float w1 = value1.W;
float x2 = value2.X;
float y2 = value2.Y;
float z2 = value2.Z;
float w2 = value2.W;
result.X = ((x2 * w1) + (x1 * w2)) + ((y2 * z1) - (z2 * y1));
result.Y = ((y2 * w1) + (y1 * w2)) + ((z2 * x1) - (x2 * z1));
result.Z = ((z2 * w1) + (z1 * w2)) + ((x2 * y1) - (y2 * x1));
result.W = (w2 * w1) - (((x2 * x1) + (y2 * y1)) + (z2 * z1));
}
#endregion
#region Conjugate
/// <summary>
/// Transforms this quaternion into its conjugated version.
/// </summary>
public void Conjugate()
{
X = -X;
Y = -Y;
Z = -Z;
}
/// <summary>
/// Creates a new <see cref="Quaternion"/> that contains conjugated version of the specified quaternion.
/// </summary>
/// <param name="value">The quaternion which values will be used to create the conjugated version.</param>
/// <returns>The conjugate version of the specified quaternion.</returns>
public static Quaternion Conjugate(Quaternion value)
{
return new Quaternion(-value.X,-value.Y,-value.Z,value.W);
}
/// <summary>
/// Creates a new <see cref="Quaternion"/> that contains conjugated version of the specified quaternion.
/// </summary>
/// <param name="value">The quaternion which values will be used to create the conjugated version.</param>
/// <param name="result">The conjugated version of the specified quaternion as an output parameter.</param>
public static void Conjugate(ref Quaternion value, out Quaternion result)
{
result.X = -value.X;
result.Y = -value.Y;
result.Z = -value.Z;
result.W = value.W;
}
#endregion
#region CreateFromAxisAngle
/// <summary>
/// Creates a new <see cref="Quaternion"/> from the specified axis and angle.
/// </summary>
/// <param name="axis">The axis of rotation.</param>
/// <param name="angle">The angle in radians.</param>
/// <returns>The new quaternion builded from axis and angle.</returns>
public static Quaternion CreateFromAxisAngle(Vector3 axis, float angle)
{
float half = angle * 0.5f;
float sin = MathF.Sin(half);
float cos = MathF.Cos(half);
return new Quaternion(axis.X * sin, axis.Y * sin, axis.Z * sin, cos);
}
/// <summary>
/// Creates a new <see cref="Quaternion"/> from the specified axis and angle.
/// </summary>
/// <param name="axis">The axis of rotation.</param>
/// <param name="angle">The angle in radians.</param>
/// <param name="result">The new quaternion builded from axis and angle as an output parameter.</param>
public static void CreateFromAxisAngle(ref Vector3 axis, float angle, out Quaternion result)
{
float half = angle * 0.5f;
float sin = MathF.Sin(half);
float cos = MathF.Cos(half);
result.X = axis.X * sin;
result.Y = axis.Y * sin;
result.Z = axis.Z * sin;
result.W = cos;
}
#endregion
#region CreateFromRotationMatrix
/// <summary>
/// Creates a new <see cref="Quaternion"/> from the specified <see cref="Matrix"/>.
/// </summary>
/// <param name="matrix">The rotation matrix.</param>
/// <returns>A quaternion composed from the rotation part of the matrix.</returns>
public static Quaternion CreateFromRotationMatrix(Matrix matrix)
{
Quaternion quaternion;
float sqrt;
float half;
float scale = matrix.M11 + matrix.M22 + matrix.M33;
if (scale > 0.0f)
{
sqrt = MathF.Sqrt(scale + 1.0f);
quaternion.W = sqrt * 0.5f;
sqrt = 0.5f / sqrt;
quaternion.X = (matrix.M23 - matrix.M32) * sqrt;
quaternion.Y = (matrix.M31 - matrix.M13) * sqrt;
quaternion.Z = (matrix.M12 - matrix.M21) * sqrt;
return quaternion;
}
if ((matrix.M11 >= matrix.M22) && (matrix.M11 >= matrix.M33))
{
sqrt = MathF.Sqrt(1.0f + matrix.M11 - matrix.M22 - matrix.M33);
half = 0.5f / sqrt;
quaternion.X = 0.5f * sqrt;
quaternion.Y = (matrix.M12 + matrix.M21) * half;
quaternion.Z = (matrix.M13 + matrix.M31) * half;
quaternion.W = (matrix.M23 - matrix.M32) * half;
return quaternion;
}
if (matrix.M22 > matrix.M33)
{
sqrt = MathF.Sqrt(1.0f + matrix.M22 - matrix.M11 - matrix.M33);
half = 0.5f / sqrt;
quaternion.X = (matrix.M21 + matrix.M12) * half;
quaternion.Y = 0.5f * sqrt;
quaternion.Z = (matrix.M32 + matrix.M23) * half;
quaternion.W = (matrix.M31 - matrix.M13) * half;
return quaternion;
}
sqrt = MathF.Sqrt(1.0f + matrix.M33 - matrix.M11 - matrix.M22);
half = 0.5f / sqrt;
quaternion.X = (matrix.M31 + matrix.M13) * half;
quaternion.Y = (matrix.M32 + matrix.M23) * half;
quaternion.Z = 0.5f * sqrt;
quaternion.W = (matrix.M12 - matrix.M21) * half;
return quaternion;
}
/// <summary>
/// Creates a new <see cref="Quaternion"/> from the specified <see cref="Matrix"/>.
/// </summary>
/// <param name="matrix">The rotation matrix.</param>
/// <param name="result">A quaternion composed from the rotation part of the matrix as an output parameter.</param>
public static void CreateFromRotationMatrix(ref Matrix matrix, out Quaternion result)
{
float sqrt;
float half;
float scale = matrix.M11 + matrix.M22 + matrix.M33;
if (scale > 0.0f)
{
sqrt = MathF.Sqrt(scale + 1.0f);
result.W = sqrt * 0.5f;
sqrt = 0.5f / sqrt;
result.X = (matrix.M23 - matrix.M32) * sqrt;
result.Y = (matrix.M31 - matrix.M13) * sqrt;
result.Z = (matrix.M12 - matrix.M21) * sqrt;
}
else
if ((matrix.M11 >= matrix.M22) && (matrix.M11 >= matrix.M33))
{
sqrt = MathF.Sqrt(1.0f + matrix.M11 - matrix.M22 - matrix.M33);
half = 0.5f / sqrt;
result.X = 0.5f * sqrt;
result.Y = (matrix.M12 + matrix.M21) * half;
result.Z = (matrix.M13 + matrix.M31) * half;
result.W = (matrix.M23 - matrix.M32) * half;
}
else if (matrix.M22 > matrix.M33)
{
sqrt = MathF.Sqrt(1.0f + matrix.M22 - matrix.M11 - matrix.M33);
half = 0.5f/sqrt;
result.X = (matrix.M21 + matrix.M12)*half;
result.Y = 0.5f*sqrt;
result.Z = (matrix.M32 + matrix.M23)*half;
result.W = (matrix.M31 - matrix.M13)*half;
}
else
{
sqrt = MathF.Sqrt(1.0f + matrix.M33 - matrix.M11 - matrix.M22);
half = 0.5f / sqrt;
result.X = (matrix.M31 + matrix.M13) * half;
result.Y = (matrix.M32 + matrix.M23) * half;
result.Z = 0.5f * sqrt;
result.W = (matrix.M12 - matrix.M21) * half;
}
}
#endregion
#region CreateFromYawPitchRoll
/// <summary>
/// Creates a new <see cref="Quaternion"/> from the specified yaw, pitch and roll angles.
/// </summary>
/// <param name="yaw">Yaw around the y axis in radians.</param>
/// <param name="pitch">Pitch around the x axis in radians.</param>
/// <param name="roll">Roll around the z axis in radians.</param>
/// <returns>A new quaternion from the concatenated yaw, pitch, and roll angles.</returns>
public static Quaternion CreateFromYawPitchRoll(float yaw, float pitch, float roll)
{
float halfRoll = roll * 0.5f;
float halfPitch = pitch * 0.5f;
float halfYaw = yaw * 0.5f;
float sinRoll = MathF.Sin(halfRoll);
float cosRoll = MathF.Cos(halfRoll);
float sinPitch = MathF.Sin(halfPitch);
float cosPitch = MathF.Cos(halfPitch);
float sinYaw = MathF.Sin(halfYaw);
float cosYaw = MathF.Cos(halfYaw);
return new Quaternion((cosYaw * sinPitch * cosRoll) + (sinYaw * cosPitch * sinRoll),
(sinYaw * cosPitch * cosRoll) - (cosYaw * sinPitch * sinRoll),
(cosYaw * cosPitch * sinRoll) - (sinYaw * sinPitch * cosRoll),
(cosYaw * cosPitch * cosRoll) + (sinYaw * sinPitch * sinRoll));
}
/// <summary>
/// Creates a new <see cref="Quaternion"/> from the specified yaw, pitch and roll angles.
/// </summary>
/// <param name="yaw">Yaw around the y axis in radians.</param>
/// <param name="pitch">Pitch around the x axis in radians.</param>
/// <param name="roll">Roll around the z axis in radians.</param>
/// <param name="result">A new quaternion from the concatenated yaw, pitch, and roll angles as an output parameter.</param>
public static void CreateFromYawPitchRoll(float yaw, float pitch, float roll, out Quaternion result)
{
float halfRoll = roll * 0.5f;
float halfPitch = pitch * 0.5f;
float halfYaw = yaw * 0.5f;
float sinRoll = MathF.Sin(halfRoll);
float cosRoll = MathF.Cos(halfRoll);
float sinPitch = MathF.Sin(halfPitch);
float cosPitch = MathF.Cos(halfPitch);
float sinYaw = MathF.Sin(halfYaw);
float cosYaw = MathF.Cos(halfYaw);
result.X = (cosYaw * sinPitch * cosRoll) + (sinYaw * cosPitch * sinRoll);
result.Y = (sinYaw * cosPitch * cosRoll) - (cosYaw * sinPitch * sinRoll);
result.Z = (cosYaw * cosPitch * sinRoll) - (sinYaw * sinPitch * cosRoll);
result.W = (cosYaw * cosPitch * cosRoll) + (sinYaw * sinPitch * sinRoll);
}
#endregion
#region Divide
/// <summary>
/// Divides a <see cref="Quaternion"/> by the other <see cref="Quaternion"/>.
/// </summary>
/// <param name="quaternion1">Source <see cref="Quaternion"/>.</param>
/// <param name="quaternion2">Divisor <see cref="Quaternion"/>.</param>
/// <returns>The result of dividing the quaternions.</returns>
public static Quaternion Divide(Quaternion quaternion1, Quaternion quaternion2)
{
Quaternion quaternion;
float x = quaternion1.X;
float y = quaternion1.Y;
float z = quaternion1.Z;
float w = quaternion1.W;
float num14 = (((quaternion2.X * quaternion2.X) + (quaternion2.Y * quaternion2.Y)) + (quaternion2.Z * quaternion2.Z)) + (quaternion2.W * quaternion2.W);
float num5 = 1f / num14;
float num4 = -quaternion2.X * num5;
float num3 = -quaternion2.Y * num5;
float num2 = -quaternion2.Z * num5;
float num = quaternion2.W * num5;
float num13 = (y * num2) - (z * num3);
float num12 = (z * num4) - (x * num2);
float num11 = (x * num3) - (y * num4);
float num10 = ((x * num4) + (y * num3)) + (z * num2);
quaternion.X = ((x * num) + (num4 * w)) + num13;
quaternion.Y = ((y * num) + (num3 * w)) + num12;
quaternion.Z = ((z * num) + (num2 * w)) + num11;
quaternion.W = (w * num) - num10;
return quaternion;
}
/// <summary>
/// Divides a <see cref="Quaternion"/> by the other <see cref="Quaternion"/>.
/// </summary>
/// <param name="quaternion1">Source <see cref="Quaternion"/>.</param>
/// <param name="quaternion2">Divisor <see cref="Quaternion"/>.</param>
/// <param name="result">The result of dividing the quaternions as an output parameter.</param>
public static void Divide(ref Quaternion quaternion1, ref Quaternion quaternion2, out Quaternion result)
{
float x = quaternion1.X;
float y = quaternion1.Y;
float z = quaternion1.Z;
float w = quaternion1.W;
float num14 = (((quaternion2.X * quaternion2.X) + (quaternion2.Y * quaternion2.Y)) + (quaternion2.Z * quaternion2.Z)) + (quaternion2.W * quaternion2.W);
float num5 = 1f / num14;
float num4 = -quaternion2.X * num5;
float num3 = -quaternion2.Y * num5;
float num2 = -quaternion2.Z * num5;
float num = quaternion2.W * num5;
float num13 = (y * num2) - (z * num3);
float num12 = (z * num4) - (x * num2);
float num11 = (x * num3) - (y * num4);
float num10 = ((x * num4) + (y * num3)) + (z * num2);
result.X = ((x * num) + (num4 * w)) + num13;
result.Y = ((y * num) + (num3 * w)) + num12;
result.Z = ((z * num) + (num2 * w)) + num11;
result.W = (w * num) - num10;
}
#endregion
#region Dot
/// <summary>
/// Returns a dot product of two quaternions.
/// </summary>
/// <param name="quaternion1">The first quaternion.</param>
/// <param name="quaternion2">The second quaternion.</param>
/// <returns>The dot product of two quaternions.</returns>
public static float Dot(Quaternion quaternion1, Quaternion quaternion2)
{
return ((((quaternion1.X * quaternion2.X) + (quaternion1.Y * quaternion2.Y)) + (quaternion1.Z * quaternion2.Z)) + (quaternion1.W * quaternion2.W));
}
/// <summary>
/// Returns a dot product of two quaternions.
/// </summary>
/// <param name="quaternion1">The first quaternion.</param>
/// <param name="quaternion2">The second quaternion.</param>
/// <param name="result">The dot product of two quaternions as an output parameter.</param>
public static void Dot(ref Quaternion quaternion1, ref Quaternion quaternion2, out float result)
{
result = (((quaternion1.X * quaternion2.X) + (quaternion1.Y * quaternion2.Y)) + (quaternion1.Z * quaternion2.Z)) + (quaternion1.W * quaternion2.W);
}
#endregion
#region Equals
/// <summary>
/// Compares whether current instance is equal to specified <see cref="Object"/>.
/// </summary>
/// <param name="obj">The <see cref="Object"/> to compare.</param>
/// <returns><c>true</c> if the instances are equal; <c>false</c> otherwise.</returns>
public override bool Equals(object obj)
{
if (obj is Quaternion)
return Equals((Quaternion)obj);
return false;
}
/// <summary>
/// Compares whether current instance is equal to specified <see cref="Quaternion"/>.
/// </summary>
/// <param name="other">The <see cref="Quaternion"/> to compare.</param>
/// <returns><c>true</c> if the instances are equal; <c>false</c> otherwise.</returns>
public bool Equals(Quaternion other)
{
return X == other.X &&
Y == other.Y &&
Z == other.Z &&
W == other.W;
}
#endregion
/// <summary>
/// Gets the hash code of this <see cref="Quaternion"/>.
/// </summary>
/// <returns>Hash code of this <see cref="Quaternion"/>.</returns>
public override int GetHashCode()
{
return X.GetHashCode() + Y.GetHashCode() + Z.GetHashCode() + W.GetHashCode();
}
#region Inverse
/// <summary>
/// Returns the inverse quaternion which represents the opposite rotation.
/// </summary>
/// <param name="quaternion">Source <see cref="Quaternion"/>.</param>
/// <returns>The inverse quaternion.</returns>
public static Quaternion Inverse(Quaternion quaternion)
{
Quaternion quaternion2;
float num2 = (((quaternion.X * quaternion.X) + (quaternion.Y * quaternion.Y)) + (quaternion.Z * quaternion.Z)) + (quaternion.W * quaternion.W);
float num = 1f / num2;
quaternion2.X = -quaternion.X * num;
quaternion2.Y = -quaternion.Y * num;
quaternion2.Z = -quaternion.Z * num;
quaternion2.W = quaternion.W * num;
return quaternion2;
}
/// <summary>
/// Returns the inverse quaternion which represents the opposite rotation.
/// </summary>
/// <param name="quaternion">Source <see cref="Quaternion"/>.</param>
/// <param name="result">The inverse quaternion as an output parameter.</param>
public static void Inverse(ref Quaternion quaternion, out Quaternion result)
{
float num2 = (((quaternion.X * quaternion.X) + (quaternion.Y * quaternion.Y)) + (quaternion.Z * quaternion.Z)) + (quaternion.W * quaternion.W);
float num = 1f / num2;
result.X = -quaternion.X * num;
result.Y = -quaternion.Y * num;
result.Z = -quaternion.Z * num;
result.W = quaternion.W * num;
}
#endregion
/// <summary>
/// Returns the magnitude of the quaternion components.
/// </summary>
/// <returns>The magnitude of the quaternion components.</returns>
public float Length()
{
return MathF.Sqrt((X * X) + (Y * Y) + (Z * Z) + (W * W));
}
/// <summary>
/// Returns the squared magnitude of the quaternion components.
/// </summary>
/// <returns>The squared magnitude of the quaternion components.</returns>
public float LengthSquared()
{
return (X * X) + (Y * Y) + (Z * Z) + (W * W);
}
#region Lerp
/// <summary>
/// Performs a linear blend between two quaternions.
/// </summary>
/// <param name="quaternion1">Source <see cref="Quaternion"/>.</param>
/// <param name="quaternion2">Source <see cref="Quaternion"/>.</param>
/// <param name="amount">The blend amount where 0 returns <paramref name="quaternion1"/> and 1 <paramref name="quaternion2"/>.</param>
/// <returns>The result of linear blending between two quaternions.</returns>
public static Quaternion Lerp(Quaternion quaternion1, Quaternion quaternion2, float amount)
{
float num = amount;
float num2 = 1f - num;
Quaternion quaternion = new Quaternion();
float num5 = (((quaternion1.X * quaternion2.X) + (quaternion1.Y * quaternion2.Y)) + (quaternion1.Z * quaternion2.Z)) + (quaternion1.W * quaternion2.W);
if (num5 >= 0f)
{
quaternion.X = (num2 * quaternion1.X) + (num * quaternion2.X);
quaternion.Y = (num2 * quaternion1.Y) + (num * quaternion2.Y);
quaternion.Z = (num2 * quaternion1.Z) + (num * quaternion2.Z);
quaternion.W = (num2 * quaternion1.W) + (num * quaternion2.W);
}
else
{
quaternion.X = (num2 * quaternion1.X) - (num * quaternion2.X);
quaternion.Y = (num2 * quaternion1.Y) - (num * quaternion2.Y);
quaternion.Z = (num2 * quaternion1.Z) - (num * quaternion2.Z);
quaternion.W = (num2 * quaternion1.W) - (num * quaternion2.W);
}
float num4 = (((quaternion.X * quaternion.X) + (quaternion.Y * quaternion.Y)) + (quaternion.Z * quaternion.Z)) + (quaternion.W * quaternion.W);
float num3 = 1f / (MathF.Sqrt(num4));
quaternion.X *= num3;
quaternion.Y *= num3;
quaternion.Z *= num3;
quaternion.W *= num3;
return quaternion;
}
/// <summary>
/// Performs a linear blend between two quaternions.
/// </summary>
/// <param name="quaternion1">Source <see cref="Quaternion"/>.</param>
/// <param name="quaternion2">Source <see cref="Quaternion"/>.</param>
/// <param name="amount">The blend amount where 0 returns <paramref name="quaternion1"/> and 1 <paramref name="quaternion2"/>.</param>
/// <param name="result">The result of linear blending between two quaternions as an output parameter.</param>
public static void Lerp(ref Quaternion quaternion1, ref Quaternion quaternion2, float amount, out Quaternion result)
{
float num = amount;
float num2 = 1f - num;
float num5 = (((quaternion1.X * quaternion2.X) + (quaternion1.Y * quaternion2.Y)) + (quaternion1.Z * quaternion2.Z)) + (quaternion1.W * quaternion2.W);
if (num5 >= 0f)
{
result.X = (num2 * quaternion1.X) + (num * quaternion2.X);
result.Y = (num2 * quaternion1.Y) + (num * quaternion2.Y);
result.Z = (num2 * quaternion1.Z) + (num * quaternion2.Z);
result.W = (num2 * quaternion1.W) + (num * quaternion2.W);
}
else
{
result.X = (num2 * quaternion1.X) - (num * quaternion2.X);
result.Y = (num2 * quaternion1.Y) - (num * quaternion2.Y);
result.Z = (num2 * quaternion1.Z) - (num * quaternion2.Z);
result.W = (num2 * quaternion1.W) - (num * quaternion2.W);
}
float num4 = (((result.X * result.X) + (result.Y * result.Y)) + (result.Z * result.Z)) + (result.W * result.W);
float num3 = 1f / (MathF.Sqrt(num4));
result.X *= num3;
result.Y *= num3;
result.Z *= num3;
result.W *= num3;
}
#endregion
#region Slerp
/// <summary>
/// Performs a spherical linear blend between two quaternions.
/// </summary>
/// <param name="quaternion1">Source <see cref="Quaternion"/>.</param>
/// <param name="quaternion2">Source <see cref="Quaternion"/>.</param>
/// <param name="amount">The blend amount where 0 returns <paramref name="quaternion1"/> and 1 <paramref name="quaternion2"/>.</param>
/// <returns>The result of spherical linear blending between two quaternions.</returns>
public static Quaternion Slerp(Quaternion quaternion1, Quaternion quaternion2, float amount)
{
float num2;
float num3;
Quaternion quaternion;
float num = amount;
float num4 = (((quaternion1.X * quaternion2.X) + (quaternion1.Y * quaternion2.Y)) + (quaternion1.Z * quaternion2.Z)) + (quaternion1.W * quaternion2.W);
bool flag = false;
if (num4 < 0f)
{
flag = true;
num4 = -num4;
}
if (num4 > 0.999999f)
{
num3 = 1f - num;
num2 = flag ? -num : num;
}
else
{
float num5 = MathF.Acos(num4);
float num6 = (1.0f / MathF.Sin(num5));
num3 = (MathF.Sin(((1f - num) * num5))) * num6;
num2 = flag ? ((-MathF.Sin(num * num5)) * num6) : (MathF.Sin(num * num5) * num6);
}
quaternion.X = (num3 * quaternion1.X) + (num2 * quaternion2.X);
quaternion.Y = (num3 * quaternion1.Y) + (num2 * quaternion2.Y);
quaternion.Z = (num3 * quaternion1.Z) + (num2 * quaternion2.Z);
quaternion.W = (num3 * quaternion1.W) + (num2 * quaternion2.W);
return quaternion;
}
/// <summary>
/// Performs a spherical linear blend between two quaternions.
/// </summary>
/// <param name="quaternion1">Source <see cref="Quaternion"/>.</param>
/// <param name="quaternion2">Source <see cref="Quaternion"/>.</param>
/// <param name="amount">The blend amount where 0 returns <paramref name="quaternion1"/> and 1 <paramref name="quaternion2"/>.</param>
/// <param name="result">The result of spherical linear blending between two quaternions as an output parameter.</param>
public static void Slerp(ref Quaternion quaternion1, ref Quaternion quaternion2, float amount, out Quaternion result)
{
float num2;
float num3;
float num = amount;
float num4 = (((quaternion1.X * quaternion2.X) + (quaternion1.Y * quaternion2.Y)) + (quaternion1.Z * quaternion2.Z)) + (quaternion1.W * quaternion2.W);
bool flag = false;
if (num4 < 0f)
{
flag = true;
num4 = -num4;
}
if (num4 > 0.999999f)
{
num3 = 1f - num;
num2 = flag ? -num : num;
}
else
{
float num5 = MathF.Acos(num4);
float num6 = (1.0f / MathF.Sin(num5));
num3 = (MathF.Sin((1f - num) * num5)) * num6;
num2 = flag ? ((-MathF.Sin(num * num5)) * num6) : (MathF.Sin(num * num5) * num6);
}
result.X = (num3 * quaternion1.X) + (num2 * quaternion2.X);
result.Y = (num3 * quaternion1.Y) + (num2 * quaternion2.Y);
result.Z = (num3 * quaternion1.Z) + (num2 * quaternion2.Z);
result.W = (num3 * quaternion1.W) + (num2 * quaternion2.W);
}
#endregion
#region Subtract
/// <summary>
/// Creates a new <see cref="Quaternion"/> that contains subtraction of one <see cref="Quaternion"/> from another.
/// </summary>
/// <param name="quaternion1">Source <see cref="Quaternion"/>.</param>
/// <param name="quaternion2">Source <see cref="Quaternion"/>.</param>
/// <returns>The result of the quaternion subtraction.</returns>
public static Quaternion Subtract(Quaternion quaternion1, Quaternion quaternion2)
{
Quaternion quaternion;
quaternion.X = quaternion1.X - quaternion2.X;
quaternion.Y = quaternion1.Y - quaternion2.Y;
quaternion.Z = quaternion1.Z - quaternion2.Z;
quaternion.W = quaternion1.W - quaternion2.W;
return quaternion;
}
/// <summary>
/// Creates a new <see cref="Quaternion"/> that contains subtraction of one <see cref="Quaternion"/> from another.
/// </summary>
/// <param name="quaternion1">Source <see cref="Quaternion"/>.</param>
/// <param name="quaternion2">Source <see cref="Quaternion"/>.</param>
/// <param name="result">The result of the quaternion subtraction as an output parameter.</param>
public static void Subtract(ref Quaternion quaternion1, ref Quaternion quaternion2, out Quaternion result)
{
result.X = quaternion1.X - quaternion2.X;
result.Y = quaternion1.Y - quaternion2.Y;
result.Z = quaternion1.Z - quaternion2.Z;
result.W = quaternion1.W - quaternion2.W;
}
#endregion
#region Multiply
/// <summary>
/// Creates a new <see cref="Quaternion"/> that contains a multiplication of two quaternions.
/// </summary>
/// <param name="quaternion1">Source <see cref="Quaternion"/>.</param>
/// <param name="quaternion2">Source <see cref="Quaternion"/>.</param>
/// <returns>The result of the quaternion multiplication.</returns>
public static Quaternion Multiply(Quaternion quaternion1, Quaternion quaternion2)
{
Quaternion quaternion;
float x = quaternion1.X;
float y = quaternion1.Y;
float z = quaternion1.Z;
float w = quaternion1.W;
float num4 = quaternion2.X;
float num3 = quaternion2.Y;
float num2 = quaternion2.Z;
float num = quaternion2.W;
float num12 = (y * num2) - (z * num3);
float num11 = (z * num4) - (x * num2);
float num10 = (x * num3) - (y * num4);
float num9 = ((x * num4) + (y * num3)) + (z * num2);
quaternion.X = ((x * num) + (num4 * w)) + num12;
quaternion.Y = ((y * num) + (num3 * w)) + num11;
quaternion.Z = ((z * num) + (num2 * w)) + num10;
quaternion.W = (w * num) - num9;
return quaternion;
}
/// <summary>
/// Creates a new <see cref="Quaternion"/> that contains a multiplication of <see cref="Quaternion"/> and a scalar.
/// </summary>
/// <param name="quaternion1">Source <see cref="Quaternion"/>.</param>
/// <param name="scaleFactor">Scalar value.</param>
/// <returns>The result of the quaternion multiplication with a scalar.</returns>
public static Quaternion Multiply(Quaternion quaternion1, float scaleFactor)
{
Quaternion quaternion;
quaternion.X = quaternion1.X * scaleFactor;
quaternion.Y = quaternion1.Y * scaleFactor;
quaternion.Z = quaternion1.Z * scaleFactor;
quaternion.W = quaternion1.W * scaleFactor;
return quaternion;
}
/// <summary>
/// Creates a new <see cref="Quaternion"/> that contains a multiplication of <see cref="Quaternion"/> and a scalar.
/// </summary>
/// <param name="quaternion1">Source <see cref="Quaternion"/>.</param>
/// <param name="scaleFactor">Scalar value.</param>
/// <param name="result">The result of the quaternion multiplication with a scalar as an output parameter.</param>
public static void Multiply(ref Quaternion quaternion1, float scaleFactor, out Quaternion result)
{
result.X = quaternion1.X * scaleFactor;
result.Y = quaternion1.Y * scaleFactor;
result.Z = quaternion1.Z * scaleFactor;
result.W = quaternion1.W * scaleFactor;
}
/// <summary>
/// Creates a new <see cref="Quaternion"/> that contains a multiplication of two quaternions.
/// </summary>
/// <param name="quaternion1">Source <see cref="Quaternion"/>.</param>
/// <param name="quaternion2">Source <see cref="Quaternion"/>.</param>
/// <param name="result">The result of the quaternion multiplication as an output parameter.</param>
public static void Multiply(ref Quaternion quaternion1, ref Quaternion quaternion2, out Quaternion result)
{
float x = quaternion1.X;
float y = quaternion1.Y;
float z = quaternion1.Z;
float w = quaternion1.W;
float num4 = quaternion2.X;
float num3 = quaternion2.Y;
float num2 = quaternion2.Z;
float num = quaternion2.W;
float num12 = (y * num2) - (z * num3);
float num11 = (z * num4) - (x * num2);
float num10 = (x * num3) - (y * num4);
float num9 = ((x * num4) + (y * num3)) + (z * num2);
result.X = ((x * num) + (num4 * w)) + num12;
result.Y = ((y * num) + (num3 * w)) + num11;
result.Z = ((z * num) + (num2 * w)) + num10;
result.W = (w * num) - num9;
}
#endregion
#region Negate
/// <summary>
/// Flips the sign of the all the quaternion components.
/// </summary>
/// <param name="quaternion">Source <see cref="Quaternion"/>.</param>
/// <returns>The result of the quaternion negation.</returns>
public static Quaternion Negate(Quaternion quaternion)
{
return new Quaternion(-quaternion.X, -quaternion.Y, -quaternion.Z, -quaternion.W);
}
/// <summary>
/// Flips the sign of the all the quaternion components.
/// </summary>
/// <param name="quaternion">Source <see cref="Quaternion"/>.</param>
/// <param name="result">The result of the quaternion negation as an output parameter.</param>
public static void Negate(ref Quaternion quaternion, out Quaternion result)
{
result.X = -quaternion.X;
result.Y = -quaternion.Y;
result.Z = -quaternion.Z;
result.W = -quaternion.W;
}
#endregion
#region Normalize
/// <summary>
/// Scales the quaternion magnitude to unit length.
/// </summary>
public void Normalize()
{
float num = 1f / (MathF.Sqrt((X * X) + (Y * Y) + (Z * Z) + (W * W)));
X *= num;
Y *= num;
Z *= num;
W *= num;
}
/// <summary>
/// Scales the quaternion magnitude to unit length.
/// </summary>
/// <param name="quaternion">Source <see cref="Quaternion"/>.</param>
/// <returns>The unit length quaternion.</returns>
public static Quaternion Normalize(Quaternion quaternion)
{
Quaternion result;
float num = 1f / (MathF.Sqrt((quaternion.X * quaternion.X) + (quaternion.Y * quaternion.Y) + (quaternion.Z * quaternion.Z) + (quaternion.W * quaternion.W)));
result.X = quaternion.X * num;
result.Y = quaternion.Y * num;
result.Z = quaternion.Z * num;
result.W = quaternion.W * num;
return result;
}
/// <summary>
/// Scales the quaternion magnitude to unit length.
/// </summary>
/// <param name="quaternion">Source <see cref="Quaternion"/>.</param>
/// <param name="result">The unit length quaternion an output parameter.</param>
public static void Normalize(ref Quaternion quaternion, out Quaternion result)
{
float num = 1f / (MathF.Sqrt((quaternion.X * quaternion.X) + (quaternion.Y * quaternion.Y) + (quaternion.Z * quaternion.Z) + (quaternion.W * quaternion.W)));
result.X = quaternion.X * num;
result.Y = quaternion.Y * num;
result.Z = quaternion.Z * num;
result.W = quaternion.W * num;
}
#endregion
/// <summary>
/// Returns a <see cref="String"/> representation of this <see cref="Quaternion"/> in the format:
/// {X:[<see cref="X"/>] Y:[<see cref="Y"/>] Z:[<see cref="Z"/>] W:[<see cref="W"/>]}
/// </summary>
/// <returns>A <see cref="String"/> representation of this <see cref="Quaternion"/>.</returns>
public override string ToString()
{
return "{X:" + X + " Y:" + Y + " Z:" + Z + " W:" + W + "}";
}
/// <summary>
/// Gets a <see cref="Vector4"/> representation for this object.
/// </summary>
/// <returns>A <see cref="Vector4"/> representation for this object.</returns>
public Vector4 ToVector4()
{
return new Vector4(X,Y,Z,W);
}
public void Deconstruct(out float x, out float y, out float z, out float w)
{
x = X;
y = Y;
z = Z;
w = W;
}
/// <summary>
/// Returns a <see cref="System.Numerics.Quaternion"/>.
/// </summary>
public System.Numerics.Quaternion ToNumerics()
{
return new System.Numerics.Quaternion(this.X, this.Y, this.Z, this.W);
}
#endregion
#region Operators
/// <summary>
/// Converts a <see cref="System.Numerics.Quaternion"/> to a <see cref="Quaternion"/>.
/// </summary>
/// <param name="value">The converted value.</param>
public static implicit operator Quaternion(System.Numerics.Quaternion value)
{
return new Quaternion(value.X, value.Y, value.Z, value.W);
}
/// <summary>
/// Adds two quaternions.
/// </summary>
/// <param name="quaternion1">Source <see cref="Quaternion"/> on the left of the add sign.</param>
/// <param name="quaternion2">Source <see cref="Quaternion"/> on the right of the add sign.</param>
/// <returns>Sum of the vectors.</returns>
public static Quaternion operator +(Quaternion quaternion1, Quaternion quaternion2)
{
Quaternion quaternion;
quaternion.X = quaternion1.X + quaternion2.X;
quaternion.Y = quaternion1.Y + quaternion2.Y;
quaternion.Z = quaternion1.Z + quaternion2.Z;
quaternion.W = quaternion1.W + quaternion2.W;
return quaternion;
}
/// <summary>
/// Divides a <see cref="Quaternion"/> by the other <see cref="Quaternion"/>.
/// </summary>
/// <param name="quaternion1">Source <see cref="Quaternion"/> on the left of the div sign.</param>
/// <param name="quaternion2">Divisor <see cref="Quaternion"/> on the right of the div sign.</param>
/// <returns>The result of dividing the quaternions.</returns>
public static Quaternion operator /(Quaternion quaternion1, Quaternion quaternion2)
{
Quaternion quaternion;
float x = quaternion1.X;
float y = quaternion1.Y;
float z = quaternion1.Z;
float w = quaternion1.W;
float num14 = (((quaternion2.X * quaternion2.X) + (quaternion2.Y * quaternion2.Y)) + (quaternion2.Z * quaternion2.Z)) + (quaternion2.W * quaternion2.W);
float num5 = 1f / num14;
float num4 = -quaternion2.X * num5;
float num3 = -quaternion2.Y * num5;
float num2 = -quaternion2.Z * num5;
float num = quaternion2.W * num5;
float num13 = (y * num2) - (z * num3);
float num12 = (z * num4) - (x * num2);
float num11 = (x * num3) - (y * num4);
float num10 = ((x * num4) + (y * num3)) + (z * num2);
quaternion.X = ((x * num) + (num4 * w)) + num13;
quaternion.Y = ((y * num) + (num3 * w)) + num12;
quaternion.Z = ((z * num) + (num2 * w)) + num11;
quaternion.W = (w * num) - num10;
return quaternion;
}
/// <summary>
/// Compares whether two <see cref="Quaternion"/> instances are equal.
/// </summary>
/// <param name="quaternion1"><see cref="Quaternion"/> instance on the left of the equal sign.</param>
/// <param name="quaternion2"><see cref="Quaternion"/> instance on the right of the equal sign.</param>
/// <returns><c>true</c> if the instances are equal; <c>false</c> otherwise.</returns>
public static bool operator ==(Quaternion quaternion1, Quaternion quaternion2)
{
return ((((quaternion1.X == quaternion2.X) && (quaternion1.Y == quaternion2.Y)) && (quaternion1.Z == quaternion2.Z)) && (quaternion1.W == quaternion2.W));
}
/// <summary>
/// Compares whether two <see cref="Quaternion"/> instances are not equal.
/// </summary>
/// <param name="quaternion1"><see cref="Quaternion"/> instance on the left of the not equal sign.</param>
/// <param name="quaternion2"><see cref="Quaternion"/> instance on the right of the not equal sign.</param>
/// <returns><c>true</c> if the instances are not equal; <c>false</c> otherwise.</returns>
public static bool operator !=(Quaternion quaternion1, Quaternion quaternion2)
{
if (((quaternion1.X == quaternion2.X) && (quaternion1.Y == quaternion2.Y)) && (quaternion1.Z == quaternion2.Z))
{
return (quaternion1.W != quaternion2.W);
}
return true;
}
/// <summary>
/// Multiplies two quaternions.
/// </summary>
/// <param name="quaternion1">Source <see cref="Quaternion"/> on the left of the mul sign.</param>
/// <param name="quaternion2">Source <see cref="Quaternion"/> on the right of the mul sign.</param>
/// <returns>Result of the quaternions multiplication.</returns>
public static Quaternion operator *(Quaternion quaternion1, Quaternion quaternion2)
{
Quaternion quaternion;
float x = quaternion1.X;
float y = quaternion1.Y;
float z = quaternion1.Z;
float w = quaternion1.W;
float num4 = quaternion2.X;
float num3 = quaternion2.Y;
float num2 = quaternion2.Z;
float num = quaternion2.W;
float num12 = (y * num2) - (z * num3);
float num11 = (z * num4) - (x * num2);
float num10 = (x * num3) - (y * num4);
float num9 = ((x * num4) + (y * num3)) + (z * num2);
quaternion.X = ((x * num) + (num4 * w)) + num12;
quaternion.Y = ((y * num) + (num3 * w)) + num11;
quaternion.Z = ((z * num) + (num2 * w)) + num10;
quaternion.W = (w * num) - num9;
return quaternion;
}
/// <summary>
/// Multiplies the components of quaternion by a scalar.
/// </summary>
/// <param name="quaternion1">Source <see cref="Vector3"/> on the left of the mul sign.</param>
/// <param name="scaleFactor">Scalar value on the right of the mul sign.</param>
/// <returns>Result of the quaternion multiplication with a scalar.</returns>
public static Quaternion operator *(Quaternion quaternion1, float scaleFactor)
{
Quaternion quaternion;
quaternion.X = quaternion1.X * scaleFactor;
quaternion.Y = quaternion1.Y * scaleFactor;
quaternion.Z = quaternion1.Z * scaleFactor;
quaternion.W = quaternion1.W * scaleFactor;
return quaternion;
}
/// <summary>
/// Subtracts a <see cref="Quaternion"/> from a <see cref="Quaternion"/>.
/// </summary>
/// <param name="quaternion1">Source <see cref="Vector3"/> on the left of the sub sign.</param>
/// <param name="quaternion2">Source <see cref="Vector3"/> on the right of the sub sign.</param>
/// <returns>Result of the quaternion subtraction.</returns>
public static Quaternion operator -(Quaternion quaternion1, Quaternion quaternion2)
{
Quaternion quaternion;
quaternion.X = quaternion1.X - quaternion2.X;
quaternion.Y = quaternion1.Y - quaternion2.Y;
quaternion.Z = quaternion1.Z - quaternion2.Z;
quaternion.W = quaternion1.W - quaternion2.W;
return quaternion;
}
/// <summary>
/// Flips the sign of the all the quaternion components.
/// </summary>
/// <param name="quaternion">Source <see cref="Quaternion"/> on the right of the sub sign.</param>
/// <returns>The result of the quaternion negation.</returns>
public static Quaternion operator -(Quaternion quaternion)
{
Quaternion quaternion2;
quaternion2.X = -quaternion.X;
quaternion2.Y = -quaternion.Y;
quaternion2.Z = -quaternion.Z;
quaternion2.W = -quaternion.W;
return quaternion2;
}
#endregion
}
}
| 40.957358 | 166 | 0.564009 | [
"MIT"
] | PseudoPlay/MonoGame | MonoGame.Framework/Quaternion.cs | 48,985 | C# |
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Text;
using System.Xml;
using System.IO;
using System.Collections.Generic;
using System.Collections;
using System.Reflection;
using System.Threading;
using OpenMetaverse;
using log4net;
using OpenSim.Framework;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes.Scripting;
using OpenSim.Region.Framework.Scenes.Serialization;
using PermissionMask = OpenSim.Framework.PermissionMask;
namespace OpenSim.Region.Framework.Scenes
{
public class SceneObjectPartInventory : IEntityInventory
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private byte[] m_inventoryFileData = new byte[0];
private byte[] m_inventoryFileNameBytes = new byte[0];
private string m_inventoryFileName = "";
private uint m_inventoryFileNameSerial = 0;
private bool m_inventoryPrivileged = false;
private object m_inventoryFileLock = new object();
private Dictionary<UUID, ArrayList> m_scriptErrors = new Dictionary<UUID, ArrayList>();
/// <value>
/// The part to which the inventory belongs.
/// </value>
private SceneObjectPart m_part;
/// <summary>
/// Serial count for inventory file , used to tell if inventory has changed
/// no need for this to be part of Database backup
/// </summary>
protected uint m_inventorySerial = 0;
/// <summary>
/// Holds in memory prim inventory
/// </summary>
protected TaskInventoryDictionary m_items = new TaskInventoryDictionary();
/// <summary>
/// Tracks whether inventory has changed since the last persistent backup
/// </summary>
internal bool HasInventoryChanged;
/// <value>
/// Inventory serial number
/// </value>
protected internal uint Serial
{
get { return m_inventorySerial; }
set { m_inventorySerial = value; }
}
/// <value>
/// Raw inventory data
/// </value>
protected internal TaskInventoryDictionary Items
{
get
{
return m_items;
}
set
{
m_items = value;
m_inventorySerial++;
QueryScriptStates();
}
}
public int Count
{
get
{
lock (m_items)
return m_items.Count;
}
}
/// <summary>
/// Constructor
/// </summary>
/// <param name="part">
/// A <see cref="SceneObjectPart"/>
/// </param>
public SceneObjectPartInventory(SceneObjectPart part)
{
m_part = part;
}
/// <summary>
/// Force the task inventory of this prim to persist at the next update sweep
/// </summary>
public void ForceInventoryPersistence()
{
HasInventoryChanged = true;
}
/// <summary>
/// Reset UUIDs for all the items in the prim's inventory.
/// </summary>
/// <remarks>
/// This involves either generating
/// new ones or setting existing UUIDs to the correct parent UUIDs.
///
/// If this method is called and there are inventory items, then we regard the inventory as having changed.
/// </remarks>
public void ResetInventoryIDs()
{
if (m_part == null)
return;
m_items.LockItemsForWrite(true);
if (m_items.Count == 0)
{
m_items.LockItemsForWrite(false);
return;
}
UUID partID = m_part.UUID;
IList<TaskInventoryItem> items = new List<TaskInventoryItem>(m_items.Values);
m_items.Clear();
foreach (TaskInventoryItem item in items)
{
item.ResetIDs(partID);
m_items.Add(item.ItemID, item);
}
m_inventorySerial++;
m_items.LockItemsForWrite(false);
}
public void ResetObjectID()
{
if (m_part == null)
return;
m_items.LockItemsForWrite(true);
if (m_items.Count == 0)
{
m_items.LockItemsForWrite(false);
return;
}
IList<TaskInventoryItem> items = new List<TaskInventoryItem>(m_items.Values);
m_items.Clear();
UUID partID = m_part.UUID;
foreach (TaskInventoryItem item in items)
{
item.ParentPartID = partID;
item.ParentID = partID;
m_items.Add(item.ItemID, item);
}
m_inventorySerial++;
m_items.LockItemsForWrite(false);
}
/// <summary>
/// Change every item in this inventory to a new owner.
/// </summary>
/// <param name="ownerId"></param>
public void ChangeInventoryOwner(UUID ownerId)
{
if(m_part == null)
return;
m_items.LockItemsForWrite(true);
if (m_items.Count == 0)
{
m_items.LockItemsForWrite(false);
return;
}
foreach (TaskInventoryItem item in m_items.Values)
{
if (ownerId != item.OwnerID)
item.LastOwnerID = item.OwnerID;
item.OwnerID = ownerId;
item.PermsMask = 0;
item.PermsGranter = UUID.Zero;
item.OwnerChanged = true;
}
HasInventoryChanged = true;
m_part.ParentGroup.HasGroupChanged = true;
m_inventorySerial++;
m_items.LockItemsForWrite(false);
}
/// <summary>
/// Change every item in this inventory to a new group.
/// </summary>
/// <param name="groupID"></param>
public void ChangeInventoryGroup(UUID groupID)
{
if(m_part == null)
return;
m_items.LockItemsForWrite(true);
if (m_items.Count == 0)
{
m_items.LockItemsForWrite(false);
return;
}
m_inventorySerial++;
// Don't let this set the HasGroupChanged flag for attachments
// as this happens during rez and we don't want a new asset
// for each attachment each time
if (!m_part.ParentGroup.IsAttachment)
{
HasInventoryChanged = true;
m_part.ParentGroup.HasGroupChanged = true;
}
foreach (TaskInventoryItem item in m_items.Values)
item.GroupID = groupID;
m_items.LockItemsForWrite(false);
}
private void QueryScriptStates()
{
if (m_part == null || m_part.ParentGroup == null || m_part.ParentGroup.Scene == null)
return;
m_items.LockItemsForRead(true);
foreach (TaskInventoryItem item in m_items.Values)
{
if (item.InvType == (int)InventoryType.LSL)
{
bool running;
if (TryGetScriptInstanceRunning(m_part.ParentGroup.Scene, item, out running))
item.ScriptRunning = running;
}
}
m_items.LockItemsForRead(false);
}
public bool TryGetScriptInstanceRunning(UUID itemId, out bool running)
{
running = false;
TaskInventoryItem item = GetInventoryItem(itemId);
if (item == null)
return false;
return TryGetScriptInstanceRunning(m_part.ParentGroup.Scene, item, out running);
}
public static bool TryGetScriptInstanceRunning(Scene scene, TaskInventoryItem item, out bool running)
{
running = false;
if (item.InvType != (int)InventoryType.LSL)
return false;
IScriptModule[] engines = scene.RequestModuleInterfaces<IScriptModule>();
if (engines == null) // No engine at all
return false;
foreach (IScriptModule e in engines)
{
if (e.HasScript(item.ItemID, out running))
return true;
}
return false;
}
public int CreateScriptInstances(int startParam, bool postOnRez, string engine, int stateSource)
{
int scriptsValidForStarting = 0;
List<TaskInventoryItem> scripts = GetInventoryItems(InventoryType.LSL);
foreach (TaskInventoryItem item in scripts)
if (CreateScriptInstance(item, startParam, postOnRez, engine, stateSource))
scriptsValidForStarting++;
return scriptsValidForStarting;
}
public ArrayList GetScriptErrors(UUID itemID)
{
ArrayList ret = new ArrayList();
IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>();
foreach (IScriptModule e in engines)
{
if (e != null)
{
ArrayList errors = e.GetScriptErrors(itemID);
foreach (Object line in errors)
ret.Add(line);
}
}
return ret;
}
/// <summary>
/// Stop and remove all the scripts in this prim.
/// </summary>
/// <param name="sceneObjectBeingDeleted">
/// Should be true if these scripts are being removed because the scene
/// object is being deleted. This will prevent spurious updates to the client.
/// </param>
public void RemoveScriptInstances(bool sceneObjectBeingDeleted)
{
List<TaskInventoryItem> scripts = GetInventoryItems(InventoryType.LSL);
foreach (TaskInventoryItem item in scripts)
{
RemoveScriptInstance(item.ItemID, sceneObjectBeingDeleted);
m_part.RemoveScriptEvents(item.ItemID);
}
}
/// <summary>
/// Stop all the scripts in this prim.
/// </summary>
public void StopScriptInstances()
{
List<TaskInventoryItem> scripts = GetInventoryItems(InventoryType.LSL);
foreach (TaskInventoryItem item in scripts)
StopScriptInstance(item);
}
/// <summary>
/// Start a script which is in this prim's inventory.
/// </summary>
/// <param name="item"></param>
/// <returns>true if the script instance was created, false otherwise</returns>
public bool CreateScriptInstance(TaskInventoryItem item, int startParam, bool postOnRez, string engine, int stateSource)
{
// m_log.DebugFormat("[PRIM INVENTORY]: Starting script {0} {1} in prim {2} {3} in {4}",
// item.Name, item.ItemID, m_part.Name, m_part.UUID, m_part.ParentGroup.Scene.RegionInfo.RegionName);
if (!m_part.ParentGroup.Scene.Permissions.CanRunScript(item, m_part))
{
StoreScriptError(item.ItemID, "no permission");
return false;
}
m_part.AddFlag(PrimFlags.Scripted);
if (m_part.ParentGroup.Scene.RegionInfo.RegionSettings.DisableScripts)
return false;
if (stateSource == 2 && // Prim crossing
m_part.ParentGroup.Scene.m_trustBinaries)
{
m_items.LockItemsForWrite(true);
m_items[item.ItemID].PermsMask = 0;
m_items[item.ItemID].PermsGranter = UUID.Zero;
m_items.LockItemsForWrite(false);
m_part.ParentGroup.Scene.EventManager.TriggerRezScript(
m_part.LocalId, item.ItemID, String.Empty, startParam, postOnRez, engine, stateSource);
StoreScriptErrors(item.ItemID, null);
m_part.ParentGroup.AddActiveScriptCount(1);
m_part.ScheduleFullUpdate();
return true;
}
AssetBase asset = m_part.ParentGroup.Scene.AssetService.Get(item.AssetID.ToString());
if (null == asset)
{
string msg = String.Format("asset ID {0} could not be found", item.AssetID);
StoreScriptError(item.ItemID, msg);
m_log.ErrorFormat(
"[PRIM INVENTORY]: Couldn't start script {0}, {1} at {2} in {3} since asset ID {4} could not be found",
item.Name, item.ItemID, m_part.AbsolutePosition,
m_part.ParentGroup.Scene.RegionInfo.RegionName, item.AssetID);
return false;
}
else
{
if (m_part.ParentGroup.m_savedScriptState != null)
item.OldItemID = RestoreSavedScriptState(item.LoadedItemID, item.OldItemID, item.ItemID);
m_items.LockItemsForWrite(true);
m_items[item.ItemID].OldItemID = item.OldItemID;
m_items[item.ItemID].PermsMask = 0;
m_items[item.ItemID].PermsGranter = UUID.Zero;
m_items.LockItemsForWrite(false);
string script = Utils.BytesToString(asset.Data);
m_part.ParentGroup.Scene.EventManager.TriggerRezScript(
m_part.LocalId, item.ItemID, script, startParam, postOnRez, engine, stateSource);
StoreScriptErrors(item.ItemID, null);
if (!item.ScriptRunning)
m_part.ParentGroup.Scene.EventManager.TriggerStopScript(
m_part.LocalId, item.ItemID);
m_part.ParentGroup.AddActiveScriptCount(1);
m_part.ScheduleFullUpdate();
return true;
}
}
private UUID RestoreSavedScriptState(UUID loadedID, UUID oldID, UUID newID)
{
// m_log.DebugFormat(
// "[PRIM INVENTORY]: Restoring scripted state for item {0}, oldID {1}, loadedID {2}",
// newID, oldID, loadedID);
IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>();
if (engines.Length == 0) // No engine at all
return oldID;
UUID stateID = oldID;
if (!m_part.ParentGroup.m_savedScriptState.ContainsKey(oldID))
stateID = loadedID;
if (m_part.ParentGroup.m_savedScriptState.ContainsKey(stateID))
{
XmlDocument doc = new XmlDocument();
doc.LoadXml(m_part.ParentGroup.m_savedScriptState[stateID]);
////////// CRUFT WARNING ///////////////////////////////////
//
// Old objects will have <ScriptState><State> ...
// This format is XEngine ONLY
//
// New objects have <State Engine="...." ...><ScriptState>...
// This can be passed to any engine
//
XmlNode n = doc.SelectSingleNode("ScriptState");
if (n != null) // Old format data
{
XmlDocument newDoc = new XmlDocument();
XmlElement rootN = newDoc.CreateElement("", "State", "");
XmlAttribute uuidA = newDoc.CreateAttribute("", "UUID", "");
uuidA.Value = stateID.ToString();
rootN.Attributes.Append(uuidA);
XmlAttribute engineA = newDoc.CreateAttribute("", "Engine", "");
engineA.Value = "XEngine";
rootN.Attributes.Append(engineA);
newDoc.AppendChild(rootN);
XmlNode stateN = newDoc.ImportNode(n, true);
rootN.AppendChild(stateN);
// This created document has only the minimun data
// necessary for XEngine to parse it successfully
// m_log.DebugFormat("[PRIM INVENTORY]: Adding legacy state {0} in {1}", stateID, newID);
m_part.ParentGroup.m_savedScriptState[stateID] = newDoc.OuterXml;
}
foreach (IScriptModule e in engines)
{
if (e != null)
{
if (e.SetXMLState(newID, m_part.ParentGroup.m_savedScriptState[stateID]))
break;
}
}
m_part.ParentGroup.m_savedScriptState.Remove(stateID);
}
return stateID;
}
/// <summary>
/// Start a script which is in this prim's inventory.
/// Some processing may occur in the background, but this routine returns asap.
/// </summary>
/// <param name="itemId">
/// A <see cref="UUID"/>
/// </param>
public bool CreateScriptInstance(UUID itemId, int startParam, bool postOnRez, string engine, int stateSource)
{
lock (m_scriptErrors)
{
// Indicate to CreateScriptInstanceInternal() we don't want it to wait for completion
m_scriptErrors.Remove(itemId);
}
CreateScriptInstanceInternal(itemId, startParam, postOnRez, engine, stateSource);
return true;
}
private void CreateScriptInstanceInternal(UUID itemId, int startParam, bool postOnRez, string engine, int stateSource)
{
m_items.LockItemsForRead(true);
if (m_items.ContainsKey(itemId))
{
TaskInventoryItem it = m_items[itemId];
m_items.LockItemsForRead(false);
CreateScriptInstance(it, startParam, postOnRez, engine, stateSource);
}
else
{
m_items.LockItemsForRead(false);
string msg = String.Format("couldn't be found for prim {0}, {1} at {2} in {3}", m_part.Name, m_part.UUID,
m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName);
StoreScriptError(itemId, msg);
m_log.ErrorFormat(
"[PRIM INVENTORY]: " +
"Couldn't start script with ID {0} since it {1}", itemId, msg);
}
}
/// <summary>
/// Start a script which is in this prim's inventory and return any compilation error messages.
/// </summary>
/// <param name="itemId">
/// A <see cref="UUID"/>
/// </param>
public ArrayList CreateScriptInstanceEr(UUID itemId, int startParam, bool postOnRez, string engine, int stateSource)
{
ArrayList errors;
// Indicate to CreateScriptInstanceInternal() we want it to
// post any compilation/loading error messages
lock (m_scriptErrors)
{
m_scriptErrors[itemId] = null;
}
// Perform compilation/loading
CreateScriptInstanceInternal(itemId, startParam, postOnRez, engine, stateSource);
// Wait for and retrieve any errors
lock (m_scriptErrors)
{
while ((errors = m_scriptErrors[itemId]) == null)
{
if (!System.Threading.Monitor.Wait(m_scriptErrors, 15000))
{
m_log.ErrorFormat(
"[PRIM INVENTORY]: " +
"timedout waiting for script {0} errors", itemId);
errors = m_scriptErrors[itemId];
if (errors == null)
{
errors = new ArrayList(1);
errors.Add("timedout waiting for errors");
}
break;
}
}
m_scriptErrors.Remove(itemId);
}
return errors;
}
// Signal to CreateScriptInstanceEr() that compilation/loading is complete
private void StoreScriptErrors(UUID itemId, ArrayList errors)
{
lock (m_scriptErrors)
{
// If compilation/loading initiated via CreateScriptInstance(),
// it does not want the errors, so just get out
if (!m_scriptErrors.ContainsKey(itemId))
{
return;
}
// Initiated via CreateScriptInstanceEr(), if we know what the
// errors are, save them and wake CreateScriptInstanceEr().
if (errors != null)
{
m_scriptErrors[itemId] = errors;
System.Threading.Monitor.PulseAll(m_scriptErrors);
return;
}
}
// Initiated via CreateScriptInstanceEr() but we don't know what
// the errors are yet, so retrieve them from the script engine.
// This may involve some waiting internal to GetScriptErrors().
errors = GetScriptErrors(itemId);
// Get a default non-null value to indicate success.
if (errors == null)
{
errors = new ArrayList();
}
// Post to CreateScriptInstanceEr() and wake it up
lock (m_scriptErrors)
{
m_scriptErrors[itemId] = errors;
System.Threading.Monitor.PulseAll(m_scriptErrors);
}
}
// Like StoreScriptErrors(), but just posts a single string message
private void StoreScriptError(UUID itemId, string message)
{
ArrayList errors = new ArrayList(1);
errors.Add(message);
StoreScriptErrors(itemId, errors);
}
/// <summary>
/// Stop and remove a script which is in this prim's inventory.
/// </summary>
/// <param name="itemId"></param>
/// <param name="sceneObjectBeingDeleted">
/// Should be true if this script is being removed because the scene
/// object is being deleted. This will prevent spurious updates to the client.
/// </param>
public void RemoveScriptInstance(UUID itemId, bool sceneObjectBeingDeleted)
{
if (m_items.ContainsKey(itemId))
{
if (!sceneObjectBeingDeleted)
m_part.RemoveScriptEvents(itemId);
m_part.ParentGroup.Scene.EventManager.TriggerRemoveScript(m_part.LocalId, itemId);
m_part.ParentGroup.AddActiveScriptCount(-1);
}
else
{
m_log.WarnFormat(
"[PRIM INVENTORY]: " +
"Couldn't stop script with ID {0} since it couldn't be found for prim {1}, {2} at {3} in {4}",
itemId, m_part.Name, m_part.UUID,
m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName);
}
}
/// <summary>
/// Stop a script which is in this prim's inventory.
/// </summary>
/// <param name="itemId"></param>
/// <param name="sceneObjectBeingDeleted">
/// Should be true if this script is being removed because the scene
/// object is being deleted. This will prevent spurious updates to the client.
/// </param>
public void StopScriptInstance(UUID itemId)
{
TaskInventoryItem scriptItem;
lock (m_items)
m_items.TryGetValue(itemId, out scriptItem);
if (scriptItem != null)
{
StopScriptInstance(scriptItem);
}
else
{
m_log.WarnFormat(
"[PRIM INVENTORY]: " +
"Couldn't stop script with ID {0} since it couldn't be found for prim {1}, {2} at {3} in {4}",
itemId, m_part.Name, m_part.UUID,
m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName);
}
}
/// <summary>
/// Stop a script which is in this prim's inventory.
/// </summary>
/// <param name="itemId"></param>
/// <param name="sceneObjectBeingDeleted">
/// Should be true if this script is being removed because the scene
/// object is being deleted. This will prevent spurious updates to the client.
/// </param>
public void StopScriptInstance(TaskInventoryItem item)
{
if (m_part.ParentGroup.Scene != null)
m_part.ParentGroup.Scene.EventManager.TriggerStopScript(m_part.LocalId, item.ItemID);
// At the moment, even stopped scripts are counted as active, which is probably wrong.
// m_part.ParentGroup.AddActiveScriptCount(-1);
}
/// <summary>
/// Check if the inventory holds an item with a given name.
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
private bool InventoryContainsName(string name)
{
m_items.LockItemsForRead(true);
foreach (TaskInventoryItem item in m_items.Values)
{
if (item.Name == name)
{
m_items.LockItemsForRead(false);
return true;
}
}
m_items.LockItemsForRead(false);
return false;
}
/// <summary>
/// For a given item name, return that name if it is available. Otherwise, return the next available
/// similar name (which is currently the original name with the next available numeric suffix).
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
private string FindAvailableInventoryName(string name)
{
if (!InventoryContainsName(name))
return name;
int suffix=1;
while (suffix < 256)
{
string tryName=String.Format("{0} {1}", name, suffix);
if (!InventoryContainsName(tryName))
return tryName;
suffix++;
}
return String.Empty;
}
/// <summary>
/// Add an item to this prim's inventory. If an item with the same name already exists, then an alternative
/// name is chosen.
/// </summary>
/// <param name="item"></param>
public void AddInventoryItem(TaskInventoryItem item, bool allowedDrop)
{
AddInventoryItem(item.Name, item, allowedDrop);
}
/// <summary>
/// Add an item to this prim's inventory. If an item with the same name already exists, it is replaced.
/// </summary>
/// <param name="item"></param>
public void AddInventoryItemExclusive(TaskInventoryItem item, bool allowedDrop)
{
m_items.LockItemsForRead(true);
List<TaskInventoryItem> il = new List<TaskInventoryItem>(m_items.Values);
m_items.LockItemsForRead(false);
foreach (TaskInventoryItem i in il)
{
if (i.Name == item.Name)
{
if (i.InvType == (int)InventoryType.LSL)
RemoveScriptInstance(i.ItemID, false);
RemoveInventoryItem(i.ItemID);
break;
}
}
AddInventoryItem(item.Name, item, allowedDrop);
}
/// <summary>
/// Add an item to this prim's inventory.
/// </summary>
/// <param name="name">The name that the new item should have.</param>
/// <param name="item">
/// The item itself. The name within this structure is ignored in favour of the name
/// given in this method's arguments
/// </param>
/// <param name="allowedDrop">
/// Item was only added to inventory because AllowedDrop is set
/// </param>
protected void AddInventoryItem(string name, TaskInventoryItem item, bool allowedDrop)
{
name = FindAvailableInventoryName(name);
if (name == String.Empty)
return;
item.ParentID = m_part.UUID;
item.ParentPartID = m_part.UUID;
item.Name = name;
item.GroupID = m_part.GroupID;
m_items.LockItemsForWrite(true);
m_items.Add(item.ItemID, item);
m_items.LockItemsForWrite(false);
if (allowedDrop)
m_part.TriggerScriptChangedEvent(Changed.ALLOWED_DROP);
else
m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
m_part.AggregateInnerPerms();
m_inventorySerial++;
HasInventoryChanged = true;
m_part.ParentGroup.HasGroupChanged = true;
}
/// <summary>
/// Restore a whole collection of items to the prim's inventory at once.
/// We assume that the items already have all their fields correctly filled out.
/// The items are not flagged for persistence to the database, since they are being restored
/// from persistence rather than being newly added.
/// </summary>
/// <param name="items"></param>
public void RestoreInventoryItems(ICollection<TaskInventoryItem> items)
{
m_items.LockItemsForWrite(true);
foreach (TaskInventoryItem item in items)
{
m_items.Add(item.ItemID, item);
// m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
}
m_items.LockItemsForWrite(false);
m_part.AggregateInnerPerms();
m_inventorySerial++;
}
/// <summary>
/// Returns an existing inventory item. Returns the original, so any changes will be live.
/// </summary>
/// <param name="itemID"></param>
/// <returns>null if the item does not exist</returns>
public TaskInventoryItem GetInventoryItem(UUID itemId)
{
TaskInventoryItem item;
m_items.LockItemsForRead(true);
m_items.TryGetValue(itemId, out item);
m_items.LockItemsForRead(false);
return item;
}
public TaskInventoryItem GetInventoryItem(string name)
{
m_items.LockItemsForRead(true);
foreach (TaskInventoryItem item in m_items.Values)
{
if (item.Name == name)
{
m_items.LockItemsForRead(false);
return item;
}
}
m_items.LockItemsForRead(false);
return null;
}
public List<TaskInventoryItem> GetInventoryItems(string name)
{
List<TaskInventoryItem> items = new List<TaskInventoryItem>();
m_items.LockItemsForRead(true);
foreach (TaskInventoryItem item in m_items.Values)
{
if (item.Name == name)
items.Add(item);
}
m_items.LockItemsForRead(false);
return items;
}
public bool GetRezReadySceneObjects(TaskInventoryItem item, out List<SceneObjectGroup> objlist, out List<Vector3> veclist, out Vector3 bbox, out float offsetHeight)
{
AssetBase rezAsset = m_part.ParentGroup.Scene.AssetService.Get(item.AssetID.ToString());
if (null == rezAsset)
{
m_log.WarnFormat(
"[PRIM INVENTORY]: Could not find asset {0} for inventory item {1} in {2}",
item.AssetID, item.Name, m_part.Name);
objlist = null;
veclist = null;
bbox = Vector3.Zero;
offsetHeight = 0;
return false;
}
bool single = m_part.ParentGroup.Scene.GetObjectsToRez(rezAsset.Data, false, out objlist, out veclist, out bbox, out offsetHeight);
for (int i = 0; i < objlist.Count; i++)
{
SceneObjectGroup group = objlist[i];
/*
group.RootPart.AttachPoint = group.RootPart.Shape.State;
group.RootPart.AttachedPos = group.AbsolutePosition;
group.RootPart.AttachRotation = group.GroupRotation;
*/
group.ResetIDs();
SceneObjectPart rootPart = group.GetPart(group.UUID);
// Since renaming the item in the inventory does not affect the name stored
// in the serialization, transfer the correct name from the inventory to the
// object itself before we rez.
// Only do these for the first object if we are rezzing a coalescence.
// nahh dont mess with coalescence objects,
// the name in inventory can be change for inventory purpuses only
if (objlist.Count == 1)
{
rootPart.Name = item.Name;
rootPart.Description = item.Description;
}
/* reverted to old code till part.ApplyPermissionsOnRez is better reviewed/fixed
group.SetGroup(m_part.GroupID, null);
foreach (SceneObjectPart part in group.Parts)
{
// Convert between InventoryItem classes. You can never have too many similar but slightly different classes :)
InventoryItemBase dest = new InventoryItemBase(item.ItemID, item.OwnerID);
dest.BasePermissions = item.BasePermissions;
dest.CurrentPermissions = item.CurrentPermissions;
dest.EveryOnePermissions = item.EveryonePermissions;
dest.GroupPermissions = item.GroupPermissions;
dest.NextPermissions = item.NextPermissions;
dest.Flags = item.Flags;
part.ApplyPermissionsOnRez(dest, false, m_part.ParentGroup.Scene);
}
*/
// old code start
SceneObjectPart[] partList = group.Parts;
group.SetGroup(m_part.GroupID, null);
if ((rootPart.OwnerID != item.OwnerID) || (item.CurrentPermissions & (uint)PermissionMask.Slam) != 0 || (item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0)
{
if (m_part.ParentGroup.Scene.Permissions.PropagatePermissions())
{
foreach (SceneObjectPart part in partList)
{
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0)
part.EveryoneMask = item.EveryonePermissions;
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0)
part.NextOwnerMask = item.NextPermissions;
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteGroup) != 0)
part.GroupMask = item.GroupPermissions;
}
group.ApplyNextOwnerPermissions();
}
}
foreach (SceneObjectPart part in partList)
{
if ((part.OwnerID != item.OwnerID) || (item.CurrentPermissions & (uint)PermissionMask.Slam) != 0 || (item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0)
{
if(part.GroupID != part.OwnerID)
part.LastOwnerID = part.OwnerID;
part.OwnerID = item.OwnerID;
part.Inventory.ChangeInventoryOwner(item.OwnerID);
}
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0)
part.EveryoneMask = item.EveryonePermissions;
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0)
part.NextOwnerMask = item.NextPermissions;
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteGroup) != 0)
part.GroupMask = item.GroupPermissions;
}
// old code end
rootPart.TrimPermissions();
group.InvalidateDeepEffectivePerms();
}
return true;
}
/// <summary>
/// Update an existing inventory item.
/// </summary>
/// <param name="item">The updated item. An item with the same id must already exist
/// in this prim's inventory.</param>
/// <returns>false if the item did not exist, true if the update occurred successfully</returns>
public bool UpdateInventoryItem(TaskInventoryItem item)
{
return UpdateInventoryItem(item, true, true);
}
public bool UpdateInventoryItem(TaskInventoryItem item, bool fireScriptEvents)
{
return UpdateInventoryItem(item, fireScriptEvents, true);
}
public bool UpdateInventoryItem(TaskInventoryItem item, bool fireScriptEvents, bool considerChanged)
{
m_items.LockItemsForWrite(true);
if (m_items.ContainsKey(item.ItemID))
{
// m_log.DebugFormat("[PRIM INVENTORY]: Updating item {0} in {1}", item.Name, m_part.Name);
item.ParentID = m_part.UUID;
item.ParentPartID = m_part.UUID;
// If group permissions have been set on, check that the groupID is up to date in case it has
// changed since permissions were last set.
if (item.GroupPermissions != (uint)PermissionMask.None)
item.GroupID = m_part.GroupID;
if(item.OwnerID == UUID.Zero) // viewer to internal enconding of group owned
item.OwnerID = item.GroupID;
if (item.AssetID == UUID.Zero)
item.AssetID = m_items[item.ItemID].AssetID;
m_items[item.ItemID] = item;
m_inventorySerial++;
if (fireScriptEvents)
m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
if (considerChanged)
{
m_part.ParentGroup.InvalidateDeepEffectivePerms();
HasInventoryChanged = true;
m_part.ParentGroup.HasGroupChanged = true;
}
m_items.LockItemsForWrite(false);
return true;
}
else
{
m_log.ErrorFormat(
"[PRIM INVENTORY]: " +
"Tried to retrieve item ID {0} from prim {1}, {2} at {3} in {4} but the item does not exist in this inventory",
item.ItemID, m_part.Name, m_part.UUID,
m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName);
}
m_items.LockItemsForWrite(false);
return false;
}
/// <summary>
/// Remove an item from this prim's inventory
/// </summary>
/// <param name="itemID"></param>
/// <returns>Numeric asset type of the item removed. Returns -1 if the item did not exist
/// in this prim's inventory.</returns>
public int RemoveInventoryItem(UUID itemID)
{
m_items.LockItemsForRead(true);
if (m_items.ContainsKey(itemID))
{
int type = m_items[itemID].InvType;
m_items.LockItemsForRead(false);
if (type == (int)InventoryType.LSL) // Script
{
m_part.ParentGroup.Scene.EventManager.TriggerRemoveScript(m_part.LocalId, itemID);
}
m_items.LockItemsForWrite(true);
m_items.Remove(itemID);
m_items.LockItemsForWrite(false);
m_part.ParentGroup.InvalidateDeepEffectivePerms();
m_inventorySerial++;
m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
HasInventoryChanged = true;
m_part.ParentGroup.HasGroupChanged = true;
int scriptcount = 0;
m_items.LockItemsForRead(true);
foreach (TaskInventoryItem item in m_items.Values)
{
if (item.Type == (int)InventoryType.LSL)
{
scriptcount++;
}
}
m_items.LockItemsForRead(false);
if (scriptcount <= 0)
{
m_part.RemFlag(PrimFlags.Scripted);
}
m_part.ScheduleFullUpdate();
return type;
}
else
{
m_items.LockItemsForRead(false);
m_log.ErrorFormat(
"[PRIM INVENTORY]: " +
"Tried to remove item ID {0} from prim {1}, {2} but the item does not exist in this inventory",
itemID, m_part.Name, m_part.UUID);
}
return -1;
}
/// <summary>
/// Serialize all the metadata for the items in this prim's inventory ready for sending to the client
/// </summary>
/// <param name="xferManager"></param>
public void RequestInventoryFile(IClientAPI client, IXfer xferManager)
{
lock (m_inventoryFileLock)
{
bool changed = false;
m_items.LockItemsForRead(true);
if (m_inventorySerial == 0) // No inventory
{
m_items.LockItemsForRead(false);
client.SendTaskInventory(m_part.UUID, 0, new byte[0]);
return;
}
if (m_items.Count == 0) // No inventory
{
m_items.LockItemsForRead(false);
client.SendTaskInventory(m_part.UUID, 0, new byte[0]);
return;
}
if (m_inventoryFileNameSerial != m_inventorySerial)
{
m_inventoryFileNameSerial = m_inventorySerial;
changed = true;
}
m_items.LockItemsForRead(false);
if (m_inventoryFileData.Length < 2)
changed = true;
bool includeAssets = false;
if (m_part.ParentGroup.Scene.Permissions.CanEditObjectInventory(m_part.UUID, client.AgentId))
includeAssets = true;
if (m_inventoryPrivileged != includeAssets)
changed = true;
if (!changed)
{
xferManager.AddNewFile(m_inventoryFileName, m_inventoryFileData);
client.SendTaskInventory(m_part.UUID, (short)m_inventoryFileNameSerial,
m_inventoryFileNameBytes);
return;
}
m_inventoryPrivileged = includeAssets;
InventoryStringBuilder invString = new InventoryStringBuilder(m_part.UUID, UUID.Zero);
m_items.LockItemsForRead(true);
foreach (TaskInventoryItem item in m_items.Values)
{
UUID ownerID = item.OwnerID;
UUID groupID = item.GroupID;
uint everyoneMask = item.EveryonePermissions;
uint baseMask = item.BasePermissions;
uint ownerMask = item.CurrentPermissions;
uint groupMask = item.GroupPermissions;
invString.AddItemStart();
invString.AddNameValueLine("item_id", item.ItemID.ToString());
invString.AddNameValueLine("parent_id", m_part.UUID.ToString());
invString.AddPermissionsStart();
invString.AddNameValueLine("base_mask", Utils.UIntToHexString(baseMask));
invString.AddNameValueLine("owner_mask", Utils.UIntToHexString(ownerMask));
invString.AddNameValueLine("group_mask", Utils.UIntToHexString(groupMask));
invString.AddNameValueLine("everyone_mask", Utils.UIntToHexString(everyoneMask));
invString.AddNameValueLine("next_owner_mask", Utils.UIntToHexString(item.NextPermissions));
invString.AddNameValueLine("creator_id", item.CreatorID.ToString());
invString.AddNameValueLine("last_owner_id", item.LastOwnerID.ToString());
invString.AddNameValueLine("group_id",groupID.ToString());
if(groupID != UUID.Zero && ownerID == groupID)
{
invString.AddNameValueLine("owner_id", UUID.Zero.ToString());
invString.AddNameValueLine("group_owned","1");
}
else
{
invString.AddNameValueLine("owner_id", ownerID.ToString());
invString.AddNameValueLine("group_owned","0");
}
invString.AddSectionEnd();
if (includeAssets)
invString.AddNameValueLine("asset_id", item.AssetID.ToString());
else
invString.AddNameValueLine("asset_id", UUID.Zero.ToString());
invString.AddNameValueLine("type", Utils.AssetTypeToString((AssetType)item.Type));
invString.AddNameValueLine("inv_type", Utils.InventoryTypeToString((InventoryType)item.InvType));
invString.AddNameValueLine("flags", Utils.UIntToHexString(item.Flags));
invString.AddSaleStart();
invString.AddNameValueLine("sale_type", "not");
invString.AddNameValueLine("sale_price", "0");
invString.AddSectionEnd();
invString.AddNameValueLine("name", item.Name + "|");
invString.AddNameValueLine("desc", item.Description + "|");
invString.AddNameValueLine("creation_date", item.CreationDate.ToString());
invString.AddSectionEnd();
}
m_items.LockItemsForRead(false);
m_inventoryFileData = Utils.StringToBytes(invString.GetString());
if (m_inventoryFileData.Length > 2)
{
m_inventoryFileName = "inventory_" + UUID.Random().ToString() + ".tmp";
m_inventoryFileNameBytes = Util.StringToBytes256(m_inventoryFileName);
xferManager.AddNewFile(m_inventoryFileName, m_inventoryFileData);
client.SendTaskInventory(m_part.UUID, (short)m_inventoryFileNameSerial,m_inventoryFileNameBytes);
return;
}
client.SendTaskInventory(m_part.UUID, 0, new byte[0]);
}
}
/// <summary>
/// Process inventory backup
/// </summary>
/// <param name="datastore"></param>
public void ProcessInventoryBackup(ISimulationDataService datastore)
{
// Removed this because linking will cause an immediate delete of the new
// child prim from the database and the subsequent storing of the prim sees
// the inventory of it as unchanged and doesn't store it at all. The overhead
// of storing prim inventory needlessly is much less than the aggravation
// of prim inventory loss.
// if (HasInventoryChanged)
// {
m_items.LockItemsForRead(true);
ICollection<TaskInventoryItem> itemsvalues = m_items.Values;
HasInventoryChanged = false;
m_items.LockItemsForRead(false);
try
{
datastore.StorePrimInventory(m_part.UUID, itemsvalues);
}
catch {}
// }
}
public class InventoryStringBuilder
{
private StringBuilder BuildString = new StringBuilder(1024);
public InventoryStringBuilder(UUID folderID, UUID parentID)
{
BuildString.Append("\tinv_object\t0\n\t{\n");
AddNameValueLine("obj_id", folderID.ToString());
AddNameValueLine("parent_id", parentID.ToString());
AddNameValueLine("type", "category");
AddNameValueLine("name", "Contents|\n\t}");
}
public void AddItemStart()
{
BuildString.Append("\tinv_item\t0\n\t{\n");
}
public void AddPermissionsStart()
{
BuildString.Append("\tpermissions 0\n\t{\n");
}
public void AddSaleStart()
{
BuildString.Append("\tsale_info\t0\n\t{\n");
}
protected void AddSectionStart()
{
BuildString.Append("\t{\n");
}
public void AddSectionEnd()
{
BuildString.Append("\t}\n");
}
public void AddLine(string addLine)
{
BuildString.Append(addLine);
}
public void AddNameValueLine(string name, string value)
{
BuildString.Append("\t\t");
BuildString.Append(name);
BuildString.Append("\t");
BuildString.Append(value);
BuildString.Append("\n");
}
public String GetString()
{
return BuildString.ToString();
}
public void Close()
{
}
}
public void AggregateInnerPerms(ref uint owner, ref uint group, ref uint everyone)
{
foreach (TaskInventoryItem item in m_items.Values)
{
if(item.InvType == (sbyte)InventoryType.Landmark)
continue;
owner &= item.CurrentPermissions;
group &= item.GroupPermissions;
everyone &= item.EveryonePermissions;
}
}
public uint MaskEffectivePermissions()
{
// used to propagate permissions restrictions outwards
// Modify does not propagate outwards.
uint mask=0x7fffffff;
foreach (TaskInventoryItem item in m_items.Values)
{
if(item.InvType == (sbyte)InventoryType.Landmark)
continue;
// apply current to normal permission bits
uint newperms = item.CurrentPermissions;
if ((newperms & (uint)PermissionMask.Copy) == 0)
mask &= ~(uint)PermissionMask.Copy;
if ((newperms & (uint)PermissionMask.Transfer) == 0)
mask &= ~(uint)PermissionMask.Transfer;
if ((newperms & (uint)PermissionMask.Export) == 0)
mask &= ~((uint)PermissionMask.Export);
// apply next owner restricted by current to folded bits
newperms &= item.NextPermissions;
if ((newperms & (uint)PermissionMask.Copy) == 0)
mask &= ~((uint)PermissionMask.FoldedCopy);
if ((newperms & (uint)PermissionMask.Transfer) == 0)
mask &= ~((uint)PermissionMask.FoldedTransfer);
if ((newperms & (uint)PermissionMask.Export) == 0)
mask &= ~((uint)PermissionMask.FoldedExport);
}
return mask;
}
public void ApplyNextOwnerPermissions()
{
foreach (TaskInventoryItem item in m_items.Values)
{
item.CurrentPermissions &= item.NextPermissions;
item.BasePermissions &= item.NextPermissions;
item.EveryonePermissions &= item.NextPermissions;
item.OwnerChanged = true;
item.PermsMask = 0;
item.PermsGranter = UUID.Zero;
}
}
public void ApplyGodPermissions(uint perms)
{
foreach (TaskInventoryItem item in m_items.Values)
{
item.CurrentPermissions = perms;
item.BasePermissions = perms;
}
m_inventorySerial++;
HasInventoryChanged = true;
}
/// <summary>
/// Returns true if this part inventory contains any scripts. False otherwise.
/// </summary>
/// <returns></returns>
public bool ContainsScripts()
{
foreach (TaskInventoryItem item in m_items.Values)
{
if (item.InvType == (int)InventoryType.LSL)
{
return true;
}
}
return false;
}
/// <summary>
/// Returns the count of scripts in this parts inventory.
/// </summary>
/// <returns></returns>
public int ScriptCount()
{
int count = 0;
m_items.LockItemsForRead(true);
foreach (TaskInventoryItem item in m_items.Values)
{
if (item.InvType == (int)InventoryType.LSL)
count++;
}
m_items.LockItemsForRead(false);
return count;
}
/// <summary>
/// Returns the count of running scripts in this parts inventory.
/// </summary>
/// <returns></returns>
public int RunningScriptCount()
{
IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>();
if (engines.Length == 0)
return 0;
int count = 0;
List<TaskInventoryItem> scripts = GetInventoryItems(InventoryType.LSL);
foreach (TaskInventoryItem item in scripts)
{
foreach (IScriptModule engine in engines)
{
if (engine != null)
{
if (engine.GetScriptState(item.ItemID))
count++;
}
}
}
return count;
}
public List<UUID> GetInventoryList()
{
m_items.LockItemsForRead(true);
List<UUID> ret = new List<UUID>(m_items.Count);
foreach (TaskInventoryItem item in m_items.Values)
ret.Add(item.ItemID);
m_items.LockItemsForRead(false);
return ret;
}
public List<TaskInventoryItem> GetInventoryItems()
{
m_items.LockItemsForRead(true);
List<TaskInventoryItem> ret = new List<TaskInventoryItem>(m_items.Values);
m_items.LockItemsForRead(false);
return ret;
}
public List<TaskInventoryItem> GetInventoryItems(InventoryType type)
{
m_items.LockItemsForRead(true);
List<TaskInventoryItem> ret = new List<TaskInventoryItem>(m_items.Count);
foreach (TaskInventoryItem item in m_items.Values)
if (item.InvType == (int)type)
ret.Add(item);
m_items.LockItemsForRead(false);
return ret;
}
public Dictionary<UUID, string> GetScriptStates()
{
return GetScriptStates(false);
}
public Dictionary<UUID, string> GetScriptStates(bool oldIDs)
{
Dictionary<UUID, string> ret = new Dictionary<UUID, string>();
if (m_part.ParentGroup.Scene == null) // Group not in a scene
return ret;
IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>();
if (engines.Length == 0) // No engine at all
return ret;
List<TaskInventoryItem> scripts = GetInventoryItems(InventoryType.LSL);
foreach (TaskInventoryItem item in scripts)
{
foreach (IScriptModule e in engines)
{
if (e != null)
{
// m_log.DebugFormat(
// "[PRIM INVENTORY]: Getting script state from engine {0} for {1} in part {2} in group {3} in {4}",
// e.Name, item.Name, m_part.Name, m_part.ParentGroup.Name, m_part.ParentGroup.Scene.Name);
string n = e.GetXMLState(item.ItemID);
if (n != String.Empty)
{
if (oldIDs)
{
if (!ret.ContainsKey(item.OldItemID))
ret[item.OldItemID] = n;
}
else
{
if (!ret.ContainsKey(item.ItemID))
ret[item.ItemID] = n;
}
break;
}
}
}
}
return ret;
}
public void ResumeScripts()
{
IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>();
if (engines.Length == 0)
return;
List<TaskInventoryItem> scripts = GetInventoryItems(InventoryType.LSL);
foreach (TaskInventoryItem item in scripts)
{
foreach (IScriptModule engine in engines)
{
if (engine != null)
{
// m_log.DebugFormat(
// "[PRIM INVENTORY]: Resuming script {0} {1} for {2}, OwnerChanged {3}",
// item.Name, item.ItemID, item.OwnerID, item.OwnerChanged);
engine.ResumeScript(item.ItemID);
if (item.OwnerChanged)
engine.PostScriptEvent(item.ItemID, "changed", new Object[] { (int)Changed.OWNER });
item.OwnerChanged = false;
}
}
}
}
}
}
| 38.029981 | 180 | 0.534671 | [
"BSD-3-Clause"
] | UbitUmarov/OpenSim | OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 60,886 | C# |
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
//using System.ServiceModel.Channels;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
//using Microsoft.AspNetCore.Http.Internal;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
//using Microsoft.Extensions.Configuration;
using TeduCoreApp.Data.Entities;
using TeduCoreApp.Services;
//using TeduCoreApp.Extensions;
using Microsoft.Extensions.FileProviders;
using TeduCoreApp.Models.FileViewModels;
using TeduCoreApp.Data.EF;
using Microsoft.EntityFrameworkCore;
using System.Net.Http.Headers;
using Syncfusion.MVC.EJ;
//using Syncfusion.JavaScript;
namespace TeduCoreApp.Controllers
{
public class FilesController : Controller
{
private readonly IFileProvider fileProvider;
private readonly IHostingEnvironment _hostingEnvironment;
private readonly AppDbContext _context;
private readonly IFunctional _functionalService;
private readonly UserManager<AppUser> _userManager;
public FilesController(IFileProvider fileProvider, IHostingEnvironment hostingEnvironment, AppDbContext context, IFunctional functionalService, UserManager<AppUser> userManager)
{
_hostingEnvironment = hostingEnvironment;
_context = context;
_functionalService = functionalService;
_userManager = userManager;
this.fileProvider = fileProvider;
}
public IActionResult UploadFiles(IList<IFormFile> files)
{
long size = 0;
foreach (var file in files)
{
var filename = ContentDispositionHeaderValue
.Parse(file.ContentDisposition)
.FileName
.Trim('"');
filename = _hostingEnvironment.WebRootPath + $@"\uploaded\" + $@"\{ filename}
";
size += file.Length;
using (FileStream fs = System.IO.File.Create(filename))
{
file.CopyTo(fs);
fs.Flush();
}
}
return Content("");
}
public IActionResult Index()
{
return View();
}
[HttpPost]
[RequestSizeLimit(5000000)]
public async Task<IActionResult> PostUploadProfilePictures(List<IFormFile> files)
{
try
{
var IdCurent = User.FindFirst("UserId").Value.ToString();
var appUser = await _context.AppUsers.Where(x => x.Id.ToString() == IdCurent).SingleOrDefaultAsync();
var folderUpload = "uploaded";
var fileName = await _functionalService.UploadFiles(files, _hostingEnvironment, folderUpload, IdCurent);
if (appUser != null)
{
appUser.Avatar = "/" + folderUpload + "/" + fileName;
_context.AppUsers.Update(appUser);
await _context.SaveChangesAsync();
}
return Ok(fileName);
}
catch (Exception ex)
{
return StatusCode(500, new { message = ex.Message });
}
}
[HttpPost]
[RequestSizeLimit(5000000)]
public async Task<IActionResult> PostUploadProfilePicture(IFormFile file)
{
try
{
var IdCurent = User.FindFirst("UserId").Value.ToString();
var appUser = await _context.AppUsers.Where(x => x.Id.ToString() == IdCurent).SingleOrDefaultAsync();
var folderUpload = "uploaded";
var fileName = await _functionalService.UploadFile(file, _hostingEnvironment, folderUpload, IdCurent);
var webRoot = _hostingEnvironment.ContentRootPath;
if (appUser != null)
{
appUser.Avatar = "/" + folderUpload + "/" + fileName;
_context.AppUsers.Update(appUser);
await _context.SaveChangesAsync();
}
return Ok(fileName);
}
catch (Exception ex)
{
return StatusCode(500, new { message = ex.Message });
}
}
[HttpPost]
public async Task<IActionResult> UploadFile(IFormFile file)
{
if (file == null || file.Length == 0)
return Content("file not selected");
var path = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot/uploaded", file.GetFilename());
using (var stream = new FileStream(path, FileMode.Create))
{
await file.CopyToAsync(stream);
}
return Ok("Files");
}
[HttpPost]
public async Task<IActionResult> UploadFiles(List<IFormFile> files)
{
if (files == null || files.Count == 0)
return Content("files not selected");
foreach (var file in files)
{
var path = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot/uploaded", file.GetFilename());
using (var stream = new FileStream(path, FileMode.Create))
{
await file.CopyToAsync(stream);
}
}
return Ok("Files");
}
[HttpPost]
public async Task<IActionResult> UploadFileViaModel(FileInputModel model)
{
if (model == null ||
model.FileToUpload == null || model.FileToUpload.Length == 0)
return Content("file not selected");
var path = Path.Combine(
Directory.GetCurrentDirectory(), "wwwroot/uploaded/Client",
model.FileToUpload.GetFilename());
using (var stream = new FileStream(path, FileMode.Create))
{
await model.FileToUpload.CopyToAsync(stream);
}
return RedirectToAction("Files");
}
public IActionResult Files()
{
var model = new FilesViewModel();
foreach (var item in this.fileProvider.GetDirectoryContents(""))
{
model.Files.Add(
new FileDetails { Name = item.Name, Path = item.PhysicalPath });
}
return View(model);
}
public async Task<IActionResult> Download(string filename)
{
if (filename == null)
return Content("filename not present");
var path = Path.Combine(
Directory.GetCurrentDirectory(),
"wwwroot/files", filename);
var memory = new MemoryStream();
using (var stream = new FileStream(path, FileMode.Open))
{
await stream.CopyToAsync(memory);
}
memory.Position = 0;
return File(memory, GetContentType(path), Path.GetFileName(path));
}
private string GetContentType(string path)
{
var types = GetMimeTypes();
var ext = Path.GetExtension(path).ToLowerInvariant();
return types[ext];
}
private Dictionary<string, string> GetMimeTypes()
{
return new Dictionary<string, string>
{
{".txt", "text/plain"},
{".pdf", "application/pdf"},
{".doc", "application/vnd.ms-word"},
{".docx", "application/vnd.ms-word"},
{".xls", "application/vnd.ms-excel"},
{".xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},
{".png", "image/png"},
{".jpg", "image/jpeg"},
{".jpeg", "image/jpeg"},
{".gif", "image/gif"},
{".csv", "text/csv"}
};
}
}
} | 34.636752 | 185 | 0.544109 | [
"MIT"
] | https-github-com-duytan2309-AppCoreWeb/AppCoreWeb | TeduCoreApp/Controllers/FilesController.cs | 8,107 | C# |
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using DotNetNuke.Common.Utilities;
using DotNetNuke.ComponentModel;
using DotNetNuke.Data;
using DotNetNuke.Entities.Host;
using DotNetNuke.Entities.Users;
using DotNetNuke.Services.FileSystem.Internal;
namespace DotNetNuke.Services.FileSystem
{
public class FolderMappingController : ComponentBase<IFolderMappingController, FolderMappingController>, IFolderMappingController
{
#region Constructor
internal FolderMappingController()
{
}
#endregion
#region Private Variables
private static readonly DataProvider dataProvider = DataProvider.Instance();
private const string CacheKeyPrefix = "GetFolderMappingSettings";
#endregion
#region Public Methods
public FolderMappingInfo GetDefaultFolderMapping(int portalId)
{
var defaultFolderMapping = Config.GetSection("dotnetnuke/folder") != null ?
this.GetFolderMappings(portalId).Find(fm => fm.FolderProviderType == Config.GetDefaultProvider("folder").Name) :
this.GetFolderMapping(portalId, "Standard");
return defaultFolderMapping ?? this.GetFolderMapping(portalId, "Standard");
}
public int AddFolderMapping(FolderMappingInfo objFolderMapping)
{
objFolderMapping.FolderMappingID = dataProvider.AddFolderMapping(objFolderMapping.PortalID,
objFolderMapping.MappingName,
objFolderMapping.FolderProviderType,
UserController.Instance.GetCurrentUserInfo().UserID);
UpdateFolderMappingSettings(objFolderMapping);
ClearFolderMappingCache(objFolderMapping.PortalID);
return objFolderMapping.FolderMappingID;
}
public void DeleteFolderMapping(int portalID, int folderMappingID)
{
var folderManager = FolderManager.Instance;
var folders = folderManager.GetFolders(portalID);
var folderMappingFolders = folders.Where(f => f.FolderMappingID == folderMappingID);
if (folderMappingFolders.Count() > 0)
{
// Delete files in folders with the provided mapping (only in the database)
foreach (var file in folderMappingFolders.Select<IFolderInfo, IEnumerable<IFileInfo>>(folderManager.GetFiles).SelectMany(files => files))
{
dataProvider.DeleteFile(portalID, file.FileName, file.FolderId);
}
// Remove the folders with the provided mapping that doesn't have child folders with other mapping (only in the database and filesystem)
var folders1 = folders; // copy the variable to not access a modified closure
var removableFolders = folders.Where(f => f.FolderMappingID == folderMappingID && !folders1.Any(f2 => f2.FolderID != f.FolderID &&
f2.FolderPath.StartsWith(f.FolderPath) && f2.FolderMappingID != folderMappingID));
if (removableFolders.Count() > 0)
{
foreach (var removableFolder in removableFolders.OrderByDescending(rf => rf.FolderPath))
{
DirectoryWrapper.Instance.Delete(removableFolder.PhysicalPath, false);
dataProvider.DeleteFolder(portalID, removableFolder.FolderPath);
}
}
// Update the rest of folders with the provided mapping to use the standard mapping
folders = folderManager.GetFolders(portalID, false); // re-fetch the folders
folderMappingFolders = folders.Where(f => f.FolderMappingID == folderMappingID);
if (folderMappingFolders.Count() > 0)
{
var defaultFolderMapping = this.GetDefaultFolderMapping(portalID);
foreach (var folderMappingFolder in folderMappingFolders)
{
folderMappingFolder.FolderMappingID = defaultFolderMapping.FolderMappingID;
folderManager.UpdateFolder(folderMappingFolder);
}
}
}
dataProvider.DeleteFolderMapping(folderMappingID);
ClearFolderMappingCache(portalID);
ClearFolderMappingSettingsCache(folderMappingID);
}
public void UpdateFolderMapping(FolderMappingInfo objFolderMapping)
{
dataProvider.UpdateFolderMapping(objFolderMapping.FolderMappingID,
objFolderMapping.MappingName,
objFolderMapping.Priority,
UserController.Instance.GetCurrentUserInfo().UserID);
ClearFolderMappingCache(objFolderMapping.PortalID);
UpdateFolderMappingSettings(objFolderMapping);
}
public FolderMappingInfo GetFolderMapping(int folderMappingID)
{
return CBO.FillObject<FolderMappingInfo>(dataProvider.GetFolderMapping(folderMappingID));
}
public FolderMappingInfo GetFolderMapping(int portalId, int folderMappingID)
{
return this.GetFolderMappings(portalId).SingleOrDefault(fm => fm.FolderMappingID == folderMappingID);
}
public FolderMappingInfo GetFolderMapping(int portalId, string mappingName)
{
return this.GetFolderMappings(portalId).SingleOrDefault(fm => fm.MappingName == mappingName);
}
public List<FolderMappingInfo> GetFolderMappings(int portalId)
{
var cacheKey = String.Format(DataCache.FolderMappingCacheKey, portalId);
return CBO.GetCachedObject<List<FolderMappingInfo>>(new CacheItemArgs(cacheKey,
DataCache.FolderMappingCacheTimeOut,
DataCache.FolderMappingCachePriority),
(c) => CBO.FillCollection<FolderMappingInfo>(dataProvider.GetFolderMappings(portalId)));
}
public void AddDefaultFolderTypes(int portalID)
{
dataProvider.AddDefaultFolderTypes(portalID);
}
public Hashtable GetFolderMappingSettings(int folderMappingID)
{
var strCacheKey = CacheKeyPrefix + folderMappingID;
var objSettings = (Hashtable)DataCache.GetCache(strCacheKey);
if (objSettings == null)
{
objSettings = new Hashtable();
IDataReader dr = null;
try
{
dr = dataProvider.GetFolderMappingSettings(folderMappingID);
while (dr.Read())
{
if (!dr.IsDBNull(1))
{
objSettings[dr.GetString(0)] = dr.GetString(1);
}
else
{
objSettings[dr.GetString(0)] = string.Empty;
}
}
}
catch (Exception ex)
{
Exceptions.Exceptions.LogException(ex);
}
finally
{
CBO.CloseDataReader(dr, true);
}
var intCacheTimeout = 20 * Convert.ToInt32(Host.PerformanceSetting);
DataCache.SetCache(strCacheKey, objSettings, TimeSpan.FromMinutes(intCacheTimeout));
}
return objSettings;
}
#endregion
#region Private Methods
private static void UpdateFolderMappingSettings(FolderMappingInfo objFolderMapping)
{
foreach (string sKey in objFolderMapping.FolderMappingSettings.Keys)
{
UpdateFolderMappingSetting(objFolderMapping.FolderMappingID, sKey, Convert.ToString(objFolderMapping.FolderMappingSettings[sKey]));
}
ClearFolderMappingSettingsCache(objFolderMapping.FolderMappingID);
}
private static void UpdateFolderMappingSetting(int folderMappingID, string settingName, string settingValue)
{
IDataReader dr = null;
try
{
dr = dataProvider.GetFolderMappingSetting(folderMappingID, settingName);
if (dr.Read())
{
dataProvider.UpdateFolderMappingSetting(folderMappingID, settingName, settingValue, UserController.Instance.GetCurrentUserInfo().UserID);
}
else
{
dataProvider.AddFolderMappingSetting(folderMappingID, settingName, settingValue, UserController.Instance.GetCurrentUserInfo().UserID);
}
}
catch (Exception ex)
{
Exceptions.Exceptions.LogException(ex);
}
finally
{
// Ensure DataReader is closed
CBO.CloseDataReader(dr, true);
}
}
private static void ClearFolderMappingCache(int portalId)
{
var cacheKey = String.Format(DataCache.FolderMappingCacheKey, portalId);
DataCache.RemoveCache(cacheKey);
}
private static void ClearFolderMappingSettingsCache(int folderMappingID)
{
DataCache.RemoveCache(CacheKeyPrefix + folderMappingID);
}
#endregion
}
}
| 41.703704 | 157 | 0.58585 | [
"MIT"
] | MaiklT/Dnn.Platform | DNN Platform/Library/Services/FileSystem/FolderMappings/FolderMappingController.cs | 10,136 | C# |
using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle("XPusher")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("yauhe")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion("1.0.*")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]
| 34.892857 | 81 | 0.743091 | [
"Apache-2.0"
] | wcoder/XPusher | XPusher/XPusher/Properties/AssemblyInfo.cs | 979 | C# |
using LyncUCWA.Service;
using LyncUCWA.Properties;
using System;
using System.Net.Http;
public class LyncHttpClient : HttpClient
{
public static bool IsLoggedIn { get; set; }
/// <summary>
/// Build a new Lync UCWA request object.
/// </summary>
/// <param name="url">URI of the resource</param>
/// <remarks>
/// Using the inbuilt class would possibly lead to confusion later as the code expands.
/// Therefore, it was decided that a "dedicated" class would handle the requests for this application.
/// </remarks>
public LyncHttpClient()
{
this.BaseAddress = new Uri(Settings.Default.DomainAddress);
if (!Settings.Default.OAuthToken.IsEmpty())
{
this.DefaultRequestHeaders.Add("Authorization", Settings.Default.OAuthToken.StartsWith("Bearer") ?
Settings.Default.OAuthToken : String.Concat("Bearer ", Settings.Default.OAuthToken));
}
}
} | 35.148148 | 110 | 0.665964 | [
"MIT"
] | rencoder/LyncUCWA | LyncUCWA/LyncHttpClient.cs | 951 | C# |
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// 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("Canvas_ObsCollection_Project")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Canvas_ObsCollection_Project")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| 43.071429 | 98 | 0.711028 | [
"Unlicense"
] | luciochen233/CSE483-code | repo/Canvas_ObsCollection_Project/Properties/AssemblyInfo.cs | 2,415 | C# |
using Actio.Common.Events;
using Actio.Common.Services;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
namespace Actio.Api
{
public class Program
{
public static void Main(string[] args)
{
ServiceHost.Create<Startup>(args)
.UseRabbitMq()
.SubscribeToEvent<ActivityCreated>()
.Build()
.Run();
}
}
}
| 21.8 | 52 | 0.575688 | [
"MIT"
] | msadeqsirjani/Actio | src/Actio.Api/Program.cs | 436 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.AspNetCore.Authorization;
using littlebreadloaf.Data;
namespace littlebreadloaf.Pages.Products
{
[Authorize]
public class ProductDeleteModel : PageModel
{
private readonly ProductContext _context;
public ProductDeleteModel(ProductContext context)
{
_context = context;
}
[BindProperty]
public Product Product { get; set; }
public IActionResult OnGet(string ProductID)
{
return new RedirectResult("/Products/ProductList");
//We don't want to delete products so we can preserve older orders
//if (String.IsNullOrEmpty(ProductID) || !Guid.TryParse(ProductID, out Guid parsedID))
//{
// return new RedirectResult("/Products/ProductList");
//}
//Product = _context.Product.FirstOrDefault(m => m.ProductID == parsedID);
//if (Product == null)
//{
// return new RedirectResult("/Products/ProductList");
//}
//return Page();
}
public async Task<IActionResult> OnPost()
{
return new RedirectResult("/Products/ProductList");
//We don't want to delete products so we can preserve older orders
//if(Product == null || Product.ProductID == null)
//{
// return new RedirectResult("/Products/ProductList");
//}
//Product = _context.Product.FirstOrDefault(m => m.ProductID == Product.ProductID);
//if (Product != null)
//{
// var imgHel = new ImageHelper(Product.ProductID.ToString());
// imgHel.DeleteAll();
// _context.RemoveRange(_context.ProductBadge.Where(b => b.ProductID == Product.ProductID));
// _context.RemoveRange(_context.ProductIngredient.Where(b => b.ProductID == Product.ProductID));
// _context.RemoveRange(_context.ProductSuggestion.Where(b => b.ProductID == Product.ProductID));
// _context.RemoveRange(_context.ProductImage.Where(b => b.ProductID == Product.ProductID));
// _context.Remove(Product);
// await _context.SaveChangesAsync();
//}
//return new RedirectResult("/Products/ProductList");
}
}
} | 34.283784 | 112 | 0.59598 | [
"MIT"
] | ZombieFleshEaters/LittleBreadLoaf | littlebreadloaf/Pages/Products/ProductDelete.cshtml.cs | 2,537 | C# |
using Microsoft.EntityFrameworkCore;
using MultiTenant.Data.Abstract;
using MultiTenant.Model.Master;
namespace MultiTenant.Data.Configuration.Master;
public class ClienteConfiguration : ConfigBase<Cliente>
{
protected override void ConfigureFK()
{
}
protected override void ConfigurePK()
{
builder.HasKey(pk => pk.Id);
}
protected override void ConfigureFieldsTable()
{
builder.Property(p => p.Id)
.HasColumnName("id")
.ValueGeneratedOnAdd()
.IsRequired();
builder.Property(p => p.Nome)
.HasColumnName("nome")
.HasMaxLength(155)
.IsRequired();
builder.Property(p => p.Schema)
.HasColumnName("schema")
.HasMaxLength(50)
.IsRequired();
}
protected override void ConfigureTableName()
{
builder.ToTable("tab_cliente");
}
} | 23.45 | 55 | 0.595949 | [
"MIT"
] | jeffersonmello/aspnetcore.ef.migrations.multitenant | MultiTenant/MultiTenant.Data/Configuration/Master/ClienteConfiguration.cs | 938 | C# |
using Newtonsoft.Json;
namespace Alipay.AopSdk.Core.Response
{
/// <summary>
/// AlipayOpenAppXwbtestpreCreateResponse.
/// </summary>
public class AlipayOpenAppXwbtestpreCreateResponse : AopResponse
{
/// <summary>
/// s
/// </summary>
[JsonProperty("forestuser")]
public bool Forestuser { get; set; }
/// <summary>
/// 1
/// </summary>
[JsonProperty("sd")]
public string Sd { get; set; }
/// <summary>
/// 1
/// </summary>
[JsonProperty("sdd")]
public string Sdd { get; set; }
/// <summary>
/// 1
/// </summary>
[JsonProperty("sdf")]
public string Sdf { get; set; }
/// <summary>
/// 描述
/// </summary>
[JsonProperty("sdfsdf")]
public bool Sdfsdf { get; set; }
}
} | 18.75 | 65 | 0.576 | [
"MIT"
] | ArcherTrister/LeXun.Alipay.AopSdk | src/Alipay.AopSdk.Core/Response/AlipayOpenAppXwbtestpreCreateResponse.cs | 754 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StrategyPattern
{
class Squeck : IQuackBehavior
{
public void Quack()
{
Console.WriteLine("Squeak");
}
}
}
| 16.647059 | 40 | 0.639576 | [
"Apache-2.0"
] | nandehutuzn/DesignPattern | ZnDesignPattern/StrategyPattern/Squeck.cs | 285 | 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 wafv2-2019-07-29.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.WAFV2.Model
{
/// <summary>
/// This is the response object from the ListAvailableManagedRuleGroups operation.
/// </summary>
public partial class ListAvailableManagedRuleGroupsResponse : AmazonWebServiceResponse
{
private List<ManagedRuleGroupSummary> _managedRuleGroups = new List<ManagedRuleGroupSummary>();
private string _nextMarker;
/// <summary>
/// Gets and sets the property ManagedRuleGroups.
/// </summary>
public List<ManagedRuleGroupSummary> ManagedRuleGroups
{
get { return this._managedRuleGroups; }
set { this._managedRuleGroups = value; }
}
// Check to see if ManagedRuleGroups property is set
internal bool IsSetManagedRuleGroups()
{
return this._managedRuleGroups != null && this._managedRuleGroups.Count > 0;
}
/// <summary>
/// Gets and sets the property NextMarker.
/// <para>
/// When you request a list of objects with a <code>Limit</code> setting, if the number
/// of objects that are still available for retrieval exceeds the limit, AWS WAF returns
/// a <code>NextMarker</code> value in the response. To retrieve the next batch of objects,
/// provide the marker from the prior call in your next request.
/// </para>
/// </summary>
[AWSProperty(Min=1, Max=256)]
public string NextMarker
{
get { return this._nextMarker; }
set { this._nextMarker = value; }
}
// Check to see if NextMarker property is set
internal bool IsSetNextMarker()
{
return this._nextMarker != null;
}
}
} | 35.207792 | 104 | 0.638141 | [
"Apache-2.0"
] | philasmar/aws-sdk-net | sdk/src/Services/WAFV2/Generated/Model/ListAvailableManagedRuleGroupsResponse.cs | 2,711 | C# |
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
namespace PholioVisualisation.RequestParameters
{
public class ParentAreaGroupsParameters : BaseParameters
{
public int ProfileId { get; set; }
public int TemplateProfileId { get; set; }
public ParentAreaGroupsParameters(NameValueCollection parameters)
: base(parameters)
{
ProfileId = ParseInt(ParameterNames.ProfileId);
TemplateProfileId = ParseInt(ParameterNames.TemplateProfileId);
}
public override bool AreValid
{
get
{
return ProfileId > 0;
}
}
public int GetNonSearchProfileId()
{
return ParameterHelper.GetNonSearchProfileId(ProfileId, TemplateProfileId);
}
}
}
| 25.714286 | 87 | 0.632222 | [
"MIT"
] | PublicHealthEngland/fingertips-open | PholioVisualisationWS/RequestParameters/ParentAreaGroupsParameters.cs | 902 | C# |
using LiveScoreUpdateSystem.Data.SaveContext.Contracts;
using LiveScoreUpdateSystem.Web.Infrastructure.Providers;
using System.Web.Mvc;
namespace LiveScoreUpdateSystem.Web.Infrastructure.Attributes
{
public class SaveChangesAttribute : ActionFilterAttribute
{
}
} | 30.666667 | 61 | 0.826087 | [
"MIT"
] | papiReta/livescore | LiveScoreUpdateSystem/LiveScoreUpdateSystem.Web/Infrastructure/Attributes/SaveChangesAttribute.cs | 278 | C# |
using System.Linq;
public static class IsbnVerifier {
public static bool IsValid(string number) {
number = number.Replace("-", "");
if (number.Length != 10) {
return false;
}
var chars = number.ToCharArray();
if (!chars.Take(9).All(c => char.IsDigit(c))) {
return false;
}
if (!char.IsDigit(chars[9]) && chars[9] != 'X') {
return false;
}
var digits = chars.Select(c => c == 'X' ? 10 : (int)char.GetNumericValue(c)).ToArray();
return (digits[0] * 10
+ digits[1] * 9
+ digits[2] * 8
+ digits[3] * 7
+ digits[4] * 6
+ digits[5] * 5
+ digits[6] * 4
+ digits[7] * 3
+ digits[8] * 2
+ digits[9] * 1) % 11 == 0;
}
} | 28.451613 | 95 | 0.420635 | [
"MIT"
] | Sankra/ExercismSolutions | csharp/isbn-verifier/IsbnVerifier.cs | 884 | C# |
#pragma warning disable 108 // new keyword hiding
#pragma warning disable 114 // new keyword hiding
namespace Windows.UI.Xaml.Controls
{
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
public enum CommandBarLabelPosition
{
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
Default = 0,
#endif
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
Collapsed = 1,
#endif
}
#endif
}
| 31.882353 | 99 | 0.714022 | [
"Apache-2.0"
] | Robert-Louis/Uno | src/Uno.UI/Generated/3.0.0.0/Windows.UI.Xaml.Controls/CommandBarLabelPosition.cs | 542 | C# |
using EntscheidungsbaumLernen.Controller;
using EntscheidungsbaumLernen.Interfaces;
using System;
namespace EntscheidungsbaumLernen.Factorys
{
#region CLASS WissensspeicherFactory ...................................................................................
/// <summary>
/// Factory zum Erzeugen der Klasse des Wissensspeichers
/// </summary>
/// <remarks>
/// <br /><b>Versionen:</b><br />
/// V1.0 06.06.2021 - Paz-Paz - erstellt<br />
/// </remarks>
internal class WissensspeicherFactory
{
#region Eigenschaften ..................................................................................................
/// <summary>
/// Wissensspeicher an sich.
/// </summary>
private IWissensspeicher _response = null;
#endregion .............................................................................................................
#region Oeffentliche Methoden ..........................................................................................
/// <summary>
/// Erzeugt ein <see cref="IWissensspeicher"/>-Objekt aus den zuvor gemachten Einstellungen und gibt es zurück.
/// </summary>
/// <returns>Erzeugtes Objekt</returns>
internal IWissensspeicher Build()
{
if (this._response == null)
{
return new WissensspeicherRam(); ;
}
return this._response;
}
/// <summary>
/// Entfernt alle bisher hinterlegten Wissensspeicher.
/// </summary>
/// <remarks>
/// Falls keiner mehr hinzugefügt wird, wir der "RAM" als Default trotzdem verwendet.
/// </remarks>
/// <returns>Die Factory um weitere Einstellungen vornehmen zu können.</returns>
internal WissensspeicherFactory Clear()
{
this._response = null;
return this;
}
/// <summary>
/// Fügt einen Speicher hinzu, welcher die Daten (nur) im RAM ablegt und nirgends persistent speichert.
/// </summary>
/// <returns>Die Factory um weitere Einstellungen vornehmen zu können.</returns>
internal WissensspeicherFactory AddRamSpeicher()
{
this.AddSpeicher(new WissensspeicherRam());
return this;
}
/// <summary>
/// Fügt einen Speicher hinzu, welcher aus Datein lesen und in sie schreiben kann.
/// </summary>
/// <param name="pfad">Pfad zur Datei. Falls die Datei nicht existiert wird versucht sie beim ersten Schreiben anzulegen.</param>
/// <param name="speichereLeserlich">Wenn true wird die gespeicherte JSON-Datei 'schön' gespeichert, bei false wird sie minimiert gespeichert.</param>
/// <returns>Die Factory um weitere Einstellungen vornehmen zu können.</returns>
/// <exception cref="NotImplementedException">Datei-Speicher wurde noch (nicht fertig) implementiert.</exception>
internal WissensspeicherFactory AddDateiSpeicher<TResult>(in string pfad, in bool speichereLeserlich = false) where TResult : Enum
{
this.AddSpeicher(new WissensspeicherDatei<TResult>(pfad, speichereLeserlich));
return this;
}
#endregion .............................................................................................................
#region Paket-Interne Methoden .........................................................................................
/// <summary>
/// Fügt einen beliebigen, auch extern erzeugen, Wissensspeicher hinzu.
/// </summary>
/// <remarks>
/// Vorbereitet um in Zukunft das externe Erstellen von Wissensspeichern per <see cref="IWissensspeicher"/> zu ermöglichen.
/// </remarks>
/// <param name="wissensspeicher">Hinzuzufügender Wissensspeicher.</param>
/// <returns>Die Factory um weitere Einstellungen vornehmen zu können.</returns>
internal WissensspeicherFactory AddEigenenSpeicher(in IWissensspeicher wissensspeicher)
{
this.AddSpeicher(wissensspeicher);
return this;
}
#endregion .............................................................................................................
#region Private Methoden ...............................................................................................
/// <summary>
/// Fügt den übergebenen Wissensspeicher hinzu.
/// </summary>
/// <param name="wissensspeicher"></param>
private void AddSpeicher(IWissensspeicher wissensspeicher)
{
if (this._response == null)
{
this._response = wissensspeicher;
}
else
{
IWissensspeicher letzter = this._response;
while (letzter.Next != null)
{
letzter = letzter.Next;
}
letzter.SetNaechsteInstanz(wissensspeicher);
}
}
#endregion .............................................................................................................
}
#endregion .............................................................................................................
}
| 39.717742 | 154 | 0.531777 | [
"MIT"
] | Paz-Paz/DecisionTree | EntscheidungsbaumLernen/Factorys/WissensspeicherFactory.cs | 4,941 | C# |
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text;
namespace NETCore.DapperKit.ExpressionVisitor.Query.Interface
{
public interface IDeleteQueryAble<T> : ISqlQueryAble<T> where T : class
{
}
}
| 19.538462 | 75 | 0.76378 | [
"MIT"
] | myloveCc/NETCore.DapperKit | src/NETCore.DapperKit/ExpressionVisitor/Query/Interface/IDeleteQueryAble.cs | 254 | 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.Postgres.V20170312.Models
{
using Newtonsoft.Json;
using System.Collections.Generic;
using TencentCloud.Common;
public class DBInstanceNetInfo : AbstractModel
{
/// <summary>
/// DNS域名
/// </summary>
[JsonProperty("Address")]
public string Address{ get; set; }
/// <summary>
/// IP地址
/// </summary>
[JsonProperty("Ip")]
public string Ip{ get; set; }
/// <summary>
/// 连接Port地址
/// </summary>
[JsonProperty("Port")]
public ulong? Port{ get; set; }
/// <summary>
/// 网络类型,1、inner(基础网络内网地址);2、private(私有网络内网地址);3、public(基础网络或私有网络的外网地址);
/// </summary>
[JsonProperty("NetType")]
public string NetType{ get; set; }
/// <summary>
/// 网络连接状态
/// </summary>
[JsonProperty("Status")]
public string Status{ get; set; }
/// <summary>
/// For internal usage only. DO NOT USE IT.
/// </summary>
internal override void ToMap(Dictionary<string, string> map, string prefix)
{
this.SetParamSimple(map, prefix + "Address", this.Address);
this.SetParamSimple(map, prefix + "Ip", this.Ip);
this.SetParamSimple(map, prefix + "Port", this.Port);
this.SetParamSimple(map, prefix + "NetType", this.NetType);
this.SetParamSimple(map, prefix + "Status", this.Status);
}
}
}
| 30.125 | 83 | 0.596127 | [
"Apache-2.0"
] | ImEdisonJiang/tencentcloud-sdk-dotnet | TencentCloud/Postgres/V20170312/Models/DBInstanceNetInfo.cs | 2,291 | C# |
namespace HaRepacker.GUI
{
partial class FirstRunForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FirstRunForm));
this.button1 = new System.Windows.Forms.Button();
this.autoAssociateBox = new System.Windows.Forms.CheckBox();
this.SuspendLayout();
//
// button1
//
resources.ApplyResources(this.button1, "button1");
this.button1.Name = "button1";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// autoAssociateBox
//
resources.ApplyResources(this.autoAssociateBox, "autoAssociateBox");
this.autoAssociateBox.Checked = true;
this.autoAssociateBox.CheckState = System.Windows.Forms.CheckState.Checked;
this.autoAssociateBox.Name = "autoAssociateBox";
this.autoAssociateBox.UseVisualStyleBackColor = true;
//
// FirstRunForm
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.autoAssociateBox);
this.Controls.Add(this.button1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FirstRunForm";
this.ShowInTaskbar = false;
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FirstRunForm_FormClosing);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button button1;
private System.Windows.Forms.CheckBox autoAssociateBox;
}
} | 38.657534 | 144 | 0.598157 | [
"MPL-2.0",
"MPL-2.0-no-copyleft-exception"
] | 369MJ/Harepacker-resurrected | HaRepacker/GUI/FirstRunForm.Designer.cs | 2,824 | C# |
// ------------------------------------------------------------------------------
// <auto-generated>
// Generated by Xsd2Code. Version 3.4.0.18239 Microsoft Reciprocal License (Ms-RL)
// <NameSpace>Dms.Ambulance.V2100</NameSpace><Collection>Array</Collection><codeType>CSharp</codeType><EnableDataBinding>False</EnableDataBinding><EnableLazyLoading>False</EnableLazyLoading><TrackingChangesEnable>False</TrackingChangesEnable><GenTrackingClasses>False</GenTrackingClasses><HidePrivateFieldInIDE>False</HidePrivateFieldInIDE><EnableSummaryComment>True</EnableSummaryComment><VirtualProp>False</VirtualProp><IncludeSerializeMethod>True</IncludeSerializeMethod><UseBaseClass>False</UseBaseClass><GenBaseClass>False</GenBaseClass><GenerateCloneMethod>True</GenerateCloneMethod><GenerateDataContracts>False</GenerateDataContracts><CodeBaseTag>Net35</CodeBaseTag><SerializeMethodName>Serialize</SerializeMethodName><DeserializeMethodName>Deserialize</DeserializeMethodName><SaveToFileMethodName>SaveToFile</SaveToFileMethodName><LoadFromFileMethodName>LoadFromFile</LoadFromFileMethodName><GenerateXMLAttributes>True</GenerateXMLAttributes><OrderXMLAttrib>False</OrderXMLAttrib><EnableEncoding>False</EnableEncoding><AutomaticProperties>False</AutomaticProperties><GenerateShouldSerialize>False</GenerateShouldSerialize><DisableDebug>False</DisableDebug><PropNameSpecified>Default</PropNameSpecified><Encoder>UTF8</Encoder><CustomUsings></CustomUsings><ExcludeIncludedTypes>True</ExcludeIncludedTypes><EnableInitializeFields>False</EnableInitializeFields>
// </auto-generated>
// ------------------------------------------------------------------------------
namespace Dms.Ambulance.V2100 {
using System;
using System.Diagnostics;
using System.Xml.Serialization;
using System.Collections;
using System.Xml.Schema;
using System.ComponentModel;
using System.IO;
using System.Text;
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.18239")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:hl7-org:v3")]
[System.Xml.Serialization.XmlRootAttribute(Namespace="urn:hl7-org:v3", IsNullable=false)]
public enum ProcessingMode_code {
/// <remarks/>
A,
/// <remarks/>
I,
/// <remarks/>
R,
/// <remarks/>
T,
}
}
| 65.675676 | 1,368 | 0.721811 | [
"MIT"
] | Kusnaditjung/MimDms | src/Dms.Ambulance.V2100/Generated/ProcessingMode_code.cs | 2,430 | 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("6th")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("6th")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("2a996c72-0992-410e-8f2f-12d24a98e01b")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| 37.756757 | 84 | 0.745168 | [
"MIT"
] | nikoivo/programming-basics | exam-real-18th/6th/Properties/AssemblyInfo.cs | 1,400 | C# |
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;
namespace gitapp2.Pages
{
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public class ErrorModel : PageModel
{
public string RequestId { get; set; }
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
private readonly ILogger<ErrorModel> _logger;
public ErrorModel(ILogger<ErrorModel> logger)
{
_logger = logger;
}
public void OnGet()
{
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
}
}
}
| 25.25 | 88 | 0.680693 | [
"MIT"
] | asalavessa/gitapp2 | gitapp2/Pages/Error.cshtml.cs | 808 | C# |
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace Ex_03_CountWords
{
class StartUp
{
static void Main(string[] args)
{
ReadFile();
}
private static void ReadFile()
{
var words = new List<string>();
words.AddRange(File.ReadAllLines("../../../words.txt"));
CountWordsInText(words);
}
private static void CountWordsInText(List<string> words)
{
var text = File.ReadAllText("../../../text.txt")
.Split(new char[] { '-', ',', '.', '!', '?', ' ' }, StringSplitOptions.RemoveEmptyEntries);
var dictionary = new Dictionary<string, int>();
foreach(var word in text)
{
if(words.Contains(word.ToLower()) && dictionary.ContainsKey(word.ToLower()))
{
dictionary[word.ToLower()]++;
}
else if (words.Contains(word.ToLower()) && !dictionary.ContainsKey(word.ToLower()))
{
dictionary.Add(word.ToLower(), 1);
}
}
PrintFile(dictionary);
}
private static void PrintFile(Dictionary<string, int> dictionary)
{
foreach(var word in dictionary)
{
File.AppendAllText("../../../actualResults.txt", $"{word.Key} - {word.Value}{Environment.NewLine}");
}
foreach (var word in dictionary.OrderByDescending(w=>w.Value))
{
File.AppendAllText("../../../expectedResults.txt", $"{word.Key} - {word.Value}{Environment.NewLine}");
}
}
}
}
| 29.610169 | 118 | 0.499714 | [
"MIT"
] | Brankovanov/SoftUniCourses | 3.CSharpAdvanced/C#Advanced2020/StreamsFilesDirectoriesExcersises/Ex_03_CountWords/StartUp.cs | 1,749 | C# |
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------
using System.Collections.Generic;
using System.Management.Automation;
using System.Security.Permissions;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using Microsoft.WindowsAzure.Commands.Utilities.Properties;
using Microsoft.WindowsAzure.Commands.Utilities.Store;
namespace Microsoft.WindowsAzure.Commands.Store
{
/// <summary>
/// Removes all purchased Add-Ons or specific Add-On
/// </summary>
[Cmdlet(VerbsCommon.Remove, "AzureStoreAddOn"), OutputType(typeof(List<PSObject>))]
public class RemoveAzureStoreAddOnCommand : ServiceManagementBaseCmdlet
{
public StoreClient StoreClient { get; set; }
public PowerShellCustomConfirmation CustomConfirmation;
[Parameter(Position = 0, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Add-On name")]
public string Name { get; set; }
[Parameter(Position = 1, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Get result of the cmdlet")]
public SwitchParameter PassThru { get; set; }
[PermissionSet(SecurityAction.Demand, Name = "FullTrust")]
public override void ExecuteCmdlet()
{
StoreClient = StoreClient ?? new StoreClient(CurrentContext.Subscription);
CustomConfirmation = CustomConfirmation ?? new PowerShellCustomConfirmation(Host);
string message = StoreClient.GetConfirmationMessage(OperationType.Remove);
bool remove = CustomConfirmation.ShouldProcess(Resources.RemoveAddOnConformation, message);
if (remove)
{
StoreClient.RemoveAddOn(Name);
WriteVerbose(string.Format(Resources.AddOnRemovedMessage, Name));
if (PassThru.IsPresent)
{
WriteObject(true);
}
}
}
}
} | 45.542373 | 135 | 0.640119 | [
"MIT"
] | DeepakRajendranMsft/azure-sdk-tools | src/ServiceManagement/Services/Commands/Store/RemoveAzureStoreAddOn.cs | 2,631 | C# |
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
namespace Essensoft.AspNetCore.Payment.Alipay.Domain
{
/// <summary>
/// AlipayUserLogonidMaskedQueryModel Data Structure.
/// </summary>
[Serializable]
public class AlipayUserLogonidMaskedQueryModel : AlipayObject
{
/// <summary>
/// 蚂蚁统一会员ID,不可为空,一次最多传10个
/// </summary>
[JsonProperty("user_id_list")]
public List<string> UserIdList { get; set; }
}
}
| 24.7 | 65 | 0.65587 | [
"MIT"
] | gebiWangshushu/payment | src/Essensoft.AspNetCore.Payment.Alipay/Domain/AlipayUserLogonidMaskedQueryModel.cs | 532 | C# |
using System.ComponentModel.DataAnnotations;
namespace ByYsmn.Web.UI.Models
{
public class LoginViewModel
{
[Required]
[EmailAddress]
[Display(Name = "Kullanıcı Adı")]
public string Username { get; set; }
[Required]
[DataType(DataType.Password)]
[Display(Name = "Parola")]
[StringLength(20, ErrorMessage = "Lutfen {0} en az {2} karakter olmali en uzun {1} karakter olmali", MinimumLength = 6)]
public string Password { get; set; }
}
}
| 28.944444 | 128 | 0.618042 | [
"MIT"
] | asafgunay/ByYsmn | src/ByYsmn.Web.UI/Models/LoginViewModel.cs | 526 | 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.AzureNextGen.Search.V20191001Preview.Outputs
{
[OutputType]
public sealed class PrivateEndpointConnectionPropertiesResponsePrivateLinkServiceConnectionState
{
/// <summary>
/// A description of any extra actions that may be required.
/// </summary>
public readonly string? ActionsRequired;
/// <summary>
/// The description for the private link service connection state.
/// </summary>
public readonly string? Description;
/// <summary>
/// Status of the the private link service connection. Can be Pending, Approved, Rejected, or Disconnected.
/// </summary>
public readonly string? Status;
[OutputConstructor]
private PrivateEndpointConnectionPropertiesResponsePrivateLinkServiceConnectionState(
string? actionsRequired,
string? description,
string? status)
{
ActionsRequired = actionsRequired;
Description = description;
Status = status;
}
}
}
| 32.162791 | 115 | 0.661605 | [
"Apache-2.0"
] | pulumi/pulumi-azure-nextgen | sdk/dotnet/Search/V20191001Preview/Outputs/PrivateEndpointConnectionPropertiesResponsePrivateLinkServiceConnectionState.cs | 1,383 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using System.Runtime.InteropServices;
using Autodesk;
using Autodesk.Revit;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using Autodesk.Revit.ApplicationServices;
using Rhino;
using Rhino.Geometry;
using Rhino.Geometry.Collections;
namespace RhinoInside.Revit
{
public static class Convert
{
#region Enums
public static StorageType ToStorageType(this ParameterType parameterType)
{
switch (parameterType)
{
case ParameterType.Invalid:
return StorageType.None;
case ParameterType.Text:
case ParameterType.MultilineText:
return StorageType.String;
case ParameterType.YesNo:
case ParameterType.Integer:
return StorageType.Integer;
case ParameterType.Material:
case ParameterType.FamilyType:
case ParameterType.Image:
return StorageType.ElementId;
case ParameterType.Number:
default:
return StorageType.Double;
}
}
public static BuiltInParameter ToBuiltInParameter(this int value)
{
switch (value)
{
case (int) BuiltInParameter.GENERIC_THICKNESS: return BuiltInParameter.GENERIC_THICKNESS;
case (int) BuiltInParameter.GENERIC_WIDTH: return BuiltInParameter.GENERIC_WIDTH;
case (int) BuiltInParameter.GENERIC_HEIGHT: return BuiltInParameter.GENERIC_HEIGHT;
case (int) BuiltInParameter.GENERIC_DEPTH: return BuiltInParameter.GENERIC_DEPTH;
case (int) BuiltInParameter.GENERIC_FINISH: return BuiltInParameter.GENERIC_FINISH;
case (int) BuiltInParameter.GENERIC_CONSTRUCTION_TYPE: return BuiltInParameter.GENERIC_CONSTRUCTION_TYPE;
case (int) BuiltInParameter.FIRE_RATING: return BuiltInParameter.FIRE_RATING;
case (int) BuiltInParameter.ALL_MODEL_COST: return BuiltInParameter.ALL_MODEL_COST;
case (int) BuiltInParameter.ALL_MODEL_MARK: return BuiltInParameter.ALL_MODEL_MARK;
case (int) BuiltInParameter.ALL_MODEL_FAMILY_NAME: return BuiltInParameter.ALL_MODEL_FAMILY_NAME;
case (int) BuiltInParameter.ALL_MODEL_TYPE_NAME: return BuiltInParameter.ALL_MODEL_TYPE_NAME;
case (int) BuiltInParameter.ALL_MODEL_TYPE_MARK: return BuiltInParameter.ALL_MODEL_TYPE_MARK;
}
return (BuiltInParameter) value;
}
public static BuiltInParameter AsBuiltInParameter(this int value)
{
var builtInParameter = ToBuiltInParameter(value);
return Enum.IsDefined(typeof(BuiltInParameter), builtInParameter) ? builtInParameter : BuiltInParameter.INVALID;
}
#endregion
#region Math
public static int Clamp(this int v, int lo, int hi)
{
return hi < v ? hi : v < lo ? lo : v;
}
public static double Clamp(this double v, double lo, double hi)
{
return hi < v ? hi : v < lo ? lo : v;
}
#endregion
#region GraphicAttributes
public sealed class GraphicAttributes : State<GraphicAttributes>
{
public ElementId GraphicsStyleId = ElementId.InvalidElementId;
public ElementId MaterialId = ElementId.InvalidElementId;
public Rhino.Geometry.MeshingParameters MeshingParameters = null;
public double TriangulateLevelOfDetail => MeshingParameters?.RelativeTolerance ?? double.NaN;
}
#endregion
#region Scale
static internal Point3d Scale(this Point3d p, double factor)
{
return new Point3d(p.X * factor, p.Y * factor, p.Z * factor);
}
static internal Vector3d Scale(this Vector3d p, double factor)
{
return new Vector3d(p.X * factor, p.Y * factor, p.Z * factor);
}
static internal BoundingBox Scale(this BoundingBox bbox, double factor)
{
return new BoundingBox(bbox.Min.Scale(factor), bbox.Max.Scale(factor));
}
static internal Rhino.Geometry.Line Scale(this Rhino.Geometry.Line l, double factor)
{
return new Rhino.Geometry.Line(l.From.Scale(factor), l.To.Scale(factor));
}
static internal Rhino.Geometry.Plane Scale(this Rhino.Geometry.Plane p, double factor)
{
return new Rhino.Geometry.Plane(p.Origin.Scale(factor), p.XAxis, p.YAxis);
}
#endregion
#region ToRhino
static public System.Drawing.Color ToRhino(this Color c)
{
return System.Drawing.Color.FromArgb((int) c.Red, (int) c.Green, (int) c.Blue);
}
static readonly Rhino.Display.DisplayMaterial defaultMaterial = new Rhino.Display.DisplayMaterial(System.Drawing.Color.WhiteSmoke);
static internal Rhino.Display.DisplayMaterial ToRhino(this Autodesk.Revit.DB.Material material, Rhino.Display.DisplayMaterial parentMaterial)
{
return (material == null) ? parentMaterial ?? defaultMaterial :
new Rhino.Display.DisplayMaterial()
{
Diffuse = material.Color.ToRhino(),
Transparency = material.Transparency / 100.0,
Shine = material.Shininess / 128.0
};
}
static public Point3d ToRhino(this XYZ p)
{
return new Point3d(p.X, p.Y, p.Z);
}
static IEnumerable<Point3d> ToRhino(this IEnumerable<XYZ> points)
{
foreach (var p in points)
yield return p.ToRhino();
}
static public Rhino.Geometry.BoundingBox ToRhino(this BoundingBoxXYZ bbox)
{
if (bbox?.Enabled ?? false)
{
var box = new Rhino.Geometry.BoundingBox(bbox.Min.ToRhino(), bbox.Max.ToRhino());
return bbox.Transform.ToRhino().TransformBoundingBox(box);
}
return Rhino.Geometry.BoundingBox.Empty;
}
static public Rhino.Geometry.Transform ToRhino(this Autodesk.Revit.DB.Transform transform)
{
var value = new Rhino.Geometry.Transform
{
M00 = transform.BasisX.X,
M10 = transform.BasisX.Y,
M20 = transform.BasisX.Z,
M30 = 0.0,
M01 = transform.BasisY.X,
M11 = transform.BasisY.Y,
M21 = transform.BasisY.Z,
M31 = 0.0,
M02 = transform.BasisZ.X,
M12 = transform.BasisZ.Y,
M22 = transform.BasisZ.Z,
M32 = 0.0,
M03 = transform.Origin.X,
M13 = transform.Origin.Y,
M23 = transform.Origin.Z,
M33 = 1.0
};
return value;
}
static public Rhino.Geometry.Plane ToRhino(this Autodesk.Revit.DB.Plane plane)
{
return new Rhino.Geometry.Plane(plane.Origin.ToRhino(), (Vector3d) plane.XVec.ToRhino(), (Vector3d) plane.YVec.ToRhino());
}
static internal Rhino.Geometry.Curve ToRhino(this Autodesk.Revit.DB.Curve curve)
{
switch (curve)
{
case Autodesk.Revit.DB.Line line:
{
return line.IsBound ? new Rhino.Geometry.LineCurve(line.GetEndPoint(0).ToRhino(), line.GetEndPoint(1).ToRhino()) : null;
}
case Autodesk.Revit.DB.Arc arc:
{
var plane = new Rhino.Geometry.Plane(arc.Center.ToRhino(), new Vector3d(arc.XDirection.ToRhino()), new Vector3d(arc.YDirection.ToRhino()));
if (arc.IsBound)
{
var p0 = arc.GetEndPoint(0).ToRhino();
var p1 = arc.Evaluate(0.5, true).ToRhino();
var p2 = arc.GetEndPoint(1).ToRhino();
return new Rhino.Geometry.ArcCurve(new Rhino.Geometry.Arc(p0, p1, p2));
}
else
{
return new Rhino.Geometry.ArcCurve(new Rhino.Geometry.Circle(plane, arc.Radius));
}
}
case Autodesk.Revit.DB.Ellipse ellipse:
{
var plane = new Rhino.Geometry.Plane(ellipse.Center.ToRhino(), new Vector3d(ellipse.XDirection.ToRhino()), new Vector3d(ellipse.YDirection.ToRhino()));
var e = new Rhino.Geometry.Ellipse(plane, ellipse.RadiusX, ellipse.RadiusY);
var n = e.ToNurbsCurve();
if (ellipse.IsBound)
{
var t0 = Math.IEEERemainder(ellipse.GetEndParameter(0), 2.0 * Math.PI);
var t1 = Math.IEEERemainder(ellipse.GetEndParameter(1), 2.0 * Math.PI);
return n.Trim(t0, t1);
}
return n;
}
case Autodesk.Revit.DB.HermiteSpline hermite:
{
return NurbSpline.Create(hermite).ToRhino();
}
case Autodesk.Revit.DB.NurbSpline nurb:
{
var controlPoints = nurb.CtrlPoints;
var n = new Rhino.Geometry.NurbsCurve(3, nurb.isRational, nurb.Degree + 1, controlPoints.Count);
if (nurb.isRational)
{
using (var Weights = nurb.Weights)
{
var weights = Weights.OfType<double>().ToArray();
int index = 0;
foreach (var pt in controlPoints)
{
var w = weights[index];
n.Points.SetPoint(index++, pt.X * w, pt.Y * w, pt.Z * w, w);
}
}
}
else
{
int index = 0;
foreach (var pt in controlPoints)
n.Points.SetPoint(index++, pt.X, pt.Y, pt.Z);
}
using (var Knots = nurb.Knots)
{
int index = 0;
foreach (var w in Knots.OfType<double>().Skip(1).Take(n.Knots.Count))
n.Knots[index++] = w;
}
return n;
}
case Autodesk.Revit.DB.CylindricalHelix helix: // TODO :
default:
return new Rhino.Geometry.PolylineCurve(curve.Tessellate().ToRhino());
}
}
static internal IEnumerable<Rhino.Geometry.Curve> ToRhino(this IEnumerable<CurveLoop> loops)
{
foreach (var loop in loops)
{
var polycurve = new Rhino.Geometry.PolyCurve();
foreach (var curve in loop)
polycurve.Append(curve.ToRhino());
yield return polycurve;
}
}
static internal Rhino.Geometry.PlaneSurface ToRhino(this Autodesk.Revit.DB.Plane surface, Interval xExtents, Interval yExtents)
{
var plane = new Rhino.Geometry.Plane(surface.Origin.ToRhino(), (Vector3d) surface.XVec.ToRhino(), (Vector3d) surface.YVec.ToRhino());
return new Rhino.Geometry.PlaneSurface(plane, xExtents, yExtents);
}
static internal Rhino.Geometry.RevSurface ToRhino(this Autodesk.Revit.DB.ConicalSurface surface, Interval interval)
{
var plane = new Rhino.Geometry.Plane(surface.Origin.ToRhino(), (Vector3d) surface.XDir.ToRhino(), (Vector3d) surface.YDir.ToRhino());
double height = interval.Min;
var cone = new Rhino.Geometry.Cone(plane, height, Math.Tan(surface.HalfAngle) * height);
return cone.ToRevSurface();
}
static internal Rhino.Geometry.RevSurface ToRhino(this Autodesk.Revit.DB.CylindricalSurface surface, Interval interval)
{
var plane = new Rhino.Geometry.Plane(surface.Origin.ToRhino(), (Vector3d) surface.XDir.ToRhino(), (Vector3d) surface.YDir.ToRhino());
var circle = new Rhino.Geometry.Circle(plane, surface.Radius);
var cylinder = new Rhino.Geometry.Cylinder(circle)
{
Height1 = interval.Min,
Height2 = interval.Max
};
return cylinder.ToRevSurface();
}
static internal Rhino.Geometry.RevSurface ToRhino(this Autodesk.Revit.DB.RevolvedSurface surface, Interval interval)
{
var plane = new Rhino.Geometry.Plane(surface.Origin.ToRhino(), (Vector3d) surface.XDir.ToRhino(), (Vector3d) surface.YDir.ToRhino());
var curve = surface.GetProfileCurveInWorldCoordinates().ToRhino();
var axis = new Rhino.Geometry.Line(surface.Origin.ToRhino(), surface.Origin.ToRhino() + (Vector3d) surface.Axis.ToRhino());
return Rhino.Geometry.RevSurface.Create(curve, axis);
}
static Rhino.Geometry.Brep TrimFace(this Rhino.Geometry.Brep brep, int faceIndex, IEnumerable<Rhino.Geometry.Curve> curves, double tolerance)
{
var trimmedBrep = brep.Faces[faceIndex].Split(curves, Revit.VertexTolerance);
{
var nakedFaces = new List<int>();
foreach (var trimedFace in trimmedBrep.Faces)
{
foreach (var trim in trimedFace.Loops.SelectMany(loop => loop.Trims).Where(trim => trim.Edge.Valence == EdgeAdjacency.Naked))
{
var midPoint = trim.Edge.PointAtNormalizedLength(0.5);
if (!curves.Where(curve => curve.ClosestPoint(midPoint, out var t, Revit.VertexTolerance)).Any())
{
nakedFaces.Add(trimedFace.FaceIndex);
break;
}
}
}
foreach (var nakedFace in nakedFaces.OrderByDescending(x => x))
trimmedBrep.Faces.RemoveAt(nakedFace);
}
{
var interiorFaces = new List<int>();
foreach (var trimedFace in trimmedBrep.Faces)
{
foreach (var trim in trimedFace.Loops.SelectMany(loop => loop.Trims).Where(trim => trim.Edge.Valence == EdgeAdjacency.Interior))
{
if (trim.Loop.LoopType == BrepLoopType.Outer)
{
interiorFaces.Add(trimedFace.FaceIndex);
break;
}
}
}
foreach (var interiorFace in interiorFaces.OrderByDescending(x => x))
trimmedBrep.Faces.RemoveAt(interiorFace);
}
return trimmedBrep;
}
#if !REVIT2018
static internal Autodesk.Revit.DB.Surface GetSurface(this Autodesk.Revit.DB.Face face)
{
switch(face)
{
case PlanarFace planarFace:
return Autodesk.Revit.DB.Plane.CreateByOriginAndBasis(planarFace.Origin, planarFace.XVector, planarFace.YVector);
case ConicalFace conicalFace:
{
var basisX = conicalFace.get_Radius(0).Normalize();
var basisY = conicalFace.get_Radius(1).Normalize();
var basisZ = conicalFace.Axis.Normalize();
return Autodesk.Revit.DB.ConicalSurface.Create(new Frame(conicalFace.Origin, basisX, basisY, basisZ), conicalFace.HalfAngle);
}
case CylindricalFace cylindricalFace:
{
double radius = cylindricalFace.get_Radius(0).GetLength();
var basisX = cylindricalFace.get_Radius(0).Normalize();
var basisY = cylindricalFace.get_Radius(1).Normalize();
var basisZ = cylindricalFace.Axis.Normalize();
return Autodesk.Revit.DB.CylindricalSurface.Create(new Frame(cylindricalFace.Origin, basisX, basisY, basisZ), radius);
}
case RevolvedFace revolvedFace:
{
var basisX = revolvedFace.get_Radius(0).Normalize();
var basisY = revolvedFace.get_Radius(1).Normalize();
var basisZ = revolvedFace.Axis.Normalize();
return Autodesk.Revit.DB.RevolvedSurface.Create(new Frame(revolvedFace.Origin, basisX, basisY, basisZ), revolvedFace.Curve);
}
}
return null;
}
#endif
static internal Rhino.Geometry.Brep ToRhino(this Autodesk.Revit.DB.Face face)
{
using (var surface = face.GetSurface())
{
Rhino.Geometry.Brep brep = null;
var loops = face.GetEdgesAsCurveLoops().ToRhino().ToArray();
switch (surface)
{
case Autodesk.Revit.DB.Plane planeSurface:
{
var plane = new Rhino.Geometry.Plane(planeSurface.Origin.ToRhino(), (Vector3d) planeSurface.XVec.ToRhino(), (Vector3d) planeSurface.YVec.ToRhino());
var bbox = BoundingBox.Empty;
foreach (var loop in loops)
{
var edgeBoundingBox = loop.GetBoundingBox(plane);
bbox = BoundingBox.Union(bbox, edgeBoundingBox);
}
brep = Brep.CreateFromSurface(planeSurface.ToRhino(new Interval(bbox.Min.X, bbox.Max.X), new Interval(bbox.Min.Y, bbox.Max.Y)));
break;
}
case ConicalSurface conicalSurface:
{
var plane = new Rhino.Geometry.Plane(conicalSurface.Origin.ToRhino(), (Vector3d) conicalSurface.XDir.ToRhino(), (Vector3d) conicalSurface.YDir.ToRhino());
var bbox = BoundingBox.Empty;
foreach (var loop in loops)
{
var edgeBoundingBox = loop.GetBoundingBox(plane);
bbox = BoundingBox.Union(bbox, edgeBoundingBox);
}
brep = Rhino.Geometry.Brep.CreateFromRevSurface(conicalSurface.ToRhino(new Interval(bbox.Min.Z, bbox.Max.Z)), false, false);
break;
}
case CylindricalSurface cylindricalSurface:
{
var plane = new Rhino.Geometry.Plane(cylindricalSurface.Origin.ToRhino(), (Vector3d) cylindricalSurface.XDir.ToRhino(), (Vector3d) cylindricalSurface.YDir.ToRhino());
var bbox = BoundingBox.Empty;
foreach (var loop in loops)
{
var edgeBoundingBox = loop.GetBoundingBox(plane);
bbox = BoundingBox.Union(bbox, edgeBoundingBox);
}
brep = Rhino.Geometry.Brep.CreateFromRevSurface(cylindricalSurface.ToRhino(new Interval(bbox.Min.Z, bbox.Max.Z)), false, false);
break;
}
case RevolvedSurface revolvedSurface:
{
var plane = new Rhino.Geometry.Plane(revolvedSurface.Origin.ToRhino(), (Vector3d) revolvedSurface.XDir.ToRhino(), (Vector3d) revolvedSurface.YDir.ToRhino());
var bbox = BoundingBox.Empty;
foreach (var loop in loops)
{
var edgeBoundingBox = loop.GetBoundingBox(plane);
bbox = BoundingBox.Union(bbox, edgeBoundingBox);
}
brep = Rhino.Geometry.Brep.CreateFromRevSurface(revolvedSurface.ToRhino(new Interval(bbox.Min.Z, bbox.Max.Z)), false, false);
break;
}
default:
return null;
}
Debug.Assert(brep.Faces.Count == 1);
#if REVIT2018
brep.Faces[0].OrientationIsReversed = !face.OrientationMatchesSurfaceOrientation;
#endif
return brep.TrimFace(0, loops, Revit.VertexTolerance);
}
}
static Rhino.Geometry.GeometryBase ToRhino(this Autodesk.Revit.DB.Solid solid)
{
bool hasNotImplementedFaces = false;
foreach (var face in solid.Faces)
{
if (hasNotImplementedFaces = !(face is PlanarFace /*|| face is ConicalFace*/ || face is CylindricalFace || face is RevolvedFace))
break;
}
if (hasNotImplementedFaces)
{
// Emergency conversion to mesh
var triangulateLevelOfDetail = GraphicAttributes.Peek.TriangulateLevelOfDetail;
var facesMeshes = new List<Rhino.Geometry.Mesh>(solid.Faces.Size);
foreach (var face in solid.Faces.OfType<Face>())
facesMeshes.Add((double.IsNaN(triangulateLevelOfDetail) ? face.Triangulate() : face.Triangulate(triangulateLevelOfDetail)).ToRhino());
if (facesMeshes.Count > 0)
{
var mesh = new Rhino.Geometry.Mesh();
mesh.Append(facesMeshes);
return mesh;
}
return null;
}
else
{
var brepsToJoin = solid.Faces.Cast<Face>().Select(x => x.ToRhino()).ToArray();
var breps = Rhino.Geometry.Brep.JoinBreps(brepsToJoin, Revit.VertexTolerance);
return breps?.Length == 1 ? breps[0] : Rhino.Geometry.Brep.MergeBreps(breps, Revit.VertexTolerance);
}
}
static Rhino.Geometry.Mesh ToRhino(this Autodesk.Revit.DB.Mesh mesh)
{
var result = new Rhino.Geometry.Mesh();
result.Vertices.AddVertices(mesh.Vertices.ToRhino());
for (int t = 0; t < mesh.NumTriangles; ++t)
{
var triangle = mesh.get_Triangle(t);
var meshFace = new MeshFace
(
(int) triangle.get_Index(0),
(int) triangle.get_Index(1),
(int) triangle.get_Index(2)
);
result.Faces.AddFace(meshFace);
}
return result;
}
static internal IEnumerable<Rhino.Geometry.GeometryBase> ToRhino(this IEnumerable<Autodesk.Revit.DB.GeometryObject> geometries)
{
var scaleFactor = Revit.ModelUnits;
foreach (var geometry in geometries)
{
switch (geometry)
{
case Autodesk.Revit.DB.GeometryInstance instance:
foreach (var g in instance.GetInstanceGeometry().ToRhino())
yield return g;
break;
case Autodesk.Revit.DB.Mesh mesh:
var m = mesh.ToRhino();
m.Faces.ConvertTrianglesToQuads(Revit.AngleTolerance, 0.0);
if (scaleFactor != 1.0)
m?.Scale(scaleFactor);
yield return m;
break;
case Autodesk.Revit.DB.Solid solid:
var s = solid.ToRhino();
if (scaleFactor != 1.0)
s?.Scale(scaleFactor);
yield return s;
break;
case Autodesk.Revit.DB.Curve curve:
var c = curve.ToRhino();
if (scaleFactor != 1.0)
c?.Scale(scaleFactor);
yield return c;
break;
case Autodesk.Revit.DB.PolyLine polyline:
var p = new Rhino.Geometry.PolylineCurve(polyline.GetCoordinates().ToRhino());
if (scaleFactor != 1.0)
p?.Scale(scaleFactor);
yield return p;
break;
}
}
}
#endregion
#region GetPreviewMaterials
static bool HasMultipleMaterials(this IEnumerable<Face> faces)
{
if (faces.Any())
{
var materialId = faces.First()?.MaterialElementId ?? ElementId.InvalidElementId;
foreach (var face in faces.Skip(1))
{
if (face.MaterialElementId != materialId)
return true;
}
}
return false;
}
static internal IEnumerable<Rhino.Display.DisplayMaterial> GetPreviewMaterials(this IEnumerable<Autodesk.Revit.DB.GeometryObject> geometries, Rhino.Display.DisplayMaterial defaultMaterial)
{
var scaleFactor = Revit.ModelUnits;
foreach (var geometry in geometries)
{
if (geometry.Visibility != Visibility.Visible)
continue;
switch (geometry)
{
case Autodesk.Revit.DB.GeometryInstance instance:
foreach (var g in instance.GetInstanceGeometry().GetPreviewMaterials(instance.GetInstanceGeometry().MaterialElement.ToRhino(defaultMaterial)))
yield return g;
break;
case Autodesk.Revit.DB.Mesh mesh:
if (mesh.NumTriangles <= 0)
continue;
var sm = Revit.ActiveDBDocument.GetElement(mesh.MaterialElementId) as Material;
yield return sm.ToRhino(defaultMaterial);
break;
case Autodesk.Revit.DB.Solid solid:
if (solid.Faces.IsEmpty)
continue;
var solidFaces = solid.Faces.OfType<Face>();
bool useMultipleMaterials = solidFaces.HasMultipleMaterials();
foreach (var face in solidFaces)
{
var fm = Revit.ActiveDBDocument.GetElement(face.MaterialElementId) as Material;
yield return fm.ToRhino(defaultMaterial);
if (!useMultipleMaterials)
break;
}
break;
}
}
}
#endregion
#region GetPreviewMeshes
static internal IEnumerable<Rhino.Geometry.Mesh> GetPreviewMeshes(this IEnumerable<Autodesk.Revit.DB.GeometryObject> geometries)
{
var scaleFactor = Revit.ModelUnits;
foreach (var geometry in geometries)
{
if (geometry.Visibility != Visibility.Visible)
continue;
switch (geometry)
{
case Autodesk.Revit.DB.GeometryInstance instance:
foreach (var g in instance.GetInstanceGeometry().GetPreviewMeshes())
yield return g;
break;
case Autodesk.Revit.DB.Mesh mesh:
if (mesh.NumTriangles <= 0)
continue;
var m = mesh.ToRhino();
m.Faces.ConvertTrianglesToQuads(Math.PI / 90.0, 0.0);
if (scaleFactor != 1.0)
m?.Scale(scaleFactor);
yield return m;
break;
case Autodesk.Revit.DB.Solid solid:
if (solid.Faces.IsEmpty)
continue;
var meshingParameters = GraphicAttributes.Peek.MeshingParameters;
var solidFaces = solid.Faces.OfType<Face>();
bool useMultipleMaterials = solidFaces.HasMultipleMaterials();
var facesMeshes = useMultipleMaterials ? null : new List<Rhino.Geometry.Mesh>(solid.Faces.Size);
foreach (var face in solidFaces)
{
var f = (meshingParameters == null ? face.Triangulate() : face.Triangulate(meshingParameters.RelativeTolerance)).ToRhino();
//f.Faces.ConvertTrianglesToQuads(Math.PI / 90.0, 0.0);
if (scaleFactor != 1.0)
f?.Scale(scaleFactor);
if (facesMeshes == null)
yield return f;
else
facesMeshes.Add(f);
}
if(facesMeshes != null)
{
if (facesMeshes.Count > 0)
{
var mesh = new Rhino.Geometry.Mesh();
mesh.Append(facesMeshes);
yield return mesh;
}
yield return null;
}
break;
}
}
}
#endregion
#region GetPreviewWires
static internal IEnumerable<Rhino.Geometry.Curve> GetPreviewWires(this IEnumerable<Autodesk.Revit.DB.GeometryObject> geometries)
{
var scaleFactor = Revit.ModelUnits;
foreach (var geometry in geometries)
{
var gs = Revit.ActiveDBDocument.GetElement(geometry.GraphicsStyleId) as GraphicsStyle;
if (geometry.Visibility != Visibility.Visible)
continue;
switch (geometry)
{
case Autodesk.Revit.DB.GeometryInstance instance:
foreach (var g in instance.GetInstanceGeometry().GetPreviewWires())
yield return g;
break;
case Autodesk.Revit.DB.Solid solid:
if (solid.Faces.IsEmpty)
continue;
foreach (var edge in solid.Edges.OfType<Edge>())
{
var s = edge.AsCurve().ToRhino();
if (scaleFactor != 1.0)
s?.Scale(scaleFactor);
yield return s;
}
break;
case Autodesk.Revit.DB.Curve curve:
var c = curve.ToRhino();
if (scaleFactor != 1.0)
c?.Scale(scaleFactor);
yield return c;
break;
case Autodesk.Revit.DB.PolyLine polyline:
if (polyline.NumberOfCoordinates <= 0)
continue;
var p = new Rhino.Geometry.PolylineCurve(polyline.GetCoordinates().ToRhino());
if (scaleFactor != 1.0)
p?.Scale(scaleFactor);
yield return p;
break;
}
}
}
#endregion
#region ToHost
static public Color ToHost(this System.Drawing.Color c)
{
return new Color(c.R, c.G, c.B);
}
static public XYZ ToHost(this Point3f p)
{
return new XYZ(p.X, p.Y, p.Z);
}
static public XYZ ToHost(this Point3d p)
{
return new XYZ(p.X, p.Y, p.Z);
}
static public XYZ ToHost(this Vector3f p)
{
return new XYZ(p.X, p.Y, p.Z);
}
static public XYZ ToHost(this Vector3d p)
{
return new XYZ(p.X, p.Y, p.Z);
}
static public Autodesk.Revit.DB.Line ToHost(this Rhino.Geometry.Line line)
{
return Autodesk.Revit.DB.Line.CreateBound(line.From.ToHost(), line.To.ToHost());
}
static public Autodesk.Revit.DB.Plane ToHost(this Rhino.Geometry.Plane plane)
{
return Autodesk.Revit.DB.Plane.CreateByOriginAndBasis(plane.Origin.ToHost(), plane.XAxis.ToHost(), plane.YAxis.ToHost());
}
static public Autodesk.Revit.DB.Transform ToHost(this Rhino.Geometry.Transform transform)
{
var value = Autodesk.Revit.DB.Transform.CreateTranslation(new XYZ(transform.M03, transform.M13, transform.M23));
value.BasisX = new XYZ(transform.M00, transform.M10, transform.M20);
value.BasisY = new XYZ(transform.M01, transform.M11, transform.M21);
value.BasisZ = new XYZ(transform.M02, transform.M12, transform.M22);
return value;
}
static internal IList<XYZ> ToHost(this IList<Point3d> points)
{
var xyz = new List<XYZ>(points.Count);
foreach (var p in points)
xyz.Add(p.ToHost());
return xyz;
}
static internal IList<XYZ> ToHost(this IList<ControlPoint> points)
{
var xyz = new List<XYZ>(points.Count);
foreach (var p in points)
xyz.Add(p.Location.ToHost());
return xyz;
}
static internal IList<XYZ> ToHost(this IEnumerable<ControlPoint> points)
{
var xyz = new List<XYZ>();
foreach (var p in points)
xyz.Add(p.Location.ToHost());
return xyz;
}
static internal IList<double> ToHost(this NurbsCurveKnotList knotList)
{
var knotListCount = knotList.Count;
if (knotListCount > 0)
{
var knots = new List<double>(knotListCount + 2);
knots.Add(knotList[0]);
foreach (var k in knotList)
knots.Add(k);
knots.Add(knotList[knotListCount - 1]);
return knots;
}
return new List<double>();
}
static internal IList<double> ToHost(this NurbsSurfaceKnotList knotList)
{
var knotListCount = knotList.Count;
if (knotListCount > 0)
{
var knots = new List<double>(knotListCount + 2);
knots.Add(knotList[0]);
foreach (var k in knotList)
knots.Add(k);
knots.Add(knotList[knotListCount - 1]);
return knots;
}
return new List<double>();
}
static internal Autodesk.Revit.DB.Point ToHost(this Rhino.Geometry.Point point)
{
return Autodesk.Revit.DB.Point.Create(ToHost(point.Location));
}
static internal IEnumerable<Autodesk.Revit.DB.Point> ToHost(this Rhino.Geometry.PointCloud pointCloud)
{
foreach(var p in pointCloud)
yield return Autodesk.Revit.DB.Point.Create(ToHost(p.Location));
}
static internal IEnumerable<Autodesk.Revit.DB.Curve> ToHost(this Rhino.Geometry.Curve curve, double curveTolerance = double.PositiveInfinity)
{
curveTolerance = Math.Min(Revit.ShortCurveTolerance, Math.Abs(curveTolerance));
Debug.Assert(!curve.IsShort(curveTolerance));
var simplifiedCurve = curve.Simplify(CurveSimplifyOptions.SplitAtFullyMultipleKnots, curveTolerance, Revit.AngleTolerance);
if (simplifiedCurve != null)
curve = simplifiedCurve;
switch (curve)
{
case Rhino.Geometry.LineCurve line:
yield return Autodesk.Revit.DB.Line.CreateBound(line.PointAtStart.ToHost(), line.PointAtEnd.ToHost());
break;
case Rhino.Geometry.PolylineCurve polyline:
for (int p = 1; p < polyline.PointCount; ++p)
yield return Autodesk.Revit.DB.Line.CreateBound(polyline.Point(p - 1).ToHost(), polyline.Point(p).ToHost());
break;
case Rhino.Geometry.ArcCurve arc:
if (arc.IsClosed)
yield return Autodesk.Revit.DB.Arc.Create(arc.Arc.Plane.ToHost(), arc.Arc.Radius, 0.0, (2.0 * Math.PI) - 2e-8);
else
yield return Autodesk.Revit.DB.Arc.Create(arc.Arc.StartPoint.ToHost(), arc.Arc.EndPoint.ToHost(), arc.Arc.MidPoint.ToHost());
break;
case Rhino.Geometry.PolyCurve polyCurve:
polyCurve.RemoveNesting();
polyCurve.RemoveShortSegments(curveTolerance);
for (int s = 0; s < polyCurve.SegmentCount; ++s)
{
foreach (var segment in polyCurve.SegmentCurve(s).ToHost())
yield return segment;
}
break;
case Rhino.Geometry.NurbsCurve nurbsCurve:
if (nurbsCurve.IsLinear(Revit.VertexTolerance))
{
yield return Autodesk.Revit.DB.Line.CreateBound(nurbsCurve.PointAtStart.ToHost(), nurbsCurve.PointAtEnd.ToHost());
yield break;
}
if (nurbsCurve.TryGetPolyline(out var polylineSegment))
{
polylineSegment.ReduceSegments(curveTolerance);
foreach (var segment in polylineSegment.GetSegments())
yield return Autodesk.Revit.DB.Line.CreateBound(segment.From.ToHost(), segment.To.ToHost());
yield break;
}
if (nurbsCurve.TryGetArc(out var arcSegment, Revit.VertexTolerance))
{
yield return Autodesk.Revit.DB.Arc.Create(arcSegment.StartPoint.ToHost(), arcSegment.EndPoint.ToHost(), arcSegment.MidPoint.ToHost());
yield break;
}
if (nurbsCurve.IsClosed)
{
if (nurbsCurve.TryGetCircle(out var circle, Revit.VertexTolerance))
{
yield return Autodesk.Revit.DB.Arc.Create(circle.Plane.ToHost(), circle.Radius, 0.0, 2.0 * (2.0 * Math.PI) - 2e-8);
yield break;
}
if (nurbsCurve.TryGetEllipse(out var ellipse, Revit.VertexTolerance))
{
yield return Autodesk.Revit.DB.Ellipse.CreateCurve(ellipse.Plane.Origin.ToHost(), ellipse.Radius1, ellipse.Radius2, ellipse.Plane.XAxis.ToHost(), ellipse.Plane.YAxis.ToHost(), 0.0, (2.0 * Math.PI) - 2e-8);
yield break;
}
foreach (var segment in nurbsCurve.Split(nurbsCurve.Domain.Mid))
foreach (var c in segment.ToHost())
yield return c;
}
else
{
nurbsCurve.Knots.RemoveMultipleKnots(1, nurbsCurve.Degree, Revit.VertexTolerance);
var degree = nurbsCurve.Degree;
var knots = nurbsCurve.Knots.ToHost();
var controlPoints = nurbsCurve.Points.ToHost();
Debug.Assert(degree >= 1);
Debug.Assert(controlPoints.Count > nurbsCurve.Degree);
Debug.Assert(knots.Count == nurbsCurve.Degree + controlPoints.Count + 1);
Autodesk.Revit.DB.Curve nurbSpline = null;
try
{
if (nurbsCurve.IsRational)
{
var weights = new List<double>(controlPoints.Count);
foreach (var p in nurbsCurve.Points)
{
Debug.Assert(p.Weight > 0.0);
weights.Add(p.Weight);
}
Debug.Assert(weights.Count == controlPoints.Count);
nurbSpline = NurbSpline.CreateCurve(nurbsCurve.Degree, knots, controlPoints, weights);
}
else
{
nurbSpline = NurbSpline.CreateCurve(nurbsCurve.Degree, knots, controlPoints);
}
}
catch (Autodesk.Revit.Exceptions.ApplicationException e)
{
Debug.Fail(e.Source, e.Message);
}
yield return nurbSpline;
}
break;
default:
foreach (var c in curve.ToNurbsCurve().ToHost())
yield return c;
break;
}
}
static internal BRepBuilderSurfaceGeometry ToHost(this Rhino.Geometry.BrepFace faceSurface)
{
using (var nurbsSurface = faceSurface.ToNurbsSurface())
{
{
var domainU = nurbsSurface.Domain(0);
Debug.Assert(!nurbsSurface.GetNextDiscontinuity(0, Continuity.C2_continuous, domainU.Min, domainU.Max, out var tU));
var domainV = nurbsSurface.Domain(1);
Debug.Assert(!nurbsSurface.GetNextDiscontinuity(1, Continuity.C2_continuous, domainV.Min, domainV.Max, out var tV));
}
var degreeU = nurbsSurface.Degree(0);
var degreeV = nurbsSurface.Degree(1);
var knotsU = nurbsSurface.KnotsU.ToHost();
var knotsV = nurbsSurface.KnotsV.ToHost();
var controlPoints = nurbsSurface.Points.ToHost();
Debug.Assert(degreeU >= 1);
Debug.Assert(degreeV >= 1);
Debug.Assert(knotsU.Count >= 2 * (degreeU + 1));
Debug.Assert(knotsV.Count >= 2 * (degreeV + 1));
Debug.Assert(controlPoints.Count == (knotsU.Count - degreeU - 1) * (knotsV.Count - degreeV - 1));
try
{
if (nurbsSurface.IsRational)
{
var weights = new List<double>(controlPoints.Count);
foreach (var p in nurbsSurface.Points)
{
Debug.Assert(p.Weight > 0.0);
weights.Add(p.Weight);
}
return BRepBuilderSurfaceGeometry.CreateNURBSSurface
(
degreeU, degreeV, knotsU, knotsV, controlPoints, weights, false, null
);
}
else
{
return BRepBuilderSurfaceGeometry.CreateNURBSSurface
(
degreeU, degreeV, knotsU, knotsV, controlPoints, false, null
);
}
}
catch (Autodesk.Revit.Exceptions.ApplicationException e)
{
Debug.Fail(e.Source, e.Message);
}
}
return null;
}
static private Rhino.Geometry.Brep SplitClosedFaces(Rhino.Geometry.Brep brep)
{
Brep brepToSplit = null;
while (brepToSplit != brep && brep != null)
{
brep.Standardize();
brepToSplit = brep;
foreach (var face in brepToSplit.Faces)
{
face.ShrinkFace(BrepFace.ShrinkDisableSide.ShrinkAllSides);
var face_IsClosed = new bool[2];
var splitters = new List<Rhino.Geometry.Curve>();
// Compute splitters at C2
for (int d = 0; d < 2; d++)
{
face_IsClosed[d] = face.IsClosed(d);
var domain = face.Domain(d);
var t = domain.Min;
while (face.GetNextDiscontinuity(d, Continuity.C2_continuous, t, domain.Max, out t))
{
splitters.AddRange(face.TrimAwareIsoCurve((d == 0) ? 1 : 0, t));
face_IsClosed[d] = false;
}
}
if (face_IsClosed[0])
splitters.AddRange(face.TrimAwareIsoCurve(1, face.Domain(0).Mid));
if (face_IsClosed[1])
splitters.AddRange(face.TrimAwareIsoCurve(0, face.Domain(1).Mid));
if (splitters.Count > 0)
{
brep = face.Split(splitters, Revit.ShortCurveTolerance);
if (brep == null)
return null;
if(brep.Faces.Count != brepToSplit.Faces.Count)
break; // try again until no face is splitted
// Split was ok but no new faces were created for tolerance reasons
// Too near from the limits.
brep = brepToSplit;
}
}
}
return brep;
}
static internal IEnumerable<GeometryObject> ToHost(this Rhino.Geometry.Brep brep)
{
Solid solid = null;
// MakeValidForV2 converts everything inside brep to NURBS
if (brep.MakeValidForV2())
{
var splittedBrep = SplitClosedFaces(brep);
if (splittedBrep != null)
{
brep = splittedBrep;
try
{
var builder = new BRepBuilder(brep.IsSolid ? BRepType.Solid : BRepType.OpenShell);
builder.AllowRemovalOfProblematicFaces();
builder.SetAllowShortEdges();
var brepEdges = new List<BRepBuilderGeometryId>[brep.Edges.Count];
foreach (var face in brep.Faces)
{
var faceId = builder.AddFace(face.ToHost(), face.OrientationIsReversed);
builder.SetFaceMaterialId(faceId, GraphicAttributes.Peek.MaterialId);
foreach (var loop in face.Loops)
{
var loopId = builder.AddLoop(faceId);
foreach (var trim in loop.Trims)
{
if (trim.TrimType != BrepTrimType.Boundary && trim.TrimType != BrepTrimType.Mated)
continue;
var edge = trim.Edge;
if (edge == null)
continue;
var edgeIds = brepEdges[edge.EdgeIndex];
if (edgeIds == null)
{
edgeIds = brepEdges[edge.EdgeIndex] = new List<BRepBuilderGeometryId>();
foreach (var e in edge.ToHost())
edgeIds.Add(builder.AddEdge(BRepBuilderEdgeGeometry.Create(e)));
}
if (trim.IsReversed())
{
for (int e = edgeIds.Count - 1; e >= 0; --e)
builder.AddCoEdge(loopId, edgeIds[e], true);
}
else
{
for (int e = 0; e < edgeIds.Count; ++e)
builder.AddCoEdge(loopId, edgeIds[e], false);
}
}
builder.FinishLoop(loopId);
}
builder.FinishFace(faceId);
}
builder.Finish();
if (builder.IsResultAvailable())
solid = builder.GetResult();
}
catch (Autodesk.Revit.Exceptions.ApplicationException e)
{
// TODO: Fix cases with singularities and uncomment this line
//Debug.Fail(e.Source, e.Message);
Debug.WriteLine(e.Message, e.Source);
}
}
else
{
Debug.Fail("SplitClosedFaces", "SplitClosedFaces failed to split a closed surface.");
}
}
if (solid != null)
{
yield return solid;
}
else
{
// Emergency result as a mesh
var mp = MeshingParameters.Default;
mp.MinimumEdgeLength = Revit.VertexTolerance;
mp.ClosedObjectPostProcess = true;
mp.JaggedSeams = false;
var brepMesh = new Rhino.Geometry.Mesh();
brepMesh.Append(Rhino.Geometry.Mesh.CreateFromBrep(brep, mp));
foreach(var g in brepMesh.ToHost())
yield return g;
}
}
static internal IEnumerable<GeometryObject> ToHost(this Rhino.Geometry.Mesh mesh)
{
var faceVertices = new List<XYZ>(4);
var builder = new TessellatedShapeBuilder()
{
Target = TessellatedShapeBuilderTarget.AnyGeometry,
Fallback = TessellatedShapeBuilderFallback.Mesh
};
var pieces = mesh.DisjointMeshCount > 1 ?
mesh.SplitDisjointPieces() :
new Rhino.Geometry.Mesh[] { mesh };
foreach (var piece in pieces)
{
piece.Faces.ConvertNonPlanarQuadsToTriangles(Revit.VertexTolerance, RhinoMath.UnsetValue, 5);
var isSolid = piece.IsClosed && piece.IsManifold(true, out var isOriented, out var hasBoundary) && isOriented;
var vertices = piece.Vertices.ToPoint3dArray();
builder.OpenConnectedFaceSet(isSolid);
foreach (var face in piece.Faces)
{
faceVertices.Add(vertices[face.A].ToHost());
faceVertices.Add(vertices[face.B].ToHost());
faceVertices.Add(vertices[face.C].ToHost());
if (face.IsQuad)
faceVertices.Add(vertices[face.D].ToHost());
builder.AddFace(new TessellatedFace(faceVertices, GraphicAttributes.Peek.MaterialId));
faceVertices.Clear();
}
builder.CloseConnectedFaceSet();
}
IList<GeometryObject> objects = null;
try
{
builder.Build();
objects = builder.GetBuildResult().GetGeometricalObjects();
}
catch (Autodesk.Revit.Exceptions.ApplicationException e)
{
Debug.Fail(e.Source, e.Message);
objects = new List<GeometryObject>();
}
return objects;
}
static public IEnumerable<IList<GeometryObject>> ToHost(this IEnumerable<Rhino.Geometry.GeometryBase> geometries)
{
var scaleFactor = 1.0 / Revit.ModelUnits;
foreach (var geometry in geometries)
{
switch (geometry)
{
case Rhino.Geometry.Point point:
point = (Rhino.Geometry.Point) point.DuplicateShallow();
if (scaleFactor != 1.0)
point.Scale(scaleFactor);
yield return Enumerable.Repeat(point.ToHost(), 1).Cast<GeometryObject>().ToList();
break;
case Rhino.Geometry.PointCloud pointCloud:
pointCloud = (Rhino.Geometry.PointCloud) pointCloud.DuplicateShallow();
if (scaleFactor != 1.0)
pointCloud.Scale(scaleFactor);
yield return pointCloud.ToHost().Cast<GeometryObject>().ToList();
break;
case Rhino.Geometry.Curve curve:
curve = (Rhino.Geometry.Curve) curve.DuplicateShallow();
if (scaleFactor != 1.0)
curve.Scale(scaleFactor);
yield return curve.ToHost().Cast<GeometryObject>().ToList();
break;
case Rhino.Geometry.Brep brep:
brep = (Rhino.Geometry.Brep) brep.DuplicateShallow();
if (scaleFactor != 1.0)
brep.Scale(scaleFactor);
yield return brep.ToHost().Cast<GeometryObject>().ToList();
break;
case Rhino.Geometry.Mesh mesh:
mesh = (Rhino.Geometry.Mesh) mesh.DuplicateShallow();
if (scaleFactor != 1.0)
mesh.Scale(scaleFactor);
while (mesh.CollapseFacesByEdgeLength(false, Revit.VertexTolerance) > 0) ;
yield return mesh.ToHost().Cast<GeometryObject>().ToList();
break;
}
}
}
#endregion
#region Utils
static public bool TryGetExtrusion(this Rhino.Geometry.Surface surface, out Rhino.Geometry.Extrusion extrusion, int direction = 1)
{
extrusion = null;
var nurbsSurface = surface as NurbsSurface ?? surface.ToNurbsSurface();
var oposite = direction == 0 ? 1 : 0;
var domain = nurbsSurface.Domain(direction);
var iso0 = nurbsSurface.IsoCurve(oposite, domain.Min);
var iso1 = nurbsSurface.IsoCurve(oposite, domain.Max);
// Revit needs closed loops for NewExtrusionForm()
if (iso0.IsClosed)
return false;
if(iso0.TryGetPlane(out var plane0) && iso1.TryGetPlane(out var plane1))
{
if(plane0.Normal.IsParallelTo(plane1.Normal, RhinoMath.ToRadians(1.0 / 100.0)) == 1)
{
double tolerance = Revit.VertexTolerance * Revit.ModelUnits;
var rows = direction == 0 ? nurbsSurface.Points.CountU : nurbsSurface.Points.CountV;
var columns = direction == 0 ? nurbsSurface.Points.CountV : nurbsSurface.Points.CountU;
for (int c = 0; c < columns; ++c)
{
var point = direction == 0 ? nurbsSurface.Points.GetControlPoint(0, c) : nurbsSurface.Points.GetControlPoint(c, 0);
for (int r = 1; r < rows; ++r)
{
var pointR = direction == 0 ? nurbsSurface.Points.GetControlPoint(r, c) : nurbsSurface.Points.GetControlPoint(c, r);
if(plane0.ClosestPoint(pointR.Location).DistanceTo(point.Location) > tolerance)
return false;
if (pointR.Weight != point.Weight)
return false;
}
}
extrusion = Rhino.Geometry.Extrusion.Create(iso0, iso0.PointAtStart.DistanceTo(iso1.PointAtStart), false);
return true;
}
}
return false;
}
static public bool TryGetExtrusion(this Rhino.Geometry.Brep brep, out Rhino.Geometry.Extrusion extrusion)
{
extrusion = null;
if (brep.Faces.Count == 3)
{
// TODO : Find the wall surface but Rhino.Geometry.ExtrusionToBrep.ToBrep() conversion sets the wall in face[0] end extrude in U direction
return brep.Faces[0].TryGetExtrusion(out extrusion, 1);
}
return false;
}
#endregion
};
}
| 34.380986 | 219 | 0.599909 | [
"MIT"
] | jmirtsch/rhino.inside | Autodesk/Revit/Convert.cs | 48,099 | C# |
using DFC.App.SkillsHealthCheck.Services.SkillsCentral.Enums;
using DFC.App.SkillsHealthCheck.Services.SkillsCentral.Messages;
using System.Threading.Tasks;
namespace DFC.App.SkillsHealthCheck.Services.SkillsCentral.Interfaces
{
public interface ISkillsHealthCheckService
{
/// <summary>
/// Gets the skills document.
/// </summary>
/// <param name="getSkillsDocumentRequest">The get skills document request.</param>
/// <returns></returns>
GetSkillsDocumentResponse GetSkillsDocument(GetSkillsDocumentRequest getSkillsDocumentRequest);
/// <summary>
/// Gets the skills document.
/// </summary>
/// <param name="Identifier">the Identifier of the skills document</param>
/// <returns></returns>
GetSkillsDocumentIdResponse GetSkillsDocumentByIdentifier(string Identifier);
/// <summary>
/// Creates the skills document.
/// </summary>
/// <param name="createSkillsDocumentRequest">The create skills document request.</param>
/// <returns></returns>
CreateSkillsDocumentResponse CreateSkillsDocument(CreateSkillsDocumentRequest createSkillsDocumentRequest);
/// <summary>
/// Gets the list type fields.
/// </summary>
/// <param name="getListTypeFieldsRequest">The get list type fields request.</param>
/// <returns></returns>
GetListTypeFieldsResponse GetListTypeFields(GetListTypeFieldsRequest getListTypeFieldsRequest);
/// <summary>
/// Gets the assessment question.
/// </summary>
/// <param name="getAssessmentQuestionRequest">The get assessment question request.</param>
/// <returns></returns>
GetAssessmentQuestionResponse GetAssessmentQuestion(GetAssessmentQuestionRequest getAssessmentQuestionRequest);
/// <summary>
/// Saves the question answer.
/// </summary>
/// <param name="saveQuestionAnswerRequest">The save question answer request.</param>
/// <returns></returns>
SaveQuestionAnswerResponse SaveQuestionAnswer(SaveQuestionAnswerRequest saveQuestionAnswerRequest);
/// <summary>
/// Request the preparation of a document for download.
/// </summary>
/// <param name="documentId">The document id.</param>
/// <param name="formatter">The document format type.</param>
/// <param name="documentId">Name associated with request.</param>
/// <returns></returns>
Task<DocumentStatus> RequestDownloadAsync(long documentId, string formatter, string requestedBy);
/// <summary>
/// Query download status to see if document is ready.
/// </summary>
/// <param name="documentId">The document id.</param>
/// <param name="formatter">The document format type.</param>
/// <returns></returns>
Task<DocumentStatus> QueryDownloadStatusAsync(long documentId, string formatter);
/// <summary>
/// Downloads the document.
/// </summary>
/// <param name="downloadDocumentRequest">The download document request.</param>
/// <returns></returns>
DownloadDocumentResponse DownloadDocument(DownloadDocumentRequest downloadDocumentRequest);
}
}
| 42.525641 | 119 | 0.661743 | [
"MIT"
] | SkillsFundingAgency/dfc-app-skillshealthcheck | DFC.App.SkillsHealthCheck.Services.SkillsCentral/Interfaces/ISkillsHealthCheckService.cs | 3,319 | C# |
using System;
namespace OP.MSCRM.AutoNumberGenerator.Plugins.ExceptionHandling
{
/// <summary>
/// Plugin execution exception handling
/// </summary>
public class PluginException : Exception
{
public PluginException(string name, string description)
{
Name = name;
Description = description;
}
/// <summary>
/// Exception name
/// </summary>
public string Name { get; private set; }
/// <summary>
/// Exception description
/// </summary>
public string Description { get; private set; }
}
}
| 23.5 | 65 | 0.539514 | [
"MIT"
] | ITFury/MSCRMAutoNumberGenerator | OP.MSCRM.AutoNumberGenerator/OP.MSCRM.AutoNumberGenerator.Plugins/ExceptionHandling/PluginException.cs | 660 | C# |
//
// Encog(tm) Core v3.3 - .Net Version
// http://www.heatonresearch.com/encog/
//
// Copyright 2008-2014 Heaton Research, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// For more information on Heaton Research copyrights, licenses
// and trademarks visit:
// http://www.heatonresearch.com/copyright
//
using System;
using System.Collections.Generic;
using Encog.ML.Data;
using Encog.ML.Factory.Parse;
using Encog.ML.SVM;
using Encog.ML.SVM.Training;
using Encog.ML.Train;
using Encog.Util;
namespace Encog.ML.Factory.Train
{
/// <summary>
/// A factory that creates SVM-search trainers.
/// </summary>
///
public class SVMSearchFactory
{
/// <summary>
/// Property for gamma.
/// </summary>
///
public const String PropertyGamma1 = "GAMMA1";
/// <summary>
/// Property for constant.
/// </summary>
///
public const String PropertyC1 = "C1";
/// <summary>
/// Property for gamma.
/// </summary>
///
public const String PropertyGamma2 = "GAMMA2";
/// <summary>
/// Property for constant.
/// </summary>
///
public const String PropertyC2 = "C2";
/// <summary>
/// Property for gamma.
/// </summary>
///
public const String PropertyGammaStep = "GAMMASTEP";
/// <summary>
/// Property for constant.
/// </summary>
///
public const String PropertyCStep = "CSTEP";
/// <summary>
/// Create a SVM trainer.
/// </summary>
///
/// <param name="method">The method to use.</param>
/// <param name="training">The training data to use.</param>
/// <param name="argsStr">The arguments to use.</param>
/// <returns>The newly created trainer.</returns>
public IMLTrain Create(IMLMethod method,
IMLDataSet training, String argsStr)
{
if (!(method is SupportVectorMachine))
{
throw new EncogError(
"SVM Train training cannot be used on a method of type: "
+ method.GetType().FullName);
}
IDictionary<String, String> args = ArchitectureParse.ParseParams(argsStr);
new ParamsHolder(args);
var holder = new ParamsHolder(args);
double gammaStart = holder.GetDouble(
PropertyGamma1, false,
SVMSearchTrain.DefaultGammaBegin);
double cStart = holder.GetDouble(PropertyC1,
false, SVMSearchTrain.DefaultConstBegin);
double gammaStop = holder.GetDouble(
PropertyGamma2, false,
SVMSearchTrain.DefaultGammaEnd);
double cStop = holder.GetDouble(PropertyC2,
false, SVMSearchTrain.DefaultConstEnd);
double gammaStep = holder.GetDouble(
PropertyGammaStep, false,
SVMSearchTrain.DefaultGammaStep);
double cStep = holder.GetDouble(PropertyCStep,
false, SVMSearchTrain.DefaultConstStep);
var result = new SVMSearchTrain((SupportVectorMachine) method, training)
{
GammaBegin = gammaStart,
GammaEnd = gammaStop,
GammaStep = gammaStep,
ConstBegin = cStart,
ConstEnd = cStop,
ConstStep = cStep
};
return result;
}
}
}
| 34.640625 | 87 | 0.531123 | [
"BSD-3-Clause"
] | asad4237/encog-dotnet-core | encog-core-cs/ML/Factory/Train/SVMSearchFactory.cs | 4,434 | C# |
namespace Whitelist
{
partial class Form1
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.button1 = new System.Windows.Forms.Button();
this.email = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(67, 113);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(267, 31);
this.button1.TabIndex = 0;
this.button1.Text = "Login";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// email
//
this.email.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.email.Location = new System.Drawing.Point(45, 87);
this.email.Name = "email";
this.email.Size = new System.Drawing.Size(304, 13);
this.email.TabIndex = 1;
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(398, 201);
this.Controls.Add(this.email);
this.Controls.Add(this.button1);
this.Name = "Form1";
this.Text = "1";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button button1;
private System.Windows.Forms.TextBox email;
}
}
| 35.16 | 108 | 0.532423 | [
"MIT"
] | Verfired/WhiteList | Whitelist/Form1.Designer.cs | 2,639 | 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("Greetings")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Greetings")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("f85a8c89-700d-428f-a51d-928f11cc0db5")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| 37.594595 | 84 | 0.744069 | [
"MIT"
] | vesopk/TechModule-Exercises | DataTypeLab/Greetings/Properties/AssemblyInfo.cs | 1,394 | C# |
using System;
using Rxns.Xamarin.Features.Navigation.Pages;
using Xamarin.Forms;
namespace Rxns.Xamarin.Features.Navigation
{
public interface IResolvePages
{
/// <summary>
/// Resolves view model with a given configuration, ready for use
/// </summary>
/// <typeparam name="TPageModel"></typeparam>
/// <returns></returns>
TPageModel ResolvePageModel<TPageModel>() where TPageModel : IRxnPageModel;
Page ResolvePageWithModel<TPageModel>() where TPageModel : IRxnPageModel;
IRxnPageModel ResolvePageModel(Type pageModelType, object vmcfg = null);
Page ResolvePageWithModel(Type pageModelType, object vmcfg = null);
TPageModel ResolvePageModel<TPageModel, TViewModelCfg>(TViewModelCfg cfg)
where TPageModel : IRxnPageModel, IViewModelWithCfg<TViewModelCfg>
where TViewModelCfg : ICfgFromUrl;
Page ResolvePageWithModel<TPageModel, TViewModelCfg>(TViewModelCfg cfg)
where TPageModel : IRxnPageModel, IViewModelWithCfg<TViewModelCfg>
where TViewModelCfg : ICfgFromUrl;
Page ResolvePageWithModel(Type pageType, IRxnPageModel pageModel, object vmcfg = null, bool boostrapPage = true, bool bootstrapModel = true);
TPage ResolvePageWithModel<TPage>(IRxnPageModel pageModel, object vmCfg, bool shouldBootstrapPage = true, bool shouldBootstrapModel = true)
where TPage : Page;
}
}
| 39.648649 | 149 | 0.706203 | [
"MIT"
] | captainjono/rxns | src/Rxns.Xamarin/Features/Navigation/IResolvePages.cs | 1,469 | C# |
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Net.Http.Json;
using System.Security.Claims;
using System.Threading.Tasks;
//using Blazored.LocalStorage;
//using Blazored.SessionStorage;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Authorization;
using Monitor.Service.Model;
using Monitor.Service.Urls;
using System.Text.Json;
namespace Count4U.Service.Shared
{
//Поскольку мы используем клиентскую версию Blazor, нам нужно предоставить собственную реализацию для класса AuthenticationStateProvider.
//Поскольку существует множество вариантов клиентских приложений, нет способа создать класс по умолчанию, который бы работал для всех.
//Нужно переопределить метод GetAuthenticationStateAsync.
//В этом методе нам нужно определить, аутентифицирован ли текущий пользователь или нет.
//также нужно добавить несколько вспомогательных методов, которые мы будем использовать для обновления состояния аутентификации, когда пользователь входит в систему или выходит из нее.
public class ApiAuthenticationStateProvider : AuthenticationStateProvider
{
private readonly HttpClient _httpClient;
//private readonly ISessionStorageService _sessionStorage;
//private readonly ILocalStorageService _localStorage;
private readonly IJwtService _jwtService;
public ApiAuthenticationStateProvider(HttpClient httpClient
// , ISessionStorageService sessionStorage
//, ILocalStorageService localStorage
, IJwtService jwtService)
{
this._httpClient = httpClient ??
throw new ArgumentNullException(nameof(httpClient));
//this._sessionStorage = sessionStorage ??
// throw new ArgumentNullException(nameof(sessionStorage));
//this._localStorage = localStorage ??
// throw new ArgumentNullException(nameof(localStorage));
this._jwtService = jwtService ??
throw new ArgumentNullException(nameof(jwtService));
}
//Метод GetAuthenticationStateAsync вызывается компонентом CascadingAuthenticationState, чтобы определить,
//аутентифицирован ли текущий пользователь или нет.
public override async Task<AuthenticationState> GetAuthenticationStateAsync()
{
Console.WriteLine($"Client.ApiAuthenticationStateProvider.GetAuthenticationStateAsync() : start");
//if (this._sessionStorage == null)
//{
// Console.WriteLine($"Client.ApiAuthenticationStateProvider.GetAuthenticationStateAsync() : _sessionStorage is null");
// Console.WriteLine($"Client.ApiAuthenticationStateProvider.GetAuthenticationStateAsync() : end");
// return new AuthenticationState(new ClaimsPrincipal());
//}
//if (this._localStorage == null)
//{
// Console.WriteLine($"Client.ApiAuthenticationStateProvider.GetAuthenticationStateAsync() : _localStorage is null");
// Console.WriteLine($"Client.ApiAuthenticationStateProvider.GetAuthenticationStateAsync() : end");
// return new AuthenticationState(new ClaimsPrincipal());
//}
//try
//{
//var savedToken = await this._sessionStorage.GetItemAsync<string>(SessionStorageKey.authToken);
//string authenticationWebapiUrl = await this._localStorage.GetItemAsync<string>(SessionStorageKey.authenticationWebapiUrl);
//// мы проверяем, есть ли токен аутентификации в локальном хранилище.Если есть, мы извлекаем его
////и устанавливаем заголовок авторизации по умолчанию для HttpClient.
//if (!string.IsNullOrWhiteSpace(savedToken))
//{
// this._httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("bearer", savedToken);
//}
//if (string.IsNullOrWhiteSpace(authenticationWebapiUrl) == true)
//{
// Console.WriteLine($"Client.ApiAuthenticationStateProvider.GetAuthenticationStateAsync() : ERROR Authentication Server Url is Empty. Can't get user from Server");
// Console.WriteLine($"Client.ApiAuthenticationStateProvider.GetAuthenticationStateAsync() : end");
// return new AuthenticationState(new ClaimsPrincipal());
//}
//string requestPing = Opetarion.UrlCombine(authenticationWebapiUrl, Common.Urls.WebApiAuthenticationPing.GetPing);
//Console.WriteLine($"Client.ApiAuthenticationStateProvider.GetAuthenticationStateAsync() : request {requestPing}");
//try
//{
// var resultPing = await this._httpClient.GetFromJsonAsync<string>(requestPing);
//}
//catch (Exception ecx) when (LogError(ecx))
//{
// Console.WriteLine($"Client.ApiAuthenticationStateProvider.GetAuthenticationStateAsync() : can't ping Authentication Server");
// Console.WriteLine(ecx.Message);
// Console.WriteLine($"Client.ApiAuthenticationStateProvider.GetAuthenticationStateAsync() : end");
// return new AuthenticationState(new ClaimsPrincipal());
//}
//Затем мы делаем вызов конечной точке GetUser, которую мы видели ранее на контроллере учетных записей.
//string request = Opetarion.UrlCombine(authenticationWebapiUrl, WebApiAuthenticationAccounts.GetUser);
//Console.WriteLine($"Client.ApiAuthenticationStateProvider.GetAuthenticationStateAsync() : request {request}");
//UserModel userInfo = await this._httpClient.GetFromJsonAsync<UserModel>(request); //"api/accounts/user");
//if (userInfo == null)
//{
// Console.WriteLine($"Client.ApiAuthenticationStateProvider.GetAuthenticationStateAsync() : userInfo is null. Can't get from Server");
// Console.WriteLine($"Client.ApiAuthenticationStateProvider.GetAuthenticationStateAsync() : end");
// return new AuthenticationState(new ClaimsPrincipal());
//}
//Если токен все еще действителен, то мы получим ответ, указывающий, что пользователь аутентифицирован,
//и мы можем затем создать новый принципал заявок с информацией о текущих пользователях.
//Если токен в локальном хранилище отсутствует или токен больше не действителен,
//то мы создаем пустой субъект заявок. Это эквивалентно тому, что текущий пользователь не аутентифицирован.
// 1 версия
//var identity = userInfo.IsAuthenticated
// ? new ClaimsIdentity(new[] { new Claim(ClaimTypes.Name, userInfo.Email) }, "apiauth")
// : new ClaimsIdentity();
// 2 версия
// var identity = userInfo.IsAuthenticated ? new ClaimsIdentity(this._jwtService.ParseClaimsFromJwt(savedToken), "jwt") : new ClaimsIdentity();
// Console.WriteLine($"Client.ApiAuthenticationStateProvider.GetAuthenticationStateAsync() : end");
// return new AuthenticationState(new ClaimsPrincipal(identity));
//}
//catch (Exception exc) when (LogError(exc))
//{
// Console.WriteLine($"Client.ApiAuthenticationStateProvider.GetAuthenticationStateAsync() Exception ");
// Console.WriteLine(exc.Message);
// Console.WriteLine($"Client.ApiAuthenticationStateProvider.GetAuthenticationStateAsync() : end with Exception");
return new AuthenticationState(new ClaimsPrincipal());
//}
}
//MarkUserAsAuthenticated - это вспомогательный метод, который используется при входе пользователя в систему.
//Его единственная цель - вызвать метод NotifyAuthenticationStateChanged, который вызывает событие AuthenticationStateChanged.
//Это каскадирует новое состояние аутентификации через компонент CascadingAuthenticationState.
public void MarkUserAsAuthenticated(string token)
{
//1 версия
//var authenticatedUser = new ClaimsPrincipal(new ClaimsIdentity(new[] { new Claim(ClaimTypes.Name, email) }, "apiauth"));
//2 версия
Console.WriteLine($"Client.ApiAuthenticationStateProvider.MarkUserAsAuthenticated() : start");
if (string.IsNullOrWhiteSpace(token) == true)
Console.WriteLine("Client.ApiAuthenticationStateProvider.MarkUserAsAuthenticated() : token is empty");
try
{
var authenticatedUser = new ClaimsPrincipal(new ClaimsIdentity(this._jwtService.ParseClaimsFromJwt(token), "jwt"));
if (authenticatedUser == null)
Console.WriteLine("Client.ApiAuthenticationStateProvider.MarkUserAsAuthenticated() : authenticatedUser is null");
var authState = Task.FromResult(new AuthenticationState(authenticatedUser));
this.NotifyAuthenticationStateChanged(authState);
Console.WriteLine($"Client.ApiAuthenticationStateProvider.MarkUserAsAuthenticated() : end");
}
catch (Exception exc) when (LogError(exc))
{
Console.WriteLine("Client.ApiAuthenticationStateProvider.MarkUserAsAuthenticated() Exception : ");
Console.WriteLine(exc.Message);
Console.WriteLine($"Client.ApiAuthenticationStateProvider.MarkUserAsAuthenticated() : end with Exception");
}
}
//Как вы можете ожидать, MarkUserAsLoggedOut делает почти то же самое, что и предыдущий метод,
//но когда пользователь выходит из системы.
public void MarkUserAsLoggedOut()
{
Console.WriteLine($"Client.ApiAuthenticationStateProvider.MarkUserAsLoggedOut() : start");
try
{
var anonymousUser = new ClaimsPrincipal(new ClaimsIdentity());
var authState = Task.FromResult(new AuthenticationState(anonymousUser));
this.NotifyAuthenticationStateChanged(authState);
}
catch (Exception exc) when (LogError(exc))
{
Console.WriteLine("Client.ApiAuthenticationStateProvider.MarkUserAsLoggedOut() Exception : ");
Console.WriteLine(exc.Message);
Console.WriteLine($"Client.ApiAuthenticationStateProvider.MarkUserAsLoggedOut() : end with Exception");
}
Console.WriteLine($"Client.ApiAuthenticationStateProvider.MarkUserAsLoggedOut() : end");
}
public async Task<IEnumerable<Claim>> GetClaimsFromTokenAsync()
{
Console.WriteLine($"Client.ApiAuthenticationStateProvider.GetClaimsFromTokenAsync() : start");
//if (this._sessionStorage == null)
//{
// Console.WriteLine($"Client.ApiAuthenticationStateProvider.GetClaimsFromTokenAsync() : _sessionStorage is null");
// Console.WriteLine($"Client.ApiAuthenticationStateProvider.GetClaimsFromTokenAsync() : end");
// return new List<Claim>();
//}
//try
//{
// var savedToken = await this._sessionStorage.GetItemAsync<string>(SessionStorageKey.authToken);
// var authenticatedUser = new ClaimsPrincipal(new ClaimsIdentity(this._jwtService.ParseClaimsFromJwt(savedToken), "jwt"));
// Console.WriteLine($"Client.ApiAuthenticationStateProvider.GetClaimsFromTokenAsync() : end");
// if (authenticatedUser == null)
// return new List<Claim>();
// return authenticatedUser.Claims;
//}
//catch (Exception exc) when (LogError(exc))
//{
// Console.WriteLine("Client.ApiAuthenticationStateProvider.GetClaimsFromTokenAsync() Exception : ");
// Console.WriteLine(exc.Message);
// Console.WriteLine($"Client.ApiAuthenticationStateProvider.GetClaimsFromTokenAsync() : end with Exception");
return new List<Claim>();
//}
}
//public ClaimsPrincipal GetClaimsPrincipalFromToken(string savedToken)
//{
// ClaimsPrincipal authenticatedUser = new ClaimsPrincipal(new ClaimsIdentity(ParseClaimsFromJwt(savedToken), "jwt"));
// return authenticatedUser;
//}
static bool LogError(Exception ex)
{
return true;
}
}
}
| 49.08 | 185 | 0.760935 | [
"MIT"
] | parad74/Count4U.Service.5 | src/Count4U.Client.Shared_test/Service/Infrastructure/ApiAuthenticationStateProvider.cs | 12,394 | C# |
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Runtime.InteropServices;
internal static partial class Interop
{
public static partial class UxTheme
{
[DllImport(Libraries.UxTheme, CharSet = CharSet.Unicode, ExactSpelling = true)]
public unsafe static extern HRESULT GetThemeString(IntPtr hTheme, int iPartId, int iStateId, int iPropId, char* pszBuff, int cchMaxBuffChars);
public unsafe static HRESULT GetThemeString(IHandle hTheme, int iPartId, int iStateId, int iPropId, char* pszBuff, int cchMaxBuffChars)
{
HRESULT hr = GetThemeString(hTheme.Handle, iPartId, iStateId, iPropId, pszBuff, cchMaxBuffChars);
GC.KeepAlive(hTheme);
return hr;
}
}
}
| 40.130435 | 150 | 0.71506 | [
"MIT"
] | Amy-Li03/winforms | src/System.Windows.Forms.Primitives/src/Interop/UxTheme/Interop.GetThemeString.cs | 925 | C# |
/* BoutDuTunnel Copyright (c) 2006-2019 Sebastien Lebreton
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.Net.Sockets;
using Bdt.Server.Resources;
using Bdt.Shared.Logs;
namespace Bdt.Server.Service
{
internal class TunnelConnection : TimeoutObject
{
public string Address { get; set; }
public int Port { get; set; }
public string Host { get; set; }
public TcpClient TcpClient { get; set; }
public NetworkStream Stream { get; set; }
public int ReadCount { get; set; }
public int WriteCount { get; set; }
public TunnelConnection(int timeoutdelay) : base(timeoutdelay)
{
}
protected override void Timeout(ILogger logger)
{
logger.Log(this, string.Format(Strings.CONNECTION_TIMEOUT, TcpClient.Client.RemoteEndPoint), ESeverity.INFO);
SafeDisconnect();
}
public void SafeDisconnect()
{
try
{
if (Stream != null)
{
Stream.Flush();
Stream.Close();
}
}
// ReSharper disable EmptyGeneralCatchClause
catch (Exception)
{
}
// ReSharper restore EmptyGeneralCatchClause
try
{
TcpClient?.Close();
}
// ReSharper disable EmptyGeneralCatchClause
catch (Exception)
{
}
// ReSharper restore EmptyGeneralCatchClause
Stream = null;
TcpClient = null;
}
}
}
| 28.25 | 112 | 0.740708 | [
"MIT"
] | Luciker/Bdtunnel | Bdt.Server/Service/TunnelConnection.cs | 2,260 | C# |
// MathTypeSDK.cs --- Copyright (c) 2008-2010 by Design Science, Inc.
// Purpose:
// $Header: /MathType/Windows/SDK/DotNET/MTSDKDN/MTSDKDN/MathTypeSDK.cs 7 4/07/10 11:00a Jimm $
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text;
namespace MTSDKDN
{
#region MathType SDK Types
[StructLayout(LayoutKind.Sequential)]
public struct MTAPI_PICT
{
public long _mm;
public long _xExt;
public long _yExt;
public long _hMF;
public MTAPI_PICT(long mm, long xExt, long yExt, long hMF)
{
_mm = mm;
_xExt = xExt;
_yExt = yExt;
_hMF = hMF;
}
}
[StructLayout(LayoutKind.Sequential)]
public struct RECT
{
public long _left;
public long _top;
public long _right;
public long _bottom;
public RECT(long left, long top, long right, long bottom)
{
_left = left;
_top = top;
_right = right;
_bottom = bottom;
}
}
[StructLayout(LayoutKind.Sequential)]
public struct MTAPI_DIMS
{
public int _baseline;
public RECT _bounds;
public MTAPI_DIMS(int baseline, ref RECT bounds)
{
_baseline = baseline;
_bounds._left = bounds._left;
_bounds._top = bounds._top;
_bounds._right = bounds._right;
_bounds._bottom = bounds._bottom;
}
}
#endregion MathType SDK Types
#region MathType Constants
// Error codes returned by most API's
public sealed class MathTypeReturnValue
{
public const short mtOK = 0; // no error
public const short mtNOT_FOUND = -1; // trouble finding the MT erver, usually indicates a bad session ID
public const short mtCANT_RUN = -2; // could not start the MT server
public const short mtBAD_VERSION = -3; // server / DLL version mismatch
public const short mtIN_USE = -4; // server is busy/in-use
public const short mtNOT_RUNNING = -5; // server aborted
public const short mtRUN_TIMEOUT = -6; // connection to the server failed due to time-out
public const short mtNOT_EQUATION = -7; // an API call that expects an equation could not find one
public const short mtFILE_NOT_FOUND = -8; // a preference, translator or other file could not be found
public const short mtMEMORY = -9; // a buffer too small to hold the result of an API call was passed in
public const short mtBAD_FILE = -10; // file found was not a translator
public const short mtDATA_NOT_FOUND = -11; // unable to read preferences from MTEF on the clipboard
public const short mtTOO_MANY_SESSIONS = -12; // too many open connections to the SDK
public const short mtSUBSTITUTION_ERROR = -13; // problem with substition error during a call to MTXFormEqn
public const short mtTRANSLATOR_ERROR = -14; // there was an error in compiling or in execution of a translator
public const short mtPREFERENCE_ERROR = -15; // could not set preferences
public const short mtBAD_PATH = -16; // a bad path was encountered when trying to write to a file
public const short mtFILE_ACCESS = -17; // a file could not be written to
public const short mtFILE_WRITE_ERROR = -18; // a file could not be written to
public const short mtBAD_DATA = -19; // (deprecated)
public const short mtERROR = -9999; // other error
}
public sealed class MTXFormSetTranslator
{
// options values for MTXFormSetTranslator
public const short mtxfmTRANSL_INC_NONE = 0; // include neither the translator name nor equation data in output
public const short mtxfmTRANSL_INC_NAME = 1; // include the translator's name in translator output
public const short mtxfmTRANSL_INC_DATA = 2; // include MathType equation data in translator output
public const short mtxfmTRANSL_INC_MTDEFAULT = 4; // use defaults for translator name and equation data
// append 'Z' to text equations placed on clipboard
// kludge to fix Word's trailing CRLF truncation bug
public const short mtxfmTRANSL_INC_CLIPBOARD_EXTRA = 8;
}
public sealed class MTTranslatorInfo
{
// options values for MTGetTranslatorsInfo
public const short mttrnCOUNT = 1; // get the total number of translators
public const short mttrnMAX_NAME = 2; // maximum size of any translator name
public const short mttrnMAX_DESC = 3; // maximum size of any translator description string
public const short mttrnMAX_FILE = 4; // maximum size of any translator file name
public const short mttrnOPTIONS = 5; // get translation options
}
public sealed class MTXTranslatorPreference
{
// options values for MTXFormSetTranslator
public const short mtxfmPREF_EXISTING = 1; // use existing preferences
public const short mtxfmPREF_MTDEFAULT = 2; // use MathType's default preferences
public const short mtxfmPREF_USER = 3; // use specified preferences
public const short mtxfmPREF_LAST = 3; // (internal use)
}
public sealed class MTXFormStatus
{
// return values from MTXFormGetStatus
public const short mtxfmSTAT_ACTUAL_LEN = -1; // number of bytes of data actually returned in dstData (if MTXformEqn succeeded) or
// the number of bytes required (if MTXformEqn retuned mtMEMORY - not enough memory
// was specified for dstData), otherwise 0L.
public const short mtxfmSTAT_TRANSL = -2; // status for translation:
// mtOK - successful translation
// mtFILE_NOT_FOUND - could not find translator
// mtBAD_FILE - file found was not a translator
public const short mtxfmSTAT_PREF = -3; // status for set preferences:
// mtOK - sucess setting preferences
// mtSUBSTITUTION_ERROR - bad preference data
}
public sealed class MTXFormEqn
{
// see comment for MTXFormEqnMgn below, for a description of the following constants
// data sources/destinations for MTXFormEqn
public const short mtxfmPREVIOUS = -1;
public const short mtxfmCLIPBOARD = -2;
public const short mtxfmLOCAL = -3;
public const short mtxfmFILE = -4;
// data formats for MTXFormEqn
public const short mtxfmMTEF = 4;
public const short mtxfmHMTEF = 5;
public const short mtxfmPICT = 6;
public const short mtxfmTEXT = 7;
public const short mtxfmHTEXT = 8;
public const short mtxfmGIF = 9;
public const short mtxfmEPS_NONE = 10;
public const short mtxfmEPS_WMF = 11;
public const short mtxfmEPS_TIFF = 12;
}
public sealed class MTPreferences
{
// option values for MTSetMTPrefs
public const short mtprfMODE_NEXT_EQN = 1; // apply to next new equation
public const short mtprfMODE_MTDEFAULT = 2; // set MathType's defaults for new equations
public const short mtprfMODE_INLINE = 4; // makes next eqn inline
}
public sealed class MTXFormSubValues
{
// option values for MTXFormAddVarSub
public const short mtxfmSUBST_ALL = 0; // substitute all variables
public const short mtxfmSUBST_ONE = 1; // substitute one variable
// find/replace types for MTXFormAddVarSub substitutions
public const short mtxfmVAR_SUB_BAD = -1;
public const short mtxfmVAR_SUB_PLAIN_TEXT = 0;
public const short mtxfmVAR_SUB_MTEF_TEXT = 1;
public const short mtxfmVAR_SUB_MTEF_BINARY = 2;
public const short mtxfmVAR_SUB_DELETE = 3;
public const short mtxfmVAR_SUB_MAX = 4;
// replace styles for MTXFormAddVarSub substitutions where type = mtxfmVAR_SUB_PLAIN_TEXT
public const short mtxfmSTYLE_FIRST = 1;
public const short mtxfmSTYLE_TEXT = 1;
public const short mtxfmSTYLE_FUNCTION = 2;
public const short mtxfmSTYLE_VARIABLE = 3;
public const short mtxfmSTYLE_LCGREEK = 4;
public const short mtxfmSTYLE_UCGREEK = 5;
public const short mtxfmSTYLE_SYMBOL = 6;
public const short mtxfmSTYLE_VECTOR = 7;
public const short mtxfmSTYLE_NUMBER = 8;
public const short mtxfmSTYLE_LAST = 8;
}
public sealed class MTApiStartValues
{
public const short mtinitLAUNCH_AS_NEEDED = 0; // launch MathType when first needed
public const short mtinitLAUNCH_NOW = 1; // launch MathType server immediately
}
public sealed class MTClipboardEqnTypes
{
public const short mtOLE_EQUATION = 1; // equation OLE 1.0 object on clipboard
public const short mtWMF_EQUATION = 2; // Windows metafile equation graphic (not OLE object) on clipboard
public const short mtMAC_PICT_EQUATION = 4; // Macintosh PICT equation graphic (not OLE object) on clipboard
public const short mtOLE2_EQUATION = 8; // equation OLE 2.0 object on clipboard
}
public sealed class MTURLTypes
{
// option values for MTGetURL
public const short mturlMATHTYPE_HOME = 1; // for MathType Homepage (e.g. http:www.dessci.com/en/products/mathtype)
public const short mturlMATHTYPE_SUPPORT = 2; // for Online Support (e.g. http:www.dessci.com/en/support/mathtype)
public const short mturlMATHTYPE_FEEDBACK = 3; // for Feedback Email To (e.g. mailto:support@dessci.com)
public const short mturlMATHTYPE_ORDER = 4; // for Order MathType (e.g. http://www.dessci.com/en/store/mathtype/options.asp?prodId=MT)
public const short mturlMATHTYPE_FUTURE = 5; // for Future MathType (to be determined)
public const short mturlMATHTYPE_REGISTER = 6; // for registering MathType
}
public sealed class MTDimensionValues
{
// options value for MTGetLastDimension
// use the following to get a dimension from the last equation copied to the clipboard or written to a file
public const short mtdimFIRST = 1; // (internal use)
public const short mtdimWIDTH = 1; //
public const short mtdimHEIGHT = 2; //
public const short mtdimBASELINE = 3; //
public const short mtdimHORIZ_POS_TYPE = 4; //
public const short mtdimHORIZ_POS = 5; //
public const short mtdimLast = 5; // (internal use)
}
// clipboard formats
public sealed class ClipboardFormats
{
public const string cfNative = "Native";
public const string cfOwnerLink = "OwnerLink";
public const string cfRTF = "Rich Text Format";
public const string cfMTEF = "MathType EF";
public const string cfMacPICT = "Mac PICT";
public const string cfEmbedSrc = "Embed Source";
public const string cfObjDesc = "Object Descriptor";
public const string cfEmbeddedObj = "Embedded Object";
public const string cfMTMacro = "MathType Macro";
public const string cfHTML = "HTML Format";
public const string cfMTMacroPict = "MathType Macro PICT";
public const string cfMMLPres = "MathML Presentation";
public const string cfMML = "MathML";
public const string cfMMLXML = "application/mathml+xml";
public const string cfTeX = "TeX Input Language";
}
#endregion MathType Constants
public class MathTypeSDK
{
#region Singleton class
private static readonly MathTypeSDK instance = new MathTypeSDK();
private MathTypeSDK() { }
public static MathTypeSDK Instance
{
get { return instance; }
}
#endregion
#region MathType SDK Function Declarations
[DllImport("MT6.dll", CharSet = CharSet.Auto, PreserveSig = true, ExactSpelling = true, SetLastError = true)]
private static extern int MTAPIConnect(short mtStart, short timeout);
[DllImport("MT6.DLL", CharSet = CharSet.Auto, PreserveSig = true, ExactSpelling = true, SetLastError = true)]
private static extern int MTAPIVersion(ushort apiversion);
[DllImport("MT6.DLL", CharSet = CharSet.Auto, PreserveSig = true, ExactSpelling = true, SetLastError = true)]
private static extern int MTAPIDisconnect();
[DllImport("MT6.DLL", CharSet = CharSet.Auto, PreserveSig = true, ExactSpelling = true, SetLastError = true)]
private static extern int MTEquationOnClipboard();
[DllImport("MT6.DLL", CharSet = CharSet.Auto, PreserveSig = true, ExactSpelling = true, SetLastError = true)]
private static extern int MTClearClipboard();
[DllImport("MT6.DLL", CharSet = CharSet.Auto, PreserveSig = true, ExactSpelling = true, SetLastError = true)]
private static extern int MTGetLastDimension(short dimIndex);
[DllImport("MT6.DLL", CharSet = CharSet.Auto, PreserveSig = true, ExactSpelling = true, SetLastError = true)]
private static extern int MTOpenFileDialog(short fileType, [MarshalAs(UnmanagedType.LPStr)] string title, string dir, [MarshalAs(UnmanagedType.LPStr)] StringBuilder file, short fileLen);
[DllImport("MT6.DLL", CharSet = CharSet.Auto, PreserveSig = true, ExactSpelling = true, SetLastError = true)]
private static extern int MTGetPrefsFromClipboard([MarshalAs(UnmanagedType.LPStr)] StringBuilder prefs, short prefsLen);
[DllImport("MT6.DLL", CharSet = CharSet.Auto, PreserveSig = true, ExactSpelling = true, SetLastError = true)]
private static extern int MTGetPrefsFromFile([MarshalAs(UnmanagedType.LPStr)] string prefFile,
[MarshalAs(UnmanagedType.LPStr)] StringBuilder prefs, short prefsLen);
[DllImport("MT6.DLL", CharSet = CharSet.Auto, PreserveSig = true, ExactSpelling = true, SetLastError = true)]
private static extern int MTConvertPrefsToUIForm([MarshalAs(UnmanagedType.LPStr)] string inPrefs,
[MarshalAs(UnmanagedType.LPStr)] StringBuilder outPrefs, short outPrefsLen);
[DllImport("MT6.DLL", CharSet = CharSet.Auto, PreserveSig = true, ExactSpelling = true, SetLastError = true)]
private static extern int MTGetPrefsMTDefault([MarshalAs(UnmanagedType.LPStr)] StringBuilder prefs, short prefsLen);
[DllImport("MT6.DLL", CharSet = CharSet.Auto, PreserveSig = true, ExactSpelling = true, SetLastError = true)]
private static extern int MTSetMTPrefs(short mode, [MarshalAs(UnmanagedType.LPStr)] string prefs, short timeout);
[DllImport("MT6.DLL", CharSet = CharSet.Auto, PreserveSig = true, ExactSpelling = true, SetLastError = true)]
private static extern int MTGetTranslatorsInfo(short infoIndex);
[DllImport("MT6.DLL", CharSet = CharSet.Auto, PreserveSig = true, ExactSpelling = true, SetLastError = true)]
private static extern int MTEnumTranslators(short index, [MarshalAs(UnmanagedType.LPStr)] StringBuilder transName,
short transNameLen, [MarshalAs(UnmanagedType.LPStr)] StringBuilder transDesc, short transDescLen,
[MarshalAs(UnmanagedType.LPStr)] StringBuilder transFile, short transFileLen);
[DllImport("MT6.DLL", CharSet = CharSet.Auto, PreserveSig = true, ExactSpelling = true, SetLastError = true)]
private static extern int MTXFormReset();
[DllImport("MT6.DLL", CharSet = CharSet.Auto, PreserveSig = true, ExactSpelling = true, SetLastError = true)]
private static extern int MTXFormAddVarSub(short options, short findType, [MarshalAs(UnmanagedType.LPStr)] string find,
int findLen, short replaceType, [MarshalAs(UnmanagedType.LPStr)] string replace, int replaceLen, short replaceStyle);
[DllImport("MT6.DLL", CharSet = CharSet.Auto, PreserveSig = true, ExactSpelling = true, SetLastError = true)]
private static extern int MTXFormSetTranslator(ushort options, [MarshalAs(UnmanagedType.LPStr)] string transName);
[DllImport("MT6.DLL", CharSet = CharSet.Auto, PreserveSig = true, ExactSpelling = true, SetLastError = true)]
private static extern int MTXFormSetPrefs(short prefType, [MarshalAs(UnmanagedType.LPStr)] string prefStr);
[DllImport("MT6.dll", EntryPoint = "MTXFormEqn", ExactSpelling = false)]
private static extern int MTXFormEqn(
short src,
short srcFmt,
byte[] srcData,
int srcDataLen,
short dst,
short dstFmt,
System.Text.StringBuilder dstData,
int dstDataLen,
[MarshalAs(UnmanagedType.LPStr)] string dstPath,
ref MTAPI_DIMS dims);
[DllImport("MT6.dll", EntryPoint = "MTXFormEqn", ExactSpelling = false)]
private static extern int MTXFormEqn(
short src,
short srcFmt,
byte[] srcData,
int srcDataLen,
short dst,
short dstFmt,
IntPtr dstData,
int dstDataLen,
[MarshalAs(UnmanagedType.LPStr)] string dstPath,
ref MTAPI_DIMS dims);
[DllImport("MT6.DLL", CharSet = CharSet.Auto, PreserveSig = true, ExactSpelling = true, SetLastError = true)]
private static extern int MTXFormGetStatus(short index);
[DllImport("MT6.DLL", CharSet = CharSet.Auto, PreserveSig = true, ExactSpelling = true, SetLastError = true)]
private static extern int MTPreviewDialog(IntPtr parent, [MarshalAs(UnmanagedType.LPStr)] string title,
[MarshalAs(UnmanagedType.LPStr)] string prefs, [MarshalAs(UnmanagedType.LPStr)] string closeBtnText,
[MarshalAs(UnmanagedType.LPStr)] string helpBtnText, int helpID, [MarshalAs(UnmanagedType.LPStr)] string helpFile);
[DllImport("MT6.DLL", CharSet = CharSet.Auto, PreserveSig = true, ExactSpelling = true, SetLastError = true)]
private static extern int MTShowAboutBox();
[DllImport("MT6.DLL", CharSet = CharSet.Auto, PreserveSig = true, ExactSpelling = true, SetLastError = true)]
private static extern int MTGetURL(int whichURL, bool bGoToURL, [MarshalAs(UnmanagedType.LPStr)] StringBuilder strURL, int sizeURL);
#endregion MathType SDK Functions
#region Kernel32 function calls
[DllImport("kernel32.dll", CharSet = CharSet.Auto, ExactSpelling = true, SetLastError = true)]
public static extern IntPtr GlobalLock(HandleRef handle);
[DllImport("kernel32.dll", CharSet = CharSet.Auto, ExactSpelling = true, SetLastError = true)]
public static extern bool GlobalUnlock(HandleRef handle);
[DllImport("kernel32.dll", CharSet = CharSet.Auto, ExactSpelling = true, SetLastError = true)]
public static extern int GlobalSize(HandleRef handle);
#endregion Kernel32 function calls
#region MathType SDK Function Wrappers
/// <summary>
///
/// </summary>
/// <param name="mtStart">mtinitLAUNCH_NOW => launch MathType server immediately
/// mtinitLAUNCH_AS_NEEDED => launch MathType when first needed</param>
/// <param name="timeout"># of seconds to wait before timing out when attempting to
/// launch MathType. If timeOut = -1 then will never timeout.
/// This value is eventually passed to RPCConnectToServer
/// where it is not currently used</param>
/// <returns></returns>
public int MTAPIConnectMgn(short mtStart, short timeout)
{
int retCode = MathTypeReturnValue.mtOK;
retCode = MTAPIConnect(mtStart, timeout);
return retCode;
}
/// <summary>
/// Which version of the API is set.
/// </summary>
/// <param name="apiversion">Set the version of the API</param>
/// <returns>0 if API set unknown or hi-byte (of lo-word) = major version,
/// lo-byte (of lo-word) = minor version</returns>
public int MTAPIVersionMgn(ushort apiversion)
{
int retCode = MathTypeReturnValue.mtOK;
retCode = MTAPIVersion(apiversion);
return retCode;
}
/// <summary>
/// Disconnect the current instance of the running API server.
/// </summary>
/// <returns></returns>
public int MTAPIDisconnectMgn()
{
int retCode = MathTypeReturnValue.mtOK;
retCode = MTAPIDisconnect();
return retCode;
}
/// <summary>
/// Check for the type of equation on the clipboard, if any
/// </summary>
/// <returns>If equation on the clipboard, returns type of eqn data:
/// mtOLE_EQUATION, mtWMF_EQUATION, mtMAC_PICT_EQUATION,
/// Otherwise status value
/// mtNOT_EQUATION - no eqn on clipboard
/// mtMEMORY - insufficient memory for prog ID
/// mtERROR - any other error</returns>
public int MTEquationOnClipboardMgn()
{
int retCode = MathTypeReturnValue.mtOK;
retCode = MTEquationOnClipboard();
return retCode;
}
/// <summary>
/// clear the clipboard contents
/// </summary>
/// <returns>mtOK - everything was successful</returns>
public int MTClearClipboardMgn()
{
int retCode = MathTypeReturnValue.mtOK;
retCode = MTClearClipboard();
return retCode;
}
/// <summary>
/// Get a dimension from the last equation copied to the clipboard or written
/// to a file.
/// </summary>
/// <param name="dimIndex">desired dimension (mtdimXXXX)</param>
/// <returns>If successful (>0), value of desired dimension in 32nds of a point
/// Otherwise, error status
/// mtNOT_EQUATION - no equation to take dimension from
/// mtERROR - bad value for whichDim</returns>
public int MTGetLastDimensionMgn(short dimIndex)
{
int retCode = MathTypeReturnValue.mtOK;
retCode = MTGetLastDimension(dimIndex);
return retCode;
}
/// <summary>
/// Put up an open file dialog (Win32 only)
/// Calls GetForegroundWindow for parent, upon which it gets centered
/// </summary>
/// <param name="fileType"> 1 for MT preference files</param>
/// <param name="title">dialog window title</param>
/// <param name="dir">default directory (may be empty or NULL)</param>
/// <param name="file">result: new filename</param>
/// <param name="fileLen">maximum number of characters in filename</param>
/// <returns>Returns 1 for OK, 0 for Cancel</returns>
public int MTOpenFileDialogMgn(short fileType, string title, string dir, StringBuilder file, short fileLen)
{
int retCode = MathTypeReturnValue.mtOK;
retCode = MTOpenFileDialog(fileType, title, dir, file, fileLen);
return retCode;
}
/// <summary>
/// Get equation preferences from the MathType equation that is currently
/// on the clipboard
/// </summary>
/// <param name="prefs">[out] Preference string (if sizeStr > 0)</param>
/// <param name="prefsLen">[in] Size of prefStr (inc. null) or 0</param>
/// <returns>If sizeStr == 0 then this is the size required for prefStr,
/// Otherwise it's a status
/// mtOK Success
/// mtMEMORY Not enough memory for to store preferences
/// mtNOT_EQUATION Not equation on clipboard
/// mtBAD_VERSION No preference data found in equation
/// mtERROR Other error</returns>
public int MTGetPrefsFromClipboardMgn(StringBuilder prefs, short prefsLen)
{
int retCode = MathTypeReturnValue.mtOK;
retCode = MTGetPrefsFromClipboard(prefs, prefsLen);
return retCode;
}
/// <summary>
/// Get equation preferences from the specified preferences file
/// </summary>
/// <param name="prefFile">[in] Pathname for the preference file</param>
/// <param name="prefs">[out] Preference string (if sizeStr > 0)</param>
/// <param name="prefsLen">[in] Size of prefStr or 0 </param>
/// <returns>If sizeStr == 0 then this is the size required for prefStr,
/// Otherwise it's a status
/// mtOK Success
/// mtMEMORY Not enough memory for to store preferences
/// mtFile_NOT_FOUND File does not exist or bad pathname
/// mtERROR Other error</returns>
public int MTGetPrefsFromFileMgn(string prefFile, StringBuilder prefs, short prefsLen)
{
int retCode = MathTypeReturnValue.mtOK;
retCode = MTGetPrefsFromFile(prefFile, prefs, prefsLen);
return retCode;
}
/// <summary>
/// Convert internal preferences string to a form to be presented to the user
/// </summary>
/// <param name="inPrefs">[in] internal preferences string</param>
/// <param name="outPrefs">[out] Preference string (if sizeStr > 0)</param>
/// <param name="outPrefsLen">[in] Size of outPrefStr (inc. null) or 0 to get length</param>
/// <returns>If outPrefsLen == 0 then this is the size required for outPrefStr, else it's a status
/// mtOK Success
/// mtMEMORY Not enough memory for to store preferences
/// mtERROR Other error</returns>
public int MTConvertPrefsToUIFormMgn(string inPrefs, StringBuilder outPrefs, short outPrefsLen)
{
int retCode = MathTypeReturnValue.mtOK;
retCode = MTConvertPrefsToUIForm(inPrefs, outPrefs, outPrefsLen);
return retCode;
}
/// <summary>
/// Get MathType's current default equation preferences
/// </summary>
/// <param name="prefs">[out] Preference string (if sizeStr > 0)</param>
/// <param name="prefsLen">[in] Size of prefStr or 0</param>
/// <returns>If sizeStr == 0 then this is the size required for prefStr,
/// Otherwise it's a status
/// mtOK Success
/// mtMEMORY Not enough memory for to store preferences
/// mtERROR Other error</returns>
public int MTGetPrefsMTDefaultMgn(StringBuilder prefs, short prefsLen)
{
int retCode = MathTypeReturnValue.mtOK;
retCode = MTGetPrefsMTDefault(prefs, prefsLen);
return retCode;
}
/// <summary>
/// Set MathType's default peferences for new equations
/// </summary>
/// <param name="mode">[in] Specifies the way the preferences will be applied
/// mtprfMODE_NEXT_EQN => Apply to next new equation (see timeOut)
/// mtprfMODE_MTDEFAULT => Set MathType's defaults for new equations
/// mtprfMODE_INLINE => makes next eqn inline</param>
/// <param name="prefs">[in] Null terminated preference string</param>
/// <param name="timeout">[in] Number of seconds to wait for new equation (used only
/// when mode = 1), Note: -1 means wait forever</param>
/// <returns>mtOK Success,
/// mtBAD_DATA Bad pref string,
/// mtERROR Any other error</returns>
public int MTSetMTPrefsMgn(short mode, string prefs, short timeout)
{
int retCode = MathTypeReturnValue.mtOK;
retCode = MTSetMTPrefs(mode, prefs, timeout);
return retCode;
}
/// <summary>
/// Get information about the current set of translators
/// </summary>
/// <param name="infoIndex">[In] A flag indicating what info to return:
/// 1 => Total number of translators
/// 2 => Maximum size of any translator name
/// 3 => Maximum size of any translator description string
/// 4 => Maximum size of any translator file name </param>
/// <returns>If >= 0 then this value is the information specified by infoID
/// Otherwise its a status
/// mtERROR Bad value for infoID</returns>
public int MTGetTranslatorsInfoMgn(short infoIndex)
{
int retCode = MathTypeReturnValue.mtOK;
retCode = MTGetTranslatorsInfo(infoIndex);
return retCode;
}
/// <summary>
/// Enumerate the available equation (TeX, etc.) translators
/// </summary>
/// <param name="index">[in] Index of the translator to enumerate
/// (Must be initialized to 1 by the caller)</param>
/// <param name="transName">[out] Translator name</param>
/// <param name="transNameLen">[in] Size of tShort. (May be set to zero)</param>
/// <param name="transDesc">[out] Translator descriptor string</param>
/// <param name="transDescLen">[in] Size of transDesc. (May be set to zero)</param>
/// <param name="transFile">[out] Translator file name</param>
/// <param name="transFileLen">[in] Size of transFile. (May be set to zero)</param>
/// <returns>If >0 then this value is the index of next translator to enumerate,
/// (i.e. the caller should pass this value in for indx - def below)
/// Otherwise, a status
/// mtOK Success (no more translators in the list)
/// mtMEMORY Not enough room in transName, transDesc, or transFile
/// mtERROR Any other failure</returns>
public int MTEnumTranslatorsMgn(short index, StringBuilder transName, short transNameLen, StringBuilder transDesc,
short transDescLen, StringBuilder transFile, short transFileLen)
{
int retCode = MathTypeReturnValue.mtOK;
retCode = MTEnumTranslators(index, transName, transNameLen, transDesc, transDescLen, transFile, transFileLen);
return retCode;
}
/// <summary>
/// Resets to default options for MTXformEqn (i.e. no substitutions, no
/// translation, and use existing preferences)
/// </summary>
/// <returns>Only returns mtOK</returns>
public int MTXFormResetMgn()
{
int retCode = MathTypeReturnValue.mtOK;
retCode = MTXFormReset();
return retCode;
}
/// <summary>
/// Specify a variable substitution to be performed with next MTXformEqn
/// (may be called 0 or more times).
/// </summary>
/// <param name="options">mtxfmSUBST_ALL or mtxfmSUBST_ONE</param>
/// <param name="findType">type of data in find arg (must be mtxfmVAR_SUB_PLAIN_TEXT for now)</param>
/// <param name="find">equation text to be found and replaced (null-terminated text string for now)</param>
/// <param name="findLen">length of find arg data (ignored for now)</param>
/// <param name="replaceType">type of data in replace arg (mtxfmVAR_SUB_XXX; mtxfmVAR_SUB_DELETE to delete find)</param>
/// <param name="replace">equation text to replace find arg</param>
/// <param name="replaceLen">iff replaceType = mtxfmVAR_SUB_MTEF_BINARY, length of replace arg data</param>
/// <param name="replaceStyle">if replaceType = mtxfmVAR_SUB_PLAIN_TEXT, style (fnXXXX)</param>
/// <returns>mtOK - success
/// mtERROR - some other error</returns>
public int MTXFormAddVarSubMgn(short options, short findType, string find, int findLen, short replaceType, string replace, int replaceLen, short replaceStyle)
{
int retCode = MathTypeReturnValue.mtOK;
retCode = MTXFormAddVarSub(options, findType, find, findLen, replaceType, replace, replaceLen, replaceStyle);
return retCode;
}
/// <summary>
/// Specify translation to be performed with the next MTXformEqn.
/// </summary>
/// <param name="options">[in] One or more (OR'd together) of:
/// mtxfmTRANS_INC_NAME include the translator's name in
/// translator output
/// mtxfmTRANS_INC_EQN include MathType equation data in
/// translator output</param>
/// <param name="transName">[in] File name of translator to be used,
/// NULL for no translation</param>
/// <returns>mtOK - success
/// mtFILE_NOT_FOUND - could not find translator
/// mtTRANSLATOR_ERROR - errors compiling translator
/// mtERROR - some other error</returns>
public int MTXFormSetTranslatorMgn(ushort options, string transName)
{
int retCode = MathTypeReturnValue.mtOK;
retCode = MTXFormSetTranslator(options, transName);
return retCode;
}
/// <summary>
/// Specify a new set of preferences to be used with the next MTXformEqn.
/// </summary>
/// <param name="prefType">[in] One of the following,
/// mtxfmPREF_EXISTING - use existing preferences
/// mtxfmPREF_MTDEFAULT - use MathType's default preferences
/// mtxfmPREF_USER - use specified preferences</param>
/// <param name="prefStr">[in] Preferences to apply (mtxfmPREF_USER)</param>
/// <returns>mtOK if the preference is set, else mtERROR</returns>
public int MTXFormSetPrefsMgn(short prefType, string prefStr)
{
int retCode = MathTypeReturnValue.mtOK;
retCode = MTXFormSetPrefs(prefType, prefStr);
return retCode;
}
/// <summary>
/// Transform an equation (uses options specified via MTXAddVarSubst,
/// MTXSetTrans, and MTXSetPrefs)
/// Note: Variations involving mtxform_SRC_PICT, mtxform_DST_PICT, or
/// mtxform_DST_HMTEF are not callable via Word Basic.
/// </summary>
/// <param name="src">[in] Equation data source, either
/// mtxfmPREVIOUS => data from previous result
/// mtxfmCLIPBOARD => data on clipboard
/// mtxfmLOCAL => data passed (i.e. in srcData)</param>
/// <param name="srcFmt">[in] Equation source data format (mtxfmXXX, see next)
/// Note: srcFmt, srcData, and srcDataLen are used only
/// if src is mtfxmLOCAL</param>
/// <param name="srcData">[in] Depends on data source (src)
/// mtxfmMTEF => ptr to MTEF-binary (BYTE *)
/// mtxfmPICT => ptr to pict (MTAPI_PICT *)
/// mtxfmTEXT => ptr to text (CHAR *), either MTEF-text or plain text</param>
/// <param name="srcDataLen">[in] # of bytes in srcData</param>
/// <param name="dst">[in] Equation data destination, either
/// mtxfmCLIPBOARD => transformed data placed on clipboard
/// mtxfmLOCAL => transformed data in dstData
/// mtxfmFILE => transformed data in the file specified by dstPath</param>
/// <param name="dstFmt">[in] Equation data format (mtxfmXXX, see next)
/// Note: dstFmt, dstData, and dstDataLen are used only
/// if dst is mtfxmLOCAL (data placed on the clipboard
/// is either an OLE object or translator text)</param>
/// <param name="dstData">[out] Depends on data destination (dstFmt)
/// mtxfmMTEF => ptr to MTEF-binary (BYTE *)
/// mtxfmHMTEF => ptr to handle to MTEF-binary (HANDLE *)
/// mtxfmPICT => ptr to pict data (MTAPI_PICT *)
/// mtxfmTEXT => ptr to translated text or, if no translator, MTEF-text (CHAR *)
/// mtxfmHTEXT => ptr to handle to translated text or, if no translator, MTEF-text (HANDLE *)
/// Note: If translator specified dst must be either
/// mtxfmTEXT or mtxfmHTEXT for the translation to be performed[out] Depends on data destination (dstFmt)
/// mtxfmMTEF => ptr to MTEF-binary (BYTE *)
/// mtxfmHMTEF => ptr to handle to MTEF-binary (HANDLE *)
/// mtxfmPICT => ptr to pict data (MTAPI_PICT *)
/// mtxfmTEXT => ptr to translated text or, if no translator, MTEF-text (CHAR *)
/// mtxfmHTEXT => ptr to handle to translated text or, if no translator, MTEF-text (HANDLE *)
/// Note: If translator specified dst must be either
/// mtxfmTEXT or mtxfmHTEXT for the translation to be performed</param>
/// <param name="dstDataLen">[in] # of bytes in dstData (used for mtxfmLOCAL only)</param>
/// <param name="dstPath">[in] destination pathname (used if dst == mtxfmFILE only, may be NULL if not used)</param>
/// <param name="dims">[out] pict dimensions, may be NULL (valid only for
/// dst = mtxfmPICT)</param>
/// <returns>mtOK - success
/// mtNOT_EQUATION - source data does not contain MTEF
/// mtSUBSTITUTION_ERROR - could not perform one or more subs
/// mtTRANSLATOR_ERROR - errors occured during translation
/// (translation not done)
/// mtPREFERENCE_ERROR - could not set perferences
/// mtMEMORY - not enough space in dstData
/// mtERROR - some other error </returns>
public int MTXFormEqnMgn(
short src,
short srcFmt,
byte[] srcData,
int srcDataLen,
short dst,
short dstFmt,
System.Text.StringBuilder dstData,
int dstDataLen,
string dstPath,
ref MTAPI_DIMS dims)
{
int retCode = MathTypeReturnValue.mtOK;
retCode = MTXFormEqn(src, srcFmt, srcData, srcDataLen, dst, dstFmt, dstData, dstDataLen, dstPath, ref dims);
return retCode;
}
public int MTXFormEqnMgn(
short src,
short srcFmt,
byte[] srcData,
int srcDataLen,
short dst,
short dstFmt,
IntPtr dstData,
int dstDataLen,
string dstPath,
ref MTAPI_DIMS dims)
{
int retCode = MathTypeReturnValue.mtOK;
retCode = MTXFormEqn(src, srcFmt, srcData, srcDataLen, dst, dstFmt, dstData, dstDataLen, dstPath, ref dims);
return retCode;
}
/// <summary>
/// Check error/status after XformEqn
/// </summary>
/// <param name="index">[in] which status to get; described above</param>
/// <returns>Depends on the value of 'which', as follows:
/// which = mtxfmSTAT_PREF, status for set preferences
/// mtOK - sucess setting preferences
/// mtBAD_DATA - bad preference data
/// which = mtxfmSTAT_TRANSL, status for translation
/// mtOK - successful translation
/// mtFILE_NOT_FOUND - could not find translator
/// mtBAD_FILE - file found was not a translator
/// which = mtxfmSTAT_ACTUAL_LEN, number of bytes of data
/// actually returned in dstData (if MTXformEqn succeeded) or
/// the number of bytes required (if MTXformEqn retuned
/// mtMEMORY - not enough memory was specified for dstData),
/// otherwise 0L.
/// which >= 1, status of the i-th (i = which)
/// variable substitution, either # of times the
/// substitution was performed, or, if < 0, an error status
///
/// NOTE: returns mtERROR for bad values of which</returns>
public int MTXFormGetStatusMgn(Int16 index)
{
int retCode = MathTypeReturnValue.mtOK;
retCode = MTXFormGetStatus(index);
return retCode;
}
/// <summary>
/// Puts up a preview dialog for displaying preferences
/// </summary>
/// <param name="parent">parent window</param>
/// <param name="title">dialog title</param>
/// <param name="prefs">text to preview</param>
/// <param name="closeBtnText">text for Close button (can be NULL for English)</param>
/// <param name="helpBtnText">text for Help button (can be NULL for English)</param>
/// <param name="helpID">Help topic ID</param>
/// <param name="helpFile">help file</param>
/// <returns>returns 0 if successful, non-zero if error</returns>
public int MTPreviewDialogMgn(IntPtr parent, string title, string prefs, string closeBtnText, string helpBtnText, int helpID, string helpFile)
{
int retCode = MathTypeReturnValue.mtOK;
retCode = MTPreviewDialog(parent, title, prefs, closeBtnText, helpBtnText, helpID, helpFile);
return retCode;
}
/// <summary>
/// Shows the about box for the current version of MathType
/// </summary>
/// <returns>Always returns mtOK</returns>
public int MTShowAboutBoxMgn()
{
int retCode = MathTypeReturnValue.mtOK;
retCode = MTShowAboutBox();
return retCode;
}
/// <summary>
/// Displays the requested URL.
/// </summary>
/// <param name="whichURL">[in] One of --
/// mturlMATHTYPE_HOME
/// for MathType Homepage (e.g. http:www.dessci.com/en/products/mathtype)
/// mturlMATHTYPE_SUPPORT
/// for Online Support (e.g. http:www.dessci.com/en/support/mathtype)
/// mturlMATHTYPE_FEEDBACK
/// for Feedback Email To (e.g. mailto:support@dessci.com)
/// mturlMATHTYPE_ORDER
/// for Order MathType (e.g. http://www.dessci.com/en/store/mathtype/options.asp?prodId=MT)
/// mturlMATHTYPE_FUTURE
/// for Future MathType (to be determined)</param>
/// <param name="bGoToURL">[in] True if browser should be launched</param>
/// <param name="strURL">[out] URL String (if sizeURL > 0)</param>
/// <param name="sizeURL">[in] Size of strURL or 0</param>
/// <returns>If >0 and sizeURL == 0 then this is the size required for strURL,
/// Otherwise it's a status
/// mtOK Success
/// mtMEMORY Not enough memory to store the URL (in strURL)
/// mtERROR Could not find the URL</returns>
public int MTGetURLMgn(int whichURL, bool bGoToURL, StringBuilder strURL, int sizeURL)
{
int retCode = MathTypeReturnValue.mtOK;
retCode = MTGetURL(whichURL, bGoToURL, strURL, sizeURL);
return retCode;
}
#endregion MathType Regular SDK Function calls
#region IDataObject
#region class OLECLOSE
public sealed class OleClose
{
public const int OLECLOSE_SAVEIFDIRTY = 0;
public const int OLECLOSE_NOSAVE = 1;
public const int OLECLOSE_PROMPTSAVE = 2;
}
#endregion
#region class tagSIZEL
[StructLayout(LayoutKind.Sequential)]
public sealed class tagSIZEL
{
public int cx;
public int cy;
public tagSIZEL() { }
public tagSIZEL(int cx, int cy) { this.cx = cx; this.cy = cy; }
public tagSIZEL(tagSIZEL o) { this.cx = o.cx; this.cy = o.cy; }
}
#endregion
#region class COMRECT
[ComVisible(true), StructLayout(LayoutKind.Sequential)]
public class COMRECT
{
public int left;
public int top;
public int right;
public int bottom;
public COMRECT() { }
public COMRECT(int left, int top, int right, int bottom)
{
this.left = left;
this.top = top;
this.right = right;
this.bottom = bottom;
}
public static COMRECT FromXYWH(int x, int y, int width, int height)
{
return new COMRECT(x, y, x + width, y + height);
}
}
#endregion
#region class tagOLEVERB
[StructLayout(LayoutKind.Sequential)]
public sealed class tagOLEVERB
{
public int lVerb;
[MarshalAs(UnmanagedType.LPWStr)]
public string lpszVerbName;
[MarshalAs(UnmanagedType.U4)]
public int fuFlags;
[MarshalAs(UnmanagedType.U4)]
public int grfAttribs;
public tagOLEVERB() { }
}
#endregion
#region class FORMATETC
public sealed class FORMATETC
{
[MarshalAs(UnmanagedType.I4)]
public int cfFormat;
public IntPtr ptd;
[MarshalAs(UnmanagedType.I4)]
public int dwAspect;
[MarshalAs(UnmanagedType.I4)]
public int lindex;
[MarshalAs(UnmanagedType.I4)]
public int tymed;
}
#endregion
#region class STGMEDIUM
[ComVisible(false), StructLayout(LayoutKind.Sequential)]
public class STGMEDIUM
{
[MarshalAs(UnmanagedType.I4)]
public int tymed;
public IntPtr unionmember;
public IntPtr pUnkForRelease;
}
#endregion
#region class Ole32Methods
public class Ole32Methods
{
[DllImport("ole32.Dll")]
static public extern uint CoCreateInstance(ref Guid clsid,
[MarshalAs(UnmanagedType.IUnknown)] object inner,
uint context,
ref Guid uuid,
[MarshalAs(UnmanagedType.IUnknown)] out object rReturnedComObject);
}
#endregion
#region interface IEnumOLEVERB
[ComImport, Guid("00000104-0000-0000-C000-000000000046"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IEnumOLEVERB
{
[PreserveSig]
int Next([MarshalAs(UnmanagedType.U4)] int celt, [Out] tagOLEVERB rgelt, [Out, MarshalAs(UnmanagedType.LPArray)] int[] pceltFetched);
[PreserveSig]
int Skip([In, MarshalAs(UnmanagedType.U4)] int celt);
void Reset();
void Clone(out IEnumOLEVERB ppenum);
}
#endregion
#region interface IOleClientSite
[ComImport, Guid("00000118-0000-0000-C000-000000000046"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IOleClientSite
{
void SaveObject();
void GetMoniker(uint dwAssign, uint dwWhichMoniker, ref object ppmk);
void GetContainer(ref object ppContainer);
void ShowObject();
void OnShowWindow(bool fShow);
void RequestNewObjectLayout();
}
#endregion
#region interface IEnumFORMATETC
[ComVisible(true), ComImport(), Guid("00000103-0000-0000-C000-000000000046"), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IEnumFORMATETC
{
[return: MarshalAs(UnmanagedType.I4)]
[PreserveSig]
int Next([In, MarshalAs(UnmanagedType.U4)] int celt, [Out] FORMATETC rgelt,
[In, Out, MarshalAs(UnmanagedType.LPArray)] int[] pceltFetched);
[return: MarshalAs(UnmanagedType.I4)]
[PreserveSig]
int Skip([In, MarshalAs(UnmanagedType.U4)]int celt);
[return: MarshalAs(UnmanagedType.I4)]
[PreserveSig]
int Reset();
[return: MarshalAs(UnmanagedType.I4)]
[PreserveSig]
int Clone([Out, MarshalAs(UnmanagedType.LPArray)] IEnumFORMATETC[] ppenum);
}
#endregion
#region interface IDataObject
[ComVisible(true), ComImport(), Guid("0000010E-0000-0000-C000-000000000046"),
InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IDataObject
{
int GetData(FORMATETC pFormatetc, [Out] STGMEDIUM pMedium);
int GetDataHere(FORMATETC pFormatetc, [In, Out] STGMEDIUM pMedium);
int QueryGetData(FORMATETC pFormatetc);
int GetCanonicalFormatEtc(FORMATETC pformatectIn, [Out] FORMATETC pformatetcOut);
int SetData(FORMATETC pFormatectIn, STGMEDIUM pmedium, int fRelease);
[return: MarshalAs(UnmanagedType.Interface)]
IEnumFORMATETC EnumFormatEtc([In, MarshalAs(UnmanagedType.U4)] int dwDirection);
int DAdvise(FORMATETC pFormatetc, [In, MarshalAs(UnmanagedType.U4)] int advf,
[In, MarshalAs(UnmanagedType.Interface)] object pAdvSink,
[Out, MarshalAs(UnmanagedType.LPArray)] int[] pdwConnection);
int DUnadvise([In, MarshalAs(UnmanagedType.U4)] int dwConnection);
int EnumDAdvise([Out, MarshalAs(UnmanagedType.LPArray)] object[] ppenumAdvise);
}
#endregion
#region interface IAdviseSink
[ComVisible(true), Guid("0000010f-0000-0000-C000-000000000046"),
InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IAdviseSink
{
void OnDataChange([In] object pFormatetc, [In] object pStgmed);
void OnViewChange([In, MarshalAs(UnmanagedType.U4)] int dwAspect,[In, MarshalAs(UnmanagedType.I4)] int lindex);
void OnRename([In, MarshalAs(UnmanagedType.Interface)] UCOMIMoniker pmk);
void OnSave();
void OnClose();
}
#endregion
#region interface IOleObject
[ComImport, Guid("00000112-0000-0000-C000-000000000046"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IOleObject
{
[PreserveSig]
int SetClientSite([In, MarshalAs(UnmanagedType.Interface)] IOleClientSite pClientSite);
IOleClientSite GetClientSite();
[PreserveSig]
int SetHostNames([In, MarshalAs(UnmanagedType.LPWStr)] string szContainerApp, [In, MarshalAs(UnmanagedType.LPWStr)] string szContainerObj);
[PreserveSig]
int Close(int dwSaveOption);
[PreserveSig]
int SetMoniker([In, MarshalAs(UnmanagedType.U4)] int dwWhichMoniker, [In, MarshalAs(UnmanagedType.Interface)] object pmk);
[PreserveSig]
int GetMoniker([In, MarshalAs(UnmanagedType.U4)] int dwAssign, [In, MarshalAs(UnmanagedType.U4)] int dwWhichMoniker, [MarshalAs(UnmanagedType.Interface)] out object moniker);
[PreserveSig]
int InitFromData([In, MarshalAs(UnmanagedType.Interface)] IDataObject pDataObject, int fCreation, [In, MarshalAs(UnmanagedType.U4)] int dwReserved);
[PreserveSig]
int GetClipboardData([In, MarshalAs(UnmanagedType.U4)] int dwReserved, out IDataObject data);
[PreserveSig]
int DoVerb(int iVerb, [In] IntPtr lpmsg, [In, MarshalAs(UnmanagedType.Interface)] IOleClientSite pActiveSite, int lindex, IntPtr hwndParent, [In] COMRECT lprcPosRect);
[PreserveSig]
int EnumVerbs(out IEnumOLEVERB e);
[PreserveSig]
int OleUpdate();
[PreserveSig]
int IsUpToDate();
[PreserveSig]
int GetUserClassID([In, Out] ref Guid pClsid);
[PreserveSig]
int GetUserType([In, MarshalAs(UnmanagedType.U4)] int dwFormOfType, [MarshalAs(UnmanagedType.LPWStr)] out string userType);
[PreserveSig]
int SetExtent([In, MarshalAs(UnmanagedType.U4)] int dwDrawAspect, [In] tagSIZEL pSizel);
[PreserveSig]
int GetExtent([In, MarshalAs(UnmanagedType.U4)] int dwDrawAspect, [Out] tagSIZEL pSizel);
[PreserveSig]
int Advise(IAdviseSink pAdvSink, out int cookie);
[PreserveSig]
int Unadvise([In, MarshalAs(UnmanagedType.U4)] int dwConnection);
//[PreserveSig]
//int EnumAdvise(out IEnumSTATDATA e);
//[PreserveSig]
//int GetMiscStatus([In, MarshalAs(UnmanagedType.U4)] int dwAspect, out int misc);
//[PreserveSig]
//int SetColorScheme([In] Win32.tagLOGPALETTE pLogpal);
}
#endregion
#region getIDataObject
public static System.Runtime.InteropServices.ComTypes.IDataObject getIDataObject()
{
const uint CLSCTX_INPROC_SERVER = 4;
//
// CLSID of the COM object
// FIXME: need the actual GUID to use here.
//
Guid clsid = new Guid("0002CE03-0000-0000-C000-000000000046");
//
// GUID of the required interface
// TODO: Verify that this is the correct GUID
//
Guid IID_IUnknown = new Guid("00000000-0000-0000-C000-000000000046");
object instance = null;
uint hResult = Ole32Methods.CoCreateInstance(ref clsid, null, CLSCTX_INPROC_SERVER, ref IID_IUnknown, out instance);
if (hResult != 0)
return null;
return instance as System.Runtime.InteropServices.ComTypes.IDataObject;
}
#endregion
#endregion
}
}
| 46.248722 | 194 | 0.614723 | [
"MIT"
] | scalad/MathML2MathTypeEquation | MTSDKDN/MTSDKDN/MathTypeSDK.cs | 54,296 | C# |
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
namespace MercadoPago.DataStructures.Payment
{
public struct Identification
{
/// <summary>
/// Identification type
/// </summary>
[StringLength(256)]
public string Type { get; set; }
/// <summary>
/// Identification number
/// </summary>
[StringLength(256)]
public string Number { get; set; }
}
}
| 22.791667 | 45 | 0.583181 | [
"MIT"
] | GustavoHennig/Lexim-MercadoPago-Sdk | px-dotnet/DataStructures/Payment/Identification.cs | 549 | C# |
using eXam;
using Windows.UI.Xaml.Media;
using Xamarin.Forms;
using Xamarin.Forms.Platform.WinRT;
//add appropriate using statement for each windows platform variant
[assembly: ResolutionGroupName ("Xamarin")]
[assembly: ExportEffect (typeof (GradientEffectWindows), "GradientEffect")]
namespace eXam
{
internal class GradientEffectWindows : PlatformEffect
{
Brush oldBrush;
protected override void OnAttached()
{
var button = Element as Button;
if (button == null)
return;
var gradBrush = new LinearGradientBrush()
{
StartPoint = new global::Windows.Foundation.Point(0, 0),
EndPoint = new global::Windows.Foundation.Point(0, 1)
};
var color1 = Color.FromRgb(0, 0, 40);
var color2 = button.BackgroundColor;
gradBrush.GradientStops.Add(new GradientStop() { Color = GetWindowsColor(color1), Offset = 1 });
gradBrush.GradientStops.Add(new GradientStop() { Color = GetWindowsColor(color2), Offset = 0 });
var btn = Control as global::Windows.UI.Xaml.Controls.Button;
oldBrush = btn.Background;
btn.Background = gradBrush;
}
protected override void OnDetached()
{
var btn = Control as global::Windows.UI.Xaml.Controls.Button;
if (btn == null)
return;
btn.Background = oldBrush;
}
protected override void OnElementPropertyChanged (System.ComponentModel.PropertyChangedEventArgs args)
{
base.OnElementPropertyChanged (args);
}
global::Windows.UI.Color GetWindowsColor (Color color)
{
return global::Windows.UI.Color.FromArgb((byte)(255 * color.A), (byte)(255 * color.R), (byte)(255 * color.G), (byte)(255 * color.B));
}
}
} | 30.409836 | 145 | 0.624798 | [
"MIT"
] | XamarinUniversity/Evolve-HOL | Exercises/Ex21/eXam/eXam.WinPhone/GradientEffectWindows.cs | 1,857 | C# |
#pragma checksum "C:\Users\Mert\source\repos\RazorViews\RazorViews\Views\Cats\Create.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "c2aa46a74baa03f8574b1f35b350236b7482b955"
// <auto-generated/>
#pragma warning disable 1591
[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.Views_Cats_Create), @"mvc.1.0.view", @"/Views/Cats/Create.cshtml")]
namespace AspNetCore
{
#line hidden
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.AspNetCore.Mvc.ViewFeatures;
#nullable restore
#line 1 "C:\Users\Mert\source\repos\RazorViews\RazorViews\Views\_ViewImports.cshtml"
using RazorViews;
#line default
#line hidden
#nullable disable
#nullable restore
#line 2 "C:\Users\Mert\source\repos\RazorViews\RazorViews\Views\_ViewImports.cshtml"
using RazorViews.Models;
#line default
#line hidden
#nullable disable
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"c2aa46a74baa03f8574b1f35b350236b7482b955", @"/Views/Cats/Create.cshtml")]
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"43312301974cd693b7003ed434a401aa2ae0bf90", @"/Views/_ViewImports.cshtml")]
public class Views_Cats_Create : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<CatViewModel>
{
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("class", new global::Microsoft.AspNetCore.Html.HtmlString("form-control"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_1 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("placeholder", new global::Microsoft.AspNetCore.Html.HtmlString("Enter cat\'s name.."), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_2 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("type", "number", global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_3 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("placeholder", new global::Microsoft.AspNetCore.Html.HtmlString("Enter cat\'s age.."), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_4 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("method", "post", global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
#line hidden
#pragma warning disable 0649
private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext __tagHelperExecutionContext;
#pragma warning restore 0649
private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner __tagHelperRunner = new global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner();
#pragma warning disable 0169
private string __tagHelperStringValueBuffer;
#pragma warning restore 0169
private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager __backed__tagHelperScopeManager = null;
private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager __tagHelperScopeManager
{
get
{
if (__backed__tagHelperScopeManager == null)
{
__backed__tagHelperScopeManager = new global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager(StartTagHelperWritingScope, EndTagHelperWritingScope);
}
return __backed__tagHelperScopeManager;
}
}
private global::Microsoft.AspNetCore.Mvc.TagHelpers.FormTagHelper __Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper;
private global::Microsoft.AspNetCore.Mvc.TagHelpers.RenderAtEndOfFormTagHelper __Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper;
private global::Microsoft.AspNetCore.Mvc.TagHelpers.LabelTagHelper __Microsoft_AspNetCore_Mvc_TagHelpers_LabelTagHelper;
private global::Microsoft.AspNetCore.Mvc.TagHelpers.InputTagHelper __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper;
#pragma warning disable 1998
public async override global::System.Threading.Tasks.Task ExecuteAsync()
{
WriteLiteral("\r\n");
#nullable restore
#line 3 "C:\Users\Mert\source\repos\RazorViews\RazorViews\Views\Cats\Create.cshtml"
ViewData["Title"] = "Create";
#line default
#line hidden
#nullable disable
WriteLiteral("\r\n");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("form", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "c2aa46a74baa03f8574b1f35b350236b7482b9555365", async() => {
WriteLiteral("\r\n <div class=\"form-group\">\r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("label", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "c2aa46a74baa03f8574b1f35b350236b7482b9555665", async() => {
}
);
__Microsoft_AspNetCore_Mvc_TagHelpers_LabelTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.LabelTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_LabelTagHelper);
#nullable restore
#line 9 "C:\Users\Mert\source\repos\RazorViews\RazorViews\Views\Cats\Create.cshtml"
__Microsoft_AspNetCore_Mvc_TagHelpers_LabelTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.Name);
#line default
#line hidden
#nullable disable
__tagHelperExecutionContext.AddTagHelperAttribute("asp-for", __Microsoft_AspNetCore_Mvc_TagHelpers_LabelTagHelper.For, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
WriteLiteral("\r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagOnly, "c2aa46a74baa03f8574b1f35b350236b7482b9557149", async() => {
}
);
__Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.InputTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper);
#nullable restore
#line 10 "C:\Users\Mert\source\repos\RazorViews\RazorViews\Views\Cats\Create.cshtml"
__Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.Name);
#line default
#line hidden
#nullable disable
__tagHelperExecutionContext.AddTagHelperAttribute("asp-for", __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
WriteLiteral("\r\n </div>\r\n <div class=\"form-group\">\r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("label", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "c2aa46a74baa03f8574b1f35b350236b7482b9558857", async() => {
}
);
__Microsoft_AspNetCore_Mvc_TagHelpers_LabelTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.LabelTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_LabelTagHelper);
#nullable restore
#line 13 "C:\Users\Mert\source\repos\RazorViews\RazorViews\Views\Cats\Create.cshtml"
__Microsoft_AspNetCore_Mvc_TagHelpers_LabelTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.Age);
#line default
#line hidden
#nullable disable
__tagHelperExecutionContext.AddTagHelperAttribute("asp-for", __Microsoft_AspNetCore_Mvc_TagHelpers_LabelTagHelper.For, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
WriteLiteral("\r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagOnly, "c2aa46a74baa03f8574b1f35b350236b7482b95510341", async() => {
}
);
__Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.InputTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper);
#nullable restore
#line 14 "C:\Users\Mert\source\repos\RazorViews\RazorViews\Views\Cats\Create.cshtml"
__Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.Age);
#line default
#line hidden
#nullable disable
__tagHelperExecutionContext.AddTagHelperAttribute("asp-for", __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
__Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.InputTypeName = (string)__tagHelperAttribute_2.Value;
__tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_2);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_3);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
WriteLiteral("\r\n </div>\r\n\r\n <button type=\"submit\" class=\"btn btn-primary\">Submit</button>\r\n");
}
);
__Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.FormTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper);
__Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.RenderAtEndOfFormTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper);
__Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper.Method = (string)__tagHelperAttribute_4.Value;
__tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_4);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
WriteLiteral("\r\n\r\n\r\n");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("form", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "c2aa46a74baa03f8574b1f35b350236b7482b95513481", async() => {
WriteLiteral("\r\n\r\n");
#nullable restore
#line 23 "C:\Users\Mert\source\repos\RazorViews\RazorViews\Views\Cats\Create.cshtml"
Write(Html.LabelFor(c => c.Name));
#line default
#line hidden
#nullable disable
WriteLiteral("\r\n");
#nullable restore
#line 24 "C:\Users\Mert\source\repos\RazorViews\RazorViews\Views\Cats\Create.cshtml"
Write(Html.TextBoxFor(c => c.Name));
#line default
#line hidden
#nullable disable
WriteLiteral("\r\n\r\n<br />\r\n\r\n");
#nullable restore
#line 28 "C:\Users\Mert\source\repos\RazorViews\RazorViews\Views\Cats\Create.cshtml"
Write(Html.LabelFor(c => c.Age));
#line default
#line hidden
#nullable disable
WriteLiteral("\r\n");
#nullable restore
#line 29 "C:\Users\Mert\source\repos\RazorViews\RazorViews\Views\Cats\Create.cshtml"
Write(Html.TextBoxFor(c => c.Age));
#line default
#line hidden
#nullable disable
WriteLiteral("\r\n\r\n<input type=\"submit\" /> \r\n\r\n");
}
);
__Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.FormTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper);
__Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.RenderAtEndOfFormTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper);
__Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper.Method = (string)__tagHelperAttribute_4.Value;
__tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_4);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
WriteLiteral("\r\n");
}
#pragma warning restore 1998
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; }
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; }
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; }
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; }
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<CatViewModel> Html { get; private set; }
}
}
#pragma warning restore 1591
| 66.919355 | 363 | 0.746324 | [
"MIT"
] | meco00/CSharp-Web | RazorViews/RazorViews/obj/Debug/net5.0/Razor/Views/Cats/Create.cshtml.g.cs | 16,596 | C# |
namespace DrawingFromGeometryGraphSample {
partial class DrawingFromGeometryGraphForm {
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing) {
if (disposing && (components != null)) {
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent() {
this.SuspendLayout();
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(282, 257);
this.Name = "DrawingFromGeometryGraphForm";
this.Text = "Form1";
this.ResumeLayout(false);
}
#endregion
}
}
| 32.44186 | 107 | 0.569892 | [
"MIT"
] | 0xbeecaffe/MSAGL | GraphLayout/Samples/DrawingFromGeometryGraphSample/DrawingFromGeometryGraphForm.Designer.cs | 1,395 | C# |
/*
* Copyright 2018 JDCLOUD.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.
*
*
*
*
*
* Contact:
*
* NOTE: This class is auto generated by the jdcloud code generator program.
*/
using System;
using System.Collections.Generic;
using System.Text;
using JDCloudSDK.Core.Annotation;
namespace JDCloudSDK.Jdfusion.Model
{
/// <summary>
/// createRDSDB
/// </summary>
public class CreateRDSDB
{
///<summary>
/// 数据库名
///Required:true
///</summary>
[Required]
public string Name{ get; set; }
///<summary>
/// 字符集
///Required:true
///</summary>
[Required]
public string CharacterSetName{ get; set; }
}
}
| 22.709091 | 76 | 0.640512 | [
"Apache-2.0"
] | jdcloud-api/jdcloud-sdk-net | sdk/src/Service/Jdfusion/Model/CreateRDSDB.cs | 1,263 | C# |
using Newtonsoft.Json.Linq;
using OTFN.Core.Market;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OTFN.Core.Endpoints.JSON
{
public static class QuoteExtension
{
private const string KeyOpen = "o";
private const string KeyHigh = "h";
private const string KeyLow = "l";
private const string KeyClose = "c";
private const string KeyVolume = "v";
private const string KeyRealVolume = "V";
private const string KeyTimestamp = "t";
public static JToken ToJSONObject(this Quote quote)
{
JArray obj = new JArray();
obj.Add(quote.Open);
obj.Add(quote.High);
obj.Add(quote.Low);
obj.Add(quote.Close);
obj.Add(quote.Volume);
obj.Add(quote.RealVolume);
obj.Add(quote.Timestamp);
return obj;
}
public static Quote FromJSONObject(this Quote quote, JToken jsonObj)
{
JArray arr = (JArray)jsonObj;
quote.Open = (double)arr[0];
quote.High = (double)arr[1];
quote.Low = (double)arr[2];
quote.Close = (double)arr[3];
quote.Volume = (double)arr[4];
quote.RealVolume = (double)arr[5];
quote.Timestamp = (uint)arr[6];
return quote;
}
}
}
| 29.510204 | 76 | 0.565007 | [
"Apache-2.0"
] | AndreyMav/OpenTradingFrameworkNet | OTFNCore/Endpoints/JSON/QuoteExtension.cs | 1,448 | C# |
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
[assembly: global::Android.Runtime.ResourceDesignerAttribute("XamarinSample.Droid.Resource", IsApplication=true)]
namespace XamarinSample.Droid
{
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "1.0.0.0")]
public partial class Resource
{
static Resource()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
public static void UpdateIdValues()
{
global::Microsoft.Azure.Amqp.Resource.String.ApplicationName = global::XamarinSample.Droid.Resource.String.ApplicationName;
global::Xamarin.Forms.Platform.Android.Resource.Attribute.actionBarSize = global::XamarinSample.Droid.Resource.Attribute.actionBarSize;
}
public partial class Animation
{
// aapt resource value: 0x7f040000
public const int abc_fade_in = 2130968576;
// aapt resource value: 0x7f040001
public const int abc_fade_out = 2130968577;
// aapt resource value: 0x7f040002
public const int abc_grow_fade_in_from_bottom = 2130968578;
// aapt resource value: 0x7f040003
public const int abc_popup_enter = 2130968579;
// aapt resource value: 0x7f040004
public const int abc_popup_exit = 2130968580;
// aapt resource value: 0x7f040005
public const int abc_shrink_fade_out_from_bottom = 2130968581;
// aapt resource value: 0x7f040006
public const int abc_slide_in_bottom = 2130968582;
// aapt resource value: 0x7f040007
public const int abc_slide_in_top = 2130968583;
// aapt resource value: 0x7f040008
public const int abc_slide_out_bottom = 2130968584;
// aapt resource value: 0x7f040009
public const int abc_slide_out_top = 2130968585;
// aapt resource value: 0x7f04000a
public const int design_bottom_sheet_slide_in = 2130968586;
// aapt resource value: 0x7f04000b
public const int design_bottom_sheet_slide_out = 2130968587;
// aapt resource value: 0x7f04000c
public const int design_fab_in = 2130968588;
// aapt resource value: 0x7f04000d
public const int design_fab_out = 2130968589;
// aapt resource value: 0x7f04000e
public const int design_snackbar_in = 2130968590;
// aapt resource value: 0x7f04000f
public const int design_snackbar_out = 2130968591;
static Animation()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
private Animation()
{
}
}
public partial class Animator
{
// aapt resource value: 0x7f050000
public const int design_appbar_state_list_animator = 2131034112;
static Animator()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
private Animator()
{
}
}
public partial class Attribute
{
// aapt resource value: 0x7f01005f
public const int actionBarDivider = 2130772063;
// aapt resource value: 0x7f010060
public const int actionBarItemBackground = 2130772064;
// aapt resource value: 0x7f010059
public const int actionBarPopupTheme = 2130772057;
// aapt resource value: 0x7f01005e
public const int actionBarSize = 2130772062;
// aapt resource value: 0x7f01005b
public const int actionBarSplitStyle = 2130772059;
// aapt resource value: 0x7f01005a
public const int actionBarStyle = 2130772058;
// aapt resource value: 0x7f010055
public const int actionBarTabBarStyle = 2130772053;
// aapt resource value: 0x7f010054
public const int actionBarTabStyle = 2130772052;
// aapt resource value: 0x7f010056
public const int actionBarTabTextStyle = 2130772054;
// aapt resource value: 0x7f01005c
public const int actionBarTheme = 2130772060;
// aapt resource value: 0x7f01005d
public const int actionBarWidgetTheme = 2130772061;
// aapt resource value: 0x7f01007a
public const int actionButtonStyle = 2130772090;
// aapt resource value: 0x7f010076
public const int actionDropDownStyle = 2130772086;
// aapt resource value: 0x7f0100cc
public const int actionLayout = 2130772172;
// aapt resource value: 0x7f010061
public const int actionMenuTextAppearance = 2130772065;
// aapt resource value: 0x7f010062
public const int actionMenuTextColor = 2130772066;
// aapt resource value: 0x7f010065
public const int actionModeBackground = 2130772069;
// aapt resource value: 0x7f010064
public const int actionModeCloseButtonStyle = 2130772068;
// aapt resource value: 0x7f010067
public const int actionModeCloseDrawable = 2130772071;
// aapt resource value: 0x7f010069
public const int actionModeCopyDrawable = 2130772073;
// aapt resource value: 0x7f010068
public const int actionModeCutDrawable = 2130772072;
// aapt resource value: 0x7f01006d
public const int actionModeFindDrawable = 2130772077;
// aapt resource value: 0x7f01006a
public const int actionModePasteDrawable = 2130772074;
// aapt resource value: 0x7f01006f
public const int actionModePopupWindowStyle = 2130772079;
// aapt resource value: 0x7f01006b
public const int actionModeSelectAllDrawable = 2130772075;
// aapt resource value: 0x7f01006c
public const int actionModeShareDrawable = 2130772076;
// aapt resource value: 0x7f010066
public const int actionModeSplitBackground = 2130772070;
// aapt resource value: 0x7f010063
public const int actionModeStyle = 2130772067;
// aapt resource value: 0x7f01006e
public const int actionModeWebSearchDrawable = 2130772078;
// aapt resource value: 0x7f010057
public const int actionOverflowButtonStyle = 2130772055;
// aapt resource value: 0x7f010058
public const int actionOverflowMenuStyle = 2130772056;
// aapt resource value: 0x7f0100ce
public const int actionProviderClass = 2130772174;
// aapt resource value: 0x7f0100cd
public const int actionViewClass = 2130772173;
// aapt resource value: 0x7f010082
public const int activityChooserViewStyle = 2130772098;
// aapt resource value: 0x7f0100a7
public const int alertDialogButtonGroupStyle = 2130772135;
// aapt resource value: 0x7f0100a8
public const int alertDialogCenterButtons = 2130772136;
// aapt resource value: 0x7f0100a6
public const int alertDialogStyle = 2130772134;
// aapt resource value: 0x7f0100a9
public const int alertDialogTheme = 2130772137;
// aapt resource value: 0x7f0100bc
public const int allowStacking = 2130772156;
// aapt resource value: 0x7f0100bd
public const int alpha = 2130772157;
// aapt resource value: 0x7f0100c4
public const int arrowHeadLength = 2130772164;
// aapt resource value: 0x7f0100c5
public const int arrowShaftLength = 2130772165;
// aapt resource value: 0x7f0100ae
public const int autoCompleteTextViewStyle = 2130772142;
// aapt resource value: 0x7f010028
public const int background = 2130772008;
// aapt resource value: 0x7f01002a
public const int backgroundSplit = 2130772010;
// aapt resource value: 0x7f010029
public const int backgroundStacked = 2130772009;
// aapt resource value: 0x7f010101
public const int backgroundTint = 2130772225;
// aapt resource value: 0x7f010102
public const int backgroundTintMode = 2130772226;
// aapt resource value: 0x7f0100c6
public const int barLength = 2130772166;
// aapt resource value: 0x7f01012c
public const int behavior_autoHide = 2130772268;
// aapt resource value: 0x7f010109
public const int behavior_hideable = 2130772233;
// aapt resource value: 0x7f010135
public const int behavior_overlapTop = 2130772277;
// aapt resource value: 0x7f010108
public const int behavior_peekHeight = 2130772232;
// aapt resource value: 0x7f01010a
public const int behavior_skipCollapsed = 2130772234;
// aapt resource value: 0x7f01012a
public const int borderWidth = 2130772266;
// aapt resource value: 0x7f01007f
public const int borderlessButtonStyle = 2130772095;
// aapt resource value: 0x7f010124
public const int bottomSheetDialogTheme = 2130772260;
// aapt resource value: 0x7f010125
public const int bottomSheetStyle = 2130772261;
// aapt resource value: 0x7f01007c
public const int buttonBarButtonStyle = 2130772092;
// aapt resource value: 0x7f0100ac
public const int buttonBarNegativeButtonStyle = 2130772140;
// aapt resource value: 0x7f0100ad
public const int buttonBarNeutralButtonStyle = 2130772141;
// aapt resource value: 0x7f0100ab
public const int buttonBarPositiveButtonStyle = 2130772139;
// aapt resource value: 0x7f01007b
public const int buttonBarStyle = 2130772091;
// aapt resource value: 0x7f0100f6
public const int buttonGravity = 2130772214;
// aapt resource value: 0x7f01003d
public const int buttonPanelSideLayout = 2130772029;
// aapt resource value: 0x7f0100af
public const int buttonStyle = 2130772143;
// aapt resource value: 0x7f0100b0
public const int buttonStyleSmall = 2130772144;
// aapt resource value: 0x7f0100be
public const int buttonTint = 2130772158;
// aapt resource value: 0x7f0100bf
public const int buttonTintMode = 2130772159;
// aapt resource value: 0x7f010011
public const int cardBackgroundColor = 2130771985;
// aapt resource value: 0x7f010012
public const int cardCornerRadius = 2130771986;
// aapt resource value: 0x7f010013
public const int cardElevation = 2130771987;
// aapt resource value: 0x7f010014
public const int cardMaxElevation = 2130771988;
// aapt resource value: 0x7f010016
public const int cardPreventCornerOverlap = 2130771990;
// aapt resource value: 0x7f010015
public const int cardUseCompatPadding = 2130771989;
// aapt resource value: 0x7f0100b1
public const int checkboxStyle = 2130772145;
// aapt resource value: 0x7f0100b2
public const int checkedTextViewStyle = 2130772146;
// aapt resource value: 0x7f0100d9
public const int closeIcon = 2130772185;
// aapt resource value: 0x7f01003a
public const int closeItemLayout = 2130772026;
// aapt resource value: 0x7f0100f8
public const int collapseContentDescription = 2130772216;
// aapt resource value: 0x7f0100f7
public const int collapseIcon = 2130772215;
// aapt resource value: 0x7f010117
public const int collapsedTitleGravity = 2130772247;
// aapt resource value: 0x7f010111
public const int collapsedTitleTextAppearance = 2130772241;
// aapt resource value: 0x7f0100c0
public const int color = 2130772160;
// aapt resource value: 0x7f01009e
public const int colorAccent = 2130772126;
// aapt resource value: 0x7f0100a5
public const int colorBackgroundFloating = 2130772133;
// aapt resource value: 0x7f0100a2
public const int colorButtonNormal = 2130772130;
// aapt resource value: 0x7f0100a0
public const int colorControlActivated = 2130772128;
// aapt resource value: 0x7f0100a1
public const int colorControlHighlight = 2130772129;
// aapt resource value: 0x7f01009f
public const int colorControlNormal = 2130772127;
// aapt resource value: 0x7f01009c
public const int colorPrimary = 2130772124;
// aapt resource value: 0x7f01009d
public const int colorPrimaryDark = 2130772125;
// aapt resource value: 0x7f0100a3
public const int colorSwitchThumbNormal = 2130772131;
// aapt resource value: 0x7f0100de
public const int commitIcon = 2130772190;
// aapt resource value: 0x7f010033
public const int contentInsetEnd = 2130772019;
// aapt resource value: 0x7f010037
public const int contentInsetEndWithActions = 2130772023;
// aapt resource value: 0x7f010034
public const int contentInsetLeft = 2130772020;
// aapt resource value: 0x7f010035
public const int contentInsetRight = 2130772021;
// aapt resource value: 0x7f010032
public const int contentInsetStart = 2130772018;
// aapt resource value: 0x7f010036
public const int contentInsetStartWithNavigation = 2130772022;
// aapt resource value: 0x7f010017
public const int contentPadding = 2130771991;
// aapt resource value: 0x7f01001b
public const int contentPaddingBottom = 2130771995;
// aapt resource value: 0x7f010018
public const int contentPaddingLeft = 2130771992;
// aapt resource value: 0x7f010019
public const int contentPaddingRight = 2130771993;
// aapt resource value: 0x7f01001a
public const int contentPaddingTop = 2130771994;
// aapt resource value: 0x7f010112
public const int contentScrim = 2130772242;
// aapt resource value: 0x7f0100a4
public const int controlBackground = 2130772132;
// aapt resource value: 0x7f01014b
public const int counterEnabled = 2130772299;
// aapt resource value: 0x7f01014c
public const int counterMaxLength = 2130772300;
// aapt resource value: 0x7f01014e
public const int counterOverflowTextAppearance = 2130772302;
// aapt resource value: 0x7f01014d
public const int counterTextAppearance = 2130772301;
// aapt resource value: 0x7f01002b
public const int customNavigationLayout = 2130772011;
// aapt resource value: 0x7f0100d8
public const int defaultQueryHint = 2130772184;
// aapt resource value: 0x7f010074
public const int dialogPreferredPadding = 2130772084;
// aapt resource value: 0x7f010073
public const int dialogTheme = 2130772083;
// aapt resource value: 0x7f010021
public const int displayOptions = 2130772001;
// aapt resource value: 0x7f010027
public const int divider = 2130772007;
// aapt resource value: 0x7f010081
public const int dividerHorizontal = 2130772097;
// aapt resource value: 0x7f0100ca
public const int dividerPadding = 2130772170;
// aapt resource value: 0x7f010080
public const int dividerVertical = 2130772096;
// aapt resource value: 0x7f0100c2
public const int drawableSize = 2130772162;
// aapt resource value: 0x7f01001c
public const int drawerArrowStyle = 2130771996;
// aapt resource value: 0x7f010093
public const int dropDownListViewStyle = 2130772115;
// aapt resource value: 0x7f010077
public const int dropdownListPreferredItemHeight = 2130772087;
// aapt resource value: 0x7f010088
public const int editTextBackground = 2130772104;
// aapt resource value: 0x7f010087
public const int editTextColor = 2130772103;
// aapt resource value: 0x7f0100b3
public const int editTextStyle = 2130772147;
// aapt resource value: 0x7f010038
public const int elevation = 2130772024;
// aapt resource value: 0x7f010149
public const int errorEnabled = 2130772297;
// aapt resource value: 0x7f01014a
public const int errorTextAppearance = 2130772298;
// aapt resource value: 0x7f01003c
public const int expandActivityOverflowButtonDrawable = 2130772028;
// aapt resource value: 0x7f010103
public const int expanded = 2130772227;
// aapt resource value: 0x7f010118
public const int expandedTitleGravity = 2130772248;
// aapt resource value: 0x7f01010b
public const int expandedTitleMargin = 2130772235;
// aapt resource value: 0x7f01010f
public const int expandedTitleMarginBottom = 2130772239;
// aapt resource value: 0x7f01010e
public const int expandedTitleMarginEnd = 2130772238;
// aapt resource value: 0x7f01010c
public const int expandedTitleMarginStart = 2130772236;
// aapt resource value: 0x7f01010d
public const int expandedTitleMarginTop = 2130772237;
// aapt resource value: 0x7f010110
public const int expandedTitleTextAppearance = 2130772240;
// aapt resource value: 0x7f010010
public const int externalRouteEnabledDrawable = 2130771984;
// aapt resource value: 0x7f010128
public const int fabSize = 2130772264;
// aapt resource value: 0x7f01012d
public const int foregroundInsidePadding = 2130772269;
// aapt resource value: 0x7f0100c3
public const int gapBetweenBars = 2130772163;
// aapt resource value: 0x7f0100da
public const int goIcon = 2130772186;
// aapt resource value: 0x7f010133
public const int headerLayout = 2130772275;
// aapt resource value: 0x7f01001d
public const int height = 2130771997;
// aapt resource value: 0x7f010031
public const int hideOnContentScroll = 2130772017;
// aapt resource value: 0x7f01014f
public const int hintAnimationEnabled = 2130772303;
// aapt resource value: 0x7f010148
public const int hintEnabled = 2130772296;
// aapt resource value: 0x7f010147
public const int hintTextAppearance = 2130772295;
// aapt resource value: 0x7f010079
public const int homeAsUpIndicator = 2130772089;
// aapt resource value: 0x7f01002c
public const int homeLayout = 2130772012;
// aapt resource value: 0x7f010025
public const int icon = 2130772005;
// aapt resource value: 0x7f0100d6
public const int iconifiedByDefault = 2130772182;
// aapt resource value: 0x7f010089
public const int imageButtonStyle = 2130772105;
// aapt resource value: 0x7f01002e
public const int indeterminateProgressStyle = 2130772014;
// aapt resource value: 0x7f01003b
public const int initialActivityCount = 2130772027;
// aapt resource value: 0x7f010134
public const int insetForeground = 2130772276;
// aapt resource value: 0x7f01001e
public const int isLightTheme = 2130771998;
// aapt resource value: 0x7f010131
public const int itemBackground = 2130772273;
// aapt resource value: 0x7f01012f
public const int itemIconTint = 2130772271;
// aapt resource value: 0x7f010030
public const int itemPadding = 2130772016;
// aapt resource value: 0x7f010132
public const int itemTextAppearance = 2130772274;
// aapt resource value: 0x7f010130
public const int itemTextColor = 2130772272;
// aapt resource value: 0x7f01011c
public const int keylines = 2130772252;
// aapt resource value: 0x7f0100d5
public const int layout = 2130772181;
// aapt resource value: 0x7f010000
public const int layoutManager = 2130771968;
// aapt resource value: 0x7f01011f
public const int layout_anchor = 2130772255;
// aapt resource value: 0x7f010121
public const int layout_anchorGravity = 2130772257;
// aapt resource value: 0x7f01011e
public const int layout_behavior = 2130772254;
// aapt resource value: 0x7f01011a
public const int layout_collapseMode = 2130772250;
// aapt resource value: 0x7f01011b
public const int layout_collapseParallaxMultiplier = 2130772251;
// aapt resource value: 0x7f010123
public const int layout_dodgeInsetEdges = 2130772259;
// aapt resource value: 0x7f010122
public const int layout_insetEdge = 2130772258;
// aapt resource value: 0x7f010120
public const int layout_keyline = 2130772256;
// aapt resource value: 0x7f010106
public const int layout_scrollFlags = 2130772230;
// aapt resource value: 0x7f010107
public const int layout_scrollInterpolator = 2130772231;
// aapt resource value: 0x7f01009b
public const int listChoiceBackgroundIndicator = 2130772123;
// aapt resource value: 0x7f010075
public const int listDividerAlertDialog = 2130772085;
// aapt resource value: 0x7f010041
public const int listItemLayout = 2130772033;
// aapt resource value: 0x7f01003e
public const int listLayout = 2130772030;
// aapt resource value: 0x7f0100bb
public const int listMenuViewStyle = 2130772155;
// aapt resource value: 0x7f010094
public const int listPopupWindowStyle = 2130772116;
// aapt resource value: 0x7f01008e
public const int listPreferredItemHeight = 2130772110;
// aapt resource value: 0x7f010090
public const int listPreferredItemHeightLarge = 2130772112;
// aapt resource value: 0x7f01008f
public const int listPreferredItemHeightSmall = 2130772111;
// aapt resource value: 0x7f010091
public const int listPreferredItemPaddingLeft = 2130772113;
// aapt resource value: 0x7f010092
public const int listPreferredItemPaddingRight = 2130772114;
// aapt resource value: 0x7f010026
public const int logo = 2130772006;
// aapt resource value: 0x7f0100fb
public const int logoDescription = 2130772219;
// aapt resource value: 0x7f010136
public const int maxActionInlineWidth = 2130772278;
// aapt resource value: 0x7f0100f5
public const int maxButtonHeight = 2130772213;
// aapt resource value: 0x7f0100c8
public const int measureWithLargestChild = 2130772168;
// aapt resource value: 0x7f010004
public const int mediaRouteAudioTrackDrawable = 2130771972;
// aapt resource value: 0x7f010005
public const int mediaRouteButtonStyle = 2130771973;
// aapt resource value: 0x7f010006
public const int mediaRouteCloseDrawable = 2130771974;
// aapt resource value: 0x7f010007
public const int mediaRouteControlPanelThemeOverlay = 2130771975;
// aapt resource value: 0x7f010008
public const int mediaRouteDefaultIconDrawable = 2130771976;
// aapt resource value: 0x7f010009
public const int mediaRoutePauseDrawable = 2130771977;
// aapt resource value: 0x7f01000a
public const int mediaRoutePlayDrawable = 2130771978;
// aapt resource value: 0x7f01000b
public const int mediaRouteSpeakerGroupIconDrawable = 2130771979;
// aapt resource value: 0x7f01000c
public const int mediaRouteSpeakerIconDrawable = 2130771980;
// aapt resource value: 0x7f01000d
public const int mediaRouteStopDrawable = 2130771981;
// aapt resource value: 0x7f01000e
public const int mediaRouteTheme = 2130771982;
// aapt resource value: 0x7f01000f
public const int mediaRouteTvIconDrawable = 2130771983;
// aapt resource value: 0x7f01012e
public const int menu = 2130772270;
// aapt resource value: 0x7f01003f
public const int multiChoiceItemLayout = 2130772031;
// aapt resource value: 0x7f0100fa
public const int navigationContentDescription = 2130772218;
// aapt resource value: 0x7f0100f9
public const int navigationIcon = 2130772217;
// aapt resource value: 0x7f010020
public const int navigationMode = 2130772000;
// aapt resource value: 0x7f0100d1
public const int overlapAnchor = 2130772177;
// aapt resource value: 0x7f0100d3
public const int paddingBottomNoButtons = 2130772179;
// aapt resource value: 0x7f0100ff
public const int paddingEnd = 2130772223;
// aapt resource value: 0x7f0100fe
public const int paddingStart = 2130772222;
// aapt resource value: 0x7f0100d4
public const int paddingTopNoTitle = 2130772180;
// aapt resource value: 0x7f010098
public const int panelBackground = 2130772120;
// aapt resource value: 0x7f01009a
public const int panelMenuListTheme = 2130772122;
// aapt resource value: 0x7f010099
public const int panelMenuListWidth = 2130772121;
// aapt resource value: 0x7f010152
public const int passwordToggleContentDescription = 2130772306;
// aapt resource value: 0x7f010151
public const int passwordToggleDrawable = 2130772305;
// aapt resource value: 0x7f010150
public const int passwordToggleEnabled = 2130772304;
// aapt resource value: 0x7f010153
public const int passwordToggleTint = 2130772307;
// aapt resource value: 0x7f010154
public const int passwordToggleTintMode = 2130772308;
// aapt resource value: 0x7f010085
public const int popupMenuStyle = 2130772101;
// aapt resource value: 0x7f010039
public const int popupTheme = 2130772025;
// aapt resource value: 0x7f010086
public const int popupWindowStyle = 2130772102;
// aapt resource value: 0x7f0100cf
public const int preserveIconSpacing = 2130772175;
// aapt resource value: 0x7f010129
public const int pressedTranslationZ = 2130772265;
// aapt resource value: 0x7f01002f
public const int progressBarPadding = 2130772015;
// aapt resource value: 0x7f01002d
public const int progressBarStyle = 2130772013;
// aapt resource value: 0x7f0100e0
public const int queryBackground = 2130772192;
// aapt resource value: 0x7f0100d7
public const int queryHint = 2130772183;
// aapt resource value: 0x7f0100b4
public const int radioButtonStyle = 2130772148;
// aapt resource value: 0x7f0100b5
public const int ratingBarStyle = 2130772149;
// aapt resource value: 0x7f0100b6
public const int ratingBarStyleIndicator = 2130772150;
// aapt resource value: 0x7f0100b7
public const int ratingBarStyleSmall = 2130772151;
// aapt resource value: 0x7f010002
public const int reverseLayout = 2130771970;
// aapt resource value: 0x7f010127
public const int rippleColor = 2130772263;
// aapt resource value: 0x7f010116
public const int scrimAnimationDuration = 2130772246;
// aapt resource value: 0x7f010115
public const int scrimVisibleHeightTrigger = 2130772245;
// aapt resource value: 0x7f0100dc
public const int searchHintIcon = 2130772188;
// aapt resource value: 0x7f0100db
public const int searchIcon = 2130772187;
// aapt resource value: 0x7f01008d
public const int searchViewStyle = 2130772109;
// aapt resource value: 0x7f0100b8
public const int seekBarStyle = 2130772152;
// aapt resource value: 0x7f01007d
public const int selectableItemBackground = 2130772093;
// aapt resource value: 0x7f01007e
public const int selectableItemBackgroundBorderless = 2130772094;
// aapt resource value: 0x7f0100cb
public const int showAsAction = 2130772171;
// aapt resource value: 0x7f0100c9
public const int showDividers = 2130772169;
// aapt resource value: 0x7f0100ec
public const int showText = 2130772204;
// aapt resource value: 0x7f010042
public const int showTitle = 2130772034;
// aapt resource value: 0x7f010040
public const int singleChoiceItemLayout = 2130772032;
// aapt resource value: 0x7f010001
public const int spanCount = 2130771969;
// aapt resource value: 0x7f0100c1
public const int spinBars = 2130772161;
// aapt resource value: 0x7f010078
public const int spinnerDropDownItemStyle = 2130772088;
// aapt resource value: 0x7f0100b9
public const int spinnerStyle = 2130772153;
// aapt resource value: 0x7f0100eb
public const int splitTrack = 2130772203;
// aapt resource value: 0x7f010043
public const int srcCompat = 2130772035;
// aapt resource value: 0x7f010003
public const int stackFromEnd = 2130771971;
// aapt resource value: 0x7f0100d2
public const int state_above_anchor = 2130772178;
// aapt resource value: 0x7f010104
public const int state_collapsed = 2130772228;
// aapt resource value: 0x7f010105
public const int state_collapsible = 2130772229;
// aapt resource value: 0x7f01011d
public const int statusBarBackground = 2130772253;
// aapt resource value: 0x7f010113
public const int statusBarScrim = 2130772243;
// aapt resource value: 0x7f0100d0
public const int subMenuArrow = 2130772176;
// aapt resource value: 0x7f0100e1
public const int submitBackground = 2130772193;
// aapt resource value: 0x7f010022
public const int subtitle = 2130772002;
// aapt resource value: 0x7f0100ee
public const int subtitleTextAppearance = 2130772206;
// aapt resource value: 0x7f0100fd
public const int subtitleTextColor = 2130772221;
// aapt resource value: 0x7f010024
public const int subtitleTextStyle = 2130772004;
// aapt resource value: 0x7f0100df
public const int suggestionRowLayout = 2130772191;
// aapt resource value: 0x7f0100e9
public const int switchMinWidth = 2130772201;
// aapt resource value: 0x7f0100ea
public const int switchPadding = 2130772202;
// aapt resource value: 0x7f0100ba
public const int switchStyle = 2130772154;
// aapt resource value: 0x7f0100e8
public const int switchTextAppearance = 2130772200;
// aapt resource value: 0x7f01013a
public const int tabBackground = 2130772282;
// aapt resource value: 0x7f010139
public const int tabContentStart = 2130772281;
// aapt resource value: 0x7f01013c
public const int tabGravity = 2130772284;
// aapt resource value: 0x7f010137
public const int tabIndicatorColor = 2130772279;
// aapt resource value: 0x7f010138
public const int tabIndicatorHeight = 2130772280;
// aapt resource value: 0x7f01013e
public const int tabMaxWidth = 2130772286;
// aapt resource value: 0x7f01013d
public const int tabMinWidth = 2130772285;
// aapt resource value: 0x7f01013b
public const int tabMode = 2130772283;
// aapt resource value: 0x7f010146
public const int tabPadding = 2130772294;
// aapt resource value: 0x7f010145
public const int tabPaddingBottom = 2130772293;
// aapt resource value: 0x7f010144
public const int tabPaddingEnd = 2130772292;
// aapt resource value: 0x7f010142
public const int tabPaddingStart = 2130772290;
// aapt resource value: 0x7f010143
public const int tabPaddingTop = 2130772291;
// aapt resource value: 0x7f010141
public const int tabSelectedTextColor = 2130772289;
// aapt resource value: 0x7f01013f
public const int tabTextAppearance = 2130772287;
// aapt resource value: 0x7f010140
public const int tabTextColor = 2130772288;
// aapt resource value: 0x7f010049
public const int textAllCaps = 2130772041;
// aapt resource value: 0x7f010070
public const int textAppearanceLargePopupMenu = 2130772080;
// aapt resource value: 0x7f010095
public const int textAppearanceListItem = 2130772117;
// aapt resource value: 0x7f010096
public const int textAppearanceListItemSecondary = 2130772118;
// aapt resource value: 0x7f010097
public const int textAppearanceListItemSmall = 2130772119;
// aapt resource value: 0x7f010072
public const int textAppearancePopupMenuHeader = 2130772082;
// aapt resource value: 0x7f01008b
public const int textAppearanceSearchResultSubtitle = 2130772107;
// aapt resource value: 0x7f01008a
public const int textAppearanceSearchResultTitle = 2130772106;
// aapt resource value: 0x7f010071
public const int textAppearanceSmallPopupMenu = 2130772081;
// aapt resource value: 0x7f0100aa
public const int textColorAlertDialogListItem = 2130772138;
// aapt resource value: 0x7f010126
public const int textColorError = 2130772262;
// aapt resource value: 0x7f01008c
public const int textColorSearchUrl = 2130772108;
// aapt resource value: 0x7f010100
public const int theme = 2130772224;
// aapt resource value: 0x7f0100c7
public const int thickness = 2130772167;
// aapt resource value: 0x7f0100e7
public const int thumbTextPadding = 2130772199;
// aapt resource value: 0x7f0100e2
public const int thumbTint = 2130772194;
// aapt resource value: 0x7f0100e3
public const int thumbTintMode = 2130772195;
// aapt resource value: 0x7f010046
public const int tickMark = 2130772038;
// aapt resource value: 0x7f010047
public const int tickMarkTint = 2130772039;
// aapt resource value: 0x7f010048
public const int tickMarkTintMode = 2130772040;
// aapt resource value: 0x7f010044
public const int tint = 2130772036;
// aapt resource value: 0x7f010045
public const int tintMode = 2130772037;
// aapt resource value: 0x7f01001f
public const int title = 2130771999;
// aapt resource value: 0x7f010119
public const int titleEnabled = 2130772249;
// aapt resource value: 0x7f0100ef
public const int titleMargin = 2130772207;
// aapt resource value: 0x7f0100f3
public const int titleMarginBottom = 2130772211;
// aapt resource value: 0x7f0100f1
public const int titleMarginEnd = 2130772209;
// aapt resource value: 0x7f0100f0
public const int titleMarginStart = 2130772208;
// aapt resource value: 0x7f0100f2
public const int titleMarginTop = 2130772210;
// aapt resource value: 0x7f0100f4
public const int titleMargins = 2130772212;
// aapt resource value: 0x7f0100ed
public const int titleTextAppearance = 2130772205;
// aapt resource value: 0x7f0100fc
public const int titleTextColor = 2130772220;
// aapt resource value: 0x7f010023
public const int titleTextStyle = 2130772003;
// aapt resource value: 0x7f010114
public const int toolbarId = 2130772244;
// aapt resource value: 0x7f010084
public const int toolbarNavigationButtonStyle = 2130772100;
// aapt resource value: 0x7f010083
public const int toolbarStyle = 2130772099;
// aapt resource value: 0x7f0100e4
public const int track = 2130772196;
// aapt resource value: 0x7f0100e5
public const int trackTint = 2130772197;
// aapt resource value: 0x7f0100e6
public const int trackTintMode = 2130772198;
// aapt resource value: 0x7f01012b
public const int useCompatPadding = 2130772267;
// aapt resource value: 0x7f0100dd
public const int voiceIcon = 2130772189;
// aapt resource value: 0x7f01004a
public const int windowActionBar = 2130772042;
// aapt resource value: 0x7f01004c
public const int windowActionBarOverlay = 2130772044;
// aapt resource value: 0x7f01004d
public const int windowActionModeOverlay = 2130772045;
// aapt resource value: 0x7f010051
public const int windowFixedHeightMajor = 2130772049;
// aapt resource value: 0x7f01004f
public const int windowFixedHeightMinor = 2130772047;
// aapt resource value: 0x7f01004e
public const int windowFixedWidthMajor = 2130772046;
// aapt resource value: 0x7f010050
public const int windowFixedWidthMinor = 2130772048;
// aapt resource value: 0x7f010052
public const int windowMinWidthMajor = 2130772050;
// aapt resource value: 0x7f010053
public const int windowMinWidthMinor = 2130772051;
// aapt resource value: 0x7f01004b
public const int windowNoTitle = 2130772043;
static Attribute()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
private Attribute()
{
}
}
public partial class Boolean
{
// aapt resource value: 0x7f0d0000
public const int abc_action_bar_embed_tabs = 2131558400;
// aapt resource value: 0x7f0d0001
public const int abc_allow_stacked_button_bar = 2131558401;
// aapt resource value: 0x7f0d0002
public const int abc_config_actionMenuItemAllCaps = 2131558402;
// aapt resource value: 0x7f0d0003
public const int abc_config_closeDialogWhenTouchOutside = 2131558403;
// aapt resource value: 0x7f0d0004
public const int abc_config_showMenuShortcutsWhenKeyboardPresent = 2131558404;
static Boolean()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
private Boolean()
{
}
}
public partial class Color
{
// aapt resource value: 0x7f0c004a
public const int abc_background_cache_hint_selector_material_dark = 2131492938;
// aapt resource value: 0x7f0c004b
public const int abc_background_cache_hint_selector_material_light = 2131492939;
// aapt resource value: 0x7f0c004c
public const int abc_btn_colored_borderless_text_material = 2131492940;
// aapt resource value: 0x7f0c004d
public const int abc_btn_colored_text_material = 2131492941;
// aapt resource value: 0x7f0c004e
public const int abc_color_highlight_material = 2131492942;
// aapt resource value: 0x7f0c004f
public const int abc_hint_foreground_material_dark = 2131492943;
// aapt resource value: 0x7f0c0050
public const int abc_hint_foreground_material_light = 2131492944;
// aapt resource value: 0x7f0c0005
public const int abc_input_method_navigation_guard = 2131492869;
// aapt resource value: 0x7f0c0051
public const int abc_primary_text_disable_only_material_dark = 2131492945;
// aapt resource value: 0x7f0c0052
public const int abc_primary_text_disable_only_material_light = 2131492946;
// aapt resource value: 0x7f0c0053
public const int abc_primary_text_material_dark = 2131492947;
// aapt resource value: 0x7f0c0054
public const int abc_primary_text_material_light = 2131492948;
// aapt resource value: 0x7f0c0055
public const int abc_search_url_text = 2131492949;
// aapt resource value: 0x7f0c0006
public const int abc_search_url_text_normal = 2131492870;
// aapt resource value: 0x7f0c0007
public const int abc_search_url_text_pressed = 2131492871;
// aapt resource value: 0x7f0c0008
public const int abc_search_url_text_selected = 2131492872;
// aapt resource value: 0x7f0c0056
public const int abc_secondary_text_material_dark = 2131492950;
// aapt resource value: 0x7f0c0057
public const int abc_secondary_text_material_light = 2131492951;
// aapt resource value: 0x7f0c0058
public const int abc_tint_btn_checkable = 2131492952;
// aapt resource value: 0x7f0c0059
public const int abc_tint_default = 2131492953;
// aapt resource value: 0x7f0c005a
public const int abc_tint_edittext = 2131492954;
// aapt resource value: 0x7f0c005b
public const int abc_tint_seek_thumb = 2131492955;
// aapt resource value: 0x7f0c005c
public const int abc_tint_spinner = 2131492956;
// aapt resource value: 0x7f0c005d
public const int abc_tint_switch_thumb = 2131492957;
// aapt resource value: 0x7f0c005e
public const int abc_tint_switch_track = 2131492958;
// aapt resource value: 0x7f0c0009
public const int accent_material_dark = 2131492873;
// aapt resource value: 0x7f0c000a
public const int accent_material_light = 2131492874;
// aapt resource value: 0x7f0c000b
public const int background_floating_material_dark = 2131492875;
// aapt resource value: 0x7f0c000c
public const int background_floating_material_light = 2131492876;
// aapt resource value: 0x7f0c000d
public const int background_material_dark = 2131492877;
// aapt resource value: 0x7f0c000e
public const int background_material_light = 2131492878;
// aapt resource value: 0x7f0c000f
public const int bright_foreground_disabled_material_dark = 2131492879;
// aapt resource value: 0x7f0c0010
public const int bright_foreground_disabled_material_light = 2131492880;
// aapt resource value: 0x7f0c0011
public const int bright_foreground_inverse_material_dark = 2131492881;
// aapt resource value: 0x7f0c0012
public const int bright_foreground_inverse_material_light = 2131492882;
// aapt resource value: 0x7f0c0013
public const int bright_foreground_material_dark = 2131492883;
// aapt resource value: 0x7f0c0014
public const int bright_foreground_material_light = 2131492884;
// aapt resource value: 0x7f0c0015
public const int button_material_dark = 2131492885;
// aapt resource value: 0x7f0c0016
public const int button_material_light = 2131492886;
// aapt resource value: 0x7f0c0000
public const int cardview_dark_background = 2131492864;
// aapt resource value: 0x7f0c0001
public const int cardview_light_background = 2131492865;
// aapt resource value: 0x7f0c0002
public const int cardview_shadow_end_color = 2131492866;
// aapt resource value: 0x7f0c0003
public const int cardview_shadow_start_color = 2131492867;
// aapt resource value: 0x7f0c003f
public const int design_bottom_navigation_shadow_color = 2131492927;
// aapt resource value: 0x7f0c005f
public const int design_error = 2131492959;
// aapt resource value: 0x7f0c0040
public const int design_fab_shadow_end_color = 2131492928;
// aapt resource value: 0x7f0c0041
public const int design_fab_shadow_mid_color = 2131492929;
// aapt resource value: 0x7f0c0042
public const int design_fab_shadow_start_color = 2131492930;
// aapt resource value: 0x7f0c0043
public const int design_fab_stroke_end_inner_color = 2131492931;
// aapt resource value: 0x7f0c0044
public const int design_fab_stroke_end_outer_color = 2131492932;
// aapt resource value: 0x7f0c0045
public const int design_fab_stroke_top_inner_color = 2131492933;
// aapt resource value: 0x7f0c0046
public const int design_fab_stroke_top_outer_color = 2131492934;
// aapt resource value: 0x7f0c0047
public const int design_snackbar_background_color = 2131492935;
// aapt resource value: 0x7f0c0048
public const int design_textinput_error_color_dark = 2131492936;
// aapt resource value: 0x7f0c0049
public const int design_textinput_error_color_light = 2131492937;
// aapt resource value: 0x7f0c0060
public const int design_tint_password_toggle = 2131492960;
// aapt resource value: 0x7f0c0017
public const int dim_foreground_disabled_material_dark = 2131492887;
// aapt resource value: 0x7f0c0018
public const int dim_foreground_disabled_material_light = 2131492888;
// aapt resource value: 0x7f0c0019
public const int dim_foreground_material_dark = 2131492889;
// aapt resource value: 0x7f0c001a
public const int dim_foreground_material_light = 2131492890;
// aapt resource value: 0x7f0c001b
public const int foreground_material_dark = 2131492891;
// aapt resource value: 0x7f0c001c
public const int foreground_material_light = 2131492892;
// aapt resource value: 0x7f0c001d
public const int highlighted_text_material_dark = 2131492893;
// aapt resource value: 0x7f0c001e
public const int highlighted_text_material_light = 2131492894;
// aapt resource value: 0x7f0c001f
public const int material_blue_grey_800 = 2131492895;
// aapt resource value: 0x7f0c0020
public const int material_blue_grey_900 = 2131492896;
// aapt resource value: 0x7f0c0021
public const int material_blue_grey_950 = 2131492897;
// aapt resource value: 0x7f0c0022
public const int material_deep_teal_200 = 2131492898;
// aapt resource value: 0x7f0c0023
public const int material_deep_teal_500 = 2131492899;
// aapt resource value: 0x7f0c0024
public const int material_grey_100 = 2131492900;
// aapt resource value: 0x7f0c0025
public const int material_grey_300 = 2131492901;
// aapt resource value: 0x7f0c0026
public const int material_grey_50 = 2131492902;
// aapt resource value: 0x7f0c0027
public const int material_grey_600 = 2131492903;
// aapt resource value: 0x7f0c0028
public const int material_grey_800 = 2131492904;
// aapt resource value: 0x7f0c0029
public const int material_grey_850 = 2131492905;
// aapt resource value: 0x7f0c002a
public const int material_grey_900 = 2131492906;
// aapt resource value: 0x7f0c0004
public const int notification_action_color_filter = 2131492868;
// aapt resource value: 0x7f0c002b
public const int notification_icon_bg_color = 2131492907;
// aapt resource value: 0x7f0c002c
public const int notification_material_background_media_default_color = 2131492908;
// aapt resource value: 0x7f0c002d
public const int primary_dark_material_dark = 2131492909;
// aapt resource value: 0x7f0c002e
public const int primary_dark_material_light = 2131492910;
// aapt resource value: 0x7f0c002f
public const int primary_material_dark = 2131492911;
// aapt resource value: 0x7f0c0030
public const int primary_material_light = 2131492912;
// aapt resource value: 0x7f0c0031
public const int primary_text_default_material_dark = 2131492913;
// aapt resource value: 0x7f0c0032
public const int primary_text_default_material_light = 2131492914;
// aapt resource value: 0x7f0c0033
public const int primary_text_disabled_material_dark = 2131492915;
// aapt resource value: 0x7f0c0034
public const int primary_text_disabled_material_light = 2131492916;
// aapt resource value: 0x7f0c0035
public const int ripple_material_dark = 2131492917;
// aapt resource value: 0x7f0c0036
public const int ripple_material_light = 2131492918;
// aapt resource value: 0x7f0c0037
public const int secondary_text_default_material_dark = 2131492919;
// aapt resource value: 0x7f0c0038
public const int secondary_text_default_material_light = 2131492920;
// aapt resource value: 0x7f0c0039
public const int secondary_text_disabled_material_dark = 2131492921;
// aapt resource value: 0x7f0c003a
public const int secondary_text_disabled_material_light = 2131492922;
// aapt resource value: 0x7f0c003b
public const int switch_thumb_disabled_material_dark = 2131492923;
// aapt resource value: 0x7f0c003c
public const int switch_thumb_disabled_material_light = 2131492924;
// aapt resource value: 0x7f0c0061
public const int switch_thumb_material_dark = 2131492961;
// aapt resource value: 0x7f0c0062
public const int switch_thumb_material_light = 2131492962;
// aapt resource value: 0x7f0c003d
public const int switch_thumb_normal_material_dark = 2131492925;
// aapt resource value: 0x7f0c003e
public const int switch_thumb_normal_material_light = 2131492926;
static Color()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
private Color()
{
}
}
public partial class Dimension
{
// aapt resource value: 0x7f070018
public const int abc_action_bar_content_inset_material = 2131165208;
// aapt resource value: 0x7f070019
public const int abc_action_bar_content_inset_with_nav = 2131165209;
// aapt resource value: 0x7f07000d
public const int abc_action_bar_default_height_material = 2131165197;
// aapt resource value: 0x7f07001a
public const int abc_action_bar_default_padding_end_material = 2131165210;
// aapt resource value: 0x7f07001b
public const int abc_action_bar_default_padding_start_material = 2131165211;
// aapt resource value: 0x7f070021
public const int abc_action_bar_elevation_material = 2131165217;
// aapt resource value: 0x7f070022
public const int abc_action_bar_icon_vertical_padding_material = 2131165218;
// aapt resource value: 0x7f070023
public const int abc_action_bar_overflow_padding_end_material = 2131165219;
// aapt resource value: 0x7f070024
public const int abc_action_bar_overflow_padding_start_material = 2131165220;
// aapt resource value: 0x7f07000e
public const int abc_action_bar_progress_bar_size = 2131165198;
// aapt resource value: 0x7f070025
public const int abc_action_bar_stacked_max_height = 2131165221;
// aapt resource value: 0x7f070026
public const int abc_action_bar_stacked_tab_max_width = 2131165222;
// aapt resource value: 0x7f070027
public const int abc_action_bar_subtitle_bottom_margin_material = 2131165223;
// aapt resource value: 0x7f070028
public const int abc_action_bar_subtitle_top_margin_material = 2131165224;
// aapt resource value: 0x7f070029
public const int abc_action_button_min_height_material = 2131165225;
// aapt resource value: 0x7f07002a
public const int abc_action_button_min_width_material = 2131165226;
// aapt resource value: 0x7f07002b
public const int abc_action_button_min_width_overflow_material = 2131165227;
// aapt resource value: 0x7f07000c
public const int abc_alert_dialog_button_bar_height = 2131165196;
// aapt resource value: 0x7f07002c
public const int abc_button_inset_horizontal_material = 2131165228;
// aapt resource value: 0x7f07002d
public const int abc_button_inset_vertical_material = 2131165229;
// aapt resource value: 0x7f07002e
public const int abc_button_padding_horizontal_material = 2131165230;
// aapt resource value: 0x7f07002f
public const int abc_button_padding_vertical_material = 2131165231;
// aapt resource value: 0x7f070030
public const int abc_cascading_menus_min_smallest_width = 2131165232;
// aapt resource value: 0x7f070011
public const int abc_config_prefDialogWidth = 2131165201;
// aapt resource value: 0x7f070031
public const int abc_control_corner_material = 2131165233;
// aapt resource value: 0x7f070032
public const int abc_control_inset_material = 2131165234;
// aapt resource value: 0x7f070033
public const int abc_control_padding_material = 2131165235;
// aapt resource value: 0x7f070012
public const int abc_dialog_fixed_height_major = 2131165202;
// aapt resource value: 0x7f070013
public const int abc_dialog_fixed_height_minor = 2131165203;
// aapt resource value: 0x7f070014
public const int abc_dialog_fixed_width_major = 2131165204;
// aapt resource value: 0x7f070015
public const int abc_dialog_fixed_width_minor = 2131165205;
// aapt resource value: 0x7f070034
public const int abc_dialog_list_padding_bottom_no_buttons = 2131165236;
// aapt resource value: 0x7f070035
public const int abc_dialog_list_padding_top_no_title = 2131165237;
// aapt resource value: 0x7f070016
public const int abc_dialog_min_width_major = 2131165206;
// aapt resource value: 0x7f070017
public const int abc_dialog_min_width_minor = 2131165207;
// aapt resource value: 0x7f070036
public const int abc_dialog_padding_material = 2131165238;
// aapt resource value: 0x7f070037
public const int abc_dialog_padding_top_material = 2131165239;
// aapt resource value: 0x7f070038
public const int abc_dialog_title_divider_material = 2131165240;
// aapt resource value: 0x7f070039
public const int abc_disabled_alpha_material_dark = 2131165241;
// aapt resource value: 0x7f07003a
public const int abc_disabled_alpha_material_light = 2131165242;
// aapt resource value: 0x7f07003b
public const int abc_dropdownitem_icon_width = 2131165243;
// aapt resource value: 0x7f07003c
public const int abc_dropdownitem_text_padding_left = 2131165244;
// aapt resource value: 0x7f07003d
public const int abc_dropdownitem_text_padding_right = 2131165245;
// aapt resource value: 0x7f07003e
public const int abc_edit_text_inset_bottom_material = 2131165246;
// aapt resource value: 0x7f07003f
public const int abc_edit_text_inset_horizontal_material = 2131165247;
// aapt resource value: 0x7f070040
public const int abc_edit_text_inset_top_material = 2131165248;
// aapt resource value: 0x7f070041
public const int abc_floating_window_z = 2131165249;
// aapt resource value: 0x7f070042
public const int abc_list_item_padding_horizontal_material = 2131165250;
// aapt resource value: 0x7f070043
public const int abc_panel_menu_list_width = 2131165251;
// aapt resource value: 0x7f070044
public const int abc_progress_bar_height_material = 2131165252;
// aapt resource value: 0x7f070045
public const int abc_search_view_preferred_height = 2131165253;
// aapt resource value: 0x7f070046
public const int abc_search_view_preferred_width = 2131165254;
// aapt resource value: 0x7f070047
public const int abc_seekbar_track_background_height_material = 2131165255;
// aapt resource value: 0x7f070048
public const int abc_seekbar_track_progress_height_material = 2131165256;
// aapt resource value: 0x7f070049
public const int abc_select_dialog_padding_start_material = 2131165257;
// aapt resource value: 0x7f07001d
public const int abc_switch_padding = 2131165213;
// aapt resource value: 0x7f07004a
public const int abc_text_size_body_1_material = 2131165258;
// aapt resource value: 0x7f07004b
public const int abc_text_size_body_2_material = 2131165259;
// aapt resource value: 0x7f07004c
public const int abc_text_size_button_material = 2131165260;
// aapt resource value: 0x7f07004d
public const int abc_text_size_caption_material = 2131165261;
// aapt resource value: 0x7f07004e
public const int abc_text_size_display_1_material = 2131165262;
// aapt resource value: 0x7f07004f
public const int abc_text_size_display_2_material = 2131165263;
// aapt resource value: 0x7f070050
public const int abc_text_size_display_3_material = 2131165264;
// aapt resource value: 0x7f070051
public const int abc_text_size_display_4_material = 2131165265;
// aapt resource value: 0x7f070052
public const int abc_text_size_headline_material = 2131165266;
// aapt resource value: 0x7f070053
public const int abc_text_size_large_material = 2131165267;
// aapt resource value: 0x7f070054
public const int abc_text_size_medium_material = 2131165268;
// aapt resource value: 0x7f070055
public const int abc_text_size_menu_header_material = 2131165269;
// aapt resource value: 0x7f070056
public const int abc_text_size_menu_material = 2131165270;
// aapt resource value: 0x7f070057
public const int abc_text_size_small_material = 2131165271;
// aapt resource value: 0x7f070058
public const int abc_text_size_subhead_material = 2131165272;
// aapt resource value: 0x7f07000f
public const int abc_text_size_subtitle_material_toolbar = 2131165199;
// aapt resource value: 0x7f070059
public const int abc_text_size_title_material = 2131165273;
// aapt resource value: 0x7f070010
public const int abc_text_size_title_material_toolbar = 2131165200;
// aapt resource value: 0x7f070009
public const int cardview_compat_inset_shadow = 2131165193;
// aapt resource value: 0x7f07000a
public const int cardview_default_elevation = 2131165194;
// aapt resource value: 0x7f07000b
public const int cardview_default_radius = 2131165195;
// aapt resource value: 0x7f070076
public const int design_appbar_elevation = 2131165302;
// aapt resource value: 0x7f070077
public const int design_bottom_navigation_active_item_max_width = 2131165303;
// aapt resource value: 0x7f070078
public const int design_bottom_navigation_active_text_size = 2131165304;
// aapt resource value: 0x7f070079
public const int design_bottom_navigation_elevation = 2131165305;
// aapt resource value: 0x7f07007a
public const int design_bottom_navigation_height = 2131165306;
// aapt resource value: 0x7f07007b
public const int design_bottom_navigation_item_max_width = 2131165307;
// aapt resource value: 0x7f07007c
public const int design_bottom_navigation_item_min_width = 2131165308;
// aapt resource value: 0x7f07007d
public const int design_bottom_navigation_margin = 2131165309;
// aapt resource value: 0x7f07007e
public const int design_bottom_navigation_shadow_height = 2131165310;
// aapt resource value: 0x7f07007f
public const int design_bottom_navigation_text_size = 2131165311;
// aapt resource value: 0x7f070080
public const int design_bottom_sheet_modal_elevation = 2131165312;
// aapt resource value: 0x7f070081
public const int design_bottom_sheet_peek_height_min = 2131165313;
// aapt resource value: 0x7f070082
public const int design_fab_border_width = 2131165314;
// aapt resource value: 0x7f070083
public const int design_fab_elevation = 2131165315;
// aapt resource value: 0x7f070084
public const int design_fab_image_size = 2131165316;
// aapt resource value: 0x7f070085
public const int design_fab_size_mini = 2131165317;
// aapt resource value: 0x7f070086
public const int design_fab_size_normal = 2131165318;
// aapt resource value: 0x7f070087
public const int design_fab_translation_z_pressed = 2131165319;
// aapt resource value: 0x7f070088
public const int design_navigation_elevation = 2131165320;
// aapt resource value: 0x7f070089
public const int design_navigation_icon_padding = 2131165321;
// aapt resource value: 0x7f07008a
public const int design_navigation_icon_size = 2131165322;
// aapt resource value: 0x7f07006e
public const int design_navigation_max_width = 2131165294;
// aapt resource value: 0x7f07008b
public const int design_navigation_padding_bottom = 2131165323;
// aapt resource value: 0x7f07008c
public const int design_navigation_separator_vertical_padding = 2131165324;
// aapt resource value: 0x7f07006f
public const int design_snackbar_action_inline_max_width = 2131165295;
// aapt resource value: 0x7f070070
public const int design_snackbar_background_corner_radius = 2131165296;
// aapt resource value: 0x7f07008d
public const int design_snackbar_elevation = 2131165325;
// aapt resource value: 0x7f070071
public const int design_snackbar_extra_spacing_horizontal = 2131165297;
// aapt resource value: 0x7f070072
public const int design_snackbar_max_width = 2131165298;
// aapt resource value: 0x7f070073
public const int design_snackbar_min_width = 2131165299;
// aapt resource value: 0x7f07008e
public const int design_snackbar_padding_horizontal = 2131165326;
// aapt resource value: 0x7f07008f
public const int design_snackbar_padding_vertical = 2131165327;
// aapt resource value: 0x7f070074
public const int design_snackbar_padding_vertical_2lines = 2131165300;
// aapt resource value: 0x7f070090
public const int design_snackbar_text_size = 2131165328;
// aapt resource value: 0x7f070091
public const int design_tab_max_width = 2131165329;
// aapt resource value: 0x7f070075
public const int design_tab_scrollable_min_width = 2131165301;
// aapt resource value: 0x7f070092
public const int design_tab_text_size = 2131165330;
// aapt resource value: 0x7f070093
public const int design_tab_text_size_2line = 2131165331;
// aapt resource value: 0x7f07005a
public const int disabled_alpha_material_dark = 2131165274;
// aapt resource value: 0x7f07005b
public const int disabled_alpha_material_light = 2131165275;
// aapt resource value: 0x7f07005c
public const int highlight_alpha_material_colored = 2131165276;
// aapt resource value: 0x7f07005d
public const int highlight_alpha_material_dark = 2131165277;
// aapt resource value: 0x7f07005e
public const int highlight_alpha_material_light = 2131165278;
// aapt resource value: 0x7f07005f
public const int hint_alpha_material_dark = 2131165279;
// aapt resource value: 0x7f070060
public const int hint_alpha_material_light = 2131165280;
// aapt resource value: 0x7f070061
public const int hint_pressed_alpha_material_dark = 2131165281;
// aapt resource value: 0x7f070062
public const int hint_pressed_alpha_material_light = 2131165282;
// aapt resource value: 0x7f070000
public const int item_touch_helper_max_drag_scroll_per_frame = 2131165184;
// aapt resource value: 0x7f070001
public const int item_touch_helper_swipe_escape_max_velocity = 2131165185;
// aapt resource value: 0x7f070002
public const int item_touch_helper_swipe_escape_velocity = 2131165186;
// aapt resource value: 0x7f070003
public const int mr_controller_volume_group_list_item_height = 2131165187;
// aapt resource value: 0x7f070004
public const int mr_controller_volume_group_list_item_icon_size = 2131165188;
// aapt resource value: 0x7f070005
public const int mr_controller_volume_group_list_max_height = 2131165189;
// aapt resource value: 0x7f070008
public const int mr_controller_volume_group_list_padding_top = 2131165192;
// aapt resource value: 0x7f070006
public const int mr_dialog_fixed_width_major = 2131165190;
// aapt resource value: 0x7f070007
public const int mr_dialog_fixed_width_minor = 2131165191;
// aapt resource value: 0x7f070063
public const int notification_action_icon_size = 2131165283;
// aapt resource value: 0x7f070064
public const int notification_action_text_size = 2131165284;
// aapt resource value: 0x7f070065
public const int notification_big_circle_margin = 2131165285;
// aapt resource value: 0x7f07001e
public const int notification_content_margin_start = 2131165214;
// aapt resource value: 0x7f070066
public const int notification_large_icon_height = 2131165286;
// aapt resource value: 0x7f070067
public const int notification_large_icon_width = 2131165287;
// aapt resource value: 0x7f07001f
public const int notification_main_column_padding_top = 2131165215;
// aapt resource value: 0x7f070020
public const int notification_media_narrow_margin = 2131165216;
// aapt resource value: 0x7f070068
public const int notification_right_icon_size = 2131165288;
// aapt resource value: 0x7f07001c
public const int notification_right_side_padding_top = 2131165212;
// aapt resource value: 0x7f070069
public const int notification_small_icon_background_padding = 2131165289;
// aapt resource value: 0x7f07006a
public const int notification_small_icon_size_as_large = 2131165290;
// aapt resource value: 0x7f07006b
public const int notification_subtext_size = 2131165291;
// aapt resource value: 0x7f07006c
public const int notification_top_pad = 2131165292;
// aapt resource value: 0x7f07006d
public const int notification_top_pad_large_text = 2131165293;
static Dimension()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
private Dimension()
{
}
}
public partial class Drawable
{
// aapt resource value: 0x7f020000
public const int abc_ab_share_pack_mtrl_alpha = 2130837504;
// aapt resource value: 0x7f020001
public const int abc_action_bar_item_background_material = 2130837505;
// aapt resource value: 0x7f020002
public const int abc_btn_borderless_material = 2130837506;
// aapt resource value: 0x7f020003
public const int abc_btn_check_material = 2130837507;
// aapt resource value: 0x7f020004
public const int abc_btn_check_to_on_mtrl_000 = 2130837508;
// aapt resource value: 0x7f020005
public const int abc_btn_check_to_on_mtrl_015 = 2130837509;
// aapt resource value: 0x7f020006
public const int abc_btn_colored_material = 2130837510;
// aapt resource value: 0x7f020007
public const int abc_btn_default_mtrl_shape = 2130837511;
// aapt resource value: 0x7f020008
public const int abc_btn_radio_material = 2130837512;
// aapt resource value: 0x7f020009
public const int abc_btn_radio_to_on_mtrl_000 = 2130837513;
// aapt resource value: 0x7f02000a
public const int abc_btn_radio_to_on_mtrl_015 = 2130837514;
// aapt resource value: 0x7f02000b
public const int abc_btn_switch_to_on_mtrl_00001 = 2130837515;
// aapt resource value: 0x7f02000c
public const int abc_btn_switch_to_on_mtrl_00012 = 2130837516;
// aapt resource value: 0x7f02000d
public const int abc_cab_background_internal_bg = 2130837517;
// aapt resource value: 0x7f02000e
public const int abc_cab_background_top_material = 2130837518;
// aapt resource value: 0x7f02000f
public const int abc_cab_background_top_mtrl_alpha = 2130837519;
// aapt resource value: 0x7f020010
public const int abc_control_background_material = 2130837520;
// aapt resource value: 0x7f020011
public const int abc_dialog_material_background = 2130837521;
// aapt resource value: 0x7f020012
public const int abc_edit_text_material = 2130837522;
// aapt resource value: 0x7f020013
public const int abc_ic_ab_back_material = 2130837523;
// aapt resource value: 0x7f020014
public const int abc_ic_arrow_drop_right_black_24dp = 2130837524;
// aapt resource value: 0x7f020015
public const int abc_ic_clear_material = 2130837525;
// aapt resource value: 0x7f020016
public const int abc_ic_commit_search_api_mtrl_alpha = 2130837526;
// aapt resource value: 0x7f020017
public const int abc_ic_go_search_api_material = 2130837527;
// aapt resource value: 0x7f020018
public const int abc_ic_menu_copy_mtrl_am_alpha = 2130837528;
// aapt resource value: 0x7f020019
public const int abc_ic_menu_cut_mtrl_alpha = 2130837529;
// aapt resource value: 0x7f02001a
public const int abc_ic_menu_overflow_material = 2130837530;
// aapt resource value: 0x7f02001b
public const int abc_ic_menu_paste_mtrl_am_alpha = 2130837531;
// aapt resource value: 0x7f02001c
public const int abc_ic_menu_selectall_mtrl_alpha = 2130837532;
// aapt resource value: 0x7f02001d
public const int abc_ic_menu_share_mtrl_alpha = 2130837533;
// aapt resource value: 0x7f02001e
public const int abc_ic_search_api_material = 2130837534;
// aapt resource value: 0x7f02001f
public const int abc_ic_star_black_16dp = 2130837535;
// aapt resource value: 0x7f020020
public const int abc_ic_star_black_36dp = 2130837536;
// aapt resource value: 0x7f020021
public const int abc_ic_star_black_48dp = 2130837537;
// aapt resource value: 0x7f020022
public const int abc_ic_star_half_black_16dp = 2130837538;
// aapt resource value: 0x7f020023
public const int abc_ic_star_half_black_36dp = 2130837539;
// aapt resource value: 0x7f020024
public const int abc_ic_star_half_black_48dp = 2130837540;
// aapt resource value: 0x7f020025
public const int abc_ic_voice_search_api_material = 2130837541;
// aapt resource value: 0x7f020026
public const int abc_item_background_holo_dark = 2130837542;
// aapt resource value: 0x7f020027
public const int abc_item_background_holo_light = 2130837543;
// aapt resource value: 0x7f020028
public const int abc_list_divider_mtrl_alpha = 2130837544;
// aapt resource value: 0x7f020029
public const int abc_list_focused_holo = 2130837545;
// aapt resource value: 0x7f02002a
public const int abc_list_longpressed_holo = 2130837546;
// aapt resource value: 0x7f02002b
public const int abc_list_pressed_holo_dark = 2130837547;
// aapt resource value: 0x7f02002c
public const int abc_list_pressed_holo_light = 2130837548;
// aapt resource value: 0x7f02002d
public const int abc_list_selector_background_transition_holo_dark = 2130837549;
// aapt resource value: 0x7f02002e
public const int abc_list_selector_background_transition_holo_light = 2130837550;
// aapt resource value: 0x7f02002f
public const int abc_list_selector_disabled_holo_dark = 2130837551;
// aapt resource value: 0x7f020030
public const int abc_list_selector_disabled_holo_light = 2130837552;
// aapt resource value: 0x7f020031
public const int abc_list_selector_holo_dark = 2130837553;
// aapt resource value: 0x7f020032
public const int abc_list_selector_holo_light = 2130837554;
// aapt resource value: 0x7f020033
public const int abc_menu_hardkey_panel_mtrl_mult = 2130837555;
// aapt resource value: 0x7f020034
public const int abc_popup_background_mtrl_mult = 2130837556;
// aapt resource value: 0x7f020035
public const int abc_ratingbar_indicator_material = 2130837557;
// aapt resource value: 0x7f020036
public const int abc_ratingbar_material = 2130837558;
// aapt resource value: 0x7f020037
public const int abc_ratingbar_small_material = 2130837559;
// aapt resource value: 0x7f020038
public const int abc_scrubber_control_off_mtrl_alpha = 2130837560;
// aapt resource value: 0x7f020039
public const int abc_scrubber_control_to_pressed_mtrl_000 = 2130837561;
// aapt resource value: 0x7f02003a
public const int abc_scrubber_control_to_pressed_mtrl_005 = 2130837562;
// aapt resource value: 0x7f02003b
public const int abc_scrubber_primary_mtrl_alpha = 2130837563;
// aapt resource value: 0x7f02003c
public const int abc_scrubber_track_mtrl_alpha = 2130837564;
// aapt resource value: 0x7f02003d
public const int abc_seekbar_thumb_material = 2130837565;
// aapt resource value: 0x7f02003e
public const int abc_seekbar_tick_mark_material = 2130837566;
// aapt resource value: 0x7f02003f
public const int abc_seekbar_track_material = 2130837567;
// aapt resource value: 0x7f020040
public const int abc_spinner_mtrl_am_alpha = 2130837568;
// aapt resource value: 0x7f020041
public const int abc_spinner_textfield_background_material = 2130837569;
// aapt resource value: 0x7f020042
public const int abc_switch_thumb_material = 2130837570;
// aapt resource value: 0x7f020043
public const int abc_switch_track_mtrl_alpha = 2130837571;
// aapt resource value: 0x7f020044
public const int abc_tab_indicator_material = 2130837572;
// aapt resource value: 0x7f020045
public const int abc_tab_indicator_mtrl_alpha = 2130837573;
// aapt resource value: 0x7f020046
public const int abc_text_cursor_material = 2130837574;
// aapt resource value: 0x7f020047
public const int abc_text_select_handle_left_mtrl_dark = 2130837575;
// aapt resource value: 0x7f020048
public const int abc_text_select_handle_left_mtrl_light = 2130837576;
// aapt resource value: 0x7f020049
public const int abc_text_select_handle_middle_mtrl_dark = 2130837577;
// aapt resource value: 0x7f02004a
public const int abc_text_select_handle_middle_mtrl_light = 2130837578;
// aapt resource value: 0x7f02004b
public const int abc_text_select_handle_right_mtrl_dark = 2130837579;
// aapt resource value: 0x7f02004c
public const int abc_text_select_handle_right_mtrl_light = 2130837580;
// aapt resource value: 0x7f02004d
public const int abc_textfield_activated_mtrl_alpha = 2130837581;
// aapt resource value: 0x7f02004e
public const int abc_textfield_default_mtrl_alpha = 2130837582;
// aapt resource value: 0x7f02004f
public const int abc_textfield_search_activated_mtrl_alpha = 2130837583;
// aapt resource value: 0x7f020050
public const int abc_textfield_search_default_mtrl_alpha = 2130837584;
// aapt resource value: 0x7f020051
public const int abc_textfield_search_material = 2130837585;
// aapt resource value: 0x7f020052
public const int abc_vector_test = 2130837586;
// aapt resource value: 0x7f020053
public const int avd_hide_password = 2130837587;
// aapt resource value: 0x7f02010e
public const int avd_hide_password_1 = 2130837774;
// aapt resource value: 0x7f02010f
public const int avd_hide_password_2 = 2130837775;
// aapt resource value: 0x7f020110
public const int avd_hide_password_3 = 2130837776;
// aapt resource value: 0x7f020054
public const int avd_show_password = 2130837588;
// aapt resource value: 0x7f020111
public const int avd_show_password_1 = 2130837777;
// aapt resource value: 0x7f020112
public const int avd_show_password_2 = 2130837778;
// aapt resource value: 0x7f020113
public const int avd_show_password_3 = 2130837779;
// aapt resource value: 0x7f020055
public const int design_bottom_navigation_item_background = 2130837589;
// aapt resource value: 0x7f020056
public const int design_fab_background = 2130837590;
// aapt resource value: 0x7f020057
public const int design_ic_visibility = 2130837591;
// aapt resource value: 0x7f020058
public const int design_ic_visibility_off = 2130837592;
// aapt resource value: 0x7f020059
public const int design_password_eye = 2130837593;
// aapt resource value: 0x7f02005a
public const int design_snackbar_background = 2130837594;
// aapt resource value: 0x7f02005b
public const int ic_audiotrack_dark = 2130837595;
// aapt resource value: 0x7f02005c
public const int ic_audiotrack_light = 2130837596;
// aapt resource value: 0x7f02005d
public const int ic_dialog_close_dark = 2130837597;
// aapt resource value: 0x7f02005e
public const int ic_dialog_close_light = 2130837598;
// aapt resource value: 0x7f02005f
public const int ic_group_collapse_00 = 2130837599;
// aapt resource value: 0x7f020060
public const int ic_group_collapse_01 = 2130837600;
// aapt resource value: 0x7f020061
public const int ic_group_collapse_02 = 2130837601;
// aapt resource value: 0x7f020062
public const int ic_group_collapse_03 = 2130837602;
// aapt resource value: 0x7f020063
public const int ic_group_collapse_04 = 2130837603;
// aapt resource value: 0x7f020064
public const int ic_group_collapse_05 = 2130837604;
// aapt resource value: 0x7f020065
public const int ic_group_collapse_06 = 2130837605;
// aapt resource value: 0x7f020066
public const int ic_group_collapse_07 = 2130837606;
// aapt resource value: 0x7f020067
public const int ic_group_collapse_08 = 2130837607;
// aapt resource value: 0x7f020068
public const int ic_group_collapse_09 = 2130837608;
// aapt resource value: 0x7f020069
public const int ic_group_collapse_10 = 2130837609;
// aapt resource value: 0x7f02006a
public const int ic_group_collapse_11 = 2130837610;
// aapt resource value: 0x7f02006b
public const int ic_group_collapse_12 = 2130837611;
// aapt resource value: 0x7f02006c
public const int ic_group_collapse_13 = 2130837612;
// aapt resource value: 0x7f02006d
public const int ic_group_collapse_14 = 2130837613;
// aapt resource value: 0x7f02006e
public const int ic_group_collapse_15 = 2130837614;
// aapt resource value: 0x7f02006f
public const int ic_group_expand_00 = 2130837615;
// aapt resource value: 0x7f020070
public const int ic_group_expand_01 = 2130837616;
// aapt resource value: 0x7f020071
public const int ic_group_expand_02 = 2130837617;
// aapt resource value: 0x7f020072
public const int ic_group_expand_03 = 2130837618;
// aapt resource value: 0x7f020073
public const int ic_group_expand_04 = 2130837619;
// aapt resource value: 0x7f020074
public const int ic_group_expand_05 = 2130837620;
// aapt resource value: 0x7f020075
public const int ic_group_expand_06 = 2130837621;
// aapt resource value: 0x7f020076
public const int ic_group_expand_07 = 2130837622;
// aapt resource value: 0x7f020077
public const int ic_group_expand_08 = 2130837623;
// aapt resource value: 0x7f020078
public const int ic_group_expand_09 = 2130837624;
// aapt resource value: 0x7f020079
public const int ic_group_expand_10 = 2130837625;
// aapt resource value: 0x7f02007a
public const int ic_group_expand_11 = 2130837626;
// aapt resource value: 0x7f02007b
public const int ic_group_expand_12 = 2130837627;
// aapt resource value: 0x7f02007c
public const int ic_group_expand_13 = 2130837628;
// aapt resource value: 0x7f02007d
public const int ic_group_expand_14 = 2130837629;
// aapt resource value: 0x7f02007e
public const int ic_group_expand_15 = 2130837630;
// aapt resource value: 0x7f02007f
public const int ic_media_pause_dark = 2130837631;
// aapt resource value: 0x7f020080
public const int ic_media_pause_light = 2130837632;
// aapt resource value: 0x7f020081
public const int ic_media_play_dark = 2130837633;
// aapt resource value: 0x7f020082
public const int ic_media_play_light = 2130837634;
// aapt resource value: 0x7f020083
public const int ic_media_stop_dark = 2130837635;
// aapt resource value: 0x7f020084
public const int ic_media_stop_light = 2130837636;
// aapt resource value: 0x7f020085
public const int ic_mr_button_connected_00_dark = 2130837637;
// aapt resource value: 0x7f020086
public const int ic_mr_button_connected_00_light = 2130837638;
// aapt resource value: 0x7f020087
public const int ic_mr_button_connected_01_dark = 2130837639;
// aapt resource value: 0x7f020088
public const int ic_mr_button_connected_01_light = 2130837640;
// aapt resource value: 0x7f020089
public const int ic_mr_button_connected_02_dark = 2130837641;
// aapt resource value: 0x7f02008a
public const int ic_mr_button_connected_02_light = 2130837642;
// aapt resource value: 0x7f02008b
public const int ic_mr_button_connected_03_dark = 2130837643;
// aapt resource value: 0x7f02008c
public const int ic_mr_button_connected_03_light = 2130837644;
// aapt resource value: 0x7f02008d
public const int ic_mr_button_connected_04_dark = 2130837645;
// aapt resource value: 0x7f02008e
public const int ic_mr_button_connected_04_light = 2130837646;
// aapt resource value: 0x7f02008f
public const int ic_mr_button_connected_05_dark = 2130837647;
// aapt resource value: 0x7f020090
public const int ic_mr_button_connected_05_light = 2130837648;
// aapt resource value: 0x7f020091
public const int ic_mr_button_connected_06_dark = 2130837649;
// aapt resource value: 0x7f020092
public const int ic_mr_button_connected_06_light = 2130837650;
// aapt resource value: 0x7f020093
public const int ic_mr_button_connected_07_dark = 2130837651;
// aapt resource value: 0x7f020094
public const int ic_mr_button_connected_07_light = 2130837652;
// aapt resource value: 0x7f020095
public const int ic_mr_button_connected_08_dark = 2130837653;
// aapt resource value: 0x7f020096
public const int ic_mr_button_connected_08_light = 2130837654;
// aapt resource value: 0x7f020097
public const int ic_mr_button_connected_09_dark = 2130837655;
// aapt resource value: 0x7f020098
public const int ic_mr_button_connected_09_light = 2130837656;
// aapt resource value: 0x7f020099
public const int ic_mr_button_connected_10_dark = 2130837657;
// aapt resource value: 0x7f02009a
public const int ic_mr_button_connected_10_light = 2130837658;
// aapt resource value: 0x7f02009b
public const int ic_mr_button_connected_11_dark = 2130837659;
// aapt resource value: 0x7f02009c
public const int ic_mr_button_connected_11_light = 2130837660;
// aapt resource value: 0x7f02009d
public const int ic_mr_button_connected_12_dark = 2130837661;
// aapt resource value: 0x7f02009e
public const int ic_mr_button_connected_12_light = 2130837662;
// aapt resource value: 0x7f02009f
public const int ic_mr_button_connected_13_dark = 2130837663;
// aapt resource value: 0x7f0200a0
public const int ic_mr_button_connected_13_light = 2130837664;
// aapt resource value: 0x7f0200a1
public const int ic_mr_button_connected_14_dark = 2130837665;
// aapt resource value: 0x7f0200a2
public const int ic_mr_button_connected_14_light = 2130837666;
// aapt resource value: 0x7f0200a3
public const int ic_mr_button_connected_15_dark = 2130837667;
// aapt resource value: 0x7f0200a4
public const int ic_mr_button_connected_15_light = 2130837668;
// aapt resource value: 0x7f0200a5
public const int ic_mr_button_connected_16_dark = 2130837669;
// aapt resource value: 0x7f0200a6
public const int ic_mr_button_connected_16_light = 2130837670;
// aapt resource value: 0x7f0200a7
public const int ic_mr_button_connected_17_dark = 2130837671;
// aapt resource value: 0x7f0200a8
public const int ic_mr_button_connected_17_light = 2130837672;
// aapt resource value: 0x7f0200a9
public const int ic_mr_button_connected_18_dark = 2130837673;
// aapt resource value: 0x7f0200aa
public const int ic_mr_button_connected_18_light = 2130837674;
// aapt resource value: 0x7f0200ab
public const int ic_mr_button_connected_19_dark = 2130837675;
// aapt resource value: 0x7f0200ac
public const int ic_mr_button_connected_19_light = 2130837676;
// aapt resource value: 0x7f0200ad
public const int ic_mr_button_connected_20_dark = 2130837677;
// aapt resource value: 0x7f0200ae
public const int ic_mr_button_connected_20_light = 2130837678;
// aapt resource value: 0x7f0200af
public const int ic_mr_button_connected_21_dark = 2130837679;
// aapt resource value: 0x7f0200b0
public const int ic_mr_button_connected_21_light = 2130837680;
// aapt resource value: 0x7f0200b1
public const int ic_mr_button_connected_22_dark = 2130837681;
// aapt resource value: 0x7f0200b2
public const int ic_mr_button_connected_22_light = 2130837682;
// aapt resource value: 0x7f0200b3
public const int ic_mr_button_connecting_00_dark = 2130837683;
// aapt resource value: 0x7f0200b4
public const int ic_mr_button_connecting_00_light = 2130837684;
// aapt resource value: 0x7f0200b5
public const int ic_mr_button_connecting_01_dark = 2130837685;
// aapt resource value: 0x7f0200b6
public const int ic_mr_button_connecting_01_light = 2130837686;
// aapt resource value: 0x7f0200b7
public const int ic_mr_button_connecting_02_dark = 2130837687;
// aapt resource value: 0x7f0200b8
public const int ic_mr_button_connecting_02_light = 2130837688;
// aapt resource value: 0x7f0200b9
public const int ic_mr_button_connecting_03_dark = 2130837689;
// aapt resource value: 0x7f0200ba
public const int ic_mr_button_connecting_03_light = 2130837690;
// aapt resource value: 0x7f0200bb
public const int ic_mr_button_connecting_04_dark = 2130837691;
// aapt resource value: 0x7f0200bc
public const int ic_mr_button_connecting_04_light = 2130837692;
// aapt resource value: 0x7f0200bd
public const int ic_mr_button_connecting_05_dark = 2130837693;
// aapt resource value: 0x7f0200be
public const int ic_mr_button_connecting_05_light = 2130837694;
// aapt resource value: 0x7f0200bf
public const int ic_mr_button_connecting_06_dark = 2130837695;
// aapt resource value: 0x7f0200c0
public const int ic_mr_button_connecting_06_light = 2130837696;
// aapt resource value: 0x7f0200c1
public const int ic_mr_button_connecting_07_dark = 2130837697;
// aapt resource value: 0x7f0200c2
public const int ic_mr_button_connecting_07_light = 2130837698;
// aapt resource value: 0x7f0200c3
public const int ic_mr_button_connecting_08_dark = 2130837699;
// aapt resource value: 0x7f0200c4
public const int ic_mr_button_connecting_08_light = 2130837700;
// aapt resource value: 0x7f0200c5
public const int ic_mr_button_connecting_09_dark = 2130837701;
// aapt resource value: 0x7f0200c6
public const int ic_mr_button_connecting_09_light = 2130837702;
// aapt resource value: 0x7f0200c7
public const int ic_mr_button_connecting_10_dark = 2130837703;
// aapt resource value: 0x7f0200c8
public const int ic_mr_button_connecting_10_light = 2130837704;
// aapt resource value: 0x7f0200c9
public const int ic_mr_button_connecting_11_dark = 2130837705;
// aapt resource value: 0x7f0200ca
public const int ic_mr_button_connecting_11_light = 2130837706;
// aapt resource value: 0x7f0200cb
public const int ic_mr_button_connecting_12_dark = 2130837707;
// aapt resource value: 0x7f0200cc
public const int ic_mr_button_connecting_12_light = 2130837708;
// aapt resource value: 0x7f0200cd
public const int ic_mr_button_connecting_13_dark = 2130837709;
// aapt resource value: 0x7f0200ce
public const int ic_mr_button_connecting_13_light = 2130837710;
// aapt resource value: 0x7f0200cf
public const int ic_mr_button_connecting_14_dark = 2130837711;
// aapt resource value: 0x7f0200d0
public const int ic_mr_button_connecting_14_light = 2130837712;
// aapt resource value: 0x7f0200d1
public const int ic_mr_button_connecting_15_dark = 2130837713;
// aapt resource value: 0x7f0200d2
public const int ic_mr_button_connecting_15_light = 2130837714;
// aapt resource value: 0x7f0200d3
public const int ic_mr_button_connecting_16_dark = 2130837715;
// aapt resource value: 0x7f0200d4
public const int ic_mr_button_connecting_16_light = 2130837716;
// aapt resource value: 0x7f0200d5
public const int ic_mr_button_connecting_17_dark = 2130837717;
// aapt resource value: 0x7f0200d6
public const int ic_mr_button_connecting_17_light = 2130837718;
// aapt resource value: 0x7f0200d7
public const int ic_mr_button_connecting_18_dark = 2130837719;
// aapt resource value: 0x7f0200d8
public const int ic_mr_button_connecting_18_light = 2130837720;
// aapt resource value: 0x7f0200d9
public const int ic_mr_button_connecting_19_dark = 2130837721;
// aapt resource value: 0x7f0200da
public const int ic_mr_button_connecting_19_light = 2130837722;
// aapt resource value: 0x7f0200db
public const int ic_mr_button_connecting_20_dark = 2130837723;
// aapt resource value: 0x7f0200dc
public const int ic_mr_button_connecting_20_light = 2130837724;
// aapt resource value: 0x7f0200dd
public const int ic_mr_button_connecting_21_dark = 2130837725;
// aapt resource value: 0x7f0200de
public const int ic_mr_button_connecting_21_light = 2130837726;
// aapt resource value: 0x7f0200df
public const int ic_mr_button_connecting_22_dark = 2130837727;
// aapt resource value: 0x7f0200e0
public const int ic_mr_button_connecting_22_light = 2130837728;
// aapt resource value: 0x7f0200e1
public const int ic_mr_button_disabled_dark = 2130837729;
// aapt resource value: 0x7f0200e2
public const int ic_mr_button_disabled_light = 2130837730;
// aapt resource value: 0x7f0200e3
public const int ic_mr_button_disconnected_dark = 2130837731;
// aapt resource value: 0x7f0200e4
public const int ic_mr_button_disconnected_light = 2130837732;
// aapt resource value: 0x7f0200e5
public const int ic_mr_button_grey = 2130837733;
// aapt resource value: 0x7f0200e6
public const int ic_vol_type_speaker_dark = 2130837734;
// aapt resource value: 0x7f0200e7
public const int ic_vol_type_speaker_group_dark = 2130837735;
// aapt resource value: 0x7f0200e8
public const int ic_vol_type_speaker_group_light = 2130837736;
// aapt resource value: 0x7f0200e9
public const int ic_vol_type_speaker_light = 2130837737;
// aapt resource value: 0x7f0200ea
public const int ic_vol_type_tv_dark = 2130837738;
// aapt resource value: 0x7f0200eb
public const int ic_vol_type_tv_light = 2130837739;
// aapt resource value: 0x7f0200ec
public const int icon = 2130837740;
// aapt resource value: 0x7f0200ed
public const int mr_button_connected_dark = 2130837741;
// aapt resource value: 0x7f0200ee
public const int mr_button_connected_light = 2130837742;
// aapt resource value: 0x7f0200ef
public const int mr_button_connecting_dark = 2130837743;
// aapt resource value: 0x7f0200f0
public const int mr_button_connecting_light = 2130837744;
// aapt resource value: 0x7f0200f1
public const int mr_button_dark = 2130837745;
// aapt resource value: 0x7f0200f2
public const int mr_button_light = 2130837746;
// aapt resource value: 0x7f0200f3
public const int mr_dialog_close_dark = 2130837747;
// aapt resource value: 0x7f0200f4
public const int mr_dialog_close_light = 2130837748;
// aapt resource value: 0x7f0200f5
public const int mr_dialog_material_background_dark = 2130837749;
// aapt resource value: 0x7f0200f6
public const int mr_dialog_material_background_light = 2130837750;
// aapt resource value: 0x7f0200f7
public const int mr_group_collapse = 2130837751;
// aapt resource value: 0x7f0200f8
public const int mr_group_expand = 2130837752;
// aapt resource value: 0x7f0200f9
public const int mr_media_pause_dark = 2130837753;
// aapt resource value: 0x7f0200fa
public const int mr_media_pause_light = 2130837754;
// aapt resource value: 0x7f0200fb
public const int mr_media_play_dark = 2130837755;
// aapt resource value: 0x7f0200fc
public const int mr_media_play_light = 2130837756;
// aapt resource value: 0x7f0200fd
public const int mr_media_stop_dark = 2130837757;
// aapt resource value: 0x7f0200fe
public const int mr_media_stop_light = 2130837758;
// aapt resource value: 0x7f0200ff
public const int mr_vol_type_audiotrack_dark = 2130837759;
// aapt resource value: 0x7f020100
public const int mr_vol_type_audiotrack_light = 2130837760;
// aapt resource value: 0x7f020101
public const int navigation_empty_icon = 2130837761;
// aapt resource value: 0x7f020102
public const int notification_action_background = 2130837762;
// aapt resource value: 0x7f020103
public const int notification_bg = 2130837763;
// aapt resource value: 0x7f020104
public const int notification_bg_low = 2130837764;
// aapt resource value: 0x7f020105
public const int notification_bg_low_normal = 2130837765;
// aapt resource value: 0x7f020106
public const int notification_bg_low_pressed = 2130837766;
// aapt resource value: 0x7f020107
public const int notification_bg_normal = 2130837767;
// aapt resource value: 0x7f020108
public const int notification_bg_normal_pressed = 2130837768;
// aapt resource value: 0x7f020109
public const int notification_icon_background = 2130837769;
// aapt resource value: 0x7f02010c
public const int notification_template_icon_bg = 2130837772;
// aapt resource value: 0x7f02010d
public const int notification_template_icon_low_bg = 2130837773;
// aapt resource value: 0x7f02010a
public const int notification_tile_bg = 2130837770;
// aapt resource value: 0x7f02010b
public const int notify_panel_notification_icon_bg = 2130837771;
static Drawable()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
private Drawable()
{
}
}
public partial class Id
{
// aapt resource value: 0x7f08009e
public const int action0 = 2131230878;
// aapt resource value: 0x7f080064
public const int action_bar = 2131230820;
// aapt resource value: 0x7f080001
public const int action_bar_activity_content = 2131230721;
// aapt resource value: 0x7f080063
public const int action_bar_container = 2131230819;
// aapt resource value: 0x7f08005f
public const int action_bar_root = 2131230815;
// aapt resource value: 0x7f080002
public const int action_bar_spinner = 2131230722;
// aapt resource value: 0x7f080042
public const int action_bar_subtitle = 2131230786;
// aapt resource value: 0x7f080041
public const int action_bar_title = 2131230785;
// aapt resource value: 0x7f08009b
public const int action_container = 2131230875;
// aapt resource value: 0x7f080065
public const int action_context_bar = 2131230821;
// aapt resource value: 0x7f0800a2
public const int action_divider = 2131230882;
// aapt resource value: 0x7f08009c
public const int action_image = 2131230876;
// aapt resource value: 0x7f080003
public const int action_menu_divider = 2131230723;
// aapt resource value: 0x7f080004
public const int action_menu_presenter = 2131230724;
// aapt resource value: 0x7f080061
public const int action_mode_bar = 2131230817;
// aapt resource value: 0x7f080060
public const int action_mode_bar_stub = 2131230816;
// aapt resource value: 0x7f080043
public const int action_mode_close_button = 2131230787;
// aapt resource value: 0x7f08009d
public const int action_text = 2131230877;
// aapt resource value: 0x7f0800ab
public const int actions = 2131230891;
// aapt resource value: 0x7f080044
public const int activity_chooser_view_content = 2131230788;
// aapt resource value: 0x7f08001e
public const int add = 2131230750;
// aapt resource value: 0x7f080058
public const int alertTitle = 2131230808;
// aapt resource value: 0x7f08003d
public const int all = 2131230781;
// aapt resource value: 0x7f080023
public const int always = 2131230755;
// aapt resource value: 0x7f08002f
public const int auto = 2131230767;
// aapt resource value: 0x7f080020
public const int beginning = 2131230752;
// aapt resource value: 0x7f080028
public const int bottom = 2131230760;
// aapt resource value: 0x7f08004b
public const int buttonPanel = 2131230795;
// aapt resource value: 0x7f08009f
public const int cancel_action = 2131230879;
// aapt resource value: 0x7f080030
public const int center = 2131230768;
// aapt resource value: 0x7f080031
public const int center_horizontal = 2131230769;
// aapt resource value: 0x7f080032
public const int center_vertical = 2131230770;
// aapt resource value: 0x7f08005b
public const int checkbox = 2131230811;
// aapt resource value: 0x7f0800a7
public const int chronometer = 2131230887;
// aapt resource value: 0x7f080039
public const int clip_horizontal = 2131230777;
// aapt resource value: 0x7f08003a
public const int clip_vertical = 2131230778;
// aapt resource value: 0x7f080024
public const int collapseActionView = 2131230756;
// aapt resource value: 0x7f080075
public const int container = 2131230837;
// aapt resource value: 0x7f08004e
public const int contentPanel = 2131230798;
// aapt resource value: 0x7f080076
public const int coordinator = 2131230838;
// aapt resource value: 0x7f080055
public const int custom = 2131230805;
// aapt resource value: 0x7f080054
public const int customPanel = 2131230804;
// aapt resource value: 0x7f080062
public const int decor_content_parent = 2131230818;
// aapt resource value: 0x7f080047
public const int default_activity_button = 2131230791;
// aapt resource value: 0x7f080078
public const int design_bottom_sheet = 2131230840;
// aapt resource value: 0x7f08007f
public const int design_menu_item_action_area = 2131230847;
// aapt resource value: 0x7f08007e
public const int design_menu_item_action_area_stub = 2131230846;
// aapt resource value: 0x7f08007d
public const int design_menu_item_text = 2131230845;
// aapt resource value: 0x7f08007c
public const int design_navigation_view = 2131230844;
// aapt resource value: 0x7f080012
public const int disableHome = 2131230738;
// aapt resource value: 0x7f080066
public const int edit_query = 2131230822;
// aapt resource value: 0x7f080021
public const int end = 2131230753;
// aapt resource value: 0x7f0800b1
public const int end_padder = 2131230897;
// aapt resource value: 0x7f08002a
public const int enterAlways = 2131230762;
// aapt resource value: 0x7f08002b
public const int enterAlwaysCollapsed = 2131230763;
// aapt resource value: 0x7f08002c
public const int exitUntilCollapsed = 2131230764;
// aapt resource value: 0x7f080045
public const int expand_activities_button = 2131230789;
// aapt resource value: 0x7f08005a
public const int expanded_menu = 2131230810;
// aapt resource value: 0x7f08003b
public const int fill = 2131230779;
// aapt resource value: 0x7f08003c
public const int fill_horizontal = 2131230780;
// aapt resource value: 0x7f080033
public const int fill_vertical = 2131230771;
// aapt resource value: 0x7f08003f
public const int @fixed = 2131230783;
// aapt resource value: 0x7f080005
public const int home = 2131230725;
// aapt resource value: 0x7f080013
public const int homeAsUp = 2131230739;
// aapt resource value: 0x7f080049
public const int icon = 2131230793;
// aapt resource value: 0x7f0800ac
public const int icon_group = 2131230892;
// aapt resource value: 0x7f080025
public const int ifRoom = 2131230757;
// aapt resource value: 0x7f080046
public const int image = 2131230790;
// aapt resource value: 0x7f0800a8
public const int info = 2131230888;
// aapt resource value: 0x7f080000
public const int item_touch_helper_previous_elevation = 2131230720;
// aapt resource value: 0x7f080074
public const int largeLabel = 2131230836;
// aapt resource value: 0x7f080034
public const int left = 2131230772;
// aapt resource value: 0x7f0800ad
public const int line1 = 2131230893;
// aapt resource value: 0x7f0800af
public const int line3 = 2131230895;
// aapt resource value: 0x7f08000f
public const int listMode = 2131230735;
// aapt resource value: 0x7f080048
public const int list_item = 2131230792;
// aapt resource value: 0x7f0800b5
public const int masked = 2131230901;
// aapt resource value: 0x7f0800a1
public const int media_actions = 2131230881;
// aapt resource value: 0x7f080022
public const int middle = 2131230754;
// aapt resource value: 0x7f08003e
public const int mini = 2131230782;
// aapt resource value: 0x7f08008d
public const int mr_art = 2131230861;
// aapt resource value: 0x7f080082
public const int mr_chooser_list = 2131230850;
// aapt resource value: 0x7f080085
public const int mr_chooser_route_desc = 2131230853;
// aapt resource value: 0x7f080083
public const int mr_chooser_route_icon = 2131230851;
// aapt resource value: 0x7f080084
public const int mr_chooser_route_name = 2131230852;
// aapt resource value: 0x7f080081
public const int mr_chooser_title = 2131230849;
// aapt resource value: 0x7f08008a
public const int mr_close = 2131230858;
// aapt resource value: 0x7f080090
public const int mr_control_divider = 2131230864;
// aapt resource value: 0x7f080096
public const int mr_control_playback_ctrl = 2131230870;
// aapt resource value: 0x7f080099
public const int mr_control_subtitle = 2131230873;
// aapt resource value: 0x7f080098
public const int mr_control_title = 2131230872;
// aapt resource value: 0x7f080097
public const int mr_control_title_container = 2131230871;
// aapt resource value: 0x7f08008b
public const int mr_custom_control = 2131230859;
// aapt resource value: 0x7f08008c
public const int mr_default_control = 2131230860;
// aapt resource value: 0x7f080087
public const int mr_dialog_area = 2131230855;
// aapt resource value: 0x7f080086
public const int mr_expandable_area = 2131230854;
// aapt resource value: 0x7f08009a
public const int mr_group_expand_collapse = 2131230874;
// aapt resource value: 0x7f08008e
public const int mr_media_main_control = 2131230862;
// aapt resource value: 0x7f080089
public const int mr_name = 2131230857;
// aapt resource value: 0x7f08008f
public const int mr_playback_control = 2131230863;
// aapt resource value: 0x7f080088
public const int mr_title_bar = 2131230856;
// aapt resource value: 0x7f080091
public const int mr_volume_control = 2131230865;
// aapt resource value: 0x7f080092
public const int mr_volume_group_list = 2131230866;
// aapt resource value: 0x7f080094
public const int mr_volume_item_icon = 2131230868;
// aapt resource value: 0x7f080095
public const int mr_volume_slider = 2131230869;
// aapt resource value: 0x7f080019
public const int multiply = 2131230745;
// aapt resource value: 0x7f08007b
public const int navigation_header_container = 2131230843;
// aapt resource value: 0x7f080026
public const int never = 2131230758;
// aapt resource value: 0x7f080014
public const int none = 2131230740;
// aapt resource value: 0x7f080010
public const int normal = 2131230736;
// aapt resource value: 0x7f0800aa
public const int notification_background = 2131230890;
// aapt resource value: 0x7f0800a4
public const int notification_main_column = 2131230884;
// aapt resource value: 0x7f0800a3
public const int notification_main_column_container = 2131230883;
// aapt resource value: 0x7f080037
public const int parallax = 2131230775;
// aapt resource value: 0x7f08004d
public const int parentPanel = 2131230797;
// aapt resource value: 0x7f080038
public const int pin = 2131230776;
// aapt resource value: 0x7f080006
public const int progress_circular = 2131230726;
// aapt resource value: 0x7f080007
public const int progress_horizontal = 2131230727;
// aapt resource value: 0x7f08005d
public const int radio = 2131230813;
// aapt resource value: 0x7f080035
public const int right = 2131230773;
// aapt resource value: 0x7f0800a9
public const int right_icon = 2131230889;
// aapt resource value: 0x7f0800a5
public const int right_side = 2131230885;
// aapt resource value: 0x7f08001a
public const int screen = 2131230746;
// aapt resource value: 0x7f08002d
public const int scroll = 2131230765;
// aapt resource value: 0x7f080053
public const int scrollIndicatorDown = 2131230803;
// aapt resource value: 0x7f08004f
public const int scrollIndicatorUp = 2131230799;
// aapt resource value: 0x7f080050
public const int scrollView = 2131230800;
// aapt resource value: 0x7f080040
public const int scrollable = 2131230784;
// aapt resource value: 0x7f080068
public const int search_badge = 2131230824;
// aapt resource value: 0x7f080067
public const int search_bar = 2131230823;
// aapt resource value: 0x7f080069
public const int search_button = 2131230825;
// aapt resource value: 0x7f08006e
public const int search_close_btn = 2131230830;
// aapt resource value: 0x7f08006a
public const int search_edit_frame = 2131230826;
// aapt resource value: 0x7f080070
public const int search_go_btn = 2131230832;
// aapt resource value: 0x7f08006b
public const int search_mag_icon = 2131230827;
// aapt resource value: 0x7f08006c
public const int search_plate = 2131230828;
// aapt resource value: 0x7f08006d
public const int search_src_text = 2131230829;
// aapt resource value: 0x7f080071
public const int search_voice_btn = 2131230833;
// aapt resource value: 0x7f080072
public const int select_dialog_listview = 2131230834;
// aapt resource value: 0x7f08005c
public const int shortcut = 2131230812;
// aapt resource value: 0x7f080015
public const int showCustom = 2131230741;
// aapt resource value: 0x7f080016
public const int showHome = 2131230742;
// aapt resource value: 0x7f080017
public const int showTitle = 2131230743;
// aapt resource value: 0x7f0800b2
public const int sliding_tabs = 2131230898;
// aapt resource value: 0x7f080073
public const int smallLabel = 2131230835;
// aapt resource value: 0x7f08007a
public const int snackbar_action = 2131230842;
// aapt resource value: 0x7f080079
public const int snackbar_text = 2131230841;
// aapt resource value: 0x7f08002e
public const int snap = 2131230766;
// aapt resource value: 0x7f08004c
public const int spacer = 2131230796;
// aapt resource value: 0x7f080008
public const int split_action_bar = 2131230728;
// aapt resource value: 0x7f08001b
public const int src_atop = 2131230747;
// aapt resource value: 0x7f08001c
public const int src_in = 2131230748;
// aapt resource value: 0x7f08001d
public const int src_over = 2131230749;
// aapt resource value: 0x7f080036
public const int start = 2131230774;
// aapt resource value: 0x7f0800a0
public const int status_bar_latest_event_content = 2131230880;
// aapt resource value: 0x7f08005e
public const int submenuarrow = 2131230814;
// aapt resource value: 0x7f08006f
public const int submit_area = 2131230831;
// aapt resource value: 0x7f080011
public const int tabMode = 2131230737;
// aapt resource value: 0x7f0800b0
public const int text = 2131230896;
// aapt resource value: 0x7f0800ae
public const int text2 = 2131230894;
// aapt resource value: 0x7f080052
public const int textSpacerNoButtons = 2131230802;
// aapt resource value: 0x7f080051
public const int textSpacerNoTitle = 2131230801;
// aapt resource value: 0x7f080080
public const int text_input_password_toggle = 2131230848;
// aapt resource value: 0x7f08000c
public const int textinput_counter = 2131230732;
// aapt resource value: 0x7f08000d
public const int textinput_error = 2131230733;
// aapt resource value: 0x7f0800a6
public const int time = 2131230886;
// aapt resource value: 0x7f08004a
public const int title = 2131230794;
// aapt resource value: 0x7f080059
public const int titleDividerNoCustom = 2131230809;
// aapt resource value: 0x7f080057
public const int title_template = 2131230807;
// aapt resource value: 0x7f0800b3
public const int toolbar = 2131230899;
// aapt resource value: 0x7f080029
public const int top = 2131230761;
// aapt resource value: 0x7f080056
public const int topPanel = 2131230806;
// aapt resource value: 0x7f080077
public const int touch_outside = 2131230839;
// aapt resource value: 0x7f08000a
public const int transition_current_scene = 2131230730;
// aapt resource value: 0x7f08000b
public const int transition_scene_layoutid_cache = 2131230731;
// aapt resource value: 0x7f080009
public const int up = 2131230729;
// aapt resource value: 0x7f080018
public const int useLogo = 2131230744;
// aapt resource value: 0x7f08000e
public const int view_offset_helper = 2131230734;
// aapt resource value: 0x7f0800b4
public const int visible = 2131230900;
// aapt resource value: 0x7f080093
public const int volume_item_container = 2131230867;
// aapt resource value: 0x7f080027
public const int withText = 2131230759;
// aapt resource value: 0x7f08001f
public const int wrap_content = 2131230751;
static Id()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
private Id()
{
}
}
public partial class Integer
{
// aapt resource value: 0x7f0a0003
public const int abc_config_activityDefaultDur = 2131361795;
// aapt resource value: 0x7f0a0004
public const int abc_config_activityShortDur = 2131361796;
// aapt resource value: 0x7f0a0008
public const int app_bar_elevation_anim_duration = 2131361800;
// aapt resource value: 0x7f0a0009
public const int bottom_sheet_slide_duration = 2131361801;
// aapt resource value: 0x7f0a0005
public const int cancel_button_image_alpha = 2131361797;
// aapt resource value: 0x7f0a0007
public const int design_snackbar_text_max_lines = 2131361799;
// aapt resource value: 0x7f0a000a
public const int hide_password_duration = 2131361802;
// aapt resource value: 0x7f0a0000
public const int mr_controller_volume_group_list_animation_duration_ms = 2131361792;
// aapt resource value: 0x7f0a0001
public const int mr_controller_volume_group_list_fade_in_duration_ms = 2131361793;
// aapt resource value: 0x7f0a0002
public const int mr_controller_volume_group_list_fade_out_duration_ms = 2131361794;
// aapt resource value: 0x7f0a000b
public const int show_password_duration = 2131361803;
// aapt resource value: 0x7f0a0006
public const int status_bar_notification_info_maxnum = 2131361798;
static Integer()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
private Integer()
{
}
}
public partial class Interpolator
{
// aapt resource value: 0x7f060000
public const int mr_fast_out_slow_in = 2131099648;
// aapt resource value: 0x7f060001
public const int mr_linear_out_slow_in = 2131099649;
static Interpolator()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
private Interpolator()
{
}
}
public partial class Layout
{
// aapt resource value: 0x7f030000
public const int abc_action_bar_title_item = 2130903040;
// aapt resource value: 0x7f030001
public const int abc_action_bar_up_container = 2130903041;
// aapt resource value: 0x7f030002
public const int abc_action_bar_view_list_nav_layout = 2130903042;
// aapt resource value: 0x7f030003
public const int abc_action_menu_item_layout = 2130903043;
// aapt resource value: 0x7f030004
public const int abc_action_menu_layout = 2130903044;
// aapt resource value: 0x7f030005
public const int abc_action_mode_bar = 2130903045;
// aapt resource value: 0x7f030006
public const int abc_action_mode_close_item_material = 2130903046;
// aapt resource value: 0x7f030007
public const int abc_activity_chooser_view = 2130903047;
// aapt resource value: 0x7f030008
public const int abc_activity_chooser_view_list_item = 2130903048;
// aapt resource value: 0x7f030009
public const int abc_alert_dialog_button_bar_material = 2130903049;
// aapt resource value: 0x7f03000a
public const int abc_alert_dialog_material = 2130903050;
// aapt resource value: 0x7f03000b
public const int abc_alert_dialog_title_material = 2130903051;
// aapt resource value: 0x7f03000c
public const int abc_dialog_title_material = 2130903052;
// aapt resource value: 0x7f03000d
public const int abc_expanded_menu_layout = 2130903053;
// aapt resource value: 0x7f03000e
public const int abc_list_menu_item_checkbox = 2130903054;
// aapt resource value: 0x7f03000f
public const int abc_list_menu_item_icon = 2130903055;
// aapt resource value: 0x7f030010
public const int abc_list_menu_item_layout = 2130903056;
// aapt resource value: 0x7f030011
public const int abc_list_menu_item_radio = 2130903057;
// aapt resource value: 0x7f030012
public const int abc_popup_menu_header_item_layout = 2130903058;
// aapt resource value: 0x7f030013
public const int abc_popup_menu_item_layout = 2130903059;
// aapt resource value: 0x7f030014
public const int abc_screen_content_include = 2130903060;
// aapt resource value: 0x7f030015
public const int abc_screen_simple = 2130903061;
// aapt resource value: 0x7f030016
public const int abc_screen_simple_overlay_action_mode = 2130903062;
// aapt resource value: 0x7f030017
public const int abc_screen_toolbar = 2130903063;
// aapt resource value: 0x7f030018
public const int abc_search_dropdown_item_icons_2line = 2130903064;
// aapt resource value: 0x7f030019
public const int abc_search_view = 2130903065;
// aapt resource value: 0x7f03001a
public const int abc_select_dialog_material = 2130903066;
// aapt resource value: 0x7f03001b
public const int design_bottom_navigation_item = 2130903067;
// aapt resource value: 0x7f03001c
public const int design_bottom_sheet_dialog = 2130903068;
// aapt resource value: 0x7f03001d
public const int design_layout_snackbar = 2130903069;
// aapt resource value: 0x7f03001e
public const int design_layout_snackbar_include = 2130903070;
// aapt resource value: 0x7f03001f
public const int design_layout_tab_icon = 2130903071;
// aapt resource value: 0x7f030020
public const int design_layout_tab_text = 2130903072;
// aapt resource value: 0x7f030021
public const int design_menu_item_action_area = 2130903073;
// aapt resource value: 0x7f030022
public const int design_navigation_item = 2130903074;
// aapt resource value: 0x7f030023
public const int design_navigation_item_header = 2130903075;
// aapt resource value: 0x7f030024
public const int design_navigation_item_separator = 2130903076;
// aapt resource value: 0x7f030025
public const int design_navigation_item_subheader = 2130903077;
// aapt resource value: 0x7f030026
public const int design_navigation_menu = 2130903078;
// aapt resource value: 0x7f030027
public const int design_navigation_menu_item = 2130903079;
// aapt resource value: 0x7f030028
public const int design_text_input_password_icon = 2130903080;
// aapt resource value: 0x7f030029
public const int mr_chooser_dialog = 2130903081;
// aapt resource value: 0x7f03002a
public const int mr_chooser_list_item = 2130903082;
// aapt resource value: 0x7f03002b
public const int mr_controller_material_dialog_b = 2130903083;
// aapt resource value: 0x7f03002c
public const int mr_controller_volume_item = 2130903084;
// aapt resource value: 0x7f03002d
public const int mr_playback_control = 2130903085;
// aapt resource value: 0x7f03002e
public const int mr_volume_control = 2130903086;
// aapt resource value: 0x7f03002f
public const int notification_action = 2130903087;
// aapt resource value: 0x7f030030
public const int notification_action_tombstone = 2130903088;
// aapt resource value: 0x7f030031
public const int notification_media_action = 2130903089;
// aapt resource value: 0x7f030032
public const int notification_media_cancel_action = 2130903090;
// aapt resource value: 0x7f030033
public const int notification_template_big_media = 2130903091;
// aapt resource value: 0x7f030034
public const int notification_template_big_media_custom = 2130903092;
// aapt resource value: 0x7f030035
public const int notification_template_big_media_narrow = 2130903093;
// aapt resource value: 0x7f030036
public const int notification_template_big_media_narrow_custom = 2130903094;
// aapt resource value: 0x7f030037
public const int notification_template_custom_big = 2130903095;
// aapt resource value: 0x7f030038
public const int notification_template_icon_group = 2130903096;
// aapt resource value: 0x7f030039
public const int notification_template_lines_media = 2130903097;
// aapt resource value: 0x7f03003a
public const int notification_template_media = 2130903098;
// aapt resource value: 0x7f03003b
public const int notification_template_media_custom = 2130903099;
// aapt resource value: 0x7f03003c
public const int notification_template_part_chronometer = 2130903100;
// aapt resource value: 0x7f03003d
public const int notification_template_part_time = 2130903101;
// aapt resource value: 0x7f03003e
public const int select_dialog_item_material = 2130903102;
// aapt resource value: 0x7f03003f
public const int select_dialog_multichoice_material = 2130903103;
// aapt resource value: 0x7f030040
public const int select_dialog_singlechoice_material = 2130903104;
// aapt resource value: 0x7f030041
public const int support_simple_spinner_dropdown_item = 2130903105;
// aapt resource value: 0x7f030042
public const int Tabbar = 2130903106;
// aapt resource value: 0x7f030043
public const int Toolbar = 2130903107;
static Layout()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
private Layout()
{
}
}
public partial class String
{
// aapt resource value: 0x7f09003e
public const int ApplicationName = 2131296318;
// aapt resource value: 0x7f090015
public const int abc_action_bar_home_description = 2131296277;
// aapt resource value: 0x7f090016
public const int abc_action_bar_home_description_format = 2131296278;
// aapt resource value: 0x7f090017
public const int abc_action_bar_home_subtitle_description_format = 2131296279;
// aapt resource value: 0x7f090018
public const int abc_action_bar_up_description = 2131296280;
// aapt resource value: 0x7f090019
public const int abc_action_menu_overflow_description = 2131296281;
// aapt resource value: 0x7f09001a
public const int abc_action_mode_done = 2131296282;
// aapt resource value: 0x7f09001b
public const int abc_activity_chooser_view_see_all = 2131296283;
// aapt resource value: 0x7f09001c
public const int abc_activitychooserview_choose_application = 2131296284;
// aapt resource value: 0x7f09001d
public const int abc_capital_off = 2131296285;
// aapt resource value: 0x7f09001e
public const int abc_capital_on = 2131296286;
// aapt resource value: 0x7f09002a
public const int abc_font_family_body_1_material = 2131296298;
// aapt resource value: 0x7f09002b
public const int abc_font_family_body_2_material = 2131296299;
// aapt resource value: 0x7f09002c
public const int abc_font_family_button_material = 2131296300;
// aapt resource value: 0x7f09002d
public const int abc_font_family_caption_material = 2131296301;
// aapt resource value: 0x7f09002e
public const int abc_font_family_display_1_material = 2131296302;
// aapt resource value: 0x7f09002f
public const int abc_font_family_display_2_material = 2131296303;
// aapt resource value: 0x7f090030
public const int abc_font_family_display_3_material = 2131296304;
// aapt resource value: 0x7f090031
public const int abc_font_family_display_4_material = 2131296305;
// aapt resource value: 0x7f090032
public const int abc_font_family_headline_material = 2131296306;
// aapt resource value: 0x7f090033
public const int abc_font_family_menu_material = 2131296307;
// aapt resource value: 0x7f090034
public const int abc_font_family_subhead_material = 2131296308;
// aapt resource value: 0x7f090035
public const int abc_font_family_title_material = 2131296309;
// aapt resource value: 0x7f09001f
public const int abc_search_hint = 2131296287;
// aapt resource value: 0x7f090020
public const int abc_searchview_description_clear = 2131296288;
// aapt resource value: 0x7f090021
public const int abc_searchview_description_query = 2131296289;
// aapt resource value: 0x7f090022
public const int abc_searchview_description_search = 2131296290;
// aapt resource value: 0x7f090023
public const int abc_searchview_description_submit = 2131296291;
// aapt resource value: 0x7f090024
public const int abc_searchview_description_voice = 2131296292;
// aapt resource value: 0x7f090025
public const int abc_shareactionprovider_share_with = 2131296293;
// aapt resource value: 0x7f090026
public const int abc_shareactionprovider_share_with_application = 2131296294;
// aapt resource value: 0x7f090027
public const int abc_toolbar_collapse_description = 2131296295;
// aapt resource value: 0x7f090036
public const int appbar_scrolling_view_behavior = 2131296310;
// aapt resource value: 0x7f090037
public const int bottom_sheet_behavior = 2131296311;
// aapt resource value: 0x7f090038
public const int character_counter_pattern = 2131296312;
// aapt resource value: 0x7f090000
public const int mr_button_content_description = 2131296256;
// aapt resource value: 0x7f090001
public const int mr_cast_button_connected = 2131296257;
// aapt resource value: 0x7f090002
public const int mr_cast_button_connecting = 2131296258;
// aapt resource value: 0x7f090003
public const int mr_cast_button_disconnected = 2131296259;
// aapt resource value: 0x7f090004
public const int mr_chooser_searching = 2131296260;
// aapt resource value: 0x7f090005
public const int mr_chooser_title = 2131296261;
// aapt resource value: 0x7f090006
public const int mr_controller_album_art = 2131296262;
// aapt resource value: 0x7f090007
public const int mr_controller_casting_screen = 2131296263;
// aapt resource value: 0x7f090008
public const int mr_controller_close_description = 2131296264;
// aapt resource value: 0x7f090009
public const int mr_controller_collapse_group = 2131296265;
// aapt resource value: 0x7f09000a
public const int mr_controller_disconnect = 2131296266;
// aapt resource value: 0x7f09000b
public const int mr_controller_expand_group = 2131296267;
// aapt resource value: 0x7f09000c
public const int mr_controller_no_info_available = 2131296268;
// aapt resource value: 0x7f09000d
public const int mr_controller_no_media_selected = 2131296269;
// aapt resource value: 0x7f09000e
public const int mr_controller_pause = 2131296270;
// aapt resource value: 0x7f09000f
public const int mr_controller_play = 2131296271;
// aapt resource value: 0x7f090014
public const int mr_controller_stop = 2131296276;
// aapt resource value: 0x7f090010
public const int mr_controller_stop_casting = 2131296272;
// aapt resource value: 0x7f090011
public const int mr_controller_volume_slider = 2131296273;
// aapt resource value: 0x7f090012
public const int mr_system_route_name = 2131296274;
// aapt resource value: 0x7f090013
public const int mr_user_route_category_name = 2131296275;
// aapt resource value: 0x7f090039
public const int password_toggle_content_description = 2131296313;
// aapt resource value: 0x7f09003a
public const int path_password_eye = 2131296314;
// aapt resource value: 0x7f09003b
public const int path_password_eye_mask_strike_through = 2131296315;
// aapt resource value: 0x7f09003c
public const int path_password_eye_mask_visible = 2131296316;
// aapt resource value: 0x7f09003d
public const int path_password_strike_through = 2131296317;
// aapt resource value: 0x7f090028
public const int search_menu_title = 2131296296;
// aapt resource value: 0x7f090029
public const int status_bar_notification_info_overflow = 2131296297;
static String()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
private String()
{
}
}
public partial class Style
{
// aapt resource value: 0x7f0b00ae
public const int AlertDialog_AppCompat = 2131427502;
// aapt resource value: 0x7f0b00af
public const int AlertDialog_AppCompat_Light = 2131427503;
// aapt resource value: 0x7f0b00b0
public const int Animation_AppCompat_Dialog = 2131427504;
// aapt resource value: 0x7f0b00b1
public const int Animation_AppCompat_DropDownUp = 2131427505;
// aapt resource value: 0x7f0b0170
public const int Animation_Design_BottomSheetDialog = 2131427696;
// aapt resource value: 0x7f0b018b
public const int AppCompatDialogStyle = 2131427723;
// aapt resource value: 0x7f0b00b2
public const int Base_AlertDialog_AppCompat = 2131427506;
// aapt resource value: 0x7f0b00b3
public const int Base_AlertDialog_AppCompat_Light = 2131427507;
// aapt resource value: 0x7f0b00b4
public const int Base_Animation_AppCompat_Dialog = 2131427508;
// aapt resource value: 0x7f0b00b5
public const int Base_Animation_AppCompat_DropDownUp = 2131427509;
// aapt resource value: 0x7f0b000c
public const int Base_CardView = 2131427340;
// aapt resource value: 0x7f0b00b6
public const int Base_DialogWindowTitle_AppCompat = 2131427510;
// aapt resource value: 0x7f0b00b7
public const int Base_DialogWindowTitleBackground_AppCompat = 2131427511;
// aapt resource value: 0x7f0b004e
public const int Base_TextAppearance_AppCompat = 2131427406;
// aapt resource value: 0x7f0b004f
public const int Base_TextAppearance_AppCompat_Body1 = 2131427407;
// aapt resource value: 0x7f0b0050
public const int Base_TextAppearance_AppCompat_Body2 = 2131427408;
// aapt resource value: 0x7f0b0036
public const int Base_TextAppearance_AppCompat_Button = 2131427382;
// aapt resource value: 0x7f0b0051
public const int Base_TextAppearance_AppCompat_Caption = 2131427409;
// aapt resource value: 0x7f0b0052
public const int Base_TextAppearance_AppCompat_Display1 = 2131427410;
// aapt resource value: 0x7f0b0053
public const int Base_TextAppearance_AppCompat_Display2 = 2131427411;
// aapt resource value: 0x7f0b0054
public const int Base_TextAppearance_AppCompat_Display3 = 2131427412;
// aapt resource value: 0x7f0b0055
public const int Base_TextAppearance_AppCompat_Display4 = 2131427413;
// aapt resource value: 0x7f0b0056
public const int Base_TextAppearance_AppCompat_Headline = 2131427414;
// aapt resource value: 0x7f0b001a
public const int Base_TextAppearance_AppCompat_Inverse = 2131427354;
// aapt resource value: 0x7f0b0057
public const int Base_TextAppearance_AppCompat_Large = 2131427415;
// aapt resource value: 0x7f0b001b
public const int Base_TextAppearance_AppCompat_Large_Inverse = 2131427355;
// aapt resource value: 0x7f0b0058
public const int Base_TextAppearance_AppCompat_Light_Widget_PopupMenu_Large = 2131427416;
// aapt resource value: 0x7f0b0059
public const int Base_TextAppearance_AppCompat_Light_Widget_PopupMenu_Small = 2131427417;
// aapt resource value: 0x7f0b005a
public const int Base_TextAppearance_AppCompat_Medium = 2131427418;
// aapt resource value: 0x7f0b001c
public const int Base_TextAppearance_AppCompat_Medium_Inverse = 2131427356;
// aapt resource value: 0x7f0b005b
public const int Base_TextAppearance_AppCompat_Menu = 2131427419;
// aapt resource value: 0x7f0b00b8
public const int Base_TextAppearance_AppCompat_SearchResult = 2131427512;
// aapt resource value: 0x7f0b005c
public const int Base_TextAppearance_AppCompat_SearchResult_Subtitle = 2131427420;
// aapt resource value: 0x7f0b005d
public const int Base_TextAppearance_AppCompat_SearchResult_Title = 2131427421;
// aapt resource value: 0x7f0b005e
public const int Base_TextAppearance_AppCompat_Small = 2131427422;
// aapt resource value: 0x7f0b001d
public const int Base_TextAppearance_AppCompat_Small_Inverse = 2131427357;
// aapt resource value: 0x7f0b005f
public const int Base_TextAppearance_AppCompat_Subhead = 2131427423;
// aapt resource value: 0x7f0b001e
public const int Base_TextAppearance_AppCompat_Subhead_Inverse = 2131427358;
// aapt resource value: 0x7f0b0060
public const int Base_TextAppearance_AppCompat_Title = 2131427424;
// aapt resource value: 0x7f0b001f
public const int Base_TextAppearance_AppCompat_Title_Inverse = 2131427359;
// aapt resource value: 0x7f0b00a3
public const int Base_TextAppearance_AppCompat_Widget_ActionBar_Menu = 2131427491;
// aapt resource value: 0x7f0b0061
public const int Base_TextAppearance_AppCompat_Widget_ActionBar_Subtitle = 2131427425;
// aapt resource value: 0x7f0b0062
public const int Base_TextAppearance_AppCompat_Widget_ActionBar_Subtitle_Inverse = 2131427426;
// aapt resource value: 0x7f0b0063
public const int Base_TextAppearance_AppCompat_Widget_ActionBar_Title = 2131427427;
// aapt resource value: 0x7f0b0064
public const int Base_TextAppearance_AppCompat_Widget_ActionBar_Title_Inverse = 2131427428;
// aapt resource value: 0x7f0b0065
public const int Base_TextAppearance_AppCompat_Widget_ActionMode_Subtitle = 2131427429;
// aapt resource value: 0x7f0b0066
public const int Base_TextAppearance_AppCompat_Widget_ActionMode_Title = 2131427430;
// aapt resource value: 0x7f0b0067
public const int Base_TextAppearance_AppCompat_Widget_Button = 2131427431;
// aapt resource value: 0x7f0b00aa
public const int Base_TextAppearance_AppCompat_Widget_Button_Borderless_Colored = 2131427498;
// aapt resource value: 0x7f0b00ab
public const int Base_TextAppearance_AppCompat_Widget_Button_Colored = 2131427499;
// aapt resource value: 0x7f0b00a4
public const int Base_TextAppearance_AppCompat_Widget_Button_Inverse = 2131427492;
// aapt resource value: 0x7f0b00b9
public const int Base_TextAppearance_AppCompat_Widget_DropDownItem = 2131427513;
// aapt resource value: 0x7f0b0068
public const int Base_TextAppearance_AppCompat_Widget_PopupMenu_Header = 2131427432;
// aapt resource value: 0x7f0b0069
public const int Base_TextAppearance_AppCompat_Widget_PopupMenu_Large = 2131427433;
// aapt resource value: 0x7f0b006a
public const int Base_TextAppearance_AppCompat_Widget_PopupMenu_Small = 2131427434;
// aapt resource value: 0x7f0b006b
public const int Base_TextAppearance_AppCompat_Widget_Switch = 2131427435;
// aapt resource value: 0x7f0b006c
public const int Base_TextAppearance_AppCompat_Widget_TextView_SpinnerItem = 2131427436;
// aapt resource value: 0x7f0b00ba
public const int Base_TextAppearance_Widget_AppCompat_ExpandedMenu_Item = 2131427514;
// aapt resource value: 0x7f0b006d
public const int Base_TextAppearance_Widget_AppCompat_Toolbar_Subtitle = 2131427437;
// aapt resource value: 0x7f0b006e
public const int Base_TextAppearance_Widget_AppCompat_Toolbar_Title = 2131427438;
// aapt resource value: 0x7f0b006f
public const int Base_Theme_AppCompat = 2131427439;
// aapt resource value: 0x7f0b00bb
public const int Base_Theme_AppCompat_CompactMenu = 2131427515;
// aapt resource value: 0x7f0b0020
public const int Base_Theme_AppCompat_Dialog = 2131427360;
// aapt resource value: 0x7f0b0021
public const int Base_Theme_AppCompat_Dialog_Alert = 2131427361;
// aapt resource value: 0x7f0b00bc
public const int Base_Theme_AppCompat_Dialog_FixedSize = 2131427516;
// aapt resource value: 0x7f0b0022
public const int Base_Theme_AppCompat_Dialog_MinWidth = 2131427362;
// aapt resource value: 0x7f0b0010
public const int Base_Theme_AppCompat_DialogWhenLarge = 2131427344;
// aapt resource value: 0x7f0b0070
public const int Base_Theme_AppCompat_Light = 2131427440;
// aapt resource value: 0x7f0b00bd
public const int Base_Theme_AppCompat_Light_DarkActionBar = 2131427517;
// aapt resource value: 0x7f0b0023
public const int Base_Theme_AppCompat_Light_Dialog = 2131427363;
// aapt resource value: 0x7f0b0024
public const int Base_Theme_AppCompat_Light_Dialog_Alert = 2131427364;
// aapt resource value: 0x7f0b00be
public const int Base_Theme_AppCompat_Light_Dialog_FixedSize = 2131427518;
// aapt resource value: 0x7f0b0025
public const int Base_Theme_AppCompat_Light_Dialog_MinWidth = 2131427365;
// aapt resource value: 0x7f0b0011
public const int Base_Theme_AppCompat_Light_DialogWhenLarge = 2131427345;
// aapt resource value: 0x7f0b00bf
public const int Base_ThemeOverlay_AppCompat = 2131427519;
// aapt resource value: 0x7f0b00c0
public const int Base_ThemeOverlay_AppCompat_ActionBar = 2131427520;
// aapt resource value: 0x7f0b00c1
public const int Base_ThemeOverlay_AppCompat_Dark = 2131427521;
// aapt resource value: 0x7f0b00c2
public const int Base_ThemeOverlay_AppCompat_Dark_ActionBar = 2131427522;
// aapt resource value: 0x7f0b0026
public const int Base_ThemeOverlay_AppCompat_Dialog = 2131427366;
// aapt resource value: 0x7f0b0027
public const int Base_ThemeOverlay_AppCompat_Dialog_Alert = 2131427367;
// aapt resource value: 0x7f0b00c3
public const int Base_ThemeOverlay_AppCompat_Light = 2131427523;
// aapt resource value: 0x7f0b0028
public const int Base_V11_Theme_AppCompat_Dialog = 2131427368;
// aapt resource value: 0x7f0b0029
public const int Base_V11_Theme_AppCompat_Light_Dialog = 2131427369;
// aapt resource value: 0x7f0b002a
public const int Base_V11_ThemeOverlay_AppCompat_Dialog = 2131427370;
// aapt resource value: 0x7f0b0032
public const int Base_V12_Widget_AppCompat_AutoCompleteTextView = 2131427378;
// aapt resource value: 0x7f0b0033
public const int Base_V12_Widget_AppCompat_EditText = 2131427379;
// aapt resource value: 0x7f0b0071
public const int Base_V21_Theme_AppCompat = 2131427441;
// aapt resource value: 0x7f0b0072
public const int Base_V21_Theme_AppCompat_Dialog = 2131427442;
// aapt resource value: 0x7f0b0073
public const int Base_V21_Theme_AppCompat_Light = 2131427443;
// aapt resource value: 0x7f0b0074
public const int Base_V21_Theme_AppCompat_Light_Dialog = 2131427444;
// aapt resource value: 0x7f0b0075
public const int Base_V21_ThemeOverlay_AppCompat_Dialog = 2131427445;
// aapt resource value: 0x7f0b00a1
public const int Base_V22_Theme_AppCompat = 2131427489;
// aapt resource value: 0x7f0b00a2
public const int Base_V22_Theme_AppCompat_Light = 2131427490;
// aapt resource value: 0x7f0b00a5
public const int Base_V23_Theme_AppCompat = 2131427493;
// aapt resource value: 0x7f0b00a6
public const int Base_V23_Theme_AppCompat_Light = 2131427494;
// aapt resource value: 0x7f0b00c4
public const int Base_V7_Theme_AppCompat = 2131427524;
// aapt resource value: 0x7f0b00c5
public const int Base_V7_Theme_AppCompat_Dialog = 2131427525;
// aapt resource value: 0x7f0b00c6
public const int Base_V7_Theme_AppCompat_Light = 2131427526;
// aapt resource value: 0x7f0b00c7
public const int Base_V7_Theme_AppCompat_Light_Dialog = 2131427527;
// aapt resource value: 0x7f0b00c8
public const int Base_V7_ThemeOverlay_AppCompat_Dialog = 2131427528;
// aapt resource value: 0x7f0b00c9
public const int Base_V7_Widget_AppCompat_AutoCompleteTextView = 2131427529;
// aapt resource value: 0x7f0b00ca
public const int Base_V7_Widget_AppCompat_EditText = 2131427530;
// aapt resource value: 0x7f0b00cb
public const int Base_Widget_AppCompat_ActionBar = 2131427531;
// aapt resource value: 0x7f0b00cc
public const int Base_Widget_AppCompat_ActionBar_Solid = 2131427532;
// aapt resource value: 0x7f0b00cd
public const int Base_Widget_AppCompat_ActionBar_TabBar = 2131427533;
// aapt resource value: 0x7f0b0076
public const int Base_Widget_AppCompat_ActionBar_TabText = 2131427446;
// aapt resource value: 0x7f0b0077
public const int Base_Widget_AppCompat_ActionBar_TabView = 2131427447;
// aapt resource value: 0x7f0b0078
public const int Base_Widget_AppCompat_ActionButton = 2131427448;
// aapt resource value: 0x7f0b0079
public const int Base_Widget_AppCompat_ActionButton_CloseMode = 2131427449;
// aapt resource value: 0x7f0b007a
public const int Base_Widget_AppCompat_ActionButton_Overflow = 2131427450;
// aapt resource value: 0x7f0b00ce
public const int Base_Widget_AppCompat_ActionMode = 2131427534;
// aapt resource value: 0x7f0b00cf
public const int Base_Widget_AppCompat_ActivityChooserView = 2131427535;
// aapt resource value: 0x7f0b0034
public const int Base_Widget_AppCompat_AutoCompleteTextView = 2131427380;
// aapt resource value: 0x7f0b007b
public const int Base_Widget_AppCompat_Button = 2131427451;
// aapt resource value: 0x7f0b007c
public const int Base_Widget_AppCompat_Button_Borderless = 2131427452;
// aapt resource value: 0x7f0b007d
public const int Base_Widget_AppCompat_Button_Borderless_Colored = 2131427453;
// aapt resource value: 0x7f0b00d0
public const int Base_Widget_AppCompat_Button_ButtonBar_AlertDialog = 2131427536;
// aapt resource value: 0x7f0b00a7
public const int Base_Widget_AppCompat_Button_Colored = 2131427495;
// aapt resource value: 0x7f0b007e
public const int Base_Widget_AppCompat_Button_Small = 2131427454;
// aapt resource value: 0x7f0b007f
public const int Base_Widget_AppCompat_ButtonBar = 2131427455;
// aapt resource value: 0x7f0b00d1
public const int Base_Widget_AppCompat_ButtonBar_AlertDialog = 2131427537;
// aapt resource value: 0x7f0b0080
public const int Base_Widget_AppCompat_CompoundButton_CheckBox = 2131427456;
// aapt resource value: 0x7f0b0081
public const int Base_Widget_AppCompat_CompoundButton_RadioButton = 2131427457;
// aapt resource value: 0x7f0b00d2
public const int Base_Widget_AppCompat_CompoundButton_Switch = 2131427538;
// aapt resource value: 0x7f0b000f
public const int Base_Widget_AppCompat_DrawerArrowToggle = 2131427343;
// aapt resource value: 0x7f0b00d3
public const int Base_Widget_AppCompat_DrawerArrowToggle_Common = 2131427539;
// aapt resource value: 0x7f0b0082
public const int Base_Widget_AppCompat_DropDownItem_Spinner = 2131427458;
// aapt resource value: 0x7f0b0035
public const int Base_Widget_AppCompat_EditText = 2131427381;
// aapt resource value: 0x7f0b0083
public const int Base_Widget_AppCompat_ImageButton = 2131427459;
// aapt resource value: 0x7f0b00d4
public const int Base_Widget_AppCompat_Light_ActionBar = 2131427540;
// aapt resource value: 0x7f0b00d5
public const int Base_Widget_AppCompat_Light_ActionBar_Solid = 2131427541;
// aapt resource value: 0x7f0b00d6
public const int Base_Widget_AppCompat_Light_ActionBar_TabBar = 2131427542;
// aapt resource value: 0x7f0b0084
public const int Base_Widget_AppCompat_Light_ActionBar_TabText = 2131427460;
// aapt resource value: 0x7f0b0085
public const int Base_Widget_AppCompat_Light_ActionBar_TabText_Inverse = 2131427461;
// aapt resource value: 0x7f0b0086
public const int Base_Widget_AppCompat_Light_ActionBar_TabView = 2131427462;
// aapt resource value: 0x7f0b0087
public const int Base_Widget_AppCompat_Light_PopupMenu = 2131427463;
// aapt resource value: 0x7f0b0088
public const int Base_Widget_AppCompat_Light_PopupMenu_Overflow = 2131427464;
// aapt resource value: 0x7f0b00d7
public const int Base_Widget_AppCompat_ListMenuView = 2131427543;
// aapt resource value: 0x7f0b0089
public const int Base_Widget_AppCompat_ListPopupWindow = 2131427465;
// aapt resource value: 0x7f0b008a
public const int Base_Widget_AppCompat_ListView = 2131427466;
// aapt resource value: 0x7f0b008b
public const int Base_Widget_AppCompat_ListView_DropDown = 2131427467;
// aapt resource value: 0x7f0b008c
public const int Base_Widget_AppCompat_ListView_Menu = 2131427468;
// aapt resource value: 0x7f0b008d
public const int Base_Widget_AppCompat_PopupMenu = 2131427469;
// aapt resource value: 0x7f0b008e
public const int Base_Widget_AppCompat_PopupMenu_Overflow = 2131427470;
// aapt resource value: 0x7f0b00d8
public const int Base_Widget_AppCompat_PopupWindow = 2131427544;
// aapt resource value: 0x7f0b002b
public const int Base_Widget_AppCompat_ProgressBar = 2131427371;
// aapt resource value: 0x7f0b002c
public const int Base_Widget_AppCompat_ProgressBar_Horizontal = 2131427372;
// aapt resource value: 0x7f0b008f
public const int Base_Widget_AppCompat_RatingBar = 2131427471;
// aapt resource value: 0x7f0b00a8
public const int Base_Widget_AppCompat_RatingBar_Indicator = 2131427496;
// aapt resource value: 0x7f0b00a9
public const int Base_Widget_AppCompat_RatingBar_Small = 2131427497;
// aapt resource value: 0x7f0b00d9
public const int Base_Widget_AppCompat_SearchView = 2131427545;
// aapt resource value: 0x7f0b00da
public const int Base_Widget_AppCompat_SearchView_ActionBar = 2131427546;
// aapt resource value: 0x7f0b0090
public const int Base_Widget_AppCompat_SeekBar = 2131427472;
// aapt resource value: 0x7f0b00db
public const int Base_Widget_AppCompat_SeekBar_Discrete = 2131427547;
// aapt resource value: 0x7f0b0091
public const int Base_Widget_AppCompat_Spinner = 2131427473;
// aapt resource value: 0x7f0b0012
public const int Base_Widget_AppCompat_Spinner_Underlined = 2131427346;
// aapt resource value: 0x7f0b0092
public const int Base_Widget_AppCompat_TextView_SpinnerItem = 2131427474;
// aapt resource value: 0x7f0b00dc
public const int Base_Widget_AppCompat_Toolbar = 2131427548;
// aapt resource value: 0x7f0b0093
public const int Base_Widget_AppCompat_Toolbar_Button_Navigation = 2131427475;
// aapt resource value: 0x7f0b0171
public const int Base_Widget_Design_AppBarLayout = 2131427697;
// aapt resource value: 0x7f0b0172
public const int Base_Widget_Design_TabLayout = 2131427698;
// aapt resource value: 0x7f0b000b
public const int CardView = 2131427339;
// aapt resource value: 0x7f0b000d
public const int CardView_Dark = 2131427341;
// aapt resource value: 0x7f0b000e
public const int CardView_Light = 2131427342;
// aapt resource value: 0x7f0b0189
public const int MainTheme = 2131427721;
// aapt resource value: 0x7f0b018a
public const int MainTheme_Base = 2131427722;
// aapt resource value: 0x7f0b002d
public const int Platform_AppCompat = 2131427373;
// aapt resource value: 0x7f0b002e
public const int Platform_AppCompat_Light = 2131427374;
// aapt resource value: 0x7f0b0094
public const int Platform_ThemeOverlay_AppCompat = 2131427476;
// aapt resource value: 0x7f0b0095
public const int Platform_ThemeOverlay_AppCompat_Dark = 2131427477;
// aapt resource value: 0x7f0b0096
public const int Platform_ThemeOverlay_AppCompat_Light = 2131427478;
// aapt resource value: 0x7f0b002f
public const int Platform_V11_AppCompat = 2131427375;
// aapt resource value: 0x7f0b0030
public const int Platform_V11_AppCompat_Light = 2131427376;
// aapt resource value: 0x7f0b0037
public const int Platform_V14_AppCompat = 2131427383;
// aapt resource value: 0x7f0b0038
public const int Platform_V14_AppCompat_Light = 2131427384;
// aapt resource value: 0x7f0b0097
public const int Platform_V21_AppCompat = 2131427479;
// aapt resource value: 0x7f0b0098
public const int Platform_V21_AppCompat_Light = 2131427480;
// aapt resource value: 0x7f0b00ac
public const int Platform_V25_AppCompat = 2131427500;
// aapt resource value: 0x7f0b00ad
public const int Platform_V25_AppCompat_Light = 2131427501;
// aapt resource value: 0x7f0b0031
public const int Platform_Widget_AppCompat_Spinner = 2131427377;
// aapt resource value: 0x7f0b0040
public const int RtlOverlay_DialogWindowTitle_AppCompat = 2131427392;
// aapt resource value: 0x7f0b0041
public const int RtlOverlay_Widget_AppCompat_ActionBar_TitleItem = 2131427393;
// aapt resource value: 0x7f0b0042
public const int RtlOverlay_Widget_AppCompat_DialogTitle_Icon = 2131427394;
// aapt resource value: 0x7f0b0043
public const int RtlOverlay_Widget_AppCompat_PopupMenuItem = 2131427395;
// aapt resource value: 0x7f0b0044
public const int RtlOverlay_Widget_AppCompat_PopupMenuItem_InternalGroup = 2131427396;
// aapt resource value: 0x7f0b0045
public const int RtlOverlay_Widget_AppCompat_PopupMenuItem_Text = 2131427397;
// aapt resource value: 0x7f0b0046
public const int RtlOverlay_Widget_AppCompat_Search_DropDown = 2131427398;
// aapt resource value: 0x7f0b0047
public const int RtlOverlay_Widget_AppCompat_Search_DropDown_Icon1 = 2131427399;
// aapt resource value: 0x7f0b0048
public const int RtlOverlay_Widget_AppCompat_Search_DropDown_Icon2 = 2131427400;
// aapt resource value: 0x7f0b0049
public const int RtlOverlay_Widget_AppCompat_Search_DropDown_Query = 2131427401;
// aapt resource value: 0x7f0b004a
public const int RtlOverlay_Widget_AppCompat_Search_DropDown_Text = 2131427402;
// aapt resource value: 0x7f0b004b
public const int RtlOverlay_Widget_AppCompat_SearchView_MagIcon = 2131427403;
// aapt resource value: 0x7f0b004c
public const int RtlUnderlay_Widget_AppCompat_ActionButton = 2131427404;
// aapt resource value: 0x7f0b004d
public const int RtlUnderlay_Widget_AppCompat_ActionButton_Overflow = 2131427405;
// aapt resource value: 0x7f0b00dd
public const int TextAppearance_AppCompat = 2131427549;
// aapt resource value: 0x7f0b00de
public const int TextAppearance_AppCompat_Body1 = 2131427550;
// aapt resource value: 0x7f0b00df
public const int TextAppearance_AppCompat_Body2 = 2131427551;
// aapt resource value: 0x7f0b00e0
public const int TextAppearance_AppCompat_Button = 2131427552;
// aapt resource value: 0x7f0b00e1
public const int TextAppearance_AppCompat_Caption = 2131427553;
// aapt resource value: 0x7f0b00e2
public const int TextAppearance_AppCompat_Display1 = 2131427554;
// aapt resource value: 0x7f0b00e3
public const int TextAppearance_AppCompat_Display2 = 2131427555;
// aapt resource value: 0x7f0b00e4
public const int TextAppearance_AppCompat_Display3 = 2131427556;
// aapt resource value: 0x7f0b00e5
public const int TextAppearance_AppCompat_Display4 = 2131427557;
// aapt resource value: 0x7f0b00e6
public const int TextAppearance_AppCompat_Headline = 2131427558;
// aapt resource value: 0x7f0b00e7
public const int TextAppearance_AppCompat_Inverse = 2131427559;
// aapt resource value: 0x7f0b00e8
public const int TextAppearance_AppCompat_Large = 2131427560;
// aapt resource value: 0x7f0b00e9
public const int TextAppearance_AppCompat_Large_Inverse = 2131427561;
// aapt resource value: 0x7f0b00ea
public const int TextAppearance_AppCompat_Light_SearchResult_Subtitle = 2131427562;
// aapt resource value: 0x7f0b00eb
public const int TextAppearance_AppCompat_Light_SearchResult_Title = 2131427563;
// aapt resource value: 0x7f0b00ec
public const int TextAppearance_AppCompat_Light_Widget_PopupMenu_Large = 2131427564;
// aapt resource value: 0x7f0b00ed
public const int TextAppearance_AppCompat_Light_Widget_PopupMenu_Small = 2131427565;
// aapt resource value: 0x7f0b00ee
public const int TextAppearance_AppCompat_Medium = 2131427566;
// aapt resource value: 0x7f0b00ef
public const int TextAppearance_AppCompat_Medium_Inverse = 2131427567;
// aapt resource value: 0x7f0b00f0
public const int TextAppearance_AppCompat_Menu = 2131427568;
// aapt resource value: 0x7f0b0039
public const int TextAppearance_AppCompat_Notification = 2131427385;
// aapt resource value: 0x7f0b0099
public const int TextAppearance_AppCompat_Notification_Info = 2131427481;
// aapt resource value: 0x7f0b009a
public const int TextAppearance_AppCompat_Notification_Info_Media = 2131427482;
// aapt resource value: 0x7f0b00f1
public const int TextAppearance_AppCompat_Notification_Line2 = 2131427569;
// aapt resource value: 0x7f0b00f2
public const int TextAppearance_AppCompat_Notification_Line2_Media = 2131427570;
// aapt resource value: 0x7f0b009b
public const int TextAppearance_AppCompat_Notification_Media = 2131427483;
// aapt resource value: 0x7f0b009c
public const int TextAppearance_AppCompat_Notification_Time = 2131427484;
// aapt resource value: 0x7f0b009d
public const int TextAppearance_AppCompat_Notification_Time_Media = 2131427485;
// aapt resource value: 0x7f0b003a
public const int TextAppearance_AppCompat_Notification_Title = 2131427386;
// aapt resource value: 0x7f0b009e
public const int TextAppearance_AppCompat_Notification_Title_Media = 2131427486;
// aapt resource value: 0x7f0b00f3
public const int TextAppearance_AppCompat_SearchResult_Subtitle = 2131427571;
// aapt resource value: 0x7f0b00f4
public const int TextAppearance_AppCompat_SearchResult_Title = 2131427572;
// aapt resource value: 0x7f0b00f5
public const int TextAppearance_AppCompat_Small = 2131427573;
// aapt resource value: 0x7f0b00f6
public const int TextAppearance_AppCompat_Small_Inverse = 2131427574;
// aapt resource value: 0x7f0b00f7
public const int TextAppearance_AppCompat_Subhead = 2131427575;
// aapt resource value: 0x7f0b00f8
public const int TextAppearance_AppCompat_Subhead_Inverse = 2131427576;
// aapt resource value: 0x7f0b00f9
public const int TextAppearance_AppCompat_Title = 2131427577;
// aapt resource value: 0x7f0b00fa
public const int TextAppearance_AppCompat_Title_Inverse = 2131427578;
// aapt resource value: 0x7f0b00fb
public const int TextAppearance_AppCompat_Widget_ActionBar_Menu = 2131427579;
// aapt resource value: 0x7f0b00fc
public const int TextAppearance_AppCompat_Widget_ActionBar_Subtitle = 2131427580;
// aapt resource value: 0x7f0b00fd
public const int TextAppearance_AppCompat_Widget_ActionBar_Subtitle_Inverse = 2131427581;
// aapt resource value: 0x7f0b00fe
public const int TextAppearance_AppCompat_Widget_ActionBar_Title = 2131427582;
// aapt resource value: 0x7f0b00ff
public const int TextAppearance_AppCompat_Widget_ActionBar_Title_Inverse = 2131427583;
// aapt resource value: 0x7f0b0100
public const int TextAppearance_AppCompat_Widget_ActionMode_Subtitle = 2131427584;
// aapt resource value: 0x7f0b0101
public const int TextAppearance_AppCompat_Widget_ActionMode_Subtitle_Inverse = 2131427585;
// aapt resource value: 0x7f0b0102
public const int TextAppearance_AppCompat_Widget_ActionMode_Title = 2131427586;
// aapt resource value: 0x7f0b0103
public const int TextAppearance_AppCompat_Widget_ActionMode_Title_Inverse = 2131427587;
// aapt resource value: 0x7f0b0104
public const int TextAppearance_AppCompat_Widget_Button = 2131427588;
// aapt resource value: 0x7f0b0105
public const int TextAppearance_AppCompat_Widget_Button_Borderless_Colored = 2131427589;
// aapt resource value: 0x7f0b0106
public const int TextAppearance_AppCompat_Widget_Button_Colored = 2131427590;
// aapt resource value: 0x7f0b0107
public const int TextAppearance_AppCompat_Widget_Button_Inverse = 2131427591;
// aapt resource value: 0x7f0b0108
public const int TextAppearance_AppCompat_Widget_DropDownItem = 2131427592;
// aapt resource value: 0x7f0b0109
public const int TextAppearance_AppCompat_Widget_PopupMenu_Header = 2131427593;
// aapt resource value: 0x7f0b010a
public const int TextAppearance_AppCompat_Widget_PopupMenu_Large = 2131427594;
// aapt resource value: 0x7f0b010b
public const int TextAppearance_AppCompat_Widget_PopupMenu_Small = 2131427595;
// aapt resource value: 0x7f0b010c
public const int TextAppearance_AppCompat_Widget_Switch = 2131427596;
// aapt resource value: 0x7f0b010d
public const int TextAppearance_AppCompat_Widget_TextView_SpinnerItem = 2131427597;
// aapt resource value: 0x7f0b0173
public const int TextAppearance_Design_CollapsingToolbar_Expanded = 2131427699;
// aapt resource value: 0x7f0b0174
public const int TextAppearance_Design_Counter = 2131427700;
// aapt resource value: 0x7f0b0175
public const int TextAppearance_Design_Counter_Overflow = 2131427701;
// aapt resource value: 0x7f0b0176
public const int TextAppearance_Design_Error = 2131427702;
// aapt resource value: 0x7f0b0177
public const int TextAppearance_Design_Hint = 2131427703;
// aapt resource value: 0x7f0b0178
public const int TextAppearance_Design_Snackbar_Message = 2131427704;
// aapt resource value: 0x7f0b0179
public const int TextAppearance_Design_Tab = 2131427705;
// aapt resource value: 0x7f0b0000
public const int TextAppearance_MediaRouter_PrimaryText = 2131427328;
// aapt resource value: 0x7f0b0001
public const int TextAppearance_MediaRouter_SecondaryText = 2131427329;
// aapt resource value: 0x7f0b0002
public const int TextAppearance_MediaRouter_Title = 2131427330;
// aapt resource value: 0x7f0b003b
public const int TextAppearance_StatusBar_EventContent = 2131427387;
// aapt resource value: 0x7f0b003c
public const int TextAppearance_StatusBar_EventContent_Info = 2131427388;
// aapt resource value: 0x7f0b003d
public const int TextAppearance_StatusBar_EventContent_Line2 = 2131427389;
// aapt resource value: 0x7f0b003e
public const int TextAppearance_StatusBar_EventContent_Time = 2131427390;
// aapt resource value: 0x7f0b003f
public const int TextAppearance_StatusBar_EventContent_Title = 2131427391;
// aapt resource value: 0x7f0b010e
public const int TextAppearance_Widget_AppCompat_ExpandedMenu_Item = 2131427598;
// aapt resource value: 0x7f0b010f
public const int TextAppearance_Widget_AppCompat_Toolbar_Subtitle = 2131427599;
// aapt resource value: 0x7f0b0110
public const int TextAppearance_Widget_AppCompat_Toolbar_Title = 2131427600;
// aapt resource value: 0x7f0b0111
public const int Theme_AppCompat = 2131427601;
// aapt resource value: 0x7f0b0112
public const int Theme_AppCompat_CompactMenu = 2131427602;
// aapt resource value: 0x7f0b0013
public const int Theme_AppCompat_DayNight = 2131427347;
// aapt resource value: 0x7f0b0014
public const int Theme_AppCompat_DayNight_DarkActionBar = 2131427348;
// aapt resource value: 0x7f0b0015
public const int Theme_AppCompat_DayNight_Dialog = 2131427349;
// aapt resource value: 0x7f0b0016
public const int Theme_AppCompat_DayNight_Dialog_Alert = 2131427350;
// aapt resource value: 0x7f0b0017
public const int Theme_AppCompat_DayNight_Dialog_MinWidth = 2131427351;
// aapt resource value: 0x7f0b0018
public const int Theme_AppCompat_DayNight_DialogWhenLarge = 2131427352;
// aapt resource value: 0x7f0b0019
public const int Theme_AppCompat_DayNight_NoActionBar = 2131427353;
// aapt resource value: 0x7f0b0113
public const int Theme_AppCompat_Dialog = 2131427603;
// aapt resource value: 0x7f0b0114
public const int Theme_AppCompat_Dialog_Alert = 2131427604;
// aapt resource value: 0x7f0b0115
public const int Theme_AppCompat_Dialog_MinWidth = 2131427605;
// aapt resource value: 0x7f0b0116
public const int Theme_AppCompat_DialogWhenLarge = 2131427606;
// aapt resource value: 0x7f0b0117
public const int Theme_AppCompat_Light = 2131427607;
// aapt resource value: 0x7f0b0118
public const int Theme_AppCompat_Light_DarkActionBar = 2131427608;
// aapt resource value: 0x7f0b0119
public const int Theme_AppCompat_Light_Dialog = 2131427609;
// aapt resource value: 0x7f0b011a
public const int Theme_AppCompat_Light_Dialog_Alert = 2131427610;
// aapt resource value: 0x7f0b011b
public const int Theme_AppCompat_Light_Dialog_MinWidth = 2131427611;
// aapt resource value: 0x7f0b011c
public const int Theme_AppCompat_Light_DialogWhenLarge = 2131427612;
// aapt resource value: 0x7f0b011d
public const int Theme_AppCompat_Light_NoActionBar = 2131427613;
// aapt resource value: 0x7f0b011e
public const int Theme_AppCompat_NoActionBar = 2131427614;
// aapt resource value: 0x7f0b017a
public const int Theme_Design = 2131427706;
// aapt resource value: 0x7f0b017b
public const int Theme_Design_BottomSheetDialog = 2131427707;
// aapt resource value: 0x7f0b017c
public const int Theme_Design_Light = 2131427708;
// aapt resource value: 0x7f0b017d
public const int Theme_Design_Light_BottomSheetDialog = 2131427709;
// aapt resource value: 0x7f0b017e
public const int Theme_Design_Light_NoActionBar = 2131427710;
// aapt resource value: 0x7f0b017f
public const int Theme_Design_NoActionBar = 2131427711;
// aapt resource value: 0x7f0b0003
public const int Theme_MediaRouter = 2131427331;
// aapt resource value: 0x7f0b0004
public const int Theme_MediaRouter_Light = 2131427332;
// aapt resource value: 0x7f0b0005
public const int Theme_MediaRouter_Light_DarkControlPanel = 2131427333;
// aapt resource value: 0x7f0b0006
public const int Theme_MediaRouter_LightControlPanel = 2131427334;
// aapt resource value: 0x7f0b011f
public const int ThemeOverlay_AppCompat = 2131427615;
// aapt resource value: 0x7f0b0120
public const int ThemeOverlay_AppCompat_ActionBar = 2131427616;
// aapt resource value: 0x7f0b0121
public const int ThemeOverlay_AppCompat_Dark = 2131427617;
// aapt resource value: 0x7f0b0122
public const int ThemeOverlay_AppCompat_Dark_ActionBar = 2131427618;
// aapt resource value: 0x7f0b0123
public const int ThemeOverlay_AppCompat_Dialog = 2131427619;
// aapt resource value: 0x7f0b0124
public const int ThemeOverlay_AppCompat_Dialog_Alert = 2131427620;
// aapt resource value: 0x7f0b0125
public const int ThemeOverlay_AppCompat_Light = 2131427621;
// aapt resource value: 0x7f0b0007
public const int ThemeOverlay_MediaRouter_Dark = 2131427335;
// aapt resource value: 0x7f0b0008
public const int ThemeOverlay_MediaRouter_Light = 2131427336;
// aapt resource value: 0x7f0b0126
public const int Widget_AppCompat_ActionBar = 2131427622;
// aapt resource value: 0x7f0b0127
public const int Widget_AppCompat_ActionBar_Solid = 2131427623;
// aapt resource value: 0x7f0b0128
public const int Widget_AppCompat_ActionBar_TabBar = 2131427624;
// aapt resource value: 0x7f0b0129
public const int Widget_AppCompat_ActionBar_TabText = 2131427625;
// aapt resource value: 0x7f0b012a
public const int Widget_AppCompat_ActionBar_TabView = 2131427626;
// aapt resource value: 0x7f0b012b
public const int Widget_AppCompat_ActionButton = 2131427627;
// aapt resource value: 0x7f0b012c
public const int Widget_AppCompat_ActionButton_CloseMode = 2131427628;
// aapt resource value: 0x7f0b012d
public const int Widget_AppCompat_ActionButton_Overflow = 2131427629;
// aapt resource value: 0x7f0b012e
public const int Widget_AppCompat_ActionMode = 2131427630;
// aapt resource value: 0x7f0b012f
public const int Widget_AppCompat_ActivityChooserView = 2131427631;
// aapt resource value: 0x7f0b0130
public const int Widget_AppCompat_AutoCompleteTextView = 2131427632;
// aapt resource value: 0x7f0b0131
public const int Widget_AppCompat_Button = 2131427633;
// aapt resource value: 0x7f0b0132
public const int Widget_AppCompat_Button_Borderless = 2131427634;
// aapt resource value: 0x7f0b0133
public const int Widget_AppCompat_Button_Borderless_Colored = 2131427635;
// aapt resource value: 0x7f0b0134
public const int Widget_AppCompat_Button_ButtonBar_AlertDialog = 2131427636;
// aapt resource value: 0x7f0b0135
public const int Widget_AppCompat_Button_Colored = 2131427637;
// aapt resource value: 0x7f0b0136
public const int Widget_AppCompat_Button_Small = 2131427638;
// aapt resource value: 0x7f0b0137
public const int Widget_AppCompat_ButtonBar = 2131427639;
// aapt resource value: 0x7f0b0138
public const int Widget_AppCompat_ButtonBar_AlertDialog = 2131427640;
// aapt resource value: 0x7f0b0139
public const int Widget_AppCompat_CompoundButton_CheckBox = 2131427641;
// aapt resource value: 0x7f0b013a
public const int Widget_AppCompat_CompoundButton_RadioButton = 2131427642;
// aapt resource value: 0x7f0b013b
public const int Widget_AppCompat_CompoundButton_Switch = 2131427643;
// aapt resource value: 0x7f0b013c
public const int Widget_AppCompat_DrawerArrowToggle = 2131427644;
// aapt resource value: 0x7f0b013d
public const int Widget_AppCompat_DropDownItem_Spinner = 2131427645;
// aapt resource value: 0x7f0b013e
public const int Widget_AppCompat_EditText = 2131427646;
// aapt resource value: 0x7f0b013f
public const int Widget_AppCompat_ImageButton = 2131427647;
// aapt resource value: 0x7f0b0140
public const int Widget_AppCompat_Light_ActionBar = 2131427648;
// aapt resource value: 0x7f0b0141
public const int Widget_AppCompat_Light_ActionBar_Solid = 2131427649;
// aapt resource value: 0x7f0b0142
public const int Widget_AppCompat_Light_ActionBar_Solid_Inverse = 2131427650;
// aapt resource value: 0x7f0b0143
public const int Widget_AppCompat_Light_ActionBar_TabBar = 2131427651;
// aapt resource value: 0x7f0b0144
public const int Widget_AppCompat_Light_ActionBar_TabBar_Inverse = 2131427652;
// aapt resource value: 0x7f0b0145
public const int Widget_AppCompat_Light_ActionBar_TabText = 2131427653;
// aapt resource value: 0x7f0b0146
public const int Widget_AppCompat_Light_ActionBar_TabText_Inverse = 2131427654;
// aapt resource value: 0x7f0b0147
public const int Widget_AppCompat_Light_ActionBar_TabView = 2131427655;
// aapt resource value: 0x7f0b0148
public const int Widget_AppCompat_Light_ActionBar_TabView_Inverse = 2131427656;
// aapt resource value: 0x7f0b0149
public const int Widget_AppCompat_Light_ActionButton = 2131427657;
// aapt resource value: 0x7f0b014a
public const int Widget_AppCompat_Light_ActionButton_CloseMode = 2131427658;
// aapt resource value: 0x7f0b014b
public const int Widget_AppCompat_Light_ActionButton_Overflow = 2131427659;
// aapt resource value: 0x7f0b014c
public const int Widget_AppCompat_Light_ActionMode_Inverse = 2131427660;
// aapt resource value: 0x7f0b014d
public const int Widget_AppCompat_Light_ActivityChooserView = 2131427661;
// aapt resource value: 0x7f0b014e
public const int Widget_AppCompat_Light_AutoCompleteTextView = 2131427662;
// aapt resource value: 0x7f0b014f
public const int Widget_AppCompat_Light_DropDownItem_Spinner = 2131427663;
// aapt resource value: 0x7f0b0150
public const int Widget_AppCompat_Light_ListPopupWindow = 2131427664;
// aapt resource value: 0x7f0b0151
public const int Widget_AppCompat_Light_ListView_DropDown = 2131427665;
// aapt resource value: 0x7f0b0152
public const int Widget_AppCompat_Light_PopupMenu = 2131427666;
// aapt resource value: 0x7f0b0153
public const int Widget_AppCompat_Light_PopupMenu_Overflow = 2131427667;
// aapt resource value: 0x7f0b0154
public const int Widget_AppCompat_Light_SearchView = 2131427668;
// aapt resource value: 0x7f0b0155
public const int Widget_AppCompat_Light_Spinner_DropDown_ActionBar = 2131427669;
// aapt resource value: 0x7f0b0156
public const int Widget_AppCompat_ListMenuView = 2131427670;
// aapt resource value: 0x7f0b0157
public const int Widget_AppCompat_ListPopupWindow = 2131427671;
// aapt resource value: 0x7f0b0158
public const int Widget_AppCompat_ListView = 2131427672;
// aapt resource value: 0x7f0b0159
public const int Widget_AppCompat_ListView_DropDown = 2131427673;
// aapt resource value: 0x7f0b015a
public const int Widget_AppCompat_ListView_Menu = 2131427674;
// aapt resource value: 0x7f0b009f
public const int Widget_AppCompat_NotificationActionContainer = 2131427487;
// aapt resource value: 0x7f0b00a0
public const int Widget_AppCompat_NotificationActionText = 2131427488;
// aapt resource value: 0x7f0b015b
public const int Widget_AppCompat_PopupMenu = 2131427675;
// aapt resource value: 0x7f0b015c
public const int Widget_AppCompat_PopupMenu_Overflow = 2131427676;
// aapt resource value: 0x7f0b015d
public const int Widget_AppCompat_PopupWindow = 2131427677;
// aapt resource value: 0x7f0b015e
public const int Widget_AppCompat_ProgressBar = 2131427678;
// aapt resource value: 0x7f0b015f
public const int Widget_AppCompat_ProgressBar_Horizontal = 2131427679;
// aapt resource value: 0x7f0b0160
public const int Widget_AppCompat_RatingBar = 2131427680;
// aapt resource value: 0x7f0b0161
public const int Widget_AppCompat_RatingBar_Indicator = 2131427681;
// aapt resource value: 0x7f0b0162
public const int Widget_AppCompat_RatingBar_Small = 2131427682;
// aapt resource value: 0x7f0b0163
public const int Widget_AppCompat_SearchView = 2131427683;
// aapt resource value: 0x7f0b0164
public const int Widget_AppCompat_SearchView_ActionBar = 2131427684;
// aapt resource value: 0x7f0b0165
public const int Widget_AppCompat_SeekBar = 2131427685;
// aapt resource value: 0x7f0b0166
public const int Widget_AppCompat_SeekBar_Discrete = 2131427686;
// aapt resource value: 0x7f0b0167
public const int Widget_AppCompat_Spinner = 2131427687;
// aapt resource value: 0x7f0b0168
public const int Widget_AppCompat_Spinner_DropDown = 2131427688;
// aapt resource value: 0x7f0b0169
public const int Widget_AppCompat_Spinner_DropDown_ActionBar = 2131427689;
// aapt resource value: 0x7f0b016a
public const int Widget_AppCompat_Spinner_Underlined = 2131427690;
// aapt resource value: 0x7f0b016b
public const int Widget_AppCompat_TextView_SpinnerItem = 2131427691;
// aapt resource value: 0x7f0b016c
public const int Widget_AppCompat_Toolbar = 2131427692;
// aapt resource value: 0x7f0b016d
public const int Widget_AppCompat_Toolbar_Button_Navigation = 2131427693;
// aapt resource value: 0x7f0b016f
public const int Widget_Design_AppBarLayout = 2131427695;
// aapt resource value: 0x7f0b0180
public const int Widget_Design_BottomNavigationView = 2131427712;
// aapt resource value: 0x7f0b0181
public const int Widget_Design_BottomSheet_Modal = 2131427713;
// aapt resource value: 0x7f0b0182
public const int Widget_Design_CollapsingToolbar = 2131427714;
// aapt resource value: 0x7f0b0183
public const int Widget_Design_CoordinatorLayout = 2131427715;
// aapt resource value: 0x7f0b0184
public const int Widget_Design_FloatingActionButton = 2131427716;
// aapt resource value: 0x7f0b0185
public const int Widget_Design_NavigationView = 2131427717;
// aapt resource value: 0x7f0b0186
public const int Widget_Design_ScrimInsetsFrameLayout = 2131427718;
// aapt resource value: 0x7f0b0187
public const int Widget_Design_Snackbar = 2131427719;
// aapt resource value: 0x7f0b016e
public const int Widget_Design_TabLayout = 2131427694;
// aapt resource value: 0x7f0b0188
public const int Widget_Design_TextInputLayout = 2131427720;
// aapt resource value: 0x7f0b0009
public const int Widget_MediaRouter_Light_MediaRouteButton = 2131427337;
// aapt resource value: 0x7f0b000a
public const int Widget_MediaRouter_MediaRouteButton = 2131427338;
static Style()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
private Style()
{
}
}
public partial class Styleable
{
public static int[] ActionBar = new int[] {
2130771997,
2130771999,
2130772000,
2130772001,
2130772002,
2130772003,
2130772004,
2130772005,
2130772006,
2130772007,
2130772008,
2130772009,
2130772010,
2130772011,
2130772012,
2130772013,
2130772014,
2130772015,
2130772016,
2130772017,
2130772018,
2130772019,
2130772020,
2130772021,
2130772022,
2130772023,
2130772024,
2130772025,
2130772089};
// aapt resource value: 10
public const int ActionBar_background = 10;
// aapt resource value: 12
public const int ActionBar_backgroundSplit = 12;
// aapt resource value: 11
public const int ActionBar_backgroundStacked = 11;
// aapt resource value: 21
public const int ActionBar_contentInsetEnd = 21;
// aapt resource value: 25
public const int ActionBar_contentInsetEndWithActions = 25;
// aapt resource value: 22
public const int ActionBar_contentInsetLeft = 22;
// aapt resource value: 23
public const int ActionBar_contentInsetRight = 23;
// aapt resource value: 20
public const int ActionBar_contentInsetStart = 20;
// aapt resource value: 24
public const int ActionBar_contentInsetStartWithNavigation = 24;
// aapt resource value: 13
public const int ActionBar_customNavigationLayout = 13;
// aapt resource value: 3
public const int ActionBar_displayOptions = 3;
// aapt resource value: 9
public const int ActionBar_divider = 9;
// aapt resource value: 26
public const int ActionBar_elevation = 26;
// aapt resource value: 0
public const int ActionBar_height = 0;
// aapt resource value: 19
public const int ActionBar_hideOnContentScroll = 19;
// aapt resource value: 28
public const int ActionBar_homeAsUpIndicator = 28;
// aapt resource value: 14
public const int ActionBar_homeLayout = 14;
// aapt resource value: 7
public const int ActionBar_icon = 7;
// aapt resource value: 16
public const int ActionBar_indeterminateProgressStyle = 16;
// aapt resource value: 18
public const int ActionBar_itemPadding = 18;
// aapt resource value: 8
public const int ActionBar_logo = 8;
// aapt resource value: 2
public const int ActionBar_navigationMode = 2;
// aapt resource value: 27
public const int ActionBar_popupTheme = 27;
// aapt resource value: 17
public const int ActionBar_progressBarPadding = 17;
// aapt resource value: 15
public const int ActionBar_progressBarStyle = 15;
// aapt resource value: 4
public const int ActionBar_subtitle = 4;
// aapt resource value: 6
public const int ActionBar_subtitleTextStyle = 6;
// aapt resource value: 1
public const int ActionBar_title = 1;
// aapt resource value: 5
public const int ActionBar_titleTextStyle = 5;
public static int[] ActionBarLayout = new int[] {
16842931};
// aapt resource value: 0
public const int ActionBarLayout_android_layout_gravity = 0;
public static int[] ActionMenuItemView = new int[] {
16843071};
// aapt resource value: 0
public const int ActionMenuItemView_android_minWidth = 0;
public static int[] ActionMenuView;
public static int[] ActionMode = new int[] {
2130771997,
2130772003,
2130772004,
2130772008,
2130772010,
2130772026};
// aapt resource value: 3
public const int ActionMode_background = 3;
// aapt resource value: 4
public const int ActionMode_backgroundSplit = 4;
// aapt resource value: 5
public const int ActionMode_closeItemLayout = 5;
// aapt resource value: 0
public const int ActionMode_height = 0;
// aapt resource value: 2
public const int ActionMode_subtitleTextStyle = 2;
// aapt resource value: 1
public const int ActionMode_titleTextStyle = 1;
public static int[] ActivityChooserView = new int[] {
2130772027,
2130772028};
// aapt resource value: 1
public const int ActivityChooserView_expandActivityOverflowButtonDrawable = 1;
// aapt resource value: 0
public const int ActivityChooserView_initialActivityCount = 0;
public static int[] AlertDialog = new int[] {
16842994,
2130772029,
2130772030,
2130772031,
2130772032,
2130772033,
2130772034};
// aapt resource value: 0
public const int AlertDialog_android_layout = 0;
// aapt resource value: 1
public const int AlertDialog_buttonPanelSideLayout = 1;
// aapt resource value: 5
public const int AlertDialog_listItemLayout = 5;
// aapt resource value: 2
public const int AlertDialog_listLayout = 2;
// aapt resource value: 3
public const int AlertDialog_multiChoiceItemLayout = 3;
// aapt resource value: 6
public const int AlertDialog_showTitle = 6;
// aapt resource value: 4
public const int AlertDialog_singleChoiceItemLayout = 4;
public static int[] AppBarLayout = new int[] {
16842964,
2130772024,
2130772227};
// aapt resource value: 0
public const int AppBarLayout_android_background = 0;
// aapt resource value: 1
public const int AppBarLayout_elevation = 1;
// aapt resource value: 2
public const int AppBarLayout_expanded = 2;
public static int[] AppBarLayoutStates = new int[] {
2130772228,
2130772229};
// aapt resource value: 0
public const int AppBarLayoutStates_state_collapsed = 0;
// aapt resource value: 1
public const int AppBarLayoutStates_state_collapsible = 1;
public static int[] AppBarLayout_Layout = new int[] {
2130772230,
2130772231};
// aapt resource value: 0
public const int AppBarLayout_Layout_layout_scrollFlags = 0;
// aapt resource value: 1
public const int AppBarLayout_Layout_layout_scrollInterpolator = 1;
public static int[] AppCompatImageView = new int[] {
16843033,
2130772035,
2130772036,
2130772037};
// aapt resource value: 0
public const int AppCompatImageView_android_src = 0;
// aapt resource value: 1
public const int AppCompatImageView_srcCompat = 1;
// aapt resource value: 2
public const int AppCompatImageView_tint = 2;
// aapt resource value: 3
public const int AppCompatImageView_tintMode = 3;
public static int[] AppCompatSeekBar = new int[] {
16843074,
2130772038,
2130772039,
2130772040};
// aapt resource value: 0
public const int AppCompatSeekBar_android_thumb = 0;
// aapt resource value: 1
public const int AppCompatSeekBar_tickMark = 1;
// aapt resource value: 2
public const int AppCompatSeekBar_tickMarkTint = 2;
// aapt resource value: 3
public const int AppCompatSeekBar_tickMarkTintMode = 3;
public static int[] AppCompatTextHelper = new int[] {
16842804,
16843117,
16843118,
16843119,
16843120,
16843666,
16843667};
// aapt resource value: 2
public const int AppCompatTextHelper_android_drawableBottom = 2;
// aapt resource value: 6
public const int AppCompatTextHelper_android_drawableEnd = 6;
// aapt resource value: 3
public const int AppCompatTextHelper_android_drawableLeft = 3;
// aapt resource value: 4
public const int AppCompatTextHelper_android_drawableRight = 4;
// aapt resource value: 5
public const int AppCompatTextHelper_android_drawableStart = 5;
// aapt resource value: 1
public const int AppCompatTextHelper_android_drawableTop = 1;
// aapt resource value: 0
public const int AppCompatTextHelper_android_textAppearance = 0;
public static int[] AppCompatTextView = new int[] {
16842804,
2130772041};
// aapt resource value: 0
public const int AppCompatTextView_android_textAppearance = 0;
// aapt resource value: 1
public const int AppCompatTextView_textAllCaps = 1;
public static int[] AppCompatTheme = new int[] {
16842839,
16842926,
2130772042,
2130772043,
2130772044,
2130772045,
2130772046,
2130772047,
2130772048,
2130772049,
2130772050,
2130772051,
2130772052,
2130772053,
2130772054,
2130772055,
2130772056,
2130772057,
2130772058,
2130772059,
2130772060,
2130772061,
2130772062,
2130772063,
2130772064,
2130772065,
2130772066,
2130772067,
2130772068,
2130772069,
2130772070,
2130772071,
2130772072,
2130772073,
2130772074,
2130772075,
2130772076,
2130772077,
2130772078,
2130772079,
2130772080,
2130772081,
2130772082,
2130772083,
2130772084,
2130772085,
2130772086,
2130772087,
2130772088,
2130772089,
2130772090,
2130772091,
2130772092,
2130772093,
2130772094,
2130772095,
2130772096,
2130772097,
2130772098,
2130772099,
2130772100,
2130772101,
2130772102,
2130772103,
2130772104,
2130772105,
2130772106,
2130772107,
2130772108,
2130772109,
2130772110,
2130772111,
2130772112,
2130772113,
2130772114,
2130772115,
2130772116,
2130772117,
2130772118,
2130772119,
2130772120,
2130772121,
2130772122,
2130772123,
2130772124,
2130772125,
2130772126,
2130772127,
2130772128,
2130772129,
2130772130,
2130772131,
2130772132,
2130772133,
2130772134,
2130772135,
2130772136,
2130772137,
2130772138,
2130772139,
2130772140,
2130772141,
2130772142,
2130772143,
2130772144,
2130772145,
2130772146,
2130772147,
2130772148,
2130772149,
2130772150,
2130772151,
2130772152,
2130772153,
2130772154,
2130772155};
// aapt resource value: 23
public const int AppCompatTheme_actionBarDivider = 23;
// aapt resource value: 24
public const int AppCompatTheme_actionBarItemBackground = 24;
// aapt resource value: 17
public const int AppCompatTheme_actionBarPopupTheme = 17;
// aapt resource value: 22
public const int AppCompatTheme_actionBarSize = 22;
// aapt resource value: 19
public const int AppCompatTheme_actionBarSplitStyle = 19;
// aapt resource value: 18
public const int AppCompatTheme_actionBarStyle = 18;
// aapt resource value: 13
public const int AppCompatTheme_actionBarTabBarStyle = 13;
// aapt resource value: 12
public const int AppCompatTheme_actionBarTabStyle = 12;
// aapt resource value: 14
public const int AppCompatTheme_actionBarTabTextStyle = 14;
// aapt resource value: 20
public const int AppCompatTheme_actionBarTheme = 20;
// aapt resource value: 21
public const int AppCompatTheme_actionBarWidgetTheme = 21;
// aapt resource value: 50
public const int AppCompatTheme_actionButtonStyle = 50;
// aapt resource value: 46
public const int AppCompatTheme_actionDropDownStyle = 46;
// aapt resource value: 25
public const int AppCompatTheme_actionMenuTextAppearance = 25;
// aapt resource value: 26
public const int AppCompatTheme_actionMenuTextColor = 26;
// aapt resource value: 29
public const int AppCompatTheme_actionModeBackground = 29;
// aapt resource value: 28
public const int AppCompatTheme_actionModeCloseButtonStyle = 28;
// aapt resource value: 31
public const int AppCompatTheme_actionModeCloseDrawable = 31;
// aapt resource value: 33
public const int AppCompatTheme_actionModeCopyDrawable = 33;
// aapt resource value: 32
public const int AppCompatTheme_actionModeCutDrawable = 32;
// aapt resource value: 37
public const int AppCompatTheme_actionModeFindDrawable = 37;
// aapt resource value: 34
public const int AppCompatTheme_actionModePasteDrawable = 34;
// aapt resource value: 39
public const int AppCompatTheme_actionModePopupWindowStyle = 39;
// aapt resource value: 35
public const int AppCompatTheme_actionModeSelectAllDrawable = 35;
// aapt resource value: 36
public const int AppCompatTheme_actionModeShareDrawable = 36;
// aapt resource value: 30
public const int AppCompatTheme_actionModeSplitBackground = 30;
// aapt resource value: 27
public const int AppCompatTheme_actionModeStyle = 27;
// aapt resource value: 38
public const int AppCompatTheme_actionModeWebSearchDrawable = 38;
// aapt resource value: 15
public const int AppCompatTheme_actionOverflowButtonStyle = 15;
// aapt resource value: 16
public const int AppCompatTheme_actionOverflowMenuStyle = 16;
// aapt resource value: 58
public const int AppCompatTheme_activityChooserViewStyle = 58;
// aapt resource value: 95
public const int AppCompatTheme_alertDialogButtonGroupStyle = 95;
// aapt resource value: 96
public const int AppCompatTheme_alertDialogCenterButtons = 96;
// aapt resource value: 94
public const int AppCompatTheme_alertDialogStyle = 94;
// aapt resource value: 97
public const int AppCompatTheme_alertDialogTheme = 97;
// aapt resource value: 1
public const int AppCompatTheme_android_windowAnimationStyle = 1;
// aapt resource value: 0
public const int AppCompatTheme_android_windowIsFloating = 0;
// aapt resource value: 102
public const int AppCompatTheme_autoCompleteTextViewStyle = 102;
// aapt resource value: 55
public const int AppCompatTheme_borderlessButtonStyle = 55;
// aapt resource value: 52
public const int AppCompatTheme_buttonBarButtonStyle = 52;
// aapt resource value: 100
public const int AppCompatTheme_buttonBarNegativeButtonStyle = 100;
// aapt resource value: 101
public const int AppCompatTheme_buttonBarNeutralButtonStyle = 101;
// aapt resource value: 99
public const int AppCompatTheme_buttonBarPositiveButtonStyle = 99;
// aapt resource value: 51
public const int AppCompatTheme_buttonBarStyle = 51;
// aapt resource value: 103
public const int AppCompatTheme_buttonStyle = 103;
// aapt resource value: 104
public const int AppCompatTheme_buttonStyleSmall = 104;
// aapt resource value: 105
public const int AppCompatTheme_checkboxStyle = 105;
// aapt resource value: 106
public const int AppCompatTheme_checkedTextViewStyle = 106;
// aapt resource value: 86
public const int AppCompatTheme_colorAccent = 86;
// aapt resource value: 93
public const int AppCompatTheme_colorBackgroundFloating = 93;
// aapt resource value: 90
public const int AppCompatTheme_colorButtonNormal = 90;
// aapt resource value: 88
public const int AppCompatTheme_colorControlActivated = 88;
// aapt resource value: 89
public const int AppCompatTheme_colorControlHighlight = 89;
// aapt resource value: 87
public const int AppCompatTheme_colorControlNormal = 87;
// aapt resource value: 84
public const int AppCompatTheme_colorPrimary = 84;
// aapt resource value: 85
public const int AppCompatTheme_colorPrimaryDark = 85;
// aapt resource value: 91
public const int AppCompatTheme_colorSwitchThumbNormal = 91;
// aapt resource value: 92
public const int AppCompatTheme_controlBackground = 92;
// aapt resource value: 44
public const int AppCompatTheme_dialogPreferredPadding = 44;
// aapt resource value: 43
public const int AppCompatTheme_dialogTheme = 43;
// aapt resource value: 57
public const int AppCompatTheme_dividerHorizontal = 57;
// aapt resource value: 56
public const int AppCompatTheme_dividerVertical = 56;
// aapt resource value: 75
public const int AppCompatTheme_dropDownListViewStyle = 75;
// aapt resource value: 47
public const int AppCompatTheme_dropdownListPreferredItemHeight = 47;
// aapt resource value: 64
public const int AppCompatTheme_editTextBackground = 64;
// aapt resource value: 63
public const int AppCompatTheme_editTextColor = 63;
// aapt resource value: 107
public const int AppCompatTheme_editTextStyle = 107;
// aapt resource value: 49
public const int AppCompatTheme_homeAsUpIndicator = 49;
// aapt resource value: 65
public const int AppCompatTheme_imageButtonStyle = 65;
// aapt resource value: 83
public const int AppCompatTheme_listChoiceBackgroundIndicator = 83;
// aapt resource value: 45
public const int AppCompatTheme_listDividerAlertDialog = 45;
// aapt resource value: 115
public const int AppCompatTheme_listMenuViewStyle = 115;
// aapt resource value: 76
public const int AppCompatTheme_listPopupWindowStyle = 76;
// aapt resource value: 70
public const int AppCompatTheme_listPreferredItemHeight = 70;
// aapt resource value: 72
public const int AppCompatTheme_listPreferredItemHeightLarge = 72;
// aapt resource value: 71
public const int AppCompatTheme_listPreferredItemHeightSmall = 71;
// aapt resource value: 73
public const int AppCompatTheme_listPreferredItemPaddingLeft = 73;
// aapt resource value: 74
public const int AppCompatTheme_listPreferredItemPaddingRight = 74;
// aapt resource value: 80
public const int AppCompatTheme_panelBackground = 80;
// aapt resource value: 82
public const int AppCompatTheme_panelMenuListTheme = 82;
// aapt resource value: 81
public const int AppCompatTheme_panelMenuListWidth = 81;
// aapt resource value: 61
public const int AppCompatTheme_popupMenuStyle = 61;
// aapt resource value: 62
public const int AppCompatTheme_popupWindowStyle = 62;
// aapt resource value: 108
public const int AppCompatTheme_radioButtonStyle = 108;
// aapt resource value: 109
public const int AppCompatTheme_ratingBarStyle = 109;
// aapt resource value: 110
public const int AppCompatTheme_ratingBarStyleIndicator = 110;
// aapt resource value: 111
public const int AppCompatTheme_ratingBarStyleSmall = 111;
// aapt resource value: 69
public const int AppCompatTheme_searchViewStyle = 69;
// aapt resource value: 112
public const int AppCompatTheme_seekBarStyle = 112;
// aapt resource value: 53
public const int AppCompatTheme_selectableItemBackground = 53;
// aapt resource value: 54
public const int AppCompatTheme_selectableItemBackgroundBorderless = 54;
// aapt resource value: 48
public const int AppCompatTheme_spinnerDropDownItemStyle = 48;
// aapt resource value: 113
public const int AppCompatTheme_spinnerStyle = 113;
// aapt resource value: 114
public const int AppCompatTheme_switchStyle = 114;
// aapt resource value: 40
public const int AppCompatTheme_textAppearanceLargePopupMenu = 40;
// aapt resource value: 77
public const int AppCompatTheme_textAppearanceListItem = 77;
// aapt resource value: 78
public const int AppCompatTheme_textAppearanceListItemSecondary = 78;
// aapt resource value: 79
public const int AppCompatTheme_textAppearanceListItemSmall = 79;
// aapt resource value: 42
public const int AppCompatTheme_textAppearancePopupMenuHeader = 42;
// aapt resource value: 67
public const int AppCompatTheme_textAppearanceSearchResultSubtitle = 67;
// aapt resource value: 66
public const int AppCompatTheme_textAppearanceSearchResultTitle = 66;
// aapt resource value: 41
public const int AppCompatTheme_textAppearanceSmallPopupMenu = 41;
// aapt resource value: 98
public const int AppCompatTheme_textColorAlertDialogListItem = 98;
// aapt resource value: 68
public const int AppCompatTheme_textColorSearchUrl = 68;
// aapt resource value: 60
public const int AppCompatTheme_toolbarNavigationButtonStyle = 60;
// aapt resource value: 59
public const int AppCompatTheme_toolbarStyle = 59;
// aapt resource value: 2
public const int AppCompatTheme_windowActionBar = 2;
// aapt resource value: 4
public const int AppCompatTheme_windowActionBarOverlay = 4;
// aapt resource value: 5
public const int AppCompatTheme_windowActionModeOverlay = 5;
// aapt resource value: 9
public const int AppCompatTheme_windowFixedHeightMajor = 9;
// aapt resource value: 7
public const int AppCompatTheme_windowFixedHeightMinor = 7;
// aapt resource value: 6
public const int AppCompatTheme_windowFixedWidthMajor = 6;
// aapt resource value: 8
public const int AppCompatTheme_windowFixedWidthMinor = 8;
// aapt resource value: 10
public const int AppCompatTheme_windowMinWidthMajor = 10;
// aapt resource value: 11
public const int AppCompatTheme_windowMinWidthMinor = 11;
// aapt resource value: 3
public const int AppCompatTheme_windowNoTitle = 3;
public static int[] BottomNavigationView = new int[] {
2130772024,
2130772270,
2130772271,
2130772272,
2130772273};
// aapt resource value: 0
public const int BottomNavigationView_elevation = 0;
// aapt resource value: 4
public const int BottomNavigationView_itemBackground = 4;
// aapt resource value: 2
public const int BottomNavigationView_itemIconTint = 2;
// aapt resource value: 3
public const int BottomNavigationView_itemTextColor = 3;
// aapt resource value: 1
public const int BottomNavigationView_menu = 1;
public static int[] BottomSheetBehavior_Layout = new int[] {
2130772232,
2130772233,
2130772234};
// aapt resource value: 1
public const int BottomSheetBehavior_Layout_behavior_hideable = 1;
// aapt resource value: 0
public const int BottomSheetBehavior_Layout_behavior_peekHeight = 0;
// aapt resource value: 2
public const int BottomSheetBehavior_Layout_behavior_skipCollapsed = 2;
public static int[] ButtonBarLayout = new int[] {
2130772156};
// aapt resource value: 0
public const int ButtonBarLayout_allowStacking = 0;
public static int[] CardView = new int[] {
16843071,
16843072,
2130771985,
2130771986,
2130771987,
2130771988,
2130771989,
2130771990,
2130771991,
2130771992,
2130771993,
2130771994,
2130771995};
// aapt resource value: 1
public const int CardView_android_minHeight = 1;
// aapt resource value: 0
public const int CardView_android_minWidth = 0;
// aapt resource value: 2
public const int CardView_cardBackgroundColor = 2;
// aapt resource value: 3
public const int CardView_cardCornerRadius = 3;
// aapt resource value: 4
public const int CardView_cardElevation = 4;
// aapt resource value: 5
public const int CardView_cardMaxElevation = 5;
// aapt resource value: 7
public const int CardView_cardPreventCornerOverlap = 7;
// aapt resource value: 6
public const int CardView_cardUseCompatPadding = 6;
// aapt resource value: 8
public const int CardView_contentPadding = 8;
// aapt resource value: 12
public const int CardView_contentPaddingBottom = 12;
// aapt resource value: 9
public const int CardView_contentPaddingLeft = 9;
// aapt resource value: 10
public const int CardView_contentPaddingRight = 10;
// aapt resource value: 11
public const int CardView_contentPaddingTop = 11;
public static int[] CollapsingToolbarLayout = new int[] {
2130771999,
2130772235,
2130772236,
2130772237,
2130772238,
2130772239,
2130772240,
2130772241,
2130772242,
2130772243,
2130772244,
2130772245,
2130772246,
2130772247,
2130772248,
2130772249};
// aapt resource value: 13
public const int CollapsingToolbarLayout_collapsedTitleGravity = 13;
// aapt resource value: 7
public const int CollapsingToolbarLayout_collapsedTitleTextAppearance = 7;
// aapt resource value: 8
public const int CollapsingToolbarLayout_contentScrim = 8;
// aapt resource value: 14
public const int CollapsingToolbarLayout_expandedTitleGravity = 14;
// aapt resource value: 1
public const int CollapsingToolbarLayout_expandedTitleMargin = 1;
// aapt resource value: 5
public const int CollapsingToolbarLayout_expandedTitleMarginBottom = 5;
// aapt resource value: 4
public const int CollapsingToolbarLayout_expandedTitleMarginEnd = 4;
// aapt resource value: 2
public const int CollapsingToolbarLayout_expandedTitleMarginStart = 2;
// aapt resource value: 3
public const int CollapsingToolbarLayout_expandedTitleMarginTop = 3;
// aapt resource value: 6
public const int CollapsingToolbarLayout_expandedTitleTextAppearance = 6;
// aapt resource value: 12
public const int CollapsingToolbarLayout_scrimAnimationDuration = 12;
// aapt resource value: 11
public const int CollapsingToolbarLayout_scrimVisibleHeightTrigger = 11;
// aapt resource value: 9
public const int CollapsingToolbarLayout_statusBarScrim = 9;
// aapt resource value: 0
public const int CollapsingToolbarLayout_title = 0;
// aapt resource value: 15
public const int CollapsingToolbarLayout_titleEnabled = 15;
// aapt resource value: 10
public const int CollapsingToolbarLayout_toolbarId = 10;
public static int[] CollapsingToolbarLayout_Layout = new int[] {
2130772250,
2130772251};
// aapt resource value: 0
public const int CollapsingToolbarLayout_Layout_layout_collapseMode = 0;
// aapt resource value: 1
public const int CollapsingToolbarLayout_Layout_layout_collapseParallaxMultiplier = 1;
public static int[] ColorStateListItem = new int[] {
16843173,
16843551,
2130772157};
// aapt resource value: 2
public const int ColorStateListItem_alpha = 2;
// aapt resource value: 1
public const int ColorStateListItem_android_alpha = 1;
// aapt resource value: 0
public const int ColorStateListItem_android_color = 0;
public static int[] CompoundButton = new int[] {
16843015,
2130772158,
2130772159};
// aapt resource value: 0
public const int CompoundButton_android_button = 0;
// aapt resource value: 1
public const int CompoundButton_buttonTint = 1;
// aapt resource value: 2
public const int CompoundButton_buttonTintMode = 2;
public static int[] CoordinatorLayout = new int[] {
2130772252,
2130772253};
// aapt resource value: 0
public const int CoordinatorLayout_keylines = 0;
// aapt resource value: 1
public const int CoordinatorLayout_statusBarBackground = 1;
public static int[] CoordinatorLayout_Layout = new int[] {
16842931,
2130772254,
2130772255,
2130772256,
2130772257,
2130772258,
2130772259};
// aapt resource value: 0
public const int CoordinatorLayout_Layout_android_layout_gravity = 0;
// aapt resource value: 2
public const int CoordinatorLayout_Layout_layout_anchor = 2;
// aapt resource value: 4
public const int CoordinatorLayout_Layout_layout_anchorGravity = 4;
// aapt resource value: 1
public const int CoordinatorLayout_Layout_layout_behavior = 1;
// aapt resource value: 6
public const int CoordinatorLayout_Layout_layout_dodgeInsetEdges = 6;
// aapt resource value: 5
public const int CoordinatorLayout_Layout_layout_insetEdge = 5;
// aapt resource value: 3
public const int CoordinatorLayout_Layout_layout_keyline = 3;
public static int[] DesignTheme = new int[] {
2130772260,
2130772261,
2130772262};
// aapt resource value: 0
public const int DesignTheme_bottomSheetDialogTheme = 0;
// aapt resource value: 1
public const int DesignTheme_bottomSheetStyle = 1;
// aapt resource value: 2
public const int DesignTheme_textColorError = 2;
public static int[] DrawerArrowToggle = new int[] {
2130772160,
2130772161,
2130772162,
2130772163,
2130772164,
2130772165,
2130772166,
2130772167};
// aapt resource value: 4
public const int DrawerArrowToggle_arrowHeadLength = 4;
// aapt resource value: 5
public const int DrawerArrowToggle_arrowShaftLength = 5;
// aapt resource value: 6
public const int DrawerArrowToggle_barLength = 6;
// aapt resource value: 0
public const int DrawerArrowToggle_color = 0;
// aapt resource value: 2
public const int DrawerArrowToggle_drawableSize = 2;
// aapt resource value: 3
public const int DrawerArrowToggle_gapBetweenBars = 3;
// aapt resource value: 1
public const int DrawerArrowToggle_spinBars = 1;
// aapt resource value: 7
public const int DrawerArrowToggle_thickness = 7;
public static int[] FloatingActionButton = new int[] {
2130772024,
2130772225,
2130772226,
2130772263,
2130772264,
2130772265,
2130772266,
2130772267};
// aapt resource value: 1
public const int FloatingActionButton_backgroundTint = 1;
// aapt resource value: 2
public const int FloatingActionButton_backgroundTintMode = 2;
// aapt resource value: 6
public const int FloatingActionButton_borderWidth = 6;
// aapt resource value: 0
public const int FloatingActionButton_elevation = 0;
// aapt resource value: 4
public const int FloatingActionButton_fabSize = 4;
// aapt resource value: 5
public const int FloatingActionButton_pressedTranslationZ = 5;
// aapt resource value: 3
public const int FloatingActionButton_rippleColor = 3;
// aapt resource value: 7
public const int FloatingActionButton_useCompatPadding = 7;
public static int[] FloatingActionButton_Behavior_Layout = new int[] {
2130772268};
// aapt resource value: 0
public const int FloatingActionButton_Behavior_Layout_behavior_autoHide = 0;
public static int[] ForegroundLinearLayout = new int[] {
16843017,
16843264,
2130772269};
// aapt resource value: 0
public const int ForegroundLinearLayout_android_foreground = 0;
// aapt resource value: 1
public const int ForegroundLinearLayout_android_foregroundGravity = 1;
// aapt resource value: 2
public const int ForegroundLinearLayout_foregroundInsidePadding = 2;
public static int[] LinearLayoutCompat = new int[] {
16842927,
16842948,
16843046,
16843047,
16843048,
2130772007,
2130772168,
2130772169,
2130772170};
// aapt resource value: 2
public const int LinearLayoutCompat_android_baselineAligned = 2;
// aapt resource value: 3
public const int LinearLayoutCompat_android_baselineAlignedChildIndex = 3;
// aapt resource value: 0
public const int LinearLayoutCompat_android_gravity = 0;
// aapt resource value: 1
public const int LinearLayoutCompat_android_orientation = 1;
// aapt resource value: 4
public const int LinearLayoutCompat_android_weightSum = 4;
// aapt resource value: 5
public const int LinearLayoutCompat_divider = 5;
// aapt resource value: 8
public const int LinearLayoutCompat_dividerPadding = 8;
// aapt resource value: 6
public const int LinearLayoutCompat_measureWithLargestChild = 6;
// aapt resource value: 7
public const int LinearLayoutCompat_showDividers = 7;
public static int[] LinearLayoutCompat_Layout = new int[] {
16842931,
16842996,
16842997,
16843137};
// aapt resource value: 0
public const int LinearLayoutCompat_Layout_android_layout_gravity = 0;
// aapt resource value: 2
public const int LinearLayoutCompat_Layout_android_layout_height = 2;
// aapt resource value: 3
public const int LinearLayoutCompat_Layout_android_layout_weight = 3;
// aapt resource value: 1
public const int LinearLayoutCompat_Layout_android_layout_width = 1;
public static int[] ListPopupWindow = new int[] {
16843436,
16843437};
// aapt resource value: 0
public const int ListPopupWindow_android_dropDownHorizontalOffset = 0;
// aapt resource value: 1
public const int ListPopupWindow_android_dropDownVerticalOffset = 1;
public static int[] MediaRouteButton = new int[] {
16843071,
16843072,
2130771984,
2130772158};
// aapt resource value: 1
public const int MediaRouteButton_android_minHeight = 1;
// aapt resource value: 0
public const int MediaRouteButton_android_minWidth = 0;
// aapt resource value: 3
public const int MediaRouteButton_buttonTint = 3;
// aapt resource value: 2
public const int MediaRouteButton_externalRouteEnabledDrawable = 2;
public static int[] MenuGroup = new int[] {
16842766,
16842960,
16843156,
16843230,
16843231,
16843232};
// aapt resource value: 5
public const int MenuGroup_android_checkableBehavior = 5;
// aapt resource value: 0
public const int MenuGroup_android_enabled = 0;
// aapt resource value: 1
public const int MenuGroup_android_id = 1;
// aapt resource value: 3
public const int MenuGroup_android_menuCategory = 3;
// aapt resource value: 4
public const int MenuGroup_android_orderInCategory = 4;
// aapt resource value: 2
public const int MenuGroup_android_visible = 2;
public static int[] MenuItem = new int[] {
16842754,
16842766,
16842960,
16843014,
16843156,
16843230,
16843231,
16843233,
16843234,
16843235,
16843236,
16843237,
16843375,
2130772171,
2130772172,
2130772173,
2130772174};
// aapt resource value: 14
public const int MenuItem_actionLayout = 14;
// aapt resource value: 16
public const int MenuItem_actionProviderClass = 16;
// aapt resource value: 15
public const int MenuItem_actionViewClass = 15;
// aapt resource value: 9
public const int MenuItem_android_alphabeticShortcut = 9;
// aapt resource value: 11
public const int MenuItem_android_checkable = 11;
// aapt resource value: 3
public const int MenuItem_android_checked = 3;
// aapt resource value: 1
public const int MenuItem_android_enabled = 1;
// aapt resource value: 0
public const int MenuItem_android_icon = 0;
// aapt resource value: 2
public const int MenuItem_android_id = 2;
// aapt resource value: 5
public const int MenuItem_android_menuCategory = 5;
// aapt resource value: 10
public const int MenuItem_android_numericShortcut = 10;
// aapt resource value: 12
public const int MenuItem_android_onClick = 12;
// aapt resource value: 6
public const int MenuItem_android_orderInCategory = 6;
// aapt resource value: 7
public const int MenuItem_android_title = 7;
// aapt resource value: 8
public const int MenuItem_android_titleCondensed = 8;
// aapt resource value: 4
public const int MenuItem_android_visible = 4;
// aapt resource value: 13
public const int MenuItem_showAsAction = 13;
public static int[] MenuView = new int[] {
16842926,
16843052,
16843053,
16843054,
16843055,
16843056,
16843057,
2130772175,
2130772176};
// aapt resource value: 4
public const int MenuView_android_headerBackground = 4;
// aapt resource value: 2
public const int MenuView_android_horizontalDivider = 2;
// aapt resource value: 5
public const int MenuView_android_itemBackground = 5;
// aapt resource value: 6
public const int MenuView_android_itemIconDisabledAlpha = 6;
// aapt resource value: 1
public const int MenuView_android_itemTextAppearance = 1;
// aapt resource value: 3
public const int MenuView_android_verticalDivider = 3;
// aapt resource value: 0
public const int MenuView_android_windowAnimationStyle = 0;
// aapt resource value: 7
public const int MenuView_preserveIconSpacing = 7;
// aapt resource value: 8
public const int MenuView_subMenuArrow = 8;
public static int[] NavigationView = new int[] {
16842964,
16842973,
16843039,
2130772024,
2130772270,
2130772271,
2130772272,
2130772273,
2130772274,
2130772275};
// aapt resource value: 0
public const int NavigationView_android_background = 0;
// aapt resource value: 1
public const int NavigationView_android_fitsSystemWindows = 1;
// aapt resource value: 2
public const int NavigationView_android_maxWidth = 2;
// aapt resource value: 3
public const int NavigationView_elevation = 3;
// aapt resource value: 9
public const int NavigationView_headerLayout = 9;
// aapt resource value: 7
public const int NavigationView_itemBackground = 7;
// aapt resource value: 5
public const int NavigationView_itemIconTint = 5;
// aapt resource value: 8
public const int NavigationView_itemTextAppearance = 8;
// aapt resource value: 6
public const int NavigationView_itemTextColor = 6;
// aapt resource value: 4
public const int NavigationView_menu = 4;
public static int[] PopupWindow = new int[] {
16843126,
16843465,
2130772177};
// aapt resource value: 1
public const int PopupWindow_android_popupAnimationStyle = 1;
// aapt resource value: 0
public const int PopupWindow_android_popupBackground = 0;
// aapt resource value: 2
public const int PopupWindow_overlapAnchor = 2;
public static int[] PopupWindowBackgroundState = new int[] {
2130772178};
// aapt resource value: 0
public const int PopupWindowBackgroundState_state_above_anchor = 0;
public static int[] RecycleListView = new int[] {
2130772179,
2130772180};
// aapt resource value: 0
public const int RecycleListView_paddingBottomNoButtons = 0;
// aapt resource value: 1
public const int RecycleListView_paddingTopNoTitle = 1;
public static int[] RecyclerView = new int[] {
16842948,
16842993,
2130771968,
2130771969,
2130771970,
2130771971};
// aapt resource value: 1
public const int RecyclerView_android_descendantFocusability = 1;
// aapt resource value: 0
public const int RecyclerView_android_orientation = 0;
// aapt resource value: 2
public const int RecyclerView_layoutManager = 2;
// aapt resource value: 4
public const int RecyclerView_reverseLayout = 4;
// aapt resource value: 3
public const int RecyclerView_spanCount = 3;
// aapt resource value: 5
public const int RecyclerView_stackFromEnd = 5;
public static int[] ScrimInsetsFrameLayout = new int[] {
2130772276};
// aapt resource value: 0
public const int ScrimInsetsFrameLayout_insetForeground = 0;
public static int[] ScrollingViewBehavior_Layout = new int[] {
2130772277};
// aapt resource value: 0
public const int ScrollingViewBehavior_Layout_behavior_overlapTop = 0;
public static int[] SearchView = new int[] {
16842970,
16843039,
16843296,
16843364,
2130772181,
2130772182,
2130772183,
2130772184,
2130772185,
2130772186,
2130772187,
2130772188,
2130772189,
2130772190,
2130772191,
2130772192,
2130772193};
// aapt resource value: 0
public const int SearchView_android_focusable = 0;
// aapt resource value: 3
public const int SearchView_android_imeOptions = 3;
// aapt resource value: 2
public const int SearchView_android_inputType = 2;
// aapt resource value: 1
public const int SearchView_android_maxWidth = 1;
// aapt resource value: 8
public const int SearchView_closeIcon = 8;
// aapt resource value: 13
public const int SearchView_commitIcon = 13;
// aapt resource value: 7
public const int SearchView_defaultQueryHint = 7;
// aapt resource value: 9
public const int SearchView_goIcon = 9;
// aapt resource value: 5
public const int SearchView_iconifiedByDefault = 5;
// aapt resource value: 4
public const int SearchView_layout = 4;
// aapt resource value: 15
public const int SearchView_queryBackground = 15;
// aapt resource value: 6
public const int SearchView_queryHint = 6;
// aapt resource value: 11
public const int SearchView_searchHintIcon = 11;
// aapt resource value: 10
public const int SearchView_searchIcon = 10;
// aapt resource value: 16
public const int SearchView_submitBackground = 16;
// aapt resource value: 14
public const int SearchView_suggestionRowLayout = 14;
// aapt resource value: 12
public const int SearchView_voiceIcon = 12;
public static int[] SnackbarLayout = new int[] {
16843039,
2130772024,
2130772278};
// aapt resource value: 0
public const int SnackbarLayout_android_maxWidth = 0;
// aapt resource value: 1
public const int SnackbarLayout_elevation = 1;
// aapt resource value: 2
public const int SnackbarLayout_maxActionInlineWidth = 2;
public static int[] Spinner = new int[] {
16842930,
16843126,
16843131,
16843362,
2130772025};
// aapt resource value: 3
public const int Spinner_android_dropDownWidth = 3;
// aapt resource value: 0
public const int Spinner_android_entries = 0;
// aapt resource value: 1
public const int Spinner_android_popupBackground = 1;
// aapt resource value: 2
public const int Spinner_android_prompt = 2;
// aapt resource value: 4
public const int Spinner_popupTheme = 4;
public static int[] SwitchCompat = new int[] {
16843044,
16843045,
16843074,
2130772194,
2130772195,
2130772196,
2130772197,
2130772198,
2130772199,
2130772200,
2130772201,
2130772202,
2130772203,
2130772204};
// aapt resource value: 1
public const int SwitchCompat_android_textOff = 1;
// aapt resource value: 0
public const int SwitchCompat_android_textOn = 0;
// aapt resource value: 2
public const int SwitchCompat_android_thumb = 2;
// aapt resource value: 13
public const int SwitchCompat_showText = 13;
// aapt resource value: 12
public const int SwitchCompat_splitTrack = 12;
// aapt resource value: 10
public const int SwitchCompat_switchMinWidth = 10;
// aapt resource value: 11
public const int SwitchCompat_switchPadding = 11;
// aapt resource value: 9
public const int SwitchCompat_switchTextAppearance = 9;
// aapt resource value: 8
public const int SwitchCompat_thumbTextPadding = 8;
// aapt resource value: 3
public const int SwitchCompat_thumbTint = 3;
// aapt resource value: 4
public const int SwitchCompat_thumbTintMode = 4;
// aapt resource value: 5
public const int SwitchCompat_track = 5;
// aapt resource value: 6
public const int SwitchCompat_trackTint = 6;
// aapt resource value: 7
public const int SwitchCompat_trackTintMode = 7;
public static int[] TabItem = new int[] {
16842754,
16842994,
16843087};
// aapt resource value: 0
public const int TabItem_android_icon = 0;
// aapt resource value: 1
public const int TabItem_android_layout = 1;
// aapt resource value: 2
public const int TabItem_android_text = 2;
public static int[] TabLayout = new int[] {
2130772279,
2130772280,
2130772281,
2130772282,
2130772283,
2130772284,
2130772285,
2130772286,
2130772287,
2130772288,
2130772289,
2130772290,
2130772291,
2130772292,
2130772293,
2130772294};
// aapt resource value: 3
public const int TabLayout_tabBackground = 3;
// aapt resource value: 2
public const int TabLayout_tabContentStart = 2;
// aapt resource value: 5
public const int TabLayout_tabGravity = 5;
// aapt resource value: 0
public const int TabLayout_tabIndicatorColor = 0;
// aapt resource value: 1
public const int TabLayout_tabIndicatorHeight = 1;
// aapt resource value: 7
public const int TabLayout_tabMaxWidth = 7;
// aapt resource value: 6
public const int TabLayout_tabMinWidth = 6;
// aapt resource value: 4
public const int TabLayout_tabMode = 4;
// aapt resource value: 15
public const int TabLayout_tabPadding = 15;
// aapt resource value: 14
public const int TabLayout_tabPaddingBottom = 14;
// aapt resource value: 13
public const int TabLayout_tabPaddingEnd = 13;
// aapt resource value: 11
public const int TabLayout_tabPaddingStart = 11;
// aapt resource value: 12
public const int TabLayout_tabPaddingTop = 12;
// aapt resource value: 10
public const int TabLayout_tabSelectedTextColor = 10;
// aapt resource value: 8
public const int TabLayout_tabTextAppearance = 8;
// aapt resource value: 9
public const int TabLayout_tabTextColor = 9;
public static int[] TextAppearance = new int[] {
16842901,
16842902,
16842903,
16842904,
16842906,
16843105,
16843106,
16843107,
16843108,
2130772041};
// aapt resource value: 5
public const int TextAppearance_android_shadowColor = 5;
// aapt resource value: 6
public const int TextAppearance_android_shadowDx = 6;
// aapt resource value: 7
public const int TextAppearance_android_shadowDy = 7;
// aapt resource value: 8
public const int TextAppearance_android_shadowRadius = 8;
// aapt resource value: 3
public const int TextAppearance_android_textColor = 3;
// aapt resource value: 4
public const int TextAppearance_android_textColorHint = 4;
// aapt resource value: 0
public const int TextAppearance_android_textSize = 0;
// aapt resource value: 2
public const int TextAppearance_android_textStyle = 2;
// aapt resource value: 1
public const int TextAppearance_android_typeface = 1;
// aapt resource value: 9
public const int TextAppearance_textAllCaps = 9;
public static int[] TextInputLayout = new int[] {
16842906,
16843088,
2130772295,
2130772296,
2130772297,
2130772298,
2130772299,
2130772300,
2130772301,
2130772302,
2130772303,
2130772304,
2130772305,
2130772306,
2130772307,
2130772308};
// aapt resource value: 1
public const int TextInputLayout_android_hint = 1;
// aapt resource value: 0
public const int TextInputLayout_android_textColorHint = 0;
// aapt resource value: 6
public const int TextInputLayout_counterEnabled = 6;
// aapt resource value: 7
public const int TextInputLayout_counterMaxLength = 7;
// aapt resource value: 9
public const int TextInputLayout_counterOverflowTextAppearance = 9;
// aapt resource value: 8
public const int TextInputLayout_counterTextAppearance = 8;
// aapt resource value: 4
public const int TextInputLayout_errorEnabled = 4;
// aapt resource value: 5
public const int TextInputLayout_errorTextAppearance = 5;
// aapt resource value: 10
public const int TextInputLayout_hintAnimationEnabled = 10;
// aapt resource value: 3
public const int TextInputLayout_hintEnabled = 3;
// aapt resource value: 2
public const int TextInputLayout_hintTextAppearance = 2;
// aapt resource value: 13
public const int TextInputLayout_passwordToggleContentDescription = 13;
// aapt resource value: 12
public const int TextInputLayout_passwordToggleDrawable = 12;
// aapt resource value: 11
public const int TextInputLayout_passwordToggleEnabled = 11;
// aapt resource value: 14
public const int TextInputLayout_passwordToggleTint = 14;
// aapt resource value: 15
public const int TextInputLayout_passwordToggleTintMode = 15;
public static int[] Toolbar = new int[] {
16842927,
16843072,
2130771999,
2130772002,
2130772006,
2130772018,
2130772019,
2130772020,
2130772021,
2130772022,
2130772023,
2130772025,
2130772205,
2130772206,
2130772207,
2130772208,
2130772209,
2130772210,
2130772211,
2130772212,
2130772213,
2130772214,
2130772215,
2130772216,
2130772217,
2130772218,
2130772219,
2130772220,
2130772221};
// aapt resource value: 0
public const int Toolbar_android_gravity = 0;
// aapt resource value: 1
public const int Toolbar_android_minHeight = 1;
// aapt resource value: 21
public const int Toolbar_buttonGravity = 21;
// aapt resource value: 23
public const int Toolbar_collapseContentDescription = 23;
// aapt resource value: 22
public const int Toolbar_collapseIcon = 22;
// aapt resource value: 6
public const int Toolbar_contentInsetEnd = 6;
// aapt resource value: 10
public const int Toolbar_contentInsetEndWithActions = 10;
// aapt resource value: 7
public const int Toolbar_contentInsetLeft = 7;
// aapt resource value: 8
public const int Toolbar_contentInsetRight = 8;
// aapt resource value: 5
public const int Toolbar_contentInsetStart = 5;
// aapt resource value: 9
public const int Toolbar_contentInsetStartWithNavigation = 9;
// aapt resource value: 4
public const int Toolbar_logo = 4;
// aapt resource value: 26
public const int Toolbar_logoDescription = 26;
// aapt resource value: 20
public const int Toolbar_maxButtonHeight = 20;
// aapt resource value: 25
public const int Toolbar_navigationContentDescription = 25;
// aapt resource value: 24
public const int Toolbar_navigationIcon = 24;
// aapt resource value: 11
public const int Toolbar_popupTheme = 11;
// aapt resource value: 3
public const int Toolbar_subtitle = 3;
// aapt resource value: 13
public const int Toolbar_subtitleTextAppearance = 13;
// aapt resource value: 28
public const int Toolbar_subtitleTextColor = 28;
// aapt resource value: 2
public const int Toolbar_title = 2;
// aapt resource value: 14
public const int Toolbar_titleMargin = 14;
// aapt resource value: 18
public const int Toolbar_titleMarginBottom = 18;
// aapt resource value: 16
public const int Toolbar_titleMarginEnd = 16;
// aapt resource value: 15
public const int Toolbar_titleMarginStart = 15;
// aapt resource value: 17
public const int Toolbar_titleMarginTop = 17;
// aapt resource value: 19
public const int Toolbar_titleMargins = 19;
// aapt resource value: 12
public const int Toolbar_titleTextAppearance = 12;
// aapt resource value: 27
public const int Toolbar_titleTextColor = 27;
public static int[] View = new int[] {
16842752,
16842970,
2130772222,
2130772223,
2130772224};
// aapt resource value: 1
public const int View_android_focusable = 1;
// aapt resource value: 0
public const int View_android_theme = 0;
// aapt resource value: 3
public const int View_paddingEnd = 3;
// aapt resource value: 2
public const int View_paddingStart = 2;
// aapt resource value: 4
public const int View_theme = 4;
public static int[] ViewBackgroundHelper = new int[] {
16842964,
2130772225,
2130772226};
// aapt resource value: 0
public const int ViewBackgroundHelper_android_background = 0;
// aapt resource value: 1
public const int ViewBackgroundHelper_backgroundTint = 1;
// aapt resource value: 2
public const int ViewBackgroundHelper_backgroundTintMode = 2;
public static int[] ViewStubCompat = new int[] {
16842960,
16842994,
16842995};
// aapt resource value: 0
public const int ViewStubCompat_android_id = 0;
// aapt resource value: 2
public const int ViewStubCompat_android_inflatedId = 2;
// aapt resource value: 1
public const int ViewStubCompat_android_layout = 1;
static Styleable()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
private Styleable()
{
}
}
}
}
#pragma warning restore 1591
| 32.888128 | 139 | 0.710357 | [
"MIT"
] | Azure-Samples/azure-iot-samples-csharp | iot-hub/Samples/device/XamarinSample/XamarinSample/XamarinSample.Android/Resources/Resource.designer.cs | 230,480 | C# |
/* Copyright (C) 2008-2015 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
using System;
using System.Collections.Generic;
using System.IO;
using System.Security;
using SearchOption = System.IO.SearchOption;
namespace Alphaleonis.Win32.Filesystem
{
partial class Directory
{
#region .NET
/// <summary>Returns an enumerable collection of file names and directory names in a specified <paramref name="path"/>.</summary>
/// <returns>An enumerable collection of file system entries in the directory specified by <paramref name="path"/>.</returns>
/// <exception cref="ArgumentException"/>
/// <exception cref="ArgumentNullException"/>
/// <exception cref="DirectoryNotFoundException"/>
/// <exception cref="IOException"/>
/// <exception cref="NotSupportedException"/>
/// <exception cref="UnauthorizedAccessException"/>
/// <param name="path">The directory to search.</param>
[SecurityCritical]
public static IEnumerable<string> EnumerateFileSystemEntries(string path)
{
return EnumerateFileSystemEntryInfosCore<string>(null, path, Path.WildcardStarMatchAll, DirectoryEnumerationOptions.FilesAndFolders, PathFormat.RelativePath);
}
/// <summary>Returns an enumerable collection of file names and directory names that match a <paramref name="searchPattern"/> in a specified <paramref name="path"/>.</summary>
/// <returns>An enumerable collection of file system entries in the directory specified by <paramref name="path"/> and that match the specified <paramref name="searchPattern"/>.</returns>
/// <exception cref="ArgumentException"/>
/// <exception cref="ArgumentNullException"/>
/// <exception cref="DirectoryNotFoundException"/>
/// <exception cref="IOException"/>
/// <exception cref="NotSupportedException"/>
/// <exception cref="UnauthorizedAccessException"/>
/// <param name="path">The directory to search.</param>
/// <param name="searchPattern">
/// The search string to match against the names of directories in <paramref name="path"/>.
/// This parameter can contain a combination of valid literal path and wildcard
/// (<see cref="Path.WildcardStarMatchAll"/> and <see cref="Path.WildcardQuestion"/>) characters, but does not support regular expressions.
/// </param>
[SecurityCritical]
public static IEnumerable<string> EnumerateFileSystemEntries(string path, string searchPattern)
{
return EnumerateFileSystemEntryInfosCore<string>(null, path, searchPattern, DirectoryEnumerationOptions.FilesAndFolders, PathFormat.RelativePath);
}
/// <summary>Returns an enumerable collection of file names and directory names that match a <paramref name="searchPattern"/> in a specified <paramref name="path"/>, and optionally searches subdirectories.</summary>
/// <returns>An enumerable collection of file system entries in the directory specified by <paramref name="path"/> and that match the specified <paramref name="searchPattern"/> and <paramref name="searchOption"/>.</returns>
/// <exception cref="ArgumentException"/>
/// <exception cref="ArgumentNullException"/>
/// <exception cref="DirectoryNotFoundException"/>
/// <exception cref="IOException"/>
/// <exception cref="NotSupportedException"/>
/// <exception cref="UnauthorizedAccessException"/>
/// <param name="path">The directory to search.</param>
/// <param name="searchPattern">
/// The search string to match against the names of directories in <paramref name="path"/>.
/// This parameter can contain a combination of valid literal path and wildcard
/// (<see cref="Path.WildcardStarMatchAll"/> and <see cref="Path.WildcardQuestion"/>) characters, but does not support regular expressions.
/// </param>
/// <param name="searchOption">
/// One of the <see cref="SearchOption"/> enumeration values that specifies whether the <paramref name="searchOption"/>
/// should include only the current directory or should include all subdirectories.
/// </param>
[SecurityCritical]
public static IEnumerable<string> EnumerateFileSystemEntries(string path, string searchPattern, SearchOption searchOption)
{
var options = DirectoryEnumerationOptions.FilesAndFolders | ((searchOption == SearchOption.AllDirectories) ? DirectoryEnumerationOptions.Recursive : 0);
return EnumerateFileSystemEntryInfosCore<string>(null, path, searchPattern, options, PathFormat.RelativePath);
}
#endregion // .NET
/// <summary>[AlphaFS] Returns an enumerable collection of file names and directory names in a specified <paramref name="path"/>.</summary>
/// <returns>An enumerable collection of file system entries in the directory specified by <paramref name="path"/>.</returns>
/// <exception cref="ArgumentException"/>
/// <exception cref="ArgumentNullException"/>
/// <exception cref="DirectoryNotFoundException"/>
/// <exception cref="IOException"/>
/// <exception cref="NotSupportedException"/>
/// <exception cref="UnauthorizedAccessException"/>
/// <param name="path">The directory to search.</param>
/// <param name="pathFormat">Indicates the format of the path parameter(s).</param>
[SecurityCritical]
public static IEnumerable<string> EnumerateFileSystemEntries(string path, PathFormat pathFormat)
{
return EnumerateFileSystemEntryInfosCore<string>(null, path, Path.WildcardStarMatchAll, DirectoryEnumerationOptions.FilesAndFolders, pathFormat);
}
/// <summary>[AlphaFS] Returns an enumerable collection of file names and directory names that match a <paramref name="searchPattern"/> in a specified <paramref name="path"/>.</summary>
/// <returns>An enumerable collection of file system entries in the directory specified by <paramref name="path"/> and that match the specified <paramref name="searchPattern"/>.</returns>
/// <exception cref="ArgumentException"/>
/// <exception cref="ArgumentNullException"/>
/// <exception cref="DirectoryNotFoundException"/>
/// <exception cref="IOException"/>
/// <exception cref="NotSupportedException"/>
/// <exception cref="UnauthorizedAccessException"/>
/// <param name="path">The directory to search.</param>
/// <param name="searchPattern">
/// The search string to match against the names of directories in <paramref name="path"/>.
/// This parameter can contain a combination of valid literal path and wildcard
/// (<see cref="Path.WildcardStarMatchAll"/> and <see cref="Path.WildcardQuestion"/>) characters, but does not support regular expressions.
/// </param>
/// <param name="pathFormat">Indicates the format of the path parameter(s).</param>
[SecurityCritical]
public static IEnumerable<string> EnumerateFileSystemEntries(string path, string searchPattern, PathFormat pathFormat)
{
return EnumerateFileSystemEntryInfosCore<string>(null, path, searchPattern, DirectoryEnumerationOptions.FilesAndFolders, pathFormat);
}
/// <summary>[AlphaFS] Returns an enumerable collection of file names and directory names that match a <paramref name="searchPattern"/> in a specified <paramref name="path"/>, and optionally searches subdirectories.</summary>
/// <returns>An enumerable collection of file system entries in the directory specified by <paramref name="path"/> and that match the specified <paramref name="searchPattern"/> and <paramref name="searchOption"/>.</returns>
/// <exception cref="ArgumentException"/>
/// <exception cref="ArgumentNullException"/>
/// <exception cref="DirectoryNotFoundException"/>
/// <exception cref="IOException"/>
/// <exception cref="NotSupportedException"/>
/// <exception cref="UnauthorizedAccessException"/>
/// <param name="path">The directory to search.</param>
/// <param name="searchPattern">
/// The search string to match against the names of directories in <paramref name="path"/>.
/// This parameter can contain a combination of valid literal path and wildcard
/// (<see cref="Path.WildcardStarMatchAll"/> and <see cref="Path.WildcardQuestion"/>) characters, but does not support regular expressions.
/// </param>
/// <param name="searchOption">
/// One of the <see cref="SearchOption"/> enumeration values that specifies whether the <paramref name="searchOption"/>
/// should include only the current directory or should include all subdirectories.
/// </param>
/// <param name="pathFormat">Indicates the format of the path parameter(s).</param>
[SecurityCritical]
public static IEnumerable<string> EnumerateFileSystemEntries(string path, string searchPattern, SearchOption searchOption, PathFormat pathFormat)
{
var options = DirectoryEnumerationOptions.FilesAndFolders | ((searchOption == SearchOption.AllDirectories) ? DirectoryEnumerationOptions.Recursive : 0);
return EnumerateFileSystemEntryInfosCore<string>(null, path, searchPattern, options, pathFormat);
}
/// <summary>[AlphaFS] Returns an enumerable collection of file names and directory names in a specified <paramref name="path"/>.</summary>
/// <returns>An enumerable collection of file system entries in the directory specified by <paramref name="path"/>.</returns>
/// <exception cref="ArgumentException"/>
/// <exception cref="ArgumentNullException"/>
/// <exception cref="DirectoryNotFoundException"/>
/// <exception cref="IOException"/>
/// <exception cref="NotSupportedException"/>
/// <exception cref="UnauthorizedAccessException"/>
/// <param name="path">The directory to search.</param>
/// <param name="options"><see cref="DirectoryEnumerationOptions"/> flags that specify how the directory is to be enumerated.</param>
[SecurityCritical]
public static IEnumerable<string> EnumerateFileSystemEntries(string path, DirectoryEnumerationOptions options)
{
return EnumerateFileSystemEntryInfosCore<string>(null, path, Path.WildcardStarMatchAll, options, PathFormat.RelativePath);
}
/// <summary>[AlphaFS] Returns an enumerable collection of file names and directory names in a specified <paramref name="path"/>.</summary>
/// <returns>An enumerable collection of file system entries in the directory specified by <paramref name="path"/>.</returns>
/// <exception cref="ArgumentException"/>
/// <exception cref="ArgumentNullException"/>
/// <exception cref="DirectoryNotFoundException"/>
/// <exception cref="IOException"/>
/// <exception cref="NotSupportedException"/>
/// <exception cref="UnauthorizedAccessException"/>
/// <param name="path">The directory to search.</param>
/// <param name="options"><see cref="DirectoryEnumerationOptions"/> flags that specify how the directory is to be enumerated.</param>
/// <param name="pathFormat">Indicates the format of the path parameter(s).</param>
[SecurityCritical]
public static IEnumerable<string> EnumerateFileSystemEntries(string path, DirectoryEnumerationOptions options, PathFormat pathFormat)
{
return EnumerateFileSystemEntryInfosCore<string>(null, path, Path.WildcardStarMatchAll, options, pathFormat);
}
/// <summary>[AlphaFS] Returns an enumerable collection of file names and directory names that match a <paramref name="searchPattern"/> in a specified <paramref name="path"/>.</summary>
/// <returns>An enumerable collection of file system entries in the directory specified by <paramref name="path"/> and that match the specified <paramref name="searchPattern"/>.</returns>
/// <exception cref="ArgumentException"/>
/// <exception cref="ArgumentNullException"/>
/// <exception cref="DirectoryNotFoundException"/>
/// <exception cref="IOException"/>
/// <exception cref="NotSupportedException"/>
/// <exception cref="UnauthorizedAccessException"/>
/// <param name="path">The directory to search.</param>
/// <param name="searchPattern">
/// The search string to match against the names of directories in <paramref name="path"/>.
/// This parameter can contain a combination of valid literal path and wildcard
/// (<see cref="Path.WildcardStarMatchAll"/> and <see cref="Path.WildcardQuestion"/>) characters, but does not support regular expressions.
/// </param>
/// <param name="options"><see cref="DirectoryEnumerationOptions"/> flags that specify how the directory is to be enumerated.</param>
[SecurityCritical]
public static IEnumerable<string> EnumerateFileSystemEntries(string path, string searchPattern, DirectoryEnumerationOptions options)
{
return EnumerateFileSystemEntryInfosCore<string>(null, path, searchPattern, options, PathFormat.RelativePath);
}
/// <summary>[AlphaFS] Returns an enumerable collection of file names and directory names that match a <paramref name="searchPattern"/> in a specified <paramref name="path"/>.</summary>
/// <returns>An enumerable collection of file system entries in the directory specified by <paramref name="path"/> and that match the specified <paramref name="searchPattern"/>.</returns>
/// <exception cref="ArgumentException"/>
/// <exception cref="ArgumentNullException"/>
/// <exception cref="DirectoryNotFoundException"/>
/// <exception cref="IOException"/>
/// <exception cref="NotSupportedException"/>
/// <exception cref="UnauthorizedAccessException"/>
/// <param name="path">The directory to search.</param>
/// <param name="searchPattern">
/// The search string to match against the names of directories in <paramref name="path"/>.
/// This parameter can contain a combination of valid literal path and wildcard
/// (<see cref="Path.WildcardStarMatchAll"/> and <see cref="Path.WildcardQuestion"/>) characters, but does not support regular expressions.
/// </param>
/// <param name="pathFormat">Indicates the format of the path parameter(s).</param>
/// <param name="options"><see cref="DirectoryEnumerationOptions"/> flags that specify how the directory is to be enumerated.</param>
[SecurityCritical]
public static IEnumerable<string> EnumerateFileSystemEntries(string path, string searchPattern, DirectoryEnumerationOptions options, PathFormat pathFormat)
{
return EnumerateFileSystemEntryInfosCore<string>(null, path, searchPattern, options, pathFormat);
}
#region Transactional
/// <summary>[AlphaFS] Returns an enumerable collection of file names and directory names in a specified <paramref name="path"/>.</summary>
/// <returns>An enumerable collection of file system entries in the directory specified by <paramref name="path"/>.</returns>
/// <exception cref="ArgumentException"/>
/// <exception cref="ArgumentNullException"/>
/// <exception cref="DirectoryNotFoundException"/>
/// <exception cref="IOException"/>
/// <exception cref="NotSupportedException"/>
/// <exception cref="UnauthorizedAccessException"/>
/// <param name="transaction">The transaction.</param>
/// <param name="path">The directory to search.</param>
[SecurityCritical]
public static IEnumerable<string> EnumerateFileSystemEntriesTransacted(KernelTransaction transaction, string path)
{
return EnumerateFileSystemEntryInfosCore<string>(transaction, path, Path.WildcardStarMatchAll, DirectoryEnumerationOptions.FilesAndFolders, PathFormat.RelativePath);
}
/// <summary>[AlphaFS] Returns an enumerable collection of file names and directory names that match a <paramref name="searchPattern"/> in a specified <paramref name="path"/>.</summary>
/// <returns>An enumerable collection of file system entries in the directory specified by <paramref name="path"/> and that match the specified <paramref name="searchPattern"/>.</returns>
/// <exception cref="ArgumentException"/>
/// <exception cref="ArgumentNullException"/>
/// <exception cref="DirectoryNotFoundException"/>
/// <exception cref="IOException"/>
/// <exception cref="NotSupportedException"/>
/// <exception cref="UnauthorizedAccessException"/>
/// <param name="transaction">The transaction.</param>
/// <param name="path">The directory to search.</param>
/// <param name="searchPattern">
/// The search string to match against the names of directories in <paramref name="path"/>.
/// This parameter can contain a combination of valid literal path and wildcard
/// (<see cref="Path.WildcardStarMatchAll"/> and <see cref="Path.WildcardQuestion"/>) characters, but does not support regular expressions.
/// </param>
[SecurityCritical]
public static IEnumerable<string> EnumerateFileSystemEntriesTransacted(KernelTransaction transaction, string path, string searchPattern)
{
return EnumerateFileSystemEntryInfosCore<string>(transaction, path, searchPattern, DirectoryEnumerationOptions.FilesAndFolders, PathFormat.RelativePath);
}
/// <summary>[AlphaFS] Returns an enumerable collection of file names and directory names that match a <paramref name="searchPattern"/> in a specified <paramref name="path"/>, and optionally searches subdirectories.</summary>
/// <returns>An enumerable collection of file system entries in the directory specified by <paramref name="path"/> and that match the specified <paramref name="searchPattern"/> and <paramref name="searchOption"/>.</returns>
/// <exception cref="ArgumentException"/>
/// <exception cref="ArgumentNullException"/>
/// <exception cref="DirectoryNotFoundException"/>
/// <exception cref="IOException"/>
/// <exception cref="NotSupportedException"/>
/// <exception cref="UnauthorizedAccessException"/>
/// <param name="transaction">The transaction.</param>
/// <param name="path">The directory to search.</param>
/// <param name="searchPattern">
/// The search string to match against the names of directories in <paramref name="path"/>.
/// This parameter can contain a combination of valid literal path and wildcard
/// (<see cref="Path.WildcardStarMatchAll"/> and <see cref="Path.WildcardQuestion"/>) characters, but does not support regular expressions.
/// </param>
/// <param name="searchOption">
/// One of the <see cref="SearchOption"/> enumeration values that specifies whether the <paramref name="searchOption"/>
/// should include only the current directory or should include all subdirectories.
/// </param>
[SecurityCritical]
public static IEnumerable<string> EnumerateFileSystemEntriesTransacted(KernelTransaction transaction, string path, string searchPattern, SearchOption searchOption)
{
var options = DirectoryEnumerationOptions.FilesAndFolders | ((searchOption == SearchOption.AllDirectories) ? DirectoryEnumerationOptions.Recursive : 0);
return EnumerateFileSystemEntryInfosCore<string>(transaction, path, searchPattern, options, PathFormat.RelativePath);
}
/// <summary>[AlphaFS] Returns an enumerable collection of file names and directory names in a specified <paramref name="path"/>.</summary>
/// <returns>An enumerable collection of file system entries in the directory specified by <paramref name="path"/>.</returns>
/// <exception cref="ArgumentException"/>
/// <exception cref="ArgumentNullException"/>
/// <exception cref="DirectoryNotFoundException"/>
/// <exception cref="IOException"/>
/// <exception cref="NotSupportedException"/>
/// <exception cref="UnauthorizedAccessException"/>
/// <param name="transaction">The transaction.</param>
/// <param name="path">The directory to search.</param>
/// <param name="pathFormat">Indicates the format of the path parameter(s).</param>
[SecurityCritical]
public static IEnumerable<string> EnumerateFileSystemEntriesTransacted(KernelTransaction transaction, string path, PathFormat pathFormat)
{
return EnumerateFileSystemEntryInfosCore<string>(transaction, path, Path.WildcardStarMatchAll, DirectoryEnumerationOptions.FilesAndFolders, pathFormat);
}
/// <summary>[AlphaFS] Returns an enumerable collection of file names and directory names that match a <paramref name="searchPattern"/> in a specified <paramref name="path"/>.</summary>
/// <returns>An enumerable collection of file system entries in the directory specified by <paramref name="path"/> and that match the specified <paramref name="searchPattern"/>.</returns>
/// <exception cref="ArgumentException"/>
/// <exception cref="ArgumentNullException"/>
/// <exception cref="DirectoryNotFoundException"/>
/// <exception cref="IOException"/>
/// <exception cref="NotSupportedException"/>
/// <exception cref="UnauthorizedAccessException"/>
/// <param name="transaction">The transaction.</param>
/// <param name="path">The directory to search.</param>
/// <param name="searchPattern">
/// The search string to match against the names of directories in <paramref name="path"/>.
/// This parameter can contain a combination of valid literal path and wildcard
/// (<see cref="Path.WildcardStarMatchAll"/> and <see cref="Path.WildcardQuestion"/>) characters, but does not support regular expressions.
/// </param>
/// <param name="pathFormat">Indicates the format of the path parameter(s).</param>
[SecurityCritical]
public static IEnumerable<string> EnumerateFileSystemEntriesTransacted(KernelTransaction transaction, string path, string searchPattern, PathFormat pathFormat)
{
return EnumerateFileSystemEntryInfosCore<string>(transaction, path, searchPattern, DirectoryEnumerationOptions.FilesAndFolders, pathFormat);
}
/// <summary>[AlphaFS] Returns an enumerable collection of file names and directory names that match a <paramref name="searchPattern"/> in a specified <paramref name="path"/>, and optionally searches subdirectories.</summary>
/// <returns>An enumerable collection of file system entries in the directory specified by <paramref name="path"/> and that match the specified <paramref name="searchPattern"/> and <paramref name="searchOption"/>.</returns>
/// <exception cref="ArgumentException"/>
/// <exception cref="ArgumentNullException"/>
/// <exception cref="DirectoryNotFoundException"/>
/// <exception cref="IOException"/>
/// <exception cref="NotSupportedException"/>
/// <exception cref="UnauthorizedAccessException"/>
/// <param name="transaction">The transaction.</param>
/// <param name="path">The directory to search.</param>
/// <param name="searchPattern">
/// The search string to match against the names of directories in <paramref name="path"/>.
/// This parameter can contain a combination of valid literal path and wildcard
/// (<see cref="Path.WildcardStarMatchAll"/> and <see cref="Path.WildcardQuestion"/>) characters, but does not support regular expressions.
/// </param>
/// <param name="searchOption">
/// One of the <see cref="SearchOption"/> enumeration values that specifies whether the <paramref name="searchOption"/>
/// should include only the current directory or should include all subdirectories.
/// </param>
/// <param name="pathFormat">Indicates the format of the path parameter(s).</param>
[SecurityCritical]
public static IEnumerable<string> EnumerateFileSystemEntriesTransacted(KernelTransaction transaction, string path, string searchPattern, SearchOption searchOption, PathFormat pathFormat)
{
var options = DirectoryEnumerationOptions.FilesAndFolders | ((searchOption == SearchOption.AllDirectories) ? DirectoryEnumerationOptions.Recursive : 0);
return EnumerateFileSystemEntryInfosCore<string>(transaction, path, searchPattern, options, pathFormat);
}
/// <summary>[AlphaFS] Returns an enumerable collection of file names and directory names in a specified <paramref name="path"/>.</summary>
/// <returns>An enumerable collection of file system entries in the directory specified by <paramref name="path"/>.</returns>
/// <exception cref="ArgumentException"/>
/// <exception cref="ArgumentNullException"/>
/// <exception cref="DirectoryNotFoundException"/>
/// <exception cref="IOException"/>
/// <exception cref="NotSupportedException"/>
/// <exception cref="UnauthorizedAccessException"/>
/// <param name="transaction">The transaction.</param>
/// <param name="path">The directory to search.</param>
/// <param name="options"><see cref="DirectoryEnumerationOptions"/> flags that specify how the directory is to be enumerated.</param>
[SecurityCritical]
public static IEnumerable<string> EnumerateFileSystemEntriesTransacted(KernelTransaction transaction, string path, DirectoryEnumerationOptions options)
{
return EnumerateFileSystemEntryInfosCore<string>(transaction, path, Path.WildcardStarMatchAll, options, PathFormat.RelativePath);
}
/// <summary>[AlphaFS] Returns an enumerable collection of file names and directory names in a specified <paramref name="path"/>.</summary>
/// <returns>An enumerable collection of file system entries in the directory specified by <paramref name="path"/>.</returns>
/// <exception cref="ArgumentException"/>
/// <exception cref="ArgumentNullException"/>
/// <exception cref="DirectoryNotFoundException"/>
/// <exception cref="IOException"/>
/// <exception cref="NotSupportedException"/>
/// <exception cref="UnauthorizedAccessException"/>
/// <param name="transaction">The transaction.</param>
/// <param name="path">The directory to search.</param>
/// <param name="options"><see cref="DirectoryEnumerationOptions"/> flags that specify how the directory is to be enumerated.</param>
/// <param name="pathFormat">Indicates the format of the path parameter(s).</param>
[SecurityCritical]
public static IEnumerable<string> EnumerateFileSystemEntriesTransacted(KernelTransaction transaction, string path, DirectoryEnumerationOptions options, PathFormat pathFormat)
{
return EnumerateFileSystemEntryInfosCore<string>(transaction, path, Path.WildcardStarMatchAll, options, pathFormat);
}
/// <summary>[AlphaFS] Returns an enumerable collection of file names and directory names that match a <paramref name="searchPattern"/> in a specified <paramref name="path"/>.</summary>
/// <returns>An enumerable collection of file system entries in the directory specified by <paramref name="path"/> and that match the specified <paramref name="searchPattern"/>.</returns>
/// <exception cref="ArgumentException"/>
/// <exception cref="ArgumentNullException"/>
/// <exception cref="DirectoryNotFoundException"/>
/// <exception cref="IOException"/>
/// <exception cref="NotSupportedException"/>
/// <exception cref="UnauthorizedAccessException"/>
/// <param name="transaction">The transaction.</param>
/// <param name="path">The directory to search.</param>
/// <param name="searchPattern">
/// The search string to match against the names of directories in <paramref name="path"/>.
/// This parameter can contain a combination of valid literal path and wildcard
/// (<see cref="Path.WildcardStarMatchAll"/> and <see cref="Path.WildcardQuestion"/>) characters, but does not support regular expressions.
/// </param>
/// <param name="options"><see cref="DirectoryEnumerationOptions"/> flags that specify how the directory is to be enumerated.</param>
[SecurityCritical]
public static IEnumerable<string> EnumerateFileSystemEntriesTransacted(KernelTransaction transaction, string path, string searchPattern, DirectoryEnumerationOptions options)
{
return EnumerateFileSystemEntryInfosCore<string>(transaction, path, searchPattern, options, PathFormat.RelativePath);
}
/// <summary>[AlphaFS] Returns an enumerable collection of file names and directory names that match a <paramref name="searchPattern"/> in a specified <paramref name="path"/>.</summary>
/// <returns>An enumerable collection of file system entries in the directory specified by <paramref name="path"/> and that match the specified <paramref name="searchPattern"/>.</returns>
/// <exception cref="ArgumentException"/>
/// <exception cref="ArgumentNullException"/>
/// <exception cref="DirectoryNotFoundException"/>
/// <exception cref="IOException"/>
/// <exception cref="NotSupportedException"/>
/// <exception cref="UnauthorizedAccessException"/>
/// <param name="transaction">The transaction.</param>
/// <param name="path">The directory to search.</param>
/// <param name="searchPattern">
/// The search string to match against the names of directories in <paramref name="path"/>.
/// This parameter can contain a combination of valid literal path and wildcard
/// (<see cref="Path.WildcardStarMatchAll"/> and <see cref="Path.WildcardQuestion"/>) characters, but does not support regular expressions.
/// </param>
/// <param name="options"><see cref="DirectoryEnumerationOptions"/> flags that specify how the directory is to be enumerated.</param>
/// <param name="pathFormat">Indicates the format of the path parameter(s).</param>
[SecurityCritical]
public static IEnumerable<string> EnumerateFileSystemEntriesTransacted(KernelTransaction transaction, string path, string searchPattern, DirectoryEnumerationOptions options, PathFormat pathFormat)
{
return EnumerateFileSystemEntryInfosCore<string>(transaction, path, searchPattern, options, pathFormat);
}
#endregion // Transactional
}
}
| 66.968288 | 231 | 0.708012 | [
"MIT"
] | OpenDataSpace/AlphaFS | AlphaFS/Filesystem/Directory Class/Directory.EnumerateFileSystemEntries.cs | 31,676 | 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.DataFactory.V20170901Preview.Outputs
{
[OutputType]
public sealed class RetryPolicyResponse
{
/// <summary>
/// Maximum ordinary retry attempts. Default is 0. Type: integer (or Expression with resultType integer), minimum: 0.
/// </summary>
public readonly object? Count;
/// <summary>
/// Interval between retries in seconds. Default is 30.
/// </summary>
public readonly int? IntervalInSeconds;
[OutputConstructor]
private RetryPolicyResponse(
object? count,
int? intervalInSeconds)
{
Count = count;
IntervalInSeconds = intervalInSeconds;
}
}
}
| 28.833333 | 125 | 0.643545 | [
"Apache-2.0"
] | pulumi-bot/pulumi-azure-native | sdk/dotnet/DataFactory/V20170901Preview/Outputs/RetryPolicyResponse.cs | 1,038 | C# |
// Autor : Juan Parra
// 3Soft
namespace Jen
{
/// <summary>
/// para invocar a funciones sin argumentos y sin retorno
/// </summary>
public delegate void Proc();
/// <summary>
/// para invocar a funciones sin retorno con argumento TParam
/// </summary>
/// <typeparam name="TParam">Tipo del argmento</typeparam>
/// <param name="param">parametro de entrada a la funcion</param>
public delegate void Proc<TParam>(TParam param);
public delegate void Proc<TParam1, TParam2>(TParam1 param1, TParam2 param2);
/// <summary>
/// para invocar funciones con retorno del tipo TRetorno sin argumentos
/// </summary>
/// <typeparam name="TRetorno">Tipo devuelto</typeparam>
/// <returns>Retorna la instancia de TRetorno</returns>
public delegate TRetorno Func<TRetorno>();
/// <summary>
/// para invocar a funciones que retornan un TRetorno y reciben como parametro un TParam
/// </summary>
/// <typeparam name="TParam">Tipo de entrada a la funcion</typeparam>
/// <typeparam name="TRetorno">Tipo de retorno de la funcion</typeparam>
/// <param name="param">Parametro de entrada</param>
/// <returns></returns>
public delegate TRetorno Func<TParam, TRetorno>(TParam param);
/// <summary>
/// para invocar funciones con retorno y dos parametros de entrada
/// </summary>
/// <typeparam name="TParam1">Tipo de parámetro 1</typeparam>
/// <typeparam name="TParam2">Tipo de parámetro 2</typeparam>
/// <typeparam name="TRetorno">Tipo de retorno</typeparam>
/// <param name="param1">Parámetro 1</param>
/// <param name="param2">Parámetro 2</param>
/// <returns></returns>
public delegate TRetorno Func<TParam1, TParam2, TRetorno>(TParam1 param1, TParam2 param2);
} | 44.725 | 94 | 0.66853 | [
"Apache-2.0"
] | JuanParraC/Jen | Delegados.cs | 1,795 | C# |
using System;
using NetRuntimeSystem = System;
using System.ComponentModel;
using NetOffice.Attributes;
namespace NetOffice.MSFormsApi
{
/// <summary>
/// DispatchInterface IMdcToggleButton
/// SupportByVersion MSForms, 2
/// </summary>
[SupportByVersion("MSForms", 2)]
[EntityType(EntityType.IsDispatchInterface), BaseType]
[TypeId("8BD21D63-EC42-11CE-9E0D-00AA006002F3")]
[CoClassSource(typeof(NetOffice.MSFormsApi.ToggleButton))]
public interface IMdcToggleButton : IMdcCheckBox
{
}
}
| 25.4 | 62 | 0.76378 | [
"MIT"
] | igoreksiz/NetOffice | Source/MSForms/DispatchInterfaces/IMdcToggleButton.cs | 510 | C# |
using System;
using System.IO;
using System.Net;
using System.Text;
using System.Security.Cryptography.X509Certificates;
using System.Net.Security;
/////////////////////////////////////////////////////////////////////////////////////////////////////
//web_client
/////////////////////////////////////////////////////////////////////////////////////////////////////
class web_client
{
/////////////////////////////////////////////////////////////////////////////////////////////////////
//Main
/////////////////////////////////////////////////////////////////////////////////////////////////////
static void Main(string[] args)
{
bool secure = true;
string uri;
if (secure)
{
ServicePointManager.ServerCertificateValidationCallback = delegate (object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return true; };
uri = "https://127.0.0.1:8443";
}
else
{
uri = "http://127.0.0.1:8000";
}
string message = "message_from_client";
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
request.KeepAlive = false;
request.ProtocolVersion = HttpVersion.Version10;
request.Method = "POST";
byte[] buf = Encoding.ASCII.GetBytes(message);
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = buf.Length;
Stream stream = request.GetRequestStream();
stream.Write(buf, 0, buf.Length);
stream.Close();
Console.WriteLine("Client sent:");
Console.WriteLine(message);
/////////////////////////////////////////////////////////////////////////////////////////////////////
//get response
/////////////////////////////////////////////////////////////////////////////////////////////////////
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Console.WriteLine("Client received:");
Console.WriteLine(new StreamReader(response.GetResponseStream()).ReadToEnd());
Console.WriteLine(response.StatusCode);
}
}//web_client
| 34.1 | 185 | 0.489247 | [
"Apache-2.0"
] | pedro-vicente/lib_netsockets_cs | web_client.cs | 2,046 | C# |
using Newtonsoft.Json.Linq;
namespace SitecoreCognitiveServices.Foundation.BigMLSDK
{
public partial class Centroid
{
public class Arguments : Arguments<Centroid>
{
/// <summary>
/// A valid dataset/id.
/// </summary>
public string DataSet
{
get;
set;
}
public override JObject ToJson()
{
dynamic json = base.ToJson();
if(!string.IsNullOrWhiteSpace(DataSet)) json.dataset = DataSet;
return json;
}
}
}
} | 21.793103 | 79 | 0.476266 | [
"MIT"
] | markstiles/SitecoreCognitiveServices.Core | src/Foundation/BigMLSDK/code/Centroid/Arguments.cs | 632 | C# |
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("WebProject")]
[assembly: AssemblyDescription("Módulo Web")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Numeric | Kay Pacha")]
[assembly: AssemblyProduct("Plataforma PLATANUM")]
[assembly: AssemblyCopyright("Copyright © 2011 - 2015")]
[assembly: AssemblyTrademark("www.numeric.com.br")]
[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("539e21d0-7b12-4d1c-a18a-64495ea9d1fa")]
// 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.1.0.0")]
[assembly: AssemblyFileVersion("1.1.0.0")]
| 39.314286 | 84 | 0.74782 | [
"Apache-2.0"
] | NumericTechnology/SkeletonApp.Net | WebSolution/WebProject/Properties/AssemblyInfo.cs | 1,380 | C# |
using System;
using System.Collections.Generic;
using SadConsole.StringParser;
namespace SadConsole
{
public partial class ColoredString
{
/*
https://github.com/Thraka/SadConsole/discussions/272
New replaceable method named Parse. Must be generic enough to not accept an existing stack of commands.
Shouldn't talk to surface itself. But how would it then do something like encoded commands that did something like
clear the surface or even move the cursor around, like ansi sequences? Generally the cursor parses these though. So
where should that design be?
Either way, the string parser needs to be more dynamic in some case. If someone wanted BBCode, they should be able
to replace the main Parse method with their own and the existing Cursor and other things that call coloredstring.parse
should still function as normal.
*/
/// <summary>
/// This method is obsolete. Use <see cref="Parser"/>.
/// </summary>
[Obsolete("This method is forwarding to Parser.Parse. Use Parser.Parse instead.")]
public static ColoredString Parse(string value, int surfaceIndex = -1, ICellSurface surface = null, ParseCommandStacks initialBehaviors = null) =>
Parser.Parse(value, surfaceIndex, surface, initialBehaviors);
/// <summary>
/// The string parser to use for transforming strings into <see cref="ColoredString"/>.
/// </summary>
public static IParser Parser { get; set; } = new Default();
}
}
| 46.857143 | 154 | 0.657317 | [
"MIT"
] | SadConsole/SadConsole | SadConsole/ColoredString.Parse.cs | 1,642 | C# |
using System;
using System.Collections.Generic;
using Models.Dtos.Taches;
namespace Models.Mocks
{
public class TacheMock : IDtoMock<TacheReadDto>
{
public IList<TacheReadDto> Data { get; }
public TacheMock()
{
Data = new List<TacheReadDto>
{
new TacheReadDto
{
Id = 1,
Active = true,
Cycle = 0,
DateFin = DateTime.Now,
Description = null,
LocataireId = 5,
Nom = "Balayer"
},
new TacheReadDto
{
Id = 1000,
Active = false,
Cycle = 10,
DateFin = DateTime.Now,
Description = "coucou",
LocataireId = 1,
Nom = "Laver"
}
};
}
}
}
| 16.05 | 48 | 0.579439 | [
"MIT"
] | secretMoi/Wallon | Models/Mocks/TacheMock.cs | 644 | C# |
// <auto-generated />
using Database;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace Database.Migrations
{
[DbContext(typeof(DemoDbContext))]
partial class DemoDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("ProductVersion", "5.0.6")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("Database.EntityModels.Item", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("Name")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Items");
});
#pragma warning restore 612, 618
}
}
}
| 34.846154 | 125 | 0.618837 | [
"MIT"
] | ArmandJ77/grpc-demo | Demo/Database/Migrations/DemoDbContextModelSnapshot.cs | 1,361 | C# |
namespace Esri.ArcGISRuntime.OpenSourceApps.MapsApp.UWP
{
public sealed partial class MainPage
{
public MainPage()
{
InitializeComponent();
LoadApplication(new Xamarin.App());
}
}
}
| 18.769231 | 56 | 0.586066 | [
"Apache-2.0"
] | ArcGIS/maps-app-dotnet | src/MapsApp.UWP/MainPage.xaml.cs | 246 | C# |
using Nito.AsyncEx;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.ExceptionServices;
using System.Threading;
using System.Threading.Tasks;
namespace Discord
{
/// <summary> Helper class used to manage several tasks and keep them in sync. If any single task errors or stops, all other tasks will also be stopped. </summary>
public sealed class TaskManager
{
private readonly AsyncLock _lock;
private readonly Func<Task> _stopAction;
private CancellationTokenSource _cancelSource;
private Task _task;
public bool WasStopExpected => _wasStopExpected;
private bool _wasStopExpected;
public Exception Exception => _stopReason?.SourceException;
private ExceptionDispatchInfo _stopReason;
internal TaskManager()
{
_lock = new AsyncLock();
}
public TaskManager(Action stopAction)
: this()
{
_stopAction = TaskHelper.ToAsync(stopAction);
}
public TaskManager(Func<Task> stopAction)
: this()
{
_stopAction = stopAction;
}
public async Task Start(IEnumerable<Task> tasks, CancellationTokenSource cancelSource)
{
while (true)
{
var task = _task;
if (task != null)
await Stop().ConfigureAwait(false);
using (await _lock.LockAsync().ConfigureAwait(false))
{
_cancelSource = cancelSource;
if (_task != null)
continue; //Another thread sneaked in and started this manager before we got a lock, loop and try again
_stopReason = null;
_wasStopExpected = false;
Task[] tasksArray = tasks.ToArray();
Task<Task> anyTask = Task.WhenAny(tasksArray);
Task allTasks = Task.WhenAll(tasksArray);
_task = Task.Run(async () =>
{
//Wait for the first task to stop or error
Task firstTask = await anyTask.ConfigureAwait(false);
//Signal the rest of the tasks to stop
if (firstTask.Exception != null)
await SignalError(firstTask.Exception).ConfigureAwait(false);
else
await SignalStop().ConfigureAwait(false);
//Wait for the other tasks, and signal their errors too just in case
try { await allTasks.ConfigureAwait(false); }
catch (AggregateException ex) { await SignalError(ex.InnerExceptions.First()).ConfigureAwait(false); }
catch (Exception ex) { await SignalError(ex).ConfigureAwait(false); }
//Run the cleanup function within our lock
if (_stopAction != null)
await _stopAction().ConfigureAwait(false);
_task = null;
_cancelSource = null;
});
return;
}
}
}
public async Task SignalStop(bool isExpected = false)
{
using (await _lock.LockAsync().ConfigureAwait(false))
{
if (isExpected)
_wasStopExpected = true;
if (_task == null) return; //Are we running?
if (_cancelSource.IsCancellationRequested) return;
if (_cancelSource != null)
_cancelSource.Cancel();
}
}
public async Task Stop(bool isExpected = false)
{
Task task;
using (await _lock.LockAsync().ConfigureAwait(false))
{
if (isExpected)
_wasStopExpected = true;
//Cache the task so we still have something to await if Cleanup is run really quickly
task = _task;
if (task == null) return; //Are we running?
if (!_cancelSource.IsCancellationRequested && _cancelSource != null)
_cancelSource.Cancel();
}
await task.ConfigureAwait(false);
}
public async Task SignalError(Exception ex)
{
using (await _lock.LockAsync().ConfigureAwait(false))
{
if (_stopReason != null) return;
_stopReason = ExceptionDispatchInfo.Capture(ex);
if (_cancelSource != null)
_cancelSource.Cancel();
}
}
public async Task Error(Exception ex)
{
Task task;
using (await _lock.LockAsync().ConfigureAwait(false))
{
if (_stopReason != null) return;
//Cache the task so we still have something to await if Cleanup is run really quickly
task = _task ?? TaskHelper.CompletedTask;
if (!_cancelSource.IsCancellationRequested)
{
_stopReason = ExceptionDispatchInfo.Capture(ex);
if (_cancelSource != null)
_cancelSource.Cancel();
}
}
await task.ConfigureAwait(false);
}
/// <summary> Throws an exception if one was captured. </summary>
public void ThrowException()
{
using (_lock.Lock())
_stopReason?.Throw();
}
public void ClearException()
{
using (_lock.Lock())
{
_stopReason = null;
_wasStopExpected = false;
}
}
}
}
| 35.011905 | 167 | 0.516491 | [
"MIT"
] | jarveson/Discord.Net | src/Discord.Net/TaskManager.cs | 5,884 | C# |
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace PRSP_1Ejemplo
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
Process[] procesos = Process.GetProcesses();
foreach (Process item in procesos)
{
listBoxProcesos.Items.Add(item.ProcessName);
}
}
private void button1_Click(object sender, EventArgs e)
{
Process notepadProcess = new Process();
string processName = "Notepad";
notepadProcess.StartInfo.FileName = processName;
notepadProcess.StartInfo.WindowStyle = ProcessWindowStyle.Maximized;
if (Process.GetProcessesByName(notepadProcess.ProcessName).Length > 0)
notepadProcess.Start();
else
notepadProcess.Kill();
}
private void button2_Click(object sender, EventArgs e)
{
Process wordProcess = new Process();
//string processName = @"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Office 2013\Word 2013";
string processName = "WinWord";
if (!processIsOpen(processName))
{
wordProcess.StartInfo.FileName = processName;
wordProcess.StartInfo.WindowStyle = ProcessWindowStyle.Minimized;
wordProcess.Start();
}
else
wordProcess.Kill();
}
private bool processIsOpen(string processName)
{
Process[] procesos = Process.GetProcesses();
foreach (Process item in procesos)
if (item.ProcessName == processName)
return true;
return false;
}
private void button3_Click(object sender, EventArgs e)
{
string processName = "chrome";
Process[] procesos = Process.GetProcesses();
foreach (Process item in procesos)
if (item.ProcessName == processName)
item.Kill();
}
}
| 30.526316 | 123 | 0.579741 | [
"MIT"
] | aliostad/deep-learning-lang-detection | data/train/csharp/4934e678e3cb0bbd0ac56b58b5d37a3970b9c747Form1.cs | 2,322 | C# |
// Copyright 2011-2014 Chris Patterson, Dru Sellers
//
// 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 Automatonymous
{
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
public interface State :
Visitable,
IComparable<State>
{
string Name { get; }
/// <summary>
/// Raised when the state is entered
/// </summary>
Event Enter { get; }
/// <summary>
/// Raised when the state is about to be left
/// </summary>
Event Leave { get; }
/// <summary>
/// Raised just before the state is about to change to a new state
/// </summary>
Event<State> BeforeEnter { get; }
/// <summary>
/// Raised just after the state has been left and a new state is selected
/// </summary>
Event<State> AfterLeave { get; }
}
/// <summary>
/// A state within a state machine that can be targeted with events
/// </summary>
/// <typeparam name="TInstance">The instance type to which the state applies</typeparam>
public interface State<TInstance> :
State
{
IEnumerable<Event> Events { get; }
/// <summary>
/// Returns the superState of the state, if there is one
/// </summary>
State<TInstance> SuperState { get; }
Task Raise(EventContext<TInstance> context);
/// <summary>
/// Raise an event to the state, passing the instance
/// </summary>
/// <typeparam name="T">The event data type</typeparam>
/// <param name="context">The event context</param>
/// <returns></returns>
Task Raise<T>(EventContext<TInstance, T> context);
/// <summary>
/// Bind an activity to an event
/// </summary>
/// <param name="event"></param>
/// <param name="activity"></param>
void Bind(Event @event, Activity<TInstance> activity);
/// <summary>
/// Ignore the specified event in this state. Prevents an exception from being thrown if
/// the event is raised during this state.
/// </summary>
/// <param name="event"></param>
void Ignore(Event @event);
/// <summary>
/// Ignore the specified event in this state if the filter condition passed. Prevents exceptions
/// from being thrown if the event is raised during this state.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="event"></param>
/// <param name="filter"></param>
void Ignore<T>(Event<T> @event, StateMachineEventFilter<TInstance, T> filter);
/// <summary>
/// Adds a substate to the state
/// </summary>
/// <param name="subState"></param>
void AddSubstate(State<TInstance> subState);
/// <summary>
/// True if the specified state is included in the state
/// </summary>
/// <param name="state"></param>
/// <returns></returns>
bool HasState(State<TInstance> state);
/// <summary>
/// True if the specified state is a substate of the current state
/// </summary>
/// <param name="state"></param>
/// <returns></returns>
bool IsStateOf(State<TInstance> state);
}
} | 35.017544 | 105 | 0.570641 | [
"Apache-2.0"
] | DamirAinullin/Automatonymous | src/Automatonymous/State.cs | 3,992 | C# |
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: Microsoft.Extensions.Configuration.UserSecrets.UserSecretsIdAttribute("c48460f4-b607-43f6-8281-ea6cb2d88b4a")]
[assembly: System.Reflection.AssemblyCompanyAttribute("ContaMicroservice")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyProductAttribute("ContaMicroservice")]
[assembly: System.Reflection.AssemblyTitleAttribute("ContaMicroservice")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// Generated by the MSBuild WriteCodeFragment class.
| 44.92 | 121 | 0.676759 | [
"MIT"
] | WillaOnStenci/Arca | backend/ContaMicroservice/ContaMicroservice/obj/Debug/netcoreapp3.0/AssociadoMicroservice.AssemblyInfo.cs | 1,123 | C# |
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using ABPWASM.Data;
using Serilog;
using Volo.Abp;
namespace ABPWASM.DbMigrator
{
public class DbMigratorHostedService : IHostedService
{
private readonly IHostApplicationLifetime _hostApplicationLifetime;
private readonly IConfiguration _configuration;
public DbMigratorHostedService(IHostApplicationLifetime hostApplicationLifetime, IConfiguration configuration)
{
_hostApplicationLifetime = hostApplicationLifetime;
_configuration = configuration;
}
public async Task StartAsync(CancellationToken cancellationToken)
{
using (var application = AbpApplicationFactory.Create<ABPWASMDbMigratorModule>(options =>
{
options.Services.ReplaceConfiguration(_configuration);
options.UseAutofac();
options.Services.AddLogging(c => c.AddSerilog());
}))
{
application.Initialize();
await application
.ServiceProvider
.GetRequiredService<ABPWASMDbMigrationService>()
.MigrateAsync();
application.Shutdown();
_hostApplicationLifetime.StopApplication();
}
}
public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask;
}
}
| 32.479167 | 118 | 0.658114 | [
"MIT"
] | FangJY/ABPWASM | src/ABPWASM.DbMigrator/DbMigratorHostedService.cs | 1,561 | 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 rds-2014-10-31.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.RDS.Model
{
/// <summary>
/// <code>DBSubnetGroupName</code> doesn't refer to an existing DB subnet group.
/// </summary>
#if !NETSTANDARD
[Serializable]
#endif
public partial class DBSubnetGroupNotFoundException : AmazonRDSException
{
/// <summary>
/// Constructs a new DBSubnetGroupNotFoundException with the specified error
/// message.
/// </summary>
/// <param name="message">
/// Describes the error encountered.
/// </param>
public DBSubnetGroupNotFoundException(string message)
: base(message) {}
/// <summary>
/// Construct instance of DBSubnetGroupNotFoundException
/// </summary>
/// <param name="message"></param>
/// <param name="innerException"></param>
public DBSubnetGroupNotFoundException(string message, Exception innerException)
: base(message, innerException) {}
/// <summary>
/// Construct instance of DBSubnetGroupNotFoundException
/// </summary>
/// <param name="innerException"></param>
public DBSubnetGroupNotFoundException(Exception innerException)
: base(innerException) {}
/// <summary>
/// Construct instance of DBSubnetGroupNotFoundException
/// </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 DBSubnetGroupNotFoundException(string message, Exception innerException, ErrorType errorType, string errorCode, string requestId, HttpStatusCode statusCode)
: base(message, innerException, errorType, errorCode, requestId, statusCode) {}
/// <summary>
/// Construct instance of DBSubnetGroupNotFoundException
/// </summary>
/// <param name="message"></param>
/// <param name="errorType"></param>
/// <param name="errorCode"></param>
/// <param name="requestId"></param>
/// <param name="statusCode"></param>
public DBSubnetGroupNotFoundException(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 DBSubnetGroupNotFoundException 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 DBSubnetGroupNotFoundException(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
}
} | 47.709677 | 178 | 0.683401 | [
"Apache-2.0"
] | ChristopherButtars/aws-sdk-net | sdk/src/Services/RDS/Generated/Model/DBSubnetGroupNotFoundException.cs | 5,916 | C# |
using mr.cooper.mrtwit.models;
namespace mr.cooper.mrtwit.services.Interface
{
public interface IFeedService
{
void AddFeed(Feed feed);
Feed GetFeed(string userId);
}
}
| 15.538462 | 45 | 0.663366 | [
"Unlicense"
] | yathrikash/mr_twit_api | mr.cooper.mrtwit.api/mr.cooper.mrtwit.services/Interface/IFeedService.cs | 204 | C# |
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Reflection;
using CSJ2K;
using Nini.Config;
using log4net;
using Warp3D;
using Mono.Addins;
using OpenSim.Framework;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Region.PhysicsModules.SharedBase;
using OpenSim.Services.Interfaces;
using OpenMetaverse;
using OpenMetaverse.Assets;
using OpenMetaverse.Imaging;
using OpenMetaverse.Rendering;
using OpenMetaverse.StructuredData;
using WarpRenderer = global::Warp3D.Warp3D;
namespace OpenSim.Region.CoreModules.World.Warp3DMap
{
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "Warp3DImageModule")]
public class Warp3DImageModule : IMapImageGenerator, INonSharedRegionModule
{
private static readonly UUID TEXTURE_METADATA_MAGIC = new UUID("802dc0e0-f080-4931-8b57-d1be8611c4f3");
private static readonly Color4 WATER_COLOR = new Color4(29, 72, 96, 216);
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
#pragma warning disable 414
private static string LogHeader = "[WARP 3D IMAGE MODULE]";
#pragma warning restore 414
private Scene m_scene;
private IRendering m_primMesher;
private Dictionary<UUID, Color4> m_colors = new Dictionary<UUID, Color4>();
private IConfigSource m_config;
private bool m_drawPrimVolume = true; // true if should render the prims on the tile
private bool m_textureTerrain = true; // true if to create terrain splatting texture
private bool m_texturePrims = true; // true if should texture the rendered prims
private float m_texturePrimSize = 48f; // size of prim before we consider texturing it
private bool m_renderMeshes = false; // true if to render meshes rather than just bounding boxes
private bool m_Enabled = false;
// private Bitmap lastImage = null;
private DateTime lastImageTime = DateTime.MinValue;
#region Region Module interface
public void Initialise(IConfigSource source)
{
m_config = source;
string[] configSections = new string[] { "Map", "Startup" };
if (Util.GetConfigVarFromSections<string>(
m_config, "MapImageModule", configSections, "MapImageModule") != "Warp3DImageModule")
return;
m_Enabled = true;
m_drawPrimVolume
= Util.GetConfigVarFromSections<bool>(m_config, "DrawPrimOnMapTile", configSections, m_drawPrimVolume);
m_textureTerrain
= Util.GetConfigVarFromSections<bool>(m_config, "TextureOnMapTile", configSections, m_textureTerrain);
m_texturePrims
= Util.GetConfigVarFromSections<bool>(m_config, "TexturePrims", configSections, m_texturePrims);
m_texturePrimSize
= Util.GetConfigVarFromSections<float>(m_config, "TexturePrimSize", configSections, m_texturePrimSize);
m_renderMeshes
= Util.GetConfigVarFromSections<bool>(m_config, "RenderMeshes", configSections, m_renderMeshes);
}
public void AddRegion(Scene scene)
{
if (!m_Enabled)
return;
m_scene = scene;
List<string> renderers = RenderingLoader.ListRenderers(Util.ExecutingDirectory());
if (renderers.Count > 0)
m_log.Info("[MAPTILE]: Loaded prim mesher " + renderers[0]);
else
m_log.Info("[MAPTILE]: No prim mesher loaded, prim rendering will be disabled");
m_scene.RegisterModuleInterface<IMapImageGenerator>(this);
}
public void RegionLoaded(Scene scene)
{
}
public void RemoveRegion(Scene scene)
{
}
public void Close()
{
}
public string Name
{
get { return "Warp3DImageModule"; }
}
public Type ReplaceableInterface
{
get { return null; }
}
#endregion
#region IMapImageGenerator Members
public Bitmap CreateMapTile()
{
/* this must be on all map, not just its image
if ((DateTime.Now - lastImageTime).TotalSeconds < 3600)
{
return (Bitmap)lastImage.Clone();
}
*/
List<string> renderers = RenderingLoader.ListRenderers(Util.ExecutingDirectory());
if (renderers.Count > 0)
{
m_primMesher = RenderingLoader.LoadRenderer(renderers[0]);
}
Vector3 camPos = new Vector3(
m_scene.RegionInfo.RegionSizeX / 2 - 0.5f,
m_scene.RegionInfo.RegionSizeY / 2 - 0.5f,
221.7025033688163f);
// Viewport viewing down onto the region
Viewport viewport = new Viewport(camPos, -Vector3.UnitZ, 1024f, 0.1f,
(int)m_scene.RegionInfo.RegionSizeX, (int)m_scene.RegionInfo.RegionSizeY,
(float)m_scene.RegionInfo.RegionSizeX, (float)m_scene.RegionInfo.RegionSizeY);
Bitmap tile = CreateMapTile(viewport, false);
m_primMesher = null;
return tile;
/*
lastImage = tile;
lastImageTime = DateTime.Now;
return (Bitmap)lastImage.Clone();
*/
}
public Bitmap CreateViewImage(Vector3 camPos, Vector3 camDir, float fov, int width, int height, bool useTextures)
{
Viewport viewport = new Viewport(camPos, camDir, fov, Constants.RegionSize, 0.1f, width, height);
return CreateMapTile(viewport, useTextures);
}
public Bitmap CreateMapTile(Viewport viewport, bool useTextures)
{
m_colors.Clear();
int width = viewport.Width;
int height = viewport.Height;
WarpRenderer renderer = new WarpRenderer();
if(!renderer.CreateScene(width, height))
return new Bitmap(width,height);
#region Camera
warp_Vector pos = ConvertVector(viewport.Position);
warp_Vector lookat = warp_Vector.add(ConvertVector(viewport.Position), ConvertVector(viewport.LookDirection));
renderer.Scene.defaultCamera.setPos(pos);
renderer.Scene.defaultCamera.lookAt(lookat);
if (viewport.Orthographic)
{
renderer.Scene.defaultCamera.setOrthographic(true,viewport.OrthoWindowWidth, viewport.OrthoWindowHeight);
}
else
{
float fov = viewport.FieldOfView;
fov *= 1.75f; // FIXME: ???
renderer.Scene.defaultCamera.setFov(fov);
}
#endregion Camera
renderer.Scene.addLight("Light1", new warp_Light(new warp_Vector(1.0f, 0.5f, 1f), 0xffffff, 0, 320, 40));
renderer.Scene.addLight("Light2", new warp_Light(new warp_Vector(-1f, -1f, 1f), 0xffffff, 0, 100, 40));
CreateWater(renderer);
CreateTerrain(renderer, m_textureTerrain);
if (m_drawPrimVolume)
CreateAllPrims(renderer, useTextures);
renderer.Render();
Bitmap bitmap = renderer.Scene.getImage();
renderer.Scene.destroy();
renderer.Reset();
renderer = null;
viewport = null;
m_colors.Clear();
GC.Collect();
m_log.Debug("[WARP 3D IMAGE MODULE]: GC.Collect()");
return bitmap;
}
public byte[] WriteJpeg2000Image()
{
try
{
using (Bitmap mapbmp = CreateMapTile())
return OpenJPEG.EncodeFromImage(mapbmp, true);
}
catch (Exception e)
{
// JPEG2000 encoder failed
m_log.Error("[WARP 3D IMAGE MODULE]: Failed generating terrain map: ", e);
}
return null;
}
#endregion
#region Rendering Methods
// Add a water plane to the renderer.
private void CreateWater(WarpRenderer renderer)
{
float waterHeight = (float)m_scene.RegionInfo.RegionSettings.WaterHeight;
renderer.AddPlane("Water", m_scene.RegionInfo.RegionSizeX * 0.5f);
renderer.Scene.sceneobject("Water").setPos(m_scene.RegionInfo.RegionSizeX * 0.5f - 0.5f,
waterHeight,
m_scene.RegionInfo.RegionSizeY * 0.5f - 0.5f);
warp_Material waterColorMaterial = new warp_Material(ConvertColor(WATER_COLOR));
waterColorMaterial.setReflectivity(0); // match water color with standard map module thanks lkalif
waterColorMaterial.setTransparency((byte)((1f - WATER_COLOR.A) * 255f));
renderer.Scene.addMaterial("WaterColor", waterColorMaterial);
renderer.SetObjectMaterial("Water", "WaterColor");
}
// Add a terrain to the renderer.
// Note that we create a 'low resolution' 256x256 vertex terrain rather than trying for
// full resolution. This saves a lot of memory especially for very large regions.
private void CreateTerrain(WarpRenderer renderer, bool textureTerrain)
{
ITerrainChannel terrain = m_scene.Heightmap;
float regionsx = m_scene.RegionInfo.RegionSizeX;
float regionsy = m_scene.RegionInfo.RegionSizeY;
// 'diff' is the difference in scale between the real region size and the size of terrain we're buiding
float diff = regionsx / 256f;
int npointsx =(int)(regionsx / diff);
int npointsy =(int)(regionsy / diff);
float invsx = 1.0f / regionsx;
float invsy = 1.0f / (float)m_scene.RegionInfo.RegionSizeY;
// Create all the vertices for the terrain
warp_Object obj = new warp_Object();
for (float y = 0; y < regionsy; y += diff)
{
for (float x = 0; x < regionsx; x += diff)
{
warp_Vector pos = ConvertVector(x , y , (float)terrain[(int)x, (int)y]);
obj.addVertex(new warp_Vertex(pos, x * invsx, 1.0f - y * invsy));
}
}
// Now that we have all the vertices, make another pass and
// create the list of triangle indices.
float invdiff = 1.0f / diff;
int limx = npointsx - 1;
int limy = npointsy - 1;
for (float y = 0; y < regionsy; y += diff)
{
for (float x = 0; x < regionsx; x += diff)
{
float newX = x * invdiff;
float newY = y * invdiff;
if (newX < limx && newY < limy)
{
int v = (int)newY * npointsx + (int)newX;
// Make two triangles for each of the squares in the grid of vertices
obj.addTriangle(
v,
v + 1,
v + npointsx);
obj.addTriangle(
v + npointsx + 1,
v + npointsx,
v + 1);
}
}
}
renderer.Scene.addObject("Terrain", obj);
UUID[] textureIDs = new UUID[4];
float[] startHeights = new float[4];
float[] heightRanges = new float[4];
OpenSim.Framework.RegionSettings regionInfo = m_scene.RegionInfo.RegionSettings;
textureIDs[0] = regionInfo.TerrainTexture1;
textureIDs[1] = regionInfo.TerrainTexture2;
textureIDs[2] = regionInfo.TerrainTexture3;
textureIDs[3] = regionInfo.TerrainTexture4;
startHeights[0] = (float)regionInfo.Elevation1SW;
startHeights[1] = (float)regionInfo.Elevation1NW;
startHeights[2] = (float)regionInfo.Elevation1SE;
startHeights[3] = (float)regionInfo.Elevation1NE;
heightRanges[0] = (float)regionInfo.Elevation2SW;
heightRanges[1] = (float)regionInfo.Elevation2NW;
heightRanges[2] = (float)regionInfo.Elevation2SE;
heightRanges[3] = (float)regionInfo.Elevation2NE;
uint globalX, globalY;
Util.RegionHandleToWorldLoc(m_scene.RegionInfo.RegionHandle, out globalX, out globalY);
warp_Texture texture;
using (Bitmap image = TerrainSplat.Splat(
terrain, textureIDs, startHeights, heightRanges,
new Vector3d(globalX, globalY, 0.0), m_scene.AssetService, textureTerrain))
texture = new warp_Texture(image);
warp_Material material = new warp_Material(texture);
material.setReflectivity(50);
renderer.Scene.addMaterial("TerrainColor", material);
renderer.Scene.material("TerrainColor").setReflectivity(0); // reduces tile seams a bit thanks lkalif
renderer.SetObjectMaterial("Terrain", "TerrainColor");
}
private void CreateAllPrims(WarpRenderer renderer, bool useTextures)
{
if (m_primMesher == null)
return;
m_scene.ForEachSOG(
delegate(SceneObjectGroup group)
{
foreach (SceneObjectPart child in group.Parts)
CreatePrim(renderer, child, useTextures);
}
);
}
private void CreatePrim(WarpRenderer renderer, SceneObjectPart prim,
bool useTextures)
{
const float MIN_SIZE_SQUARE = 4f;
if ((PCode)prim.Shape.PCode != PCode.Prim)
return;
float primScaleLenSquared = prim.Scale.LengthSquared();
if (primScaleLenSquared < MIN_SIZE_SQUARE)
return;
FacetedMesh renderMesh = null;
Primitive omvPrim = prim.Shape.ToOmvPrimitive(prim.OffsetPosition, prim.RotationOffset);
if (m_renderMeshes)
{
if (omvPrim.Sculpt != null && omvPrim.Sculpt.SculptTexture != UUID.Zero)
{
// Try fetchinng the asset
byte[] sculptAsset = m_scene.AssetService.GetData(omvPrim.Sculpt.SculptTexture.ToString());
if (sculptAsset != null)
{
// Is it a mesh?
if (omvPrim.Sculpt.Type == SculptType.Mesh)
{
AssetMesh meshAsset = new AssetMesh(omvPrim.Sculpt.SculptTexture, sculptAsset);
FacetedMesh.TryDecodeFromAsset(omvPrim, meshAsset, DetailLevel.Highest, out renderMesh);
meshAsset = null;
}
else // It's sculptie
{
IJ2KDecoder imgDecoder = m_scene.RequestModuleInterface<IJ2KDecoder>();
if(imgDecoder != null)
{
Image sculpt = imgDecoder.DecodeToImage(sculptAsset);
if(sculpt != null)
{
renderMesh = m_primMesher.GenerateFacetedSculptMesh(omvPrim,(Bitmap)sculpt,
DetailLevel.Medium);
sculpt.Dispose();
}
}
}
}
}
}
// If not a mesh or sculptie, try the regular mesher
if (renderMesh == null)
{
renderMesh = m_primMesher.GenerateFacetedMesh(omvPrim, DetailLevel.Medium);
}
if (renderMesh == null)
return;
string primID = prim.UUID.ToString();
// Create the prim faces
// TODO: Implement the useTextures flag behavior
for (int i = 0; i < renderMesh.Faces.Count; i++)
{
Face face = renderMesh.Faces[i];
string meshName = primID + i.ToString();
// Avoid adding duplicate meshes to the scene
if (renderer.Scene.objectData.ContainsKey(meshName))
continue;
warp_Object faceObj = new warp_Object();
for (int j = 0; j < face.Vertices.Count; j++)
{
Vertex v = face.Vertices[j];
warp_Vector pos = ConvertVector(v.Position);
warp_Vertex vert = new warp_Vertex(pos, v.TexCoord.X, v.TexCoord.Y);
faceObj.addVertex(vert);
}
for (int j = 0; j < face.Indices.Count; j += 3)
{
faceObj.addTriangle(
face.Indices[j + 0],
face.Indices[j + 1],
face.Indices[j + 2]);
}
Primitive.TextureEntryFace teFace = prim.Shape.Textures.GetFace((uint)i);
Color4 faceColor = GetFaceColor(teFace);
string materialName = String.Empty;
if (m_texturePrims && primScaleLenSquared > m_texturePrimSize*m_texturePrimSize)
materialName = GetOrCreateMaterial(renderer, faceColor, teFace.TextureID);
else
materialName = GetOrCreateMaterial(renderer, faceColor);
warp_Vector primPos = ConvertVector(prim.GetWorldPosition());
warp_Quaternion primRot = ConvertQuaternion(prim.GetWorldRotation());
warp_Matrix m = warp_Matrix.quaternionMatrix(primRot);
faceObj.transform(m);
faceObj.setPos(primPos);
faceObj.scaleSelf(prim.Scale.X, prim.Scale.Z, prim.Scale.Y);
renderer.Scene.addObject(meshName, faceObj);
renderer.SetObjectMaterial(meshName, materialName);
}
}
private Color4 GetFaceColor(Primitive.TextureEntryFace face)
{
Color4 color;
if (face.TextureID == UUID.Zero)
return face.RGBA;
if (!m_colors.TryGetValue(face.TextureID, out color))
{
bool fetched = false;
// Attempt to fetch the texture metadata
UUID metadataID = UUID.Combine(face.TextureID, TEXTURE_METADATA_MAGIC);
AssetBase metadata = m_scene.AssetService.GetCached(metadataID.ToString());
if (metadata != null)
{
OSDMap map = null;
try { map = OSDParser.Deserialize(metadata.Data) as OSDMap; } catch { }
if (map != null)
{
color = map["X-JPEG2000-RGBA"].AsColor4();
fetched = true;
}
}
if (!fetched)
{
// Fetch the texture, decode and get the average color,
// then save it to a temporary metadata asset
AssetBase textureAsset = m_scene.AssetService.Get(face.TextureID.ToString());
if (textureAsset != null)
{
int width, height;
color = GetAverageColor(textureAsset.FullID, textureAsset.Data, out width, out height);
OSDMap data = new OSDMap { { "X-JPEG2000-RGBA", OSD.FromColor4(color) } };
metadata = new AssetBase
{
Data = System.Text.Encoding.UTF8.GetBytes(OSDParser.SerializeJsonString(data)),
Description = "Metadata for JPEG2000 texture " + face.TextureID.ToString(),
Flags = AssetFlags.Collectable,
FullID = metadataID,
ID = metadataID.ToString(),
Local = true,
Temporary = true,
Name = String.Empty,
Type = (sbyte)AssetType.Unknown
};
m_scene.AssetService.Store(metadata);
}
else
{
color = new Color4(0.5f, 0.5f, 0.5f, 1.0f);
}
}
m_colors[face.TextureID] = color;
}
return color * face.RGBA;
}
private string GetOrCreateMaterial(WarpRenderer renderer, Color4 color)
{
string name = color.ToString();
warp_Material material = renderer.Scene.material(name);
if (material != null)
return name;
renderer.AddMaterial(name, ConvertColor(color));
if (color.A < 1f)
renderer.Scene.material(name).setTransparency((byte)((1f - color.A) * 255f));
return name;
}
public string GetOrCreateMaterial(WarpRenderer renderer, Color4 faceColor, UUID textureID)
{
string materialName = "Color-" + faceColor.ToString() + "-Texture-" + textureID.ToString();
if (renderer.Scene.material(materialName) == null)
{
renderer.AddMaterial(materialName, ConvertColor(faceColor));
if (faceColor.A < 1f)
{
renderer.Scene.material(materialName).setTransparency((byte) ((1f - faceColor.A)*255f));
}
warp_Texture texture = GetTexture(textureID);
if (texture != null)
renderer.Scene.material(materialName).setTexture(texture);
}
return materialName;
}
private warp_Texture GetTexture(UUID id)
{
warp_Texture ret = null;
byte[] asset = m_scene.AssetService.GetData(id.ToString());
if (asset != null)
{
IJ2KDecoder imgDecoder = m_scene.RequestModuleInterface<IJ2KDecoder>();
try
{
using (Bitmap img = (Bitmap)imgDecoder.DecodeToImage(asset))
ret = new warp_Texture(img);
}
catch (Exception e)
{
m_log.Warn(string.Format("[WARP 3D IMAGE MODULE]: Failed to decode asset {0}, exception ", id), e);
}
}
return ret;
}
#endregion Rendering Methods
#region Static Helpers
// Note: axis change.
private static warp_Vector ConvertVector(float x, float y, float z)
{
return new warp_Vector(x, z, y);
}
private static warp_Vector ConvertVector(Vector3 vector)
{
return new warp_Vector(vector.X, vector.Z, vector.Y);
}
private static warp_Quaternion ConvertQuaternion(Quaternion quat)
{
return new warp_Quaternion(quat.X, quat.Z, quat.Y, -quat.W);
}
private static int ConvertColor(Color4 color)
{
int c = warp_Color.getColor((byte)(color.R * 255f), (byte)(color.G * 255f), (byte)(color.B * 255f));
if (color.A < 1f)
c |= (byte)(color.A * 255f) << 24;
return c;
}
private static Vector3 SurfaceNormal(Vector3 c1, Vector3 c2, Vector3 c3)
{
Vector3 edge1 = new Vector3(c2.X - c1.X, c2.Y - c1.Y, c2.Z - c1.Z);
Vector3 edge2 = new Vector3(c3.X - c1.X, c3.Y - c1.Y, c3.Z - c1.Z);
Vector3 normal = Vector3.Cross(edge1, edge2);
normal.Normalize();
return normal;
}
public static Color4 GetAverageColor(UUID textureID, byte[] j2kData, out int width, out int height)
{
ulong r = 0;
ulong g = 0;
ulong b = 0;
ulong a = 0;
using (MemoryStream stream = new MemoryStream(j2kData))
{
try
{
int pixelBytes;
using (Bitmap bitmap = (Bitmap)J2kImage.FromStream(stream))
{
width = bitmap.Width;
height = bitmap.Height;
BitmapData bitmapData = bitmap.LockBits(new Rectangle(0, 0, width, height), ImageLockMode.ReadOnly, bitmap.PixelFormat);
pixelBytes = (bitmap.PixelFormat == PixelFormat.Format24bppRgb) ? 3 : 4;
// Sum up the individual channels
unsafe
{
if (pixelBytes == 4)
{
for (int y = 0; y < height; y++)
{
byte* row = (byte*)bitmapData.Scan0 + (y * bitmapData.Stride);
for (int x = 0; x < width; x++)
{
b += row[x * pixelBytes + 0];
g += row[x * pixelBytes + 1];
r += row[x * pixelBytes + 2];
a += row[x * pixelBytes + 3];
}
}
}
else
{
for (int y = 0; y < height; y++)
{
byte* row = (byte*)bitmapData.Scan0 + (y * bitmapData.Stride);
for (int x = 0; x < width; x++)
{
b += row[x * pixelBytes + 0];
g += row[x * pixelBytes + 1];
r += row[x * pixelBytes + 2];
}
}
}
}
}
// Get the averages for each channel
const decimal OO_255 = 1m / 255m;
decimal totalPixels = (decimal)(width * height);
decimal rm = ((decimal)r / totalPixels) * OO_255;
decimal gm = ((decimal)g / totalPixels) * OO_255;
decimal bm = ((decimal)b / totalPixels) * OO_255;
decimal am = ((decimal)a / totalPixels) * OO_255;
if (pixelBytes == 3)
am = 1m;
return new Color4((float)rm, (float)gm, (float)bm, (float)am);
}
catch (Exception ex)
{
m_log.WarnFormat(
"[WARP 3D IMAGE MODULE]: Error decoding JPEG2000 texture {0} ({1} bytes): {2}",
textureID, j2kData.Length, ex.Message);
width = 0;
height = 0;
return new Color4(0.5f, 0.5f, 0.5f, 1.0f);
}
}
}
#endregion Static Helpers
}
public static class ImageUtils
{
/// <summary>
/// Performs bilinear interpolation between four values
/// </summary>
/// <param name="v00">First, or top left value</param>
/// <param name="v01">Second, or top right value</param>
/// <param name="v10">Third, or bottom left value</param>
/// <param name="v11">Fourth, or bottom right value</param>
/// <param name="xPercent">Interpolation value on the X axis, between 0.0 and 1.0</param>
/// <param name="yPercent">Interpolation value on fht Y axis, between 0.0 and 1.0</param>
/// <returns>The bilinearly interpolated result</returns>
public static float Bilinear(float v00, float v01, float v10, float v11, float xPercent, float yPercent)
{
return Utils.Lerp(Utils.Lerp(v00, v01, xPercent), Utils.Lerp(v10, v11, xPercent), yPercent);
}
/// <summary>
/// Performs a high quality image resize
/// </summary>
/// <param name="image">Image to resize</param>
/// <param name="width">New width</param>
/// <param name="height">New height</param>
/// <returns>Resized image</returns>
public static Bitmap ResizeImage(Image image, int width, int height)
{
Bitmap result = new Bitmap(width, height);
using (Graphics graphics = Graphics.FromImage(result))
{
graphics.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
graphics.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality;
graphics.DrawImage(image, 0, 0, result.Width, result.Height);
}
return result;
}
}
}
| 39.905303 | 144 | 0.53172 | [
"BSD-3-Clause"
] | SignpostMarv/opensim | OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs | 31,605 | C# |
namespace Nez.AI.BehaviorTrees
{
/// <summary>
/// inverts the result of the child node
/// </summary>
public class Inverter<T> : Decorator<T>
{
public override TaskStatus Update(T context)
{
Insist.IsNotNull(Child, "child must not be null");
var status = Child.Tick(context);
if (status == TaskStatus.Success)
return TaskStatus.Failure;
if (status == TaskStatus.Failure)
return TaskStatus.Success;
return TaskStatus.Running;
}
}
} | 20.478261 | 53 | 0.681529 | [
"MIT"
] | AdrianN17/ZombieSurvivalMonogame | Nez-master/Nez.Portable/AI/BehaviorTree/Decorators/Inverter.cs | 473 | C# |
// *****************************************************************************
// BSD 3-Clause License (https://github.com/ComponentFactory/Krypton/blob/master/LICENSE)
// © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
// The software and associated documentation supplied hereunder are the
// proprietary information of Component Factory Pty Ltd, 13 Swallows Close,
// Mornington, Vic 3931, Australia and are supplied subject to license terms.
//
// Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV) 2017 - 2020. All rights reserved. (https://github.com/Wagnerp/Krypton-NET-5.472)
// Version 5.472.0.0 www.ComponentFactory.com
// *****************************************************************************
using System;
using System.Windows.Forms;
namespace ComponentFactory.Krypton.Toolkit
{
/// <summary>
/// Implementation for the fixed minimize button for krypton form.
/// </summary>
public class ButtonSpecFormWindowMin : ButtonSpecFormFixed
{
#region Identity
/// <summary>
/// Initialize a new instance of the ButtonSpecFormWindowMin class.
/// </summary>
/// <param name="form">Reference to owning krypton form instance.</param>
public ButtonSpecFormWindowMin(KryptonForm form)
: base(form, PaletteButtonSpecStyle.FormMin)
{
}
#endregion
#region IButtonSpecValues
/// <summary>
/// Gets the button visible value.
/// </summary>
/// <param name="palette">Palette to use for inheriting values.</param>
/// <returns>Button visibiliy.</returns>
public override bool GetVisible(IPalette palette)
{
// We do not show if the custom chrome is combined with composition,
// in which case the form buttons are handled by the composition
if (KryptonForm.ApplyComposition && KryptonForm.ApplyCustomChrome)
{
return false;
}
// The minimize button is never present on tool windows
switch (KryptonForm.FormBorderStyle)
{
case FormBorderStyle.FixedToolWindow:
case FormBorderStyle.SizableToolWindow:
return false;
}
// Have all buttons been turned off?
if (!KryptonForm.ControlBox)
{
return false;
}
// Has the minimize/maximize buttons been turned off?
return KryptonForm.MinimizeBox || KryptonForm.MaximizeBox;
}
/// <summary>
/// Gets the button enabled state.
/// </summary>
/// <param name="palette">Palette to use for inheriting values.</param>
/// <returns>Button enabled state.</returns>
public override ButtonEnabled GetEnabled(IPalette palette)
{
// Has the minimize buttons been turned off?
return !KryptonForm.MinimizeBox ? ButtonEnabled.False : ButtonEnabled.True;
}
/// <summary>
/// Gets the button checked state.
/// </summary>
/// <param name="palette">Palette to use for inheriting values.</param>
/// <returns>Button checked state.</returns>
public override ButtonCheckState GetChecked(IPalette palette)
{
// Close button is never shown as checked
return ButtonCheckState.NotCheckButton;
}
#endregion
#region Protected Overrides
/// <summary>
/// Raises the Click event.
/// </summary>
/// <param name="e">An EventArgs that contains the event data.</param>
protected override void OnClick(EventArgs e)
{
// Only if associated view is enabled to we perform an action
if (GetViewEnabled())
{
// If we do not provide an inert form
if (!KryptonForm.InertForm)
{
// Only if the mouse is still within the button bounds do we perform action
MouseEventArgs mea = (MouseEventArgs)e;
if (GetView().ClientRectangle.Contains(mea.Location))
{
// Toggle between minimized and restored
KryptonForm.SendSysCommand(KryptonForm.WindowState == FormWindowState.Minimized
? PI.SC_.RESTORE
: PI.SC_.MINIMIZE);
// Let base class fire any other attached events
base.OnClick(e);
}
}
}
}
#endregion
}
}
| 39.425 | 157 | 0.559713 | [
"BSD-3-Clause"
] | Krypton-Suite-Legacy/Krypton-NET-5.472 | Source/Krypton Components/ComponentFactory.Krypton.Toolkit/ButtonSpec/ButtonSpecFormWindowMin.cs | 4,734 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace PubnubApi
{
public class PNFileUploadResult
{
public long Timetoken { get; internal set; }
public string FileId { get; internal set; }
public string FileName { get; internal set; }
}
}
| 21.266667 | 53 | 0.677116 | [
"MIT"
] | StockDrops/c-sharp | src/Api/PubnubApi/Model/Consumer/Files/PNFileUploadResult.cs | 321 | C# |
using System;
using System.Threading.Tasks;
using EasyNetQ.Consumer;
using EasyNetQ.FluentConfiguration;
using EasyNetQ.Producer;
using EasyNetQ.Topology;
using System.Linq;
using EasyNetQ.Internals;
namespace EasyNetQ
{
public class RabbitBus : IBus
{
private readonly IConventions conventions;
private readonly IAdvancedBus advancedBus;
private readonly IPublishExchangeDeclareStrategy publishExchangeDeclareStrategy;
private readonly IMessageDeliveryModeStrategy messageDeliveryModeStrategy;
private readonly IRpc rpc;
private readonly ISendReceive sendReceive;
private readonly ConnectionConfiguration connectionConfiguration;
public RabbitBus(
IConventions conventions,
IAdvancedBus advancedBus,
IPublishExchangeDeclareStrategy publishExchangeDeclareStrategy,
IMessageDeliveryModeStrategy messageDeliveryModeStrategy,
IRpc rpc,
ISendReceive sendReceive,
ConnectionConfiguration connectionConfiguration)
{
Preconditions.CheckNotNull(conventions, "conventions");
Preconditions.CheckNotNull(advancedBus, "advancedBus");
Preconditions.CheckNotNull(publishExchangeDeclareStrategy, "publishExchangeDeclareStrategy");
Preconditions.CheckNotNull(rpc, "rpc");
Preconditions.CheckNotNull(sendReceive, "sendReceive");
Preconditions.CheckNotNull(connectionConfiguration, "connectionConfiguration");
this.conventions = conventions;
this.advancedBus = advancedBus;
this.publishExchangeDeclareStrategy = publishExchangeDeclareStrategy;
this.messageDeliveryModeStrategy = messageDeliveryModeStrategy;
this.rpc = rpc;
this.sendReceive = sendReceive;
this.connectionConfiguration = connectionConfiguration;
}
public virtual void Publish<T>(T message) where T : class
{
Preconditions.CheckNotNull(message, "message");
Publish(message, conventions.TopicNamingConvention(typeof(T)));
}
public virtual void Publish<T>(T message, string topic) where T : class
{
Preconditions.CheckNotNull(message, "message");
Preconditions.CheckNotNull(topic, "topic");
var messageType = typeof(T);
var easyNetQMessage = new Message<T>(message)
{
Properties =
{
DeliveryMode = messageDeliveryModeStrategy.GetDeliveryMode(messageType)
}
};
var exchange = publishExchangeDeclareStrategy.DeclareExchange(advancedBus, messageType, ExchangeType.Topic);
advancedBus.Publish(exchange, topic, false, false, easyNetQMessage);
}
public virtual Task PublishAsync<T>(T message) where T : class
{
Preconditions.CheckNotNull(message, "message");
return PublishAsync(message, conventions.TopicNamingConvention(typeof(T)));
}
public virtual async Task PublishAsync<T>(T message, string topic) where T : class
{
Preconditions.CheckNotNull(message, "message");
Preconditions.CheckNotNull(topic, "topic");
var messageType = typeof (T);
var easyNetQMessage = new Message<T>(message)
{
Properties =
{
DeliveryMode = messageDeliveryModeStrategy.GetDeliveryMode(messageType)
}
};
var exchange = await publishExchangeDeclareStrategy.DeclareExchangeAsync(advancedBus, messageType, ExchangeType.Topic).ConfigureAwait(false);
await advancedBus.PublishAsync(exchange, topic, false, false, easyNetQMessage).ConfigureAwait(false);
}
public virtual ISubscriptionResult Subscribe<T>(string subscriptionId, Action<T> onMessage) where T : class
{
return Subscribe(subscriptionId, onMessage, x => { });
}
public virtual ISubscriptionResult Subscribe<T>(string subscriptionId, Action<T> onMessage, Action<ISubscriptionConfiguration> configure) where T : class
{
Preconditions.CheckNotNull(subscriptionId, "subscriptionId");
Preconditions.CheckNotNull(onMessage, "onMessage");
Preconditions.CheckNotNull(configure, "configure");
return SubscribeAsync<T>(subscriptionId, msg => TaskHelpers.ExecuteSynchronously(() => onMessage(msg)), configure);
}
public virtual ISubscriptionResult SubscribeAsync<T>(string subscriptionId, Func<T, Task> onMessage) where T : class
{
return SubscribeAsync(subscriptionId, onMessage, x => { });
}
public virtual ISubscriptionResult SubscribeAsync<T>(string subscriptionId, Func<T, Task> onMessage, Action<ISubscriptionConfiguration> configure) where T : class
{
Preconditions.CheckNotNull(subscriptionId, "subscriptionId");
Preconditions.CheckNotNull(onMessage, "onMessage");
Preconditions.CheckNotNull(configure, "configure");
var configuration = new SubscriptionConfiguration(connectionConfiguration.PrefetchCount);
configure(configuration);
var queueName = conventions.QueueNamingConvention(typeof(T), subscriptionId);
var exchangeName = conventions.ExchangeNamingConvention(typeof(T));
var queue = advancedBus.QueueDeclare(queueName, autoDelete: configuration.AutoDelete, expires: configuration.Expires);
var exchange = advancedBus.ExchangeDeclare(exchangeName, ExchangeType.Topic);
foreach (var topic in configuration.Topics.DefaultIfEmpty("#"))
{
advancedBus.Bind(exchange, queue, topic);
}
var consumerCancellation = advancedBus.Consume<T>(
queue,
(message, messageReceivedInfo) => onMessage(message.Body),
x =>
{
x.WithPriority(configuration.Priority)
.WithCancelOnHaFailover(configuration.CancelOnHaFailover)
.WithPrefetchCount(configuration.PrefetchCount);
if (configuration.IsExclusive)
{
x.AsExclusive();
}
});
return new SubscriptionResult(exchange, queue, consumerCancellation);
}
public virtual TResponse Request<TRequest, TResponse>(TRequest request)
where TRequest : class
where TResponse : class
{
Preconditions.CheckNotNull(request, "request");
var task = RequestAsync<TRequest, TResponse>(request);
task.Wait();
return task.Result;
}
public virtual Task<TResponse> RequestAsync<TRequest, TResponse>(TRequest request)
where TRequest : class
where TResponse : class
{
Preconditions.CheckNotNull(request, "request");
return rpc.Request<TRequest, TResponse>(request);
}
public virtual IDisposable Respond<TRequest, TResponse>(Func<TRequest, TResponse> responder)
where TRequest : class
where TResponse : class
{
Preconditions.CheckNotNull(responder, "responder");
Func<TRequest, Task<TResponse>> taskResponder =
request => Task<TResponse>.Factory.StartNew(_ => responder(request), null);
return RespondAsync(taskResponder);
}
public IDisposable Respond<TRequest, TResponse>(Func<TRequest, TResponse> responder, Action<IResponderConfiguration> configure) where TRequest : class where TResponse : class
{
Func<TRequest, Task<TResponse>> taskResponder =
request => Task<TResponse>.Factory.StartNew(_ => responder(request), null);
return RespondAsync(taskResponder, configure);
}
public virtual IDisposable RespondAsync<TRequest, TResponse>(Func<TRequest, Task<TResponse>> responder)
where TRequest : class
where TResponse : class
{
return RespondAsync(responder, c => { });
}
public IDisposable RespondAsync<TRequest, TResponse>(Func<TRequest, Task<TResponse>> responder, Action<IResponderConfiguration> configure) where TRequest : class where TResponse : class
{
Preconditions.CheckNotNull(responder, "responder");
Preconditions.CheckNotNull(configure, "configure");
return rpc.Respond(responder, configure);
}
public virtual void Send<T>(string queue, T message)
where T : class
{
sendReceive.Send(queue, message);
}
public virtual Task SendAsync<T>(string queue, T message)
where T : class
{
return sendReceive.SendAsync(queue, message);
}
public virtual IDisposable Receive<T>(string queue, Action<T> onMessage)
where T : class
{
return sendReceive.Receive(queue, onMessage);
}
public virtual IDisposable Receive<T>(string queue, Action<T> onMessage, Action<IConsumerConfiguration> configure)
where T : class
{
return sendReceive.Receive(queue, onMessage, configure);
}
public virtual IDisposable Receive<T>(string queue, Func<T, Task> onMessage)
where T : class
{
return sendReceive.Receive(queue, onMessage);
}
public virtual IDisposable Receive<T>(string queue, Func<T, Task> onMessage, Action<IConsumerConfiguration> configure)
where T : class
{
return sendReceive.Receive(queue, onMessage, configure);
}
public virtual IDisposable Receive(string queue, Action<IReceiveRegistration> addHandlers)
{
return sendReceive.Receive(queue, addHandlers);
}
public virtual IDisposable Receive(string queue, Action<IReceiveRegistration> addHandlers, Action<IConsumerConfiguration> configure)
{
return sendReceive.Receive(queue, addHandlers, configure);
}
public virtual bool IsConnected
{
get { return advancedBus.IsConnected; }
}
public virtual IAdvancedBus Advanced
{
get { return advancedBus; }
}
public virtual void Dispose()
{
advancedBus.Dispose();
}
}
} | 40.575758 | 193 | 0.633962 | [
"MIT"
] | chrisedebo/EasyNetQ | Source/EasyNetQ/RabbitBus.cs | 10,712 | C# |
using Kask.Services.DAO;
using Kask.Services.Exceptions;
using System.Collections.Generic;
using System.ServiceModel;
using System.ServiceModel.Web;
namespace Kask.Services.Interfaces
{
[ServiceContract]
public interface IAppliedService
{
[OperationContract]
[FaultContract(typeof(KaskServiceException))]
AppliedDAO GetAppliedByID(int id);
[OperationContract]
[FaultContract(typeof(KaskServiceException))]
IList<AppliedDAO> GetApplieds();
[OperationContract]
[FaultContract(typeof(KaskServiceException))]
[WebGet(UriTemplate = "Applied?first={first}&last={last}&ssn={ssn}")]
IList<AppliedDAO> GetAppliedsByName(string first, string last, string ssn);
[OperationContract]
[FaultContract(typeof(KaskServiceException))]
bool CreateApplied(AppliedDAO a);
[OperationContract]
[FaultContract(typeof(KaskServiceException))]
bool UpdateApplied(AppliedDAO newApp);
[OperationContract]
[FaultContract(typeof(KaskServiceException))]
bool DeleteApplied(int id);
}
}
| 28.974359 | 83 | 0.69469 | [
"MIT"
] | datanets/kask-kiosk | Kask.Services/Interfaces/IAppliedService.cs | 1,132 | C# |
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Tencent is pleased to support the open source community by making behaviac available.
//
// Copyright (C) 2015-2017 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except in
// compliance with the License. You may obtain a copy of the License at http://opensource.org/licenses/BSD-3-Clause
//
// 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.
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#define LITTLE_ENDIAN_ONLY
#define USE_STRING_COUNT_HEAD
using System;
using System.Collections.Generic;
using System.IO;
#if BEHAVIAC_USE_SYSTEM_XML
using System.Xml;
#else
using System.Security;
using MiniXml;
#endif
namespace behaviac
{
public struct property_t
{
public string name;
public string value;
public property_t(string n, string v)
{
name = n;
value = v;
}
}
//bson deserizer
public class BsonDeserizer
{
public enum BsonTypes
{
BT_None = 0,
BT_Double = 1,
BT_String = 2,
BT_Object = 3,
BT_Array = 4,
BT_Binary = 5,
BT_Undefined = 6,
BT_ObjectId = 7,
BT_Boolean = 8,
BT_DateTime = 9,
BT_Null = 10,
BT_Regex = 11,
BT_Reference = 12,
BT_Code = 13,
BT_Symbol = 14,
BT_ScopedCode = 15,
BT_Int32 = 16,
BT_Timestamp = 17,
BT_Int64 = 18,
BT_Float = 19,
BT_Element = 20,
BT_Set = 21,
BT_BehaviorElement = 22,
BT_PropertiesElement = 23,
BT_ParsElement = 24,
BT_ParElement = 25,
BT_NodeElement = 26,
BT_AttachmentsElement = 27,
BT_AttachmentElement = 28,
BT_AgentsElement = 29,
BT_AgentElement = 30,
BT_PropertyElement = 31,
BT_MethodsElement = 32,
BT_MethodElement = 33,
BT_Custom = 34,
BT_ParameterElement = 35
}
public bool Init(byte[] pBuffer)
{
try
{
m_pBuffer = pBuffer;
if (m_pBuffer != null && m_pBuffer.Length > 0)
{
m_BinaryReader = new BinaryReader(new MemoryStream(m_pBuffer));
if (this.OpenDocument())
{
return true;
}
}
}
catch (Exception e)
{
Debug.Check(false, e.Message);
}
Debug.Check(false);
return false;
}
private int GetCurrentIndex()
{
Debug.Check(this.m_BinaryReader != null);
return (int)this.m_BinaryReader.BaseStream.Position;
}
public bool OpenDocument()
{
int head = this.GetCurrentIndex();
int size = this.ReadInt32();
int end = head + size - 1;
if (this.m_pBuffer[end] == 0)
{
return true;
}
else
{
Debug.Check(false);
return false;
}
}
//if ReadType has been called as a 'peek', use CloseDocumente(false)
//usually, after a loop, use CloseDocumente(false) as that loop usually terminates with e peek ReadType
public void CloseDocument(bool bEatEod /*= false*/)
{
int endLast = this.GetCurrentIndex();
if (bEatEod)
{
this.m_BinaryReader.BaseStream.Position++;
}
else
{
endLast--;
}
Debug.Check(this.m_pBuffer[endLast] == 0);
}
public BsonTypes ReadType()
{
byte b = m_BinaryReader.ReadByte();
return (BsonTypes)b;
}
public int ReadInt32()
{
int i = m_BinaryReader.ReadInt32();
#if LITTLE_ENDIAN_ONLY
Debug.Check(BitConverter.IsLittleEndian);
return i;
#else
if (BitConverter.IsLittleEndian)
{
return i;
}
else
{
byte[] bytes = BitConverter.GetBytes(i);
i = (bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3]);
return i;
}
#endif//LITTLE_ENDIAN_ONLY
}
public UInt16 ReadUInt16()
{
ushort us = m_BinaryReader.ReadUInt16();
#if LITTLE_ENDIAN_ONLY
Debug.Check(BitConverter.IsLittleEndian);
return us;
#else
if (BitConverter.IsLittleEndian)
{
return us;
}
else
{
byte[] bytes = BitConverter.GetBytes(us);
us = (ushort)(bytes[0] << 8 | bytes[1]);
return us;
}
#endif//LITTLE_ENDIAN_ONLY
}
public float ReadFloat()
{
float f = m_BinaryReader.ReadSingle();
#if LITTLE_ENDIAN_ONLY
Debug.Check(BitConverter.IsLittleEndian);
return f;
#else
if (BitConverter.IsLittleEndian)
{
return f;
}
else
{
byte[] bytes = BitConverter.GetBytes(f);
Array.Reverse(bytes);
f = BitConverter.ToSingle(bytes, 0);
return f;
}
#endif//LITTLE_ENDIAN_ONLY
}
public bool ReadBool()
{
byte b = m_BinaryReader.ReadByte();
return (b != 0) ? true : false;
}
public string ReadString()
{
#if USE_STRING_COUNT_HEAD
UInt16 count = ReadUInt16();
byte[] bytes = m_BinaryReader.ReadBytes(count);
// The exporter uses UTF8 to export strings, so the same encoding type is used here.
string str = System.Text.Encoding.UTF8.GetString(bytes, 0, count - 1);
Debug.Check(this.m_pBuffer[this.GetCurrentIndex() - 1] == 0);
return str;
#else
List<byte> bytes = new List<byte>();
while (true)
{
byte b = m_BinaryReader.ReadByte();
if (b == 0)
{
break;
}
bytes.Add(b);
}
// The exporter uses UTF8 to export strings, so the same encoding type is used here.
string str = System.Text.Encoding.UTF8.GetString(bytes.ToArray());
return str;
#endif
}
public bool eod()
{
byte c = this.m_pBuffer[this.GetCurrentIndex()];
return (c == 0);
}
private byte[] m_pBuffer = null;
private BinaryReader m_BinaryReader = null;
}
/**
* Base class for BehaviorTree Nodes. This is the static part
*/
public abstract class BehaviorNode
{
#if BEHAVIAC_USE_HTN
public virtual bool decompose(BehaviorNode node, PlannerTaskComplex seqTask, int depth, Planner planner)
{
Debug.Check(false, "Can't step into this line");
return false;
}
#endif//
public BehaviorTask CreateAndInitTask()
{
BehaviorTask pTask = this.createTask();
Debug.Check(pTask != null);
pTask.Init(this);
return pTask;
}
public bool HasEvents()
{
return this.m_bHasEvents;
}
public void SetHasEvents(bool hasEvents)
{
this.m_bHasEvents = hasEvents;
}
public int GetChildrenCount()
{
if (this.m_children != null)
{
return this.m_children.Count;
}
return 0;
}
public BehaviorNode GetChild(int index)
{
if (this.m_children != null && index < this.m_children.Count)
{
return this.m_children[index];
}
return null;
}
public BehaviorNode GetChildById(int nodeId)
{
if (this.m_children != null && this.m_children.Count > 0)
{
for (int i = 0; i < this.m_children.Count; ++i)
{
BehaviorNode c = this.m_children[i];
if (c.GetId() == nodeId)
{
return c;
}
}
}
return null;
}
protected BehaviorNode()
{
}
//~BehaviorNode()
//{
// this.Clear();
//}
public void Clear()
{
if (this.m_events != null)
{
this.m_events.Clear();
this.m_events = null;
}
if (this.m_preconditions != null)
{
this.m_preconditions.Clear();
this.m_preconditions = null;
}
if (this.m_effectors != null)
{
this.m_effectors.Clear();
this.m_effectors = null;
}
if (this.m_children != null)
{
this.m_children.Clear();
this.m_children = null;
}
}
public virtual bool IsValid(Agent pAgent, BehaviorTask pTask)
{
#if !BEHAVIAC_RELEASE
Debug.Check(!string.IsNullOrEmpty(this.m_agentType));
return Agent.IsDerived(pAgent, this.m_agentType);
#else
return true;
#endif//#if !BEHAVIAC_RELEASE
}
//return true for Parallel, SelectorLoop, etc., which is responsible to update all its children just like sub trees
//so that they are treated as a return-running node and the next update will continue them.
public virtual bool IsManagingChildrenAsSubTrees()
{
return false;
}
#region Load
protected static BehaviorNode Create(string className)
{
return Workspace.Instance.CreateBehaviorNode(className);
}
protected virtual void load(int version, string agentType, List<property_t> properties)
{
string nodeType = this.GetClassNameString().Replace(".", "::");
Workspace.Instance.OnBehaviorNodeLoaded(nodeType, properties);
}
#if BEHAVIAC_USE_SYSTEM_XML
protected virtual void load_local(int version, string agentType, XmlNode node)
{
Debug.Check(false);
}
protected void load_properties_pars_attachments_children(bool bNode, int version, string agentType, XmlNode node)
{
#if !BEHAVIAC_RELEASE
SetAgentType(agentType);
#endif//#ifdef _DEBUG
bool bHasEvents = this.HasEvents();
List<property_t> properties = new List<property_t>();
foreach (XmlNode c in node.ChildNodes)
{
if (!load_property_pars(ref properties, c, version, agentType))
{
if (bNode)
{
if (c.Name == "attachment")
{
bHasEvents = this.load_attachment(version, agentType, bHasEvents, c);
}
else if (c.Name == "custom")
{
Debug.Check(c.ChildNodes.Count == 1);
XmlNode customNode = c.ChildNodes[0];
BehaviorNode pChildNode = BehaviorNode.load(agentType, customNode, version);
this.m_customCondition = pChildNode;
}
else if (c.Name == "node")
{
BehaviorNode pChildNode = BehaviorNode.load(agentType, c, version);
bHasEvents |= pChildNode.m_bHasEvents;
this.AddChild(pChildNode);
}
}
else
{
if (c.Name == "attachment")
{
bHasEvents = this.load_attachment(version, agentType, bHasEvents, c);
}
}
}
}
if (properties.Count > 0)
{
this.load(version, agentType, properties);
}
this.m_bHasEvents |= bHasEvents;
}
private void load_attachment_transition_effectors(int version, string agentType, bool bHasEvents, XmlNode node)
{
this.m_loadAttachment = true;
this.load_properties_pars_attachments_children(false, version, agentType, node);
this.m_loadAttachment = false;
}
private bool load_attachment(int version, string agentType, bool bHasEvents, XmlNode node)
{
try
{
string pAttachClassName = (node.Attributes["class"] != null) ? node.Attributes["class"].Value : null;
if (pAttachClassName == null)
{
this.load_attachment_transition_effectors(version, agentType, bHasEvents, node);
return true;
}
BehaviorNode pAttachment = BehaviorNode.Create(pAttachClassName);
Debug.Check(pAttachment != null);
if (pAttachment != null)
{
pAttachment.SetClassNameString(pAttachClassName);
string idStr = node.Attributes["id"].Value;
pAttachment.SetId(Convert.ToInt32(idStr));
bool bIsPrecondition = false;
bool bIsEffector = false;
bool bIsTransition = false;
string flagStr = node.Attributes["flag"].Value;
if (flagStr == "precondition")
{
bIsPrecondition = true;
}
else if (flagStr == "effector")
{
bIsEffector = true;
}
else if (flagStr == "transition")
{
bIsTransition = true;
}
pAttachment.load_properties_pars_attachments_children(false, version, agentType, node);
this.Attach(pAttachment, bIsPrecondition, bIsEffector, bIsTransition);
bHasEvents |= (pAttachment is Event);
}
return bHasEvents;
}
catch (Exception ex)
{
Debug.Check(false, ex.Message);
}
return bHasEvents;
}
private bool load_property_pars(ref List<property_t> properties, XmlNode node, int version, string agentType)
{
try
{
if (node.Name == "property")
{
Debug.Check(node.Attributes.Count == 1);
if (node.Attributes.Count == 1)
{
XmlAttribute attr = node.Attributes[0];
property_t p = new property_t(attr.Name, attr.Value);
properties.Add(p);
}
return true;
}
else if (node.Name == "pars")
{
foreach (XmlNode parNode in node.ChildNodes)
{
if (parNode.Name == "par")
{
this.load_local(version, agentType, parNode);
}
}
return true;
}
}
catch (Exception ex)
{
Debug.Check(false, ex.Message);
}
return false;
}
protected static BehaviorNode load(string agentType, XmlNode node, int version)
{
Debug.Check(node.Name == "node");
string pClassName = node.Attributes["class"].Value;
BehaviorNode pNode = BehaviorNode.Create(pClassName);
Debug.Check(pNode != null, "unsupported class {0}", pClassName);
if (pNode != null)
{
pNode.SetClassNameString(pClassName);
string idStr = node.Attributes["id"].Value;
pNode.SetId(Convert.ToInt32(idStr));
pNode.load_properties_pars_attachments_children(true, version, agentType, node);
}
return pNode;
}
#else
protected virtual void load_local(int version, string agentType, SecurityElement node)
{
Debug.Check(false);
}
protected void load_properties_pars_attachments_children(bool bNode, int version, string agentType, SecurityElement node)
{
#if !BEHAVIAC_RELEASE
SetAgentType(agentType);
#endif//#ifdef _DEBUG
bool bHasEvents = this.HasEvents();
if (node.Children != null)
{
List<property_t> properties = new List<property_t>();
foreach (SecurityElement c in node.Children)
{
if (!load_property_pars(ref properties, c, version, agentType))
{
if (bNode)
{
if (c.Tag == "attachment")
{
bHasEvents = this.load_attachment(version, agentType, bHasEvents, c);
}
else if (c.Tag == "custom")
{
Debug.Check(c.Children.Count == 1);
SecurityElement customNode = (SecurityElement)c.Children[0];
BehaviorNode pChildNode = BehaviorNode.load(agentType, customNode, version);
this.m_customCondition = pChildNode;
}
else if (c.Tag == "node")
{
BehaviorNode pChildNode = BehaviorNode.load(agentType, c, version);
bHasEvents |= pChildNode.m_bHasEvents;
this.AddChild(pChildNode);
}
else
{
Debug.Check(false);
}
}
else
{
if (c.Tag == "attachment")
{
bHasEvents = this.load_attachment(version, agentType, bHasEvents, c);
}
}
}
}
if (properties.Count > 0)
{
this.load(version, agentType, properties);
}
}
this.m_bHasEvents |= bHasEvents;
}
private void load_attachment_transition_effectors(int version, string agentType, bool bHasEvents, SecurityElement c)
{
this.m_loadAttachment = true;
this.load_properties_pars_attachments_children(false, version, agentType, c);
this.m_loadAttachment = false;
}
private bool load_attachment(int version, string agentType, bool bHasEvents, SecurityElement c)
{
try
{
string pAttachClassName = c.Attribute("class");
if (pAttachClassName == null)
{
this.load_attachment_transition_effectors(version, agentType, bHasEvents, c);
return true;
}
BehaviorNode pAttachment = BehaviorNode.Create(pAttachClassName);
Debug.Check(pAttachment != null);
if (pAttachment != null)
{
pAttachment.SetClassNameString(pAttachClassName);
string idStr = c.Attribute("id");
pAttachment.SetId(Convert.ToInt32(idStr));
bool bIsPrecondition = false;
bool bIsEffector = false;
bool bIsTransition = false;
string flagStr = c.Attribute("flag");
if (flagStr == "precondition")
{
bIsPrecondition = true;
}
else if (flagStr == "effector")
{
bIsEffector = true;
}
else if (flagStr == "transition")
{
bIsTransition = true;
}
pAttachment.load_properties_pars_attachments_children(false, version, agentType, c);
this.Attach(pAttachment, bIsPrecondition, bIsEffector, bIsTransition);
bHasEvents |= (pAttachment is Event);
}
return bHasEvents;
}
catch (Exception ex)
{
Debug.Check(false, ex.Message);
}
return bHasEvents;
}
private bool load_property_pars(ref List<property_t> properties, SecurityElement c, int version, string agentType)
{
try
{
if (c.Tag == "property")
{
Debug.Check(c.Attributes.Count == 1);
foreach (string propName in c.Attributes.Keys)
{
string propValue = (string)c.Attributes[propName];
property_t p = new property_t(propName, propValue);
properties.Add(p);
break;
}
return true;
}
else if (c.Tag == "pars")
{
if (c.Children != null)
{
foreach (SecurityElement parNode in c.Children)
{
if (parNode.Tag == "par")
{
this.load_local(version, agentType, parNode);
}
}
}
return true;
}
}
catch (Exception ex)
{
Debug.Check(false, ex.Message);
}
return false;
}
protected static BehaviorNode load(string agentType, SecurityElement node, int version)
{
Debug.Check(node.Tag == "node");
string pClassName = node.Attribute("class");
BehaviorNode pNode = BehaviorNode.Create(pClassName);
Debug.Check(pNode != null, "unsupported class {0}", pClassName);
if (pNode != null)
{
pNode.SetClassNameString(pClassName);
string idStr = node.Attribute("id");
pNode.SetId(Convert.ToInt32(idStr));
pNode.load_properties_pars_attachments_children(true, version, agentType, node);
}
return pNode;
}
#endif
#region Bson Load
protected void load_properties(int version, string agentType, BsonDeserizer d)
{
#if !BEHAVIAC_RELEASE
SetAgentType(agentType);
#endif
d.OpenDocument();
//load property after loading par as property might reference par
List<property_t> properties = new List<property_t>();
BsonDeserizer.BsonTypes type = d.ReadType();
while (type == BsonDeserizer.BsonTypes.BT_String)
{
string propertyName = d.ReadString();
string propertyValue = d.ReadString();
properties.Add(new property_t(propertyName, propertyValue));
type = d.ReadType();
}
if (properties.Count > 0)
{
this.load(version, agentType, properties);
}
Debug.Check(type == BsonDeserizer.BsonTypes.BT_None);
d.CloseDocument(false);
}
protected void load_locals(int version, string agentType, BsonDeserizer d)
{
d.OpenDocument();
BsonDeserizer.BsonTypes type = d.ReadType();
while (type == BsonDeserizer.BsonTypes.BT_ParElement)
{
this.load_local(version, agentType, d);
type = d.ReadType();
}
Debug.Check(type == BsonDeserizer.BsonTypes.BT_None);
d.CloseDocument(false);
}
protected void load_children(int version, string agentType, BsonDeserizer d)
{
d.OpenDocument();
BehaviorNode pChildNode = this.load(agentType, d, version);
bool bHasEvents = pChildNode.m_bHasEvents;
this.AddChild(pChildNode);
this.m_bHasEvents |= bHasEvents;
d.CloseDocument(false);
}
protected void load_custom(int version, string agentType, BsonDeserizer d)
{
d.OpenDocument();
BsonDeserizer.BsonTypes type = d.ReadType();
Debug.Check(type == BsonDeserizer.BsonTypes.BT_NodeElement);
d.OpenDocument();
BehaviorNode pChildNode = this.load(agentType, d, version);
this.m_customCondition = pChildNode;
d.CloseDocument(false);
d.CloseDocument(false);
type = d.ReadType();
Debug.Check(type == BsonDeserizer.BsonTypes.BT_None);
}
protected void load_properties_pars_attachments_children(int version, string agentType, BsonDeserizer d, bool bIsTransition)
{
BsonDeserizer.BsonTypes type = d.ReadType();
while (type != BsonDeserizer.BsonTypes.BT_None)
{
if (type == BsonDeserizer.BsonTypes.BT_PropertiesElement)
{
try
{
this.load_properties(version, agentType, d);
}
catch (Exception e)
{
Debug.Check(false, e.Message);
}
}
else if (type == BsonDeserizer.BsonTypes.BT_ParsElement)
{
this.load_locals(version, agentType, d);
}
else if (type == BsonDeserizer.BsonTypes.BT_AttachmentsElement)
{
this.load_attachments(version, agentType, d, bIsTransition);
this.m_bHasEvents |= this.HasEvents();
}
else if (type == BsonDeserizer.BsonTypes.BT_Custom)
{
this.load_custom(version, agentType, d);
}
else if (type == BsonDeserizer.BsonTypes.BT_NodeElement)
{
this.load_children(version, agentType, d);
}
else
{
Debug.Check(false);
}
type = d.ReadType();
}
}
protected BehaviorNode load(string agentType, BsonDeserizer d, int version)
{
string pClassName = d.ReadString();
BehaviorNode pNode = BehaviorNode.Create(pClassName);
Debug.Check(pNode != null, pClassName);
if (pNode != null)
{
pNode.SetClassNameString(pClassName);
string idString = d.ReadString();
pNode.SetId(Convert.ToInt32(idString));
pNode.load_properties_pars_attachments_children(version, agentType, d, false);
}
return pNode;
}
protected virtual void load_local(int version, string agentType, BsonDeserizer d)
{
Debug.Check(false);
}
protected void load_attachments(int version, string agentType, BsonDeserizer d, bool bIsTransition)
{
d.OpenDocument();
BsonDeserizer.BsonTypes type = d.ReadType();
while (type == BsonDeserizer.BsonTypes.BT_AttachmentElement)
{
d.OpenDocument();
if (bIsTransition)
{
this.m_loadAttachment = true;
this.load_properties_pars_attachments_children(version, agentType, d, false);
this.m_loadAttachment = false;
}
else
{
string attachClassName = d.ReadString();
BehaviorNode pAttachment = BehaviorNode.Create(attachClassName);
Debug.Check(pAttachment != null, attachClassName);
if (pAttachment != null)
{
pAttachment.SetClassNameString(attachClassName);
string idString = d.ReadString();
pAttachment.SetId(Convert.ToInt32(idString));
bool bIsPrecondition = d.ReadBool();
bool bIsEffector = d.ReadBool();
bool bAttachmentIsTransition = d.ReadBool();
pAttachment.load_properties_pars_attachments_children(version, agentType, d, bAttachmentIsTransition);
this.Attach(pAttachment, bIsPrecondition, bIsEffector, bAttachmentIsTransition);
this.m_bHasEvents |= (pAttachment is Event);
}
}
d.CloseDocument(false);
type = d.ReadType();
}
if (type != BsonDeserizer.BsonTypes.BT_None)
{
if (type == BsonDeserizer.BsonTypes.BT_ParsElement)
{
this.load_locals(version, agentType, d);
}
else if (type == BsonDeserizer.BsonTypes.BT_AttachmentsElement)
{
this.load_attachments(version, agentType, d, bIsTransition);
this.m_bHasEvents |= this.HasEvents();
}
else
{
Debug.Check(false);
}
type = d.ReadType();
}
Debug.Check(type == BsonDeserizer.BsonTypes.BT_None);
d.CloseDocument(false);
}
protected BehaviorNode load_node(int version, string agentType, BsonDeserizer d)
{
d.OpenDocument();
BsonDeserizer.BsonTypes type = d.ReadType();
Debug.Check(type == BsonDeserizer.BsonTypes.BT_NodeElement);
d.OpenDocument();
BehaviorNode node = this.load(agentType, d, version);
d.CloseDocument(false);
type = d.ReadType();
Debug.Check(type == BsonDeserizer.BsonTypes.BT_None);
d.CloseDocument(false);
return node;
}
#endregion Bson Load
#endregion Load
public void Attach(BehaviorNode pAttachment, bool bIsPrecondition, bool bIsEffector)
{
this.Attach(pAttachment, bIsPrecondition, bIsEffector, false);
}
public virtual void Attach(BehaviorNode pAttachment, bool bIsPrecondition, bool bIsEffector, bool bIsTransition)
{
Debug.Check(bIsTransition == false);
if (bIsPrecondition)
{
Debug.Check(!bIsEffector);
if (this.m_preconditions == null)
{
this.m_preconditions = new List<Precondition>();
}
Precondition predicate = pAttachment as Precondition;
Debug.Check(predicate != null);
this.m_preconditions.Add(predicate);
Precondition.EPhase phase = predicate.Phase;
if (phase == Precondition.EPhase.E_ENTER)
{
this.m_enter_precond++;
}
else if (phase == Precondition.EPhase.E_UPDATE)
{
this.m_update_precond++;
}
else if (phase == Precondition.EPhase.E_BOTH)
{
this.m_both_precond++;
}
else
{
Debug.Check(false);
}
}
else if (bIsEffector)
{
Debug.Check(!bIsPrecondition);
if (this.m_effectors == null)
{
this.m_effectors = new List<Effector>();
}
Effector effector = pAttachment as Effector;
Debug.Check(effector != null);
this.m_effectors.Add(effector);
Effector.EPhase phase = effector.Phase;
if (phase == Effector.EPhase.E_SUCCESS)
{
this.m_success_effectors++;
}
else if (phase == Effector.EPhase.E_FAILURE)
{
this.m_failure_effectors++;
}
else if (phase == Effector.EPhase.E_BOTH)
{
this.m_both_effectors++;
}
else
{
Debug.Check(false);
}
}
else
{
if (this.m_events == null)
{
this.m_events = new List<BehaviorNode>();
}
this.m_events.Add(pAttachment);
}
}
public virtual void AddChild(BehaviorNode pChild)
{
pChild.m_parent = this;
if (this.m_children == null)
{
this.m_children = new List<BehaviorNode>();
}
this.m_children.Add(pChild);
}
protected virtual EBTStatus update_impl(Agent pAgent, EBTStatus childStatus)
{
return EBTStatus.BT_FAILURE;
}
public void SetClassNameString(string className)
{
this.m_className = className;
}
public string GetClassNameString()
{
return this.m_className;
}
public int GetId()
{
return this.m_id;
}
public void SetId(int id)
{
this.m_id = id;
}
public string GetPath()
{
return "";
}
public BehaviorNode Parent
{
get
{
return this.m_parent;
}
}
public int PreconditionsCount
{
get
{
if (this.m_preconditions != null)
{
return this.m_preconditions.Count;
}
return 0;
}
}
public bool CheckPreconditions(Agent pAgent, bool bIsAlive)
{
Precondition.EPhase phase = bIsAlive ? Precondition.EPhase.E_UPDATE : Precondition.EPhase.E_ENTER;
//satisfied if there is no preconditions
if (this.m_preconditions == null || this.m_preconditions.Count == 0)
{
return true;
}
if (this.m_both_precond == 0)
{
if (phase == Precondition.EPhase.E_ENTER && this.m_enter_precond == 0)
{
return true;
}
if (phase == Precondition.EPhase.E_UPDATE && this.m_update_precond == 0)
{
return true;
}
}
bool firstValidPrecond = true;
bool lastCombineValue = false;
for (int i = 0; i < this.m_preconditions.Count; ++i)
{
Precondition pPrecond = this.m_preconditions[i];
if (pPrecond != null)
{
Precondition.EPhase ph = pPrecond.Phase;
if (phase == Precondition.EPhase.E_BOTH || ph == Precondition.EPhase.E_BOTH || ph == phase)
{
bool taskBoolean = pPrecond.Evaluate(pAgent);
CombineResults(ref firstValidPrecond, ref lastCombineValue, pPrecond, taskBoolean);
}
}
}
return lastCombineValue;
}
private static void CombineResults(ref bool firstValidPrecond, ref bool lastCombineValue, Precondition pPrecond, bool taskBoolean)
{
if (firstValidPrecond)
{
firstValidPrecond = false;
lastCombineValue = taskBoolean;
}
else
{
bool andOp = pPrecond.IsAnd;
if (andOp)
{
lastCombineValue = lastCombineValue && taskBoolean;
}
else
{
lastCombineValue = lastCombineValue || taskBoolean;
}
}
}
public virtual void ApplyEffects(Agent pAgent, Effector.EPhase phase)
{
if (this.m_effectors == null || this.m_effectors.Count == 0)
{
return;
}
if (this.m_both_effectors == 0)
{
if (phase == Effector.EPhase.E_SUCCESS && this.m_success_effectors == 0)
{
return;
}
if (phase == Effector.EPhase.E_FAILURE && this.m_failure_effectors == 0)
{
return;
}
}
for (int i = 0; i < this.m_effectors.Count; ++i)
{
Effector pEffector = this.m_effectors[i];
if (pEffector != null)
{
Effector.EPhase ph = pEffector.Phase;
if (phase == Effector.EPhase.E_BOTH || ph == Effector.EPhase.E_BOTH || ph == phase)
{
pEffector.Evaluate(pAgent);
}
}
}
return;
}
public bool CheckEvents(string eventName, Agent pAgent, Dictionary<uint, IInstantiatedVariable> eventParams)
{
if (this.m_events != null)
{
//bool bTriggered = false;
for (int i = 0; i < this.m_events.Count; ++i)
{
BehaviorNode pA = this.m_events[i];
Event pE = pA as Event;
//check events only
if (pE != null && !string.IsNullOrEmpty(eventName))
{
string pEventName = pE.GetEventName();
if (!string.IsNullOrEmpty(pEventName) && pEventName == eventName)
{
pE.switchTo(pAgent, eventParams);
if (pE.TriggeredOnce())
{
return false;
}
}
}
}
}
return true;
}
public virtual bool Evaluate(Agent pAgent)
{
Debug.Check(false, "only Condition/Sequence/And/Or allowed");
return false;
}
protected bool EvaluteCustomCondition(Agent pAgent)
{
if (this.m_customCondition != null)
{
return m_customCondition.Evaluate(pAgent);
}
return false;
}
public void SetCustomCondition(BehaviorNode node)
{
this.m_customCondition = node;
}
#if !BEHAVIAC_RELEASE
private string m_agentType;
public void SetAgentType(string agentType)
{
Debug.Check(agentType.IndexOf("::") == -1);
this.m_agentType = agentType;
}
public string GetAgentType()
{
return this.m_agentType;
}
#endif
protected abstract BehaviorTask createTask();
public virtual bool enteraction_impl(Agent pAgent)
{
return false;
}
public virtual bool exitaction_impl(Agent pAgent)
{
return false;
}
private string m_className;
private int m_id;
protected List<BehaviorNode> m_events;
private List<Precondition> m_preconditions;
private List<Effector> m_effectors;
protected bool m_loadAttachment = false;
private byte m_enter_precond;
private byte m_update_precond;
private byte m_both_precond;
private byte m_success_effectors;
private byte m_failure_effectors;
private byte m_both_effectors;
protected BehaviorNode m_parent;
protected List<BehaviorNode> m_children;
protected BehaviorNode m_customCondition;
protected bool m_bHasEvents;
}
public abstract class DecoratorNode : BehaviorNode
{
public DecoratorNode()
{
m_bDecorateWhenChildEnds = false;
}
protected override void load(int version, string agentType, List<property_t> properties)
{
base.load(version, agentType, properties);
for (int i = 0; i < properties.Count; ++i)
{
property_t p = properties[i];
if (p.name == "DecorateWhenChildEnds")
{
if (p.value == "true")
{
this.m_bDecorateWhenChildEnds = true;
}
}
}
}
public override bool IsManagingChildrenAsSubTrees()
{
//if it needs to evaluate something even the child is running, this needs to return true.
//return !this.m_bDecorateWhenChildEnds;
return true;
}
public override bool IsValid(Agent pAgent, BehaviorTask pTask)
{
if (!(pTask.GetNode() is DecoratorNode))
{
return false;
}
return base.IsValid(pAgent, pTask);
}
public bool m_bDecorateWhenChildEnds;
}
// ============================================================================
public class BehaviorTree : BehaviorNode
{
//keep this version equal to designers' NewVersion
private const int SupportedVersion = 5;
private Dictionary<uint, ICustomizedProperty> m_localProps;
public Dictionary<uint, ICustomizedProperty> LocalProps
{
get
{
return m_localProps;
}
}
// deprecated, to use AddLocal
public void AddPar(string agentType, string typeName, string name, string valueStr)
{
this.AddLocal(agentType, typeName, name, valueStr);
}
public void AddLocal(string agentType, string typeName, string name, string valueStr)
{
if (this.m_localProps == null)
{
this.m_localProps = new Dictionary<uint, ICustomizedProperty>();
}
uint varId = Utils.MakeVariableId(name);
ICustomizedProperty prop = AgentMeta.CreateProperty(typeName, varId, name, valueStr);
this.m_localProps[varId] = prop;
Type type = Utils.GetElementTypeFromName(typeName);
if (type != null)
{
typeName = Utils.GetNativeTypeName(type);
prop = AgentMeta.CreateArrayItemProperty(typeName, varId, name);
varId = Utils.MakeVariableId(name + "[]");
this.m_localProps[varId] = prop;
}
}
public void InstantiatePars(Dictionary<uint, IInstantiatedVariable> vars)
{
if (this.m_localProps != null)
{
foreach (KeyValuePair<uint, ICustomizedProperty> pair in this.m_localProps)
{
vars[pair.Key] = pair.Value.Instantiate();
}
}
}
public void UnInstantiatePars(Dictionary<uint, IInstantiatedVariable> vars)
{
if (this.m_localProps != null)
{
foreach (uint varId in this.m_localProps.Keys)
{
vars.Remove(varId);
}
}
}
#if BEHAVIAC_USE_SYSTEM_XML
protected override void load_local(int version, string agentType, XmlNode node)
{
if (node.Name != "par")
{
Debug.Check(false);
return;
}
string name = node.Attributes["name"].Value;
string type = node.Attributes["type"].Value.Replace("::", ".");
string value = node.Attributes["value"].Value;
this.AddLocal(agentType, type, name, value);
}
#else
protected override void load_local(int version, string agentType, SecurityElement node)
{
if (node.Tag != "par")
{
Debug.Check(false);
return;
}
string name = node.Attribute("name");
string type = node.Attribute("type").Replace("::", ".");
string value = node.Attribute("value");
this.AddLocal(agentType, type, name, value);
}
#endif
protected override void load_local(int version, string agentType, BsonDeserizer d)
{
d.OpenDocument();
string name = d.ReadString();
string type = d.ReadString().Replace("::", ".");
string value = d.ReadString();
this.AddLocal(agentType, type, name, value);
d.CloseDocument(true);
}
public bool load_xml(byte[] pBuffer)
{
try
{
Debug.Check(pBuffer != null);
string xml = System.Text.Encoding.UTF8.GetString(pBuffer);
#if BEHAVIAC_USE_SYSTEM_XML
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(xml);
XmlNode behaviorNode = xmlDoc.DocumentElement;
if (behaviorNode.Name != "behavior" && behaviorNode.ChildNodes.Count != 1)
{
return false;
}
this.m_name = behaviorNode.Attributes["name"].Value;
string agentType = behaviorNode.Attributes["agenttype"].Value;
string fsm = (behaviorNode.Attributes["fsm"] != null) ? behaviorNode.Attributes["fsm"].Value : null;
string versionStr = behaviorNode.Attributes["version"].Value;
#else
SecurityParser xmlDoc = new SecurityParser();
xmlDoc.LoadXml(xml);
SecurityElement behaviorNode = xmlDoc.ToXml();
if (behaviorNode.Tag != "behavior" && (behaviorNode.Children == null || behaviorNode.Children.Count != 1))
{
return false;
}
this.m_name = behaviorNode.Attribute("name");
string agentType = behaviorNode.Attribute("agenttype").Replace("::", ".");
string fsm = behaviorNode.Attribute("fsm");
string versionStr = behaviorNode.Attribute("version");
#endif
int version = int.Parse(versionStr);
if (version != SupportedVersion)
{
Debug.LogError(string.Format("'{0}' Version({1}), while Version({2}) is supported, please update runtime or rexport data using the latest designer", this.m_name, version, SupportedVersion));
}
this.SetClassNameString("BehaviorTree");
this.SetId(-1);
if (!string.IsNullOrEmpty(fsm) && fsm == "true")
{
this.m_bIsFSM = true;
}
this.load_properties_pars_attachments_children(true, version, agentType, behaviorNode);
return true;
}
catch (Exception e)
{
Debug.Check(false, e.Message);
}
Debug.Check(false);
return false;
}
public bool load_bson(byte[] pBuffer)
{
try
{
BsonDeserizer d = new BsonDeserizer();
if (d.Init(pBuffer))
{
BsonDeserizer.BsonTypes type = d.ReadType();
if (type == BsonDeserizer.BsonTypes.BT_BehaviorElement)
{
bool bOk = d.OpenDocument();
Debug.Check(bOk);
this.m_name = d.ReadString();
string agentTypeTmp = d.ReadString();
string agentType = agentTypeTmp.Replace("::", ".");
bool bFsm = d.ReadBool();
string versionStr = d.ReadString();
int version = Convert.ToInt32(versionStr);
if (version != SupportedVersion)
{
Debug.LogError(string.Format("'{0}' Version({1}), while Version({2}) is supported, please update runtime or rexport data using the latest designer", this.m_name, version, SupportedVersion));
}
this.SetClassNameString("BehaviorTree");
this.SetId(-1);
this.m_bIsFSM = bFsm;
this.load_properties_pars_attachments_children(version, agentType, d, false);
d.CloseDocument(false);
return true;
}
}
}
catch (Exception e)
{
Debug.LogError(string.Format("load_bson failed: {0} {1}", e.Message, pBuffer.Length));
Debug.Check(false, e.Message);
}
Debug.Check(false);
return false;
}
//return the path relative to the workspace path
protected string m_name;
public string GetName()
{
return this.m_name;
}
public void SetName(string name)
{
this.m_name = name;
}
#region FSM
private bool m_bIsFSM = false;
public bool IsFSM
{
get
{
return this.m_bIsFSM;
}
set
{
this.m_bIsFSM = value;
}
}
#endregion
protected override BehaviorTask createTask()
{
BehaviorTreeTask pTask = new BehaviorTreeTask();
return pTask;
}
}
}
| 30.481005 | 218 | 0.478477 | [
"MIT"
] | 625673575/StressTestSuite | StressTest/runtime/BehaviorTree/BehaviorTree.cs | 52,153 | C# |
using System;
namespace Ncp.Exceptions
{
public class DialTimeoutException : ApplicationException
{
private const string DefaultMessage = "dial timeout";
public DialTimeoutException(string message = DefaultMessage)
: base(message)
{
}
}
}
| 19.866667 | 68 | 0.64094 | [
"MIT"
] | rule110-io/nTipBot | nkn-sdk-net/Ncp/Exceptions/DialTimeoutException.cs | 300 | C# |
namespace CustomCode.Core.CodeGeneration.Scripting.Features
{
using CodeFiles;
using Composition;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// Feature for <see cref="IScript"/>s that will generate C# code files.
/// </summary>
[Export(typeof(ICodeFileCollection))]
public sealed class CodeFileCollection : LinkedFeature, ICodeFileCollection, IMutableCodeFileCollection
{
#region Data
/// <summary>
/// Gets the script's generated code files.
/// </summary>
private ConcurrentDictionary<string, ICodeFile> CodeFiles { get; set; } = new ConcurrentDictionary<string, ICodeFile>();
#endregion
#region Logic
/// <inheritdoc />
public ICodeFile CreateOrGetFile(Identity<string> codeFileId)
{
return CodeFiles.GetOrAdd(codeFileId.Value, id => new CodeFile());
}
/// <inheritdoc />
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
/// <inheritdoc />
public IEnumerator<(Identity<string> codeFileId, ICodeFile codeFile)> GetEnumerator()
{
foreach (var codeFile in CodeFiles)
{
yield return (new Identity<string>(codeFile.Key), codeFile.Value);
}
}
/// <inheritdoc />
public override string ToString()
{
return $"{CodeFiles.Count} generated code files";
}
/// <inheritdoc />
public void UpdateValues(IEnumerable<(Identity<string> codeFileId, ICodeFile codeFile)> generatedCodeFiles)
{
CodeFiles = new ConcurrentDictionary<string, ICodeFile>(
generatedCodeFiles.Select(f => new KeyValuePair<string, ICodeFile>(f.codeFileId.Value, f.codeFile)));
}
#endregion
}
} | 31.111111 | 128 | 0.610714 | [
"MIT"
] | git-custom-code/Core-CodeGeneration | src/Core/CodeGeneration.Scripting/Features/CodeFileCollection/CodeFileCollection.cs | 1,960 | C# |
using Boa.Constrictor.RestSharp;
using FluentAssertions;
using Moq;
using NUnit.Framework;
using RestSharp;
using System;
using System.Collections.Generic;
using System.Net;
namespace Boa.Constrictor.UnitTests.RestSharp
{
[TestFixture]
public class ResponseDataTest
{
[Test]
public void Init()
{
var clientUri = new Uri("https://www.pl.com");
var statusCode = HttpStatusCode.Accepted;
var errorMessage = "error";
var content = "got some cool stuff";
#pragma warning disable 0618
var parameters = new List<Parameter>()
{
new Parameter("p1", "hello", ParameterType.HttpHeader),
new Parameter("p2", "goodbye", ParameterType.Cookie),
};
#pragma warning restore 0618
var responseMock = new Mock<IRestResponse>();
responseMock.Setup(x => x.ResponseUri).Returns(clientUri);
responseMock.Setup(x => x.StatusCode).Returns(statusCode);
responseMock.Setup(x => x.Content).Returns(content);
responseMock.Setup(x => x.Headers).Returns(parameters);
responseMock.Setup(x => x.ErrorMessage).Returns(errorMessage);
var data = new ResponseData(responseMock.Object);
data.Uri.Should().Be(clientUri);
data.StatusCode.Should().Be(statusCode);
data.ErrorMessage.Should().Be(errorMessage);
data.Content.Should().Be(content);
data.Headers.Count.Should().Be(2);
data.Headers[0].Name.Should().Be("p1");
data.Headers[0].Value.Should().Be("hello");
data.Headers[0].Type.Should().Be(ParameterType.HttpHeader.ToString());
data.Headers[1].Name.Should().Be("p2");
data.Headers[1].Value.Should().Be("goodbye");
data.Headers[1].Type.Should().Be(ParameterType.Cookie.ToString());
}
}
}
| 35.672727 | 82 | 0.598879 | [
"Apache-2.0"
] | AngieEuphoria/Boa.Constrictor | Boa.Constrictor.UnitTests/RestSharp/Serialization/ResponseDataTest.cs | 1,964 | C# |
[Serializable]
public struct AxisBase // TypeDefIndex: 4831
{
// Fields
[NoSaveDuringPlayAttribute] // RVA: 0x134600 Offset: 0x134701 VA: 0x134600
[TooltipAttribute] // RVA: 0x134600 Offset: 0x134701 VA: 0x134600
public float m_Value; // 0x0
[TooltipAttribute] // RVA: 0x134650 Offset: 0x134751 VA: 0x134650
public float m_MinValue; // 0x4
[TooltipAttribute] // RVA: 0x134690 Offset: 0x134791 VA: 0x134690
public float m_MaxValue; // 0x8
[TooltipAttribute] // RVA: 0x1346D0 Offset: 0x1347D1 VA: 0x1346D0
public bool m_Wrap; // 0xC
// Methods
// RVA: 0xD6C0 Offset: 0xD7C1 VA: 0xD6C0
public void Validate() { }
}
| 29.904762 | 75 | 0.732484 | [
"MIT"
] | SinsofSloth/RF5-global-metadata | Cinemachine/AxisBase.cs | 628 | C# |
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class ShopDetector : MonoBehaviour {
int healUsed = 0;
public Transform shootPoint;
public float detectRange;
public Text shopText;
public Text warningText;
public AudioClip purchasedSound;
IEnumerator warningTextCo = null;
IEnumerator HideWarningText() {
yield return new WaitForSeconds(3f);
warningText.text = "";
yield break;
}
void Start() {
shopText = GameObject.Find("UI/InGameUI/Info/ShopText").GetComponent<Text>();
warningText = GameObject.Find("UI/InGameUI/Info/WarningText").GetComponent<Text>();
}
void PrintWarning(string text) {
if(warningTextCo != null) StopCoroutine(warningTextCo);
warningTextCo = HideWarningText();
warningText.text = text;
StartCoroutine(warningTextCo);
}
void BuyWeapon(Weapon weapon) {
string weaponName = weapon.ToString();
WeaponManager weaponManager = transform.Find("WeaponHolder").GetComponent<WeaponManager>();
GameObject weaponGO = transform.Find("WeaponHolder/" + weaponName).gameObject;
weaponManager.currentWeaponGO.GetComponent<WeaponBase>().Unload();
weaponManager.currentWeapon = weapon;
weaponManager.currentWeaponGO = weaponGO;
weaponManager.primaryWeapon = weapon;
weaponManager.primaryWeaponGO = weaponGO;
WeaponBase weaponBase = weaponManager.currentWeaponGO.GetComponent<WeaponBase>();
weaponManager.currentWeaponGO.SetActive(true);
weaponBase.InitAmmo();
weaponBase.Draw();
}
void UpgradeWeapon(WeaponBase weaponBase, ShopType upgradeType) {
switch(upgradeType) {
case ShopType.UPGRADE_DAMAGE:
weaponBase.upgradeDamage++;
break;
case ShopType.UPGRADE_RELOAD:
weaponBase.upgradeReload++;
break;
case ShopType.UPGRADE_RECOIL:
weaponBase.upgradeRecoil++;
break;
case ShopType.UPGRADE_MAGAZINE:
weaponBase.upgradeMag++;
weaponBase.RecalculateMagSize();
break;
case ShopType.UPGRADE_MAX_AMMO:
weaponBase.upgradeMaxAmmo++;
weaponBase.RecalculateMaxAmmo();
break;
}
}
int GetAmmoPrice(Weapon weapon) {
int price = 0;
switch(weapon) {
case Weapon.AKM:
price = 250;
break;
case Weapon.M870:
price = 200;
break;
case Weapon.MP5K:
price = 150;
break;
case Weapon.Glock:
price = 100;
break;
case Weapon.Python:
price = 100;
break;
default:
price = 100;
break;
}
return price;
}
int GetUpgradePrice(Weapon weapon, int upgraded) {
int basePrice = 100;
switch(weapon) {
case Weapon.AKM:
basePrice = 150;
break;
case Weapon.M870:
basePrice = 100;
break;
case Weapon.MP5K:
basePrice = 75;
break;
case Weapon.Glock:
basePrice = 50;
break;
case Weapon.Python:
basePrice = 50;
break;
}
return basePrice * (upgraded + 1);
}
void Update() {
RaycastHit hit;
Vector3 position = shootPoint.position;
position.y += 1; // Adjust height differences
// Debug.DrawRay(position, transform.TransformDirection(Vector3.forward * detectRange), Color.red);
if(Physics.Raycast(position, transform.TransformDirection(Vector3.forward * detectRange), out hit, detectRange)) {
if(hit.transform.tag == "Shop") {
Shop shop = hit.transform.GetComponent<Shop>();
ShopType shopType = shop.shopType;
string shopTitle = shop.title;
string shopDesc = shop.description;
int shopPrice = shop.price;
bool isPurchasable = true;
WeaponManager weaponManager = transform.Find("WeaponHolder").GetComponent<WeaponManager>();
WeaponBase weaponBase = weaponManager.currentWeaponGO.GetComponent<WeaponBase>();
Weapon weapon = weaponManager.currentWeapon;
if(shopType == ShopType.AMMO) {
shopPrice = GetAmmoPrice(weapon);
shopText.text = shopTitle + "\n(" + shopPrice + "$)\n\n" + shopDesc + "\n\n";
}
else if(shopType == ShopType.HEAL) {
shopPrice = 100 + (75 * healUsed);
shopText.text = shopTitle + "\n(" + shopPrice + "$)\n\n" + shopDesc + "\n\n";
}
else if(shopType == ShopType.UPGRADE_DAMAGE) {
int upgraded = weaponBase.upgradeDamage;
if(upgraded < 10) {
shopPrice = GetUpgradePrice(weaponManager.currentWeapon, upgraded);
shopText.text = shopTitle + " Lv" + (upgraded + 1) + "\n(" + shopPrice + "$)\n\n" + shopDesc + "\n\n";
}
else {
isPurchasable = false;
shopText.text = "Your weapon is fully upgraded.";
}
}
else if(shopType == ShopType.UPGRADE_RELOAD) {
int upgraded = weaponBase.upgradeReload;
if(upgraded < 10) {
shopPrice = GetUpgradePrice(weaponManager.currentWeapon, upgraded);
shopText.text = shopTitle + " Lv" + (upgraded + 1) + "\n(" + shopPrice + "$)\n\n" + shopDesc + "\n\n";
}
else {
isPurchasable = false;
shopText.text = "Your weapon is fully upgraded.";
}
}
else if(shopType == ShopType.UPGRADE_RECOIL) {
int upgraded = weaponBase.upgradeRecoil;
if(upgraded < 10) {
shopPrice = GetUpgradePrice(weaponManager.currentWeapon, upgraded);
shopText.text = shopTitle + " Lv" + (upgraded + 1) + "\n(" + shopPrice + "$)\n\n" + shopDesc + "\n\n";
}
else {
isPurchasable = false;
shopText.text = "Your weapon is fully upgraded.";
}
}
else if(shopType == ShopType.UPGRADE_MAGAZINE) {
int upgraded = weaponBase.upgradeMag;
if(upgraded < 10) {
shopPrice = GetUpgradePrice(weaponManager.currentWeapon, upgraded);
shopText.text = shopTitle + " Lv" + (upgraded + 1) + "\n(" + shopPrice + "$)\n\n" + shopDesc + "\n\n";
}
else {
isPurchasable = false;
shopText.text = "Your weapon is fully upgraded.";
}
}
else if(shopType == ShopType.UPGRADE_MAX_AMMO) {
int upgraded = weaponBase.upgradeMaxAmmo;
if(upgraded < 10) {
shopPrice = GetUpgradePrice(weaponManager.currentWeapon, upgraded);
shopText.text = shopTitle + " Lv" + (upgraded + 1) + "\n(" + shopPrice + "$)\n\n" + shopDesc + "\n\n";
}
else {
isPurchasable = false;
shopText.text = "Your weapon is fully upgraded.";
}
}
else {
shopText.text = shopTitle + "\n(" + shopPrice + "$)\n\n" + shopDesc + "\n\n";
}
if(isPurchasable && Input.GetKeyDown(KeyCode.F)) {
FundSystem fundSystem = transform.parent.GetComponent<FundSystem>();
int fund = fundSystem.GetFund();
if(fund < shopPrice) {
PrintWarning("Not enough money!");
}
else {
bool wasPurchased = true;
if(shopType == ShopType.AMMO) {
weaponBase.bulletsLeft = weaponBase.startBullets + weaponBase.bulletsPerMag;
weaponBase.UpdateAmmoText();
}
else if(shopType == ShopType.HEAL) {
HealthManager healthManager = transform.parent.GetComponent<HealthManager>();
if(healthManager.Health >= healthManager.MaxHealth) {
wasPurchased = false;
PrintWarning("You have full health.");
}
else {
healthManager.Heal();
healUsed++;
}
}
else if(shopType == ShopType.WEAPON_PYTHON) {
Debug.Log("Try buy;");
if(!weaponManager.HasWeapon(Weapon.Python)) {
BuyWeapon(Weapon.Python);
}
else {
wasPurchased = false;
PrintWarning("You already have weapon.");
}
}
else if(shopType == ShopType.WEAPON_MP5K) {
if(!weaponManager.HasWeapon(Weapon.MP5K)) {
BuyWeapon(Weapon.MP5K);
}
else {
wasPurchased = false;
PrintWarning("You already have weapon.");
}
}
else if(shopType == ShopType.WEAPON_UMP45) {
if(!weaponManager.HasWeapon(Weapon.UMP45)) {
BuyWeapon(Weapon.UMP45);
}
else {
wasPurchased = false;
PrintWarning("You already have weapon.");
}
}
else if(shopType == ShopType.WEAPON_AKM) {
if(!weaponManager.HasWeapon(Weapon.AKM)) {
BuyWeapon(Weapon.AKM);
}
else {
wasPurchased = false;
PrintWarning("You already have weapon.");
}
}
else if(shopType == ShopType.WEAPON_M870) {
if(!weaponManager.HasWeapon(Weapon.M870)) {
BuyWeapon(Weapon.M870);
}
else {
wasPurchased = false;
PrintWarning("You already have weapon.");
}
}
else if(shopType == ShopType.UPGRADE_DAMAGE) {
if(weaponBase.upgradeDamage >= 10) {
wasPurchased = false;
PrintWarning("Your weapon is fully upgraded.");
}
else {
UpgradeWeapon(weaponBase, ShopType.UPGRADE_DAMAGE);
}
}
else if(shopType == ShopType.UPGRADE_RELOAD) {
if(weaponBase.upgradeReload >= 10) {
wasPurchased = false;
PrintWarning("Your weapon is fully upgraded.");
}
else {
UpgradeWeapon(weaponBase, ShopType.UPGRADE_RELOAD);
}
}
else if(shopType == ShopType.UPGRADE_RECOIL) {
if(weaponBase.upgradeRecoil >= 10) {
wasPurchased = false;
PrintWarning("Your weapon is fully upgraded.");
}
else {
UpgradeWeapon(weaponBase, ShopType.UPGRADE_RECOIL);
}
}
else if(shopType == ShopType.UPGRADE_MAGAZINE) {
if(weaponBase.upgradeMag >= 10) {
wasPurchased = false;
PrintWarning("Your weapon is fully upgraded.");
}
else {
UpgradeWeapon(weaponBase, ShopType.UPGRADE_MAGAZINE);
}
}
else if(shopType == ShopType.UPGRADE_MAX_AMMO) {
if(weaponBase.upgradeMaxAmmo >= 10) {
wasPurchased = false;
PrintWarning("Your weapon is fully upgraded.");
}
else {
UpgradeWeapon(weaponBase, ShopType.UPGRADE_MAX_AMMO);
}
}
else {
wasPurchased = false;
}
if(wasPurchased) {
fundSystem.TakeFund(shopPrice);
SoundManager soundManager = transform.Find("SoundManager").GetComponent<SoundManager>();
soundManager.Play(purchasedSound);
}
}
}
}
}
else {
shopText.text = "";
}
}
}
| 28.349162 | 116 | 0.629619 | [
"MIT"
] | Voossu/Zombie-Shooter-Project | Assets/Scripts/Shop/ShopDetector.cs | 10,151 | C# |
namespace Mosa.Tool.Debugger.Views
{
partial class InstructionView : DebugDockContent
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
this.toolStripLabel1 = new System.Windows.Forms.ToolStripLabel();
this.tbAddress = new System.Windows.Forms.ToolStripTextBox();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
this.dataGridView1 = new System.Windows.Forms.DataGridView();
this.toolStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
this.SuspendLayout();
//
// toolStrip1
//
this.toolStrip1.ImageScalingSize = new System.Drawing.Size(24, 24);
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripLabel1,
this.tbAddress,
this.toolStripSeparator1,
this.toolStripButton1});
this.toolStrip1.Location = new System.Drawing.Point(0, 2);
this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.Size = new System.Drawing.Size(456, 56);
this.toolStrip1.TabIndex = 4;
this.toolStrip1.Text = "toolStrip1";
//
// toolStripLabel1
//
this.toolStripLabel1.Name = "toolStripLabel1";
this.toolStripLabel1.Size = new System.Drawing.Size(45, 50);
this.toolStripLabel1.Text = "IP:";
//
// tbAddress
//
this.tbAddress.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
this.tbAddress.MaxLength = 20;
this.tbAddress.Name = "tbAddress";
this.tbAddress.Size = new System.Drawing.Size(100, 56);
this.tbAddress.Text = "0x200000";
this.tbAddress.TextBoxTextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(6, 56);
//
// toolStripButton1
//
this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Black;
this.toolStripButton1.Name = "toolStripButton1";
this.toolStripButton1.Size = new System.Drawing.Size(107, 50);
this.toolStripButton1.Text = "Refresh";
this.toolStripButton1.Click += new System.EventHandler(this.toolStripButton1_Click);
//
// dataGridView1
//
this.dataGridView1.AllowUserToAddRows = false;
this.dataGridView1.AllowUserToDeleteRows = false;
this.dataGridView1.AllowUserToOrderColumns = true;
this.dataGridView1.AllowUserToResizeRows = false;
this.dataGridView1.BackgroundColor = System.Drawing.SystemColors.Control;
this.dataGridView1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill;
this.dataGridView1.Location = new System.Drawing.Point(0, 58);
this.dataGridView1.Margin = new System.Windows.Forms.Padding(0);
this.dataGridView1.MultiSelect = false;
this.dataGridView1.Name = "dataGridView1";
this.dataGridView1.ReadOnly = true;
this.dataGridView1.RowHeadersVisible = false;
this.dataGridView1.RowHeadersWidth = 92;
this.dataGridView1.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing;
this.dataGridView1.RowTemplate.DefaultCellStyle.Font = new System.Drawing.Font("Consolas", 8F);
this.dataGridView1.RowTemplate.Height = 18;
this.dataGridView1.Size = new System.Drawing.Size(456, 162);
this.dataGridView1.TabIndex = 5;
this.dataGridView1.CellMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dataGridView1_CellMouseClick);
//
// InstructionView
//
this.ClientSize = new System.Drawing.Size(456, 222);
this.CloseButton = false;
this.CloseButtonVisible = false;
this.Controls.Add(this.dataGridView1);
this.Controls.Add(this.toolStrip1);
this.HideOnClose = true;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.MinimumSize = new System.Drawing.Size(235, 200);
this.Name = "InstructionView";
this.Padding = new System.Windows.Forms.Padding(0, 2, 0, 2);
this.RightToLeftLayout = true;
this.ShowHint = WeifenLuo.WinFormsUI.Docking.DockState.DockLeft;
this.TabText = "Instructions";
this.Text = "Instruction View";
this.toolStrip1.ResumeLayout(false);
this.toolStrip1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ToolStrip toolStrip1;
private System.Windows.Forms.ToolStripLabel toolStripLabel1;
private System.Windows.Forms.ToolStripTextBox tbAddress;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripButton toolStripButton1;
private System.Windows.Forms.DataGridView dataGridView1;
}
} | 40.461538 | 134 | 0.741445 | [
"BSD-3-Clause"
] | GeroL/MOSA-Project | Source/Mosa.Tool.Debugger/Views/InstructionView.designer.cs | 5,786 | C# |
namespace Autossential.Activities.Design.Designers
{
// Interaction logic for RemoveEmptyRowsDesigner.xaml
public partial class RemoveEmptyRowsDesigner
{
public RemoveEmptyRowsDesigner()
{
InitializeComponent();
}
}
} | 24.545455 | 57 | 0.67037 | [
"MIT"
] | Autossential/Autossential.Activities | source/Autossential.Activities.Design/Designers/RemoveEmptyRowsDesigner.xaml.cs | 272 | C# |
using BillingTool.DataModels;
using BillingTool.DataModels.CombinedModel;
using BillingTool.DataModels.Pricing;
using Microsoft.Extensions.Configuration;
using ServiceStack.OrmLite;
using ServiceStack.OrmLite.SqlServer;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace BillingTool
{
public partial class frmMain : Form
{
private static ApplicationSettings appSettings;
private OrmLiteConnectionFactory dbFactory;
private static readonly NLog.Logger Logger = NLog.LogManager.GetCurrentClassLogger();
public frmMain()
{
InitializeComponent();
}
private void frmMain_Load(object sender, EventArgs e)
{
appSettings = Program.Configuration.GetSection("ApplicationSettings").Get<ApplicationSettings>();
var currentDate = DateTime.Now;
cmbYear.SelectedItem = currentDate.Year.ToString();
cmbMonth.SelectedItem = $"{currentDate.Month} - {currentDate.ToString("MMMM")}";
dbFactory = new OrmLiteConnectionFactory(appSettings.ConnectionString, SqlServerDialect.Provider);
}
private void Log(string text)
{
Logger.Info(text);
wl(text);
}
private void w(string text)
{
rtbOutput.AppendText(text);
}
private void wl(string text)
{
w(text + Environment.NewLine);
}
private void btnGetMerchants_Click(object sender, EventArgs e)
{
lstMerchants.Items.Clear();
using (var db = dbFactory.Open())
{
using (var tran = db.OpenTransaction(System.Data.IsolationLevel.ReadUncommitted))
{
var merchants = db.Select<Merchants>().Where(m => m.IsActive && m.IsApproved && !m.IsDeleted && !m.IsRejected);
foreach (var merchant in merchants)
{
lstMerchants.Items.Add(merchant);
}
}
}
}
private void btnGetMerchantBranches_Click(object sender, EventArgs e)
{
lstMerchantBranches.Items.Clear();
using (var db = dbFactory.Open())
{
using (var tran = db.OpenTransaction(System.Data.IsolationLevel.ReadUncommitted))
{
var merchantBranchesQuery = db.From<MerchantBranches>()
.Join<Merchants>((mb, m) => m.Id == mb.MerchantId, SqlServerTableHint.NoLock);
if (lstMerchants.SelectedItems.Count > 0)
{
//Get the Merchant Ids
var selectedItems = lstMerchants.SelectedItems.Cast<Merchants>().Select(i => i.Id).ToList();
merchantBranchesQuery.Where<Merchants>(m => Sql.In(m.Id, selectedItems));
}
var merchantBranches = db.Select(merchantBranchesQuery);
foreach (var merchant in merchantBranches)
{
lstMerchantBranches.Items.Add(merchant);
}
}
}
}
private void btnGetMBPs_Click(object sender, EventArgs e)
{
lstMBPs.Items.Clear();
using (var db = dbFactory.Open())
{
using (var tran = db.OpenTransaction(System.Data.IsolationLevel.ReadUncommitted))
{
var mbpQuery = db.From<MerchantBranchProducts>()
.Join<MerchantBranches>((mbp, mb) => mbp.MerchantBranchId == mb.Id, SqlServerTableHint.NoLock)
.Join<MerchantBranches, Merchants>((mb, m) => mb.MerchantId == m.Id, SqlServerTableHint.NoLock);
if (lstMerchantBranches.SelectedItems.Count > 0)
{
//Selected Merchant Branches
var selectedMerchantBranchIds = lstMerchantBranches.SelectedItems.Cast<MerchantBranches>().Select(i => i.Id).ToList();
mbpQuery.Where<MerchantBranches>(mb => Sql.In(mb.Id, selectedMerchantBranchIds));
}
if (lstMerchants.SelectedItems.Count > 0)
{
//selected merchatns
var selectedMerchantIds = lstMerchants.SelectedItems.Cast<Merchants>().Select(i => i.Id).ToList();
mbpQuery.Where<Merchants>(m => Sql.In(m.Id, selectedMerchantIds));
}
var mbps = db.Select(mbpQuery);
foreach (var mbp in mbps)
{
lstMBPs.Items.Add(mbp);
}
}
}
}
private void btnGetProducts_Click(object sender, EventArgs e)
{
lstProducts.Items.Clear();
using (var db = dbFactory.Open())
{
using (var tran = db.OpenTransaction(System.Data.IsolationLevel.ReadUncommitted))
{
var productQuery = db.From<Products>()
.Join<MerchantBranchProducts>((p, mbp) => p.Id == mbp.ProductId, SqlServerTableHint.NoLock)
.Join<MerchantBranchProducts, MerchantBranches>((mbp, mb) => mbp.MerchantBranchId == mb.Id, SqlServerTableHint.NoLock)
.Join<MerchantBranches, Merchants>((mb, m) => mb.MerchantId == m.Id, SqlServerTableHint.NoLock);
if (lstMerchantBranches.SelectedItems.Count > 0)
{
//Selected Merchant Branches
var selectedMerchantBranchIds = lstMerchantBranches.SelectedItems.Cast<MerchantBranches>().Select(i => i.Id).ToList();
productQuery.Where<MerchantBranches>(mb => Sql.In(mb.Id, selectedMerchantBranchIds));
}
if (lstMerchants.SelectedItems.Count > 0)
{
//selected merchatns
var selectedMerchantIds = lstMerchants.SelectedItems.Cast<Merchants>().Select(i => i.Id).ToList();
productQuery.Where<Merchants>(m => Sql.In(m.Id, selectedMerchantIds));
}
if (lstMBPs.SelectedItems.Count > 0)
{
//Selected MerchantBranchProductIds
var selectedMerchantBranchProductId = lstMBPs.SelectedItems.Cast<MerchantBranchProducts>().Select(i => i.Id).ToList();
productQuery.Where<MerchantBranchProducts>(mbp => Sql.In(mbp.Id, selectedMerchantBranchProductId));
}
var products = db.Select(productQuery.SelectDistinct());
foreach (var product in products)
{
lstProducts.Items.Add(product);
}
}
}
}
private void btnCountBilled_Click(object sender, EventArgs e)
{
using (var db = dbFactory.Open())
{
using (var tran = db.OpenTransaction(System.Data.IsolationLevel.ReadUncommitted))
{
var applicableDate = new DateTime(int.Parse(cmbYear.Text), int.Parse(cmbMonth.Text.Substring(0, 1)), 1);
var q = db.From<TransactionHistory>()
.Where(th => (th.Billed.HasValue && th.Billed.Value == true) && th.UpdateDate >= applicableDate)
.Select(Sql.Count("*"));
txtCountBilled.Text = db.Scalar<int>(q).ToString();
}
}
}
private void btnGetEligibleCount_Click(object sender, EventArgs e)
{
using (var db = dbFactory.Open())
{
using (var tran = db.OpenTransaction(System.Data.IsolationLevel.ReadUncommitted))
{
var eligibleYear = int.Parse(cmbYear.Text);
var eligibleMonth = int.Parse(cmbMonth.Text.Substring(0, 1));
var applicableDate = new DateTime(eligibleYear, eligibleMonth, 1);
var q = db.From<TransactionHistory>()
.Join<BillableResponseCodes>((th, brc) => th.OutcomeCode == brc.ResponseCode)
.Where(th => (!th.Billed.HasValue || th.Billed.Value == false) && th.UpdateDate >= applicableDate)
.Select(Sql.Count("*"));
txtEligibleCount.Text = db.Scalar<int>(q).ToString();
}
}
}
private void btnDoBillingRun_Click(object sender, EventArgs e)
{
int limit = int.Parse(txtLotSize.Text);
var eligibleYear = int.Parse(cmbYear.Text);
var eligibleMonth = int.Parse(cmbMonth.Text.Substring(0, 1));
var startMonth = new DateTime(eligibleYear, eligibleMonth, 1);
var endMonth = startMonth.AddMonths(1);
var mbps = GetMerchantBranchProductIds();
foreach (var mbp in mbps)
{
//Log($"MBP: {mbp}");
if (chkInstallments.Checked)
{
//get a list of transaction histories for the given mbp that have billable outcomes and that have not already been billed
GetSomeBillableInstallmentTransactionHistoryRecordsForMBP(mbp, limit, startMonth, endMonth);
}
}
}
private List<Guid> GetMerchantBranchProductIds()
{
if (lstMBPs.SelectedItems.Count > 0)
{
return lstMBPs.SelectedItems.Cast<MerchantBranchProducts>().Select(i => i.Id).ToList();
}
using (var db = dbFactory.Open())
{
using (var tran = db.OpenTransaction(System.Data.IsolationLevel.ReadUncommitted))
{
var mbpQuery = db.From<MerchantBranchProducts>()
.Select<MerchantBranchProducts>(mbp => mbp.Id);
return db.Column<Guid>(mbpQuery);
}
}
}
private void GetSomeBillableInstallmentTransactionHistoryRecordsForMBP(Guid merchantBranchProductId, int lotSize, DateTime startDate, DateTime endDate)
{
using (var db = dbFactory.Open())
{
using (var tran = db.OpenTransaction(System.Data.IsolationLevel.ReadCommitted))
{
var query =
db.From<TransactionHistory>()
.Join<Transactions>()
.Join<Transactions, InstallmentTransactions>()
.Join<TransactionHistory, BillableResponseCodes>((th, brc) => th.OutcomeCode == brc.ResponseCode)
.Where<Transactions>(th => th.MerchantBranchProductId == merchantBranchProductId)
//.Where<Transactions>(t => t.UpdateTimestamp >= startDate && t.UpdateTimestamp <= endDate)
.Select<TransactionHistory, Transactions, BillableResponseCodes, InstallmentTransactions>(
(th, t, brc, instr) => new
{
Id=th.Id,
IsCancelled = brc.IsCancelled,
IsDispute = brc.IsDispute,
IsFailed = brc.IsFailed,
IsSuccess = brc.IsSuccess,
IsTracking = brc.IsTracking,
TotalCost = t.TotalCostInCents,
InstallmentId = instr.InstallmentId
}
);
var results = db.Select<(Guid Id, bool IsCancelled, bool IsDispute, bool IsFailed, bool IsSuccess, bool IsTracking, long TotalCost, Guid InstallmentId)>(query);
foreach(var result in results)
{
Log($"{result.Id} {result.IsCancelled} {result.TotalCost} {result.InstallmentId}");
}
}
}
}
private void GetBillableInstallmentTransactionHistoryRecords()
{
using (var db = dbFactory.Open())
{
using (var tran = db.OpenTransaction(System.Data.IsolationLevel.ReadCommitted))
{
var query =
db.From<MerchantBranchProducts>()
.Join<Transactions>()
.Join<Transactions, InstallmentTransactions>()
.Join<Transactions, TransactionHistory>()
.Join<TransactionHistory, BillableResponseCodes>((th, brc) => th.OutcomeCode == brc.ResponseCode);
if (lstMBPs.SelectedItems.Count > 0)
{
//Selected MerchantBranchProductIds
var selectedMerchantBranchProductId = lstMBPs.SelectedItems.Cast<MerchantBranchProducts>().Select(i => i.Id).ToList();
query.Where<MerchantBranchProducts>(mbp => Sql.In(mbp.Id, selectedMerchantBranchProductId));
}
}
}
}
private void btnDeleteBillings_Click(object sender, EventArgs e)
{
using (var db = dbFactory.Open())
{
using (var tran = db.OpenTransaction(System.Data.IsolationLevel.ReadUncommitted))
{
}
}
}
}
}
| 41 | 181 | 0.510399 | [
"MIT"
] | StarkBotha/OrmLite-Billing-Tool | BillingTool/frmMain.cs | 14,475 | C# |
using Picturepark.SDK.V1.Builders;
using Picturepark.SDK.V1.Contract;
using Picturepark.SDK.V1.Contract.Providers;
namespace Picturepark.SDK.V1.Providers
{
public abstract class SchemaIndexingInfoProvider<T> : ISchemaIndexingInfoProvider
{
public SchemaIndexingInfo GetSchemaIndexingInfo()
{
var builder = CreateBuilder();
return Setup(builder).Build();
}
protected virtual SchemaIndexingInfoBuilder<T> CreateBuilder()
{
return new SchemaIndexingInfoBuilder<T>();
}
protected abstract SchemaIndexingInfoBuilder<T> Setup(SchemaIndexingInfoBuilder<T> builder);
}
}
| 29.173913 | 100 | 0.692996 | [
"MIT"
] | HuberAndrea/Picturepark.SDK.DotNet | src/Picturepark.SDK.V1/Providers/SchemaIndexingInfoProvider.cs | 673 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace SistemaDeEmpregados
{
static class Program
{
/// <summary>
/// Ponto de entrada principal para o aplicativo.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new FrMenu());
}
}
}
| 22.73913 | 65 | 0.621415 | [
"MIT"
] | miguelhp373/Programacao_Web_Modulo03 | SistemaDeEmpregados/Program.cs | 525 | C# |
using System;
using TestConsoleApp.ViewModels;
using MapTo;
namespace TestConsoleApp.Data.Models
{
[MapFrom(typeof(UserViewModel))]
public partial class User
{
public int Id { get; set; }
public DateTimeOffset RegisteredAt { get; set; }
}
} | 18.4 | 56 | 0.673913 | [
"MIT"
] | Wvader/MapTo | test/TestConsoleApp/Data/Models/User.cs | 278 | C# |
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using GraphProcessor;
using Unity.Jobs;
using UnityEngine;
public class SIGGraphProcessor : BaseGraphProcessor
{
protected List<BaseNode> processList;
protected SIGProcessingContext context;
/// <summary>
/// Manage graph scheduling and processing
/// </summary>
/// <param name="graph">Graph to be processed</param>
public SIGGraphProcessor(BaseGraph graph) : base(graph) {}
public override void UpdateComputeOrder()
{
processList = graph.nodes.OrderBy(n => n.computeOrder).ToList();
}
/// <summary>
/// Schedule the graph into the job system
/// </summary>
public override void Run()
{
int count = processList.Count;
context.Profiler.OnBeginGraphProcessing();
for (int i = 0; i < count; i++)
{
if (processList[i] is SIGNode node) node.Context = this.context;
processList[i].OnProcess();
}
context.Profiler.OnFinishGraphProcessing();
JobHandle.ScheduleBatchedJobs();
}
public virtual void Run(SIGProcessingContext context)
{
this.context = context;
Run();
}
}
| 25.8125 | 76 | 0.638418 | [
"MIT"
] | FreshlyBrewedCode/SIG | Packages/de.frebreco.SIG.Core/Runtime/SIGGraphProcessor.cs | 1,239 | C# |
using FluentAssertions;
using System;
using System.Threading.Tasks;
using Xunit;
namespace Functional.Unions.FluentAssertions.Tests
{
public partial class UnionValueTypeAssertionsTests
{
public class TaskAdHocWithFourTypes
{
[Fact]
public void When_EqualityIsTrue_Then_ShouldNotThrowException() => new Func<Task>(() =>
Task.FromResult(Union.FromTypes<ClassOne, ClassTwo, ClassThree, ClassFour>().Create(ModelFour)).Value().Should().Be(Union.FromTypes<ClassOne, ClassTwo, ClassThree, ClassFour>().Create(ModelFour).Value())
).Should().NotThrowAsync();
[Fact]
public void When_EqualityIsFalse_Then_ShouldThrowException() => new Func<Task>(() =>
Task.FromResult(Union.FromTypes<ClassOne, ClassTwo, ClassThree, ClassFour>().Create(ModelFour)).Value().Should().Be(Union.FromTypes<ClassOne, ClassTwo, ClassThree, ClassFour>().Create(new ClassFour()).Value())
).Should().ThrowAsync<Exception>();
[Fact]
public void When_TypeIsOneAndExpectedTypeIsOne_Then_ShouldNotThrowException() => new Func<Task>(() =>
Task.FromResult(Union.FromTypes<ClassOne, ClassTwo, ClassThree, ClassFour>().Create(ModelOne)).Value().Should().BeOfTypeOne()
).Should().NotThrowAsync();
[Fact]
public void When_TypeIsOneAndExpectedTypeIsNotOne_Then_ShouldThrowException() => new Func<Task>(() =>
Task.FromResult(Union.FromTypes<ClassOne, ClassTwo, ClassThree, ClassFour>().Create(ModelOne)).Value().Should().BeOfTypeTwo()
).Should().ThrowAsync<Exception>();
[Fact]
public void When_TypeIsTwoAndExpectedTypeIsTwo_Then_ShouldNotThrowException() => new Func<Task>(() =>
Task.FromResult(Union.FromTypes<ClassOne, ClassTwo, ClassThree, ClassFour>().Create(ModelTwo)).Value().Should().BeOfTypeTwo()
).Should().NotThrowAsync();
[Fact]
public void When_TypeIsTwoAndExpectedTypeIsNotTwo_Then_ShouldThrowException() => new Func<Task>(() =>
Task.FromResult(Union.FromTypes<ClassOne, ClassTwo, ClassThree, ClassFour>().Create(ModelTwo)).Value().Should().BeOfTypeOne()
).Should().ThrowAsync<Exception>();
[Fact]
public void When_TypeIsThreeAndExpectedTypeIsThree_Then_ShouldNotThrowException() => new Func<Task>(() =>
Task.FromResult(Union.FromTypes<ClassOne, ClassTwo, ClassThree, ClassFour>().Create(ModelThree)).Value().Should().BeOfTypeThree()
).Should().NotThrowAsync();
[Fact]
public void When_TypeIsThreeAndExpectedTypeIsNotThree_Then_ShouldThrowException() => new Func<Task>(() =>
Task.FromResult(Union.FromTypes<ClassOne, ClassTwo, ClassThree, ClassFour>().Create(ModelThree)).Value().Should().BeOfTypeTwo()
).Should().ThrowAsync<Exception>();
[Fact]
public void When_TypeIsFourAndExpectedTypeIsFour_Then_ShouldNotThrowException() => new Func<Task>(() =>
Task.FromResult(Union.FromTypes<ClassOne, ClassTwo, ClassThree, ClassFour>().Create(ModelFour)).Value().Should().BeOfTypeFour()
).Should().NotThrowAsync();
[Fact]
public void When_TypeIsFourAndExpectedTypeIsNotFour_Then_ShouldThrowException() => new Func<Task>(() =>
Task.FromResult(Union.FromTypes<ClassOne, ClassTwo, ClassThree, ClassFour>().Create(ModelFour)).Value().Should().BeOfTypeThree()
).Should().ThrowAsync<Exception>();
[Fact]
public void When_TypeIsOneAndAdditionalAssertionSucceeds_Then_ShouldNotThrowException() => new Func<Task>(() =>
Task.FromResult(Union.FromTypes<ClassOne, ClassTwo, ClassThree, ClassFour>().Create(ModelOne)).Value().Should().BeOfTypeOne().AndValue(value => value.Should().Be(ModelOne))
).Should().NotThrowAsync();
[Fact]
public void When_TypeIsTwoAndAdditionalAssertionSucceeds_Then_ShouldNotThrowException() => new Func<Task>(() =>
Task.FromResult(Union.FromTypes<ClassOne, ClassTwo, ClassThree, ClassFour>().Create(ModelTwo)).Value().Should().BeOfTypeTwo().AndValue(value => value.Should().Be(ModelTwo))
).Should().NotThrowAsync();
[Fact]
public void When_TypeIsThreeAndAdditionalAssertionSucceeds_Then_ShouldNotThrowException() => new Func<Task>(() =>
Task.FromResult(Union.FromTypes<ClassOne, ClassTwo, ClassThree, ClassFour>().Create(ModelThree)).Value().Should().BeOfTypeThree().AndValue(value => value.Should().Be(ModelThree))
).Should().NotThrowAsync();
[Fact]
public void When_TypeIsFourAndAdditionalAssertionSucceeds_Then_ShouldNotThrowException() => new Func<Task>(() =>
Task.FromResult(Union.FromTypes<ClassOne, ClassTwo, ClassThree, ClassFour>().Create(ModelFour)).Value().Should().BeOfTypeFour().AndValue(value => value.Should().Be(ModelFour))
).Should().NotThrowAsync();
}
}
}
| 54.190476 | 213 | 0.749341 | [
"MIT"
] | RyanMarcotte/Functional.FluentAssertions | src/Functional.Unions.FluentAssertions.Tests/UnionValueTypeAssertionsTests.TaskAdHocWithFourTypes.cs | 4,554 | C# |
using System.Collections.Generic;
using System.Globalization;
using static lox.TokenType;
namespace lox
{
class Scanner
{
#region Keyword Lookup
static readonly Dictionary<string, TokenType> keywords = new Dictionary<string, TokenType>
{
{"and", And},
{"break", Break},
{"class", Class},
{"else", Else},
{"false", False},
{"for", For},
{"fun", Fun},
{"if", If},
{"nil", Nil},
{"or", Or},
{"print", Print},
{"return", Return},
{"super", Super},
{"this", This},
{"true", True},
{"var", Var},
{"while", While},
};
#endregion
readonly string source;
readonly List<Token> tokens = new List<Token>();
int start;
int current;
int line = 1;
#region Helpers
bool IsAtEnd => current >= source.Length;
char Peek => IsAtEnd ? '\0' : source[current];
char PeekNext
{
get
{
if (current + 1 >= source.Length)
return '\0';
return source[current + 1];
}
}
char Advance() => source[current++];
bool IsDigit(char c) => c >= '0' && c <= '9';
bool IsAlpha(char c)
{
return (c >= 'a' && c <= 'z')
|| (c >= 'A' && c <= 'Z')
|| c == '_';
}
bool IsAlphaNum(char c) => IsDigit(c) || IsAlpha(c);
bool Match(char expected)
{
if (IsAtEnd)
return false;
if (source[current] != expected)
return false;
current++;
return true;
}
string TokenText(int startTrim = 0, int endTrim = 0) => source.Substring(start + startTrim, (current - start) + endTrim - startTrim);
void AddToken(TokenType type) => AddToken(type, null);
void AddToken(TokenType type, object literal)
{
tokens.Add(new Token(type, TokenText(), literal, line));
}
#endregion
#region Scan Methods
void String()
{
while (Peek != '"' && !IsAtEnd)
{
if (Peek == '\n')
line++;
Advance();
}
if (IsAtEnd)
{
Program.Error(line, "Unterminated string literal.");
return;
}
// For the closing "
Advance();
var value = TokenText(1, -1);
AddToken(TokenType.String, value);
}
void Number()
{
while (IsDigit(Peek))
Advance();
if (Peek == '.' && IsDigit(PeekNext))
{
Advance();
while (IsDigit(Peek))
Advance();
}
var value = TokenText();
AddToken(TokenType.Number, double.Parse(value, CultureInfo.InvariantCulture));
}
void Identifier()
{
while (IsAlphaNum(Peek))
Advance();
if (keywords.TryGetValue(TokenText(), out var type))
AddToken(type);
else
AddToken(TokenType.Identifier);
}
void ScanToken()
{
var c = Advance();
switch(c)
{
case '(': AddToken(LeftParen); break;
case ')': AddToken(RightParen); break;
case '{': AddToken(LeftBrace); break;
case '}': AddToken(RightBrace); break;
case ',': AddToken(Comma); break;
case '.': AddToken(Dot); break;
case '-': AddToken(Minus); break;
case '+': AddToken(Plus); break;
case ';': AddToken(Semicolon); break;
case '*': AddToken(Star); break;
case ':': AddToken(Colon); break;
case '?': AddToken(QuestionMark); break;
case '!': AddToken(Match('=') ? BangEqual : Bang); break;
case '=': AddToken(Match('=') ? EqualEqual : Equal); break;
case '<': AddToken(Match('=') ? LessEqual : Less); break;
case '>': AddToken(Match('=') ? GreaterEqual : Greater); break;
case '"': String(); break;
// TODO: Support C-style /* ... */ comments
case '/':
if (Match('/'))
{
while (Peek != '\n' && !IsAtEnd)
Advance();
}
else
AddToken(Slash);
break;
case ' ':
case '\r':
case '\t':
// Ignore whitespace
break;
case '\n':
line++;
break;
default:
if (IsDigit(c))
Number();
else if (IsAlpha(c))
Identifier();
else
Program.Error(line, $"Unexpected character '{c}'.");
break;
}
}
#endregion
public IEnumerable<Token> ScanTokens()
{
while (!IsAtEnd)
{
start = current;
ScanToken();
}
tokens.Add(new Token(EOF, string.Empty, null, line));
return tokens;
}
public Scanner(string source)
{
this.source = source;
}
}
} | 26.949772 | 141 | 0.394443 | [
"BSD-3-Clause"
] | rthome/Lox | lox/Scanner.cs | 5,902 | 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("Numbers from 1 to n")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Numbers from 1 to n")]
[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("b9e6e82b-43e2-43cc-92ac-ec219fe592ee")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| 38.135135 | 84 | 0.742027 | [
"MIT"
] | milkokochev/Telerik | C#1/HomeWorks/04. Console Input Output/Numbers from 1 to n/Properties/AssemblyInfo.cs | 1,414 | C# |
namespace WindowsFormsApp1
{
partial class EntryForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.DgdDisplay = new System.Windows.Forms.DataGridView();
this.IdeaDgdViewTxtCol = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.NumVoteDgdViewTxtCol = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.VoteDgdViewBtnCol = new System.Windows.Forms.DataGridViewButtonColumn();
this.BindingSrc = new System.Windows.Forms.BindingSource(this.components);
this.btnUpdate = new System.Windows.Forms.Button();
this.btnClear = new System.Windows.Forms.Button();
this.btnAdd = new System.Windows.Forms.Button();
this.txtIdea = new System.Windows.Forms.TextBox();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
((System.ComponentModel.ISupportInitialize)(this.DgdDisplay)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.BindingSrc)).BeginInit();
this.tableLayoutPanel1.SuspendLayout();
this.SuspendLayout();
//
// DgdDisplay
//
this.DgdDisplay.AllowUserToAddRows = false;
this.DgdDisplay.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.DgdDisplay.AutoGenerateColumns = false;
this.DgdDisplay.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.DgdDisplay.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.IdeaDgdViewTxtCol,
this.NumVoteDgdViewTxtCol,
this.VoteDgdViewBtnCol});
this.DgdDisplay.DataSource = this.BindingSrc;
this.DgdDisplay.Location = new System.Drawing.Point(5, 74);
this.DgdDisplay.Name = "DgdDisplay";
this.DgdDisplay.ReadOnly = true;
this.DgdDisplay.Size = new System.Drawing.Size(783, 364);
this.DgdDisplay.TabIndex = 0;
//
// IdeaDgdViewTxtCol
//
this.IdeaDgdViewTxtCol.DataPropertyName = "Idea";
this.IdeaDgdViewTxtCol.HeaderText = "Idea";
this.IdeaDgdViewTxtCol.Name = "IdeaDgdViewTxtCol";
this.IdeaDgdViewTxtCol.ReadOnly = true;
this.IdeaDgdViewTxtCol.Width = 500;
//
// NumVoteDgdViewTxtCol
//
this.NumVoteDgdViewTxtCol.DataPropertyName = "NumberOfVote";
this.NumVoteDgdViewTxtCol.HeaderText = "Number of Vote";
this.NumVoteDgdViewTxtCol.Name = "NumVoteDgdViewTxtCol";
this.NumVoteDgdViewTxtCol.ReadOnly = true;
//
// VoteDgdViewBtnCol
//
this.VoteDgdViewBtnCol.DataPropertyName = "VoteBtnCol";
this.VoteDgdViewBtnCol.HeaderText = "Vote";
this.VoteDgdViewBtnCol.Name = "VoteDgdViewBtnCol";
this.VoteDgdViewBtnCol.ReadOnly = true;
this.VoteDgdViewBtnCol.Text = "Vote This";
//
// BindingSrc
//
this.BindingSrc.DataSource = typeof(WindowsFormsApp1.BrainStormPost);
//
// btnUpdate
//
this.btnUpdate.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.btnUpdate.Font = new System.Drawing.Font("Georgia", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnUpdate.Location = new System.Drawing.Point(4, 32);
this.btnUpdate.Name = "btnUpdate";
this.btnUpdate.Size = new System.Drawing.Size(782, 34);
this.btnUpdate.TabIndex = 3;
this.btnUpdate.Text = "Show Ranking";
this.btnUpdate.UseVisualStyleBackColor = true;
this.btnUpdate.Click += new System.EventHandler(this.btnUpdate_Click);
//
// btnClear
//
this.btnClear.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.btnClear.Font = new System.Drawing.Font("Georgia", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnClear.Location = new System.Drawing.Point(711, 3);
this.btnClear.Name = "btnClear";
this.btnClear.Size = new System.Drawing.Size(74, 22);
this.btnClear.TabIndex = 2;
this.btnClear.Text = "Clear";
this.btnClear.UseVisualStyleBackColor = true;
this.btnClear.Click += new System.EventHandler(this.btnClear_Click);
//
// btnAdd
//
this.btnAdd.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.btnAdd.Font = new System.Drawing.Font("Georgia", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnAdd.Location = new System.Drawing.Point(633, 3);
this.btnAdd.Name = "btnAdd";
this.btnAdd.Size = new System.Drawing.Size(72, 22);
this.btnAdd.TabIndex = 2;
this.btnAdd.Text = "Add";
this.btnAdd.UseVisualStyleBackColor = true;
this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
//
// txtIdea
//
this.txtIdea.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtIdea.Font = new System.Drawing.Font("Calibri", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtIdea.Location = new System.Drawing.Point(3, 3);
this.txtIdea.Name = "txtIdea";
this.txtIdea.Size = new System.Drawing.Size(624, 23);
this.txtIdea.TabIndex = 1;
this.txtIdea.Text = "Type your idea here...";
this.txtIdea.Click += new System.EventHandler(this.txtIdea_Click);
this.txtIdea.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtIdea_KeyDown);
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tableLayoutPanel1.ColumnCount = 3;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 80F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel1.Controls.Add(this.txtIdea, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.btnAdd, 1, 0);
this.tableLayoutPanel1.Controls.Add(this.btnClear, 2, 0);
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 1;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(788, 28);
this.tableLayoutPanel1.TabIndex = 1;
//
// EntryForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Controls.Add(this.btnUpdate);
this.Controls.Add(this.tableLayoutPanel1);
this.Controls.Add(this.DgdDisplay);
this.Name = "EntryForm";
this.Text = "Brain Storm Board";
this.Load += new System.EventHandler(this.EntryForm_Load);
((System.ComponentModel.ISupportInitialize)(this.DgdDisplay)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.BindingSrc)).EndInit();
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.DataGridView DgdDisplay;
private System.Windows.Forms.DataGridViewTextBoxColumn voteDataGridViewTextBoxColumn;
private System.Windows.Forms.BindingSource BindingSrc;
private System.Windows.Forms.Button btnUpdate;
private System.Windows.Forms.DataGridViewTextBoxColumn IdeaDgdViewTxtCol;
private System.Windows.Forms.DataGridViewTextBoxColumn NumVoteDgdViewTxtCol;
private System.Windows.Forms.DataGridViewButtonColumn VoteDgdViewBtnCol;
private System.Windows.Forms.Button btnClear;
private System.Windows.Forms.Button btnAdd;
private System.Windows.Forms.TextBox txtIdea;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
}
} | 54.924623 | 163 | 0.635865 | [
"MIT"
] | minhtu-hoang19/BTECProgrammingAssignment2 | BTECProgrammingAssignment2/WindowsFormsApp1/DataModel/EntryForm.Designer.cs | 10,932 | C# |
using System;
namespace Swetugg.Tix.Order.Events
{
public class TicketAdded : EventBase
{
public Guid TicketId { get; set; }
public Guid TicketTypeId { get; set; }
}
} | 19.7 | 46 | 0.629442 | [
"MIT"
] | andlju/swetugg-tix | src/Swetugg.Tix.Order.Events/TicketAdded.cs | 199 | C# |
// *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
namespace Pulumi.AzureNative.Network.V20200701.Outputs
{
[OutputType]
public sealed class FirewallPolicyNatRuleCollectionResponse
{
/// <summary>
/// The action type of a Nat rule collection.
/// </summary>
public readonly Outputs.FirewallPolicyNatRuleCollectionActionResponse? Action;
/// <summary>
/// The name of the rule collection.
/// </summary>
public readonly string? Name;
/// <summary>
/// Priority of the Firewall Policy Rule Collection resource.
/// </summary>
public readonly int? Priority;
/// <summary>
/// The type of the rule collection.
/// Expected value is 'FirewallPolicyNatRuleCollection'.
/// </summary>
public readonly string RuleCollectionType;
/// <summary>
/// List of rules included in a rule collection.
/// </summary>
public readonly ImmutableArray<object> Rules;
[OutputConstructor]
private FirewallPolicyNatRuleCollectionResponse(
Outputs.FirewallPolicyNatRuleCollectionActionResponse? action,
string? name,
int? priority,
string ruleCollectionType,
ImmutableArray<object> rules)
{
Action = action;
Name = name;
Priority = priority;
RuleCollectionType = ruleCollectionType;
Rules = rules;
}
}
}
| 30.482759 | 86 | 0.620475 | [
"Apache-2.0"
] | pulumi-bot/pulumi-azure-native | sdk/dotnet/Network/V20200701/Outputs/FirewallPolicyNatRuleCollectionResponse.cs | 1,768 | C# |
namespace SoftJail.Data
{
using Microsoft.EntityFrameworkCore;
using SoftJail.Data.Models;
public class SoftJailDbContext : DbContext
{
public SoftJailDbContext()
{
}
public SoftJailDbContext(DbContextOptions options)
: base(options)
{
}
public DbSet<Prisoner> Prisoners { get; set; }
public DbSet<Officer> Officers { get; set; }
public DbSet<Cell> Cells { get; set; }
public DbSet<Mail> Mails { get; set; }
public DbSet<Department> Departments { get; set; }
public DbSet<OfficerPrisoner> OfficersPrisoners { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (!optionsBuilder.IsConfigured)
{
optionsBuilder
.UseSqlServer(Configuration.ConnectionString);
}
}
protected override void OnModelCreating(ModelBuilder builder)
{
builder.Entity<Prisoner>(entity =>
{
entity.HasOne(p => p.Cell)
.WithMany(c => c.Prisoners)
.HasForeignKey(p => p.CellId)
.OnDelete(DeleteBehavior.Restrict);
});
builder.Entity<Officer>(entity =>
{
entity.HasOne(o => o.Department);
});
builder.Entity<Cell>(entity =>
{
entity.HasOne(c => c.Department)
.WithMany(d => d.Cells)
.HasForeignKey(c => c.DepartmentId)
.OnDelete(DeleteBehavior.Restrict);
});
builder.Entity<Mail>(entity =>
{
entity.HasOne(m => m.Prisoner)
.WithMany(p => p.Mails)
.HasForeignKey(m => m.PrisonerId)
.OnDelete(DeleteBehavior.Restrict);
});
builder.Entity<OfficerPrisoner>(entity =>
{
entity.HasKey(op => new { op.PrisonerId, op.OfficerId });
entity.HasOne(op => op.Prisoner)
.WithMany(p => p.PrisonerOfficers)
.HasForeignKey(op => op.PrisonerId)
.OnDelete(DeleteBehavior.Restrict);
entity.HasOne(op => op.Officer)
.WithMany(o => o.OfficerPrisoners)
.HasForeignKey(op => op.OfficerId)
.OnDelete(DeleteBehavior.Restrict);
});
}
}
} | 29.27907 | 85 | 0.513503 | [
"MIT"
] | antoniovelev/Softuni | C#/Entity Framework/01. Model Definition_Skeleton and Datasets/SoftJail/Data/SoftJailDbContext.cs | 2,520 | C# |
using System;
namespace Dracoon.Sdk.SdkInternal {
internal class EmptyLog : ILog {
public void Debug(string tag, string message) {
// Default: Log nothing
}
public void Debug(string tag, string message, Exception e) {
// Default: Log nothing
}
public void Error(string tag, string message) {
// Default: Log nothing
}
public void Error(string tag, string message, Exception e) {
// Default: Log nothing
}
public void Info(string tag, string message) {
// Default: Log nothing
}
public void Info(string tag, string message, Exception e) {
// Default: Log nothing
}
public void Warn(string tag, string message) {
// Default: Log nothing
}
public void Warn(string tag, string message, Exception e) {
// Default: Log nothing
}
}
} | 26.135135 | 68 | 0.552223 | [
"Apache-2.0"
] | DAVISOL-GmbH/dracoon-csharp-sdk | DracoonSdk/SdkInternal/EmptyLog.cs | 969 | C# |
// <auto-generated>
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// </auto-generated>
namespace UiPath.Web.Client202010
{
using Microsoft.Rest;
using Models;
using System.Collections;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
/// <summary>
/// Environments operations.
/// </summary>
public partial interface IEnvironments
{
/// <summary>
/// Gets Environments.
/// </summary>
/// <remarks>
/// Client Credentials Flow required permissions: Robots or
/// Robots.Read.
///
/// Required permissions: Environments.View.
/// </remarks>
/// <param name='expand'>
/// Indicates the related entities to be represented inline. The
/// maximum depth is 2.
/// </param>
/// <param name='filter'>
/// Restricts the set of items returned. The maximum number of
/// expressions is 100.
/// </param>
/// <param name='select'>
/// Limits the properties returned in the result.
/// </param>
/// <param name='orderby'>
/// Specifies the order in which items are returned. The maximum number
/// of expressions is 5.
/// </param>
/// <param name='top'>
/// Limits the number of items returned from a collection. The maximum
/// value is 1000.
/// </param>
/// <param name='skip'>
/// Excludes the specified number of items of the queried collection
/// from the result.
/// </param>
/// <param name='count'>
/// Indicates whether the total count of items within a collection are
/// returned in the result.
/// </param>
/// <param name='xUIPATHOrganizationUnitId'>
/// Folder/OrganizationUnit Id
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.HttpOperationException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
/// Thrown when unable to deserialize the response
/// </exception>
Task<HttpOperationResponse<ODataValueOfIEnumerableOfEnvironmentDto>> GetWithHttpMessagesAsync(string expand = default(string), string filter = default(string), string select = default(string), string orderby = default(string), int? top = default(int?), int? skip = default(int?), bool? count = default(bool?), long? xUIPATHOrganizationUnitId = default(long?), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Post new environment
/// </summary>
/// <remarks>
/// Client Credentials Flow required permissions: Robots or
/// Robots.Write.
///
/// Required permissions: Environments.Create.
/// </remarks>
/// <param name='body'>
/// </param>
/// <param name='xUIPATHOrganizationUnitId'>
/// Folder/OrganizationUnit Id
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.HttpOperationException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
/// Thrown when unable to deserialize the response
/// </exception>
Task<HttpOperationResponse<EnvironmentDto>> PostWithHttpMessagesAsync(EnvironmentDto body = default(EnvironmentDto), long? xUIPATHOrganizationUnitId = default(long?), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Gets a single environment.
/// </summary>
/// <remarks>
/// Client Credentials Flow required permissions: Robots or
/// Robots.Read.
///
/// Required permissions: Environments.View.
/// </remarks>
/// <param name='key'>
/// </param>
/// <param name='expand'>
/// Indicates the related entities to be represented inline. The
/// maximum depth is 2.
/// </param>
/// <param name='select'>
/// Limits the properties returned in the result.
/// </param>
/// <param name='xUIPATHOrganizationUnitId'>
/// Folder/OrganizationUnit Id
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.HttpOperationException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
/// Thrown when unable to deserialize the response
/// </exception>
Task<HttpOperationResponse<EnvironmentDto>> GetByIdWithHttpMessagesAsync(long key, string expand = default(string), string select = default(string), long? xUIPATHOrganizationUnitId = default(long?), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Updates an environment.
/// </summary>
/// <remarks>
/// Client Credentials Flow required permissions: Robots or
/// Robots.Write.
///
/// Required permissions: Environments.Edit.
/// </remarks>
/// <param name='key'>
/// </param>
/// <param name='body'>
/// </param>
/// <param name='xUIPATHOrganizationUnitId'>
/// Folder/OrganizationUnit Id
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.HttpOperationException">
/// Thrown when the operation returned an invalid status code
/// </exception>
Task<HttpOperationResponse> PutByIdWithHttpMessagesAsync(long key, EnvironmentDto body = default(EnvironmentDto), long? xUIPATHOrganizationUnitId = default(long?), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Deletes an environment.
/// </summary>
/// <remarks>
/// Client Credentials Flow required permissions: Robots or
/// Robots.Write.
///
/// Required permissions: Environments.Delete.
/// </remarks>
/// <param name='key'>
/// </param>
/// <param name='xUIPATHOrganizationUnitId'>
/// Folder/OrganizationUnit Id
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.HttpOperationException">
/// Thrown when the operation returned an invalid status code
/// </exception>
Task<HttpOperationResponse> DeleteByIdWithHttpMessagesAsync(long key, long? xUIPATHOrganizationUnitId = default(long?), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Associates a robot with the given environment.
/// </summary>
/// <remarks>
/// Client Credentials Flow required permissions: Robots or
/// Robots.Write.
///
/// Required permissions: Environments.Edit.
/// </remarks>
/// <param name='key'>
/// The associated Environment Id.
/// </param>
/// <param name='body'>
/// RobotId - The associated robot Id.
/// </param>
/// <param name='xUIPATHOrganizationUnitId'>
/// Folder/OrganizationUnit Id
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.HttpOperationException">
/// Thrown when the operation returned an invalid status code
/// </exception>
Task<HttpOperationResponse> AddRobotByIdWithHttpMessagesAsync(long key, EnvironmentsAddRobotParameters body = default(EnvironmentsAddRobotParameters), long? xUIPATHOrganizationUnitId = default(long?), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Dissociates a robot from the given environment.
/// </summary>
/// <remarks>
/// Client Credentials Flow required permissions: Robots or
/// Robots.Write.
///
/// Required permissions: Environments.Edit.
/// </remarks>
/// <param name='key'>
/// Given environment's Id.
/// </param>
/// <param name='body'>
/// RobotId - The dissociated robot Id.
/// </param>
/// <param name='xUIPATHOrganizationUnitId'>
/// Folder/OrganizationUnit Id
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.HttpOperationException">
/// Thrown when the operation returned an invalid status code
/// </exception>
Task<HttpOperationResponse> RemoveRobotByIdWithHttpMessagesAsync(long key, EnvironmentsRemoveRobotParameters body = default(EnvironmentsRemoveRobotParameters), long? xUIPATHOrganizationUnitId = default(long?), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Associates a group of robots with and dissociates another group of
/// robots from the given environment.
/// </summary>
/// <remarks>
/// Client Credentials Flow required permissions: Robots or
/// Robots.Write.
///
/// Required permissions: Environments.Edit.
/// </remarks>
/// <param name='key'>
/// The environment id.
/// </param>
/// <param name='body'>
/// <para />addedRobotIds - The id of the robots to be associated
/// with the environment.
/// <para />removedRobotIds - The id of the robots to be
/// dissociated from the environment.
/// </param>
/// <param name='xUIPATHOrganizationUnitId'>
/// Folder/OrganizationUnit Id
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.HttpOperationException">
/// Thrown when the operation returned an invalid status code
/// </exception>
Task<HttpOperationResponse> SetRobotsByIdWithHttpMessagesAsync(long key, EnvironmentsSetRobotsParameters body = default(EnvironmentsSetRobotsParameters), long? xUIPATHOrganizationUnitId = default(long?), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Returns a collection of all the ids of the robots associated to an
/// environment based on environment Id.
/// </summary>
/// <remarks>
/// Client Credentials Flow required permissions: Robots or
/// Robots.Read.
///
/// Required permissions: Environments.View and Robots.View.
/// </remarks>
/// <param name='key'>
/// The Id of the environment for which the robot ids are fetched.
/// </param>
/// <param name='expand'>
/// Indicates the related entities to be represented inline. The
/// maximum depth is 2.
/// </param>
/// <param name='filter'>
/// Restricts the set of items returned. The maximum number of
/// expressions is 100.
/// </param>
/// <param name='select'>
/// Limits the properties returned in the result.
/// </param>
/// <param name='orderby'>
/// Specifies the order in which items are returned. The maximum number
/// of expressions is 5.
/// </param>
/// <param name='count'>
/// Indicates whether the total count of items within a collection are
/// returned in the result.
/// </param>
/// <param name='xUIPATHOrganizationUnitId'>
/// Folder/OrganizationUnit Id
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.HttpOperationException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
/// Thrown when unable to deserialize the response
/// </exception>
Task<HttpOperationResponse<ODataValueOfIEnumerableOfInt64>> GetRobotIdsForEnvironmentByKeyWithHttpMessagesAsync(long key, string expand = default(string), string filter = default(string), string select = default(string), string orderby = default(string), bool? count = default(bool?), long? xUIPATHOrganizationUnitId = default(long?), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Returns a collection of all robots and, if no other sorting is
/// provided, will place first those belonging to the environment.
/// Allows odata query options.
/// </summary>
/// <remarks>
/// Client Credentials Flow required permissions: Robots or
/// Robots.Read.
///
/// Required permissions: Environments.View and Robots.View.
/// </remarks>
/// <param name='key'>
/// The Id of the environment for which the associated robots are
/// placed first.
/// </param>
/// <param name='expand'>
/// Indicates the related entities to be represented inline. The
/// maximum depth is 2.
/// </param>
/// <param name='filter'>
/// Restricts the set of items returned. The maximum number of
/// expressions is 100.
/// </param>
/// <param name='select'>
/// Limits the properties returned in the result.
/// </param>
/// <param name='orderby'>
/// Specifies the order in which items are returned. The maximum number
/// of expressions is 5.
/// </param>
/// <param name='top'>
/// Limits the number of items returned from a collection. The maximum
/// value is 1000.
/// </param>
/// <param name='skip'>
/// Excludes the specified number of items of the queried collection
/// from the result.
/// </param>
/// <param name='count'>
/// Indicates whether the total count of items within a collection are
/// returned in the result.
/// </param>
/// <param name='xUIPATHOrganizationUnitId'>
/// Folder/OrganizationUnit Id
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.HttpOperationException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
/// Thrown when unable to deserialize the response
/// </exception>
Task<HttpOperationResponse<ODataValueOfIEnumerableOfRobotDto>> GetRobotsForEnvironmentByKeyWithHttpMessagesAsync(long key, string expand = default(string), string filter = default(string), string select = default(string), string orderby = default(string), int? top = default(int?), int? skip = default(int?), bool? count = default(bool?), long? xUIPATHOrganizationUnitId = default(long?), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
}
}
| 46.497368 | 518 | 0.603373 | [
"MIT"
] | AFWberlin/orchestrator-powershell | UiPath.Web.Client/generated202010/IEnvironments.cs | 17,669 | C# |
using Newtonsoft.Json;
using System;
using System.Linq;
namespace Ruyi.SDK.Online
{
/// <summary>
/// Allows players to gather together in a party.
/// </summary>
public class RuyiNetPartyService : RuyiNetService
{
/// <summary>
/// Create the Party Service.
/// </summary>
/// <param name="client">The Ruyi Net client.</param>
internal RuyiNetPartyService(RuyiNetClient client)
: base(client)
{
}
/// <summary>
/// Get the current party information for the player.
/// </summary>
/// <param name="index">The index of user.</param>
/// <param name="partyId">The ID of the party.</param>
/// <param name="callback">The function to call when the task completes.</param>
public void GetPartyInfo(int index, string partyId, Action<RuyiNetParty> callback)
{
EnqueueTask(() =>
{
return mClient.BCService.Party_GetPartyInfo(partyId, index);
}, (RuyiNetPartyResponse response) =>
{
if (callback != null)
{
if (response.status == RuyiNetHttpStatus.OK)
{
callback(response.data.party);
}
else
{
callback(null);
}
}
});
}
/// <summary>
/// Invite someone to join a party.
/// </summary>
/// <param name="index">The index of user</param>
/// <param name="playerId">The ID of the player to invite.</param>
/// <param name="callback">The function to call when the task completes.</param>
public void SendPartyInvitation(int index, string playerId, Action<RuyiNetParty> callback)
{
EnqueueTask(() =>
{
return mClient.BCService.Party_SendPartyInvitation(playerId, index);
}, (RuyiNetPartyResponse response) =>
{
if (callback != null)
{
if (response.status == RuyiNetHttpStatus.OK)
{
callback(response.data.party);
}
else
{
callback(null);
}
}
});
}
/// <summary>
/// Accept a party invitation.
/// </summary>
/// <param name="index">The index of user</param>
/// <param name="partyId">The ID of the party to join.</param>
/// <param name="callback">The function to call when the task completes.</param>
public void AcceptPartyInvitation(int index, string partyId, Action<RuyiNetParty> callback)
{
EnqueueTask(() =>
{
return mClient.BCService.Party_AcceptPartyInvitation(partyId, index);
}, (RuyiNetPartyResponse response) =>
{
if (callback != null)
{
if (response.status == RuyiNetHttpStatus.OK)
{
callback(response.data.party);
}
else
{
callback(null);
}
}
});
}
/// <summary>
/// Reject a party invitation.
/// </summary>
/// <param name="index">The index of user</param>
/// <param name="partyId">The ID of the party to reject.</param>
/// <param name="callback">The function to call when the task completes.</param>
public void RejectPartyInvitation(int index, string partyId, Action<RuyiNetParty> callback)
{
EnqueueTask(() =>
{
return mClient.BCService.Party_RejectPartyInvitation(partyId, index);
}, (RuyiNetPartyResponse response) =>
{
if (callback != null)
{
if (response.status == RuyiNetHttpStatus.OK)
{
callback(response.data.party);
}
else
{
callback(null);
}
}
});
}
/// <summary>
/// Join a friend's party.
/// </summary>
/// <param name="index">The index of user</param>
/// <param name="partyId">The ID of the party to join.</param>
/// <param name="callback">The function to call when the task completes.</param>
public void JoinParty(int index, string partyId, Action<RuyiNetParty> callback)
{
EnqueueTask(() =>
{
return mClient.BCService.Party_JoinParty(partyId, index);
}, (RuyiNetPartyResponse response) =>
{
if (callback != null)
{
if (response.status == RuyiNetHttpStatus.OK)
{
callback(response.data.party);
}
else
{
callback(null);
}
}
});
}
/// <summary>
/// Leave a party.
/// </summary>
/// <param name="index">The index of user</param>
/// <param name="partyId">The ID of the party to leave.</param>
/// <param name="callback">The function to call when the task completes.</param>
public void LeaveParty(int index, string partyId, Action<RuyiNetParty> callback)
{
EnqueueTask(() =>
{
return mClient.BCService.Party_LeaveParty(partyId, index);
}, (RuyiNetPartyResponse response) =>
{
if (callback != null)
{
if (response.status == RuyiNetHttpStatus.OK)
{
callback(response.data.party);
}
else
{
callback(null);
}
}
});
}
/// <summary>
/// Get friends' parties.
/// </summary>
/// <param name="index">The index of user</param>
/// <param name="maxResults">The maximum, number of results to return .</param>
/// <param name="callback">The function to call when the task completes.</param>
public void GetFriendsParties(int index, int maxResults, Action<RuyiNetParty[]> callback)
{
EnqueueTask(() =>
{
return mClient.BCService.Party_GetFriendsParties(maxResults, index);
}, (RuyiNetPartyListResponse response) =>
{
if (callback != null)
{
if (response.status == RuyiNetHttpStatus.OK)
{
var results = response.data.parties.Cast<RuyiNetParty>().ToArray();
callback(results);
}
else
{
callback(null);
}
}
});
}
/// <summary>
/// List Party Invitations
/// </summary>
/// <param name="index">The index of user</param>
/// <param name="callback">The function to call when the task completes.</param>
public void ListPartyInvitations(int index, Action<RuyiNetPartyInvitation[]> callback)
{
EnqueueTask(() =>
{
return mClient.BCService.Party_ListPartyInvitations(index);
}, (RuyiNetPartyInvitationResponse response) =>
{
if (callback != null)
{
if (response.status == RuyiNetHttpStatus.OK)
{
var results = response.data.invites.Cast<RuyiNetPartyInvitation>().ToArray();
callback(results);
}
else
{
callback(null);
}
}
});
}
/// <summary>
/// Returns the party the current player is a member of, if any.
/// </summary>
/// <param name="index">The index of user</param>
/// <param name="callback">The function to call when the task completes.</param>
public void GetMyParty(int index, Action<RuyiNetParty> callback)
{
EnqueueTask(() =>
{
return mClient.BCService.Party_GetMyParty(index);
}, (RuyiNetPartyResponse response) =>
{
if (callback != null)
{
if (response.status == RuyiNetHttpStatus.OK)
{
callback(response.data.party);
}
else
{
callback(null);
}
}
});
}
}
} | 35.136364 | 101 | 0.449547 | [
"MIT"
] | c04x/sdk | RuyiSDK/RuyiNet/Service/Party/RuyiNetPartyService.cs | 9,278 | C# |
using Castle.MicroKernel.Registration;
using Castle.MicroKernel.SubSystems.Configuration;
using Castle.Windsor;
using NHibernate;
namespace Abp.Domain.Repositories.NHibernate
{
internal class NhRepositoryInstaller : IWindsorInstaller
{
private readonly ISessionFactory _sessionFactory;
public NhRepositoryInstaller(ISessionFactory sessionFactory)
{
_sessionFactory = sessionFactory;
}
public void Install(IWindsorContainer container, IConfigurationStore store)
{
container.Register(
//Nhibernate session factory
Component.For<ISessionFactory>().UsingFactoryMethod(() => _sessionFactory).LifeStyle.Singleton//,
//TODO: Implement and test it!
//Generic repositories (So, user can directly inject a IRepository<TEntity> or IRepository<TEntity,TPrimaryKey>) without defining a class for it.
//Component.For(typeof (IRepository<>), typeof (NhRepositoryBase<>)).ImplementedBy(typeof (NhRepositoryBase<>)).LifestyleTransient(),
//Component.For(typeof (IRepository<,>), typeof (NhRepositoryBase<,>)).ImplementedBy(typeof (NhRepositoryBase<,>)).LifestyleTransient()
);
}
}
}
| 38.69697 | 161 | 0.678935 | [
"MIT"
] | jfvaleroso/ASPNETBOILERPLATE-TEST | src/Abp/Framework/Abp.Infrastructure.NHibernate/Domain/Repositories/NHibernate/NhRepositoryInstaller.cs | 1,279 | C# |
using System;
using System.IO;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media.Effects;
using AuroraGUI.DnsSvr;
using AuroraGUI.Fx;
using Microsoft.Win32;
namespace AuroraGUI
{
/// <summary>
/// ExpertWindow.xaml 的交互逻辑
/// </summary>
public partial class ExpertWindow
{
public bool OnExpert;
public ExpertWindow()
{
InitializeComponent();
WindowBlur.SetEnabled(this, true);
Snackbar.IsActive = true;
Card.Effect = new BlurEffect() { Radius = 10 , RenderingBias = RenderingBias.Performance };
}
private void SnackbarMessage_OnActionClick(object sender, RoutedEventArgs e)
{
Card.IsEnabled = true;
Snackbar.IsActive = false;
Card.Effect = null;
OnExpert = true;
ChinaList.IsChecked = DnsSettings.ChinaListEnable;
DisabledV4.IsChecked = DnsSettings.Ipv4Disable;
DisabledV6.IsChecked = DnsSettings.Ipv6Disable;
AllowSelfSigned.IsChecked = DnsSettings.AllowSelfSignedCert;
NotAllowAutoRedirect.IsChecked = !DnsSettings.AllowAutoRedirect;
}
private void ReadDoHListButton_OnClick(object sender, RoutedEventArgs e)
{
OpenFileDialog openFileDialog = new OpenFileDialog()
{
Filter = "list files (*.list)|*.list|txt files (*.txt)|*.txt|All files (*.*)|*.*",
RestoreDirectory = true
};
if (openFileDialog.ShowDialog() == true)
{
try
{
if (string.IsNullOrWhiteSpace(File.ReadAllText(openFileDialog.FileName)))
Snackbar.MessageQueue.Enqueue(new TextBlock() { Text = @"Error: 无效的空文件。" });
else
{
File.Copy(openFileDialog.FileName, $"{MainWindow.SetupBasePath}doh.list");
Snackbar.MessageQueue.Enqueue(new TextBlock() { Text = @"导入成功!" });
}
}
catch (Exception ex)
{
MessageBox.Show($"Error: 无法写入文件 {Environment.NewLine}Original error: " + ex.Message);
}
}
}
private void ReadDNSListButton_OnClick(object sender, RoutedEventArgs e)
{
OpenFileDialog openFileDialog = new OpenFileDialog()
{
Filter = "list files (*.list)|*.list|txt files (*.txt)|*.txt|All files (*.*)|*.*",
RestoreDirectory = true
};
if (openFileDialog.ShowDialog() != true) return;
try
{
if (string.IsNullOrWhiteSpace(File.ReadAllText(openFileDialog.FileName)))
Snackbar.MessageQueue.Enqueue(new TextBlock() { Text = @"Error: 无效的空文件。" });
else
{
File.Copy(openFileDialog.FileName, $"{MainWindow.SetupBasePath}dns.list");
Snackbar.MessageQueue.Enqueue(new TextBlock() { Text = @"导入成功!" });
}
}
catch (Exception ex)
{
MessageBox.Show($"Error: 无法写入文件 {Environment.NewLine}Original error: " + ex.Message);
}
}
private void ReadChinaListButton_OnClick(object sender, RoutedEventArgs e)
{
OpenFileDialog openFileDialog = new OpenFileDialog()
{
Filter = "list files (*.list)|*.list|txt files (*.txt)|*.txt|All files (*.*)|*.*",
RestoreDirectory = true
};
if (openFileDialog.ShowDialog() != true) return;
try
{
if (string.IsNullOrWhiteSpace(File.ReadAllText(openFileDialog.FileName)))
Snackbar.MessageQueue.Enqueue(new TextBlock() { Text = @"Error: 无效的空文件。" });
else
{
File.Copy(openFileDialog.FileName, $"{MainWindow.SetupBasePath}china.list");
Snackbar.MessageQueue.Enqueue(new TextBlock() { Text = @"导入成功!" });
}
}
catch (Exception ex)
{
MessageBox.Show($"Error: 无法写入文件 {Environment.NewLine}Original error: " + ex.Message);
}
}
private void DisabledV4_OnClick(object sender, RoutedEventArgs e)
{
if (DisabledV4.IsChecked == null) return;
DnsSettings.Ipv4Disable = DisabledV4.IsChecked.Value;
if (!DisabledV4.IsChecked.Value) return;
DisabledV6.IsChecked = false;
DnsSettings.Ipv6Disable = false;
}
private void DisabledV6_OnClick(object sender, RoutedEventArgs e)
{
if (DisabledV6.IsChecked == null) return;
DnsSettings.Ipv6Disable = DisabledV6.IsChecked.Value;
if (!DisabledV6.IsChecked.Value) return;
DisabledV4.IsChecked = false;
DnsSettings.Ipv4Disable = false;
}
private void ChinaList_OnClick(object sender, RoutedEventArgs e)
{
if (ChinaList.IsChecked == null) return;
DnsSettings.ChinaListEnable = ChinaList.IsChecked.Value;
}
private void AllowSelfSigned_OnClick(object sender, RoutedEventArgs e)
{
if (AllowSelfSigned.IsChecked == null) return;
DnsSettings.AllowSelfSignedCert = AllowSelfSigned.IsChecked.Value;
}
private void NotAllowAutoRedirect_OnClick(object sender, RoutedEventArgs e)
{
if (NotAllowAutoRedirect.IsChecked == null) return;
DnsSettings.AllowAutoRedirect = !NotAllowAutoRedirect.IsChecked.Value;
}
}
}
| 36.961783 | 105 | 0.557643 | [
"MIT"
] | Champagne0418/AuroraDNS.GUI | AuroraGUI/Forms/ExpertWindow.xaml.cs | 5,917 | C# |
using System.Windows;
using E3Series.Wrapper.SelectionDialog.WPF.Views.Interfaces;
namespace E3Series.Wrapper.Demo.Views
{
/// <inheritdoc cref="IDialogView" />
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : IDialogView
{
public MainWindow()
{
InitializeComponent();
}
private void Window_Closed(object sender, System.EventArgs e)
{
Application.Current.Shutdown();
}
}
}
| 23.130435 | 69 | 0.616541 | [
"MIT"
] | alex-buraykin/E3Series.Wrapper | E3Series.Wrapper.Demo/Views/MainWindow.xaml.cs | 534 | C# |
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Diagnostics;
namespace Xunit.Analyzers
{
public class TestMethodCannotHaveOverloadsTests
{
readonly DiagnosticAnalyzer analyzer = new TestMethodCannotHaveOverloads();
[Fact]
public async void FindsErrors_ForInstanceMethodOverloads_InSameInstanceClass()
{
var diagnostics = await CodeAnalyzerHelper.GetDiagnosticsAsync(analyzer,
"public class TestClass { " +
" [Xunit.Fact]" +
" public void TestMethod() { }" +
" [Xunit.Theory]" +
" public void TestMethod(int a) { }" +
"}");
Assert.Collection(diagnostics,
d => VerifyDiagnostic(d, "TestClass"),
d => VerifyDiagnostic(d, "TestClass"));
}
[Fact]
public async void FindsErrors_ForStaticMethodOverloads_InSameStaticClass()
{
var diagnostics = await CodeAnalyzerHelper.GetDiagnosticsAsync(analyzer,
"public static class TestClass { " +
" [Xunit.Fact]" +
" public static void TestMethod() { }" +
" [Xunit.Theory]" +
" public static void TestMethod(int a) { }" +
"}");
Assert.Collection(diagnostics,
d => VerifyDiagnostic(d, "TestClass"),
d => VerifyDiagnostic(d, "TestClass"));
}
[Fact]
public async void FindsErrors_ForInstanceMethodOverload_InDerivedClass()
{
var diagnostics = await CodeAnalyzerHelper.GetDiagnosticsAsync(analyzer,
"public class BaseClass {" +
" [Xunit.Fact]" +
" public void TestMethod() { }" +
"}",
"public class TestClass : BaseClass {" +
" [Xunit.Theory]" +
" public void TestMethod(int a) { }" +
" private void TestMethod(int a, byte c) { }" +
"}");
Assert.Collection(diagnostics,
d => VerifyDiagnostic(d, "BaseClass"),
d => VerifyDiagnostic(d, "BaseClass"));
}
[Fact]
public async void FindsError_ForStaticAndInstanceMethodOverload()
{
var diagnostics = await CodeAnalyzerHelper.GetDiagnosticsAsync(analyzer,
"public class BaseClass {" +
" [Xunit.Fact]" +
" public static void TestMethod() { }" +
"}",
"public class TestClass : BaseClass {" +
" [Xunit.Theory]" +
" public void TestMethod(int a) { }" +
"}");
Assert.Collection(diagnostics,
d => VerifyDiagnostic(d, "BaseClass"));
}
[Fact]
public async void DoesNotFindError_ForMethodOverrides()
{
var diagnostics = await CodeAnalyzerHelper.GetDiagnosticsAsync(analyzer,
"public class BaseClass {" +
" [Xunit.Fact]" +
" public virtual void TestMethod() { }" +
"}",
"public class TestClass : BaseClass {" +
" [Xunit.Fact]" +
" public override void TestMethod() { }" +
"}");
Assert.Empty(diagnostics);
}
private static void VerifyDiagnostic(Diagnostic d, string otherType)
{
Assert.Equal($"Test method 'TestMethod' on test class 'TestClass' has the same name as another method declared on class '{otherType}'.", d.GetMessage());
Assert.Equal("xUnit1024", d.Descriptor.Id);
Assert.Equal(DiagnosticSeverity.Error, d.Severity);
}
}
}
| 37.5 | 165 | 0.521569 | [
"Apache-2.0"
] | TylerLeonhardt/xunit.analyzers | test/xunit.analyzers.tests/TestMethodCannotHaveOverloadsTests.cs | 3,827 | 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("P04.Shellbound")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("P04.Shellbound")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("3c51a105-7870-4165-be21-b0a28a6e1eaa")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| 37.72973 | 84 | 0.747135 | [
"MIT"
] | ViktorAleksandrov/SoftUni--Technology-Fundamentals | Programming Fundamentals - Extended/L09.2. Nested Dictionaries - Exercises/P04.Shellbound/Properties/AssemblyInfo.cs | 1,399 | C# |
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
namespace EVEStandard.Models
{
public class SovereigntyCampaign : ModelBase<SovereigntyCampaign>
{
#region Enums
/// <summary>
/// Type of event this campaign is for. tcu_defense, ihub_defense and station_defense are referred to as \"Defense Events\", station_freeport as \"Freeport Events\".
/// </summary>
/// <value>Type of event this campaign is for. tcu_defense, ihub_defense and station_defense are referred to as \"Defense Events\", station_freeport as \"Freeport Events\". </value>
public enum EventTypeEnum
{
tcu_defense = 1,
ihub_defense = 2,
station_defense = 3,
station_freeport = 4
}
#endregion Enums
#region Properties
/// <summary>
/// Score for all attacking parties, only present in Defense Events.
/// </summary>
/// <value>Score for all attacking parties, only present in Defense Events. </value>
[JsonProperty("attackers_score")]
public float? AttackersScore { get; set; }
/// <summary>
/// Unique ID for this campaign.
/// </summary>
/// <value>Unique ID for this campaign.</value>
[JsonProperty("campaign_id")]
public int CampaignId { get; set; }
/// <summary>
/// The constellation in which the campaign will take place.
/// </summary>
/// <value>The constellation in which the campaign will take place. </value>
[JsonProperty("constellation_id")]
public int ConstellationId { get; set; }
/// <summary>
/// Defending alliance, only present in Defense Events
/// </summary>
/// <value>Defending alliance, only present in Defense Events </value>
[JsonProperty("defender_id")]
public int? DefenderId { get; set; }
/// <summary>
/// Score for the defending alliance, only present in Defense Events.
/// </summary>
/// <value>Score for the defending alliance, only present in Defense Events. </value>
[JsonProperty("defender_score")]
public float? DefenderScore { get; set; }
/// <summary>
/// Type of event this campaign is for. tcu_defense, ihub_defense and station_defense are referred to as \"Defense Events\", station_freeport as \"Freeport Events\".
/// </summary>
/// <value>Type of event this campaign is for. tcu_defense, ihub_defense and station_defense are referred to as \"Defense Events\", station_freeport as \"Freeport Events\". </value>
[JsonProperty("event_type")]
public EventTypeEnum EventType { get; set; }
/// <summary>
/// Alliance participating and their respective scores, only present in Freeport Events.
/// </summary>
/// <value>Alliance participating and their respective scores, only present in Freeport Events. </value>
[JsonProperty("participants")]
public List<SovereigntyCampaignsParticipant> Participants { get; set; }
/// <summary>
/// The solar system the structure is located in.
/// </summary>
/// <value>The solar system the structure is located in. </value>
[JsonProperty("solar_system_id")]
public int SolarSystemId { get; set; }
/// <summary>
/// Time the event is scheduled to start.
/// </summary>
/// <value>Time the event is scheduled to start. </value>
[JsonProperty("start_time")]
public DateTime StartTime { get; set; }
/// <summary>
/// The structure item ID that is related to this campaign.
/// </summary>
/// <value>The structure item ID that is related to this campaign. </value>
[JsonProperty("structure_id")]
public long StructureId { get; set; }
#endregion Properties
}
public class SovereigntyCampaignsParticipant : ModelBase<SovereigntyCampaignsParticipant>
{
#region Properties
/// <summary>
/// alliance_id integer
/// </summary>
/// <value>alliance_id integer</value>
[JsonProperty("alliance_id")]
public int? AllianceId { get; set; }
/// <summary>
/// score number
/// </summary>
/// <value>score number</value>
[JsonProperty("score")]
public float? Score { get; set; }
#endregion Properties
}
}
| 37.768595 | 209 | 0.607877 | [
"MIT"
] | Kolomona/REvernus | EVEStandard/Models/SovereigntyCampaign.cs | 4,572 | C# |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.