content stringlengths 5 1.04M | avg_line_length float64 1.75 12.9k | max_line_length int64 2 244k | alphanum_fraction float64 0 0.98 | licenses list | repository_name stringlengths 7 92 | path stringlengths 3 249 | size int64 5 1.04M | lang stringclasses 2 values |
|---|---|---|---|---|---|---|---|---|
using Breeze.Sharp;
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace GSA.Samples.Northwind.OData.Models
{
public class Product : BaseEntity
{
public Guid ID { get { return GetValue<Guid>(); } set { SetValue(value); } }
public string ProductName { get { return GetValue<string>(); } set { SetValue(value); } }
public decimal UnitPrice { get { return GetValue<decimal>(); } set { SetValue(value); } }
public bool Discontinued { get { return GetValue<bool>(); } set { SetValue(value); } }
}
} | 32.157895 | 97 | 0.674304 | [
"MIT"
] | JCallico/Northwind-OData | Northwind Breeze Client/Models/Product.cs | 613 | C# |
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/devtools/artifactregistry/v1/artifact.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Google.Cloud.ArtifactRegistry.V1 {
/// <summary>Holder for reflection information generated from google/devtools/artifactregistry/v1/artifact.proto</summary>
public static partial class ArtifactReflection {
#region Descriptor
/// <summary>File descriptor for google/devtools/artifactregistry/v1/artifact.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static ArtifactReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CjJnb29nbGUvZGV2dG9vbHMvYXJ0aWZhY3RyZWdpc3RyeS92MS9hcnRpZmFj",
"dC5wcm90bxIjZ29vZ2xlLmRldnRvb2xzLmFydGlmYWN0cmVnaXN0cnkudjEa",
"H2dvb2dsZS9hcGkvZmllbGRfYmVoYXZpb3IucHJvdG8aGWdvb2dsZS9hcGkv",
"cmVzb3VyY2UucHJvdG8aH2dvb2dsZS9wcm90b2J1Zi90aW1lc3RhbXAucHJv",
"dG8aHGdvb2dsZS9hcGkvYW5ub3RhdGlvbnMucHJvdG8i4gIKC0RvY2tlcklt",
"YWdlEhEKBG5hbWUYASABKAlCA+BBAhIQCgN1cmkYAiABKAlCA+BBAhIMCgR0",
"YWdzGAMgAygJEhgKEGltYWdlX3NpemVfYnl0ZXMYBCABKAMSLwoLdXBsb2Fk",
"X3RpbWUYBSABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEhIKCm1l",
"ZGlhX3R5cGUYBiABKAkSLgoKYnVpbGRfdGltZRgHIAEoCzIaLmdvb2dsZS5w",
"cm90b2J1Zi5UaW1lc3RhbXA6kAHqQYwBCithcnRpZmFjdHJlZ2lzdHJ5Lmdv",
"b2dsZWFwaXMuY29tL0RvY2tlckltYWdlEl1wcm9qZWN0cy97cHJvamVjdH0v",
"bG9jYXRpb25zL3tsb2NhdGlvbn0vcmVwb3NpdG9yaWVzL3tyZXBvc2l0b3J5",
"fS9kb2NrZXJJbWFnZXMve2RvY2tlcl9pbWFnZX0iVQoXTGlzdERvY2tlcklt",
"YWdlc1JlcXVlc3QSEwoGcGFyZW50GAEgASgJQgPgQQISEQoJcGFnZV9zaXpl",
"GAIgASgFEhIKCnBhZ2VfdG9rZW4YAyABKAkifAoYTGlzdERvY2tlckltYWdl",
"c1Jlc3BvbnNlEkcKDWRvY2tlcl9pbWFnZXMYASADKAsyMC5nb29nbGUuZGV2",
"dG9vbHMuYXJ0aWZhY3RyZWdpc3RyeS52MS5Eb2NrZXJJbWFnZRIXCg9uZXh0",
"X3BhZ2VfdG9rZW4YAiABKAlC+wEKJ2NvbS5nb29nbGUuZGV2dG9vbHMuYXJ0",
"aWZhY3RyZWdpc3RyeS52MUINQXJ0aWZhY3RQcm90b1ABWlNnb29nbGUuZ29s",
"YW5nLm9yZy9nZW5wcm90by9nb29nbGVhcGlzL2RldnRvb2xzL2FydGlmYWN0",
"cmVnaXN0cnkvdjE7YXJ0aWZhY3RyZWdpc3RyeaoCIEdvb2dsZS5DbG91ZC5B",
"cnRpZmFjdFJlZ2lzdHJ5LlYxygIgR29vZ2xlXENsb3VkXEFydGlmYWN0UmVn",
"aXN0cnlcVjHqAiNHb29nbGU6OkNsb3VkOjpBcnRpZmFjdFJlZ2lzdHJ5OjpW",
"MWIGcHJvdG8z"));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Google.Api.FieldBehaviorReflection.Descriptor, global::Google.Api.ResourceReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.TimestampReflection.Descriptor, global::Google.Api.AnnotationsReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.ArtifactRegistry.V1.DockerImage), global::Google.Cloud.ArtifactRegistry.V1.DockerImage.Parser, new[]{ "Name", "Uri", "Tags", "ImageSizeBytes", "UploadTime", "MediaType", "BuildTime" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.ArtifactRegistry.V1.ListDockerImagesRequest), global::Google.Cloud.ArtifactRegistry.V1.ListDockerImagesRequest.Parser, new[]{ "Parent", "PageSize", "PageToken" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.ArtifactRegistry.V1.ListDockerImagesResponse), global::Google.Cloud.ArtifactRegistry.V1.ListDockerImagesResponse.Parser, new[]{ "DockerImages", "NextPageToken" }, null, null, null, null)
}));
}
#endregion
}
#region Messages
/// <summary>
/// DockerImage represents a docker artifact.
/// The following fields are returned as untyped metadata in the Version
/// resource, using camelcase keys (i.e. metadata.imageSizeBytes):
/// * imageSizeBytes
/// * mediaType
/// * buildTime
/// </summary>
public sealed partial class DockerImage : pb::IMessage<DockerImage>
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
, pb::IBufferMessage
#endif
{
private static readonly pb::MessageParser<DockerImage> _parser = new pb::MessageParser<DockerImage>(() => new DockerImage());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pb::MessageParser<DockerImage> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pbr::MessageDescriptor Descriptor {
get { return global::Google.Cloud.ArtifactRegistry.V1.ArtifactReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public DockerImage() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public DockerImage(DockerImage other) : this() {
name_ = other.name_;
uri_ = other.uri_;
tags_ = other.tags_.Clone();
imageSizeBytes_ = other.imageSizeBytes_;
uploadTime_ = other.uploadTime_ != null ? other.uploadTime_.Clone() : null;
mediaType_ = other.mediaType_;
buildTime_ = other.buildTime_ != null ? other.buildTime_.Clone() : null;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public DockerImage Clone() {
return new DockerImage(this);
}
/// <summary>Field number for the "name" field.</summary>
public const int NameFieldNumber = 1;
private string name_ = "";
/// <summary>
/// Required. registry_location, project_id, repository_name and image id forms a unique
/// image
/// name:`projects/<project_id>/locations/<location>/repository/<repository_name>/dockerImages/<docker_image>`.
/// For example,
/// "projects/test-project/locations/us-west4/repositories/test-repo/dockerImages/
/// nginx@sha256:e9954c1fc875017be1c3e36eca16be2d9e9bccc4bf072163515467d6a823c7cf",
/// where "us-west4" is the registry_location, "test-project" is the
/// project_id, "test-repo" is the repository_name and
/// "nginx@sha256:e9954c1fc875017be1c3e36eca16be2d9e9bccc4bf072163515467d6a823c7cf"
/// is the image's digest.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string Name {
get { return name_; }
set {
name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "uri" field.</summary>
public const int UriFieldNumber = 2;
private string uri_ = "";
/// <summary>
/// Required. URL to access the image.
/// Example:
/// us-west4-docker.pkg.dev/test-project/test-repo/nginx@sha256:e9954c1fc875017be1c3e36eca16be2d9e9bccc4bf072163515467d6a823c7cf
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string Uri {
get { return uri_; }
set {
uri_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "tags" field.</summary>
public const int TagsFieldNumber = 3;
private static readonly pb::FieldCodec<string> _repeated_tags_codec
= pb::FieldCodec.ForString(26);
private readonly pbc::RepeatedField<string> tags_ = new pbc::RepeatedField<string>();
/// <summary>
/// Tags attached to this image.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public pbc::RepeatedField<string> Tags {
get { return tags_; }
}
/// <summary>Field number for the "image_size_bytes" field.</summary>
public const int ImageSizeBytesFieldNumber = 4;
private long imageSizeBytes_;
/// <summary>
/// Calculated size of the image.
/// This field is returned as the 'metadata.imageSizeBytes' field in the
/// Version resource.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public long ImageSizeBytes {
get { return imageSizeBytes_; }
set {
imageSizeBytes_ = value;
}
}
/// <summary>Field number for the "upload_time" field.</summary>
public const int UploadTimeFieldNumber = 5;
private global::Google.Protobuf.WellKnownTypes.Timestamp uploadTime_;
/// <summary>
/// Time the image was uploaded.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public global::Google.Protobuf.WellKnownTypes.Timestamp UploadTime {
get { return uploadTime_; }
set {
uploadTime_ = value;
}
}
/// <summary>Field number for the "media_type" field.</summary>
public const int MediaTypeFieldNumber = 6;
private string mediaType_ = "";
/// <summary>
/// Media type of this image, e.g.
/// "application/vnd.docker.distribution.manifest.v2+json".
/// This field is returned as the 'metadata.mediaType' field in the
/// Version resource.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string MediaType {
get { return mediaType_; }
set {
mediaType_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "build_time" field.</summary>
public const int BuildTimeFieldNumber = 7;
private global::Google.Protobuf.WellKnownTypes.Timestamp buildTime_;
/// <summary>
/// The time this image was built.
/// This field is returned as the 'metadata.buildTime' field in the
/// Version resource.
/// The build time is returned to the client as an RFC 3339 string, which can
/// be easily used with the JavaScript Date constructor.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public global::Google.Protobuf.WellKnownTypes.Timestamp BuildTime {
get { return buildTime_; }
set {
buildTime_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override bool Equals(object other) {
return Equals(other as DockerImage);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public bool Equals(DockerImage other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Name != other.Name) return false;
if (Uri != other.Uri) return false;
if(!tags_.Equals(other.tags_)) return false;
if (ImageSizeBytes != other.ImageSizeBytes) return false;
if (!object.Equals(UploadTime, other.UploadTime)) return false;
if (MediaType != other.MediaType) return false;
if (!object.Equals(BuildTime, other.BuildTime)) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override int GetHashCode() {
int hash = 1;
if (Name.Length != 0) hash ^= Name.GetHashCode();
if (Uri.Length != 0) hash ^= Uri.GetHashCode();
hash ^= tags_.GetHashCode();
if (ImageSizeBytes != 0L) hash ^= ImageSizeBytes.GetHashCode();
if (uploadTime_ != null) hash ^= UploadTime.GetHashCode();
if (MediaType.Length != 0) hash ^= MediaType.GetHashCode();
if (buildTime_ != null) hash ^= BuildTime.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void WriteTo(pb::CodedOutputStream output) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
output.WriteRawMessage(this);
#else
if (Name.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Name);
}
if (Uri.Length != 0) {
output.WriteRawTag(18);
output.WriteString(Uri);
}
tags_.WriteTo(output, _repeated_tags_codec);
if (ImageSizeBytes != 0L) {
output.WriteRawTag(32);
output.WriteInt64(ImageSizeBytes);
}
if (uploadTime_ != null) {
output.WriteRawTag(42);
output.WriteMessage(UploadTime);
}
if (MediaType.Length != 0) {
output.WriteRawTag(50);
output.WriteString(MediaType);
}
if (buildTime_ != null) {
output.WriteRawTag(58);
output.WriteMessage(BuildTime);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
#endif
}
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
if (Name.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Name);
}
if (Uri.Length != 0) {
output.WriteRawTag(18);
output.WriteString(Uri);
}
tags_.WriteTo(ref output, _repeated_tags_codec);
if (ImageSizeBytes != 0L) {
output.WriteRawTag(32);
output.WriteInt64(ImageSizeBytes);
}
if (uploadTime_ != null) {
output.WriteRawTag(42);
output.WriteMessage(UploadTime);
}
if (MediaType.Length != 0) {
output.WriteRawTag(50);
output.WriteString(MediaType);
}
if (buildTime_ != null) {
output.WriteRawTag(58);
output.WriteMessage(BuildTime);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
}
#endif
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CalculateSize() {
int size = 0;
if (Name.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
}
if (Uri.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Uri);
}
size += tags_.CalculateSize(_repeated_tags_codec);
if (ImageSizeBytes != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(ImageSizeBytes);
}
if (uploadTime_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(UploadTime);
}
if (MediaType.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(MediaType);
}
if (buildTime_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(BuildTime);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(DockerImage other) {
if (other == null) {
return;
}
if (other.Name.Length != 0) {
Name = other.Name;
}
if (other.Uri.Length != 0) {
Uri = other.Uri;
}
tags_.Add(other.tags_);
if (other.ImageSizeBytes != 0L) {
ImageSizeBytes = other.ImageSizeBytes;
}
if (other.uploadTime_ != null) {
if (uploadTime_ == null) {
UploadTime = new global::Google.Protobuf.WellKnownTypes.Timestamp();
}
UploadTime.MergeFrom(other.UploadTime);
}
if (other.MediaType.Length != 0) {
MediaType = other.MediaType;
}
if (other.buildTime_ != null) {
if (buildTime_ == null) {
BuildTime = new global::Google.Protobuf.WellKnownTypes.Timestamp();
}
BuildTime.MergeFrom(other.BuildTime);
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(pb::CodedInputStream input) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
input.ReadRawMessage(this);
#else
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
Name = input.ReadString();
break;
}
case 18: {
Uri = input.ReadString();
break;
}
case 26: {
tags_.AddEntriesFrom(input, _repeated_tags_codec);
break;
}
case 32: {
ImageSizeBytes = input.ReadInt64();
break;
}
case 42: {
if (uploadTime_ == null) {
UploadTime = new global::Google.Protobuf.WellKnownTypes.Timestamp();
}
input.ReadMessage(UploadTime);
break;
}
case 50: {
MediaType = input.ReadString();
break;
}
case 58: {
if (buildTime_ == null) {
BuildTime = new global::Google.Protobuf.WellKnownTypes.Timestamp();
}
input.ReadMessage(BuildTime);
break;
}
}
}
#endif
}
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 10: {
Name = input.ReadString();
break;
}
case 18: {
Uri = input.ReadString();
break;
}
case 26: {
tags_.AddEntriesFrom(ref input, _repeated_tags_codec);
break;
}
case 32: {
ImageSizeBytes = input.ReadInt64();
break;
}
case 42: {
if (uploadTime_ == null) {
UploadTime = new global::Google.Protobuf.WellKnownTypes.Timestamp();
}
input.ReadMessage(UploadTime);
break;
}
case 50: {
MediaType = input.ReadString();
break;
}
case 58: {
if (buildTime_ == null) {
BuildTime = new global::Google.Protobuf.WellKnownTypes.Timestamp();
}
input.ReadMessage(BuildTime);
break;
}
}
}
}
#endif
}
/// <summary>
/// The request to list docker images.
/// </summary>
public sealed partial class ListDockerImagesRequest : pb::IMessage<ListDockerImagesRequest>
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
, pb::IBufferMessage
#endif
{
private static readonly pb::MessageParser<ListDockerImagesRequest> _parser = new pb::MessageParser<ListDockerImagesRequest>(() => new ListDockerImagesRequest());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pb::MessageParser<ListDockerImagesRequest> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pbr::MessageDescriptor Descriptor {
get { return global::Google.Cloud.ArtifactRegistry.V1.ArtifactReflection.Descriptor.MessageTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public ListDockerImagesRequest() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public ListDockerImagesRequest(ListDockerImagesRequest other) : this() {
parent_ = other.parent_;
pageSize_ = other.pageSize_;
pageToken_ = other.pageToken_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public ListDockerImagesRequest Clone() {
return new ListDockerImagesRequest(this);
}
/// <summary>Field number for the "parent" field.</summary>
public const int ParentFieldNumber = 1;
private string parent_ = "";
/// <summary>
/// Required. The name of the parent resource whose docker images will be listed.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string Parent {
get { return parent_; }
set {
parent_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "page_size" field.</summary>
public const int PageSizeFieldNumber = 2;
private int pageSize_;
/// <summary>
/// The maximum number of artifacts to return.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int PageSize {
get { return pageSize_; }
set {
pageSize_ = value;
}
}
/// <summary>Field number for the "page_token" field.</summary>
public const int PageTokenFieldNumber = 3;
private string pageToken_ = "";
/// <summary>
/// The next_page_token value returned from a previous list request, if any.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string PageToken {
get { return pageToken_; }
set {
pageToken_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override bool Equals(object other) {
return Equals(other as ListDockerImagesRequest);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public bool Equals(ListDockerImagesRequest other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Parent != other.Parent) return false;
if (PageSize != other.PageSize) return false;
if (PageToken != other.PageToken) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override int GetHashCode() {
int hash = 1;
if (Parent.Length != 0) hash ^= Parent.GetHashCode();
if (PageSize != 0) hash ^= PageSize.GetHashCode();
if (PageToken.Length != 0) hash ^= PageToken.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void WriteTo(pb::CodedOutputStream output) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
output.WriteRawMessage(this);
#else
if (Parent.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Parent);
}
if (PageSize != 0) {
output.WriteRawTag(16);
output.WriteInt32(PageSize);
}
if (PageToken.Length != 0) {
output.WriteRawTag(26);
output.WriteString(PageToken);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
#endif
}
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
if (Parent.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Parent);
}
if (PageSize != 0) {
output.WriteRawTag(16);
output.WriteInt32(PageSize);
}
if (PageToken.Length != 0) {
output.WriteRawTag(26);
output.WriteString(PageToken);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
}
#endif
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CalculateSize() {
int size = 0;
if (Parent.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Parent);
}
if (PageSize != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(PageSize);
}
if (PageToken.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(PageToken);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(ListDockerImagesRequest other) {
if (other == null) {
return;
}
if (other.Parent.Length != 0) {
Parent = other.Parent;
}
if (other.PageSize != 0) {
PageSize = other.PageSize;
}
if (other.PageToken.Length != 0) {
PageToken = other.PageToken;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(pb::CodedInputStream input) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
input.ReadRawMessage(this);
#else
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
Parent = input.ReadString();
break;
}
case 16: {
PageSize = input.ReadInt32();
break;
}
case 26: {
PageToken = input.ReadString();
break;
}
}
}
#endif
}
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 10: {
Parent = input.ReadString();
break;
}
case 16: {
PageSize = input.ReadInt32();
break;
}
case 26: {
PageToken = input.ReadString();
break;
}
}
}
}
#endif
}
/// <summary>
/// The response from listing docker images.
/// </summary>
public sealed partial class ListDockerImagesResponse : pb::IMessage<ListDockerImagesResponse>
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
, pb::IBufferMessage
#endif
{
private static readonly pb::MessageParser<ListDockerImagesResponse> _parser = new pb::MessageParser<ListDockerImagesResponse>(() => new ListDockerImagesResponse());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pb::MessageParser<ListDockerImagesResponse> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pbr::MessageDescriptor Descriptor {
get { return global::Google.Cloud.ArtifactRegistry.V1.ArtifactReflection.Descriptor.MessageTypes[2]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public ListDockerImagesResponse() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public ListDockerImagesResponse(ListDockerImagesResponse other) : this() {
dockerImages_ = other.dockerImages_.Clone();
nextPageToken_ = other.nextPageToken_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public ListDockerImagesResponse Clone() {
return new ListDockerImagesResponse(this);
}
/// <summary>Field number for the "docker_images" field.</summary>
public const int DockerImagesFieldNumber = 1;
private static readonly pb::FieldCodec<global::Google.Cloud.ArtifactRegistry.V1.DockerImage> _repeated_dockerImages_codec
= pb::FieldCodec.ForMessage(10, global::Google.Cloud.ArtifactRegistry.V1.DockerImage.Parser);
private readonly pbc::RepeatedField<global::Google.Cloud.ArtifactRegistry.V1.DockerImage> dockerImages_ = new pbc::RepeatedField<global::Google.Cloud.ArtifactRegistry.V1.DockerImage>();
/// <summary>
/// The docker images returned.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public pbc::RepeatedField<global::Google.Cloud.ArtifactRegistry.V1.DockerImage> DockerImages {
get { return dockerImages_; }
}
/// <summary>Field number for the "next_page_token" field.</summary>
public const int NextPageTokenFieldNumber = 2;
private string nextPageToken_ = "";
/// <summary>
/// The token to retrieve the next page of artifacts, or empty if there are no
/// more artifacts to return.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string NextPageToken {
get { return nextPageToken_; }
set {
nextPageToken_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override bool Equals(object other) {
return Equals(other as ListDockerImagesResponse);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public bool Equals(ListDockerImagesResponse other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if(!dockerImages_.Equals(other.dockerImages_)) return false;
if (NextPageToken != other.NextPageToken) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override int GetHashCode() {
int hash = 1;
hash ^= dockerImages_.GetHashCode();
if (NextPageToken.Length != 0) hash ^= NextPageToken.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void WriteTo(pb::CodedOutputStream output) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
output.WriteRawMessage(this);
#else
dockerImages_.WriteTo(output, _repeated_dockerImages_codec);
if (NextPageToken.Length != 0) {
output.WriteRawTag(18);
output.WriteString(NextPageToken);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
#endif
}
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
dockerImages_.WriteTo(ref output, _repeated_dockerImages_codec);
if (NextPageToken.Length != 0) {
output.WriteRawTag(18);
output.WriteString(NextPageToken);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
}
#endif
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CalculateSize() {
int size = 0;
size += dockerImages_.CalculateSize(_repeated_dockerImages_codec);
if (NextPageToken.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(NextPageToken);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(ListDockerImagesResponse other) {
if (other == null) {
return;
}
dockerImages_.Add(other.dockerImages_);
if (other.NextPageToken.Length != 0) {
NextPageToken = other.NextPageToken;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(pb::CodedInputStream input) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
input.ReadRawMessage(this);
#else
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
dockerImages_.AddEntriesFrom(input, _repeated_dockerImages_codec);
break;
}
case 18: {
NextPageToken = input.ReadString();
break;
}
}
}
#endif
}
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 10: {
dockerImages_.AddEntriesFrom(ref input, _repeated_dockerImages_codec);
break;
}
case 18: {
NextPageToken = input.ReadString();
break;
}
}
}
}
#endif
}
#endregion
}
#endregion Designer generated code
| 37.489855 | 279 | 0.662028 | [
"Apache-2.0"
] | LaudateCorpus1/google-cloud-dotnet | apis/Google.Cloud.ArtifactRegistry.V1/Google.Cloud.ArtifactRegistry.V1/Artifact.g.cs | 38,802 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using DesperateDevs.CodeGeneration;
using DesperateDevs.CodeGeneration.CodeGenerator;
using DesperateDevs.Serialization;
using DesperateDevs.Utils;
using Entitas.CodeGeneration.Attributes;
namespace Entitas.CodeGeneration.Plugins {
public class ComponentDataProvider : IDataProvider, IConfigurable, ICachable, IDoctor {
public string name { get { return "Component"; } }
public int priority { get { return 0; } }
public bool runInDryMode { get { return true; } }
public Dictionary<string, string> defaultProperties {
get {
var dataProviderProperties = _dataProviders
.OfType<IConfigurable>()
.Select(i => i.defaultProperties)
.ToArray();
return _assembliesConfig.defaultProperties
.Merge(_contextsComponentDataProvider.defaultProperties)
.Merge(_ignoreNamespacesConfig.defaultProperties)
.Merge(dataProviderProperties);
}
}
public Dictionary<string, object> objectCache { get; set; }
readonly CodeGeneratorConfig _codeGeneratorConfig = new CodeGeneratorConfig();
readonly AssembliesConfig _assembliesConfig = new AssembliesConfig();
readonly ContextsComponentDataProvider _contextsComponentDataProvider = new ContextsComponentDataProvider();
readonly IgnoreNamespacesConfig _ignoreNamespacesConfig = new IgnoreNamespacesConfig();
static IComponentDataProvider[] getComponentDataProviders() {
return new IComponentDataProvider[] {
new ComponentTypeComponentDataProvider(),
new MemberDataComponentDataProvider(),
new ContextsComponentDataProvider(),
new IsUniqueComponentDataProvider(),
new FlagPrefixComponentDataProvider(),
new ShouldGenerateComponentComponentDataProvider(),
new ShouldGenerateMethodsComponentDataProvider(),
new ShouldGenerateComponentIndexComponentDataProvider(),
new EventComponentDataProvider()
};
}
readonly Type[] _types;
readonly IComponentDataProvider[] _dataProviders;
public ComponentDataProvider() : this(null) {
}
public ComponentDataProvider(Type[] types) : this(types, getComponentDataProviders()) {
}
protected ComponentDataProvider(Type[] types, IComponentDataProvider[] dataProviders) {
_types = types;
_dataProviders = dataProviders;
}
public void Configure(Preferences preferences) {
_codeGeneratorConfig.Configure(preferences);
_assembliesConfig.Configure(preferences);
foreach (var dataProvider in _dataProviders.OfType<IConfigurable>()) {
dataProvider.Configure(preferences);
}
_contextsComponentDataProvider.Configure(preferences);
_ignoreNamespacesConfig.Configure(preferences);
}
public CodeGeneratorData[] GetData() {
var types = _types ?? PluginUtil
.GetCachedAssemblyResolver(objectCache, _assembliesConfig.assemblies, _codeGeneratorConfig.searchPaths)
.GetTypes();
var dataFromComponents = types
.Where(type => type.ImplementsInterface<IComponent>())
.Where(type => !type.IsAbstract)
.Select(createDataForComponent)
.ToArray();
var dataFromNonComponents = types
.Where(type => !type.ImplementsInterface<IComponent>() && !type.ImplementsInterface<IMessage>())
.Where(type => !type.IsGenericType)
.Where(hasContexts)
.SelectMany(createDataForNonComponent)
.ToArray();
var mergedData = merge(dataFromNonComponents, dataFromComponents);
var dataFromEvents = mergedData
.Where(data => data.IsEvent())
.SelectMany(createDataForEvents)
.ToArray();
return merge(dataFromEvents, mergedData);
}
ComponentData[] merge(ComponentData[] prioData, ComponentData[] redundantData) {
var lookup = prioData.ToLookup(data => data.GetTypeName());
return redundantData
.Where(data => !lookup.Contains(data.GetTypeName()))
.Concat(prioData)
.ToArray();
}
ComponentData createDataForComponent(Type type) {
var data = new ComponentData();
foreach (var provider in _dataProviders) {
provider.Provide(type, data);
}
return data;
}
ComponentData[] createDataForNonComponent(Type type) {
return getComponentNames(type)
.Select(componentName => {
var data = createDataForComponent(type);
data.SetTypeName(componentName.AddComponentSuffix());
data.SetMemberData(new[] {
new MemberData(type.ToCompilableString(), "value")
});
return data;
}).ToArray();
}
ComponentData[] createDataForEvents(ComponentData data) {
return data.GetContextNames()
.SelectMany(contextName =>
data.GetEventData().Select(eventData => {
var dataForEvent = new ComponentData(data);
dataForEvent.IsEvent(false);
dataForEvent.IsUnique(false);
dataForEvent.ShouldGenerateComponent(false);
var eventComponentName = data.EventComponentName(eventData);
var eventTypeSuffix = eventData.GetEventTypeSuffix();
var optionalContextName = dataForEvent.GetContextNames().Length > 1 ? contextName : string.Empty;
var listenerComponentName = optionalContextName + eventComponentName + eventTypeSuffix.AddListenerSuffix();
dataForEvent.SetTypeName(listenerComponentName.AddComponentSuffix());
dataForEvent.SetMemberData(new[] {
new MemberData("System.Collections.Generic.List<I" + listenerComponentName + ">", "value")
});
dataForEvent.SetContextNames(new[] { contextName });
return dataForEvent;
}).ToArray()
).ToArray();
}
bool hasContexts(Type type) {
return _contextsComponentDataProvider.GetContextNames(type).Length != 0;
}
string[] getComponentNames(Type type) {
var attr = Attribute
.GetCustomAttributes(type)
.OfType<ComponentNameAttribute>()
.SingleOrDefault();
if (attr == null) {
return new[] { type.ToCompilableString().ShortTypeName().AddComponentSuffix() };
}
return attr.componentNames;
}
public Diagnosis Diagnose() {
var isStandalone = AppDomain.CurrentDomain
.GetAllTypes()
.Any(type => type.FullName == "DesperateDevs.CodeGeneration.CodeGenerator.CLI.Program");
if (isStandalone) {
var typeName = typeof(ComponentDataProvider).FullName;
if (_codeGeneratorConfig.dataProviders.Contains(typeName)) {
return new Diagnosis(
typeName + " loads and reflects " + string.Join(", ", _assembliesConfig.assemblies) + " and therefore doesn't support server mode!",
"Don't use the code generator in server mode with " + typeName,
DiagnosisSeverity.Hint
);
}
}
return Diagnosis.Healthy;
}
public bool Fix() {
return false;
}
}
}
| 41.291457 | 156 | 0.586589 | [
"MIT"
] | Bruyn/Entitas-CSharp | Addons/Entitas.CodeGeneration.Plugins/Entitas.CodeGeneration.Plugins/Component/DataProviders/ComponentDataProvider.cs | 8,219 | C# |
namespace MediaManager.Media
{
public enum MimeType
{
AudioAiff,
AudioBasic,
AudioMid,
AudioMidi,
AudioMp3,
AudioMpeg,
AudioMpegUrl,
AudioMpg,
AudioWav,
AudioXAiff,
AudioXMid,
AudioXMidi,
AudioXMp3,
AudioXMpeg,
AudioXMpegUrl,
AudioXMpg,
AudioXMsWax,
AudioXMsWma,
AudioXWav,
Unknown,
VideoAvi,
VideoMpeg,
VideoMpg,
VideoMsVideo,
VideoQuicktime,
VideoXMpeg,
VideoXMpeg2A,
VideoXMsAsf,
VideoXMsAsfPlugin,
VideoXMsWm,
VideoXMsWmv,
VideoXMsWmx,
VideoXMsWvx,
VideoXMsVideo,
}
}
| 18.463415 | 29 | 0.515192 | [
"MIT"
] | BaseflowIT/XamarinMediaManager | MediaManager/Media/MimeType.cs | 759 | C# |
using Rabbit.Kernel.Logging;
using Rabbit.Kernel.Works;
using System;
using System.Threading;
namespace Rabbit.Kernel.Tasks.Impl
{
internal sealed class DefaultSweepGenerator : ISweepGenerator, IDisposable
{
internal sealed class InternalTimer : IDisposable
{
#region Field
private readonly Action _action;
private TimeSpan _interval;
private Timer _timer;
#endregion Field
#region Property
public bool Enabled { get; private set; }
public TimeSpan Interval
{
get { return _interval; }
set
{
_interval = value;
_timer.Change(0, _interval.Milliseconds);
}
}
#endregion Property
#region Constructor
public InternalTimer(Action action, TimeSpan interval)
{
if (interval.Ticks <= 0)
throw new ArgumentException("无效的时间。", "interval");
_interval = interval;
_action = action;
}
#endregion Constructor
#region Public Method
public void Start()
{
if (_timer != null)
throw new Exception("无法重复启动定时器。");
Enabled = true;
LazyInitializer.EnsureInitialized(ref _timer, () =>
{
Enabled = true;
return new Timer(state => _action(), null, 0, (long)Interval.TotalMilliseconds);
});
}
public void Stop()
{
Dispose();
}
#endregion Public Method
#region Implementation of IDisposable
/// <summary>
/// 执行与释放或重置非托管资源相关的应用程序定义的任务。
/// </summary>
public void Dispose()
{
Enabled = false;
if (_timer == null)
return;
_timer.Dispose();
_timer = null;
}
#endregion Implementation of IDisposable
}
#region Field
private readonly IWorkContextAccessor _workContextAccessor;
private readonly InternalTimer _timer;
#endregion Field
#region Constructor
public DefaultSweepGenerator(IWorkContextAccessor workContextAccessor)
{
_workContextAccessor = workContextAccessor;
Logger = NullLogger.Instance;
_timer = new InternalTimer(Elapsed, TimeSpan.FromMinutes(1));
}
#endregion Constructor
#region Property
public ILogger Logger { get; set; }
public TimeSpan Interval
{
get { return _timer.Interval; }
set { _timer.Interval = value; }
}
#endregion Property
#region Implementation of ISweepGenerator
/// <summary>
/// 激活。
/// </summary>
public void Activate()
{
lock (_timer)
_timer.Start();
}
/// <summary>
/// 终止。
/// </summary>
public void Terminate()
{
lock (_timer)
_timer.Stop();
}
#endregion Implementation of ISweepGenerator
#region Implementation of IDisposable
/// <summary>
/// 执行与释放或重置非托管资源相关的应用程序定义的任务。
/// </summary>
public void Dispose()
{
_timer.Dispose();
}
#endregion Implementation of IDisposable
#region Private Method
private void Elapsed()
{
if (!_timer.Enabled)
return;
//不允许重复进入。
if (!Monitor.TryEnter(_timer))
return;
if (!_timer.Enabled)
return;
try
{
DoWork();
}
catch (Exception ex)
{
Logger.Warning(ex, "处理后台任务时发现问题。");
}
finally
{
Monitor.Exit(_timer);
}
}
private void DoWork()
{
using (var scope = _workContextAccessor.CreateWorkContextScope())
{
var manager = scope.Resolve<IBackgroundService>();
manager.Sweep();
}
}
#endregion Private Method
}
} | 23.588542 | 100 | 0.476485 | [
"Apache-2.0"
] | RabbitTeam/RabbitHub | Rabbit.Kernel/Tasks/Impl/DefaultSweepGenerator.cs | 4,719 | C# |
//
// IAlertDialogBackend.cs
//
// Author:
// Lluis Sanchez <lluis@xamarin.com>
//
// Copyright (c) 2011 Xamarin Inc
//
// 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;
namespace Xwt.Backends
{
public interface IAlertDialogBackend: IDisposable
{
void Initialize (ApplicationContext context);
Command Run (WindowFrame transientFor, MessageDescription message);
bool ApplyToAll { get; }
}
}
| 36.292683 | 80 | 0.754704 | [
"MIT"
] | Bert1974/xwt | Xwt/Xwt.Backends/IAlertDialogBackend.cs | 1,488 | C# |
using System;
using System.ComponentModel;
using System.Runtime.Serialization;
namespace FantasyData.Api.Client.Model.NBA;
[DataContract(Namespace="", Name="BettingEntityMetadata")]
[Serializable]
public class BettingEntityMetadata
{
/// <summary>
/// The id of the record. Unique only within the same entity type (i.e. BettingMarketType Ids overlap with BettingBetType Ids)
/// </summary>
[Description("The id of the record. Unique only within the same entity type (i.e. BettingMarketType Ids overlap with BettingBetType Ids)")]
[DataMember(Name = "RecordId", Order = 1)]
public int RecordId { get; set; }
/// <summary>
/// A text value for the record (e.g. Moneyline, Player Prop, 3rd Quarter)
/// </summary>
[Description("A text value for the record (e.g. Moneyline, Player Prop, 3rd Quarter)")]
[DataMember(Name = "Name", Order = 2)]
public string Name { get; set; }
} | 37.08 | 144 | 0.695793 | [
"MIT"
] | markmario/fantasydata-api-csharp | FantasyData.Api.Client/Model/NBA/BettingEntityMetadata.cs | 929 | C# |
using Coreflow.Objects;
using Coreflow.Runtime;
using System;
using System.Collections.Generic;
namespace Coreflow.Web.Models
{
public class FlowDefinitionModel : IIdentifiable
{
public List<string> ReferencedNamespaces { get; set; }
public List<FlowArgument> Parameter { get; set; }
public string Name { get; set; }
public string Icon { get; set; }
public CodeCreatorModel CodeCreatorModel { get; set; }
public Guid Identifier { get; set; }
public string Note { get; set; }
}
}
| 22.2 | 62 | 0.655856 | [
"MIT"
] | lordmampf/Coreflow | Coreflow.Web/Models/FlowDefinitionModel.cs | 557 | 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("Website")]
[assembly: AssemblyDescription("A simple web site for testing Bundler")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Website")]
[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("9a6c6caf-6f0e-410c-a6e6-199f0e72f0c1")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| 38.416667 | 84 | 0.749819 | [
"Apache-2.0"
] | Mindroute/Bundler | src/Website/Properties/AssemblyInfo.cs | 1,386 | C# |
using System;
using System.Xml.Serialization;
using System.ComponentModel.DataAnnotations;
using BroadWorksConnector.Ocip.Validation;
using System.Collections.Generic;
namespace BroadWorksConnector.Ocip.Models
{
/// <summary>
/// Request the originating permissions for a user.
/// The response is either a UserOutgoingCallingPlanOriginatingGetResponse or an ErrorResponse.
/// <see cref="UserOutgoingCallingPlanOriginatingGetResponse"/>
/// <see cref="ErrorResponse"/>
/// </summary>
[Serializable]
[XmlRoot(Namespace = "")]
[Groups(@"[{""__type"":""Sequence:#BroadWorksConnector.Ocip.Validation"",""id"":""6f793dfca9bd3d121bb35e0f9cf1cb2e:1331""}]")]
public class UserOutgoingCallingPlanOriginatingGetRequest : BroadWorksConnector.Ocip.Models.C.OCIRequest
{
private string _userId;
[XmlElement(ElementName = "userId", IsNullable = false, Namespace = "")]
[Group(@"6f793dfca9bd3d121bb35e0f9cf1cb2e:1331")]
[MinLength(1)]
[MaxLength(161)]
public string UserId
{
get => _userId;
set
{
UserIdSpecified = true;
_userId = value;
}
}
[XmlIgnore]
protected bool UserIdSpecified { get; set; }
}
}
| 30.325581 | 130 | 0.647239 | [
"MIT"
] | JTOne123/broadworks-connector-net | BroadworksConnector/Ocip/Models/UserOutgoingCallingPlanOriginatingGetRequest.cs | 1,304 | C# |
#nullable enable
using System;
using BizHawk.Common;
namespace BizHawk.Emulation.Common
{
public readonly struct AxisSpec
{
/// <summary>
/// Gets the axis constraints that apply artificial constraints to float values
/// For instance, a N64 controller's analog range is actually larger than the amount allowed by the plastic that artificially constrains it to lower values
/// Axis constraints provide a way to technically allow the full range but have a user option to constrain down to typical values that a real control would have
/// </summary>
public readonly AxisConstraint? Constraint;
public Range<float> FloatRange => ((float) Min).RangeTo(Max);
public readonly bool IsReversed;
public int Max => Range.EndInclusive;
/// <value>maximum decimal digits analog input can occupy with no-args ToString</value>
/// <remarks>does not include the extra char needed for a minus sign</remarks>
public int MaxDigits => Math.Max(Math.Abs(Min).ToString().Length, Math.Abs(Max).ToString().Length);
public readonly int Mid;
public int Min => Range.Start;
public string? PairedAxis => Constraint?.PairedAxis;
public readonly Range<int> Range;
public AxisSpec(Range<int> range, int mid, bool isReversed = false, AxisConstraint? constraint = null)
{
Constraint = constraint;
IsReversed = isReversed;
Mid = mid;
Range = range;
}
}
}
| 30.866667 | 162 | 0.735781 | [
"MIT"
] | RetroEdit/BizHawk | src/BizHawk.Emulation.Common/Base Implementations/Axes/AxisSpec.cs | 1,389 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace MsiSneakAttack
{
internal static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.SetHighDpiMode(HighDpiMode.SystemAware);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new frmMain());
}
}
}
| 24.541667 | 65 | 0.631579 | [
"MIT"
] | Redth/MsiSneakAttack | MsiSneakAttack/Program.cs | 589 | C# |
namespace JohanPolosn.UnityInjector.Test.TestRunnerTests
{
using UnityEngine;
class InjectorTests
{
public class TestClass { }
public class Compnent : MonoBehaviour
{
public GameObject test;
public TestClass testClass;
public void Construct(GameObject test, [Openal] TestClass testClass)
{
this.test = test;
this.testClass = testClass;
}
}
private readonly DependencyInjector injector = new DependencyInjector();
private readonly GameObject gameObject = new GameObject("Test");
private readonly Compnent compnent = new Compnent();
private readonly TestClass testClass = new TestClass();
private void GetGameObject()
{
injector.GameObjectDependencys.Add("test", gameObject);
TestRunner.ReferenceEquals(gameObject, injector.GetGameObject("test"));
}
private void InjectGameObject()
{
injector.GameObjectDependencys.Add("test", gameObject);
injector.Inject(compnent);
TestRunner.ReferenceEquals(gameObject, compnent.test);
TestRunner.ReferenceEquals(null, compnent.testClass);
}
private void InjectTestClass1()
{
injector.Dependencys.AddSingleton(testClass);
injector.GameObjectDependencys.Add("test", gameObject);
injector.Inject(compnent);
TestRunner.ReferenceEquals(gameObject, compnent.test);
TestRunner.ReferenceEquals(testClass, compnent.testClass);
}
}
}
| 28.603448 | 83 | 0.617842 | [
"MIT"
] | johanpolson/Unity-Injector | UnityProject/Assets/UnityInjector/Test/TestRunnerTests/InjectorTests.cs | 1,661 | C# |
using jQueryApi;
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
namespace Serenity
{
public static class LazyLoadHelper
{
private static int autoIncrement = 0;
public static void ExecuteOnceWhenShown(jQueryObject element, Action callback)
{
autoIncrement++;
string eventClass = "ExecuteOnceWhenShown" + autoIncrement;
bool executed = false;
if (element.Is(":visible"))
callback();
else
{
jQueryObject uiTabs = element.Closest(".ui-tabs");
if (uiTabs.Length > 0)
{
uiTabs.Bind("tabsshow." + eventClass, delegate(jQueryEvent e)
{
if (element.Is(":visible"))
{
uiTabs.Unbind("tabsshow." + eventClass);
if (!executed)
{
executed = true;
element.Unbind("shown." + eventClass);
callback();
}
}
});
}
jQueryObject dialog;
if (element.HasClass("ui-dialog"))
dialog = element.Children(".ui-dialog-content");
else
dialog = element.Closest(".ui-dialog-content");
if (dialog.Length > 0)
dialog.Bind("dialogopen." + eventClass, delegate
{
dialog.Unbind("dialogopen." + eventClass);
if (element.Is(":visible") && !executed)
{
executed = true;
element.Unbind("shown." + eventClass);
callback();
}
});
element.Bind("shown." + eventClass, delegate
{
if (element.Is(":visible"))
{
element.Unbind("shown." + eventClass);
if (!executed)
{
executed = true;
callback();
}
}
});
}
}
public static void ExecuteEverytimeWhenShown(jQueryObject element, Action callback,
bool callNowIfVisible)
{
autoIncrement++;
string eventClass = "ExecuteEverytimeWhenShown" + autoIncrement;
bool wasVisible = element.Is(":visible");
if (wasVisible && callNowIfVisible)
callback();
jQueryEventHandler check = delegate(jQueryEvent e)
{
if (element.Is(":visible"))
{
if (!wasVisible)
{
wasVisible = true;
callback();
}
}
else
wasVisible = false;
};
var uiTabs = element.Closest(".ui-tabs");
if (uiTabs.Length > 0)
uiTabs.Bind("tabsactivate." + eventClass, check);
var dialog = element.Closest(".ui-dialog-content");
if (dialog.Length > 0)
dialog.Bind("dialogopen." + eventClass, check);
element.Bind("shown." + eventClass, check);
}
}
} | 33.053097 | 92 | 0.395984 | [
"MIT"
] | fzhenmei/Serenity | Serenity.Script.Core/SlickGrid/LazyLoadHelper.cs | 3,737 | C# |
namespace WebForLink.Web.ViewModels
{
public class OrganizacaoComprasVM
{
public int Id { get; set; }
public string Nome { get; set; }
}
} | 20.875 | 40 | 0.610778 | [
"MIT"
] | nelson1987/ProjetoPadraoTDD | Code/1_Presentation/WebForLink.Web/ViewModels/WebForLink/OrganizacaoComprasVM.cs | 169 | C# |
using System;
namespace _03.Printing_Triangle
{
public class Printing_Triangle
{
public static void Main()
{
var number = int.Parse(Console.ReadLine());
PrintTriangle(number);
}
static void PrintColumns(int row)
{
for (int col = 1; col <= row; col++)
{
Console.Write($"{col} ");
}
Console.WriteLine();
}
static void PrintTriangle(int n)
{
for (int row = 1; row <= n; row++)
{
PrintColumns(row);
}
for (int row = n - 1; row >= 1; row--)
{
PrintColumns(row);
}
}
}
}
| 19.684211 | 55 | 0.413102 | [
"Apache-2.0"
] | vencislav-viktorov/VS-Console-App | Tech Module Intensive/4.Methods.DebugTroublesh.Code-Lab/03. Printing Triangle/Printing_Triangle.cs | 750 | C# |
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using Xunit.Sdk;
namespace Microsoft.AspNetCore;
public class AssertEx
{
public static void DirectoryExists(string path)
{
if (!Directory.Exists(path))
{
throw new XunitException($"Expected directory to exist at {path} but it did not");
}
}
public static void FileExists(string path)
{
if (!File.Exists(path))
{
throw new XunitException($"Expected file to exist at {path} but it did not");
}
}
public static void FileDoesNotExists(string path)
{
if (File.Exists(path))
{
throw new XunitException($"File should not exist at {path}");
}
}
}
| 24.264706 | 94 | 0.612121 | [
"MIT"
] | 3ejki/aspnetcore | src/Framework/test/AssertEx.cs | 825 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using NLog;
namespace MiningCore.Extensions
{
public static class LoggingExtensions
{
public static void LogInvoke(this ILogger logger, object[] args = null, [CallerMemberName] string caller = null)
{
if(args == null)
logger.Debug(() => $"{caller}()");
else
logger.Debug(()=> $"{caller}({string.Join(", ", args.Select(x=> x?.ToString()))})");
}
public static void LogInvoke(this ILogger logger, string logCat, object[] args = null, [CallerMemberName] string caller = null)
{
if (args == null)
logger.Debug(() => $"[{logCat}] {caller}()");
else
logger.Debug(() => $"[{logCat}] {caller}({string.Join(", ", args.Select(x => x?.ToString()))})");
}
}
}
| 33.655172 | 136 | 0.545082 | [
"MIT"
] | AltcoinCoop/miningcore | src/MiningCore/Extensions/LoggingExtensions.cs | 978 | C# |
version https://git-lfs.github.com/spec/v1
oid sha256:5ebe15a2da8272884ed5d3702fb5291b07a9e497dff6ef1f7c26c0d41c1fc779
size 27782
| 32.5 | 75 | 0.884615 | [
"MIT"
] | Vakuzar/Multithreaded-Blood-Sim | Blood/Library/PackageCache/com.unity.mathematics@1.1.0/Unity.Mathematics/float3x3.gen.cs | 130 | C# |
// Copyright 2015 Tosho Toshev
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using System;
using System.Globalization;
namespace ElmCommunicatorPortable.Commands.ElmCommands
{
public class CanFlowControlSetSendMessage : SendMessage
{
public CanFlowControlSetSendMessage(bool state)
{
Command = "AT CFC";
Data = Convert.ToInt32(state).ToString(CultureInfo.InvariantCulture);
}
}
} | 35.142857 | 81 | 0.700203 | [
"Apache-2.0"
] | cracker4o/elm327lib | ElmCommunicator/ElmCommunicatorPortable/Commands/ElmCommands/CanFlowControlSetSendMessage.cs | 986 | C# |
using System;
using System.Linq.Expressions;
using System.Reflection;
using DapperExtensionsReloaded.Internal;
using DapperExtensionsReloaded.Mapper.Internal;
using Xunit;
namespace DapperExtensionsReloaded.Test.Mapper
{
public class PropertyMapTests
{
private class Foo
{
public int Bar { get; set; }
public string Baz { get; set; }
}
[Fact]
public void PropertyMap_Constructor_Sets_Name_And_ColumnName_Property_From_PropertyInfo()
{
Expression<Func<Foo, object>> expression = f => f.Bar;
var pi = ReflectionHelper.GetProperty(expression) as PropertyInfo;
var pm = new PropertyMap(pi);
Assert.Equal("Bar", pm.Name);
Assert.Equal("Bar", pm.ColumnName);
}
[Fact]
public void PropertyMap_Column_Sets_ColumnName_But_Does_Not_Change_Name()
{
Expression<Func<Foo, object>> expression = f => f.Baz;
var pi = ReflectionHelper.GetProperty(expression) as PropertyInfo;
var pm = new PropertyMap(pi);
pm.Column("X");
Assert.Equal("Baz", pm.Name);
Assert.Equal("X", pm.ColumnName);
}
[Fact]
public void PropertyMap_Key_Sets_KeyType()
{
Expression<Func<Foo, object>> expression = f => f.Baz;
var pi = ReflectionHelper.GetProperty(expression) as PropertyInfo;
var pm = new PropertyMap(pi);
pm.Column("X").Key(KeyType.Identity);
Assert.Equal("Baz", pm.Name);
Assert.Equal("X", pm.ColumnName);
Assert.Equal(KeyType.Identity, pm.KeyType);
}
}
} | 33.392157 | 97 | 0.602466 | [
"MIT"
] | MisterGoodcat/Dapper-Extensions | DapperExtensionsReloaded.Test/Mapper/PropertyMapTests.cs | 1,703 | C# |
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Azure.ApplicationInsights.Query;
using Microsoft.Azure.ApplicationInsights.Query.Models;
using Microsoft.Extensions.Logging;
using Xunit;
using Xunit.Abstractions;
namespace Arcus.Observability.Tests.Integration.Serilog.Sinks.ApplicationInsights
{
public class TraceTests : ApplicationInsightsSinkTests
{
public TraceTests(ITestOutputHelper outputWriter) : base(outputWriter)
{
}
[Fact]
public async Task LogTrace_SinksToApplicationInsights_ResultsInTraceTelemetry()
{
// Arrange
string message = BogusGenerator.Lorem.Sentence();
using (ILoggerFactory loggerFactory = CreateLoggerFactory())
{
ILogger logger = loggerFactory.CreateLogger<ApplicationInsightsSinkTests>();
Dictionary<string, object> telemetryContext = CreateTestTelemetryContext();
// Act
logger.LogInformation("Trace message '{Sentence}' (Context: {Context})", message, telemetryContext);
}
// Assert
using (ApplicationInsightsDataClient client = CreateApplicationInsightsClient())
{
await RetryAssertUntilTelemetryShouldBeAvailableAsync(async () =>
{
EventsResults<EventsTraceResult> results = await client.Events.GetTraceEventsAsync(ApplicationId, filter: OnlyLastHourFilter);
Assert.Contains(results.Value, result => result.Trace.Message.Contains(message));
});
}
}
}
} | 39.309524 | 146 | 0.658995 | [
"MIT"
] | MassimoC/arcus.observability | src/Arcus.Observability.Tests.Integration/Serilog/Sinks/ApplicationInsights/TraceTests.cs | 1,653 | C# |
using System.Collections.Generic;
using System.Diagnostics;
using ShellMe.CommandLine.CommandHandling;
namespace ShellMe.Testing
{
public class LogLevelCommand : BaseCommand
{
public override string Name
{
get { return "LogLevel"; }
}
public override void Run()
{
foreach (var logLevel in LogLevel)
{
Console.WriteLine(logLevel.ToString());
}
Console.TraceEvent(TraceEventType.Error, 1, "error");
Console.TraceEvent(TraceEventType.Verbose, 1, "verbose");
Console.TraceEvent(TraceEventType.Information, 1, "information");
}
}
}
| 26.555556 | 78 | 0.576011 | [
"MIT"
] | dff-solutions/shell.me | src/shell.me/ShellMe.Testing/LogLevelCommand.cs | 719 | C# |
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
namespace Pulumi.Aws.WafV2.Outputs
{
[OutputType]
public sealed class WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementXssMatchStatementTextTransformation
{
/// <summary>
/// The relative processing order for multiple transformations that are defined for a rule statement. AWS WAF processes all transformations, from lowest priority to highest, before inspecting the transformed content.
/// </summary>
public readonly int Priority;
/// <summary>
/// The transformation to apply, you can specify the following types: `NONE`, `COMPRESS_WHITE_SPACE`, `HTML_ENTITY_DECODE`, `LOWERCASE`, `CMD_LINE`, `URL_DECODE`. See the [documentation](https://docs.aws.amazon.com/waf/latest/APIReference/API_TextTransformation.html) for more details.
/// </summary>
public readonly string Type;
[OutputConstructor]
private WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementXssMatchStatementTextTransformation(
int priority,
string type)
{
Priority = priority;
Type = type;
}
}
}
| 41.444444 | 293 | 0.714477 | [
"ECL-2.0",
"Apache-2.0"
] | Otanikotani/pulumi-aws | sdk/dotnet/WafV2/Outputs/WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementXssMatchStatementTextTransformation.cs | 1,492 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.SpaServices.AngularCli;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
namespace MPWebClient
{
public class Startup
{
private IHostingEnvironment HostingEnvironment { get; }
public Startup(IConfiguration configuration, IHostingEnvironment env)
{
HostingEnvironment = env;
Configuration = configuration;
}
public IConfiguration Configuration { get; }
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.Configure<CookiePolicyOptions>(options =>
{
// This lambda determines whether user consent for non-essential cookies is needed for a given request.
options.CheckConsentNeeded = context => true;
options.MinimumSameSitePolicy = SameSiteMode.None;
});
services.AddMvc();
if (HostingEnvironment.IsDevelopment())
{
services.AddNodeServices(options =>
{
options.LaunchWithDebugging = true;
options.DebuggingPort = 9229;
});
}
services.AddOptions();
services.AddResponseCompression();
services.AddMemoryCache();
services.AddSpaStaticFiles(configuration =>
{
configuration.RootPath = "ClientApp/dist";
});
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
app.UseDatabaseErrorPage();
//app.AddDevMiddlewares();
//app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions
//{
// HotModuleReplacement = true
//});
}
else
{
app.UseHsts();
app.UseResponseCompression();
}
app.UseStaticFiles();
app.UseSpaStaticFiles();
app.UseCookiePolicy();
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
//routes.MapSpaFallbackRoute(
// name: "spa-fallback",
// defaults: new { controller = "Home", action = "Index" });
routes.MapRoute(name: "hello", template: "hello", defaults: new { controller = "Home", action = "Hello" });
});
app.UseSpa(spa =>
{
spa.Options.SourcePath = "ClientApp";
/*
// If you want to enable server-side rendering (SSR),
// [1] In AspNetCoreSpa.csproj, change the <BuildServerSideRenderer> property
// value to 'true', so that the SSR bundle is built during publish
// [2] Uncomment this code block
*/
//spa.UseSpaPrerendering(options =>
// {
// options.BootModulePath = $"{spa.Options.SourcePath}/dist-server/main.bundle.js";
// options.BootModuleBuilder = env.IsDevelopment() ? new AngularCliBuilder(npmScript: "build:ssr") : null;
// options.ExcludeUrls = new[] { "/sockjs-node" };
// options.SupplyData = (requestContext, obj) =>
// {
// // var result = appService.GetApplicationData(requestContext).GetAwaiter().GetResult();
// obj.Add("Cookies", requestContext.Request.Cookies);
// };
// });
if (env.IsDevelopment())
{
spa.UseAngularCliServer(npmScript: "start-client");
spa.UseAngularCliServer(npmScript: "start-admin");
// OR
//spa.UseProxyToSpaDevelopmentServer("http://localhost:4200");
}
});
}
}
}
| 34.77037 | 126 | 0.52663 | [
"MIT"
] | bugMaker-237/ASP.NETCoreAngular7MultiApp | MPWebClient/Startup.cs | 4,694 | C# |
namespace Pose.Controls.Dopesheet
{
public readonly struct FrameRange
{
public int Min { get; }
public int Max { get; }
public FrameRange(int min, int max)
{
Min = min;
Max = max;
}
}
}
| 17.6 | 43 | 0.492424 | [
"MIT"
] | thomasvt/pose | Pose/Pose/Controls/Dopesheet/FrameRange.cs | 266 | C# |
using System.Collections;
using System.Collections.Generic;
namespace Lykke.Service.PdfGenerator.Core.Domain.Health
{
public class HealthIssuesCollection : IReadOnlyCollection<HealthIssue>
{
public int Count => _list.Count;
private readonly List<HealthIssue> _list;
public HealthIssuesCollection()
{
_list = new List<HealthIssue>();
}
public void Add(string type, string value)
{
_list.Add(HealthIssue.Create(type, value));
}
public IEnumerator<HealthIssue> GetEnumerator()
{
return _list.GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
}
} | 23.65625 | 74 | 0.607662 | [
"MIT"
] | LykkeCity/Lykke.Service.PdfGenerator | src/Lykke.Service.PdfGenerator.Core/Domain/Health/HealthIssuesCollection.cs | 757 | C# |
#region MIT
// /*The MIT License (MIT)
//
// Copyright 2016 lizs lizs4ever@163.com
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
// * */
#endregion
using System.Threading.Tasks;
using Pi.Framework;
using Pi.Gen;
using socket4net;
namespace Sample
{
[ComponentId((short)EComponentId.SampleComponent)]
public class ChatComponent : RpcComponent
{
public async override Task<NetResult> OnRequest(short ops, byte[] data)
{
switch ((EOps)ops)
{
case EOps.Echo:
{
var proto = PiSerializer.Deserialize<EchoProto>(data);
return
NetResult.MakeSuccess(new EchoProto
{
Message = string.Format("Response from server : {0}", proto.Message)
});
}
case EOps.Create:
{
var player = GetAncestor<Player>();
player.Es.CreateDefault<Ship>(new EntityArg(this, Uid.New()), true);
return true;
}
case EOps.Destroy:
{
var player = GetAncestor<Player>();
player.Es.DestroyAll();
return true;
}
default:
return NetResult.Failure;
}
}
public async override Task<bool> OnPush(short ops, byte[] data)
{
switch ((EOps)ops)
{
case EOps.Broadcast:
{
var proto = PiSerializer.Deserialize<BroadcastProto>(data);
// 广播该消息至客户端ChatComponent
ServerNodesMgr.Ins.GetServer<SampleSession>()
.Broadcast(0, (short) EOps.Broadcast, new BroadcastProto
{
Message = Host.Name + " : " + proto.Message
}, Id);
return true;
}
default:
return false;
}
}
}
}
| 35.703297 | 96 | 0.540474 | [
"MIT"
] | lizs/PI | Sample/Server/business/ChatComponent.cs | 3,269 | C# |
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria.ID;
using Terraria;
using Terraria.ModLoader;
namespace HavenMod.Items.Galaxium
{
public class GalaxiumPistol : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Galaxium Machine Pistol");
Tooltip.SetDefault("20% chance not to consume ammo");
}
public override void SetDefaults()
{
item.damage = 35;
item.crit = 10;
item.ranged = true;
item.noMelee = true;
item.width = 52;
item.height = 22;
item.useTime = 9;
item.useAnimation = 9;
item.useStyle = 5;
item.knockBack = 12;
item.value = Item.buyPrice(0, 5, 0, 0);
item.rare = 8;
item.UseSound = SoundID.Item12;
item.autoReuse = true;
item.shootSpeed = 20f;
item.useTurn = false;
item.useAmmo = AmmoID.Bullet;
item.shoot = 10;
}
public override Vector2? HoldoutOffset()
{
return new Vector2(-3, -2);
}
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Vector2 perturbedSpeed = new Vector2(speedX, speedY).RotatedByRandom(MathHelper.ToRadians(1));
speedX = perturbedSpeed.X;
speedY = perturbedSpeed.Y;
Vector2 muzzleOffset = Vector2.Normalize(new Vector2(speedX, speedY)) * 25f;
if (Collision.CanHit(position, 0, 0, position + muzzleOffset, 400, 0))
{
position += muzzleOffset;
}
float spread = 5f * 0.0174f;//45 degrees converted to radians
float baseSpeed = (float)Math.Sqrt(speedX * speedX + speedY * speedY);
double baseAngle = Math.Atan2(speedX, speedY);
double randomAngle = baseAngle+(Main.rand.NextFloat()-0.5f)*spread;
speedX = baseSpeed*(float)Math.Sin(randomAngle);
speedY = baseSpeed*(float)Math.Cos(randomAngle);
return true;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(null, "GalaxiumBar", 16);
recipe.SetResult(this);
recipe.AddTile(TileID.MythrilAnvil);
recipe.AddRecipe();
}
}
} | 28.324324 | 152 | 0.695134 | [
"MIT"
] | Fortanono/HavenMod | Items/Galaxium/GalaxiumPistol.cs | 2,096 | C# |
// Copyright 2007-2017 Chris Patterson, Dru Sellers, Travis Smith, et. al.
//
// 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 MassTransit.UnityIntegration
{
using System;
using System.Collections.Concurrent;
using Microsoft.Practices.Unity;
using Saga;
public static class SagaConfiguratorCache
{
static CachedConfigurator GetOrAdd(Type type)
{
return Cached.Instance.GetOrAdd(type, _ =>
(CachedConfigurator)Activator.CreateInstance(typeof(CachedConfigurator<>).MakeGenericType(type)));
}
public static void Configure(Type sagaType, IReceiveEndpointConfigurator configurator, IUnityContainer container)
{
GetOrAdd(sagaType).Configure(configurator, container);
}
static class Cached
{
internal static readonly ConcurrentDictionary<Type, CachedConfigurator> Instance =
new ConcurrentDictionary<Type, CachedConfigurator>();
}
interface CachedConfigurator
{
void Configure(IReceiveEndpointConfigurator configurator, IUnityContainer container);
}
class CachedConfigurator<T> :
CachedConfigurator
where T : class, ISaga
{
public void Configure(IReceiveEndpointConfigurator configurator, IUnityContainer container)
{
var sagaRepository = container.Resolve<ISagaRepository<T>>();
var unitySagaRepository = new UnitySagaRepository<T>(sagaRepository, container);
configurator.Saga(unitySagaRepository);
}
}
}
} | 36 | 122 | 0.65457 | [
"Apache-2.0"
] | andymac4182/MassTransit | src/Containers/MassTransit.UnityIntegration/SagaConfiguratorCache.cs | 2,234 | C# |
using SFA.DAS.ContentApi.DependencyResolution;
using StructureMap;
namespace SFA.DAS.ContentApi.Api.DependencyResolution
{
public static class IoC
{
public static void Initialize(Registry registry)
{
registry.IncludeRegistry<ConfigurationRegistry>();
registry.IncludeRegistry<MediatorRegistry>();
registry.IncludeRegistry<MapperRegistry>();
registry.IncludeRegistry<DefaultRegistry>();
}
}
} | 29.875 | 62 | 0.682008 | [
"MIT"
] | SkillsFundingAgency/das-content-api | src/SFA.DAS.ContentApi.Api/DependencyResolution/IoC.cs | 480 | 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("Business")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("Business")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2013")]
[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("b0879274-cc57-437f-a841-39c92d295860")]
// 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.027027 | 84 | 0.746979 | [
"MIT"
] | shpsyte/CRMFx | Libraries/Business/Properties/AssemblyInfo.cs | 1,410 | C# |
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Utils;
using osu.Game.Beatmaps;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Overlays;
using osu.Game.Overlays.BeatmapSet;
using osu.Game.Screens.Select.Details;
namespace osu.Game.Tests.Visual.Online
{
public class TestSceneBeatmapSetOverlayDetails : OsuTestScene
{
private RatingsExposingDetails details;
[Cached]
private OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Blue);
[SetUp]
public void Setup() => Schedule(() =>
{
Child = details = new RatingsExposingDetails
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre
};
});
[Test]
public void TestMetrics()
{
var firstSet = createSet();
var secondSet = createSet();
AddStep("set first set", () => details.BeatmapSet = firstSet);
AddAssert("ratings set", () => details.Ratings.Ratings == firstSet.Ratings);
AddStep("set second set", () => details.BeatmapSet = secondSet);
AddAssert("ratings set", () => details.Ratings.Ratings == secondSet.Ratings);
static APIBeatmapSet createSet() => new APIBeatmapSet
{
Beatmaps = new List<APIBeatmap>
{
new APIBeatmap
{
FailTimes = new APIFailTimes
{
Fails = Enumerable.Range(1, 100).Select(_ => RNG.Next(10)).ToArray(),
Retries = Enumerable.Range(-2, 100).Select(_ => RNG.Next(10)).ToArray(),
},
}
},
Ratings = Enumerable.Range(0, 11).Select(_ => RNG.Next(10)).ToArray(),
Status = BeatmapSetOnlineStatus.Ranked
};
}
private class RatingsExposingDetails : Details
{
public new UserRatings Ratings => base.Ratings;
}
}
}
| 34.211268 | 108 | 0.550432 | [
"MIT"
] | IchigoDelphinium/osu | osu.Game.Tests/Visual/Online/TestSceneBeatmapSetOverlayDetails.cs | 2,359 | C# |
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
namespace Pulumi.Azure.Network.Outputs
{
[OutputType]
public sealed class FirewallPolicyIntrusionDetectionSignatureOverride
{
/// <summary>
/// 12-digit number (id) which identifies your signature.
/// </summary>
public readonly string? Id;
/// <summary>
/// state can be any of "Off", "Alert" or "Deny".
/// </summary>
public readonly string? State;
[OutputConstructor]
private FirewallPolicyIntrusionDetectionSignatureOverride(
string? id,
string? state)
{
Id = id;
State = state;
}
}
}
| 26.861111 | 88 | 0.620476 | [
"ECL-2.0",
"Apache-2.0"
] | ScriptBox99/pulumi-azure | sdk/dotnet/Network/Outputs/FirewallPolicyIntrusionDetectionSignatureOverride.cs | 967 | C# |
using System.Collections.Generic;
namespace GCommon.Differencing.Abstractions
{
public interface IDifferentiator<in T> : IEqualityComparer<T>
{
IEnumerable<Difference> DifferenceIn(T first, T second);
}
} | 25 | 65 | 0.737778 | [
"MIT"
] | tnunnink/GMerge | src/GCommon.Differencing/Abstractions/IDifferentiator.cs | 225 | C# |
// 该文件由GT.CLI 工具生成
using Microsoft.Extensions.DependencyInjection;
namespace App.Api
{
/// <summary>
/// 仓储注册服务
/// </summary>
public static class RepositoryServiceExtensions
{
public static void AddRepositories(this IServiceCollection services)
{
}
}
}
| 17.882353 | 76 | 0.644737 | [
"Apache-2.0"
] | geethin/template | templates/project/src/App.Api/RepositoryServiceExtensions.cs | 332 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TestFlask.Models.Entity
{
public class Counter : MongoEntity
{
public string CounterKey { get; set; }
public long CounterValue { get; set; }
}
}
| 18.875 | 46 | 0.695364 | [
"MIT"
] | FatihSahin/test-flask | TestFlask.Models/Entity/Counter.cs | 304 | C# |
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Generic;
using System.Reflection;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Razor.Language;
using Microsoft.CodeAnalysis;
using Xunit;
namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X
{
public class ViewComponentTagHelperDescriptorFactoryTest
{
private static readonly Assembly _assembly = typeof(ViewComponentTagHelperDescriptorFactoryTest).GetTypeInfo().Assembly;
[Fact]
public void CreateDescriptor_UnderstandsStringParameters()
{
// Arrange
var testCompilation = TestCompilation.Create(_assembly);
var viewComponent = testCompilation.GetTypeByMetadataName(typeof(StringParameterViewComponent).FullName);
var factory = new ViewComponentTagHelperDescriptorFactory(testCompilation);
var expectedDescriptor = TagHelperDescriptorBuilder.Create(
ViewComponentTagHelperConventions.Kind,
"__Generated__StringParameterViewComponentTagHelper",
typeof(StringParameterViewComponent).GetTypeInfo().Assembly.GetName().Name)
.TypeName("__Generated__StringParameterViewComponentTagHelper")
.DisplayName("StringParameterViewComponentTagHelper")
.TagMatchingRuleDescriptor(rule =>
rule
.RequireTagName("vc:string-parameter")
.RequireAttributeDescriptor(attribute => attribute.Name("foo"))
.RequireAttributeDescriptor(attribute => attribute.Name("bar")))
.BoundAttributeDescriptor(attribute =>
attribute
.Name("foo")
.PropertyName("foo")
.TypeName(typeof(string).FullName)
.DisplayName("string StringParameterViewComponentTagHelper.foo"))
.BoundAttributeDescriptor(attribute =>
attribute
.Name("bar")
.PropertyName("bar")
.TypeName(typeof(string).FullName)
.DisplayName("string StringParameterViewComponentTagHelper.bar"))
.AddMetadata(ViewComponentTagHelperMetadata.Name, "StringParameter")
.Build();
// Act
var descriptor = factory.CreateDescriptor(viewComponent);
// Assert
Assert.Equal(expectedDescriptor, descriptor, TagHelperDescriptorComparer.Default);
}
[Fact]
public void CreateDescriptor_UnderstandsVariousParameterTypes()
{
// Arrange
var testCompilation = TestCompilation.Create(_assembly);
var viewComponent = testCompilation.GetTypeByMetadataName(typeof(VariousParameterViewComponent).FullName);
var factory = new ViewComponentTagHelperDescriptorFactory(testCompilation);
var expectedDescriptor = TagHelperDescriptorBuilder.Create(
ViewComponentTagHelperConventions.Kind,
"__Generated__VariousParameterViewComponentTagHelper",
typeof(VariousParameterViewComponent).GetTypeInfo().Assembly.GetName().Name)
.TypeName("__Generated__VariousParameterViewComponentTagHelper")
.DisplayName("VariousParameterViewComponentTagHelper")
.TagMatchingRuleDescriptor(rule =>
rule
.RequireTagName("vc:various-parameter")
.RequireAttributeDescriptor(attribute => attribute.Name("test-enum"))
.RequireAttributeDescriptor(attribute => attribute.Name("test-string"))
.RequireAttributeDescriptor(attribute => attribute.Name("baz")))
.BoundAttributeDescriptor(attribute =>
attribute
.Name("test-enum")
.PropertyName("testEnum")
.TypeName(typeof(VariousParameterViewComponent).FullName + "." + nameof(VariousParameterViewComponent.TestEnum))
.AsEnum()
.DisplayName(typeof(VariousParameterViewComponent).FullName + "." + nameof(VariousParameterViewComponent.TestEnum) + " VariousParameterViewComponentTagHelper.testEnum"))
.BoundAttributeDescriptor(attribute =>
attribute
.Name("test-string")
.PropertyName("testString")
.TypeName(typeof(string).FullName)
.DisplayName("string VariousParameterViewComponentTagHelper.testString"))
.BoundAttributeDescriptor(attribute =>
attribute
.Name("baz")
.PropertyName("baz")
.TypeName(typeof(int).FullName)
.DisplayName("int VariousParameterViewComponentTagHelper.baz"))
.AddMetadata(ViewComponentTagHelperMetadata.Name, "VariousParameter")
.Build();
// Act
var descriptor = factory.CreateDescriptor(viewComponent);
// Assert
Assert.Equal(expectedDescriptor, descriptor, TagHelperDescriptorComparer.Default);
}
[Fact]
public void CreateDescriptor_UnderstandsGenericParameters()
{
// Arrange
var testCompilation = TestCompilation.Create(_assembly);
var viewComponent = testCompilation.GetTypeByMetadataName(typeof(GenericParameterViewComponent).FullName);
var factory = new ViewComponentTagHelperDescriptorFactory(testCompilation);
var expectedDescriptor = TagHelperDescriptorBuilder.Create(
ViewComponentTagHelperConventions.Kind,
"__Generated__GenericParameterViewComponentTagHelper",
typeof(GenericParameterViewComponent).GetTypeInfo().Assembly.GetName().Name)
.TypeName("__Generated__GenericParameterViewComponentTagHelper")
.DisplayName("GenericParameterViewComponentTagHelper")
.TagMatchingRuleDescriptor(rule =>
rule
.RequireTagName("vc:generic-parameter")
.RequireAttributeDescriptor(attribute => attribute.Name("foo")))
.BoundAttributeDescriptor(attribute =>
attribute
.Name("foo")
.PropertyName("Foo")
.TypeName("System.Collections.Generic.List<System.String>")
.DisplayName("System.Collections.Generic.List<System.String> GenericParameterViewComponentTagHelper.Foo"))
.BoundAttributeDescriptor(attribute =>
attribute
.Name("bar")
.PropertyName("Bar")
.TypeName("System.Collections.Generic.Dictionary<System.String, System.Int32>")
.AsDictionaryAttribute("bar-", typeof(int).FullName)
.DisplayName("System.Collections.Generic.Dictionary<System.String, System.Int32> GenericParameterViewComponentTagHelper.Bar"))
.AddMetadata(ViewComponentTagHelperMetadata.Name, "GenericParameter")
.Build();
// Act
var descriptor = factory.CreateDescriptor(viewComponent);
// Assert
Assert.Equal(expectedDescriptor, descriptor, TagHelperDescriptorComparer.Default);
}
[Fact]
public void CreateDescriptor_AddsDiagnostic_ForViewComponentWithNoInvokeMethod()
{
// Arrange
var testCompilation = TestCompilation.Create(_assembly);
var factory = new ViewComponentTagHelperDescriptorFactory(testCompilation);
var viewComponent = testCompilation.GetTypeByMetadataName(typeof(ViewComponentWithoutInvokeMethod).FullName);
// Act
var descriptor = factory.CreateDescriptor(viewComponent);
// Assert
var diagnostic = Assert.Single(descriptor.GetAllDiagnostics());
Assert.Equal(RazorExtensionsDiagnosticFactory.ViewComponent_CannotFindMethod.Id, diagnostic.Id);
}
[Fact]
public void CreateDescriptor_ForViewComponentWithInvokeAsync_UnderstandsGenericTask()
{
// Arrange
var testCompilation = TestCompilation.Create(_assembly);
var factory = new ViewComponentTagHelperDescriptorFactory(testCompilation);
var viewComponent = testCompilation.GetTypeByMetadataName(typeof(AsyncViewComponentWithGenericTask).FullName);
// Act
var descriptor = factory.CreateDescriptor(viewComponent);
// Assert
Assert.Empty(descriptor.GetAllDiagnostics());
}
[Fact]
public void CreateDescriptor_ForViewComponentWithInvokeAsync_UnderstandsNonGenericTask()
{
// Arrange
var testCompilation = TestCompilation.Create(_assembly);
var factory = new ViewComponentTagHelperDescriptorFactory(testCompilation);
var viewComponent = testCompilation.GetTypeByMetadataName(typeof(AsyncViewComponentWithNonGenericTask).FullName);
// Act
var descriptor = factory.CreateDescriptor(viewComponent);
// Assert
Assert.Empty(descriptor.GetAllDiagnostics());
}
[Fact]
public void CreateDescriptor_ForViewComponentWithInvokeAsync_DoesNotUnderstandVoid()
{
// Arrange
var testCompilation = TestCompilation.Create(_assembly);
var factory = new ViewComponentTagHelperDescriptorFactory(testCompilation);
var viewComponent = testCompilation.GetTypeByMetadataName(typeof(AsyncViewComponentWithString).FullName);
// Act
var descriptor = factory.CreateDescriptor(viewComponent);
// Assert
var diagnostic = Assert.Single(descriptor.GetAllDiagnostics());
Assert.Equal(RazorExtensionsDiagnosticFactory.ViewComponent_AsyncMethod_ShouldReturnTask.Id, diagnostic.Id);
}
[Fact]
public void CreateDescriptor_ForViewComponentWithInvokeAsync_DoesNotUnderstandString()
{
// Arrange
var testCompilation = TestCompilation.Create(_assembly);
var factory = new ViewComponentTagHelperDescriptorFactory(testCompilation);
var viewComponent = testCompilation.GetTypeByMetadataName(typeof(AsyncViewComponentWithString).FullName);
// Act
var descriptor = factory.CreateDescriptor(viewComponent);
// Assert
var diagnostic = Assert.Single(descriptor.GetAllDiagnostics());
Assert.Equal(RazorExtensionsDiagnosticFactory.ViewComponent_AsyncMethod_ShouldReturnTask.Id, diagnostic.Id);
}
[Fact]
public void CreateDescriptor_ForViewComponentWithInvoke_DoesNotUnderstandVoid()
{
// Arrange
var testCompilation = TestCompilation.Create(_assembly);
var factory = new ViewComponentTagHelperDescriptorFactory(testCompilation);
var viewComponent = testCompilation.GetTypeByMetadataName(typeof(SyncViewComponentWithVoid).FullName);
// Act
var descriptor = factory.CreateDescriptor(viewComponent);
// Assert
var diagnostic = Assert.Single(descriptor.GetAllDiagnostics());
Assert.Equal(RazorExtensionsDiagnosticFactory.ViewComponent_SyncMethod_ShouldReturnValue.Id, diagnostic.Id);
}
[Fact]
public void CreateDescriptor_ForViewComponentWithInvoke_DoesNotUnderstandNonGenericTask()
{
// Arrange
var testCompilation = TestCompilation.Create(_assembly);
var factory = new ViewComponentTagHelperDescriptorFactory(testCompilation);
var viewComponent = testCompilation.GetTypeByMetadataName(typeof(SyncViewComponentWithNonGenericTask).FullName);
// Act
var descriptor = factory.CreateDescriptor(viewComponent);
// Assert
var diagnostic = Assert.Single(descriptor.GetAllDiagnostics());
Assert.Equal(RazorExtensionsDiagnosticFactory.ViewComponent_SyncMethod_CannotReturnTask.Id, diagnostic.Id);
}
[Fact]
public void CreateDescriptor_ForViewComponentWithInvoke_DoesNotUnderstandGenericTask()
{
// Arrange
var testCompilation = TestCompilation.Create(_assembly);
var factory = new ViewComponentTagHelperDescriptorFactory(testCompilation);
var viewComponent = testCompilation.GetTypeByMetadataName(typeof(SyncViewComponentWithGenericTask).FullName);
// Act
var descriptor = factory.CreateDescriptor(viewComponent);
// Assert
var diagnostic = Assert.Single(descriptor.GetAllDiagnostics());
Assert.Equal(RazorExtensionsDiagnosticFactory.ViewComponent_SyncMethod_CannotReturnTask.Id, diagnostic.Id);
}
}
public class StringParameterViewComponent
{
public string Invoke(string foo, string bar) => null;
}
public class VariousParameterViewComponent
{
public string Invoke(TestEnum testEnum, string testString, int baz = 5) => null;
public enum TestEnum
{
A = 1,
B = 2,
C = 3
}
}
public class GenericParameterViewComponent
{
public string Invoke(List<string> Foo, Dictionary<string, int> Bar) => null;
}
public class ViewComponentWithoutInvokeMethod
{
}
public class AsyncViewComponentWithGenericTask
{
public Task<string> InvokeAsync() => null;
}
public class AsyncViewComponentWithNonGenericTask
{
public Task InvokeAsync() => null;
}
public class AsyncViewComponentWithVoid
{
public void InvokeAsync() { }
}
public class AsyncViewComponentWithString
{
public string InvokeAsync() => null;
}
public class SyncViewComponentWithVoid
{
public void Invoke() { }
}
public class SyncViewComponentWithNonGenericTask
{
public Task Invoke() => null;
}
public class SyncViewComponentWithGenericTask
{
public Task<string> Invoke() => null;
}
} | 42.504373 | 189 | 0.647438 | [
"Apache-2.0"
] | 1175169074/aspnetcore | src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/test/ViewComponentTagHelperDescriptorFactoryTest.cs | 14,579 | C# |
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HandyControl.Controls;
using HandyControl.Data;
using PublicInfos;
namespace me.cqp.luohuaming.CustomGacha.UI
{
public static class Helper
{
public enum NoticeEnum
{
Error,
Info,
Success,
}
public static void ShowGrowlMsg(string msg, NoticeEnum notice = NoticeEnum.Success, int showTime = 2)
{
GrowlInfo info = new GrowlInfo
{
Message = msg,
WaitTime = showTime
};
switch (notice)
{
case NoticeEnum.Error:
Growl.Error(info);
break;
case NoticeEnum.Info:
Growl.Info(info);
break;
case NoticeEnum.Success:
Growl.Success(info);
break;
default:
break;
}
}
public static ObservableCollection<T> List2ObservableCollection<T>(List<T> content)
{
ObservableCollection<T> tmp = new ObservableCollection<T>();
content.ForEach(x => tmp.Add(x));
return tmp;
}
public static ObservableCollection<T> ToPageList<T>(ObservableCollection<T> ls, int pageIndex, int pageCount)
{
return List2ObservableCollection(ToPageList<T>(ls.ToList(), pageIndex, pageCount));
}
public static List<T> ToPageList<T>(List<T> ls, int pageIndex, int pageCount)
{
List<T> result = new List<T>();
if (ls.Count < pageIndex * pageCount)
{
int index = (pageIndex - 1) * pageCount;
result = ls.GetRange(index, ls.Count - (index));
}
else
{
int index = (pageIndex - 1) * pageCount;
result = ls.GetRange(index, pageCount);
}
return result;
}
public static int GetVersionOrDefault()
{
if (MainSave.CQApi == null)
{
return 115;
}
string version = MainSave.CQApi.AppInfo.Version.ToString();
return Convert.ToInt32(version.Replace(".", ""));
}
public static string ParseVerID2String(int VersionID)
{
string c = VersionID.ToString();
return $"{c.Substring(0, c.Length - 2)}.{c.Substring(c.Length - 2, 1)}.{c.Substring(c.Length - 1, 1)}";
}
}
}
| 31.267442 | 117 | 0.514689 | [
"Apache-2.0"
] | Hellobaka/CustomGacha | me.cqp.luohuaming.CustomGacha.UI/Helper.cs | 2,691 | C# |
namespace Binance.Spot.Tests
{
using Binance.Spot.Models;
using Xunit;
public class LoanDirection_Tests
{
[Fact]
public void ToString_Matches_Value()
{
var model = LoanDirection.ADDITIONAL;
Assert.Equal(model.Value.ToString(), model.ToString());
}
}
} | 20.5625 | 67 | 0.595745 | [
"MIT"
] | Hilaly/binance-connector-dotnet | Tests/Spot.Tests/Models/LoanDirection_Tests.cs | 329 | C# |
using System.Collections.Generic;
using Fabric.Authorization.API.Models;
using Fabric.Authorization.API.Models.Requests;
using Nancy;
using Nancy.Swagger;
using Nancy.Swagger.Services;
using Nancy.Swagger.Services.RouteUtils;
using Swagger.ObjectModel;
namespace Fabric.Authorization.API.Modules
{
public class GroupsMetadataModule : BaseMetadataModule
{
private readonly Parameter _grainParameter = new Parameter
{
Name = "grain",
Description = "grain",
Required = false,
Type = "string",
In = ParameterIn.Query
};
private readonly Parameter _groupNameParameter = new Parameter
{
Name = "groupName",
Description = "The name of the group",
Required = true,
Type = "string",
In = ParameterIn.Path
};
private readonly Tag _groupsTag = new Tag { Name = "Groups", Description = "Operations for managing groups" };
private readonly Parameter _securableItemParameter = new Parameter
{
Name = "securableItem",
Description = "securable item",
Required = false,
Type = "string",
In = ParameterIn.Query
};
private readonly Parameter _subjectIdParameter = new Parameter
{
Name = "subjectId",
Description = "Subject ID of the user",
Type = "string",
Required = true,
In = ParameterIn.Body
};
private readonly Parameter _identityProviderParameter = new Parameter
{
Name = "identityProvider",
Description = "3rd party identity provider (IdP) of the user",
Type = "string",
Required = true,
In = ParameterIn.Body
};
public GroupsMetadataModule(ISwaggerModelCatalog modelCatalog, ISwaggerTagCatalog tagCatalog)
: base(modelCatalog, tagCatalog)
{
modelCatalog.AddModels(
typeof(GroupRoleApiModel),
typeof(GroupUserApiModel),
typeof(PermissionApiModel),
typeof(PermissionAction),
typeof(RoleApiModel),
typeof(UserApiModel),
typeof(UserIdentifierApiRequest),
typeof(RoleIdentifierApiRequest),
typeof(GroupPatchApiRequest));
RouteDescriber.DescribeRouteWithParams(
"AddGroup",
"GroupSource can be either \"Custom\" for creating custom groups in Fabric or the displayName of the 3rd party identity provider if the group is from an external Idp. If groupSource is empty, it will be defaulted to the group source defined in the appsettings.json",
"Adds a new group",
new List<HttpResponseMetadata>
{
new HttpResponseMetadata<GroupRoleApiModel>
{
Code = (int) HttpStatusCode.Created,
Message = "Created"
},
new HttpResponseMetadata
{
Code = (int) HttpStatusCode.Forbidden,
Message = "Client does not have access"
},
new HttpResponseMetadata<Error>
{
Code = (int) HttpStatusCode.Conflict,
Message = "Group already exists"
},
new HttpResponseMetadata<Error>
{
Code = (int) HttpStatusCode.UnsupportedMediaType,
Message = "Content-Type header was not included in request"
}
},
new[]
{
new BodyParameter<GroupRoleApiModel>(modelCatalog)
{
Name = "Group",
Description = "The group to add"
}
},
new[]
{
_groupsTag
}).SecurityRequirement(OAuth2ReadWriteScopeBuilder);
RouteDescriber.DescribeRouteWithParams(
"UpdateGroup",
"",
"Updates an existing group",
new[]
{
new HttpResponseMetadata<GroupRoleApiModel>
{
Code = (int) HttpStatusCode.OK,
Message = "Updated"
},
new HttpResponseMetadata
{
Code = (int) HttpStatusCode.Forbidden,
Message = "Client does not have access"
},
new HttpResponseMetadata<Error>
{
Code = (int) HttpStatusCode.NotFound,
Message = "Group with specified name does not exist"
}
,
new HttpResponseMetadata<Error>
{
Code = (int) HttpStatusCode.UnsupportedMediaType,
Message = "Content-Type header was not included in request"
}
},
new[]
{
_groupNameParameter,
new BodyParameter<GroupPatchApiRequest>(modelCatalog)
{
Name = "GroupPatchApiRequest",
Description = "The model containing the fields to update (currently only DisplayName and Description can be modified)"
}
},
new[]
{
_groupsTag
}).SecurityRequirement(OAuth2WriteScopeBuilder);
RouteDescriber.DescribeRouteWithParams(
"UpdateGroups",
"",
"Updates a list of groups, useful for syncing 3rd party ID Provider groups with Fabric.Authorization groups.",
new List<HttpResponseMetadata>
{
new HttpResponseMetadata
{
Code = (int) HttpStatusCode.NoContent,
Message = "Groups updated"
},
new HttpResponseMetadata
{
Code = (int) HttpStatusCode.Forbidden,
Message = "Client does not have access"
},
new HttpResponseMetadata<Error>
{
Code = (int) HttpStatusCode.Conflict,
Message = "Group already exists"
},
new HttpResponseMetadata<Error>
{
Code = (int) HttpStatusCode.UnsupportedMediaType,
Message = "Content-Type header was not included in request"
}
},
new[]
{
new BodyParameter<IEnumerable<GroupRoleApiModel>>(modelCatalog)
{
Name = "Group",
Description = "The groups to update"
}
},
new[]
{
_groupsTag
}).SecurityRequirement(OAuth2WriteScopeBuilder);
RouteDescriber.DescribeRouteWithParams(
"GetGroup",
"",
"Gets a group by name",
new List<HttpResponseMetadata>
{
new HttpResponseMetadata<GroupRoleApiModel>
{
Code = (int) HttpStatusCode.OK,
Message = "OK"
},
new HttpResponseMetadata
{
Code = (int) HttpStatusCode.Forbidden,
Message = "Client does not have access"
},
new HttpResponseMetadata<Error>
{
Code = (int) HttpStatusCode.NotFound,
Message = "Group with specified name was not found"
}
},
new[]
{
_groupNameParameter
},
new[]
{
_groupsTag
}).SecurityRequirement(OAuth2ReadScopeBuilder);
RouteDescriber.DescribeRouteWithParams(
"GetGroups",
"",
"Gets groups by name and an optional type",
new List<HttpResponseMetadata>
{
new HttpResponseMetadata<GroupRoleApiModel>
{
Code = (int) HttpStatusCode.OK,
Message = "OK"
},
new HttpResponseMetadata
{
Code = (int) HttpStatusCode.Forbidden,
Message = "Client does not have access"
},
new HttpResponseMetadata<Error>
{
Code = (int) HttpStatusCode.BadRequest,
Message = "No name parameter was provided or an invalid type parameter was provided"
}
},
new[]
{
new Parameter()
{
Name = "name",
Description = "the group name",
Required = true,
Type = "string",
In = ParameterIn.Query
},
new Parameter()
{
Name = "type",
Description = "the type of group, either 'custom' or 'directory'",
Required = false,
Type = "string",
In = ParameterIn.Query
}
},
new[]
{
_groupsTag
}).SecurityRequirement(OAuth2ReadScopeBuilder);
RouteDescriber.DescribeRouteWithParams(
"DeleteGroup",
"",
"Deletes a group",
new List<HttpResponseMetadata>
{
new HttpResponseMetadata
{
Code = (int) HttpStatusCode.NoContent,
Message = "Group deleted"
},
new HttpResponseMetadata
{
Code = (int) HttpStatusCode.Forbidden,
Message = "Client does not have access"
},
new HttpResponseMetadata<Error>
{
Code = (int) HttpStatusCode.NotFound,
Message = "Group with specified name was not found"
}
},
new[]
{
_groupNameParameter
},
new[]
{
_groupsTag
}).SecurityRequirement(OAuth2WriteScopeBuilder);
#region Group -> Role Mapping Docs
RouteDescriber.DescribeRouteWithParams(
"GetRolesFromGroup",
"",
"Gets roles for a group by group name",
new List<HttpResponseMetadata>
{
new HttpResponseMetadata<IEnumerable<RoleApiModel>>
{
Code = (int) HttpStatusCode.OK,
Message = "OK"
},
new HttpResponseMetadata
{
Code = (int) HttpStatusCode.Forbidden,
Message = "Client does not have access"
},
new HttpResponseMetadata<Error>
{
Code = (int) HttpStatusCode.NotFound,
Message = "Group with specified name was not found"
}
},
new[]
{
_groupNameParameter,
_securableItemParameter,
_grainParameter
},
new[]
{
_groupsTag
}).SecurityRequirement(OAuth2ReadScopeBuilder);
RouteDescriber.DescribeRouteWithParams(
"AddRolesToGroup",
"",
"Adds a collection of roles to a group",
new List<HttpResponseMetadata>
{
new HttpResponseMetadata<GroupRoleApiModel>
{
Code = (int) HttpStatusCode.OK,
Message = "Roles added to group"
},
new HttpResponseMetadata
{
Code = (int) HttpStatusCode.Forbidden,
Message = "Client does not have access or User does not have access to add the specified roles."
},
new HttpResponseMetadata<Error>
{
Code = (int) HttpStatusCode.NotFound,
Message = "Group with specified name was not found or the role was not found"
},
new HttpResponseMetadata<Error>
{
Code = (int) HttpStatusCode.Conflict,
Message = "Role with specified name already exists for the group"
},
new HttpResponseMetadata<Error>
{
Code = (int) HttpStatusCode.BadRequest,
Message = "List of roles in body failed validation"
},
new HttpResponseMetadata<Error>
{
Code = (int) HttpStatusCode.UnsupportedMediaType,
Message = "Content-Type header was not included in request"
}
},
new[]
{
_groupNameParameter,
new BodyParameter<List<RoleApiModel>>(modelCatalog)
{
Name = "Roles",
Description = "The roles to add"
}
},
new[]
{
_groupsTag
}).SecurityRequirement(OAuth2WriteScopeBuilder);
RouteDescriber.DescribeRouteWithParams(
"DeleteRolesFromGroup",
"",
"Deletes 1 or more roles from a group",
new List<HttpResponseMetadata>
{
new HttpResponseMetadata<GroupRoleApiModel>
{
Code = (int) HttpStatusCode.OK,
Message = "Updated group entity including any mapped roles"
},
new HttpResponseMetadata<Error>
{
Code = (int) HttpStatusCode.Forbidden,
Message = "Client does not have access"
},
new HttpResponseMetadata<Error>
{
Code = (int) HttpStatusCode.NotFound,
Message = "Group with specified name was not found or the role was not found"
}
},
new[]
{
_groupNameParameter,
new BodyParameter<List<RoleIdentifierApiRequest>>(modelCatalog)
{
Name = "Roles",
Description = "The roles to delete"
}
},
new[]
{
_groupsTag
}).SecurityRequirement(OAuth2WriteScopeBuilder);
#endregion
#region Group -> User Mapping Docs
RouteDescriber.DescribeRouteWithParams(
"GetUsersFromGroup",
"",
"Gets users for a custom group by group name",
new List<HttpResponseMetadata>
{
new HttpResponseMetadata<IEnumerable<UserApiModel>>
{
Code = (int) HttpStatusCode.OK,
Message = "OK"
},
new HttpResponseMetadata<Error>
{
Code = (int) HttpStatusCode.Forbidden,
Message = "Client does not have access"
},
new HttpResponseMetadata<Error>
{
Code = (int) HttpStatusCode.NotFound,
Message = "Group with specified name was not found"
}
},
new[]
{
_groupNameParameter
},
new[]
{
_groupsTag
}).SecurityRequirement(OAuth2ReadScopeBuilder);
RouteDescriber.DescribeRouteWithParams(
"AddUsersToGroup",
"1) This operation is only valid for custom groups. 2) The user specified by SubjectId parameter will be added silently if not found.",
"Adds 1 or more users to a group.",
new List<HttpResponseMetadata>
{
new HttpResponseMetadata<GroupUserApiModel>
{
Code = (int) HttpStatusCode.Created,
Message = "Created"
},
new HttpResponseMetadata<Error>
{
Code = (int) HttpStatusCode.Forbidden,
Message = "Client does not have access"
},
new HttpResponseMetadata<Error>
{
Code = (int) HttpStatusCode.NotFound,
Message = "Group with specified name was not found"
},
new HttpResponseMetadata<Error>
{
Code = (int) HttpStatusCode.BadRequest,
Message = "Subject Id or Identity Provider were missing or group is not a custom group"
},
new HttpResponseMetadata<Error>
{
Code = (int) HttpStatusCode.Conflict,
Message = "User is already a member of the group"
},
new HttpResponseMetadata<Error>
{
Code = (int) HttpStatusCode.UnsupportedMediaType,
Message = "Content-Type header was not included in request"
}
},
new[]
{
_groupNameParameter,
new BodyParameter<List<UserIdentifierApiRequest>>(modelCatalog)
{
Name = "Users",
Description = "The users to add"
}
},
new[]
{
_groupsTag
}).SecurityRequirement(OAuth2WriteScopeBuilder);
RouteDescriber.DescribeRouteWithParams(
"DeleteUserFromGroup",
"",
"Deletes a user from a group",
new List<HttpResponseMetadata>
{
new HttpResponseMetadata<GroupUserApiModel>
{
Code = (int) HttpStatusCode.OK,
Message = "Updated group entity including any mapped users"
},
new HttpResponseMetadata<Error>
{
Code = (int) HttpStatusCode.Forbidden,
Message = "Client does not have access"
},
new HttpResponseMetadata<Error>
{
Code = (int) HttpStatusCode.NotFound,
Message = "Group with specified name was not found or the user was not found"
}
},
new[]
{
_groupNameParameter,
_subjectIdParameter,
_identityProviderParameter
},
new[]
{
_groupsTag
}).SecurityRequirement(OAuth2WriteScopeBuilder);
#endregion
}
}
} | 39.843636 | 283 | 0.415579 | [
"Apache-2.0"
] | nathan-given-health-catalyst/Fabric.Authorization | Fabric.Authorization.API/Modules/GroupsMetadataModule.cs | 21,916 | C# |
// Generated class v2.13.0.0, don't modify
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
namespace NHtmlUnit.Javascript.Host.Css
{
public partial class CSSRule : NHtmlUnit.Javascript.SimpleScriptable
{
static CSSRule()
{
ObjectWrapper.RegisterWrapperCreator((com.gargoylesoftware.htmlunit.javascript.host.css.CSSRule o) =>
new CSSRule(o));
}
public CSSRule(com.gargoylesoftware.htmlunit.javascript.host.css.CSSRule wrappedObject) : base(wrappedObject) {}
public new com.gargoylesoftware.htmlunit.javascript.host.css.CSSRule WObj
{
get { return (com.gargoylesoftware.htmlunit.javascript.host.css.CSSRule)WrappedObject; }
}
public System.Int16 Type
{
get
{
return WObj.getType();
}
}
public System.String CssText
{
get
{
return WObj.getCssText();
}
set
{
WObj.setCssText(value);
}
}
public NHtmlUnit.Javascript.Host.Css.CSSStyleSheet ParentStyleSheet
{
get
{
return ObjectWrapper.CreateWrapper<NHtmlUnit.Javascript.Host.Css.CSSStyleSheet>(
WObj.getParentStyleSheet());
}
}
public NHtmlUnit.Javascript.Host.Css.CSSRule ParentRule
{
get
{
return ObjectWrapper.CreateWrapper<NHtmlUnit.Javascript.Host.Css.CSSRule>(
WObj.getParentRule());
}
}
}
}
| 23.098592 | 119 | 0.593293 | [
"Apache-2.0"
] | timorzadir/NHtmlUnit | app/NHtmlUnit/Generated/Javascript/Host/Css/CSSRule.cs | 1,640 | C# |
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
namespace HotChocolate.Data.Projections.Expressions
{
public static class QueryableProjectionScopeExtensions
{
public static Expression<Func<T, T>> Project<T>(this QueryableProjectionScope scope)
{
return (Expression<Func<T, T>>)scope.CreateMemberInitLambda();
}
public static Expression CreateMemberInit(this QueryableProjectionScope scope)
{
if (scope.HasAbstractTypes())
{
Expression lastValue = Expression.Default(scope.RuntimeType);
foreach (KeyValuePair<Type, Queue<MemberAssignment>> val in
scope.GetAbstractTypes())
{
NewExpression ctor = Expression.New(val.Key);
Expression memberInit = Expression.MemberInit(ctor, val.Value);
lastValue = Expression.Condition(
Expression.TypeIs(scope.Instance.Peek(), val.Key),
Expression.Convert(memberInit, scope.RuntimeType),
lastValue);
}
return lastValue;
}
else
{
NewExpression ctor = Expression.New(scope.RuntimeType);
return Expression.MemberInit(ctor, scope.Level.Peek());
}
}
public static Expression CreateMemberInitLambda(this QueryableProjectionScope scope)
{
return Expression.Lambda(scope.CreateMemberInit(), scope.Parameter);
}
public static Expression CreateSelection(
this QueryableProjectionScope scope,
Expression source,
Type sourceType)
{
MethodCallExpression selection = Expression.Call(
typeof(Enumerable),
nameof(Enumerable.Select),
new[]
{
scope.RuntimeType,
scope.RuntimeType
},
source,
scope.CreateMemberInitLambda());
if (sourceType.IsArray)
{
return ToArray(scope, selection);
}
if (TryGetSetType(sourceType, out Type? setType))
{
return ToSet(selection, setType);
}
return ToList(scope, selection);
}
private static Expression ToArray(QueryableProjectionScope scope, Expression source)
{
return Expression.Call(
typeof(Enumerable),
nameof(Enumerable.ToArray),
new[]
{
scope.RuntimeType
},
source);
}
private static Expression ToList(QueryableProjectionScope scope, Expression source)
{
return Expression.Call(
typeof(Enumerable),
nameof(Enumerable.ToList),
new[]
{
scope.RuntimeType
},
source);
}
private static Expression ToSet(
Expression source,
Type setType)
{
Type typedGeneric =
setType.MakeGenericType(source.Type.GetGenericArguments()[0]);
ConstructorInfo? ctor =
typedGeneric.GetConstructor(new[]
{
source.Type
});
if (ctor is null)
{
throw new InvalidOperationException();
}
return Expression.New(ctor, source);
}
private static bool TryGetSetType(
Type type,
[NotNullWhen(true)] out Type? setType)
{
if (type.IsGenericType)
{
Type typeDefinition = type.GetGenericTypeDefinition();
if (typeDefinition == typeof(ISet<>) ||
typeDefinition == typeof(HashSet<>))
{
setType = typeof(HashSet<>);
return true;
}
if (typeDefinition == typeof(SortedSet<>))
{
setType = typeof(SortedSet<>);
return true;
}
}
setType = default;
return false;
}
}
}
| 30.402685 | 92 | 0.503091 | [
"MIT"
] | Alxandr/hotchocolate | src/HotChocolate/Data/src/Data/Projections/Expressions/QueryableProjectionScopeExtensions.cs | 4,530 | C# |
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Security;
using System.Text.RegularExpressions;
using System.Xml;
using Common;
using log4net;
using ServiceStack;
namespace PluginTester
{
public class Program
{
private static ILog _log;
public static void Main(string[] args)
{
Environment.ExitCode = 1;
try
{
ConfigureLogging();
var program = new Program();
program.ParseArgs(args);
program.Run();
Environment.ExitCode = 0;
}
catch (ExpectedException exception)
{
_log.Error(exception.Message);
}
catch (Exception exception)
{
_log.Error("Unhandled exception", exception);
}
}
private static void ConfigureLogging()
{
using (var stream = new MemoryStream(LoadEmbeddedResource("log4net.config")))
using (var reader = new StreamReader(stream))
{
var xml = new XmlDocument();
xml.LoadXml(reader.ReadToEnd());
log4net.Config.XmlConfigurator.Configure(xml.DocumentElement);
_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
}
}
private static byte[] LoadEmbeddedResource(string path)
{
// ReSharper disable once PossibleNullReferenceException
var resourceName = $"{MethodBase.GetCurrentMethod().DeclaringType.Namespace}.{path}";
using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName))
{
if (stream == null)
throw new ExpectedException($"Can't load '{resourceName}' as embedded resource.");
return stream.ReadFully();
}
}
private Context Context { get; } = new Context();
private void ParseArgs(string[] args)
{
var options = new[]
{
new CommandLineOption { Description = "Specify the plugin to be tested" },
new CommandLineOption
{
Key = "Plugin",
Setter = value => Context.PluginPath = value,
Getter = () => Context.PluginPath,
Description = "Path to the plugin assembly. Can be a folder, a DLL, or a packaged *.plugin file."
},
new CommandLineOption
{
Key = nameof(Context.Verbose),
Setter = value => Context.Verbose = bool.Parse(value),
Getter = () => $"{Context.Verbose}",
Description = "Enables verbose logging of assembly loading logic."
},
new CommandLineOption
{
Key = nameof(Context.FrameworkAssemblyPath),
Setter = value => Context.FrameworkAssemblyPath = value,
Getter = () => Context.FrameworkAssemblyPath,
Description = "Optional path to the FieldDataPluginFramework.dll assembly. [default: Test using the latest framework version]"
},
new CommandLineOption(), new CommandLineOption { Description = "Test data settings" },
new CommandLineOption
{
Key = "Data",
Setter = value => AddDataPath(Context, value),
Getter = () => string.Empty,
Description = "Path to the data file to be parsed. Can be set more than once."
},
new CommandLineOption
{
Key = nameof(Context.RecursiveSearch),
Setter = value => Context.RecursiveSearch = bool.Parse(value),
Getter = () => $"{Context.RecursiveSearch}",
Description = "Search /Data directories recursively. -R shortcut is also supported."
},
new CommandLineOption
{
Key = "Setting",
Setter = value => AddSetting(Context, value),
Getter = () => string.Empty,
Description = "Supply plugin settings as 'key=text' or 'key=@pathToTextFile' values."
},
new CommandLineOption(), new CommandLineOption { Description = "Plugin context settings" },
new CommandLineOption
{
Key = "Location",
Setter = value => Context.LocationIdentifier = value,
Getter = () => Context.LocationIdentifier,
Description = "Optional location identifier context"
},
new CommandLineOption
{
Key = "UtcOffset",
Setter = value => Context.LocationUtcOffset = TimeSpan.Parse(value),
Getter = () => Context.LocationUtcOffset.ToString(),
Description = "UTC offset in .NET TimeSpan format."
},
new CommandLineOption(), new CommandLineOption { Description = "Output settings" },
new CommandLineOption
{
Key = "Json",
Setter = value => Context.JsonPath = value,
Getter = () => Context.JsonPath,
Description = "Optional path (file or folder) to write the appended results as JSON."
},
new CommandLineOption(), new CommandLineOption { Description = "Expected response settings" },
new CommandLineOption
{
Key = nameof(Context.ExpectedError),
Setter = value => Context.ExpectedError = value,
Getter = () => Context.ExpectedError,
Description = "Expected error message"
},
new CommandLineOption
{
Key = nameof(Context.ExpectedStatus),
Setter = value => Context.ExpectedStatus = (StatusType)Enum.Parse(typeof(StatusType), value, true),
Getter = () => Context.ExpectedStatus.ToString(),
Description = $"Expected parse status. One of {string.Join(", ", Enum.GetNames(typeof(StatusType)))}"
},
};
var usageMessage = CommandLineUsage.ComposeUsageText(
"Parse a file using a field data plugin, logging the results.", options);
var optionResolver = new CommandLineOptionResolver();
optionResolver.Resolve(args, options, usageMessage, arg => PositionalArgumentResolver(Context, arg));
if (string.IsNullOrEmpty(Context.PluginPath))
throw new ExpectedException("No plugin assembly specified.");
if (!Context.DataPaths.Any())
throw new ExpectedException("No data file specified.");
}
private bool PositionalArgumentResolver(Context context, string arg)
{
if (RecursiveShortcuts.Contains(arg))
{
Context.RecursiveSearch = true;
return true;
}
var match = SettingRegex.Match(arg);
if (match.Success)
{
AddSetting(context, arg);
return true;
}
return false;
}
private static readonly HashSet<string> RecursiveShortcuts =
new HashSet<string>(StringComparer.InvariantCultureIgnoreCase)
{
"-r",
"/r"
};
private static void AddSetting(Context context, string value)
{
var match = SettingRegex.Match(value);
if (!match.Success)
throw new ExpectedException($"'{value}' does not match a key=text or key=@pathToTextFile setting.");
var key = match.Groups["key"].Value;
var text = match.Groups["text"].Value;
var pathToText = match.Groups["pathToTextFile"].Value;
context.Settings[key] = !string.IsNullOrWhiteSpace(pathToText)
? File.ReadAllText(pathToText)
: text;
}
private static readonly Regex SettingRegex = new Regex(@"^\s*(?<key>\w+)\s*=\s*(@(?<pathToTextFile>.+)|(?<text>.+))$");
private static void AddDataPath(Context context, string dataPath)
{
foreach (var path in ExpandDataPath(context, dataPath))
{
context.DataPaths.Add(path);
}
}
private static IEnumerable<string> ExpandDataPath(Context context, string path)
{
var dir = Path.GetDirectoryName(path);
var filename = Path.GetFileName(path);
if (string.IsNullOrEmpty(dir) || string.IsNullOrEmpty(filename))
{
yield return path;
}
else
{
var searchDepth = context.RecursiveSearch
? SearchOption.AllDirectories
: SearchOption.TopDirectoryOnly;
foreach (var expandedPath in Directory.GetFiles(dir, filename, searchDepth))
{
yield return expandedPath;
}
}
}
private void Run()
{
LoadFrameworkAssembly();
new Tester {Context = Context}
.Run();
}
private void LoadFrameworkAssembly()
{
if (string.IsNullOrWhiteSpace(Context.FrameworkAssemblyPath))
return;
if (!File.Exists(Context.FrameworkAssemblyPath))
throw new ExpectedException($"Can't find framework assembly at '{Context.FrameworkAssemblyPath}'.");
var assembly = LoadFrameworkAssembly(Context.FrameworkAssemblyPath);
const string targetName = "FieldDataPluginFramework.IFieldDataPlugin";
var interfaceDefinitionType = assembly.GetTypes()
.FirstOrDefault(type => type.FullName == targetName);
if (interfaceDefinitionType == null)
throw new ExpectedException($"Can't find {targetName} in '{Context.FrameworkAssemblyPath}'");
_log.Info($"Loaded external framework assembly '{assembly.FullName}' from '{Context.FrameworkAssemblyPath}'.");
}
private Assembly LoadFrameworkAssembly(string path)
{
try
{
return Assembly.LoadFile(path);
}
catch (Exception exception)
{
switch (exception)
{
case ReflectionTypeLoadException loadException:
throw new ExpectedException($"Can't load '{path}': {SummarizeLoaderExceptions(loadException)}");
case BadImageFormatException _:
case FileLoadException _:
case SecurityException _:
throw new ExpectedException($"Can't load '{path}': {exception.Message}");
default:
_log.Error($"Unexpected Assembly.LoadFile('{path}') exception: {exception.GetType().Name}: {exception.Message}");
throw;
}
}
}
private static string SummarizeLoaderExceptions(ReflectionTypeLoadException exception)
{
if (exception.LoaderExceptions == null)
return string.Empty;
return string.Join("\n", exception.LoaderExceptions.Select(e => e.Message));
}
}
}
| 38.285256 | 146 | 0.530013 | [
"Apache-2.0"
] | AquaticInformatics/aquarius-field-data-framework | src/PluginTester/Program.cs | 11,947 | C# |
using System;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.Generic;
using MathNet.Numerics.LinearAlgebra;
namespace Advent._2020.Classes
{
public enum SeatType
{
Floor,
Empty,
Occupied
}
public class Seat
{
public const char Floor = '.';
public const char Empty = 'L';
public const char Occupied = '#';
public static readonly Vector<double>[] Directions = new Vector<double>[]
{
CreateVector.Dense(new double[] { 1.0, 0.0 }), //< Right
CreateVector.Dense(new double[] { -1.0, 0.0 }), //< Left
CreateVector.Dense(new double[] { 0.0, 1.0 }), //< 'Up'
CreateVector.Dense(new double[] { 0.0, -1.0 }), //< 'Down'
CreateVector.Dense(new double[] { 1.0, 1.0 }), //< 'Up'- right
CreateVector.Dense(new double[] { 1.0, -1.0 }), //< 'Down'- right
CreateVector.Dense(new double[] { -1.0, 1.0 }), //< 'Up'- left
CreateVector.Dense(new double[] { -1.0, -1.0 }), //< 'Down'- left
};
public int X { get; } = -1;
public int Y { get; } = -1;
public SeatType Type { get; set; } = SeatType.Floor;
public Seat(int x, int y, char seat)
{
this.X = x;
this.Y = y;
this.Type = GetType(seat);
}
public bool IsSeat()
{
return Type != SeatType.Floor;
}
public static SeatType GetType(char seat)
{
switch (seat)
{
case Empty:
return SeatType.Empty;
case Occupied:
return SeatType.Occupied;
case Floor:
default:
return SeatType.Floor;
}
}
public static List<int[]> GetNeighbours(Seat s, SeatingMap map)
{
return map.SearchFirstVisible ? GetVisiblePositions(s, map) : GetAdjacentPositions(s, map);
}
private static List<int[]> GetAdjacentPositions(Seat s, SeatingMap map)
{
//< Bleh
var adj = new List<int[]>();
foreach (int x in Enumerable.Range(s.X - 1, 3))
{
foreach (int y in Enumerable.Range(s.Y - 1, 3))
{
if (x == s.X && y == s.Y)
continue;
var pos = new int[] { x, y };
if (map.IsValid(pos))
{
adj.Add(pos);
}
}
}
return adj;
}
private static List<int[]> GetVisiblePositions(Seat s, SeatingMap map)
{
var startPos = new int[] { s.X, s.Y };
var seats = new List<int[]>();
foreach (var dir in Directions)
{
//< Get the 'next' position along this direction
var pos = GetNextPosition(startPos, dir);
//< While the 'next' position is valid (to the map) -> check if it's a seat mafk
while (map.IsValid(pos))
{
//< Check if we're a seat - if so, grab that position and halt (first visible)
if (map.Grid[pos[0], pos[1]].IsSeat())
{
seats.Add(pos);
break;
}
//< Move onto the next position
pos = GetNextPosition(pos, dir);
}
}
return seats;
}
private static int[] GetNextPosition(int[] pos, Vector<double> dir)
{
return new int[] { pos[0] + (int)dir[0], pos[1] + (int)dir[1] };
}
}
public class SeatChange
{
public Seat Source { get; } = null;
public SeatType NewType { get; } = SeatType.Floor;
public int X => Source.X;
public int Y => Source.Y;
public SeatChange(Seat src, SeatType newType)
{
this.Source = src;
this.NewType = newType;
}
}
public class SeatingMap
{
public int Width { get; } = 0;
public int Height { get; } = 0;
public Seat[,] Grid { get; private set; } = null;
public List<Seat> Seats { get; private set; } = null;
public int Steps { get; private set; } = 0;
public int Occupied => Seats.Count(x => x.Type == SeatType.Occupied);
public int Tolerance { get; } = 4;
public bool SearchFirstVisible { get; } = false;
public SeatingMap(IEnumerable<string> input, int tolerance = 4, bool searchFirstVisible = false)
{
//< Parse Width/Height
this.Width = input.First().Length;
this.Height = input.Count();
//< Assign the 'visible occupied seat tolerance' and how we search
this.Tolerance = tolerance;
this.SearchFirstVisible = searchFirstVisible;
//< Make dat Grid in memory, boah
this.Grid = new Seat[Width, Height];
this.Seats = new List<Seat>();
//< Populate them shits
for (int y = 0; y < Height; y++)
{
string line = input.ElementAt(y);
for (int x = 0; x < Width; x++)
{
Grid[x, y] = new Seat(x, y, line[x]);
if (Grid[x, y].IsSeat())
{
//< Retain list of all non-floor locations for later use
Seats.Add(Grid[x, y]);
}
}
}
}
public bool IsValid(int[] pos)
{
var bX = pos[0] >= 0 && pos[0] < Width;
var bY = pos[1] >= 0 && pos[1] < Height;
return (bX && bY);
}
public void SimulateSeating()
{
Steps = 0;
List<SeatChange> changes = new List<SeatChange>();
while (changes.Count > 0 || Steps == 0)
{
//< Get all changes to seats
changes = GetChanges();
//< Apply changes
ApplyChanges(changes);
//< Update 'Step' index
Steps++;
}
}
private List<SeatChange> GetChanges()
{
var changes = new List<SeatChange>();
foreach (var seat in Seats)
{
//< Check if it's changing - generate SeatChange if it does
var change = GetChange(seat);
if (change != null)
{
changes.Add(change);
}
}
return changes;
}
private void ApplyChanges(List<SeatChange> changes)
{
foreach (var change in changes)
{
Grid[change.X, change.Y].Type = change.NewType;
}
}
private SeatChange GetChange(Seat seat)
{
//< Get all neighbour seats to be checked
var neighs = Seat.GetNeighbours(seat, this);
if (seat.Type == SeatType.Empty)
{
if (CheckPositions(neighs, _EmptyTypes))
{
return new SeatChange(seat, SeatType.Occupied);
}
}
else if (seat.Type == SeatType.Occupied)
{
if (CheckPositions(neighs, _OccupiedTypes, Tolerance))
{
return new SeatChange(seat, SeatType.Empty);
}
}
//< No change - return null
return null;
}
private static readonly SeatType[] _EmptyTypes = new SeatType[] { SeatType.Empty, SeatType.Floor };
private static readonly SeatType[] _OccupiedTypes = new SeatType[] { SeatType.Occupied };
private bool CheckPositions(IEnumerable<int[]> seats, SeatType[] types, int? numToMatch = null)
{
int countMatch = 0;
foreach (var seat in seats)
{
if (types.Contains(Grid[seat[0], seat[1]].Type))
{
countMatch++;
}
}
if (numToMatch.HasValue)
return countMatch >= numToMatch;
else
return (countMatch == seats.Count());
}
}
}
| 31.408088 | 107 | 0.460728 | [
"MIT"
] | gclodge/Advent.2020 | Advent.2020/Classes/SeatingMap.cs | 8,545 | C# |
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class FollowTarget : MonoBehaviour
{
public Transform target;
public float xLimit, yLimit;
private void LateUpdate()
{
Vector3 follow = Vector3.zero;
//calcula el offset en x
float offX = target.position.x - transform.position.x;
if (offX > xLimit)
{
follow.x = offX - xLimit;
}
else if (offX < -xLimit)
{
follow.x = offX + xLimit;
}
//calcula el offset en y
float offY = target.position.y - transform.position.y;
if (offY > yLimit)
{
follow.y = offY - yLimit;
}
else if (offY < -yLimit)
{
follow.y = offY + yLimit;
}
transform.Translate(follow);
}
} | 23.447368 | 63 | 0.516274 | [
"MIT"
] | AdriAlvarez00/Gamejam-Aurigae | BUGs/Assets/Scripts/FollowTarget.cs | 893 | C# |
//------------------------------------------------------------------------------
// <auto-generated>
// Dieser Code wurde von einem Tool generiert.
// Laufzeitversion:4.0.30319.42000
//
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
// der Code erneut generiert wird.
// </auto-generated>
//------------------------------------------------------------------------------
using NMF.Collections.Generic;
using NMF.Collections.ObjectModel;
using NMF.Expressions;
using NMF.Expressions.Linq;
using NMF.Models;
using NMF.Models.Collections;
using NMF.Models.Expressions;
using NMF.Models.Meta;
using NMF.Models.Repository;
using NMF.Serialization;
using NMF.Utilities;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using TTC2017.SmartGrids.CIM;
using TTC2017.SmartGrids.CIM.IEC61968.Common;
using TTC2017.SmartGrids.CIM.IEC61970.Contingency;
using TTC2017.SmartGrids.CIM.IEC61970.Core;
using TTC2017.SmartGrids.CIM.IEC61970.Generation.Production;
using TTC2017.SmartGrids.CIM.IEC61970.Informative.EnergyScheduling;
using TTC2017.SmartGrids.CIM.IEC61970.Informative.Financial;
using TTC2017.SmartGrids.CIM.IEC61970.Informative.InfERPSupport;
using TTC2017.SmartGrids.CIM.IEC61970.LoadModel;
using TTC2017.SmartGrids.CIM.IEC61970.Meas;
using TTC2017.SmartGrids.CIM.IEC61970.Wires;
namespace TTC2017.SmartGrids.CIM.IEC61970.Informative.MarketOperations
{
/// <summary>
/// The default implementation of the ContingencyConstraintLimit class
/// </summary>
[XmlNamespaceAttribute("http://iec.ch/TC57/2009/CIM-schema-cim14#MarketOperations")]
[XmlNamespacePrefixAttribute("cimMarketOperations")]
[ModelRepresentationClassAttribute("http://iec.ch/TC57/2009/CIM-schema-cim14#//IEC61970/Informative/MarketOperations/" +
"ContingencyConstraintLimit")]
[DebuggerDisplayAttribute("ContingencyConstraintLimit {UUID}")]
public partial class ContingencyConstraintLimit : Curve, IContingencyConstraintLimit, IModelElement
{
private static Lazy<ITypedElement> _securityConstraintSumReference = new Lazy<ITypedElement>(RetrieveSecurityConstraintSumReference);
/// <summary>
/// The backing field for the SecurityConstraintSum property
/// </summary>
private ISecurityConstraintSum _securityConstraintSum;
private static Lazy<ITypedElement> _mWLimitSchedulesReference = new Lazy<ITypedElement>(RetrieveMWLimitSchedulesReference);
/// <summary>
/// The backing field for the MWLimitSchedules property
/// </summary>
private IMWLimitSchedule _mWLimitSchedules;
private static Lazy<ITypedElement> _contingencyReference = new Lazy<ITypedElement>(RetrieveContingencyReference);
/// <summary>
/// The backing field for the Contingency property
/// </summary>
private IContingency _contingency;
private static IClass _classInstance;
/// <summary>
/// The SecurityConstraintSum property
/// </summary>
[XmlAttributeAttribute(true)]
[XmlOppositeAttribute("ContingencyConstraintLimits")]
public virtual ISecurityConstraintSum SecurityConstraintSum
{
get
{
return this._securityConstraintSum;
}
set
{
if ((this._securityConstraintSum != value))
{
ISecurityConstraintSum old = this._securityConstraintSum;
ValueChangedEventArgs e = new ValueChangedEventArgs(old, value);
this.OnSecurityConstraintSumChanging(e);
this.OnPropertyChanging("SecurityConstraintSum", e, _securityConstraintSumReference);
this._securityConstraintSum = value;
if ((old != null))
{
old.ContingencyConstraintLimits.Remove(this);
old.Deleted -= this.OnResetSecurityConstraintSum;
}
if ((value != null))
{
value.ContingencyConstraintLimits.Add(this);
value.Deleted += this.OnResetSecurityConstraintSum;
}
this.OnSecurityConstraintSumChanged(e);
this.OnPropertyChanged("SecurityConstraintSum", e, _securityConstraintSumReference);
}
}
}
/// <summary>
/// The MWLimitSchedules property
/// </summary>
[XmlAttributeAttribute(true)]
[XmlOppositeAttribute("SecurityConstraintLimit")]
public virtual IMWLimitSchedule MWLimitSchedules
{
get
{
return this._mWLimitSchedules;
}
set
{
if ((this._mWLimitSchedules != value))
{
IMWLimitSchedule old = this._mWLimitSchedules;
ValueChangedEventArgs e = new ValueChangedEventArgs(old, value);
this.OnMWLimitSchedulesChanging(e);
this.OnPropertyChanging("MWLimitSchedules", e, _mWLimitSchedulesReference);
this._mWLimitSchedules = value;
if ((old != null))
{
old.SecurityConstraintLimit = null;
old.Deleted -= this.OnResetMWLimitSchedules;
}
if ((value != null))
{
value.SecurityConstraintLimit = this;
value.Deleted += this.OnResetMWLimitSchedules;
}
this.OnMWLimitSchedulesChanged(e);
this.OnPropertyChanged("MWLimitSchedules", e, _mWLimitSchedulesReference);
}
}
}
/// <summary>
/// The Contingency property
/// </summary>
[XmlAttributeAttribute(true)]
[XmlOppositeAttribute("ContingencyConstraintLimit")]
public virtual IContingency Contingency
{
get
{
return this._contingency;
}
set
{
if ((this._contingency != value))
{
IContingency old = this._contingency;
ValueChangedEventArgs e = new ValueChangedEventArgs(old, value);
this.OnContingencyChanging(e);
this.OnPropertyChanging("Contingency", e, _contingencyReference);
this._contingency = value;
if ((old != null))
{
old.ContingencyConstraintLimit.Remove(this);
old.Deleted -= this.OnResetContingency;
}
if ((value != null))
{
value.ContingencyConstraintLimit.Add(this);
value.Deleted += this.OnResetContingency;
}
this.OnContingencyChanged(e);
this.OnPropertyChanged("Contingency", e, _contingencyReference);
}
}
}
/// <summary>
/// Gets the referenced model elements of this model element
/// </summary>
public override IEnumerableExpression<IModelElement> ReferencedElements
{
get
{
return base.ReferencedElements.Concat(new ContingencyConstraintLimitReferencedElementsCollection(this));
}
}
/// <summary>
/// Gets the Class model for this type
/// </summary>
public new static IClass ClassInstance
{
get
{
if ((_classInstance == null))
{
_classInstance = ((IClass)(MetaRepository.Instance.Resolve("http://iec.ch/TC57/2009/CIM-schema-cim14#//IEC61970/Informative/MarketOperations/" +
"ContingencyConstraintLimit")));
}
return _classInstance;
}
}
/// <summary>
/// Gets fired before the SecurityConstraintSum property changes its value
/// </summary>
public event System.EventHandler<ValueChangedEventArgs> SecurityConstraintSumChanging;
/// <summary>
/// Gets fired when the SecurityConstraintSum property changed its value
/// </summary>
public event System.EventHandler<ValueChangedEventArgs> SecurityConstraintSumChanged;
/// <summary>
/// Gets fired before the MWLimitSchedules property changes its value
/// </summary>
public event System.EventHandler<ValueChangedEventArgs> MWLimitSchedulesChanging;
/// <summary>
/// Gets fired when the MWLimitSchedules property changed its value
/// </summary>
public event System.EventHandler<ValueChangedEventArgs> MWLimitSchedulesChanged;
/// <summary>
/// Gets fired before the Contingency property changes its value
/// </summary>
public event System.EventHandler<ValueChangedEventArgs> ContingencyChanging;
/// <summary>
/// Gets fired when the Contingency property changed its value
/// </summary>
public event System.EventHandler<ValueChangedEventArgs> ContingencyChanged;
private static ITypedElement RetrieveSecurityConstraintSumReference()
{
return ((ITypedElement)(((ModelElement)(ContingencyConstraintLimit.ClassInstance)).Resolve("SecurityConstraintSum")));
}
/// <summary>
/// Raises the SecurityConstraintSumChanging event
/// </summary>
/// <param name="eventArgs">The event data</param>
protected virtual void OnSecurityConstraintSumChanging(ValueChangedEventArgs eventArgs)
{
System.EventHandler<ValueChangedEventArgs> handler = this.SecurityConstraintSumChanging;
if ((handler != null))
{
handler.Invoke(this, eventArgs);
}
}
/// <summary>
/// Raises the SecurityConstraintSumChanged event
/// </summary>
/// <param name="eventArgs">The event data</param>
protected virtual void OnSecurityConstraintSumChanged(ValueChangedEventArgs eventArgs)
{
System.EventHandler<ValueChangedEventArgs> handler = this.SecurityConstraintSumChanged;
if ((handler != null))
{
handler.Invoke(this, eventArgs);
}
}
/// <summary>
/// Handles the event that the SecurityConstraintSum property must reset
/// </summary>
/// <param name="sender">The object that sent this reset request</param>
/// <param name="eventArgs">The event data for the reset event</param>
private void OnResetSecurityConstraintSum(object sender, System.EventArgs eventArgs)
{
this.SecurityConstraintSum = null;
}
private static ITypedElement RetrieveMWLimitSchedulesReference()
{
return ((ITypedElement)(((ModelElement)(ContingencyConstraintLimit.ClassInstance)).Resolve("MWLimitSchedules")));
}
/// <summary>
/// Raises the MWLimitSchedulesChanging event
/// </summary>
/// <param name="eventArgs">The event data</param>
protected virtual void OnMWLimitSchedulesChanging(ValueChangedEventArgs eventArgs)
{
System.EventHandler<ValueChangedEventArgs> handler = this.MWLimitSchedulesChanging;
if ((handler != null))
{
handler.Invoke(this, eventArgs);
}
}
/// <summary>
/// Raises the MWLimitSchedulesChanged event
/// </summary>
/// <param name="eventArgs">The event data</param>
protected virtual void OnMWLimitSchedulesChanged(ValueChangedEventArgs eventArgs)
{
System.EventHandler<ValueChangedEventArgs> handler = this.MWLimitSchedulesChanged;
if ((handler != null))
{
handler.Invoke(this, eventArgs);
}
}
/// <summary>
/// Handles the event that the MWLimitSchedules property must reset
/// </summary>
/// <param name="sender">The object that sent this reset request</param>
/// <param name="eventArgs">The event data for the reset event</param>
private void OnResetMWLimitSchedules(object sender, System.EventArgs eventArgs)
{
this.MWLimitSchedules = null;
}
private static ITypedElement RetrieveContingencyReference()
{
return ((ITypedElement)(((ModelElement)(ContingencyConstraintLimit.ClassInstance)).Resolve("Contingency")));
}
/// <summary>
/// Raises the ContingencyChanging event
/// </summary>
/// <param name="eventArgs">The event data</param>
protected virtual void OnContingencyChanging(ValueChangedEventArgs eventArgs)
{
System.EventHandler<ValueChangedEventArgs> handler = this.ContingencyChanging;
if ((handler != null))
{
handler.Invoke(this, eventArgs);
}
}
/// <summary>
/// Raises the ContingencyChanged event
/// </summary>
/// <param name="eventArgs">The event data</param>
protected virtual void OnContingencyChanged(ValueChangedEventArgs eventArgs)
{
System.EventHandler<ValueChangedEventArgs> handler = this.ContingencyChanged;
if ((handler != null))
{
handler.Invoke(this, eventArgs);
}
}
/// <summary>
/// Handles the event that the Contingency property must reset
/// </summary>
/// <param name="sender">The object that sent this reset request</param>
/// <param name="eventArgs">The event data for the reset event</param>
private void OnResetContingency(object sender, System.EventArgs eventArgs)
{
this.Contingency = null;
}
/// <summary>
/// Sets a value to the given feature
/// </summary>
/// <param name="feature">The requested feature</param>
/// <param name="value">The value that should be set to that feature</param>
protected override void SetFeature(string feature, object value)
{
if ((feature == "SECURITYCONSTRAINTSUM"))
{
this.SecurityConstraintSum = ((ISecurityConstraintSum)(value));
return;
}
if ((feature == "MWLIMITSCHEDULES"))
{
this.MWLimitSchedules = ((IMWLimitSchedule)(value));
return;
}
if ((feature == "CONTINGENCY"))
{
this.Contingency = ((IContingency)(value));
return;
}
base.SetFeature(feature, value);
}
/// <summary>
/// Gets the property expression for the given attribute
/// </summary>
/// <returns>An incremental property expression</returns>
/// <param name="attribute">The requested attribute in upper case</param>
protected override NMF.Expressions.INotifyExpression<object> GetExpressionForAttribute(string attribute)
{
if ((attribute == "SecurityConstraintSum"))
{
return new SecurityConstraintSumProxy(this);
}
if ((attribute == "MWLimitSchedules"))
{
return new MWLimitSchedulesProxy(this);
}
if ((attribute == "Contingency"))
{
return new ContingencyProxy(this);
}
return base.GetExpressionForAttribute(attribute);
}
/// <summary>
/// Gets the property expression for the given reference
/// </summary>
/// <returns>An incremental property expression</returns>
/// <param name="reference">The requested reference in upper case</param>
protected override NMF.Expressions.INotifyExpression<NMF.Models.IModelElement> GetExpressionForReference(string reference)
{
if ((reference == "SecurityConstraintSum"))
{
return new SecurityConstraintSumProxy(this);
}
if ((reference == "MWLimitSchedules"))
{
return new MWLimitSchedulesProxy(this);
}
if ((reference == "Contingency"))
{
return new ContingencyProxy(this);
}
return base.GetExpressionForReference(reference);
}
/// <summary>
/// Gets the Class for this model element
/// </summary>
public override IClass GetClass()
{
if ((_classInstance == null))
{
_classInstance = ((IClass)(MetaRepository.Instance.Resolve("http://iec.ch/TC57/2009/CIM-schema-cim14#//IEC61970/Informative/MarketOperations/" +
"ContingencyConstraintLimit")));
}
return _classInstance;
}
/// <summary>
/// The collection class to to represent the children of the ContingencyConstraintLimit class
/// </summary>
public class ContingencyConstraintLimitReferencedElementsCollection : ReferenceCollection, ICollectionExpression<IModelElement>, ICollection<IModelElement>
{
private ContingencyConstraintLimit _parent;
/// <summary>
/// Creates a new instance
/// </summary>
public ContingencyConstraintLimitReferencedElementsCollection(ContingencyConstraintLimit parent)
{
this._parent = parent;
}
/// <summary>
/// Gets the amount of elements contained in this collection
/// </summary>
public override int Count
{
get
{
int count = 0;
if ((this._parent.SecurityConstraintSum != null))
{
count = (count + 1);
}
if ((this._parent.MWLimitSchedules != null))
{
count = (count + 1);
}
if ((this._parent.Contingency != null))
{
count = (count + 1);
}
return count;
}
}
protected override void AttachCore()
{
this._parent.SecurityConstraintSumChanged += this.PropagateValueChanges;
this._parent.MWLimitSchedulesChanged += this.PropagateValueChanges;
this._parent.ContingencyChanged += this.PropagateValueChanges;
}
protected override void DetachCore()
{
this._parent.SecurityConstraintSumChanged -= this.PropagateValueChanges;
this._parent.MWLimitSchedulesChanged -= this.PropagateValueChanges;
this._parent.ContingencyChanged -= this.PropagateValueChanges;
}
/// <summary>
/// Adds the given element to the collection
/// </summary>
/// <param name="item">The item to add</param>
public override void Add(IModelElement item)
{
if ((this._parent.SecurityConstraintSum == null))
{
ISecurityConstraintSum securityConstraintSumCasted = item.As<ISecurityConstraintSum>();
if ((securityConstraintSumCasted != null))
{
this._parent.SecurityConstraintSum = securityConstraintSumCasted;
return;
}
}
if ((this._parent.MWLimitSchedules == null))
{
IMWLimitSchedule mWLimitSchedulesCasted = item.As<IMWLimitSchedule>();
if ((mWLimitSchedulesCasted != null))
{
this._parent.MWLimitSchedules = mWLimitSchedulesCasted;
return;
}
}
if ((this._parent.Contingency == null))
{
IContingency contingencyCasted = item.As<IContingency>();
if ((contingencyCasted != null))
{
this._parent.Contingency = contingencyCasted;
return;
}
}
}
/// <summary>
/// Clears the collection and resets all references that implement it.
/// </summary>
public override void Clear()
{
this._parent.SecurityConstraintSum = null;
this._parent.MWLimitSchedules = null;
this._parent.Contingency = null;
}
/// <summary>
/// Gets a value indicating whether the given element is contained in the collection
/// </summary>
/// <returns>True, if it is contained, otherwise False</returns>
/// <param name="item">The item that should be looked out for</param>
public override bool Contains(IModelElement item)
{
if ((item == this._parent.SecurityConstraintSum))
{
return true;
}
if ((item == this._parent.MWLimitSchedules))
{
return true;
}
if ((item == this._parent.Contingency))
{
return true;
}
return false;
}
/// <summary>
/// Copies the contents of the collection to the given array starting from the given array index
/// </summary>
/// <param name="array">The array in which the elements should be copied</param>
/// <param name="arrayIndex">The starting index</param>
public override void CopyTo(IModelElement[] array, int arrayIndex)
{
if ((this._parent.SecurityConstraintSum != null))
{
array[arrayIndex] = this._parent.SecurityConstraintSum;
arrayIndex = (arrayIndex + 1);
}
if ((this._parent.MWLimitSchedules != null))
{
array[arrayIndex] = this._parent.MWLimitSchedules;
arrayIndex = (arrayIndex + 1);
}
if ((this._parent.Contingency != null))
{
array[arrayIndex] = this._parent.Contingency;
arrayIndex = (arrayIndex + 1);
}
}
/// <summary>
/// Removes the given item from the collection
/// </summary>
/// <returns>True, if the item was removed, otherwise False</returns>
/// <param name="item">The item that should be removed</param>
public override bool Remove(IModelElement item)
{
if ((this._parent.SecurityConstraintSum == item))
{
this._parent.SecurityConstraintSum = null;
return true;
}
if ((this._parent.MWLimitSchedules == item))
{
this._parent.MWLimitSchedules = null;
return true;
}
if ((this._parent.Contingency == item))
{
this._parent.Contingency = null;
return true;
}
return false;
}
/// <summary>
/// Gets an enumerator that enumerates the collection
/// </summary>
/// <returns>A generic enumerator</returns>
public override IEnumerator<IModelElement> GetEnumerator()
{
return Enumerable.Empty<IModelElement>().Concat(this._parent.SecurityConstraintSum).Concat(this._parent.MWLimitSchedules).Concat(this._parent.Contingency).GetEnumerator();
}
}
/// <summary>
/// Represents a proxy to represent an incremental access to the SecurityConstraintSum property
/// </summary>
private sealed class SecurityConstraintSumProxy : ModelPropertyChange<IContingencyConstraintLimit, ISecurityConstraintSum>
{
/// <summary>
/// Creates a new observable property access proxy
/// </summary>
/// <param name="modelElement">The model instance element for which to create the property access proxy</param>
public SecurityConstraintSumProxy(IContingencyConstraintLimit modelElement) :
base(modelElement, "SecurityConstraintSum")
{
}
/// <summary>
/// Gets or sets the value of this expression
/// </summary>
public override ISecurityConstraintSum Value
{
get
{
return this.ModelElement.SecurityConstraintSum;
}
set
{
this.ModelElement.SecurityConstraintSum = value;
}
}
}
/// <summary>
/// Represents a proxy to represent an incremental access to the MWLimitSchedules property
/// </summary>
private sealed class MWLimitSchedulesProxy : ModelPropertyChange<IContingencyConstraintLimit, IMWLimitSchedule>
{
/// <summary>
/// Creates a new observable property access proxy
/// </summary>
/// <param name="modelElement">The model instance element for which to create the property access proxy</param>
public MWLimitSchedulesProxy(IContingencyConstraintLimit modelElement) :
base(modelElement, "MWLimitSchedules")
{
}
/// <summary>
/// Gets or sets the value of this expression
/// </summary>
public override IMWLimitSchedule Value
{
get
{
return this.ModelElement.MWLimitSchedules;
}
set
{
this.ModelElement.MWLimitSchedules = value;
}
}
}
/// <summary>
/// Represents a proxy to represent an incremental access to the Contingency property
/// </summary>
private sealed class ContingencyProxy : ModelPropertyChange<IContingencyConstraintLimit, IContingency>
{
/// <summary>
/// Creates a new observable property access proxy
/// </summary>
/// <param name="modelElement">The model instance element for which to create the property access proxy</param>
public ContingencyProxy(IContingencyConstraintLimit modelElement) :
base(modelElement, "Contingency")
{
}
/// <summary>
/// Gets or sets the value of this expression
/// </summary>
public override IContingency Value
{
get
{
return this.ModelElement.Contingency;
}
set
{
this.ModelElement.Contingency = value;
}
}
}
}
}
| 39.63674 | 187 | 0.541868 | [
"MIT"
] | georghinkel/ttc2017smartGrids | generator/Schema/IEC61970/Informative/MarketOperations/ContingencyConstraintLimit.cs | 28,699 | C# |
#region PDFsharp - A .NET library for processing PDF
//
// Authors:
// Stefan Lange (mailto:Stefan.Lange@pdfsharp.com)
//
// Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany)
//
// http://www.pdfsharp.com
// http://sourceforge.net/projects/pdfsharp
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
#endregion
namespace PdfSharp
{
/// <summary>
/// Version info of this assembly.
/// </summary>
static class VersionInfo
{
public const string Title = ProductVersionInfo.Title;
public const string Description = ProductVersionInfo.Description;
public const string Producer = ProductVersionInfo.Producer;
public const string Version = ProductVersionInfo.Version;
public const string Url = ProductVersionInfo.Url;
public const string Configuration = "";
public const string Company = ProductVersionInfo.Company;
public const string Product = ProductVersionInfo.Product;
public const string Copyright = ProductVersionInfo.Copyright;
public const string Trademark = ProductVersionInfo.Trademark;
public const string Culture = "";
}
} | 44.367347 | 78 | 0.737351 | [
"MIT"
] | 2Toad/PDFsharp | PdfSharp/PdfSharp/VersionInfo.cs | 2,174 | C# |
using System;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
[assembly: InternalsVisibleTo("WeeControl.Server.WebApi.Test")]
namespace WeeControl.Common.UserSecurityLib.Helpers.CustomHandlers.TokenRefreshment
{
public class TokenRefreshmentHandler : AuthorizationHandler<TokenRefreshmentRequirement>
{
protected override Task HandleRequirementAsync(AuthorizationHandlerContext context,
TokenRefreshmentRequirement requirement)
{
var _savedDate = context.User.Claims.FirstOrDefault(x => x.Type == "iat")?.Value;
if (_savedDate != null)
{
var __savedDate = Convert.ToDouble(_savedDate);
var savedDate = DateTime.UnixEpoch.AddSeconds(__savedDate);
var diff = DateTime.UtcNow - savedDate;
if (diff < requirement.Period)
{
context.Succeed(requirement);
}
}
return Task.CompletedTask;
}
}
}
| 35.59375 | 95 | 0.624232 | [
"MIT"
] | sayedmhussein/ControlSystem | src/Common/UserSecurityLib/Helpers/CustomHandlers/TokenRefreshment/TokenRefreshmentHandler.cs | 1,141 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Insma.Mxa.Framework {
public interface IGameComponent {
void Initialize( );
}
}
| 17.666667 | 34 | 0.773585 | [
"MIT"
] | baszalmstra/MXA | MXA-Framework/src/Framework.Game/IGameComponent.cs | 214 | C# |
//
// Copyright (c) Microsoft. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
using System.Reflection;
using System.Resources;
[assembly: AssemblyTitle( "Microsoft Azure Key Vault Extensions Library" )]
[assembly: AssemblyDescription( "Provides extended capabilities for Azure Key Vault." )]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.4.0")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("Azure .NET SDK")]
[assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
| 39.064516 | 88 | 0.754748 | [
"Apache-2.0"
] | CerebralMischief/azure-sdk-for-net | src/KeyVault/Microsoft.Azure.KeyVault.Extensions/Properties/AssemblyInfo.cs | 1,211 | C# |
using System;
using FluentAssertions;
using IbanNet.Registry;
using Xunit;
namespace IbanNet
{
public class IbanValidatorOptionsTests
{
private readonly IbanValidatorOptions _sut;
public IbanValidatorOptionsTests()
{
_sut = new IbanValidatorOptions();
}
[Fact]
public void Registry_should_default_to_default_registry()
{
_sut.Registry.Should().BeSameAs(IbanRegistry.Default);
}
[Fact]
public void Validation_method_should_default_to_strict()
{
_sut.Method.Should().Be(ValidationMethod.Strict);
}
[Fact]
public void Rules_should_default_to_empty_list()
{
_sut.Rules.Should().BeEmpty();
}
[Fact]
public void When_setting_invalid_validation_method_it_should_throw()
{
Action act = () => _sut.Method = (ValidationMethod)int.MaxValue;
act.Should().Throw<ArgumentException>();
}
}
}
| 23.386364 | 76 | 0.606414 | [
"Apache-2.0"
] | 0xced/IbanNet | test/IbanNet.Tests/IbanValidatorOptionsTests.cs | 1,031 | 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("RefactorVolumeOfPyramid")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("RefactorVolumeOfPyramid")]
[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("e00fda5f-7a51-4b11-97f8-cc64dc60bf87")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| 38.351351 | 84 | 0.749119 | [
"MIT"
] | PavelRunchev/Programming-Fundamentals-2017 | Programming Fundamentals - Sep-2017/06.DataTypesAndVariables/08.RefactorVolumeOfPyramid/Properties/AssemblyInfo.cs | 1,422 | C# |
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Ship
{
namespace TIEDefender
{
public class GlaiveSquadronPilot : TIEDefender
{
public GlaiveSquadronPilot() : base()
{
PilotName = "Glaive Squadron Pilot";
PilotSkill = 6;
Cost = 34;
PrintedUpgradeIcons.Add(Upgrade.UpgradeType.Elite);
SkinName = "Crimson";
}
}
}
}
| 21.291667 | 67 | 0.53816 | [
"MIT"
] | MatthewBlanchard/FlyCasual | Assets/Scripts/Model/Ships/TIE Defender/GlaiveSquadronPilot.cs | 513 | C# |
using NPC.Runtime;
using Neo.SmartContract.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading.Tasks;
/// <summary>
/// NPC.dApps.NeoDraw.Main.UserPoint - Level 4 Collectible (Extended)
///
/// Processed: 2018-03-06 10:27:26 PM by npcc - NEO Class Framework (NPC) 2.0 Compiler v1.0.0.0
/// NPC Project: https://github.com/mwherman2000/neo-npcc/blob/master/README.md
/// NPC Lead: Michael Herman (Toronto) (mwherman@parallelspace.net)
/// </summary>
namespace NPC.dApps.NeoDraw.Main
{
public partial class UserPoint : NeoTrace /* Level 4 Collectible */
{
/// <summary>
/// Collectible methods (NPC Level 4)
/// </summary>
/// <param name="e">e</param>
/// <param name="vau">vau</param>
/// <param name="index">index</param>
/// <returns>bool</returns>
public static bool PutElement(UserPoint e, NeoVersionedAppUser vau, byte[] domain, byte[] bindex)
{
if (NeoVersionedAppUser.IsNull(vau)) return false;
Neo.SmartContract.Framework.Services.Neo.StorageContext ctx = Neo.SmartContract.Framework.Services.Neo.Storage.CurrentContext;
NeoStorageKey nsk = NeoStorageKey.New(vau, domain, "UserPoint");
byte[] bkey;
e._state = NeoEntityModel.EntityState.PUTTED;
Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, bkey = NeoStorageKey.StorageKey(nsk, bindex, _bSTA), e._state.AsBigInteger());
Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, bkey = NeoStorageKey.StorageKey(nsk, bindex, _bX), e._x); // Template: NPCLevel4APutElement_cs.txt
Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, bkey = NeoStorageKey.StorageKey(nsk, bindex, _bY), e._y); // Template: NPCLevel4APutElement_cs.txt
LogExt("PutElement(vau,i).UserPoint", e); // Template: NPCLevel4BGetElement_cs.txt
return true;
}
/// <summary>
/// Get an element of an array of entities from Storage based on a NeoStorageKey (NPC Level 4)
/// </summary>
/// <param name="vau">vau</param>
/// <param name="index">index</param>
/// <returns>UserPoint</returns>
public static UserPoint GetElement(NeoVersionedAppUser vau, byte[] domain, byte[] bindex)
{
if (NeoVersionedAppUser.IsNull(vau)) return Null();
Neo.SmartContract.Framework.Services.Neo.StorageContext ctx = Neo.SmartContract.Framework.Services.Neo.Storage.CurrentContext;
NeoStorageKey nsk = NeoStorageKey.New(vau, domain, "UserPoint");
UserPoint e;
byte[] bkey;
byte[] bsta = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, bkey = NeoStorageKey.StorageKey(nsk, bindex, _bSTA));
NeoTrace.Trace("Get(bkey).UserPoint.bsta", bsta.Length, bsta);
if (bsta.Length == 0)
{
e = UserPoint.Missing();
}
else // not MISSING
{
/*EXT*/
byte[] bext = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, bkey = NeoStorageKey.StorageKey(nsk, bindex, _bEXT));
int ista = (int)bsta.AsBigInteger();
NeoEntityModel.EntityState sta = (NeoEntityModel.EntityState)ista;
if (sta == NeoEntityModel.EntityState.TOMBSTONED)
{
e = UserPoint.Tombstone();
}
else // not MISSING && not TOMBSTONED
{
e = new UserPoint();
BigInteger X = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, bkey = NeoStorageKey.StorageKey(nsk, bindex, _bX)).AsBigInteger(); // Template: NPCLevel4CGetElement_cs.txt
BigInteger Y = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, bkey = NeoStorageKey.StorageKey(nsk, bindex, _bY)).AsBigInteger(); // Template: NPCLevel4CGetElement_cs.txt
e._x = X; e._y = Y; // NPCLevel4DBuryElement_cs.txt
e._state = sta;
e._state = NeoEntityModel.EntityState.GETTED; /* OVERRIDE */
}
}
LogExt("Get(bkey).UserPoint.e", e);
return e;
}
/// <summary>
/// Bury an element of an array of entities in Storage based on a NeoStorageKey (NPC Level 4)
/// </summary>
/// <param name="vau">vau</param>
/// <param name="index">index</param>
/// <returns>UserPoint</returns>
public static UserPoint BuryElement(NeoVersionedAppUser vau, byte[] domain, byte[] bindex)
{
if (NeoVersionedAppUser.IsNull(vau)) // TODO - create NeoEntityModel.EntityState.BADKEY?
{
return UserPoint.Null();
}
Neo.SmartContract.Framework.Services.Neo.StorageContext ctx = Neo.SmartContract.Framework.Services.Neo.Storage.CurrentContext;
NeoStorageKey nsk = NeoStorageKey.New(vau, domain, "UserPoint");
byte[] bkey;
UserPoint e;
/*STA*/
byte[] bsta = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, bkey = NeoStorageKey.StorageKey(nsk, bindex, _bSTA));
NeoTrace.Trace("Bury(vau,index).UserPoint.bsta", bsta.Length, bsta);
if (bsta.Length == 0)
{
e = UserPoint.Missing();
}
else // not MISSING - bury it
{
e = UserPoint.Tombstone(); // TODO - should Bury() preserve the exist field values or re-initialize them? Preserve is cheaper but not as private
Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, bkey = NeoStorageKey.StorageKey(nsk, bindex, _bSTA), e._state.AsBigInteger());
Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, bkey = NeoStorageKey.StorageKey(nsk, bindex, _bX), e._x); // NPCLevel4EBuryElement_cs.txt
Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, bkey = NeoStorageKey.StorageKey(nsk, bindex, _bY), e._y); // NPCLevel4EBuryElement_cs.txt
} // Template: NPCLevel4Part2_cs.txt
LogExt("Bury(vau,i).UserPoint", e);
return e;
}
}
} | 49.765625 | 200 | 0.612245 | [
"MIT"
] | mwherman2000/neo-npcc | neo-npcc/NPC.dApps.NeoDraw.Small/UserPointL4CollectibleExt2.cs | 6,370 | C# |
namespace Atomus.Control.Toolbar
{
partial class DefaultToolbar
{
/// <summary>
/// 필수 디자이너 변수입니다.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 사용 중인 모든 리소스를 정리합니다.
/// </summary>
/// <param name="disposing">관리되는 리소스를 삭제해야 하면 true이고, 그렇지 않으면 false입니다.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 구성 요소 디자이너에서 생성한 코드
/// <summary>
/// 디자이너 지원에 필요한 메서드입니다.
/// 이 메서드의 내용을 코드 편집기로 수정하지 마십시오.
/// </summary>
private void InitializeComponent()
{
this.webBrowser1 = new System.Windows.Forms.WebBrowser();
this.SuspendLayout();
//
// webBrowser1
//
this.webBrowser1.AllowNavigation = false;
this.webBrowser1.AllowWebBrowserDrop = false;
this.webBrowser1.Dock = System.Windows.Forms.DockStyle.Right;
this.webBrowser1.IsWebBrowserContextMenuEnabled = false;
this.webBrowser1.Location = new System.Drawing.Point(560, 0);
this.webBrowser1.Margin = new System.Windows.Forms.Padding(0);
this.webBrowser1.MinimumSize = new System.Drawing.Size(23, 25);
this.webBrowser1.Name = "webBrowser1";
this.webBrowser1.ScrollBarsEnabled = false;
this.webBrowser1.Size = new System.Drawing.Size(571, 100);
this.webBrowser1.TabIndex = 6;
this.webBrowser1.TabStop = false;
this.webBrowser1.Visible = false;
this.webBrowser1.WebBrowserShortcutsEnabled = false;
//
// DefaultToolbar
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.Transparent;
this.Controls.Add(this.webBrowser1);
this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.Name = "DefaultToolbar";
this.Size = new System.Drawing.Size(1131, 100);
this.Load += new System.EventHandler(this.DefaultMenu_Load);
this.SizeChanged += new System.EventHandler(this.DefaultToolbar_SizeChanged);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.WebBrowser webBrowser1;
}
}
| 37.267606 | 89 | 0.579365 | [
"MIT"
] | dsuny/Atomus.Control.Toolbar.DefaultToolbar | dotNet/Views/DefaultToolbar.Designer.cs | 2,856 | C# |
// <auto-generated />
using System;
using DncZeus.Api.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace DncZeus.Api.Migrations
{
[DbContext(typeof(DncZeusDbContext))]
[Migration("20200930072329_workflowTemplate")]
partial class workflowTemplate
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "3.1.2")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("DncZeus.Api.Entities.DncIcon", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("Code")
.IsRequired()
.HasColumnType("nvarchar(50)");
b.Property<string>("Color")
.HasColumnType("nvarchar(50)");
b.Property<Guid>("CreatedByUserGuid")
.HasColumnType("uniqueidentifier");
b.Property<string>("CreatedByUserName")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreatedOn")
.HasColumnType("datetime2");
b.Property<string>("Custom")
.HasColumnType("nvarchar(60)");
b.Property<string>("Description")
.HasColumnType("nvarchar(max)");
b.Property<int>("IsDeleted")
.HasColumnType("int");
b.Property<Guid?>("ModifiedByUserGuid")
.HasColumnType("uniqueidentifier");
b.Property<string>("ModifiedByUserName")
.HasColumnType("nvarchar(max)");
b.Property<DateTime?>("ModifiedOn")
.HasColumnType("datetime2");
b.Property<string>("Size")
.HasColumnType("nvarchar(20)");
b.Property<int>("Status")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("DncIcon");
});
modelBuilder.Entity("DncZeus.Api.Entities.DncMenu", b =>
{
b.Property<Guid>("Guid")
.HasColumnType("uniqueidentifier");
b.Property<string>("Alias")
.HasColumnType("nvarchar(255)");
b.Property<string>("BeforeCloseFun")
.HasColumnType("nvarchar(255)")
.HasMaxLength(255);
b.Property<string>("Component")
.HasColumnType("nvarchar(255)")
.HasMaxLength(255);
b.Property<Guid>("CreatedByUserGuid")
.HasColumnType("uniqueidentifier");
b.Property<string>("CreatedByUserName")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreatedOn")
.HasColumnType("datetime2");
b.Property<string>("Description")
.HasColumnType("nvarchar(800)");
b.Property<int?>("HideInMenu")
.HasColumnType("int");
b.Property<string>("Icon")
.HasColumnType("nvarchar(128)");
b.Property<int>("IsDefaultRouter")
.HasColumnType("int");
b.Property<int>("IsDeleted")
.HasColumnType("int");
b.Property<int>("Level")
.HasColumnType("int");
b.Property<Guid?>("ModifiedByUserGuid")
.HasColumnType("uniqueidentifier");
b.Property<string>("ModifiedByUserName")
.HasColumnType("nvarchar(max)");
b.Property<DateTime?>("ModifiedOn")
.HasColumnType("datetime2");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(50)");
b.Property<int?>("NotCache")
.HasColumnType("int");
b.Property<Guid?>("ParentGuid")
.HasColumnType("uniqueidentifier");
b.Property<string>("ParentName")
.HasColumnType("nvarchar(max)");
b.Property<int>("Sort")
.HasColumnType("int");
b.Property<int>("Status")
.HasColumnType("int");
b.Property<string>("Url")
.HasColumnType("nvarchar(255)");
b.HasKey("Guid");
b.ToTable("DncMenu");
});
modelBuilder.Entity("DncZeus.Api.Entities.DncPermission", b =>
{
b.Property<string>("Code")
.HasColumnType("nvarchar(20)");
b.Property<string>("ActionCode")
.IsRequired()
.HasColumnType("nvarchar(80)");
b.Property<Guid>("CreatedByUserGuid")
.HasColumnType("uniqueidentifier");
b.Property<string>("CreatedByUserName")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreatedOn")
.HasColumnType("datetime2");
b.Property<string>("Description")
.HasColumnType("nvarchar(max)");
b.Property<string>("Icon")
.HasColumnType("nvarchar(max)");
b.Property<int>("IsDeleted")
.HasColumnType("int");
b.Property<Guid>("MenuGuid")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("ModifiedByUserGuid")
.HasColumnType("uniqueidentifier");
b.Property<string>("ModifiedByUserName")
.HasColumnType("nvarchar(max)");
b.Property<DateTime?>("ModifiedOn")
.HasColumnType("datetime2");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(50)");
b.Property<int>("Status")
.HasColumnType("int");
b.Property<int>("Type")
.HasColumnType("int");
b.HasKey("Code");
b.HasIndex("Code")
.IsUnique();
b.HasIndex("MenuGuid");
b.ToTable("DncPermission");
});
modelBuilder.Entity("DncZeus.Api.Entities.DncPermissionWithMenu", b =>
{
b.Property<int>("IsDefaultRouter")
.HasColumnType("int");
b.Property<string>("MenuAlias")
.HasColumnType("nvarchar(max)");
b.Property<Guid>("MenuGuid")
.HasColumnType("uniqueidentifier");
b.Property<string>("MenuName")
.HasColumnType("nvarchar(max)");
b.Property<string>("PermissionActionCode")
.HasColumnType("nvarchar(max)");
b.Property<string>("PermissionCode")
.HasColumnType("nvarchar(max)");
b.Property<string>("PermissionName")
.HasColumnType("nvarchar(max)");
b.Property<int>("PermissionType")
.HasColumnType("int");
b.ToTable("DncPermissionWithMenu");
});
modelBuilder.Entity("DncZeus.Api.Entities.DncRole", b =>
{
b.Property<string>("Code")
.HasColumnType("nvarchar(50)");
b.Property<Guid>("CreatedByUserGuid")
.HasColumnType("uniqueidentifier");
b.Property<string>("CreatedByUserName")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreatedOn")
.HasColumnType("datetime2");
b.Property<string>("Description")
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsBuiltin")
.HasColumnType("bit");
b.Property<int>("IsDeleted")
.HasColumnType("int");
b.Property<bool>("IsSuperAdministrator")
.HasColumnType("bit");
b.Property<Guid?>("ModifiedByUserGuid")
.HasColumnType("uniqueidentifier");
b.Property<string>("ModifiedByUserName")
.HasColumnType("nvarchar(max)");
b.Property<DateTime?>("ModifiedOn")
.HasColumnType("datetime2");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(50)");
b.Property<int>("Status")
.HasColumnType("int");
b.HasKey("Code");
b.HasIndex("Code")
.IsUnique();
b.ToTable("DncRole");
});
modelBuilder.Entity("DncZeus.Api.Entities.DncRolePermissionMapping", b =>
{
b.Property<string>("RoleCode")
.HasColumnType("nvarchar(50)");
b.Property<string>("PermissionCode")
.HasColumnType("nvarchar(20)");
b.Property<DateTime>("CreatedOn")
.HasColumnType("datetime2");
b.HasKey("RoleCode", "PermissionCode");
b.HasIndex("PermissionCode");
b.ToTable("DncRolePermissionMapping");
});
modelBuilder.Entity("DncZeus.Api.Entities.DncUser", b =>
{
b.Property<Guid>("Guid")
.HasColumnType("uniqueidentifier");
b.Property<string>("Avatar")
.HasColumnType("nvarchar(255)");
b.Property<Guid>("CreatedByUserGuid")
.HasColumnType("uniqueidentifier");
b.Property<string>("CreatedByUserName")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreatedOn")
.HasColumnType("datetime2");
b.Property<string>("Description")
.HasColumnType("nvarchar(800)");
b.Property<string>("DisplayName")
.HasColumnType("nvarchar(50)");
b.Property<int>("IsDeleted")
.HasColumnType("int");
b.Property<int>("IsLocked")
.HasColumnType("int");
b.Property<string>("LoginName")
.IsRequired()
.HasColumnType("nvarchar(50)");
b.Property<Guid?>("ModifiedByUserGuid")
.HasColumnType("uniqueidentifier");
b.Property<string>("ModifiedByUserName")
.HasColumnType("nvarchar(max)");
b.Property<DateTime?>("ModifiedOn")
.HasColumnType("datetime2");
b.Property<string>("Password")
.HasColumnType("nvarchar(255)");
b.Property<int>("Status")
.HasColumnType("int");
b.Property<int>("UserType")
.HasColumnType("int");
b.HasKey("Guid");
b.ToTable("DncUser");
});
modelBuilder.Entity("DncZeus.Api.Entities.DncUserRoleMapping", b =>
{
b.Property<Guid>("UserGuid")
.HasColumnType("uniqueidentifier");
b.Property<string>("RoleCode")
.HasColumnType("nvarchar(50)");
b.Property<DateTime>("CreatedOn")
.HasColumnType("datetime2");
b.HasKey("UserGuid", "RoleCode");
b.HasIndex("RoleCode");
b.ToTable("DncUserRoleMapping");
});
modelBuilder.Entity("DncZeus.Api.Entities.FinanceAccount", b =>
{
b.Property<string>("Code")
.HasColumnType("nvarchar(50)");
b.Property<string>("Account")
.HasColumnType("nvarchar(max)");
b.Property<Guid>("CreatedByUserGuid")
.HasColumnType("uniqueidentifier");
b.Property<string>("CreatedByUserName")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreatedOn")
.HasColumnType("datetime2");
b.Property<string>("DepartmentCode")
.HasColumnType("nvarchar(max)");
b.Property<string>("Description")
.HasColumnType("nvarchar(max)");
b.Property<string>("Holder")
.HasColumnType("nvarchar(max)");
b.Property<int>("IsDeleted")
.HasColumnType("int");
b.Property<Guid?>("ModifiedByUserGuid")
.HasColumnType("uniqueidentifier");
b.Property<string>("ModifiedByUserName")
.HasColumnType("nvarchar(max)");
b.Property<DateTime?>("ModifiedOn")
.HasColumnType("datetime2");
b.Property<string>("Name")
.HasColumnType("nvarchar(max)");
b.Property<string>("Owner")
.HasColumnType("nvarchar(max)");
b.Property<int>("Status")
.HasColumnType("int");
b.Property<string>("Title")
.HasColumnType("nvarchar(max)");
b.Property<string>("Type")
.HasColumnType("nvarchar(max)");
b.HasKey("Code");
b.ToTable("FinanceAccount");
});
modelBuilder.Entity("DncZeus.Api.Entities.FinanceInfo", b =>
{
b.Property<string>("Code")
.HasColumnType("nvarchar(50)");
b.Property<decimal>("Amount")
.HasColumnType("decimal(18,4)");
b.Property<Guid>("CreatedByUserGuid")
.HasColumnType("uniqueidentifier");
b.Property<string>("CreatedByUserName")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreatedOn")
.HasColumnType("datetime2");
b.Property<string>("DepartmentCode")
.HasColumnType("nvarchar(max)");
b.Property<string>("Description")
.HasColumnType("nvarchar(max)");
b.Property<string>("FilePath")
.HasColumnType("nvarchar(max)");
b.Property<string>("FinanceAccount")
.HasColumnType("nvarchar(max)");
b.Property<string>("HandleDate")
.HasColumnType("nvarchar(max)");
b.Property<string>("HandleName")
.HasColumnType("nvarchar(max)");
b.Property<string>("ImagePath")
.HasColumnType("nvarchar(max)");
b.Property<string>("InfoStatus")
.HasColumnType("nvarchar(max)");
b.Property<int>("IsDeleted")
.HasColumnType("int");
b.Property<Guid?>("ModifiedByUserGuid")
.HasColumnType("uniqueidentifier");
b.Property<string>("ModifiedByUserName")
.HasColumnType("nvarchar(max)");
b.Property<DateTime?>("ModifiedOn")
.HasColumnType("datetime2");
b.Property<string>("Note")
.HasColumnType("nvarchar(max)");
b.Property<int>("Status")
.HasColumnType("int");
b.Property<string>("Title")
.HasColumnType("nvarchar(max)");
b.Property<string>("Type")
.HasColumnType("nvarchar(max)");
b.Property<string>("User")
.HasColumnType("nvarchar(max)");
b.HasKey("Code");
b.ToTable("FinanceInfo");
});
modelBuilder.Entity("DncZeus.Api.Entities.QueryModels.DncPermission.DncPermissionWithAssignProperty", b =>
{
b.Property<string>("ActionCode")
.HasColumnType("nvarchar(max)");
b.Property<string>("Code")
.HasColumnType("nvarchar(max)");
b.Property<int>("IsAssigned")
.HasColumnType("int");
b.Property<Guid?>("MenuGuid")
.HasColumnType("uniqueidentifier");
b.Property<string>("Name")
.HasColumnType("nvarchar(max)");
b.Property<string>("RoleCode")
.HasColumnType("nvarchar(max)");
b.ToTable("DncPermissionWithAssignProperty");
});
modelBuilder.Entity("DncZeus.Api.Entities.ResumeInfo", b =>
{
b.Property<string>("Code")
.HasColumnType("nvarchar(50)");
b.Property<string>("Address")
.HasColumnType("nvarchar(max)");
b.Property<int>("Age")
.HasColumnType("int");
b.Property<string>("Alipay")
.HasColumnType("nvarchar(max)");
b.Property<string>("AnimalSign")
.HasColumnType("nvarchar(max)");
b.Property<string>("Awards")
.HasColumnType("nvarchar(max)");
b.Property<DateTime?>("Birthday")
.HasColumnType("datetime2");
b.Property<string>("City")
.HasColumnType("nvarchar(max)");
b.Property<string>("Comments")
.HasColumnType("nvarchar(max)");
b.Property<string>("Country")
.HasColumnType("nvarchar(max)");
b.Property<string>("County")
.HasColumnType("nvarchar(max)");
b.Property<Guid>("CreatedByUserGuid")
.HasColumnType("uniqueidentifier");
b.Property<string>("CreatedByUserName")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreatedOn")
.HasColumnType("datetime2");
b.Property<string>("DepartmentCode")
.HasColumnType("nvarchar(max)");
b.Property<string>("Education")
.HasColumnType("nvarchar(max)");
b.Property<string>("EducationBackgrounds")
.HasColumnType("nvarchar(max)");
b.Property<string>("Email")
.HasColumnType("nvarchar(max)");
b.Property<string>("Height")
.HasColumnType("nvarchar(max)");
b.Property<int>("HomeInfo")
.HasColumnType("int");
b.Property<string>("ImagePath")
.HasColumnType("nvarchar(max)");
b.Property<string>("Interests")
.HasColumnType("nvarchar(max)");
b.Property<int>("IsDeleted")
.HasColumnType("int");
b.Property<int>("JobStatus")
.HasColumnType("int");
b.Property<string>("Language")
.HasColumnType("nvarchar(max)");
b.Property<string>("LevelID")
.HasColumnType("nvarchar(max)");
b.Property<string>("License")
.HasColumnType("nvarchar(max)");
b.Property<string>("Mobile")
.HasColumnType("nvarchar(max)");
b.Property<Guid?>("ModifiedByUserGuid")
.HasColumnType("uniqueidentifier");
b.Property<string>("ModifiedByUserName")
.HasColumnType("nvarchar(max)");
b.Property<DateTime?>("ModifiedOn")
.HasColumnType("datetime2");
b.Property<string>("NickName")
.HasColumnType("nvarchar(max)");
b.Property<string>("Password")
.HasColumnType("nvarchar(max)");
b.Property<string>("PositionCode")
.HasColumnType("nvarchar(max)");
b.Property<string>("Province")
.HasColumnType("nvarchar(max)");
b.Property<string>("QQ")
.HasColumnType("nvarchar(max)");
b.Property<string>("RealName")
.HasColumnType("nvarchar(max)");
b.Property<string>("Remark")
.HasColumnType("nvarchar(max)");
b.Property<string>("SelfEvaluations")
.HasColumnType("nvarchar(max)");
b.Property<int>("Sex")
.HasColumnType("int");
b.Property<string>("Skills")
.HasColumnType("nvarchar(max)");
b.Property<int>("Status")
.HasColumnType("int");
b.Property<string>("TEL")
.HasColumnType("nvarchar(max)");
b.Property<string>("Telegram")
.HasColumnType("nvarchar(max)");
b.Property<int>("TypeID")
.HasColumnType("int");
b.Property<Guid>("UserGuid")
.HasColumnType("uniqueidentifier");
b.Property<string>("Wechat")
.HasColumnType("nvarchar(max)");
b.Property<string>("Weight")
.HasColumnType("nvarchar(max)");
b.Property<string>("Works")
.HasColumnType("nvarchar(max)");
b.Property<int>("Years")
.HasColumnType("int");
b.HasKey("Code");
b.ToTable("ResumeInfo");
});
modelBuilder.Entity("DncZeus.Api.Entities.SystemDicType", b =>
{
b.Property<string>("Code")
.HasColumnType("nvarchar(50)");
b.Property<string>("Name")
.HasColumnType("nvarchar(max)");
b.Property<string>("Value")
.HasColumnType("nvarchar(max)");
b.HasKey("Code");
b.ToTable("SystemDicType");
});
modelBuilder.Entity("DncZeus.Api.Entities.SystemDictionary", b =>
{
b.Property<string>("Code")
.HasColumnType("nvarchar(50)");
b.Property<bool>("Fixed")
.HasColumnType("bit");
b.Property<string>("Name")
.HasColumnType("nvarchar(max)");
b.Property<string>("TypeCode")
.HasColumnType("nvarchar(50)");
b.Property<string>("Value")
.HasColumnType("nvarchar(max)");
b.HasKey("Code");
b.HasIndex("Code")
.IsUnique();
b.HasIndex("TypeCode");
b.ToTable("SystemDictionary");
});
modelBuilder.Entity("DncZeus.Api.Entities.UserDepartment", b =>
{
b.Property<string>("Code")
.HasColumnType("nvarchar(50)");
b.Property<string>("Address")
.HasColumnType("nvarchar(max)");
b.Property<string>("City")
.HasColumnType("nvarchar(max)");
b.Property<string>("Company")
.HasColumnType("nvarchar(max)");
b.Property<string>("County")
.HasColumnType("nvarchar(max)");
b.Property<Guid>("CreatedByUserGuid")
.HasColumnType("uniqueidentifier");
b.Property<string>("CreatedByUserName")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreatedOn")
.HasColumnType("datetime2");
b.Property<string>("Email")
.HasColumnType("nvarchar(max)");
b.Property<string>("Fax")
.HasColumnType("nvarchar(max)");
b.Property<string>("Friday")
.HasColumnType("nvarchar(max)");
b.Property<int>("IsDeleted")
.HasColumnType("int");
b.Property<int>("LevelID")
.HasColumnType("int");
b.Property<string>("Manager")
.HasColumnType("nvarchar(max)");
b.Property<Guid?>("ModifiedByUserGuid")
.HasColumnType("uniqueidentifier");
b.Property<string>("ModifiedByUserName")
.HasColumnType("nvarchar(max)");
b.Property<DateTime?>("ModifiedOn")
.HasColumnType("datetime2");
b.Property<string>("Monday")
.HasColumnType("nvarchar(max)");
b.Property<string>("Name")
.HasColumnType("nvarchar(max)");
b.Property<string>("ParentCode")
.HasColumnType("nvarchar(max)");
b.Property<string>("Phone1")
.HasColumnType("nvarchar(max)");
b.Property<string>("Phone2")
.HasColumnType("nvarchar(max)");
b.Property<string>("Province")
.HasColumnType("nvarchar(max)");
b.Property<string>("Saturday")
.HasColumnType("nvarchar(max)");
b.Property<int>("SortID")
.HasColumnType("int");
b.Property<int>("Status")
.HasColumnType("int");
b.Property<string>("Sunday")
.HasColumnType("nvarchar(max)");
b.Property<string>("Thursday")
.HasColumnType("nvarchar(max)");
b.Property<string>("Tuesday")
.HasColumnType("nvarchar(max)");
b.Property<int>("TypeID")
.HasColumnType("int");
b.Property<string>("Wednesday")
.HasColumnType("nvarchar(max)");
b.Property<string>("Zone")
.HasColumnType("nvarchar(max)");
b.HasKey("Code");
b.ToTable("UserDepartment");
});
modelBuilder.Entity("DncZeus.Api.Entities.UserPosition", b =>
{
b.Property<string>("Code")
.HasColumnType("nvarchar(50)");
b.Property<Guid>("CreatedByUserGuid")
.HasColumnType("uniqueidentifier");
b.Property<string>("CreatedByUserName")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreatedOn")
.HasColumnType("datetime2");
b.Property<int>("IsDeleted")
.HasColumnType("int");
b.Property<int>("LevelID")
.HasColumnType("int");
b.Property<Guid?>("ModifiedByUserGuid")
.HasColumnType("uniqueidentifier");
b.Property<string>("ModifiedByUserName")
.HasColumnType("nvarchar(max)");
b.Property<DateTime?>("ModifiedOn")
.HasColumnType("datetime2");
b.Property<string>("Name")
.HasColumnType("nvarchar(max)");
b.Property<string>("ParentCode")
.HasColumnType("nvarchar(max)");
b.Property<int>("SortID")
.HasColumnType("int");
b.Property<int>("Status")
.HasColumnType("int");
b.HasKey("Code");
b.ToTable("UserPosition");
});
modelBuilder.Entity("DncZeus.Api.Entities.WageInfo", b =>
{
b.Property<string>("Code")
.HasColumnType("nvarchar(50)");
b.Property<decimal?>("AccumulationFund")
.HasColumnType("decimal(18,4)");
b.Property<string>("Additions")
.HasColumnType("nvarchar(max)");
b.Property<decimal?>("BaseWage")
.HasColumnType("decimal(18,4)");
b.Property<decimal?>("Bonus")
.HasColumnType("decimal(18,4)");
b.Property<decimal?>("Commission")
.HasColumnType("decimal(18,4)");
b.Property<Guid>("CreatedByUserGuid")
.HasColumnType("uniqueidentifier");
b.Property<string>("CreatedByUserName")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreatedOn")
.HasColumnType("datetime2");
b.Property<string>("Deductions")
.HasColumnType("nvarchar(max)");
b.Property<string>("DepartmentCode")
.HasColumnType("nvarchar(max)");
b.Property<DateTime?>("EndDate")
.HasColumnType("datetime2");
b.Property<decimal?>("IncomeTax")
.HasColumnType("decimal(18,4)");
b.Property<int>("IsDeleted")
.HasColumnType("int");
b.Property<Guid?>("ModifiedByUserGuid")
.HasColumnType("uniqueidentifier");
b.Property<string>("ModifiedByUserName")
.HasColumnType("nvarchar(max)");
b.Property<DateTime?>("ModifiedOn")
.HasColumnType("datetime2");
b.Property<int?>("OTDays")
.HasColumnType("int");
b.Property<decimal?>("OTWage")
.HasColumnType("decimal(18,4)");
b.Property<decimal?>("PerformanceWage")
.HasColumnType("decimal(18,4)");
b.Property<string>("PositionCode")
.HasColumnType("nvarchar(max)");
b.Property<string>("RealName")
.HasColumnType("nvarchar(max)");
b.Property<decimal?>("ReissueWage")
.HasColumnType("decimal(18,4)");
b.Property<decimal?>("SocialSecurity")
.HasColumnType("decimal(18,4)");
b.Property<DateTime?>("StartDate")
.HasColumnType("datetime2");
b.Property<int>("Status")
.HasColumnType("int");
b.Property<decimal?>("Subsidy")
.HasColumnType("decimal(18,4)");
b.Property<decimal?>("TotalWage")
.HasColumnType("decimal(18,4)");
b.Property<Guid>("UserGuid")
.HasColumnType("uniqueidentifier");
b.Property<int?>("WorkDays")
.HasColumnType("int");
b.HasKey("Code");
b.ToTable("WageInfo");
});
modelBuilder.Entity("DncZeus.Api.Entities.WorkflowTemplate", b =>
{
b.Property<string>("Code")
.HasColumnType("nvarchar(50)");
b.Property<Guid>("CreatedByUserGuid")
.HasColumnType("uniqueidentifier");
b.Property<string>("CreatedByUserName")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreatedOn")
.HasColumnType("datetime2");
b.Property<string>("Description")
.HasColumnType("nvarchar(max)");
b.Property<int>("IsDeleted")
.HasColumnType("int");
b.Property<bool>("IsStepFree")
.HasColumnType("bit");
b.Property<Guid?>("ModifiedByUserGuid")
.HasColumnType("uniqueidentifier");
b.Property<string>("ModifiedByUserName")
.HasColumnType("nvarchar(max)");
b.Property<DateTime?>("ModifiedOn")
.HasColumnType("datetime2");
b.Property<string>("Name")
.HasColumnType("nvarchar(max)");
b.Property<string>("ParentCode")
.HasColumnType("nvarchar(max)");
b.Property<int>("Status")
.HasColumnType("int");
b.Property<bool>("Visible")
.HasColumnType("bit");
b.HasKey("Code");
b.ToTable("WorkflowTemplate");
});
modelBuilder.Entity("DncZeus.Api.Entities.DncPermission", b =>
{
b.HasOne("DncZeus.Api.Entities.DncMenu", "Menu")
.WithMany("Permissions")
.HasForeignKey("MenuGuid")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("DncZeus.Api.Entities.DncRolePermissionMapping", b =>
{
b.HasOne("DncZeus.Api.Entities.DncPermission", "DncPermission")
.WithMany("Roles")
.HasForeignKey("PermissionCode")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("DncZeus.Api.Entities.DncRole", "DncRole")
.WithMany("Permissions")
.HasForeignKey("RoleCode")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
});
modelBuilder.Entity("DncZeus.Api.Entities.DncUserRoleMapping", b =>
{
b.HasOne("DncZeus.Api.Entities.DncRole", "DncRole")
.WithMany("UserRoles")
.HasForeignKey("RoleCode")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("DncZeus.Api.Entities.DncUser", "DncUser")
.WithMany("UserRoles")
.HasForeignKey("UserGuid")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
});
modelBuilder.Entity("DncZeus.Api.Entities.SystemDictionary", b =>
{
b.HasOne("DncZeus.Api.Entities.SystemDicType", "systemDicType")
.WithMany("SystemDictionarys")
.HasForeignKey("TypeCode")
.OnDelete(DeleteBehavior.Restrict);
});
#pragma warning restore 612, 618
}
}
}
| 35.554428 | 125 | 0.438235 | [
"MIT"
] | zhangbao138208/financeAndpersonnel | DncZeus.Api/Migrations/20200930072329_workflowTemplate.Designer.cs | 38,543 | C# |
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
using System;
using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.PixelFormats;
namespace SixLabors.ImageSharp.Formats.Tiff.PhotometricInterpretation
{
/// <summary>
/// Implements the 'RGB' photometric interpretation with an alpha channel and 8 bits per channel.
/// </summary>
internal class Rgba8888TiffColor<TPixel> : TiffBaseColorDecoder<TPixel>
where TPixel : unmanaged, IPixel<TPixel>
{
private readonly Configuration configuration;
public Rgba8888TiffColor(Configuration configuration) => this.configuration = configuration;
/// <inheritdoc/>
public override void Decode(ReadOnlySpan<byte> data, Buffer2D<TPixel> pixels, int left, int top, int width, int height)
{
int offset = 0;
for (int y = top; y < top + height; y++)
{
Span<TPixel> pixelRow = pixels.DangerousGetRowSpan(y).Slice(left, width);
int byteCount = pixelRow.Length * 4;
PixelOperations<TPixel>.Instance.FromRgba32Bytes(
this.configuration,
data.Slice(offset, byteCount),
pixelRow,
pixelRow.Length);
offset += byteCount;
}
}
}
}
| 34.225 | 127 | 0.617239 | [
"Apache-2.0"
] | kroymann/ImageSharp | src/ImageSharp/Formats/Tiff/PhotometricInterpretation/Rgba8888TiffColor{TPixel}.cs | 1,369 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace FingerScan
{
public class DeviceRecord
{
internal string DeviceCode { get; set; }
internal string Ip { get; set; }
internal int Port { get; set; }
internal string Branch { get; set; }
internal string Company { get; set; }
internal string Admin { get; set; }
internal string Tel { get; set; }
internal string Email { get; set; }
internal DateTime? LastModified { get; set; }
}
[Serializable]
public class RawRecord
{
internal string EnrollNumber { get; set; }
internal int VerifyMode { get; set; }
internal int InOutMode { get; set; }
internal int Year { get; set; }
internal int Month { get; set; }
internal int Day { get; set; }
internal int Hour { get; set; }
internal int Minute { get; set; }
internal int Second { get; set; }
internal int Workcode { get; set; }
internal int SensorID { get; set; }
internal string DeviceCode { get; set; }
}
public class LogRecord
{
internal DateTime Date { get; set; }
internal DateTime Time { get; set; }
internal string Activity { get; set; }
internal string DeviceCode { get; set; }
internal string DeviceIP { get; set; }
internal EventLevel Level { get; set; }
internal string Source { get; set; }
internal string Version { get; set; }
internal string Message { get; set; }
}
public class WorkshiftRecord
{
internal string PersonNo { get; set; }
internal string EmployeeNo { get; set; }
internal int UserID { get; set; }
internal TimeSpan? MorningIn { get; set; }
internal TimeSpan? MorningOut { get; set; }
internal TimeSpan? AfternoonIn { get; set; }
internal TimeSpan? AfternoonOut { get; set; }
internal TimeSpan? BreakTime { get; set; }
}
}
| 32.52381 | 53 | 0.589068 | [
"Unlicense"
] | gnoon/lv1 | FingerScan/Records.cs | 2,051 | C# |
using System;
using WslManager.Extensions;
namespace WslManager.Screens
{
// Helpers
partial class PropertiesForm
{
}
}
| 12.545455 | 32 | 0.688406 | [
"MIT"
] | anaymalpani/WSLMANAGER | src/WslManager/Screens/PropertiesForm.Helpers.cs | 140 | C# |
using System.Windows.Forms;
using Newtonsoft.Json.Linq;
namespace JsonTreeView
{
public static class JsonTreeViewLoader
{
public static void LoadJsonToTreeView(this TreeView treeView, string json)
{
if (string.IsNullOrWhiteSpace(json))
{
return;
}
var @object = JObject.Parse(json);
AddObjectNodes(@object, "JSON", treeView.Nodes);
}
public static void AddObjectNodes(JObject @object, string name, TreeNodeCollection parent)
{
var node = new TreeNode(name);
parent.Add(node);
foreach (var property in @object.Properties())
{
AddTokenNodes(property.Value, property.Name, node.Nodes);
}
}
private static void AddArrayNodes(JArray array, string name, TreeNodeCollection parent)
{
var node = new TreeNode(name);
parent.Add(node);
for (var i = 0; i < array.Count; i++)
{
AddTokenNodes(array[i], string.Format("[{0}]", i), node.Nodes);
}
}
private static void AddTokenNodes(JToken token, string name, TreeNodeCollection parent)
{
if (token is JValue)
{
parent.Add(new TreeNode(string.Format("{0}: {1}", name, ((JValue)token).Value)));
}
else if (token is JArray)
{
AddArrayNodes((JArray)token, name, parent);
}
else if (token is JObject)
{
AddObjectNodes((JObject)token, name, parent);
}
}
}
} | 29.596491 | 98 | 0.524007 | [
"MIT"
] | Kevin0M16/NMSCoordinates | NMSCoordinates/Class2.cs | 1,689 | C# |
using DotNetify;
using System;
using System.Reactive.Linq;
namespace dotNetify_Elements
{
public class RealtimeClock : BaseVM
{
public RealtimeClock()
{
var timer = Observable.Interval(TimeSpan.FromSeconds(1)).StartWith(0);
AddProperty<string>("Clock")
.SubscribeTo(timer.Select(_ => DateTime.Now.ToString("hh:mm:ss tt")))
.SubscribedBy(AddInternalProperty<bool>("Update"), _ =>
{
PushUpdates();
return true;
});
}
}
} | 24.727273 | 81 | 0.579044 | [
"Apache-2.0"
] | dsuryd/dotNetify-Elements | DevApp.ViewModels/Introduction/Examples/RealtimeClock.cs | 546 | C# |
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
namespace StyleCop.Analyzers.Helpers
{
using System.Threading.Tasks;
internal static class SpecializedTasks
{
internal static Task CompletedTask { get; } = Task.FromResult(default(VoidResult));
private struct VoidResult
{
}
}
}
| 26.058824 | 91 | 0.69526 | [
"MIT"
] | AraHaan/StyleCopAnalyzers | StyleCop.Analyzers/StyleCop.Analyzers/Helpers/SpecializedTasks.cs | 445 | C# |
using System.Collections.Generic;
using NBitcoin;
using Newtonsoft.Json;
namespace Xels.Bitcoin.Features.Wallet.Models
{
public class WalletBalanceModel
{
public WalletBalanceModel()
{
this.AccountsBalances = new List<AccountBalanceModel>();
}
[JsonProperty(PropertyName = "balances")]
public List<AccountBalanceModel> AccountsBalances { get; set; }
}
public class AccountBalanceModel
{
[JsonProperty(PropertyName = "accountName")]
public string Name { get; set; }
[JsonProperty(PropertyName = "accountHdPath")]
public string HdPath { get; set; }
[JsonProperty(PropertyName = "coinType")]
public CoinType CoinType { get; set; }
[JsonProperty(PropertyName = "amountConfirmed")]
public Money AmountConfirmed { get; set; }
[JsonProperty(PropertyName = "amountUnconfirmed")]
public Money AmountUnconfirmed { get; set; }
[JsonProperty(PropertyName = "spendableAmount")]
public Money SpendableAmount { get; set; }
[JsonProperty(PropertyName = "addresses")]
public IEnumerable<AddressModel> Addresses { get; set; }
}
}
| 29 | 71 | 0.644499 | [
"MIT"
] | xels-io/SideChain-SmartContract | src/Xels.Bitcoin.Features.Wallet/Models/WalletBalanceModel.cs | 1,220 | C# |
/*
* Copyright 2010-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the eventbridge-2015-10-07.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.EventBridge.Model
{
/// <summary>
/// Container for the parameters to the ListPartnerEventSourceAccounts operation.
/// An SaaS partner can use this operation to display the AWS account ID that a particular
/// partner event source name is associated with.
///
/// <note>
/// <para>
/// This operation is used by SaaS partners, not by AWS customers.
/// </para>
/// </note>
/// </summary>
public partial class ListPartnerEventSourceAccountsRequest : AmazonEventBridgeRequest
{
private string _eventSourceName;
private int? _limit;
private string _nextToken;
/// <summary>
/// Gets and sets the property EventSourceName.
/// <para>
/// The name of the partner event source to display account information about.
/// </para>
/// </summary>
[AWSProperty(Required=true, Min=1, Max=256)]
public string EventSourceName
{
get { return this._eventSourceName; }
set { this._eventSourceName = value; }
}
// Check to see if EventSourceName property is set
internal bool IsSetEventSourceName()
{
return this._eventSourceName != null;
}
/// <summary>
/// Gets and sets the property Limit.
/// <para>
/// Specifying this limits the number of results returned by this operation. The operation
/// also returns a <code>NextToken</code> that you can use in a subsequent operation to
/// retrieve the next set of results.
/// </para>
/// </summary>
[AWSProperty(Min=1, Max=100)]
public int Limit
{
get { return this._limit.GetValueOrDefault(); }
set { this._limit = value; }
}
// Check to see if Limit property is set
internal bool IsSetLimit()
{
return this._limit.HasValue;
}
/// <summary>
/// Gets and sets the property NextToken.
/// <para>
/// The token returned by a previous call to this operation. Specifying this retrieves
/// the next set of results.
/// </para>
/// </summary>
[AWSProperty(Min=1, Max=2048)]
public string NextToken
{
get { return this._nextToken; }
set { this._nextToken = value; }
}
// Check to see if NextToken property is set
internal bool IsSetNextToken()
{
return this._nextToken != null;
}
}
} | 32.083333 | 109 | 0.612698 | [
"Apache-2.0"
] | TallyUpTeam/aws-sdk-net | sdk/src/Services/EventBridge/Generated/Model/ListPartnerEventSourceAccountsRequest.cs | 3,465 | C# |
// Copyright Naked Objects Group Ltd, 45 Station Road, Henley on Thames, UK, RG9 1AT
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and limitations under the License.
using System;
using NakedObjects.Architecture.Interactions;
using NakedObjects.Architecture.Spec;
namespace NakedObjects.Meta.Facet {
[Serializable]
public sealed class MaxLengthFacetZero : MaxLengthFacetAbstract {
private const int NoLimit = 0;
public MaxLengthFacetZero(ISpecification holder)
: base(NoLimit, holder) { }
public override bool IsNoOp => true;
/// <summary>
/// No limit to maximum length
/// </summary>
public override string Invalidates(IInteractionContext interactionContext) => null;
}
// Copyright (c) Naked Objects Group Ltd.
} | 43.517241 | 136 | 0.724247 | [
"Apache-2.0"
] | e-manual-goldstein/NakedObjectsFramework | NakedFramework/NakedFramework.Metamodel/Facet/MaxLengthFacetZero.cs | 1,262 | C# |
////////////////////////////////////////////////////////////////////////////////
//
// ADOBE SYSTEMS INCORPORATED
// Copyright 2004-2006 Adobe Systems Incorporated
// All Rights Reserved.
//
// NOTICE: Adobe permits you to use, modify, and distribute this file
// in accordance with the terms of the license agreement accompanying it.
//
////////////////////////////////////////////////////////////////////////////////
using System;
namespace Flash.Util
{
/// <summary> Format a sequence of characters into a fixed length field
/// justifying if applied.
/// </summary>
public class FieldFormat
{
public const int ALIGN_UNKNOWN = 0;
public const int ALIGN_LEFT = 1;
public const int ALIGN_RIGHT = 2;
public const int ALIGN_CENTER = 3;
// Right justifies a long value into a hex field with leading zeros
public static System.Text.StringBuilder formatLongToHex(System.Text.StringBuilder sb, long v, int length)
{
return formatLongToHex(sb, v, length, true);
}
// Right justifies a long value into a field optionally zero filling the opening.
public static System.Text.StringBuilder formatLongToHex(System.Text.StringBuilder sb, long v, int length, bool leadingZeros)
{
return format(sb, System.Convert.ToString(v, 16), length, ALIGN_RIGHT, ((leadingZeros)?'0':' '), ' ');
}
// Right justifies a long value into a fixed length field
public static System.Text.StringBuilder formatLong(System.Text.StringBuilder sb, long v, int length)
{
return formatLong(sb, v, length, false);
}
public static System.Text.StringBuilder formatLong(System.Text.StringBuilder sb, long v, int length, bool leadingZeros)
{
return format(sb, System.Convert.ToString(v), length, ((leadingZeros)?ALIGN_RIGHT:ALIGN_LEFT), ((leadingZeros)?'0':' '), ' ');
}
// basis for all formats
public static System.Text.StringBuilder format(System.Text.StringBuilder sb, String chars, int length, int alignment, char preFieldCharacter, char postFieldCharacter)
{
// find the length of our string
int charsCount = chars.Length;
// position within the field
int startAt = 0;
if (alignment == ALIGN_RIGHT)
startAt = length - charsCount;
else if (alignment == ALIGN_CENTER)
startAt = (length - charsCount) / 2;
// force to right it off edge
if (startAt < 0)
startAt = 0;
// truncate it
if ((startAt + charsCount) > length)
charsCount = length - startAt;
// now add the pre-field if any
for (int i = 0; i < startAt; i++)
sb.Append(preFieldCharacter);
// the content
sb.Append(chars.Substring(0, (charsCount) - (0)));
// post field if any
for (int i = startAt + charsCount; i < length; i++)
sb.Append(postFieldCharacter);
return sb;
}
}
}
| 34.481928 | 169 | 0.633823 | [
"MIT"
] | Acidburn0zzz/flashdevelop | External/Archive/FlashDebugger/FlexSDK/SwfUtils/flash/util/FieldFormat.cs | 2,780 | C# |
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Threading.Tasks;
using MongoDB.Bson;
using MongoDB.Bson.Serialization;
using MongoDB.Bson.Serialization.Attributes;
using MongoDB.Driver;
using Microsoft.Extensions.Options;
using Microsoft.Extensions.Logging;
namespace Turquoise.Common.Mongo
{
public class MangoBaseRepo<T> where T : new()
{
public IMongoDatabase MongoDb { get; private set; }
public MongoClient mongoClient { get; private set; }
public string IdFieldName { get; private set; }
private string collectionName;
readonly ILogger<MangoBaseRepo<T>> logger;
public MangoBaseRepo(IOptions<MangoBaseRepoSettings<T>> options, ILogger<MangoBaseRepo<T>> logger, string collectionName) : this(options.Value.ConnectionString, options.Value.DatabaseName, collectionName, logger)
{
}
public MangoBaseRepo(IOptions<MangoBaseRepoSettings<T>> options, ILogger<MangoBaseRepo<T>> logger) : this(options.Value.ConnectionString, options.Value.DatabaseName, options.Value.CollectionName, logger)
{
}
public MangoBaseRepo(string connectionString, string databaseName, string collectionName, string IdField, ILogger<MangoBaseRepo<T>> logger)
{
this.logger = logger;
init(connectionString, databaseName, collectionName, IdField);
}
public MangoBaseRepo(string connectionString, string databaseName, string collectionName, ILogger<MangoBaseRepo<T>> logger) : this(connectionString, databaseName, collectionName, null as Expression<Func<T, object>>, logger)
{
}
public MangoBaseRepo(string connectionString, string databaseName, string collectionName, Expression<Func<T, object>> IdField, ILogger<MangoBaseRepo<T>> logger)
{
this.logger = logger;
string field = null;
if (IdField != null && IdField.Body is MemberExpression)
{
field = (IdField.Body as MemberExpression).Member.Name;
}
init(connectionString, databaseName, collectionName, field);
}
private void init(string connectionString, string databaseName, string collectionName, string IdField)
{
if (IdField != null)
{
this.IdFieldName = IdField;
// CreateIdMap();
}
else
{
if (BsonClassMap.IsClassMapRegistered(typeof(T)))
{
this.IdFieldName = BsonClassMap.LookupClassMap(typeof(T))?.IdMemberMap?.MemberInfo?.Name;
}
if (IdFieldName == null)
{
Type typeParameterType = typeof(T);
var item = typeParameterType.GetProperties().FirstOrDefault(p => p.CustomAttributes.Any(p1 => p1.AttributeType == typeof(BsonIdAttribute)));
if (item == null)
{
item = typeParameterType.GetProperties().FirstOrDefault(p => p.CustomAttributes.Any(p1 => p1.AttributeType == typeof(KeyAttribute)));
if (item != null)
{
this.IdFieldName = item.Name;
CreateIdMap();
}
}
if (item == null)
{
item = typeParameterType.GetProperties().FirstOrDefault(p => p.Name.ToLower() == "id");
}
if (item != null)
{
this.IdFieldName = item.Name;
}
}
}
logger.LogCritical(" IdFieldName " + IdFieldName);
logger.LogCritical(" collectionName " + collectionName);
// logger.LogCritical("mongoProductRepo " + items1.Count().ToString());
// logger.LogCritical("mongoProductRepo " + items1.Count().ToString());
this.collectionName = collectionName;
mongoClient = new MongoClient(connectionString);
MongoDb = mongoClient.GetDatabase(databaseName);
}
public IMongoCollection<T> Items
{
get
{
var check = CollectionExistsAsync(collectionName);
Task.WaitAll(check);
if (!check.Result)
{
MongoDb.CreateCollection(collectionName);
var collection = MongoDb.GetCollection<T>(collectionName);
InitialDatabase(collection);
return collection;
}
return MongoDb.GetCollection<T>(collectionName);
}
}
public IEnumerable<T> GetAll()
{
var name = typeof(T).ToString();
logger.LogCritical(name + " collectionName " + collectionName);
return Items.Find(FilterDefinition<T>.Empty).ToList();
}
public async Task<IEnumerable<T>> GetAllAsync()
{
var name = typeof(T).ToString();
logger.LogCritical(name + " collectionName " + collectionName);
var res = await Items.FindAsync(FilterDefinition<T>.Empty);
return res.ToList();
}
public IEnumerable<T> Find(FilterDefinition<T> filter)
{
var name = typeof(T).ToString();
return Items.Find(filter).ToList();
}
public IEnumerable<T> Find(Expression<Func<T, bool>> filter)
{
var name = typeof(T).ToString();
return Items.Find(filter).ToList();
}
public async Task<IEnumerable<T>> FindAsync(FilterDefinition<T> filter)
{
var name = typeof(T).ToString();
var res = await Items.FindAsync(filter);
return res.ToList();
}
public async Task<IEnumerable<T>> FindAsync(Expression<Func<T, bool>> filter)
{
var name = typeof(T).ToString();
var res = await Items.FindAsync(filter);
return res.ToList();
}
public async Task<T> Get(BsonDocument filter)
{
return await Items.FindSync<T>(filter).FirstOrDefaultAsync();
}
public async Task<T> Get(FilterDefinition<T> filter)
{
return await Items.FindSync<T>(filter).FirstOrDefaultAsync();
}
public async Task<T> GetByIDAsync(object value)
{
if (IdFieldName != null)
{
var filter = Builders<T>.Filter.Eq(IdFieldName, value);
return await Get(filter);
}
else
{
throw new MissingFieldException("ID field not Defined, use Key or BsonId Attribute in your Model or define on the constructor");
}
}
public async Task AddAsync(T item)
{
await Items.InsertOneAsync(item);
}
public async Task AddAsync(IEnumerable<T> items)
{
await Items.InsertManyAsync(items);
}
public async Task<ReplaceOneResult> UpdateAsync(object id, T item)
{
var filter = Builders<T>.Filter.Eq(IdFieldName, id);
var result = await Items.ReplaceOneAsync(filter, item);
return result;
}
public async Task<ReplaceOneResult> UpdateAsync(T item)
{
if (IdFieldName != null)
{
var id = item.GetType().GetRuntimeProperty(IdFieldName).GetValue(item);
var filter = Builders<T>.Filter.Eq(IdFieldName, id);
var result = await Items.ReplaceOneAsync(filter, item);
return result;
}
else
{
throw new MissingFieldException("ID field not Defined, use Key or BsonId Attribute in your Model or define on the constructor");
}
}
public async Task RemoveAsync(object id)
{
if (IdFieldName == null) { throw new MissingFieldException("ID field not Defined, use Key or BsonId Attribute in your Model or define on the constructor"); }
if (id == null) { throw new ArgumentNullException("ID Field can not be Null"); }
var filter = Builders<T>.Filter.Eq(IdFieldName, id);
await Items.DeleteOneAsync(filter);
}
public async Task RemoveAsync(T item)
{
if (IdFieldName == null) { throw new MissingFieldException("ID field not Defined, use Key or BsonId Attribute in your Model or define on the constructor"); }
if (item == null) { throw new ArgumentNullException("item can not be Null"); }
var id = item.GetType().GetRuntimeProperty(IdFieldName).GetValue(item);
var filter = Builders<T>.Filter.Eq(IdFieldName, id);
await Items.DeleteOneAsync(filter);
}
public async Task Upsert(T item, Expression<Func<T, bool>> filter)
{
await Items.ReplaceOneAsync(
filter: filter,
replacement: item,
options: new UpdateOptions { IsUpsert = true }
);
}
public async Task<T> GetAsync<TProperty>(Expression<Func<T, TProperty>> property, object value)
{
if (property.Body is System.Linq.Expressions.MemberExpression)
{
var pro = (property.Body as MemberExpression).Member;
var propertyName = nameof(pro.Name);
var filter = Builders<T>.Filter.Eq(propertyName, value);
return await Get(filter);
}
else { return default(T); }
}
public async Task<bool> CollectionExistsAsync(string collectionName)
{
var filter = new BsonDocument("name", collectionName);
var collections = await MongoDb.ListCollectionsAsync(new ListCollectionsOptions { Filter = filter });
return (await collections.ToListAsync()).Any();
}
public async Task DropCollectionAsync(string collectionName)
{
await MongoDb.DropCollectionAsync(collectionName);
}
public void DropCollection(string collectionName)
{
MongoDb.DropCollection(collectionName);
}
private void CreateIdMap()
{
if (IdFieldName != null)
{
if (BsonClassMap.IsClassMapRegistered(typeof(T)))
{
BsonClassMap.LookupClassMap(typeof(T)).AutoMap();
BsonClassMap.LookupClassMap(typeof(T)).MapIdProperty(IdFieldName);
}
else
{
BsonClassMap.RegisterClassMap<T>(cm =>
{
cm.AutoMap();
cm.MapIdProperty(IdFieldName);
});
}
}
}
public virtual void InitialDatabase(IMongoCollection<T> collection)
{
}
}
public class Gen<T> : IIdGenerator
{
public object GenerateId(object container, object document)
{
if (container is MongoDB.Driver.IMongoCollection<T>)
{
// (container as MongoDB.Driver.IMongoCollection<T>).Find(null).Max
}
throw new NotImplementedException();
}
public bool IsEmpty(object id)
{
throw new NotImplementedException();
}
}
public class MangoBaseRepoSettings<T> where T : new()
{
public string ConnectionString { get; set; }
public string DatabaseName { get; set; }
public string CollectionName { get; set; }
public string IdField { get; set; }
}
} | 38.146497 | 231 | 0.564368 | [
"Apache-2.0"
] | mmercan/Turquoise.HealthChecks | App/Libs/Turquoise.Common.Mongo/MangoBaseRepo.cs | 11,978 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Identity;
namespace Blogifier.Models
{
// Add profile data for application users by adding properties to the ApplicationUser class
public class ApplicationUser : IdentityUser
{
}
}
| 23.071429 | 95 | 0.773994 | [
"MIT"
] | dansiegel/Blogifier | Blogifier.Web/Models/ApplicationUser.cs | 325 | C# |
/*
* libiio - Library for interfacing industrial I/O (IIO) devices
*
* Copyright (C) 2015 Analog Devices, Inc.
* Author: Paul Cercueil <paul.cercueil@analog.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* */
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace iio
{
/// <summary><see cref="iio.Channel"/> class:
/// Contains the representation of an input or output channel.</summary>
public class Channel
{
private class ChannelAttr : Attr
{
private IntPtr chn;
[DllImport("libiio.dll", CallingConvention = CallingConvention.Cdecl)]
private static extern int iio_channel_attr_read(IntPtr chn, [In()] string name, [Out()] StringBuilder val, uint len);
[DllImport("libiio.dll", CallingConvention = CallingConvention.Cdecl)]
private static extern int iio_channel_attr_write(IntPtr chn, [In()] string name, string val);
[DllImport("libiio.dll", CallingConvention = CallingConvention.Cdecl)]
private static extern IntPtr iio_channel_attr_get_filename(IntPtr chn, [In()] string attr);
public ChannelAttr(IntPtr chn, string name) : base(name, Marshal.PtrToStringAnsi(iio_channel_attr_get_filename(chn, name)))
{
this.chn = chn;
}
public override string read()
{
StringBuilder builder = new StringBuilder(1024);
int err = iio_channel_attr_read(chn, name, builder, (uint) builder.Capacity);
if (err < 0)
throw new Exception("Unable to read channel attribute " + err);
return builder.ToString();
}
public override void write(string str)
{
int err = iio_channel_attr_write(chn, name, str);
if (err < 0)
throw new Exception("Unable to write channel attribute " + err);
}
}
private IntPtr chn;
private uint sample_size;
[DllImport("libiio.dll", CallingConvention = CallingConvention.Cdecl)]
private static extern IntPtr iio_channel_get_id(IntPtr chn);
[DllImport("libiio.dll", CallingConvention = CallingConvention.Cdecl)]
private static extern IntPtr iio_channel_get_name(IntPtr chn);
[DllImport("libiio.dll", CallingConvention = CallingConvention.Cdecl)]
private static extern uint iio_channel_get_attrs_count(IntPtr chn);
[DllImport("libiio.dll", CallingConvention = CallingConvention.Cdecl)]
private static extern IntPtr iio_channel_get_attr(IntPtr chn, uint index);
[DllImport("libiio.dll", CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
private static extern bool iio_channel_is_output(IntPtr chn);
[DllImport("libiio.dll", CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
private static extern bool iio_channel_is_scan_element(IntPtr chn);
[DllImport("libiio.dll", CallingConvention = CallingConvention.Cdecl)]
private static extern void iio_channel_enable(IntPtr chn);
[DllImport("libiio.dll", CallingConvention = CallingConvention.Cdecl)]
private static extern void iio_channel_disable(IntPtr chn);
[DllImport("libiio.dll", CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
private static extern bool iio_channel_is_enabled(IntPtr chn);
[DllImport("libiio.dll", CallingConvention = CallingConvention.Cdecl)]
private static extern uint iio_channel_read_raw(IntPtr chn, IntPtr buf, IntPtr dst, uint len);
[DllImport("libiio.dll", CallingConvention = CallingConvention.Cdecl)]
private static extern uint iio_channel_write_raw(IntPtr chn, IntPtr buf, IntPtr src, uint len);
[DllImport("libiio.dll", CallingConvention = CallingConvention.Cdecl)]
private static extern uint iio_channel_read(IntPtr chn, IntPtr buf, IntPtr dst, uint len);
[DllImport("libiio.dll", CallingConvention = CallingConvention.Cdecl)]
private static extern uint iio_channel_write(IntPtr chn, IntPtr buf, IntPtr src, uint len);
[DllImport("libiio.dll", CallingConvention = CallingConvention.Cdecl)]
private static extern IntPtr iio_channel_get_data_format(IntPtr chn);
/// <summary>The name of this channel.</summary>
public readonly string name;
/// <summary>An identifier of this channel.</summary>
/// <remarks>It is possible that two channels have the same ID,
/// if one is an input channel and the other is an output channel.</remarks>
public readonly string id;
/// <summary>Contains <c>true</c> if the channel is an output channel,
/// <c>false</c> otherwise.</summary>
public readonly bool output;
/// <summary>Contains <c>true</c> if the channel is a scan element,
/// <c>false</c> otherwise.</summary>
/// <remarks>If a channel is a scan element, then it is possible to enable it
/// and use it for I/O operations.</remarks>
public readonly bool scan_element;
/// <summary>A <c>list</c> of all the attributes that this channel has.</summary>
public readonly List<Attr> attrs;
internal Channel(IntPtr chn)
{
this.chn = chn;
attrs = new List<Attr>();
sample_size = (uint)Marshal.ReadInt32(iio_channel_get_data_format(this.chn)) / 8;
uint nb_attrs = iio_channel_get_attrs_count(chn);
for (uint i = 0; i < nb_attrs; i++)
attrs.Add(new ChannelAttr(this.chn, Marshal.PtrToStringAnsi(iio_channel_get_attr(chn, i))));
IntPtr name_ptr = iio_channel_get_name(this.chn);
if (name_ptr == IntPtr.Zero)
name = "";
else
name = Marshal.PtrToStringAnsi(name_ptr);
id = Marshal.PtrToStringAnsi(iio_channel_get_id(this.chn));
output = iio_channel_is_output(this.chn);
scan_element = iio_channel_is_scan_element(this.chn);
}
/// <summary>Enable the current channel, so that it can be used for I/O operations.</summary>
public void enable()
{
iio_channel_enable(this.chn);
}
/// <summary>Disable the current channel.</summary>
public void disable()
{
iio_channel_disable(this.chn);
}
/// <summary>Returns whether or not the channel has been enabled.</summary>
public bool is_enabled()
{
return iio_channel_is_enabled(this.chn);
}
/// <summary>Extract the samples corresponding to this channel from the
/// given <see cref="iio.IOBuffer"/> object.</summary>
/// <param name="buffer">A valid instance of the <see cref="iio.IOBuffer"/> class.</param>
/// <param name="raw">If set to <c>true</c>, the samples are not converted from their
/// hardware format to their host format.</param>
/// <returns>A <c>byte</c> array containing the extracted samples.</returns>
/// <exception cref="System.Exception">The samples could not be read.</exception>
public byte[] read(IOBuffer buffer, bool raw = false)
{
if (!is_enabled())
throw new Exception("Channel must be enabled before the IOBuffer is instantiated");
if (this.output)
throw new Exception("Unable to read from output channel");
byte[] array = new byte[(int) (buffer.samples_count * sample_size)];
MemoryStream stream = new MemoryStream(array, true);
GCHandle handle = GCHandle.Alloc(array, GCHandleType.Pinned);
IntPtr addr = handle.AddrOfPinnedObject();
uint count;
if (raw)
count = iio_channel_read_raw(this.chn, buffer.buf, addr, buffer.samples_count * sample_size);
else
count = iio_channel_read(this.chn, buffer.buf, addr, buffer.samples_count * sample_size);
handle.Free();
stream.SetLength((long) count);
return stream.ToArray();
}
/// <summary>
/// Write the specified array of samples corresponding to this channel into the
/// given <see cref="iio.IOBuffer"/> object.</summary>
/// <param name="buffer">A valid instance of the <see cref="iio.IOBuffer"/> class.</param>
/// <param name="array">A <c>byte</c> array containing the samples to write.</param>
/// <param name="raw">If set to <c>true</c>, the samples are not converted from their
/// host format to their native format.</param>
/// <returns>The number of bytes written.</returns>
/// <exception cref="System.Exception">The samples could not be written.</exception>
public uint write(IOBuffer buffer, byte[] array, bool raw = false)
{
if (!is_enabled())
throw new Exception("Channel must be enabled before the IOBuffer is instantiated");
if (!this.output)
throw new Exception("Unable to write to an input channel");
GCHandle handle = GCHandle.Alloc(array, GCHandleType.Pinned);
IntPtr addr = handle.AddrOfPinnedObject();
uint count;
if (raw)
count = iio_channel_write_raw(this.chn, buffer.buf, addr, (uint) array.Length);
else
count = iio_channel_write(this.chn, buffer.buf, addr, (uint) array.Length);
handle.Free();
return count;
}
}
}
| 43.666667 | 135 | 0.638323 | [
"MPL-2.0",
"MPL-2.0-no-copyleft-exception"
] | SchulichRacingElectrical/telemetry | components/libiioComponent/libiio/bindings/csharp/Channel.cs | 10,349 | C# |
using System;
using System.Collections.Generic;
namespace Dgt.Dojo.Optimisations
{
public static class IndicesOf
{
public static IEnumerable<int> Baseline(string value, string substring)
{
var indices = new List<int>();
var index = 0;
while ((index = value.IndexOf(substring, index, StringComparison.Ordinal)) != -1)
{
indices.Add(index++);
}
return indices;
}
public static IEnumerable<int> A_YieldReturn(string value, string substring)
{
var index = 0;
while ((index = value.IndexOf(substring, index, StringComparison.Ordinal)) != -1)
{
yield return index++;
}
}
public static IEnumerable<int> B_UsingSpanAndList(ReadOnlySpan<char> value, ReadOnlySpan<char> substring)
{
var indices = new List<int>();
var index = 0;
var lastIndex = -1;
var remainingValue = value[..];
while (index < value.Length)
{
index = remainingValue.IndexOf(substring, StringComparison.Ordinal);
if (index == -1)
{
break;
}
lastIndex = lastIndex + index + 1;
indices.Add(lastIndex) ;
remainingValue = remainingValue[(index + 1)..];
}
return indices;
}
public static IEnumerable<int> C_UsingSpanAndStack(ReadOnlySpan<char> value, ReadOnlySpan<char> substring)
{
var indices = new Stack<int>();
var index = 0;
var lastIndex = -1;
var remainingValue = value[..];
while (index < value.Length)
{
index = remainingValue.IndexOf(substring, StringComparison.Ordinal);
if (index == -1)
{
break;
}
lastIndex = lastIndex + index + 1;
indices.Push(lastIndex) ;
remainingValue = remainingValue[(index + 1)..];
}
return indices;
}
public static IEnumerable<int> D_ManualComparisonOfSpansUsingRange(this ReadOnlySpan<char> value, ReadOnlySpan<char> substring)
{
var indices = new List<int>();
var index = 0;
while (index + substring.Length <= value.Length)
{
if (Compare(value[index..(index + substring.Length)], substring))
{
indices.Add(index);
}
index++;
}
return indices;
bool Compare(ReadOnlySpan<char> left, ReadOnlySpan<char> right)
{
if (left.Length != right.Length)
{
return false;
}
for (var i = 0; i < left.Length; i++)
{
if (left[i] != right[i])
{
return false;
}
}
return true;
}
}
public static IEnumerable<int> E_ManualComparisonOfSpansUsingOffsetAndLocalFunction(this ReadOnlySpan<char> value, ReadOnlySpan<char> substring)
{
var indices = new List<int>();
var index = 0;
while (index + substring.Length <= value.Length)
{
if (Compare(value, substring, index))
{
indices.Add(index);
}
index++;
}
return indices;
bool Compare(ReadOnlySpan<char> left, ReadOnlySpan<char> right, int offset)
{
for (var i = 0; i < right.Length; i++)
{
if (left[i + offset] != right[i])
{
return false;
}
}
return true;
}
}
public static IEnumerable<int> F_ManualComparisonOfSpansUsingOffsetAndNestedLoop(this ReadOnlySpan<char> value, ReadOnlySpan<char> substring)
{
var indices = new List<int>();
var index = 0;
while (index + substring.Length <= value.Length)
{
for (var j = 0; j < substring.Length; j++)
{
if(value[index + j] != substring[j])
{
break;
}
indices.Add(index);
}
index++;
}
return indices;
}
}
} | 29.065089 | 152 | 0.436889 | [
"MIT"
] | mmmcaffeine/balance | src/Optimisations/IndicesOf.cs | 4,914 | C# |
using System.Net.Mail;
namespace Abp.Net.Mail.Smtp
{
/// <summary>
/// Used to send emails over SMTP.
/// </summary>
public interface ISmtpEmailSender : IEmailSender
{
/// <summary>
/// Creates and configures new <see cref="SmtpClient"/> object to send emails.
/// </summary>
/// <returns>
/// An <see cref="SmtpClient"/> object that is ready to send emails.
/// </returns>
SmtpClient BuildClient();
}
} | 26.944444 | 87 | 0.571134 | [
"MIT"
] | FlipGitBits/aspnetboilerplate | src/Abp/Net/Mail/Smtp/ISmtpEmailSender.cs | 485 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CottontailApi.Commons;
using CottontailApi.Commons.CustomJsonConverter;
using Newtonsoft.Json;
namespace CottontailApi.Dto.Match
{
public class MatchDto
{
/// <summary>
///
/// </summary>
[JsonProperty("seasonId")]
public int SeasonId { get; set; }
/// <summary>
///
/// </summary>
[JsonProperty("queueId")]
public int QueueId { get; set; }
/// <summary>
///
/// </summary>
[JsonProperty("gameId")]
public long GameId { get; set; }
/// <summary>
///
/// </summary>
[JsonProperty("participantIdentities")]
public List<ParticipantIdentityDto> ParticipantIdentities { get; set; }
/// <summary>
///
/// </summary>
[JsonProperty("gameVersion")]
public string GameVersion { get; set; }
/// <summary>
///
/// </summary>
[JsonProperty("platformId")]
[JsonConverter(typeof(PlatformJsonConverter))]
public Enums.Platform PlatformId { get; set; }
/// <summary>
///
/// </summary>
[JsonProperty("gameMode")]
[JsonConverter(typeof(GameModeTypeJsonConverter))]
public Enums.GameModeType GameMode { get; set; }
/// <summary>
///
/// </summary>
[JsonProperty("mapId")]
public int MapId { get; set; }
[JsonProperty("gameType")]
[JsonConverter(typeof(GameTypeJsonConverter))]
public Enums.GameType GameType { get; set; }
/// <summary>
///
/// </summary>
[JsonProperty("teams")]
public List<TeamStatsDto> Teams { get; set; }
/// <summary>
///
/// </summary>
[JsonProperty("participants")]
public List<ParticipantDto> Participants { get; set; }
/// <summary>
///
/// </summary>
[JsonProperty("gameDuration")]
public long GameDuration { get; set; }
/// <summary>
///
/// </summary>
[JsonProperty("gameCreation")]
public long GameCreation { get; set; }
}
}
| 24.892473 | 79 | 0.52527 | [
"MIT"
] | ercand/CottontailSummoners | CottontailApi/Dto/Match/MatchDto.cs | 2,317 | C# |
using System;
using RimWorldRealFoW;
using Verse;
namespace RimWorldRealFoW
{
// Token: 0x0200000F RID: 15
public class CompComponentsPositionTracker : ThingSubComp
{
// Token: 0x06000044 RID: 68 RVA: 0x00005A3C File Offset: 0x00003C3C
public override void PostSpawnSetup(bool respawningAfterLoad)
{
this.setupDone = true;
ThingDef def = this.parent.def;
this.size = def.size;
this.isOneCell = (this.size.z == 1 && this.size.x == 1);
this.compHideFromPlayer = this.mainComponent.compHideFromPlayer;
this.compAffectVision = this.parent.TryGetComp<CompAffectVision>();
this.lastPosition = CompComponentsPositionTracker.iv3Invalid;
this.lastRotation = CompComponentsPositionTracker.r4Invalid;
this.updatePosition();
}
// Token: 0x06000045 RID: 69 RVA: 0x00005ACD File Offset: 0x00003CCD
public override void ReceiveCompSignal(string signal)
{
base.ReceiveCompSignal(signal);
this.updatePosition();
}
// Token: 0x06000046 RID: 70 RVA: 0x00005AE0 File Offset: 0x00003CE0
public override void CompTick()
{
base.CompTick();
int ticksGame = Find.TickManager.TicksGame;
bool flag = ticksGame % 12 == 0;
if (flag)
{
this.updatePosition();
}
}
// Token: 0x06000047 RID: 71 RVA: 0x00005B14 File Offset: 0x00003D14
public void updatePosition()
{
bool flag = !this.setupDone;
if (!flag)
{
Thing parent = this.parent;
IntVec3 position = parent.Position;
Rot4 rotation = parent.Rotation;
bool flag2 = parent != null && parent.Spawned && parent.Map != null && position != CompComponentsPositionTracker.iv3Invalid && (this.isOneCell || rotation != CompComponentsPositionTracker.r4Invalid) && (this.compHideFromPlayer != null || this.compAffectVision != null);
if (flag2)
{
bool flag3 = this.map != parent.Map;
if (flag3)
{
this.map = parent.Map;
this.mapCompSeenFog = parent.Map.getMapComponentSeenFog();
}
else
{
bool flag4 = this.mapCompSeenFog == null;
if (flag4)
{
this.mapCompSeenFog = parent.Map.getMapComponentSeenFog();
}
}
bool flag5 = this.mapCompSeenFog == null;
if (!flag5)
{
bool flag6 = !this.calculated || position != this.lastPosition || (!this.isOneCell && rotation != this.lastRotation);
if (flag6)
{
this.calculated = true;
bool flag7 = this.isOneCell;
if (flag7)
{
bool flag8 = this.compHideFromPlayer != null;
if (flag8)
{
this.mapCompSeenFog.DeregisterCompHideFromPlayerPosition(this.compHideFromPlayer, this.lastPosition.x, this.lastPosition.z);
this.mapCompSeenFog.RegisterCompHideFromPlayerPosition(this.compHideFromPlayer, position.x, position.z);
}
bool flag9 = this.compAffectVision != null;
if (flag9)
{
this.mapCompSeenFog.DeregisterCompAffectVisionPosition(this.compAffectVision, this.lastPosition.x, this.lastPosition.z);
this.mapCompSeenFog.RegisterCompAffectVisionPosition(this.compAffectVision, position.x, position.z);
}
}
else
{
bool flag10 = this.lastPosition != CompComponentsPositionTracker.iv3Invalid && this.lastRotation != CompComponentsPositionTracker.r4Invalid;
if (flag10)
{
CellRect cellRect = GenAdj.OccupiedRect(this.lastPosition, this.lastRotation, this.size);
for (int i = cellRect.minZ; i <= cellRect.maxZ; i++)
{
for (int j = cellRect.minX; j <= cellRect.maxX; j++)
{
bool flag11 = this.compHideFromPlayer != null;
if (flag11)
{
this.mapCompSeenFog.DeregisterCompHideFromPlayerPosition(this.compHideFromPlayer, j, i);
}
bool flag12 = this.compAffectVision != null;
if (flag12)
{
this.mapCompSeenFog.DeregisterCompAffectVisionPosition(this.compAffectVision, j, i);
}
}
}
}
bool flag13 = position != CompComponentsPositionTracker.iv3Invalid && rotation != CompComponentsPositionTracker.r4Invalid;
if (flag13)
{
CellRect cellRect2 = GenAdj.OccupiedRect(position, rotation, this.size);
for (int i = cellRect2.minZ; i <= cellRect2.maxZ; i++)
{
for (int j = cellRect2.minX; j <= cellRect2.maxX; j++)
{
bool flag14 = this.compHideFromPlayer != null;
if (flag14)
{
this.mapCompSeenFog.RegisterCompHideFromPlayerPosition(this.compHideFromPlayer, j, i);
}
bool flag15 = this.compAffectVision != null;
if (flag15)
{
this.mapCompSeenFog.RegisterCompAffectVisionPosition(this.compAffectVision, j, i);
}
}
}
}
}
this.lastPosition = position;
bool flag16 = this.size.x != 1 || this.size.z != 1;
if (flag16)
{
this.lastRotation = rotation;
}
}
}
}
}
}
// Token: 0x06000048 RID: 72 RVA: 0x00005F0C File Offset: 0x0000410C
public override void PostDeSpawn(Map map)
{
base.PostDeSpawn(map);
bool flag = this.mapCompSeenFog != null && (this.compHideFromPlayer != null || this.compAffectVision != null);
if (flag)
{
bool flag2 = this.isOneCell;
if (flag2)
{
this.mapCompSeenFog.DeregisterCompHideFromPlayerPosition(this.compHideFromPlayer, this.lastPosition.x, this.lastPosition.z);
this.mapCompSeenFog.DeregisterCompAffectVisionPosition(this.compAffectVision, this.lastPosition.x, this.lastPosition.z);
}
else
{
bool flag3 = this.lastPosition != CompComponentsPositionTracker.iv3Invalid && this.lastRotation != CompComponentsPositionTracker.r4Invalid;
if (flag3)
{
CellRect cellRect = GenAdj.OccupiedRect(this.lastPosition, this.lastRotation, this.size);
for (int i = cellRect.minZ; i <= cellRect.maxZ; i++)
{
for (int j = cellRect.minX; j <= cellRect.maxX; j++)
{
bool flag4 = this.compHideFromPlayer != null;
if (flag4)
{
this.mapCompSeenFog.DeregisterCompHideFromPlayerPosition(this.compHideFromPlayer, j, i);
}
bool flag5 = this.compAffectVision != null;
if (flag5)
{
this.mapCompSeenFog.DeregisterCompAffectVisionPosition(this.compAffectVision, j, i);
}
}
}
}
}
}
}
// Token: 0x04000037 RID: 55
private static readonly IntVec3 iv3Invalid = IntVec3.Invalid;
// Token: 0x04000038 RID: 56
private static readonly Rot4 r4Invalid = Rot4.Invalid;
// Token: 0x04000039 RID: 57
private IntVec2 size;
// Token: 0x0400003A RID: 58
private IntVec3 lastPosition;
// Token: 0x0400003B RID: 59
private Rot4 lastRotation;
// Token: 0x0400003C RID: 60
private bool isOneCell;
// Token: 0x0400003D RID: 61
private Map map;
// Token: 0x0400003E RID: 62
private MapComponentSeenFog mapCompSeenFog;
// Token: 0x0400003F RID: 63
private CompHideFromPlayer compHideFromPlayer;
// Token: 0x04000040 RID: 64
private CompAffectVision compAffectVision;
// Token: 0x04000041 RID: 65
private bool setupDone = false;
// Token: 0x04000042 RID: 66
private bool calculated = false;
}
}
| 32.389381 | 273 | 0.647404 | [
"Apache-2.0"
] | Cireric120/rimworld-mod-real-fow | Sources/RimWorldRealFoW/CompComponentsPositionTracker.cs | 7,322 | C# |
#region BSD License
/*
* Use of this source code is governed by a BSD-style
* license that can be found in the LICENSE.md file or at
* https://github.com/Wagnerp/Krypton-Toolkit-Suite-Extended-NET-5.470/blob/master/LICENSE
*
*/
#endregion
using ComponentFactory.Krypton.Toolkit;
using Persistence.Classes.Options.Theming;
using System;
using System.Windows.Forms;
using ToolkitSettings.Classes.PaletteExplorer;
namespace Persistence.UX.Options
{
public partial class GlobalOptionsMenu : KryptonForm
{
#region System
private System.Windows.Forms.Panel panel1;
private KryptonPanel kryptonPanel2;
private ComponentFactory.Krypton.Navigator.KryptonNavigator kryptonNavigator1;
private ComponentFactory.Krypton.Navigator.KryptonPage kryptonPage1;
private ComponentFactory.Krypton.Navigator.KryptonPage kpTheme;
private KryptonToolkitSuiteExtendedCore.Components.KryptonUACElevatedButton kbtnUACApply;
private KryptonButton kbtnOk;
private KryptonButton kbtnCancel;
private ComponentFactory.Krypton.Docking.KryptonDockableNavigator kryptonDockableNavigator1;
private ComponentFactory.Krypton.Navigator.KryptonPage kryptonPage3;
private ComponentFactory.Krypton.Navigator.KryptonPage kryptonPage4;
private ComponentFactory.Krypton.Navigator.KryptonPage kryptonPage5;
private KryptonLabel kryptonLabel1;
private KryptonLabel kryptonLabel2;
private KryptonLabel kryptonLabel3;
private KryptonColorButton kcbBaseColour;
private KryptonLabel kryptonLabel4;
private KryptonToolkitSuiteExtendedCore.CircularPictureBox cbxLightestColourPreview;
private KryptonNumericUpDown knumDarkColourIntensityValue;
private KryptonToolkitSuiteExtendedCore.CircularPictureBox cbxLightColourPreview;
private KryptonNumericUpDown knumMiddleColourIntensityValue;
private KryptonToolkitSuiteExtendedCore.CircularPictureBox cbxMediumColourPreview;
private KryptonNumericUpDown knumLightColourIntensityValue;
private KryptonToolkitSuiteExtendedCore.CircularPictureBox cbxDarkColourPreview;
private KryptonNumericUpDown knumLightestColourIntensityValue;
private KryptonLabel kryptonLabel5;
private KryptonLabel klblLightestColourIntensityValueOutput;
private KryptonLabel kryptonLabel6;
private KryptonLabel klblLightColourIntensityValueOutput;
private KryptonLabel kryptonLabel7;
private KryptonLabel klblMiddleColourIntensityValueOutput;
private KryptonLabel kryptonLabel8;
private KryptonLabel klblDarkColourIntensityValueOutput;
private KryptonButton kbtnDarkColourIntensityValueMinus;
private KryptonButton kbtnLightestColourIntensityValuePlus;
private KryptonButton kbnDarkestColourIntensityValuePlus;
private KryptonButton kbtnLightestColourIntensityValueMinus;
private KryptonButton kbtnMiddleColourIntensityValueMinus;
private KryptonButton kbtLightColourIntensityValuePlus;
private KryptonButton kbtnMiddleColourIntensityValuePlus;
private KryptonButton kbtnLightColourIntensityValueMinus;
private KryptonButton kbtnResetColourBlendingValues;
private KryptonCheckBox kchkConvertToRGBValue;
private KryptonCheckBox kcbConvertToHexadecimalValue;
private KryptonCheckBox kchkGenerateAlphaValue;
private KryptonToolkitSuiteExtendedCore.CircularPictureBox cbxCircular;
private System.Windows.Forms.PictureBox pbxStandard;
private KryptonComboBox kcmbDisplayType;
private KryptonLabel kryptonLabel9;
private KryptonCheckBox kchkAutomaticallyUpdateValues;
private KryptonButton kbtnRestore;
private KryptonButton kbtnBrowse;
private KryptonMaskedTextBox kmtxtFilePath;
private KryptonLabel kryptonLabel10;
private KryptonTextBox ktxtCustomPath;
private KryptonLabel klblCustomTheme;
private KryptonComboBox kcmbPaletteTheme;
private KryptonLabel kryptonLabel11;
private KryptonButton kbtnLoadTheme;
private KryptonButton kbtnImportPalette;
private KryptonButton kbtnResetThemeValues;
private ComponentFactory.Krypton.Navigator.KryptonPage kpSettings;
private KryptonButton kbtnResetPaletteTypefaceSettings;
private KryptonButton kbtnResetGlobalStringSettings;
private KryptonButton kbtnResetGlobalBooleanSettings;
private KryptonButton kbtnResetColourStringSettings;
private KryptonButton kbtnResetColourSettings;
private KryptonButton kbtnResetColourIntegerSettings;
private KryptonButton kbtnResetColourBlendingSettings;
private KryptonButton kbtnNukeAllSettings;
private KryptonCheckBox kchkAskForConfirmation;
private KryptonPanel kryptonPanel1;
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(GlobalOptionsMenu));
this.kryptonPanel1 = new ComponentFactory.Krypton.Toolkit.KryptonPanel();
this.kbtnResetThemeValues = new ComponentFactory.Krypton.Toolkit.KryptonButton();
this.kbtnResetColourBlendingValues = new ComponentFactory.Krypton.Toolkit.KryptonButton();
this.kbtnOk = new ComponentFactory.Krypton.Toolkit.KryptonButton();
this.kbtnCancel = new ComponentFactory.Krypton.Toolkit.KryptonButton();
this.kbtnUACApply = new KryptonToolkitSuiteExtendedCore.Components.KryptonUACElevatedButton();
this.panel1 = new System.Windows.Forms.Panel();
this.kryptonPanel2 = new ComponentFactory.Krypton.Toolkit.KryptonPanel();
this.kryptonNavigator1 = new ComponentFactory.Krypton.Navigator.KryptonNavigator();
this.kryptonPage1 = new ComponentFactory.Krypton.Navigator.KryptonPage();
this.kryptonDockableNavigator1 = new ComponentFactory.Krypton.Docking.KryptonDockableNavigator();
this.kryptonPage3 = new ComponentFactory.Krypton.Navigator.KryptonPage();
this.kryptonLabel1 = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
this.kryptonLabel2 = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
this.kryptonLabel3 = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
this.kcbBaseColour = new ComponentFactory.Krypton.Toolkit.KryptonColorButton();
this.kryptonLabel4 = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
this.cbxLightestColourPreview = new KryptonToolkitSuiteExtendedCore.CircularPictureBox();
this.knumDarkColourIntensityValue = new ComponentFactory.Krypton.Toolkit.KryptonNumericUpDown();
this.cbxLightColourPreview = new KryptonToolkitSuiteExtendedCore.CircularPictureBox();
this.knumMiddleColourIntensityValue = new ComponentFactory.Krypton.Toolkit.KryptonNumericUpDown();
this.cbxMediumColourPreview = new KryptonToolkitSuiteExtendedCore.CircularPictureBox();
this.knumLightColourIntensityValue = new ComponentFactory.Krypton.Toolkit.KryptonNumericUpDown();
this.cbxDarkColourPreview = new KryptonToolkitSuiteExtendedCore.CircularPictureBox();
this.knumLightestColourIntensityValue = new ComponentFactory.Krypton.Toolkit.KryptonNumericUpDown();
this.kryptonLabel5 = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
this.klblLightestColourIntensityValueOutput = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
this.kryptonLabel6 = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
this.klblLightColourIntensityValueOutput = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
this.kryptonLabel7 = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
this.klblMiddleColourIntensityValueOutput = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
this.kryptonLabel8 = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
this.klblDarkColourIntensityValueOutput = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
this.kbtnDarkColourIntensityValueMinus = new ComponentFactory.Krypton.Toolkit.KryptonButton();
this.kbtnLightestColourIntensityValuePlus = new ComponentFactory.Krypton.Toolkit.KryptonButton();
this.kbnDarkestColourIntensityValuePlus = new ComponentFactory.Krypton.Toolkit.KryptonButton();
this.kbtnLightestColourIntensityValueMinus = new ComponentFactory.Krypton.Toolkit.KryptonButton();
this.kbtnMiddleColourIntensityValueMinus = new ComponentFactory.Krypton.Toolkit.KryptonButton();
this.kbtLightColourIntensityValuePlus = new ComponentFactory.Krypton.Toolkit.KryptonButton();
this.kbtnMiddleColourIntensityValuePlus = new ComponentFactory.Krypton.Toolkit.KryptonButton();
this.kbtnLightColourIntensityValueMinus = new ComponentFactory.Krypton.Toolkit.KryptonButton();
this.kryptonPage4 = new ComponentFactory.Krypton.Navigator.KryptonPage();
this.kchkConvertToRGBValue = new ComponentFactory.Krypton.Toolkit.KryptonCheckBox();
this.kcbConvertToHexadecimalValue = new ComponentFactory.Krypton.Toolkit.KryptonCheckBox();
this.kchkGenerateAlphaValue = new ComponentFactory.Krypton.Toolkit.KryptonCheckBox();
this.cbxCircular = new KryptonToolkitSuiteExtendedCore.CircularPictureBox();
this.pbxStandard = new System.Windows.Forms.PictureBox();
this.kcmbDisplayType = new ComponentFactory.Krypton.Toolkit.KryptonComboBox();
this.kryptonLabel9 = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
this.kchkAutomaticallyUpdateValues = new ComponentFactory.Krypton.Toolkit.KryptonCheckBox();
this.kryptonPage5 = new ComponentFactory.Krypton.Navigator.KryptonPage();
this.kbtnRestore = new ComponentFactory.Krypton.Toolkit.KryptonButton();
this.kbtnBrowse = new ComponentFactory.Krypton.Toolkit.KryptonButton();
this.kmtxtFilePath = new ComponentFactory.Krypton.Toolkit.KryptonMaskedTextBox();
this.kryptonLabel10 = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
this.kpTheme = new ComponentFactory.Krypton.Navigator.KryptonPage();
this.kbtnLoadTheme = new ComponentFactory.Krypton.Toolkit.KryptonButton();
this.kbtnImportPalette = new ComponentFactory.Krypton.Toolkit.KryptonButton();
this.ktxtCustomPath = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
this.klblCustomTheme = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
this.kcmbPaletteTheme = new ComponentFactory.Krypton.Toolkit.KryptonComboBox();
this.kryptonLabel11 = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
this.kpSettings = new ComponentFactory.Krypton.Navigator.KryptonPage();
this.kchkAskForConfirmation = new ComponentFactory.Krypton.Toolkit.KryptonCheckBox();
this.kbtnResetPaletteTypefaceSettings = new ComponentFactory.Krypton.Toolkit.KryptonButton();
this.kbtnResetGlobalStringSettings = new ComponentFactory.Krypton.Toolkit.KryptonButton();
this.kbtnResetGlobalBooleanSettings = new ComponentFactory.Krypton.Toolkit.KryptonButton();
this.kbtnResetColourStringSettings = new ComponentFactory.Krypton.Toolkit.KryptonButton();
this.kbtnResetColourSettings = new ComponentFactory.Krypton.Toolkit.KryptonButton();
this.kbtnResetColourIntegerSettings = new ComponentFactory.Krypton.Toolkit.KryptonButton();
this.kbtnResetColourBlendingSettings = new ComponentFactory.Krypton.Toolkit.KryptonButton();
this.kbtnNukeAllSettings = new ComponentFactory.Krypton.Toolkit.KryptonButton();
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
this.kryptonPanel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit();
this.kryptonPanel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.kryptonNavigator1)).BeginInit();
this.kryptonNavigator1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.kryptonPage1)).BeginInit();
this.kryptonPage1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.kryptonDockableNavigator1)).BeginInit();
this.kryptonDockableNavigator1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.kryptonPage3)).BeginInit();
this.kryptonPage3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.cbxLightestColourPreview)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.cbxLightColourPreview)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.cbxMediumColourPreview)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.cbxDarkColourPreview)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.kryptonPage4)).BeginInit();
this.kryptonPage4.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.cbxCircular)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pbxStandard)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.kcmbDisplayType)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.kryptonPage5)).BeginInit();
this.kryptonPage5.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.kpTheme)).BeginInit();
this.kpTheme.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.kcmbPaletteTheme)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.kpSettings)).BeginInit();
this.kpSettings.SuspendLayout();
this.SuspendLayout();
//
// kryptonPanel1
//
this.kryptonPanel1.Controls.Add(this.kbtnResetThemeValues);
this.kryptonPanel1.Controls.Add(this.kbtnResetColourBlendingValues);
this.kryptonPanel1.Controls.Add(this.kbtnOk);
this.kryptonPanel1.Controls.Add(this.kbtnCancel);
this.kryptonPanel1.Controls.Add(this.kbtnUACApply);
this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.kryptonPanel1.Location = new System.Drawing.Point(0, 537);
this.kryptonPanel1.Name = "kryptonPanel1";
this.kryptonPanel1.Size = new System.Drawing.Size(690, 52);
this.kryptonPanel1.TabIndex = 0;
//
// kbtnResetThemeValues
//
this.kbtnResetThemeValues.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.kbtnResetThemeValues.AutoSize = true;
this.kbtnResetThemeValues.Enabled = false;
this.kbtnResetThemeValues.Location = new System.Drawing.Point(12, 10);
this.kbtnResetThemeValues.Name = "kbtnResetThemeValues";
this.kbtnResetThemeValues.Size = new System.Drawing.Size(144, 30);
this.kbtnResetThemeValues.StateCommon.Content.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kbtnResetThemeValues.TabIndex = 63;
this.kbtnResetThemeValues.Values.Text = "Re&set Values";
//
// kbtnResetColourBlendingValues
//
this.kbtnResetColourBlendingValues.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.kbtnResetColourBlendingValues.AutoSize = true;
this.kbtnResetColourBlendingValues.Enabled = false;
this.kbtnResetColourBlendingValues.Location = new System.Drawing.Point(12, 10);
this.kbtnResetColourBlendingValues.Name = "kbtnResetColourBlendingValues";
this.kbtnResetColourBlendingValues.Size = new System.Drawing.Size(144, 30);
this.kbtnResetColourBlendingValues.StateCommon.Content.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kbtnResetColourBlendingValues.TabIndex = 62;
this.kbtnResetColourBlendingValues.Values.Text = "Re&set Values";
//
// kbtnOk
//
this.kbtnOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.kbtnOk.AutoSize = true;
this.kbtnOk.Location = new System.Drawing.Point(414, 10);
this.kbtnOk.Name = "kbtnOk";
this.kbtnOk.Size = new System.Drawing.Size(90, 30);
this.kbtnOk.StateCommon.Content.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kbtnOk.TabIndex = 4;
this.kbtnOk.Values.Text = "&Ok";
//
// kbtnCancel
//
this.kbtnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.kbtnCancel.AutoSize = true;
this.kbtnCancel.Location = new System.Drawing.Point(510, 10);
this.kbtnCancel.Name = "kbtnCancel";
this.kbtnCancel.Size = new System.Drawing.Size(90, 30);
this.kbtnCancel.StateCommon.Content.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kbtnCancel.TabIndex = 5;
this.kbtnCancel.Values.Text = "Ca&ncel";
//
// kbtnUACApply
//
this.kbtnUACApply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.kbtnUACApply.AutoSize = true;
this.kbtnUACApply.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.kbtnUACApply.Enabled = false;
this.kbtnUACApply.Location = new System.Drawing.Point(606, 10);
this.kbtnUACApply.Name = "kbtnUACApply";
this.kbtnUACApply.Size = new System.Drawing.Size(71, 30);
this.kbtnUACApply.StateCommon.Content.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kbtnUACApply.TabIndex = 0;
this.kbtnUACApply.Values.Image = ((System.Drawing.Image)(resources.GetObject("kbtnUACApply.Values.Image")));
this.kbtnUACApply.Values.Text = "&Apply";
//
// panel1
//
this.panel1.BackColor = System.Drawing.SystemColors.ControlDarkDark;
this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.panel1.Location = new System.Drawing.Point(0, 534);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(690, 3);
this.panel1.TabIndex = 1;
//
// kryptonPanel2
//
this.kryptonPanel2.Controls.Add(this.kryptonNavigator1);
this.kryptonPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.kryptonPanel2.Location = new System.Drawing.Point(0, 0);
this.kryptonPanel2.Name = "kryptonPanel2";
this.kryptonPanel2.Size = new System.Drawing.Size(690, 534);
this.kryptonPanel2.TabIndex = 2;
//
// kryptonNavigator1
//
this.kryptonNavigator1.Button.ButtonDisplayLogic = ComponentFactory.Krypton.Navigator.ButtonDisplayLogic.NextPrevious;
this.kryptonNavigator1.Button.CloseButtonDisplay = ComponentFactory.Krypton.Navigator.ButtonDisplay.Hide;
this.kryptonNavigator1.Location = new System.Drawing.Point(12, 12);
this.kryptonNavigator1.Name = "kryptonNavigator1";
this.kryptonNavigator1.NavigatorMode = ComponentFactory.Krypton.Navigator.NavigatorMode.BarCheckButtonGroupOutside;
this.kryptonNavigator1.Pages.AddRange(new ComponentFactory.Krypton.Navigator.KryptonPage[] {
this.kryptonPage1,
this.kpTheme,
this.kpSettings});
this.kryptonNavigator1.SelectedIndex = 1;
this.kryptonNavigator1.Size = new System.Drawing.Size(663, 511);
this.kryptonNavigator1.StateCommon.Tab.Content.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kryptonNavigator1.TabIndex = 0;
this.kryptonNavigator1.Text = "kryptonNavigator1";
//
// kryptonPage1
//
this.kryptonPage1.AutoHiddenSlideSize = new System.Drawing.Size(200, 200);
this.kryptonPage1.Controls.Add(this.kryptonDockableNavigator1);
this.kryptonPage1.Flags = 65534;
this.kryptonPage1.LastVisibleSet = true;
this.kryptonPage1.MinimumSize = new System.Drawing.Size(50, 50);
this.kryptonPage1.Name = "kryptonPage1";
this.kryptonPage1.Size = new System.Drawing.Size(661, 482);
this.kryptonPage1.Text = "C&olour Blending";
this.kryptonPage1.ToolTipTitle = "Page ToolTip";
this.kryptonPage1.UniqueName = "5B92D5986C334B5ADFAF98FE8EEA16E1";
//
// kryptonDockableNavigator1
//
this.kryptonDockableNavigator1.Button.ButtonDisplayLogic = ComponentFactory.Krypton.Navigator.ButtonDisplayLogic.NextPrevious;
this.kryptonDockableNavigator1.Button.CloseButtonAction = ComponentFactory.Krypton.Navigator.CloseButtonAction.None;
this.kryptonDockableNavigator1.Button.CloseButtonDisplay = ComponentFactory.Krypton.Navigator.ButtonDisplay.Hide;
this.kryptonDockableNavigator1.Location = new System.Drawing.Point(15, 19);
this.kryptonDockableNavigator1.Name = "kryptonDockableNavigator1";
this.kryptonDockableNavigator1.NavigatorMode = ComponentFactory.Krypton.Navigator.NavigatorMode.BarCheckButtonGroupOutside;
this.kryptonDockableNavigator1.Pages.AddRange(new ComponentFactory.Krypton.Navigator.KryptonPage[] {
this.kryptonPage3,
this.kryptonPage4,
this.kryptonPage5});
this.kryptonDockableNavigator1.SelectedIndex = 0;
this.kryptonDockableNavigator1.Size = new System.Drawing.Size(627, 450);
this.kryptonDockableNavigator1.TabIndex = 36;
this.kryptonDockableNavigator1.Text = "kryptonDockableNavigator1";
//
// kryptonPage3
//
this.kryptonPage3.AutoHiddenSlideSize = new System.Drawing.Size(200, 200);
this.kryptonPage3.Controls.Add(this.kryptonLabel1);
this.kryptonPage3.Controls.Add(this.kryptonLabel2);
this.kryptonPage3.Controls.Add(this.kryptonLabel3);
this.kryptonPage3.Controls.Add(this.kcbBaseColour);
this.kryptonPage3.Controls.Add(this.kryptonLabel4);
this.kryptonPage3.Controls.Add(this.cbxLightestColourPreview);
this.kryptonPage3.Controls.Add(this.knumDarkColourIntensityValue);
this.kryptonPage3.Controls.Add(this.cbxLightColourPreview);
this.kryptonPage3.Controls.Add(this.knumMiddleColourIntensityValue);
this.kryptonPage3.Controls.Add(this.cbxMediumColourPreview);
this.kryptonPage3.Controls.Add(this.knumLightColourIntensityValue);
this.kryptonPage3.Controls.Add(this.cbxDarkColourPreview);
this.kryptonPage3.Controls.Add(this.knumLightestColourIntensityValue);
this.kryptonPage3.Controls.Add(this.kryptonLabel5);
this.kryptonPage3.Controls.Add(this.klblLightestColourIntensityValueOutput);
this.kryptonPage3.Controls.Add(this.kryptonLabel6);
this.kryptonPage3.Controls.Add(this.klblLightColourIntensityValueOutput);
this.kryptonPage3.Controls.Add(this.kryptonLabel7);
this.kryptonPage3.Controls.Add(this.klblMiddleColourIntensityValueOutput);
this.kryptonPage3.Controls.Add(this.kryptonLabel8);
this.kryptonPage3.Controls.Add(this.klblDarkColourIntensityValueOutput);
this.kryptonPage3.Controls.Add(this.kbtnDarkColourIntensityValueMinus);
this.kryptonPage3.Controls.Add(this.kbtnLightestColourIntensityValuePlus);
this.kryptonPage3.Controls.Add(this.kbnDarkestColourIntensityValuePlus);
this.kryptonPage3.Controls.Add(this.kbtnLightestColourIntensityValueMinus);
this.kryptonPage3.Controls.Add(this.kbtnMiddleColourIntensityValueMinus);
this.kryptonPage3.Controls.Add(this.kbtLightColourIntensityValuePlus);
this.kryptonPage3.Controls.Add(this.kbtnMiddleColourIntensityValuePlus);
this.kryptonPage3.Controls.Add(this.kbtnLightColourIntensityValueMinus);
this.kryptonPage3.Flags = 65534;
this.kryptonPage3.LastVisibleSet = true;
this.kryptonPage3.MinimumSize = new System.Drawing.Size(50, 50);
this.kryptonPage3.Name = "kryptonPage3";
this.kryptonPage3.Size = new System.Drawing.Size(625, 421);
this.kryptonPage3.Text = "Colour Intensity";
this.kryptonPage3.ToolTipTitle = "Page ToolTip";
this.kryptonPage3.UniqueName = "CA84FA1D35D047D920A054A4CAC807D7";
//
// kryptonLabel1
//
this.kryptonLabel1.Location = new System.Drawing.Point(17, 27);
this.kryptonLabel1.Name = "kryptonLabel1";
this.kryptonLabel1.Size = new System.Drawing.Size(204, 26);
this.kryptonLabel1.StateCommon.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kryptonLabel1.TabIndex = 33;
this.kryptonLabel1.Values.Text = "Darkest Colour Intensity:";
//
// kryptonLabel2
//
this.kryptonLabel2.Location = new System.Drawing.Point(17, 122);
this.kryptonLabel2.Name = "kryptonLabel2";
this.kryptonLabel2.Size = new System.Drawing.Size(199, 26);
this.kryptonLabel2.StateCommon.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kryptonLabel2.TabIndex = 34;
this.kryptonLabel2.Values.Text = "Middle Colour Intensity:";
//
// kryptonLabel3
//
this.kryptonLabel3.Location = new System.Drawing.Point(17, 217);
this.kryptonLabel3.Name = "kryptonLabel3";
this.kryptonLabel3.Size = new System.Drawing.Size(184, 26);
this.kryptonLabel3.StateCommon.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kryptonLabel3.TabIndex = 35;
this.kryptonLabel3.Values.Text = "Light Colour Intensity:";
//
// kcbBaseColour
//
this.kcbBaseColour.AutoSize = true;
this.kcbBaseColour.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.kcbBaseColour.Location = new System.Drawing.Point(17, 369);
this.kcbBaseColour.Name = "kcbBaseColour";
this.kcbBaseColour.Size = new System.Drawing.Size(199, 30);
this.kcbBaseColour.StateCommon.Content.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kcbBaseColour.TabIndex = 61;
this.kcbBaseColour.Values.Image = global::Persistence.Properties.Resources.Colour_Wheel_16_x_16;
this.kcbBaseColour.Values.Text = "&Choose a Base Colour";
//
// kryptonLabel4
//
this.kryptonLabel4.Location = new System.Drawing.Point(17, 312);
this.kryptonLabel4.Name = "kryptonLabel4";
this.kryptonLabel4.Size = new System.Drawing.Size(207, 26);
this.kryptonLabel4.StateCommon.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kryptonLabel4.TabIndex = 36;
this.kryptonLabel4.Values.Text = "Lightest Colour Intensity:";
//
// cbxLightestColourPreview
//
this.cbxLightestColourPreview.BackColor = System.Drawing.Color.Black;
this.cbxLightestColourPreview.Location = new System.Drawing.Point(567, 308);
this.cbxLightestColourPreview.Name = "cbxLightestColourPreview";
this.cbxLightestColourPreview.Size = new System.Drawing.Size(32, 32);
this.cbxLightestColourPreview.TabIndex = 60;
this.cbxLightestColourPreview.TabStop = false;
//
// knumDarkColourIntensityValue
//
this.knumDarkColourIntensityValue.DecimalPlaces = 2;
this.knumDarkColourIntensityValue.Location = new System.Drawing.Point(227, 27);
this.knumDarkColourIntensityValue.Name = "knumDarkColourIntensityValue";
this.knumDarkColourIntensityValue.Size = new System.Drawing.Size(82, 28);
this.knumDarkColourIntensityValue.StateCommon.Content.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.knumDarkColourIntensityValue.TabIndex = 37;
this.knumDarkColourIntensityValue.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// cbxLightColourPreview
//
this.cbxLightColourPreview.BackColor = System.Drawing.Color.Black;
this.cbxLightColourPreview.Location = new System.Drawing.Point(567, 213);
this.cbxLightColourPreview.Name = "cbxLightColourPreview";
this.cbxLightColourPreview.Size = new System.Drawing.Size(32, 32);
this.cbxLightColourPreview.TabIndex = 59;
this.cbxLightColourPreview.TabStop = false;
//
// knumMiddleColourIntensityValue
//
this.knumMiddleColourIntensityValue.DecimalPlaces = 2;
this.knumMiddleColourIntensityValue.Location = new System.Drawing.Point(227, 120);
this.knumMiddleColourIntensityValue.Name = "knumMiddleColourIntensityValue";
this.knumMiddleColourIntensityValue.Size = new System.Drawing.Size(82, 28);
this.knumMiddleColourIntensityValue.StateCommon.Content.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.knumMiddleColourIntensityValue.TabIndex = 38;
this.knumMiddleColourIntensityValue.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// cbxMediumColourPreview
//
this.cbxMediumColourPreview.BackColor = System.Drawing.Color.Black;
this.cbxMediumColourPreview.Location = new System.Drawing.Point(567, 120);
this.cbxMediumColourPreview.Name = "cbxMediumColourPreview";
this.cbxMediumColourPreview.Size = new System.Drawing.Size(32, 32);
this.cbxMediumColourPreview.TabIndex = 58;
this.cbxMediumColourPreview.TabStop = false;
//
// knumLightColourIntensityValue
//
this.knumLightColourIntensityValue.DecimalPlaces = 2;
this.knumLightColourIntensityValue.Location = new System.Drawing.Point(227, 215);
this.knumLightColourIntensityValue.Name = "knumLightColourIntensityValue";
this.knumLightColourIntensityValue.Size = new System.Drawing.Size(82, 28);
this.knumLightColourIntensityValue.StateCommon.Content.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.knumLightColourIntensityValue.TabIndex = 39;
this.knumLightColourIntensityValue.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// cbxDarkColourPreview
//
this.cbxDarkColourPreview.BackColor = System.Drawing.Color.Black;
this.cbxDarkColourPreview.Location = new System.Drawing.Point(567, 27);
this.cbxDarkColourPreview.Name = "cbxDarkColourPreview";
this.cbxDarkColourPreview.Size = new System.Drawing.Size(32, 32);
this.cbxDarkColourPreview.TabIndex = 57;
this.cbxDarkColourPreview.TabStop = false;
//
// knumLightestColourIntensityValue
//
this.knumLightestColourIntensityValue.DecimalPlaces = 2;
this.knumLightestColourIntensityValue.Location = new System.Drawing.Point(227, 312);
this.knumLightestColourIntensityValue.Name = "knumLightestColourIntensityValue";
this.knumLightestColourIntensityValue.Size = new System.Drawing.Size(82, 28);
this.knumLightestColourIntensityValue.StateCommon.Content.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.knumLightestColourIntensityValue.TabIndex = 40;
this.knumLightestColourIntensityValue.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// kryptonLabel5
//
this.kryptonLabel5.Location = new System.Drawing.Point(315, 27);
this.kryptonLabel5.Name = "kryptonLabel5";
this.kryptonLabel5.Size = new System.Drawing.Size(26, 26);
this.kryptonLabel5.StateCommon.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kryptonLabel5.TabIndex = 41;
this.kryptonLabel5.Values.Text = "%";
//
// klblLightestColourIntensityValueOutput
//
this.klblLightestColourIntensityValueOutput.Location = new System.Drawing.Point(430, 312);
this.klblLightestColourIntensityValueOutput.Name = "klblLightestColourIntensityValueOutput";
this.klblLightestColourIntensityValueOutput.Size = new System.Drawing.Size(98, 26);
this.klblLightestColourIntensityValueOutput.StateCommon.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.klblLightestColourIntensityValueOutput.TabIndex = 56;
this.klblLightestColourIntensityValueOutput.Values.Text = "Output: {0}";
//
// kryptonLabel6
//
this.kryptonLabel6.Location = new System.Drawing.Point(315, 122);
this.kryptonLabel6.Name = "kryptonLabel6";
this.kryptonLabel6.Size = new System.Drawing.Size(26, 26);
this.kryptonLabel6.StateCommon.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kryptonLabel6.TabIndex = 42;
this.kryptonLabel6.Values.Text = "%";
//
// klblLightColourIntensityValueOutput
//
this.klblLightColourIntensityValueOutput.Location = new System.Drawing.Point(430, 217);
this.klblLightColourIntensityValueOutput.Name = "klblLightColourIntensityValueOutput";
this.klblLightColourIntensityValueOutput.Size = new System.Drawing.Size(98, 26);
this.klblLightColourIntensityValueOutput.StateCommon.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.klblLightColourIntensityValueOutput.TabIndex = 55;
this.klblLightColourIntensityValueOutput.Values.Text = "Output: {0}";
//
// kryptonLabel7
//
this.kryptonLabel7.Location = new System.Drawing.Point(315, 217);
this.kryptonLabel7.Name = "kryptonLabel7";
this.kryptonLabel7.Size = new System.Drawing.Size(26, 26);
this.kryptonLabel7.StateCommon.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kryptonLabel7.TabIndex = 43;
this.kryptonLabel7.Values.Text = "%";
//
// klblMiddleColourIntensityValueOutput
//
this.klblMiddleColourIntensityValueOutput.Location = new System.Drawing.Point(430, 122);
this.klblMiddleColourIntensityValueOutput.Name = "klblMiddleColourIntensityValueOutput";
this.klblMiddleColourIntensityValueOutput.Size = new System.Drawing.Size(98, 26);
this.klblMiddleColourIntensityValueOutput.StateCommon.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.klblMiddleColourIntensityValueOutput.TabIndex = 54;
this.klblMiddleColourIntensityValueOutput.Values.Text = "Output: {0}";
//
// kryptonLabel8
//
this.kryptonLabel8.Location = new System.Drawing.Point(315, 312);
this.kryptonLabel8.Name = "kryptonLabel8";
this.kryptonLabel8.Size = new System.Drawing.Size(26, 26);
this.kryptonLabel8.StateCommon.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kryptonLabel8.TabIndex = 44;
this.kryptonLabel8.Values.Text = "%";
//
// klblDarkColourIntensityValueOutput
//
this.klblDarkColourIntensityValueOutput.Location = new System.Drawing.Point(430, 27);
this.klblDarkColourIntensityValueOutput.Name = "klblDarkColourIntensityValueOutput";
this.klblDarkColourIntensityValueOutput.Size = new System.Drawing.Size(98, 26);
this.klblDarkColourIntensityValueOutput.StateCommon.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.klblDarkColourIntensityValueOutput.TabIndex = 53;
this.klblDarkColourIntensityValueOutput.Values.Text = "Output: {0}";
//
// kbtnDarkColourIntensityValueMinus
//
this.kbtnDarkColourIntensityValueMinus.AutoSize = true;
this.kbtnDarkColourIntensityValueMinus.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.kbtnDarkColourIntensityValueMinus.Location = new System.Drawing.Point(347, 27);
this.kbtnDarkColourIntensityValueMinus.Name = "kbtnDarkColourIntensityValueMinus";
this.kbtnDarkColourIntensityValueMinus.Size = new System.Drawing.Size(18, 30);
this.kbtnDarkColourIntensityValueMinus.StateCommon.Content.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kbtnDarkColourIntensityValueMinus.TabIndex = 45;
this.kbtnDarkColourIntensityValueMinus.Values.Text = "-";
//
// kbtnLightestColourIntensityValuePlus
//
this.kbtnLightestColourIntensityValuePlus.AutoSize = true;
this.kbtnLightestColourIntensityValuePlus.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.kbtnLightestColourIntensityValuePlus.Location = new System.Drawing.Point(383, 308);
this.kbtnLightestColourIntensityValuePlus.Name = "kbtnLightestColourIntensityValuePlus";
this.kbtnLightestColourIntensityValuePlus.Size = new System.Drawing.Size(23, 30);
this.kbtnLightestColourIntensityValuePlus.StateCommon.Content.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kbtnLightestColourIntensityValuePlus.TabIndex = 52;
this.kbtnLightestColourIntensityValuePlus.Values.Text = "+";
//
// kbnDarkestColourIntensityValuePlus
//
this.kbnDarkestColourIntensityValuePlus.AutoSize = true;
this.kbnDarkestColourIntensityValuePlus.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.kbnDarkestColourIntensityValuePlus.Location = new System.Drawing.Point(383, 27);
this.kbnDarkestColourIntensityValuePlus.Name = "kbnDarkestColourIntensityValuePlus";
this.kbnDarkestColourIntensityValuePlus.Size = new System.Drawing.Size(23, 30);
this.kbnDarkestColourIntensityValuePlus.StateCommon.Content.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kbnDarkestColourIntensityValuePlus.TabIndex = 46;
this.kbnDarkestColourIntensityValuePlus.Values.Text = "+";
//
// kbtnLightestColourIntensityValueMinus
//
this.kbtnLightestColourIntensityValueMinus.AutoSize = true;
this.kbtnLightestColourIntensityValueMinus.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.kbtnLightestColourIntensityValueMinus.Location = new System.Drawing.Point(347, 308);
this.kbtnLightestColourIntensityValueMinus.Name = "kbtnLightestColourIntensityValueMinus";
this.kbtnLightestColourIntensityValueMinus.Size = new System.Drawing.Size(18, 30);
this.kbtnLightestColourIntensityValueMinus.StateCommon.Content.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kbtnLightestColourIntensityValueMinus.TabIndex = 51;
this.kbtnLightestColourIntensityValueMinus.Values.Text = "-";
//
// kbtnMiddleColourIntensityValueMinus
//
this.kbtnMiddleColourIntensityValueMinus.AutoSize = true;
this.kbtnMiddleColourIntensityValueMinus.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.kbtnMiddleColourIntensityValueMinus.Location = new System.Drawing.Point(347, 118);
this.kbtnMiddleColourIntensityValueMinus.Name = "kbtnMiddleColourIntensityValueMinus";
this.kbtnMiddleColourIntensityValueMinus.Size = new System.Drawing.Size(18, 30);
this.kbtnMiddleColourIntensityValueMinus.StateCommon.Content.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kbtnMiddleColourIntensityValueMinus.TabIndex = 47;
this.kbtnMiddleColourIntensityValueMinus.Values.Text = "-";
//
// kbtLightColourIntensityValuePlus
//
this.kbtLightColourIntensityValuePlus.AutoSize = true;
this.kbtLightColourIntensityValuePlus.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.kbtLightColourIntensityValuePlus.Location = new System.Drawing.Point(383, 213);
this.kbtLightColourIntensityValuePlus.Name = "kbtLightColourIntensityValuePlus";
this.kbtLightColourIntensityValuePlus.Size = new System.Drawing.Size(23, 30);
this.kbtLightColourIntensityValuePlus.StateCommon.Content.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kbtLightColourIntensityValuePlus.TabIndex = 50;
this.kbtLightColourIntensityValuePlus.Values.Text = "+";
//
// kbtnMiddleColourIntensityValuePlus
//
this.kbtnMiddleColourIntensityValuePlus.AutoSize = true;
this.kbtnMiddleColourIntensityValuePlus.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.kbtnMiddleColourIntensityValuePlus.Location = new System.Drawing.Point(383, 118);
this.kbtnMiddleColourIntensityValuePlus.Name = "kbtnMiddleColourIntensityValuePlus";
this.kbtnMiddleColourIntensityValuePlus.Size = new System.Drawing.Size(23, 30);
this.kbtnMiddleColourIntensityValuePlus.StateCommon.Content.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kbtnMiddleColourIntensityValuePlus.TabIndex = 48;
this.kbtnMiddleColourIntensityValuePlus.Values.Text = "+";
//
// kbtnLightColourIntensityValueMinus
//
this.kbtnLightColourIntensityValueMinus.AutoSize = true;
this.kbtnLightColourIntensityValueMinus.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.kbtnLightColourIntensityValueMinus.Location = new System.Drawing.Point(347, 213);
this.kbtnLightColourIntensityValueMinus.Name = "kbtnLightColourIntensityValueMinus";
this.kbtnLightColourIntensityValueMinus.Size = new System.Drawing.Size(18, 30);
this.kbtnLightColourIntensityValueMinus.StateCommon.Content.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kbtnLightColourIntensityValueMinus.TabIndex = 49;
this.kbtnLightColourIntensityValueMinus.Values.Text = "-";
//
// kryptonPage4
//
this.kryptonPage4.AutoHiddenSlideSize = new System.Drawing.Size(200, 200);
this.kryptonPage4.Controls.Add(this.kchkConvertToRGBValue);
this.kryptonPage4.Controls.Add(this.kcbConvertToHexadecimalValue);
this.kryptonPage4.Controls.Add(this.kchkGenerateAlphaValue);
this.kryptonPage4.Controls.Add(this.cbxCircular);
this.kryptonPage4.Controls.Add(this.pbxStandard);
this.kryptonPage4.Controls.Add(this.kcmbDisplayType);
this.kryptonPage4.Controls.Add(this.kryptonLabel9);
this.kryptonPage4.Controls.Add(this.kchkAutomaticallyUpdateValues);
this.kryptonPage4.Flags = 65534;
this.kryptonPage4.LastVisibleSet = true;
this.kryptonPage4.MinimumSize = new System.Drawing.Size(50, 50);
this.kryptonPage4.Name = "kryptonPage4";
this.kryptonPage4.Size = new System.Drawing.Size(625, 421);
this.kryptonPage4.Text = "UI Options";
this.kryptonPage4.ToolTipTitle = "Page ToolTip";
this.kryptonPage4.UniqueName = "FA50690FF4D649BA9E9ED453E8E571B5";
//
// kchkConvertToRGBValue
//
this.kchkConvertToRGBValue.Location = new System.Drawing.Point(39, 257);
this.kchkConvertToRGBValue.Name = "kchkConvertToRGBValue";
this.kchkConvertToRGBValue.Size = new System.Drawing.Size(286, 26);
this.kchkConvertToRGBValue.StateCommon.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kchkConvertToRGBValue.TabIndex = 50;
this.kchkConvertToRGBValue.Values.Text = "Automatically Convert to &RGB Value";
//
// kcbConvertToHexadecimalValue
//
this.kcbConvertToHexadecimalValue.Location = new System.Drawing.Point(39, 204);
this.kcbConvertToHexadecimalValue.Name = "kcbConvertToHexadecimalValue";
this.kcbConvertToHexadecimalValue.Size = new System.Drawing.Size(348, 26);
this.kcbConvertToHexadecimalValue.StateCommon.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kcbConvertToHexadecimalValue.TabIndex = 49;
this.kcbConvertToHexadecimalValue.Values.Text = "Automatically Convert to &Hexadecimal Value";
//
// kchkGenerateAlphaValue
//
this.kchkGenerateAlphaValue.Location = new System.Drawing.Point(39, 151);
this.kchkGenerateAlphaValue.Name = "kchkGenerateAlphaValue";
this.kchkGenerateAlphaValue.Size = new System.Drawing.Size(205, 26);
this.kchkGenerateAlphaValue.StateCommon.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kchkGenerateAlphaValue.TabIndex = 48;
this.kchkGenerateAlphaValue.Values.Text = "&Generate an Alpha Value";
//
// cbxCircular
//
this.cbxCircular.BackColor = System.Drawing.Color.Black;
this.cbxCircular.Location = new System.Drawing.Point(347, 88);
this.cbxCircular.Name = "cbxCircular";
this.cbxCircular.Size = new System.Drawing.Size(32, 32);
this.cbxCircular.TabIndex = 47;
this.cbxCircular.TabStop = false;
//
// pbxStandard
//
this.pbxStandard.BackColor = System.Drawing.Color.Black;
this.pbxStandard.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.pbxStandard.Location = new System.Drawing.Point(347, 88);
this.pbxStandard.Name = "pbxStandard";
this.pbxStandard.Size = new System.Drawing.Size(32, 32);
this.pbxStandard.TabIndex = 46;
this.pbxStandard.TabStop = false;
//
// kcmbDisplayType
//
this.kcmbDisplayType.DropDownWidth = 203;
this.kcmbDisplayType.Items.AddRange(new object[] {
"Standard",
"Circular"});
this.kcmbDisplayType.Location = new System.Drawing.Point(138, 88);
this.kcmbDisplayType.Name = "kcmbDisplayType";
this.kcmbDisplayType.Size = new System.Drawing.Size(203, 27);
this.kcmbDisplayType.StateCommon.ComboBox.Content.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kcmbDisplayType.TabIndex = 45;
//
// kryptonLabel9
//
this.kryptonLabel9.Location = new System.Drawing.Point(17, 87);
this.kryptonLabel9.Name = "kryptonLabel9";
this.kryptonLabel9.Size = new System.Drawing.Size(115, 26);
this.kryptonLabel9.StateCommon.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kryptonLabel9.TabIndex = 44;
this.kryptonLabel9.Values.Text = "Display Type:";
//
// kchkAutomaticallyUpdateValues
//
this.kchkAutomaticallyUpdateValues.Location = new System.Drawing.Point(17, 24);
this.kchkAutomaticallyUpdateValues.Name = "kchkAutomaticallyUpdateValues";
this.kchkAutomaticallyUpdateValues.Size = new System.Drawing.Size(234, 26);
this.kchkAutomaticallyUpdateValues.StateCommon.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kchkAutomaticallyUpdateValues.TabIndex = 43;
this.kchkAutomaticallyUpdateValues.Values.Text = "&Automatically Update Values";
//
// kryptonPage5
//
this.kryptonPage5.AutoHiddenSlideSize = new System.Drawing.Size(200, 200);
this.kryptonPage5.Controls.Add(this.kbtnRestore);
this.kryptonPage5.Controls.Add(this.kbtnBrowse);
this.kryptonPage5.Controls.Add(this.kmtxtFilePath);
this.kryptonPage5.Controls.Add(this.kryptonLabel10);
this.kryptonPage5.Flags = 65534;
this.kryptonPage5.LastVisibleSet = true;
this.kryptonPage5.MinimumSize = new System.Drawing.Size(50, 50);
this.kryptonPage5.Name = "kryptonPage5";
this.kryptonPage5.Size = new System.Drawing.Size(625, 421);
this.kryptonPage5.Text = "File Options";
this.kryptonPage5.ToolTipTitle = "Page ToolTip";
this.kryptonPage5.UniqueName = "4FF76322826141100EA9C00D97F3A7A2";
//
// kbtnRestore
//
this.kbtnRestore.AutoSize = true;
this.kbtnRestore.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.kbtnRestore.Enabled = false;
this.kbtnRestore.Location = new System.Drawing.Point(17, 56);
this.kbtnRestore.Name = "kbtnRestore";
this.kbtnRestore.Size = new System.Drawing.Size(133, 30);
this.kbtnRestore.StateCommon.Content.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kbtnRestore.TabIndex = 65;
this.kbtnRestore.Values.Text = "&Restore File Path";
//
// kbtnBrowse
//
this.kbtnBrowse.AutoSize = true;
this.kbtnBrowse.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.kbtnBrowse.Location = new System.Drawing.Point(547, 24);
this.kbtnBrowse.Name = "kbtnBrowse";
this.kbtnBrowse.Size = new System.Drawing.Size(23, 30);
this.kbtnBrowse.StateCommon.Content.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kbtnBrowse.TabIndex = 64;
this.kbtnBrowse.Values.Text = "...";
//
// kmtxtFilePath
//
this.kmtxtFilePath.Location = new System.Drawing.Point(175, 24);
this.kmtxtFilePath.Name = "kmtxtFilePath";
this.kmtxtFilePath.Size = new System.Drawing.Size(366, 29);
this.kmtxtFilePath.StateCommon.Content.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kmtxtFilePath.TabIndex = 63;
//
// kryptonLabel10
//
this.kryptonLabel10.Location = new System.Drawing.Point(17, 24);
this.kryptonLabel10.Name = "kryptonLabel10";
this.kryptonLabel10.Size = new System.Drawing.Size(152, 26);
this.kryptonLabel10.StateCommon.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kryptonLabel10.TabIndex = 62;
this.kryptonLabel10.Values.Text = "Export Colours to:";
//
// kpTheme
//
this.kpTheme.AutoHiddenSlideSize = new System.Drawing.Size(200, 200);
this.kpTheme.Controls.Add(this.kbtnLoadTheme);
this.kpTheme.Controls.Add(this.kbtnImportPalette);
this.kpTheme.Controls.Add(this.ktxtCustomPath);
this.kpTheme.Controls.Add(this.klblCustomTheme);
this.kpTheme.Controls.Add(this.kcmbPaletteTheme);
this.kpTheme.Controls.Add(this.kryptonLabel11);
this.kpTheme.Flags = 65534;
this.kpTheme.LastVisibleSet = true;
this.kpTheme.MinimumSize = new System.Drawing.Size(50, 50);
this.kpTheme.Name = "kpTheme";
this.kpTheme.Size = new System.Drawing.Size(661, 482);
this.kpTheme.Text = "&Theme";
this.kpTheme.ToolTipTitle = "Page ToolTip";
this.kpTheme.UniqueName = "DACF4417245246D33A84C27025B0D112";
//
// kbtnLoadTheme
//
this.kbtnLoadTheme.AutoSize = true;
this.kbtnLoadTheme.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.kbtnLoadTheme.Enabled = false;
this.kbtnLoadTheme.Location = new System.Drawing.Point(597, 103);
this.kbtnLoadTheme.Name = "kbtnLoadTheme";
this.kbtnLoadTheme.Size = new System.Drawing.Size(47, 30);
this.kbtnLoadTheme.StateCommon.Content.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kbtnLoadTheme.TabIndex = 9;
this.kbtnLoadTheme.Values.Text = "&Load";
this.kbtnLoadTheme.Visible = false;
//
// kbtnImportPalette
//
this.kbtnImportPalette.AutoSize = true;
this.kbtnImportPalette.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.kbtnImportPalette.Enabled = false;
this.kbtnImportPalette.Location = new System.Drawing.Point(621, 62);
this.kbtnImportPalette.Name = "kbtnImportPalette";
this.kbtnImportPalette.Size = new System.Drawing.Size(23, 30);
this.kbtnImportPalette.StateCommon.Content.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kbtnImportPalette.TabIndex = 8;
this.kbtnImportPalette.Values.Text = ".&..";
this.kbtnImportPalette.Click += new System.EventHandler(this.kbtnImportPalette_Click);
//
// ktxtCustomPath
//
this.ktxtCustomPath.Enabled = false;
this.ktxtCustomPath.Location = new System.Drawing.Point(251, 62);
this.ktxtCustomPath.Name = "ktxtCustomPath";
this.ktxtCustomPath.Size = new System.Drawing.Size(364, 29);
this.ktxtCustomPath.StateCommon.Content.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ktxtCustomPath.TabIndex = 7;
//
// klblCustomTheme
//
this.klblCustomTheme.Enabled = false;
this.klblCustomTheme.Location = new System.Drawing.Point(41, 65);
this.klblCustomTheme.Name = "klblCustomTheme";
this.klblCustomTheme.Size = new System.Drawing.Size(204, 26);
this.klblCustomTheme.StateCommon.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.klblCustomTheme.TabIndex = 6;
this.klblCustomTheme.Values.Text = "Custom Theme File Path:";
//
// kcmbPaletteTheme
//
this.kcmbPaletteTheme.DropDownWidth = 216;
this.kcmbPaletteTheme.Location = new System.Drawing.Point(150, 22);
this.kcmbPaletteTheme.Name = "kcmbPaletteTheme";
this.kcmbPaletteTheme.Size = new System.Drawing.Size(216, 27);
this.kcmbPaletteTheme.StateCommon.ComboBox.Content.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kcmbPaletteTheme.TabIndex = 5;
this.kcmbPaletteTheme.SelectedIndexChanged += new System.EventHandler(this.kcmbPaletteTheme_SelectedIndexChanged);
this.kcmbPaletteTheme.TextChanged += new System.EventHandler(this.kcmbPaletteTheme_TextChanged);
//
// kryptonLabel11
//
this.kryptonLabel11.Location = new System.Drawing.Point(15, 22);
this.kryptonLabel11.Name = "kryptonLabel11";
this.kryptonLabel11.Size = new System.Drawing.Size(128, 26);
this.kryptonLabel11.StateCommon.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kryptonLabel11.TabIndex = 4;
this.kryptonLabel11.Values.Text = "Palette Theme:";
//
// kpSettings
//
this.kpSettings.AutoHiddenSlideSize = new System.Drawing.Size(200, 200);
this.kpSettings.Controls.Add(this.kchkAskForConfirmation);
this.kpSettings.Controls.Add(this.kbtnResetPaletteTypefaceSettings);
this.kpSettings.Controls.Add(this.kbtnResetGlobalStringSettings);
this.kpSettings.Controls.Add(this.kbtnResetGlobalBooleanSettings);
this.kpSettings.Controls.Add(this.kbtnResetColourStringSettings);
this.kpSettings.Controls.Add(this.kbtnResetColourSettings);
this.kpSettings.Controls.Add(this.kbtnResetColourIntegerSettings);
this.kpSettings.Controls.Add(this.kbtnResetColourBlendingSettings);
this.kpSettings.Controls.Add(this.kbtnNukeAllSettings);
this.kpSettings.Flags = 65534;
this.kpSettings.LastVisibleSet = true;
this.kpSettings.MinimumSize = new System.Drawing.Size(50, 50);
this.kpSettings.Name = "kpSettings";
this.kpSettings.Size = new System.Drawing.Size(661, 482);
this.kpSettings.Text = "Se&ttings";
this.kpSettings.ToolTipTitle = "Page ToolTip";
this.kpSettings.UniqueName = "D086C4F6C5234FC02DA044DBB946AE2F";
//
// kchkAskForConfirmation
//
this.kchkAskForConfirmation.Location = new System.Drawing.Point(469, 440);
this.kchkAskForConfirmation.Name = "kchkAskForConfirmation";
this.kchkAskForConfirmation.Size = new System.Drawing.Size(175, 26);
this.kchkAskForConfirmation.StateCommon.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kchkAskForConfirmation.TabIndex = 80;
this.kchkAskForConfirmation.Values.Text = "&Ask for Confirmation";
//
// kbtnResetPaletteTypefaceSettings
//
this.kbtnResetPaletteTypefaceSettings.AutoSize = true;
this.kbtnResetPaletteTypefaceSettings.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.kbtnResetPaletteTypefaceSettings.Location = new System.Drawing.Point(18, 370);
this.kbtnResetPaletteTypefaceSettings.Name = "kbtnResetPaletteTypefaceSettings";
this.kbtnResetPaletteTypefaceSettings.Size = new System.Drawing.Size(238, 30);
this.kbtnResetPaletteTypefaceSettings.StateCommon.Content.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kbtnResetPaletteTypefaceSettings.TabIndex = 79;
this.kbtnResetPaletteTypefaceSettings.Values.Text = "Reset &Palette Typeface Settings";
//
// kbtnResetGlobalStringSettings
//
this.kbtnResetGlobalStringSettings.AutoSize = true;
this.kbtnResetGlobalStringSettings.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.kbtnResetGlobalStringSettings.Location = new System.Drawing.Point(18, 312);
this.kbtnResetGlobalStringSettings.Name = "kbtnResetGlobalStringSettings";
this.kbtnResetGlobalStringSettings.Size = new System.Drawing.Size(214, 30);
this.kbtnResetGlobalStringSettings.StateCommon.Content.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kbtnResetGlobalStringSettings.TabIndex = 78;
this.kbtnResetGlobalStringSettings.Values.Text = "Reset &Global String Settings";
//
// kbtnResetGlobalBooleanSettings
//
this.kbtnResetGlobalBooleanSettings.AutoSize = true;
this.kbtnResetGlobalBooleanSettings.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.kbtnResetGlobalBooleanSettings.Location = new System.Drawing.Point(18, 254);
this.kbtnResetGlobalBooleanSettings.Name = "kbtnResetGlobalBooleanSettings";
this.kbtnResetGlobalBooleanSettings.Size = new System.Drawing.Size(230, 30);
this.kbtnResetGlobalBooleanSettings.StateCommon.Content.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kbtnResetGlobalBooleanSettings.TabIndex = 77;
this.kbtnResetGlobalBooleanSettings.Values.Text = "Reset Global B&oolean Settings";
//
// kbtnResetColourStringSettings
//
this.kbtnResetColourStringSettings.AutoSize = true;
this.kbtnResetColourStringSettings.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.kbtnResetColourStringSettings.Location = new System.Drawing.Point(18, 196);
this.kbtnResetColourStringSettings.Name = "kbtnResetColourStringSettings";
this.kbtnResetColourStringSettings.Size = new System.Drawing.Size(215, 30);
this.kbtnResetColourStringSettings.StateCommon.Content.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kbtnResetColourStringSettings.TabIndex = 76;
this.kbtnResetColourStringSettings.Values.Text = "Reset Colour &String Settings";
//
// kbtnResetColourSettings
//
this.kbtnResetColourSettings.AutoSize = true;
this.kbtnResetColourSettings.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.kbtnResetColourSettings.Location = new System.Drawing.Point(18, 138);
this.kbtnResetColourSettings.Name = "kbtnResetColourSettings";
this.kbtnResetColourSettings.Size = new System.Drawing.Size(168, 30);
this.kbtnResetColourSettings.StateCommon.Content.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kbtnResetColourSettings.TabIndex = 75;
this.kbtnResetColourSettings.Values.Text = "Reset &Colour Settings";
//
// kbtnResetColourIntegerSettings
//
this.kbtnResetColourIntegerSettings.AutoSize = true;
this.kbtnResetColourIntegerSettings.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.kbtnResetColourIntegerSettings.Location = new System.Drawing.Point(18, 80);
this.kbtnResetColourIntegerSettings.Name = "kbtnResetColourIntegerSettings";
this.kbtnResetColourIntegerSettings.Size = new System.Drawing.Size(224, 30);
this.kbtnResetColourIntegerSettings.StateCommon.Content.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kbtnResetColourIntegerSettings.TabIndex = 74;
this.kbtnResetColourIntegerSettings.Values.Text = "Reset Colour &Integer Settings";
//
// kbtnResetColourBlendingSettings
//
this.kbtnResetColourBlendingSettings.AutoSize = true;
this.kbtnResetColourBlendingSettings.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.kbtnResetColourBlendingSettings.Location = new System.Drawing.Point(18, 22);
this.kbtnResetColourBlendingSettings.Name = "kbtnResetColourBlendingSettings";
this.kbtnResetColourBlendingSettings.Size = new System.Drawing.Size(236, 30);
this.kbtnResetColourBlendingSettings.StateCommon.Content.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kbtnResetColourBlendingSettings.TabIndex = 73;
this.kbtnResetColourBlendingSettings.Values.Text = "Reset Colour &Blending Settings";
//
// kbtnNukeAllSettings
//
this.kbtnNukeAllSettings.AutoSize = true;
this.kbtnNukeAllSettings.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.kbtnNukeAllSettings.Location = new System.Drawing.Point(18, 428);
this.kbtnNukeAllSettings.Name = "kbtnNukeAllSettings";
this.kbtnNukeAllSettings.Size = new System.Drawing.Size(137, 30);
this.kbtnNukeAllSettings.StateCommon.Content.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kbtnNukeAllSettings.TabIndex = 72;
this.kbtnNukeAllSettings.Values.Text = "&Nuke All Settings";
//
// GlobalOptionsMenu
//
this.ClientSize = new System.Drawing.Size(690, 589);
this.Controls.Add(this.kryptonPanel2);
this.Controls.Add(this.panel1);
this.Controls.Add(this.kryptonPanel1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "GlobalOptionsMenu";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Global Options Menu";
this.TextExtra = "(For Development Use Only)";
this.Load += new System.EventHandler(this.GlobalOptionsMenu_Load);
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
this.kryptonPanel1.ResumeLayout(false);
this.kryptonPanel1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).EndInit();
this.kryptonPanel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.kryptonNavigator1)).EndInit();
this.kryptonNavigator1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.kryptonPage1)).EndInit();
this.kryptonPage1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.kryptonDockableNavigator1)).EndInit();
this.kryptonDockableNavigator1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.kryptonPage3)).EndInit();
this.kryptonPage3.ResumeLayout(false);
this.kryptonPage3.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.cbxLightestColourPreview)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.cbxLightColourPreview)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.cbxMediumColourPreview)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.cbxDarkColourPreview)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.kryptonPage4)).EndInit();
this.kryptonPage4.ResumeLayout(false);
this.kryptonPage4.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.cbxCircular)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pbxStandard)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.kcmbDisplayType)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.kryptonPage5)).EndInit();
this.kryptonPage5.ResumeLayout(false);
this.kryptonPage5.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.kpTheme)).EndInit();
this.kpTheme.ResumeLayout(false);
this.kpTheme.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.kcmbPaletteTheme)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.kpSettings)).EndInit();
this.kpSettings.ResumeLayout(false);
this.kpSettings.PerformLayout();
this.ResumeLayout(false);
}
#endregion
#region Variables
private KryptonManager _manager = new KryptonManager();
private KryptonPalette _palette = new KryptonPalette();
private Classes.Theming.ThemeManager _themeManager = new Classes.Theming.ThemeManager();
private ThemingLogic _themingLogic = new ThemingLogic();
private PaletteThemeSettingsManager _paletteThemeSettingsManager = new PaletteThemeSettingsManager();
#endregion
public GlobalOptionsMenu()
{
InitializeComponent();
}
private void GlobalOptionsMenu_Load(object sender, EventArgs e)
{
InitialiseWindow();
}
private void InitialiseWindow()
{
DialogResult result = KryptonMessageBox.Show("This is for developmental use only. Do you want to continue?", "Global Options", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (result == DialogResult.No)
{
Hide();
}
_themeManager.PropagateThemes(kcmbPaletteTheme);
kcmbPaletteTheme.Text = _paletteThemeSettingsManager.GetTheme().ToString();
}
private void kbtnImportPalette_Click(object sender, EventArgs e)
{
_palette.Import();
ktxtCustomPath.Text = _palette.GetCustomisedKryptonPaletteFilePath();
Classes.Theming.ThemeManager.SetCustomTheme(_manager, _palette, ktxtCustomPath.Text);
}
private void kcmbPaletteTheme_SelectedIndexChanged(object sender, EventArgs e)
{
_manager = new KryptonManager();
if (kcmbPaletteTheme.Text == "Professional System")
{
Classes.Theming.ThemeManager.SwitchTheme(PaletteModeManager.ProfessionalSystem, _manager);
}
else if (kcmbPaletteTheme.Text == "Professional Office 2003")
{
Classes.Theming.ThemeManager.SwitchTheme(PaletteModeManager.ProfessionalOffice2003, _manager);
}
else if (kcmbPaletteTheme.Text == "Office 2007 Black")
{
Classes.Theming.ThemeManager.SwitchTheme(PaletteModeManager.Office2007Black, _manager);
}
else if (kcmbPaletteTheme.Text == "Office 2007 Blue")
{
Classes.Theming.ThemeManager.SwitchTheme(PaletteModeManager.Office2007Blue, _manager);
}
else if (kcmbPaletteTheme.Text == "Office 2007 Silver")
{
Classes.Theming.ThemeManager.SwitchTheme(PaletteModeManager.Office2007Silver, _manager);
}
else if (kcmbPaletteTheme.Text == "Office 2010 Black")
{
Classes.Theming.ThemeManager.SwitchTheme(PaletteModeManager.Office2010Black, _manager);
}
else if (kcmbPaletteTheme.Text == "Office 2010 Blue")
{
Classes.Theming.ThemeManager.SwitchTheme(PaletteModeManager.Office2010Blue, _manager);
}
else if (kcmbPaletteTheme.Text == "Office 2010 Silver")
{
Classes.Theming.ThemeManager.SwitchTheme(PaletteModeManager.Office2010Silver, _manager);
}
else if (kcmbPaletteTheme.Text == "Office 2013")
{
Classes.Theming.ThemeManager.SwitchTheme(PaletteModeManager.Office2013, _manager);
}
else if (kcmbPaletteTheme.Text == "Office 2013 White")
{
Classes.Theming.ThemeManager.SwitchTheme(PaletteModeManager.Office2013White, _manager);
}
else if (kcmbPaletteTheme.Text == "Sparkle Blue")
{
Classes.Theming.ThemeManager.SwitchTheme(PaletteModeManager.SparkleBlue, _manager);
}
else if (kcmbPaletteTheme.Text == "Sparkle Orange")
{
Classes.Theming.ThemeManager.SwitchTheme(PaletteModeManager.SparkleOrange, _manager);
}
else if (kcmbPaletteTheme.Text == "Sparkle Purple")
{
Classes.Theming.ThemeManager.SwitchTheme(PaletteModeManager.SparklePurple, _manager);
}
else if (kcmbPaletteTheme.Text == "Custom")
{
Classes.Theming.ThemeManager.EnableCustomThemeControls(klblCustomTheme, ktxtCustomPath, kbtnImportPalette, true);
Classes.Theming.ThemeManager.SwitchTheme(PaletteModeManager.Custom, _manager);
}
}
private void kcmbPaletteTheme_TextChanged(object sender, EventArgs e)
{
}
}
} | 66.307627 | 215 | 0.68277 | [
"BSD-3-Clause"
] | Krypton-Suite-Legacy-Archive/Krypton-Toolkit-Suite-Extended-NET-5.470 | Source/Krypton Toolkit Suite Extended/Shared/Persistence/UX/Options/GlobalOptionsMenu.cs | 78,245 | C# |
#nullable disable
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using NLog;
using VocaDb.Model.Database.Repositories;
using VocaDb.Model.DataContracts;
using VocaDb.Model.DataContracts.SongImport;
using VocaDb.Model.DataContracts.SongLists;
using VocaDb.Model.DataContracts.Songs;
using VocaDb.Model.DataContracts.Users;
using VocaDb.Model.Domain;
using VocaDb.Model.Domain.Activityfeed;
using VocaDb.Model.Domain.Comments;
using VocaDb.Model.Domain.Images;
using VocaDb.Model.Domain.Security;
using VocaDb.Model.Domain.Songs;
using VocaDb.Model.Service;
using VocaDb.Model.Service.Queries;
using VocaDb.Model.Service.QueryableExtensions;
using VocaDb.Model.Service.Search;
using VocaDb.Model.Service.Search.SongSearch;
using VocaDb.Model.Service.SongImport;
using VocaDb.Model.Service.TagFormatting;
namespace VocaDb.Model.Database.Queries
{
public class SongListQueries : QueriesBase<ISongListRepository, SongList>
{
private readonly IEntryLinkFactory _entryLinkFactory;
private static readonly Logger s_log = LogManager.GetCurrentClassLogger();
private readonly IAggregatedEntryImageUrlFactory _thumbStore;
private readonly IEntryThumbPersister _imagePersister;
private readonly IUserIconFactory _userIconFactory;
public ArchivedSongListVersion Archive(IDatabaseContext<SongList> ctx, SongList songList, SongListDiff diff, EntryEditEvent reason, string notes = "")
{
var agentLoginData = ctx.CreateAgentLoginData(PermissionContext);
var archived = songList.CreateArchivedVersion(diff, agentLoginData, reason, notes);
ctx.OfType<ArchivedSongListVersion>().Save(archived);
return archived;
}
private PartialImportedSongs FindSongs(PartialImportedSongs songs)
{
return HandleQuery(session =>
{
foreach (var entry in songs.Items)
{
var pv = session.Query<PVForSong>()
.FirstOrDefault(p => p.Service == entry.PVService && p.PVId == entry.PVId && !p.Song.Deleted);
var song = pv != null ? new SongForApiContract(pv.Song, null, LanguagePreference, SongOptionalFields.None) : null;
entry.MatchedSong = song;
}
return songs;
});
}
private PartialFindResult<T> GetSongsInList<T>(IDatabaseContext<SongList> session, SongInListQueryParams queryParams,
Func<SongInList, T> fac)
{
var q = session.OfType<SongInList>().Query()
.Where(a => !a.Song.Deleted && a.List.Id == queryParams.ListId)
.WhereSongHasName(queryParams.TextQuery, true)
.WhereSongHasPVService(queryParams.PVServices)
.WhereSongHasArtists(queryParams.ArtistIds, queryParams.ChildVoicebanks)
.WhereSongHasTags(queryParams.TagIds)
.WhereSongHasType(queryParams.SongTypes)
.WhereMatchFilters(queryParams.AdvancedFilters);
IQueryable<SongInList> resultQ = q.OrderBy(queryParams.SortRule, PermissionContext.LanguagePreference);
resultQ = resultQ.Paged(queryParams.Paging);
var contracts = resultQ.ToArray().Select(s => fac(s)).ToArray();
var totalCount = (queryParams.Paging.GetTotalCount ? q.Count() : 0);
return new PartialFindResult<T>(contracts, totalCount);
}
private SongList CreateSongList(IDatabaseContext<SongList> ctx, SongListForEditContract contract, UploadedFileContract uploadedFile)
{
var user = GetLoggedUser(ctx);
var newList = new SongList(contract.Name, user);
newList.Description = contract.Description ?? string.Empty;
newList.EventDate = contract.EventDate;
if (EntryPermissionManager.CanManageFeaturedLists(_permissionContext))
newList.FeaturedCategory = contract.FeaturedCategory;
ctx.Save(newList);
var songDiff = newList.SyncSongs(contract.SongLinks, c => ctx.OfType<Song>().Load(c.Song.Id));
ctx.OfType<SongInList>().Sync(songDiff);
SetThumb(newList, uploadedFile);
ctx.Update(newList);
ctx.AuditLogger.AuditLog($"created song list {_entryLinkFactory.CreateEntryLink(newList)}", user);
var archived = Archive(ctx, newList, new SongListDiff(), EntryEditEvent.Created, contract.UpdateNotes);
if (newList.FeaturedList)
{
AddEntryEditedEntry(ctx.OfType<ActivityEntry>(), newList, EntryEditEvent.Created, archived);
}
return newList;
}
private void SetThumb(SongList list, UploadedFileContract uploadedFile)
{
if (uploadedFile != null)
{
var thumb = new EntryThumbMain(list, uploadedFile.Mime);
list.Thumb = thumb;
var thumbGenerator = new ImageThumbGenerator(_imagePersister);
thumbGenerator.GenerateThumbsAndMoveImage(uploadedFile.Stream, thumb, SongList.ImageSizes, originalSize: Constants.RestrictedImageOriginalSize);
}
}
public SongListQueries(ISongListRepository repository, IUserPermissionContext permissionContext, IEntryLinkFactory entryLinkFactory,
IEntryThumbPersister imagePersister, IAggregatedEntryImageUrlFactory thumbStore, IUserIconFactory userIconFactory)
: base(repository, permissionContext)
{
_entryLinkFactory = entryLinkFactory;
_imagePersister = imagePersister;
_thumbStore = thumbStore;
_userIconFactory = userIconFactory;
}
public ICommentQueries Comments(IDatabaseContext<SongList> ctx)
{
return new CommentQueries<SongListComment, SongList>(ctx.OfType<SongListComment>(), PermissionContext, _userIconFactory, _entryLinkFactory);
}
public CommentForApiContract CreateComment(int songId, CommentForApiContract contract)
{
return HandleTransaction(ctx => Comments(ctx).Create(songId, contract));
}
public void Delete(int listId, string notes)
{
_permissionContext.VerifyManageDatabase();
_repository.HandleTransaction(ctx =>
{
var entry = ctx.Load(listId);
PermissionContext.VerifyEntryDelete(entry);
entry.Deleted = true;
ctx.Update(entry);
Archive(ctx, entry, new SongListDiff(false), EntryEditEvent.Deleted, notes);
ctx.AuditLogger.AuditLog($"deleted {entry}");
});
}
public void MoveToTrash(int listId)
{
PermissionContext.VerifyPermission(PermissionToken.EditProfile);
HandleTransaction(ctx =>
{
var user = GetLoggedUser(ctx);
var list = ctx.Load<SongList>(listId);
ctx.AuditLogger.SysLog($"deleting {list.ToString()}");
EntryPermissionManager.VerifyEdit(PermissionContext, list);
var archivedVersions = list.ArchivedVersionsManager.Versions;
ctx.DeleteAll(archivedVersions);
list.ArchivedVersionsManager.Versions.Clear();
var activityEntries = ctx.Query<SongListActivityEntry>().Where(a => a.Entry.Id == listId).ToArray();
ctx.DeleteAll(activityEntries);
ctx.Delete(list);
ctx.AuditLogger.AuditLog($"deleted {list.ToString()}", user);
});
}
public PartialFindResult<TResult> Find<TResult>(Func<SongList, TResult> fac, SongListQueryParams queryParams)
{
return HandleQuery(ctx =>
{
var listQuery = ctx.Query()
.WhereNotDeleted()
.WhereHasFeaturedCategory(queryParams.FeaturedCategory, false)
.WhereHasName(queryParams.TextQuery)
.WhereHasTags(queryParams.TagIds, queryParams.ChildTags);
var count = queryParams.Paging.GetTotalCount ? listQuery.Count() : 0;
return new PartialFindResult<TResult>(listQuery
.OrderBy(queryParams.SortRule)
.Paged(queryParams.Paging)
.ToArray()
.Select(s => fac(s))
.ToArray(), count);
});
}
public CommentForApiContract[] GetComments(int listId)
{
return HandleQuery(ctx => Comments(ctx).GetAll(listId));
}
public SongListForApiContract GetDetails(int listId)
{
return _repository.HandleQuery(ctx =>
{
return new SongListForApiContract(ctx.Load(listId), LanguagePreference, _userIconFactory, _thumbStore, SongListOptionalFields.Description | SongListOptionalFields.Events | SongListOptionalFields.MainPicture | SongListOptionalFields.Tags)
{
LatestComments = Comments(ctx).GetList(listId, 3)
};
});
}
public PartialFindResult<SongInListContract> GetSongsInList(SongInListQueryParams queryParams)
{
return _repository.HandleQuery(session => GetSongsInList(session, queryParams, s => new SongInListContract(s, PermissionContext.LanguagePreference)));
}
public PartialFindResult<T> GetSongsInList<T>(SongInListQueryParams queryParams, Func<SongInList, T> fac)
{
return _repository.HandleQuery(ctx => GetSongsInList(ctx, queryParams, fac));
}
public SongListContract GetSongList(int listId)
{
return _repository.HandleQuery(session => new SongListContract(session.Load(listId), PermissionContext));
}
public SongListForEditContract GetSongListForEdit(int listId)
{
return _repository.HandleQuery(session => new SongListForEditContract(session.Load(listId), PermissionContext));
}
public SongListWithArchivedVersionsContract GetSongListWithArchivedVersions(int id)
{
return _repository.HandleQuery(session => new SongListWithArchivedVersionsContract(session.Load(id), PermissionContext));
}
public async Task<ImportedSongListContract> Import(string url, bool parseAll)
{
var parsed = await new SongListImporters().Parse(url, parseAll);
FindSongs(parsed.Songs);
return parsed;
}
public async Task<PartialImportedSongs> ImportSongs(string url, string pageToken, int maxResults, bool parseAll)
{
var songs = await new SongListImporters().GetSongs(url, pageToken, maxResults, parseAll);
return FindSongs(songs);
}
public int UpdateSongList(SongListForEditContract contract, UploadedFileContract uploadedFile)
{
ParamIs.NotNull(() => contract);
PermissionContext.VerifyPermission(PermissionToken.EditProfile);
return _repository.HandleTransaction(ctx =>
{
var user = GetLoggedUser(ctx);
SongList list;
if (contract.Id == 0)
{
list = CreateSongList(ctx, contract, uploadedFile);
}
else
{
list = ctx.Load(contract.Id);
var diff = new SongListDiff();
EntryPermissionManager.VerifyEdit(PermissionContext, list);
if (list.Description != contract.Description)
{
diff.Description.Set();
list.Description = contract.Description ?? string.Empty;
}
if (list.Name != contract.Name)
{
diff.Name.Set();
list.Name = contract.Name;
}
if (EntryPermissionManager.CanManageFeaturedLists(PermissionContext) && list.FeaturedCategory != contract.FeaturedCategory)
{
diff.FeaturedCategory.Set();
list.FeaturedCategory = contract.FeaturedCategory;
}
if (list.EventDate != contract.EventDate)
{
diff.SetChanged(SongListEditableFields.EventDate);
list.EventDate = contract.EventDate;
}
if (list.Status != contract.Status)
{
diff.Status.Set();
list.Status = contract.Status;
}
var songDiff = list.SyncSongs(contract.SongLinks, c => ctx.OfType<Song>().Load(c.Song.Id));
if (songDiff.Changed)
{
diff.Songs.Set();
}
ctx.OfType<SongInList>().Sync(songDiff);
if (uploadedFile != null)
{
diff.Thumbnail.Set();
SetThumb(list, uploadedFile);
}
ctx.Update(list);
ctx.AuditLogger.AuditLog(
$"updated song list {_entryLinkFactory.CreateEntryLink(list)} ({diff.ChangedFieldsString})", user);
var archived = Archive(ctx, list, diff, EntryEditEvent.Updated, contract.UpdateNotes);
if (list.FeaturedList)
{
AddEntryEditedEntry(ctx.OfType<ActivityEntry>(), list, EntryEditEvent.Updated, archived);
}
}
return list.Id;
});
}
public void DeleteComment(int commentId) => HandleTransaction(ctx => Comments(ctx).Delete(commentId));
public IEnumerable<string> GetFeaturedListNames(string query = "",
NameMatchMode nameMatchMode = NameMatchMode.Auto,
SongListFeaturedCategory? featuredCategory = null,
int maxResults = 10)
{
var textQuery = SearchTextQuery.Create(query, nameMatchMode);
return HandleQuery(ctx =>
{
return ctx.Query()
.WhereNotDeleted()
.WhereHasFeaturedCategory(featuredCategory, false)
.WhereHasName(textQuery)
.Select(l => l.Name)
.OrderBy(n => n)
.Take(maxResults)
.ToArray();
});
}
public void PostEditComment(int commentId, CommentForApiContract contract) => HandleTransaction(ctx => Comments(ctx).Update(commentId, contract));
public string GetTagString(int id, string formatString) => HandleQuery(ctx => new SongListFormatter(_entryLinkFactory).ApplyFormat(ctx.Load(id), formatString, PermissionContext.LanguagePreference, true));
}
} | 33.814815 | 242 | 0.719058 | [
"MIT"
] | Pyther99/vocadb | VocaDbModel/Database/Queries/SongListQueries.cs | 12,782 | C# |
using System.Collections.Generic;
using Essensoft.Paylink.Alipay.Response;
namespace Essensoft.Paylink.Alipay.Request
{
/// <summary>
/// alipay.commerce.iot.voicemodel.customvoice.send
/// </summary>
public class AlipayCommerceIotVoicemodelCustomvoiceSendRequest : IAlipayRequest<AlipayCommerceIotVoicemodelCustomvoiceSendResponse>
{
/// <summary>
/// 自定义语音播报
/// </summary>
public string BizContent { get; set; }
#region IAlipayRequest Members
private bool needEncrypt = false;
private string apiVersion = "1.0";
private string terminalType;
private string terminalInfo;
private string prodCode;
private string notifyUrl;
private string returnUrl;
private AlipayObject bizModel;
public void SetNeedEncrypt(bool needEncrypt)
{
this.needEncrypt = needEncrypt;
}
public bool GetNeedEncrypt()
{
return needEncrypt;
}
public void SetNotifyUrl(string notifyUrl)
{
this.notifyUrl = notifyUrl;
}
public string GetNotifyUrl()
{
return notifyUrl;
}
public void SetReturnUrl(string returnUrl)
{
this.returnUrl = returnUrl;
}
public string GetReturnUrl()
{
return returnUrl;
}
public void SetTerminalType(string terminalType)
{
this.terminalType = terminalType;
}
public string GetTerminalType()
{
return terminalType;
}
public void SetTerminalInfo(string terminalInfo)
{
this.terminalInfo = terminalInfo;
}
public string GetTerminalInfo()
{
return terminalInfo;
}
public void SetProdCode(string prodCode)
{
this.prodCode = prodCode;
}
public string GetProdCode()
{
return prodCode;
}
public string GetApiName()
{
return "alipay.commerce.iot.voicemodel.customvoice.send";
}
public void SetApiVersion(string apiVersion)
{
this.apiVersion = apiVersion;
}
public string GetApiVersion()
{
return apiVersion;
}
public IDictionary<string, string> GetParameters()
{
var parameters = new AlipayDictionary
{
{ "biz_content", BizContent }
};
return parameters;
}
public AlipayObject GetBizModel()
{
return bizModel;
}
public void SetBizModel(AlipayObject bizModel)
{
this.bizModel = bizModel;
}
#endregion
}
}
| 22.975806 | 135 | 0.553177 | [
"MIT"
] | fory77/paylink | src/Essensoft.Paylink.Alipay/Request/AlipayCommerceIotVoicemodelCustomvoiceSendRequest.cs | 2,865 | C# |
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.1
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#pragma warning disable 1591
namespace FirmaRehber {
/// <summary>
///Represents a strongly typed in-memory cache of data.
///</summary>
[global::System.Serializable()]
[global::System.ComponentModel.DesignerCategoryAttribute("code")]
[global::System.ComponentModel.ToolboxItem(true)]
[global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedDataSetSchema")]
[global::System.Xml.Serialization.XmlRootAttribute("yetkiliPozisyon")]
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.DataSet")]
public partial class yetkiliPozisyon : global::System.Data.DataSet {
private FirmadakiPozisyonDataTable tableFirmadakiPozisyon;
private global::System.Data.SchemaSerializationMode _schemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
public yetkiliPozisyon() {
this.BeginInit();
this.InitClass();
global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
base.Tables.CollectionChanged += schemaChangedHandler;
base.Relations.CollectionChanged += schemaChangedHandler;
this.EndInit();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
protected yetkiliPozisyon(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) :
base(info, context, false) {
if ((this.IsBinarySerialized(info, context) == true)) {
this.InitVars(false);
global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler1 = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
this.Tables.CollectionChanged += schemaChangedHandler1;
this.Relations.CollectionChanged += schemaChangedHandler1;
return;
}
string strSchema = ((string)(info.GetValue("XmlSchema", typeof(string))));
if ((this.DetermineSchemaSerializationMode(info, context) == global::System.Data.SchemaSerializationMode.IncludeSchema)) {
global::System.Data.DataSet ds = new global::System.Data.DataSet();
ds.ReadXmlSchema(new global::System.Xml.XmlTextReader(new global::System.IO.StringReader(strSchema)));
if ((ds.Tables["FirmadakiPozisyon"] != null)) {
base.Tables.Add(new FirmadakiPozisyonDataTable(ds.Tables["FirmadakiPozisyon"]));
}
this.DataSetName = ds.DataSetName;
this.Prefix = ds.Prefix;
this.Namespace = ds.Namespace;
this.Locale = ds.Locale;
this.CaseSensitive = ds.CaseSensitive;
this.EnforceConstraints = ds.EnforceConstraints;
this.Merge(ds, false, global::System.Data.MissingSchemaAction.Add);
this.InitVars();
}
else {
this.ReadXmlSchema(new global::System.Xml.XmlTextReader(new global::System.IO.StringReader(strSchema)));
}
this.GetSerializationData(info, context);
global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
base.Tables.CollectionChanged += schemaChangedHandler;
this.Relations.CollectionChanged += schemaChangedHandler;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
[global::System.ComponentModel.Browsable(false)]
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)]
public FirmadakiPozisyonDataTable FirmadakiPozisyon {
get {
return this.tableFirmadakiPozisyon;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
[global::System.ComponentModel.BrowsableAttribute(true)]
[global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Visible)]
public override global::System.Data.SchemaSerializationMode SchemaSerializationMode {
get {
return this._schemaSerializationMode;
}
set {
this._schemaSerializationMode = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
[global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
public new global::System.Data.DataTableCollection Tables {
get {
return base.Tables;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
[global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
public new global::System.Data.DataRelationCollection Relations {
get {
return base.Relations;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
protected override void InitializeDerivedDataSet() {
this.BeginInit();
this.InitClass();
this.EndInit();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
public override global::System.Data.DataSet Clone() {
yetkiliPozisyon cln = ((yetkiliPozisyon)(base.Clone()));
cln.InitVars();
cln.SchemaSerializationMode = this.SchemaSerializationMode;
return cln;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
protected override bool ShouldSerializeTables() {
return false;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
protected override bool ShouldSerializeRelations() {
return false;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
protected override void ReadXmlSerializable(global::System.Xml.XmlReader reader) {
if ((this.DetermineSchemaSerializationMode(reader) == global::System.Data.SchemaSerializationMode.IncludeSchema)) {
this.Reset();
global::System.Data.DataSet ds = new global::System.Data.DataSet();
ds.ReadXml(reader);
if ((ds.Tables["FirmadakiPozisyon"] != null)) {
base.Tables.Add(new FirmadakiPozisyonDataTable(ds.Tables["FirmadakiPozisyon"]));
}
this.DataSetName = ds.DataSetName;
this.Prefix = ds.Prefix;
this.Namespace = ds.Namespace;
this.Locale = ds.Locale;
this.CaseSensitive = ds.CaseSensitive;
this.EnforceConstraints = ds.EnforceConstraints;
this.Merge(ds, false, global::System.Data.MissingSchemaAction.Add);
this.InitVars();
}
else {
this.ReadXml(reader);
this.InitVars();
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
protected override global::System.Xml.Schema.XmlSchema GetSchemaSerializable() {
global::System.IO.MemoryStream stream = new global::System.IO.MemoryStream();
this.WriteXmlSchema(new global::System.Xml.XmlTextWriter(stream, null));
stream.Position = 0;
return global::System.Xml.Schema.XmlSchema.Read(new global::System.Xml.XmlTextReader(stream), null);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
internal void InitVars() {
this.InitVars(true);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
internal void InitVars(bool initTable) {
this.tableFirmadakiPozisyon = ((FirmadakiPozisyonDataTable)(base.Tables["FirmadakiPozisyon"]));
if ((initTable == true)) {
if ((this.tableFirmadakiPozisyon != null)) {
this.tableFirmadakiPozisyon.InitVars();
}
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
private void InitClass() {
this.DataSetName = "yetkiliPozisyon";
this.Prefix = "";
this.Namespace = "http://tempuri.org/yetkiliPozisyon.xsd";
this.EnforceConstraints = true;
this.SchemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema;
this.tableFirmadakiPozisyon = new FirmadakiPozisyonDataTable();
base.Tables.Add(this.tableFirmadakiPozisyon);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
private bool ShouldSerializeFirmadakiPozisyon() {
return false;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
private void SchemaChanged(object sender, global::System.ComponentModel.CollectionChangeEventArgs e) {
if ((e.Action == global::System.ComponentModel.CollectionChangeAction.Remove)) {
this.InitVars();
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
yetkiliPozisyon ds = new yetkiliPozisyon();
global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
global::System.Xml.Schema.XmlSchemaAny any = new global::System.Xml.Schema.XmlSchemaAny();
any.Namespace = ds.Namespace;
sequence.Items.Add(any);
type.Particle = sequence;
global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
if (xs.Contains(dsSchema.TargetNamespace)) {
global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
try {
global::System.Xml.Schema.XmlSchema schema = null;
dsSchema.Write(s1);
for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
s2.SetLength(0);
schema.Write(s2);
if ((s1.Length == s2.Length)) {
s1.Position = 0;
s2.Position = 0;
for (; ((s1.Position != s1.Length)
&& (s1.ReadByte() == s2.ReadByte())); ) {
;
}
if ((s1.Position == s1.Length)) {
return type;
}
}
}
}
finally {
if ((s1 != null)) {
s1.Close();
}
if ((s2 != null)) {
s2.Close();
}
}
}
xs.Add(dsSchema);
return type;
}
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
public delegate void FirmadakiPozisyonRowChangeEventHandler(object sender, FirmadakiPozisyonRowChangeEvent e);
/// <summary>
///Represents the strongly named DataTable class.
///</summary>
[global::System.Serializable()]
[global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")]
public partial class FirmadakiPozisyonDataTable : global::System.Data.DataTable, global::System.Collections.IEnumerable {
private global::System.Data.DataColumn columnId;
private global::System.Data.DataColumn columnFirmadakiPozisyon;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
public FirmadakiPozisyonDataTable() {
this.TableName = "FirmadakiPozisyon";
this.BeginInit();
this.InitClass();
this.EndInit();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
internal FirmadakiPozisyonDataTable(global::System.Data.DataTable table) {
this.TableName = table.TableName;
if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
this.CaseSensitive = table.CaseSensitive;
}
if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) {
this.Locale = table.Locale;
}
if ((table.Namespace != table.DataSet.Namespace)) {
this.Namespace = table.Namespace;
}
this.Prefix = table.Prefix;
this.MinimumCapacity = table.MinimumCapacity;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
protected FirmadakiPozisyonDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) :
base(info, context) {
this.InitVars();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
public global::System.Data.DataColumn IdColumn {
get {
return this.columnId;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
public global::System.Data.DataColumn FirmadakiPozisyonColumn {
get {
return this.columnFirmadakiPozisyon;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
[global::System.ComponentModel.Browsable(false)]
public int Count {
get {
return this.Rows.Count;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
public FirmadakiPozisyonRow this[int index] {
get {
return ((FirmadakiPozisyonRow)(this.Rows[index]));
}
}
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
public event FirmadakiPozisyonRowChangeEventHandler FirmadakiPozisyonRowChanging;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
public event FirmadakiPozisyonRowChangeEventHandler FirmadakiPozisyonRowChanged;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
public event FirmadakiPozisyonRowChangeEventHandler FirmadakiPozisyonRowDeleting;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
public event FirmadakiPozisyonRowChangeEventHandler FirmadakiPozisyonRowDeleted;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
public void AddFirmadakiPozisyonRow(FirmadakiPozisyonRow row) {
this.Rows.Add(row);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
public FirmadakiPozisyonRow AddFirmadakiPozisyonRow(string FirmadakiPozisyon) {
FirmadakiPozisyonRow rowFirmadakiPozisyonRow = ((FirmadakiPozisyonRow)(this.NewRow()));
object[] columnValuesArray = new object[] {
null,
FirmadakiPozisyon};
rowFirmadakiPozisyonRow.ItemArray = columnValuesArray;
this.Rows.Add(rowFirmadakiPozisyonRow);
return rowFirmadakiPozisyonRow;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
public FirmadakiPozisyonRow FindById(int Id) {
return ((FirmadakiPozisyonRow)(this.Rows.Find(new object[] {
Id})));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
public virtual global::System.Collections.IEnumerator GetEnumerator() {
return this.Rows.GetEnumerator();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
public override global::System.Data.DataTable Clone() {
FirmadakiPozisyonDataTable cln = ((FirmadakiPozisyonDataTable)(base.Clone()));
cln.InitVars();
return cln;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
protected override global::System.Data.DataTable CreateInstance() {
return new FirmadakiPozisyonDataTable();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
internal void InitVars() {
this.columnId = base.Columns["Id"];
this.columnFirmadakiPozisyon = base.Columns["FirmadakiPozisyon"];
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
private void InitClass() {
this.columnId = new global::System.Data.DataColumn("Id", typeof(int), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnId);
this.columnFirmadakiPozisyon = new global::System.Data.DataColumn("FirmadakiPozisyon", typeof(string), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnFirmadakiPozisyon);
this.Constraints.Add(new global::System.Data.UniqueConstraint("Constraint1", new global::System.Data.DataColumn[] {
this.columnId}, true));
this.columnId.AutoIncrement = true;
this.columnId.AutoIncrementSeed = 1;
this.columnId.AllowDBNull = false;
this.columnId.ReadOnly = true;
this.columnId.Unique = true;
this.columnFirmadakiPozisyon.MaxLength = 50;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
public FirmadakiPozisyonRow NewFirmadakiPozisyonRow() {
return ((FirmadakiPozisyonRow)(this.NewRow()));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) {
return new FirmadakiPozisyonRow(builder);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
protected override global::System.Type GetRowType() {
return typeof(FirmadakiPozisyonRow);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowChanged(e);
if ((this.FirmadakiPozisyonRowChanged != null)) {
this.FirmadakiPozisyonRowChanged(this, new FirmadakiPozisyonRowChangeEvent(((FirmadakiPozisyonRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowChanging(e);
if ((this.FirmadakiPozisyonRowChanging != null)) {
this.FirmadakiPozisyonRowChanging(this, new FirmadakiPozisyonRowChangeEvent(((FirmadakiPozisyonRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowDeleted(e);
if ((this.FirmadakiPozisyonRowDeleted != null)) {
this.FirmadakiPozisyonRowDeleted(this, new FirmadakiPozisyonRowChangeEvent(((FirmadakiPozisyonRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowDeleting(e);
if ((this.FirmadakiPozisyonRowDeleting != null)) {
this.FirmadakiPozisyonRowDeleting(this, new FirmadakiPozisyonRowChangeEvent(((FirmadakiPozisyonRow)(e.Row)), e.Action));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
public void RemoveFirmadakiPozisyonRow(FirmadakiPozisyonRow row) {
this.Rows.Remove(row);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
yetkiliPozisyon ds = new yetkiliPozisyon();
global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
any1.Namespace = "http://www.w3.org/2001/XMLSchema";
any1.MinOccurs = new decimal(0);
any1.MaxOccurs = decimal.MaxValue;
any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
sequence.Items.Add(any1);
global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
any2.MinOccurs = new decimal(1);
any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
sequence.Items.Add(any2);
global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
attribute1.Name = "namespace";
attribute1.FixedValue = ds.Namespace;
type.Attributes.Add(attribute1);
global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
attribute2.Name = "tableTypeName";
attribute2.FixedValue = "FirmadakiPozisyonDataTable";
type.Attributes.Add(attribute2);
type.Particle = sequence;
global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
if (xs.Contains(dsSchema.TargetNamespace)) {
global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
try {
global::System.Xml.Schema.XmlSchema schema = null;
dsSchema.Write(s1);
for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
s2.SetLength(0);
schema.Write(s2);
if ((s1.Length == s2.Length)) {
s1.Position = 0;
s2.Position = 0;
for (; ((s1.Position != s1.Length)
&& (s1.ReadByte() == s2.ReadByte())); ) {
;
}
if ((s1.Position == s1.Length)) {
return type;
}
}
}
}
finally {
if ((s1 != null)) {
s1.Close();
}
if ((s2 != null)) {
s2.Close();
}
}
}
xs.Add(dsSchema);
return type;
}
}
/// <summary>
///Represents strongly named DataRow class.
///</summary>
public partial class FirmadakiPozisyonRow : global::System.Data.DataRow {
private FirmadakiPozisyonDataTable tableFirmadakiPozisyon;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
internal FirmadakiPozisyonRow(global::System.Data.DataRowBuilder rb) :
base(rb) {
this.tableFirmadakiPozisyon = ((FirmadakiPozisyonDataTable)(this.Table));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
public int Id {
get {
return ((int)(this[this.tableFirmadakiPozisyon.IdColumn]));
}
set {
this[this.tableFirmadakiPozisyon.IdColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
public string FirmadakiPozisyon {
get {
try {
return ((string)(this[this.tableFirmadakiPozisyon.FirmadakiPozisyonColumn]));
}
catch (global::System.InvalidCastException e) {
throw new global::System.Data.StrongTypingException("The value for column \'FirmadakiPozisyon\' in table \'FirmadakiPozisyon\' is DBNull.", e);
}
}
set {
this[this.tableFirmadakiPozisyon.FirmadakiPozisyonColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
public bool IsFirmadakiPozisyonNull() {
return this.IsNull(this.tableFirmadakiPozisyon.FirmadakiPozisyonColumn);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
public void SetFirmadakiPozisyonNull() {
this[this.tableFirmadakiPozisyon.FirmadakiPozisyonColumn] = global::System.Convert.DBNull;
}
}
/// <summary>
///Row event argument class
///</summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
public class FirmadakiPozisyonRowChangeEvent : global::System.EventArgs {
private FirmadakiPozisyonRow eventRow;
private global::System.Data.DataRowAction eventAction;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
public FirmadakiPozisyonRowChangeEvent(FirmadakiPozisyonRow row, global::System.Data.DataRowAction action) {
this.eventRow = row;
this.eventAction = action;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
public FirmadakiPozisyonRow Row {
get {
return this.eventRow;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
public global::System.Data.DataRowAction Action {
get {
return this.eventAction;
}
}
}
}
}
namespace FirmaRehber.yetkiliPozisyonTableAdapters {
/// <summary>
///Represents the connection and commands used to retrieve and save data.
///</summary>
[global::System.ComponentModel.DesignerCategoryAttribute("code")]
[global::System.ComponentModel.ToolboxItem(true)]
[global::System.ComponentModel.DataObjectAttribute(true)]
[global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner" +
", Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
public partial class FirmadakiPozisyonTableAdapter : global::System.ComponentModel.Component {
private global::System.Data.SqlClient.SqlDataAdapter _adapter;
private global::System.Data.SqlClient.SqlConnection _connection;
private global::System.Data.SqlClient.SqlTransaction _transaction;
private global::System.Data.SqlClient.SqlCommand[] _commandCollection;
private bool _clearBeforeFill;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
public FirmadakiPozisyonTableAdapter() {
this.ClearBeforeFill = true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
protected internal global::System.Data.SqlClient.SqlDataAdapter Adapter {
get {
if ((this._adapter == null)) {
this.InitAdapter();
}
return this._adapter;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
internal global::System.Data.SqlClient.SqlConnection Connection {
get {
if ((this._connection == null)) {
this.InitConnection();
}
return this._connection;
}
set {
this._connection = value;
if ((this.Adapter.InsertCommand != null)) {
this.Adapter.InsertCommand.Connection = value;
}
if ((this.Adapter.DeleteCommand != null)) {
this.Adapter.DeleteCommand.Connection = value;
}
if ((this.Adapter.UpdateCommand != null)) {
this.Adapter.UpdateCommand.Connection = value;
}
for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
if ((this.CommandCollection[i] != null)) {
((global::System.Data.SqlClient.SqlCommand)(this.CommandCollection[i])).Connection = value;
}
}
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
internal global::System.Data.SqlClient.SqlTransaction Transaction {
get {
return this._transaction;
}
set {
this._transaction = value;
for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
this.CommandCollection[i].Transaction = this._transaction;
}
if (((this.Adapter != null)
&& (this.Adapter.DeleteCommand != null))) {
this.Adapter.DeleteCommand.Transaction = this._transaction;
}
if (((this.Adapter != null)
&& (this.Adapter.InsertCommand != null))) {
this.Adapter.InsertCommand.Transaction = this._transaction;
}
if (((this.Adapter != null)
&& (this.Adapter.UpdateCommand != null))) {
this.Adapter.UpdateCommand.Transaction = this._transaction;
}
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
protected global::System.Data.SqlClient.SqlCommand[] CommandCollection {
get {
if ((this._commandCollection == null)) {
this.InitCommandCollection();
}
return this._commandCollection;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
public bool ClearBeforeFill {
get {
return this._clearBeforeFill;
}
set {
this._clearBeforeFill = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
private void InitAdapter() {
this._adapter = new global::System.Data.SqlClient.SqlDataAdapter();
global::System.Data.Common.DataTableMapping tableMapping = new global::System.Data.Common.DataTableMapping();
tableMapping.SourceTable = "Table";
tableMapping.DataSetTable = "FirmadakiPozisyon";
tableMapping.ColumnMappings.Add("Id", "Id");
tableMapping.ColumnMappings.Add("FirmadakiPozisyon", "FirmadakiPozisyon");
this._adapter.TableMappings.Add(tableMapping);
this._adapter.DeleteCommand = new global::System.Data.SqlClient.SqlCommand();
this._adapter.DeleteCommand.Connection = this.Connection;
this._adapter.DeleteCommand.CommandText = "DELETE FROM [dbo].[FirmadakiPozisyon] WHERE (([Id] = @Original_Id) AND ((@IsNull_" +
"FirmadakiPozisyon = 1 AND [FirmadakiPozisyon] IS NULL) OR ([FirmadakiPozisyon] =" +
" @Original_FirmadakiPozisyon)))";
this._adapter.DeleteCommand.CommandType = global::System.Data.CommandType.Text;
this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_Id", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Id", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_FirmadakiPozisyon", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "FirmadakiPozisyon", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_FirmadakiPozisyon", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "FirmadakiPozisyon", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
this._adapter.InsertCommand = new global::System.Data.SqlClient.SqlCommand();
this._adapter.InsertCommand.Connection = this.Connection;
this._adapter.InsertCommand.CommandText = "INSERT INTO [dbo].[FirmadakiPozisyon] ([FirmadakiPozisyon]) VALUES (@FirmadakiPoz" +
"isyon);\r\nSELECT Id, FirmadakiPozisyon FROM FirmadakiPozisyon WHERE (Id = SCOPE_I" +
"DENTITY())";
this._adapter.InsertCommand.CommandType = global::System.Data.CommandType.Text;
this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@FirmadakiPozisyon", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "FirmadakiPozisyon", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._adapter.UpdateCommand = new global::System.Data.SqlClient.SqlCommand();
this._adapter.UpdateCommand.Connection = this.Connection;
this._adapter.UpdateCommand.CommandText = @"UPDATE [dbo].[FirmadakiPozisyon] SET [FirmadakiPozisyon] = @FirmadakiPozisyon WHERE (([Id] = @Original_Id) AND ((@IsNull_FirmadakiPozisyon = 1 AND [FirmadakiPozisyon] IS NULL) OR ([FirmadakiPozisyon] = @Original_FirmadakiPozisyon)));
SELECT Id, FirmadakiPozisyon FROM FirmadakiPozisyon WHERE (Id = @Id)";
this._adapter.UpdateCommand.CommandType = global::System.Data.CommandType.Text;
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@FirmadakiPozisyon", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "FirmadakiPozisyon", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_Id", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Id", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_FirmadakiPozisyon", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "FirmadakiPozisyon", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_FirmadakiPozisyon", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "FirmadakiPozisyon", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Id", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 0, 0, "Id", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
private void InitConnection() {
this._connection = new global::System.Data.SqlClient.SqlConnection();
this._connection.ConnectionString = global::FirmaRehber.Properties.Settings.Default.DataConnectionString1;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
private void InitCommandCollection() {
this._commandCollection = new global::System.Data.SqlClient.SqlCommand[1];
this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand();
this._commandCollection[0].Connection = this.Connection;
this._commandCollection[0].CommandText = "SELECT Id, FirmadakiPozisyon FROM dbo.FirmadakiPozisyon";
this._commandCollection[0].CommandType = global::System.Data.CommandType.Text;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, true)]
public virtual int Fill(yetkiliPozisyon.FirmadakiPozisyonDataTable dataTable) {
this.Adapter.SelectCommand = this.CommandCollection[0];
if ((this.ClearBeforeFill == true)) {
dataTable.Clear();
}
int returnValue = this.Adapter.Fill(dataTable);
return returnValue;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, true)]
public virtual yetkiliPozisyon.FirmadakiPozisyonDataTable GetData() {
this.Adapter.SelectCommand = this.CommandCollection[0];
yetkiliPozisyon.FirmadakiPozisyonDataTable dataTable = new yetkiliPozisyon.FirmadakiPozisyonDataTable();
this.Adapter.Fill(dataTable);
return dataTable;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
public virtual int Update(yetkiliPozisyon.FirmadakiPozisyonDataTable dataTable) {
return this.Adapter.Update(dataTable);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
public virtual int Update(yetkiliPozisyon dataSet) {
return this.Adapter.Update(dataSet, "FirmadakiPozisyon");
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
public virtual int Update(global::System.Data.DataRow dataRow) {
return this.Adapter.Update(new global::System.Data.DataRow[] {
dataRow});
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
public virtual int Update(global::System.Data.DataRow[] dataRows) {
return this.Adapter.Update(dataRows);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Delete, true)]
public virtual int Delete(int Original_Id, string Original_FirmadakiPozisyon) {
this.Adapter.DeleteCommand.Parameters[0].Value = ((int)(Original_Id));
if ((Original_FirmadakiPozisyon == null)) {
this.Adapter.DeleteCommand.Parameters[1].Value = ((object)(1));
this.Adapter.DeleteCommand.Parameters[2].Value = global::System.DBNull.Value;
}
else {
this.Adapter.DeleteCommand.Parameters[1].Value = ((object)(0));
this.Adapter.DeleteCommand.Parameters[2].Value = ((string)(Original_FirmadakiPozisyon));
}
global::System.Data.ConnectionState previousConnectionState = this.Adapter.DeleteCommand.Connection.State;
if (((this.Adapter.DeleteCommand.Connection.State & global::System.Data.ConnectionState.Open)
!= global::System.Data.ConnectionState.Open)) {
this.Adapter.DeleteCommand.Connection.Open();
}
try {
int returnValue = this.Adapter.DeleteCommand.ExecuteNonQuery();
return returnValue;
}
finally {
if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
this.Adapter.DeleteCommand.Connection.Close();
}
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Insert, true)]
public virtual int Insert(string FirmadakiPozisyon) {
if ((FirmadakiPozisyon == null)) {
this.Adapter.InsertCommand.Parameters[0].Value = global::System.DBNull.Value;
}
else {
this.Adapter.InsertCommand.Parameters[0].Value = ((string)(FirmadakiPozisyon));
}
global::System.Data.ConnectionState previousConnectionState = this.Adapter.InsertCommand.Connection.State;
if (((this.Adapter.InsertCommand.Connection.State & global::System.Data.ConnectionState.Open)
!= global::System.Data.ConnectionState.Open)) {
this.Adapter.InsertCommand.Connection.Open();
}
try {
int returnValue = this.Adapter.InsertCommand.ExecuteNonQuery();
return returnValue;
}
finally {
if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
this.Adapter.InsertCommand.Connection.Close();
}
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)]
public virtual int Update(string FirmadakiPozisyon, int Original_Id, string Original_FirmadakiPozisyon, int Id) {
if ((FirmadakiPozisyon == null)) {
this.Adapter.UpdateCommand.Parameters[0].Value = global::System.DBNull.Value;
}
else {
this.Adapter.UpdateCommand.Parameters[0].Value = ((string)(FirmadakiPozisyon));
}
this.Adapter.UpdateCommand.Parameters[1].Value = ((int)(Original_Id));
if ((Original_FirmadakiPozisyon == null)) {
this.Adapter.UpdateCommand.Parameters[2].Value = ((object)(1));
this.Adapter.UpdateCommand.Parameters[3].Value = global::System.DBNull.Value;
}
else {
this.Adapter.UpdateCommand.Parameters[2].Value = ((object)(0));
this.Adapter.UpdateCommand.Parameters[3].Value = ((string)(Original_FirmadakiPozisyon));
}
this.Adapter.UpdateCommand.Parameters[4].Value = ((int)(Id));
global::System.Data.ConnectionState previousConnectionState = this.Adapter.UpdateCommand.Connection.State;
if (((this.Adapter.UpdateCommand.Connection.State & global::System.Data.ConnectionState.Open)
!= global::System.Data.ConnectionState.Open)) {
this.Adapter.UpdateCommand.Connection.Open();
}
try {
int returnValue = this.Adapter.UpdateCommand.ExecuteNonQuery();
return returnValue;
}
finally {
if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
this.Adapter.UpdateCommand.Connection.Close();
}
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)]
public virtual int Update(string FirmadakiPozisyon, int Original_Id, string Original_FirmadakiPozisyon) {
return this.Update(FirmadakiPozisyon, Original_Id, Original_FirmadakiPozisyon, Original_Id);
}
}
/// <summary>
///TableAdapterManager is used to coordinate TableAdapters in the dataset to enable Hierarchical Update scenarios
///</summary>
[global::System.ComponentModel.DesignerCategoryAttribute("code")]
[global::System.ComponentModel.ToolboxItem(true)]
[global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerDesigner, Microsoft.VSD" +
"esigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapterManager")]
public partial class TableAdapterManager : global::System.ComponentModel.Component {
private UpdateOrderOption _updateOrder;
private FirmadakiPozisyonTableAdapter _firmadakiPozisyonTableAdapter;
private bool _backupDataSetBeforeUpdate;
private global::System.Data.IDbConnection _connection;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
public UpdateOrderOption UpdateOrder {
get {
return this._updateOrder;
}
set {
this._updateOrder = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
[global::System.ComponentModel.EditorAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerPropertyEditor, Microso" +
"ft.VSDesigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3" +
"a", "System.Drawing.Design.UITypeEditor")]
public FirmadakiPozisyonTableAdapter FirmadakiPozisyonTableAdapter {
get {
return this._firmadakiPozisyonTableAdapter;
}
set {
this._firmadakiPozisyonTableAdapter = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
public bool BackupDataSetBeforeUpdate {
get {
return this._backupDataSetBeforeUpdate;
}
set {
this._backupDataSetBeforeUpdate = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
[global::System.ComponentModel.Browsable(false)]
public global::System.Data.IDbConnection Connection {
get {
if ((this._connection != null)) {
return this._connection;
}
if (((this._firmadakiPozisyonTableAdapter != null)
&& (this._firmadakiPozisyonTableAdapter.Connection != null))) {
return this._firmadakiPozisyonTableAdapter.Connection;
}
return null;
}
set {
this._connection = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
[global::System.ComponentModel.Browsable(false)]
public int TableAdapterInstanceCount {
get {
int count = 0;
if ((this._firmadakiPozisyonTableAdapter != null)) {
count = (count + 1);
}
return count;
}
}
/// <summary>
///Update rows in top-down order.
///</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
private int UpdateUpdatedRows(yetkiliPozisyon dataSet, global::System.Collections.Generic.List<global::System.Data.DataRow> allChangedRows, global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows) {
int result = 0;
if ((this._firmadakiPozisyonTableAdapter != null)) {
global::System.Data.DataRow[] updatedRows = dataSet.FirmadakiPozisyon.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent);
updatedRows = this.GetRealUpdatedRows(updatedRows, allAddedRows);
if (((updatedRows != null)
&& (0 < updatedRows.Length))) {
result = (result + this._firmadakiPozisyonTableAdapter.Update(updatedRows));
allChangedRows.AddRange(updatedRows);
}
}
return result;
}
/// <summary>
///Insert rows in top-down order.
///</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
private int UpdateInsertedRows(yetkiliPozisyon dataSet, global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows) {
int result = 0;
if ((this._firmadakiPozisyonTableAdapter != null)) {
global::System.Data.DataRow[] addedRows = dataSet.FirmadakiPozisyon.Select(null, null, global::System.Data.DataViewRowState.Added);
if (((addedRows != null)
&& (0 < addedRows.Length))) {
result = (result + this._firmadakiPozisyonTableAdapter.Update(addedRows));
allAddedRows.AddRange(addedRows);
}
}
return result;
}
/// <summary>
///Delete rows in bottom-up order.
///</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
private int UpdateDeletedRows(yetkiliPozisyon dataSet, global::System.Collections.Generic.List<global::System.Data.DataRow> allChangedRows) {
int result = 0;
if ((this._firmadakiPozisyonTableAdapter != null)) {
global::System.Data.DataRow[] deletedRows = dataSet.FirmadakiPozisyon.Select(null, null, global::System.Data.DataViewRowState.Deleted);
if (((deletedRows != null)
&& (0 < deletedRows.Length))) {
result = (result + this._firmadakiPozisyonTableAdapter.Update(deletedRows));
allChangedRows.AddRange(deletedRows);
}
}
return result;
}
/// <summary>
///Remove inserted rows that become updated rows after calling TableAdapter.Update(inserted rows) first
///</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
private global::System.Data.DataRow[] GetRealUpdatedRows(global::System.Data.DataRow[] updatedRows, global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows) {
if (((updatedRows == null)
|| (updatedRows.Length < 1))) {
return updatedRows;
}
if (((allAddedRows == null)
|| (allAddedRows.Count < 1))) {
return updatedRows;
}
global::System.Collections.Generic.List<global::System.Data.DataRow> realUpdatedRows = new global::System.Collections.Generic.List<global::System.Data.DataRow>();
for (int i = 0; (i < updatedRows.Length); i = (i + 1)) {
global::System.Data.DataRow row = updatedRows[i];
if ((allAddedRows.Contains(row) == false)) {
realUpdatedRows.Add(row);
}
}
return realUpdatedRows.ToArray();
}
/// <summary>
///Update all changes to the dataset.
///</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
public virtual int UpdateAll(yetkiliPozisyon dataSet) {
if ((dataSet == null)) {
throw new global::System.ArgumentNullException("dataSet");
}
if ((dataSet.HasChanges() == false)) {
return 0;
}
if (((this._firmadakiPozisyonTableAdapter != null)
&& (this.MatchTableAdapterConnection(this._firmadakiPozisyonTableAdapter.Connection) == false))) {
throw new global::System.ArgumentException("All TableAdapters managed by a TableAdapterManager must use the same connection s" +
"tring.");
}
global::System.Data.IDbConnection workConnection = this.Connection;
if ((workConnection == null)) {
throw new global::System.ApplicationException("TableAdapterManager contains no connection information. Set each TableAdapterMana" +
"ger TableAdapter property to a valid TableAdapter instance.");
}
bool workConnOpened = false;
if (((workConnection.State & global::System.Data.ConnectionState.Broken)
== global::System.Data.ConnectionState.Broken)) {
workConnection.Close();
}
if ((workConnection.State == global::System.Data.ConnectionState.Closed)) {
workConnection.Open();
workConnOpened = true;
}
global::System.Data.IDbTransaction workTransaction = workConnection.BeginTransaction();
if ((workTransaction == null)) {
throw new global::System.ApplicationException("The transaction cannot begin. The current data connection does not support transa" +
"ctions or the current state is not allowing the transaction to begin.");
}
global::System.Collections.Generic.List<global::System.Data.DataRow> allChangedRows = new global::System.Collections.Generic.List<global::System.Data.DataRow>();
global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows = new global::System.Collections.Generic.List<global::System.Data.DataRow>();
global::System.Collections.Generic.List<global::System.Data.Common.DataAdapter> adaptersWithAcceptChangesDuringUpdate = new global::System.Collections.Generic.List<global::System.Data.Common.DataAdapter>();
global::System.Collections.Generic.Dictionary<object, global::System.Data.IDbConnection> revertConnections = new global::System.Collections.Generic.Dictionary<object, global::System.Data.IDbConnection>();
int result = 0;
global::System.Data.DataSet backupDataSet = null;
if (this.BackupDataSetBeforeUpdate) {
backupDataSet = new global::System.Data.DataSet();
backupDataSet.Merge(dataSet);
}
try {
// ---- Prepare for update -----------
//
if ((this._firmadakiPozisyonTableAdapter != null)) {
revertConnections.Add(this._firmadakiPozisyonTableAdapter, this._firmadakiPozisyonTableAdapter.Connection);
this._firmadakiPozisyonTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(workConnection));
this._firmadakiPozisyonTableAdapter.Transaction = ((global::System.Data.SqlClient.SqlTransaction)(workTransaction));
if (this._firmadakiPozisyonTableAdapter.Adapter.AcceptChangesDuringUpdate) {
this._firmadakiPozisyonTableAdapter.Adapter.AcceptChangesDuringUpdate = false;
adaptersWithAcceptChangesDuringUpdate.Add(this._firmadakiPozisyonTableAdapter.Adapter);
}
}
//
//---- Perform updates -----------
//
if ((this.UpdateOrder == UpdateOrderOption.UpdateInsertDelete)) {
result = (result + this.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows));
result = (result + this.UpdateInsertedRows(dataSet, allAddedRows));
}
else {
result = (result + this.UpdateInsertedRows(dataSet, allAddedRows));
result = (result + this.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows));
}
result = (result + this.UpdateDeletedRows(dataSet, allChangedRows));
//
//---- Commit updates -----------
//
workTransaction.Commit();
if ((0 < allAddedRows.Count)) {
global::System.Data.DataRow[] rows = new System.Data.DataRow[allAddedRows.Count];
allAddedRows.CopyTo(rows);
for (int i = 0; (i < rows.Length); i = (i + 1)) {
global::System.Data.DataRow row = rows[i];
row.AcceptChanges();
}
}
if ((0 < allChangedRows.Count)) {
global::System.Data.DataRow[] rows = new System.Data.DataRow[allChangedRows.Count];
allChangedRows.CopyTo(rows);
for (int i = 0; (i < rows.Length); i = (i + 1)) {
global::System.Data.DataRow row = rows[i];
row.AcceptChanges();
}
}
}
catch (global::System.Exception ex) {
workTransaction.Rollback();
// ---- Restore the dataset -----------
if (this.BackupDataSetBeforeUpdate) {
global::System.Diagnostics.Debug.Assert((backupDataSet != null));
dataSet.Clear();
dataSet.Merge(backupDataSet);
}
else {
if ((0 < allAddedRows.Count)) {
global::System.Data.DataRow[] rows = new System.Data.DataRow[allAddedRows.Count];
allAddedRows.CopyTo(rows);
for (int i = 0; (i < rows.Length); i = (i + 1)) {
global::System.Data.DataRow row = rows[i];
row.AcceptChanges();
row.SetAdded();
}
}
}
throw ex;
}
finally {
if (workConnOpened) {
workConnection.Close();
}
if ((this._firmadakiPozisyonTableAdapter != null)) {
this._firmadakiPozisyonTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(revertConnections[this._firmadakiPozisyonTableAdapter]));
this._firmadakiPozisyonTableAdapter.Transaction = null;
}
if ((0 < adaptersWithAcceptChangesDuringUpdate.Count)) {
global::System.Data.Common.DataAdapter[] adapters = new System.Data.Common.DataAdapter[adaptersWithAcceptChangesDuringUpdate.Count];
adaptersWithAcceptChangesDuringUpdate.CopyTo(adapters);
for (int i = 0; (i < adapters.Length); i = (i + 1)) {
global::System.Data.Common.DataAdapter adapter = adapters[i];
adapter.AcceptChangesDuringUpdate = true;
}
}
}
return result;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
protected virtual void SortSelfReferenceRows(global::System.Data.DataRow[] rows, global::System.Data.DataRelation relation, bool childFirst) {
global::System.Array.Sort<global::System.Data.DataRow>(rows, new SelfReferenceComparer(relation, childFirst));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
protected virtual bool MatchTableAdapterConnection(global::System.Data.IDbConnection inputConnection) {
if ((this._connection != null)) {
return true;
}
if (((this.Connection == null)
|| (inputConnection == null))) {
return true;
}
if (string.Equals(this.Connection.ConnectionString, inputConnection.ConnectionString, global::System.StringComparison.Ordinal)) {
return true;
}
return false;
}
/// <summary>
///Update Order Option
///</summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
public enum UpdateOrderOption {
InsertUpdateDelete = 0,
UpdateInsertDelete = 1,
}
/// <summary>
///Used to sort self-referenced table's rows
///</summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
private class SelfReferenceComparer : object, global::System.Collections.Generic.IComparer<global::System.Data.DataRow> {
private global::System.Data.DataRelation _relation;
private int _childFirst;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
internal SelfReferenceComparer(global::System.Data.DataRelation relation, bool childFirst) {
this._relation = relation;
if (childFirst) {
this._childFirst = -1;
}
else {
this._childFirst = 1;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
private global::System.Data.DataRow GetRoot(global::System.Data.DataRow row, out int distance) {
global::System.Diagnostics.Debug.Assert((row != null));
global::System.Data.DataRow root = row;
distance = 0;
global::System.Collections.Generic.IDictionary<global::System.Data.DataRow, global::System.Data.DataRow> traversedRows = new global::System.Collections.Generic.Dictionary<global::System.Data.DataRow, global::System.Data.DataRow>();
traversedRows[row] = row;
global::System.Data.DataRow parent = row.GetParentRow(this._relation, global::System.Data.DataRowVersion.Default);
for (
; ((parent != null)
&& (traversedRows.ContainsKey(parent) == false));
) {
distance = (distance + 1);
root = parent;
traversedRows[parent] = parent;
parent = parent.GetParentRow(this._relation, global::System.Data.DataRowVersion.Default);
}
if ((distance == 0)) {
traversedRows.Clear();
traversedRows[row] = row;
parent = row.GetParentRow(this._relation, global::System.Data.DataRowVersion.Original);
for (
; ((parent != null)
&& (traversedRows.ContainsKey(parent) == false));
) {
distance = (distance + 1);
root = parent;
traversedRows[parent] = parent;
parent = parent.GetParentRow(this._relation, global::System.Data.DataRowVersion.Original);
}
}
return root;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
public int Compare(global::System.Data.DataRow row1, global::System.Data.DataRow row2) {
if (object.ReferenceEquals(row1, row2)) {
return 0;
}
if ((row1 == null)) {
return -1;
}
if ((row2 == null)) {
return 1;
}
int distance1 = 0;
global::System.Data.DataRow root1 = this.GetRoot(row1, out distance1);
int distance2 = 0;
global::System.Data.DataRow root2 = this.GetRoot(row2, out distance2);
if (object.ReferenceEquals(root1, root2)) {
return (this._childFirst * distance1.CompareTo(distance2));
}
else {
global::System.Diagnostics.Debug.Assert(((root1.Table != null)
&& (root2.Table != null)));
if ((root1.Table.Rows.IndexOf(root1) < root2.Table.Rows.IndexOf(root2))) {
return -1;
}
else {
return 1;
}
}
}
}
}
}
#pragma warning restore 1591 | 56.780314 | 319 | 0.607442 | [
"MIT"
] | cihancosgun/firmarehber | FirmaRehber/FirmaRehber/yetkiliPozisyon.Designer.cs | 79,608 | C# |
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using LetzFly.Models;
namespace LetzFly.Migrations
{
[DbContext(typeof(LetzFlyDbContext))]
partial class UserDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
modelBuilder
.HasAnnotation("ProductVersion", "1.0.0-rtm-21431")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("LetzFly.Models.User", b =>
{
b.Property<string>("Id");
b.Property<int>("AccessFailedCount");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken();
b.Property<string>("Email")
.HasAnnotation("MaxLength", 256);
b.Property<bool>("EmailConfirmed");
b.Property<string>("FullName");
b.Property<bool>("LockoutEnabled");
b.Property<DateTimeOffset?>("LockoutEnd");
b.Property<string>("NormalizedEmail")
.HasAnnotation("MaxLength", 256);
b.Property<string>("NormalizedUserName")
.HasAnnotation("MaxLength", 256);
b.Property<string>("PasswordHash");
b.Property<string>("PhoneNumber");
b.Property<bool>("PhoneNumberConfirmed");
b.Property<string>("SecurityStamp");
b.Property<bool>("TwoFactorEnabled");
b.Property<string>("UserName")
.HasAnnotation("MaxLength", 256);
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasName("UserNameIndex");
b.ToTable("AspNetUsers");
});
modelBuilder.Entity("LetzFly.Models.UserRole", b =>
{
b.Property<string>("Id");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken();
b.Property<string>("Description");
b.Property<string>("Name")
.HasAnnotation("MaxLength", 256);
b.Property<string>("NormalizedName")
.HasAnnotation("MaxLength", 256);
b.HasKey("Id");
b.HasIndex("NormalizedName")
.HasName("RoleNameIndex");
b.ToTable("AspNetRoles");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ClaimType");
b.Property<string>("ClaimValue");
b.Property<string>("RoleId")
.IsRequired();
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ClaimType");
b.Property<string>("ClaimValue");
b.Property<string>("UserId")
.IsRequired();
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AspNetUserClaims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin<string>", b =>
{
b.Property<string>("LoginProvider");
b.Property<string>("ProviderKey");
b.Property<string>("ProviderDisplayName");
b.Property<string>("UserId")
.IsRequired();
b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId");
b.ToTable("AspNetUserLogins");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole<string>", b =>
{
b.Property<string>("UserId");
b.Property<string>("RoleId");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.HasIndex("UserId");
b.ToTable("AspNetUserRoles");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserToken<string>", b =>
{
b.Property<string>("UserId");
b.Property<string>("LoginProvider");
b.Property<string>("Name");
b.Property<string>("Value");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim<string>", b =>
{
b.HasOne("LetzFly.Models.UserRole")
.WithMany("Claims")
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim<string>", b =>
{
b.HasOne("LetzFly.Models.User")
.WithMany("Claims")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin<string>", b =>
{
b.HasOne("LetzFly.Models.User")
.WithMany("Logins")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole<string>", b =>
{
b.HasOne("LetzFly.Models.UserRole")
.WithMany("Users")
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("LetzFly.Models.User")
.WithMany("Roles")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
}
}
}
| 33.486239 | 117 | 0.480137 | [
"MIT"
] | TalayRuk/LetzFly | src/LetzFly/Migrations/UserDbContextModelSnapshot.cs | 7,302 | C# |
namespace Gecko.WebIDL
{
using System;
internal class TVScanningStateChangedEvent : WebIDLBase
{
public TVScanningStateChangedEvent(nsIDOMWindow globalWindow, nsISupports thisObject) :
base(globalWindow, thisObject)
{
}
public TVScanningState State
{
get
{
return this.GetProperty<TVScanningState>("state");
}
}
public nsISupports Channel
{
get
{
return this.GetProperty<nsISupports>("channel");
}
}
}
}
| 20.967742 | 96 | 0.493846 | [
"MIT"
] | haga-rak/Freezer | Freezer/GeckoFX/__Core/WebIDL/Generated/TVScanningStateChangedEvent.cs | 650 | C# |
namespace YoutubeMetadataBackup_backend.Models.database
{
public class VideoDatabaseSettings : IVideoDatabaseSettings
{
public string VideoCollectionsName { get; set; }
public string ConnectionString { get; set; }
public string DatabaseName { get; set; }
public int QueryTimeoutMilliseconds { get; set; }
public long MaxQueryResult { get; set; }
}
public class IVideoDatabaseSettings
{
public string VideoCollectionsName { get; set; }
public string ConnectionString { get; set; }
public string DatabaseName { get; set; }
public int QueryTimeoutMilliseconds { get; set; }
public long MaxQueryResult { get; set; }
}
} | 36.25 | 63 | 0.663448 | [
"MIT"
] | sqz269/YoutubeMetadataBackup | YoutubeMetadataBackup-backend/YoutubeMetadataBackup-backend/Models/database/VideoDatabaseSettings.cs | 727 | C# |
namespace BlazorShop.Services.Orders
{
using System.Collections.Generic;
using System.Threading.Tasks;
using Common;
using Models.Orders;
public interface IOrdersService : IService
{
Task<string> PurchaseAsync(OrdersRequestModel model, string userId);
Task<OrdersDetailsResponseModel> DetailsAsync(string id);
Task<IEnumerable<OrdersListingResponseModel>> ByUserAsync(string userId);
}
} | 26.117647 | 81 | 0.72973 | [
"MIT"
] | FredericoSilvaTeles/BlazorShop | src/BlazorShop.Services/Orders/IOrdersService.cs | 446 | C# |
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace CSharpRegexTools4Npp {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CSharpRegexTools4Npp.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap icon {
get {
object obj = ResourceManager.GetObject("icon", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}
| 42.459459 | 175 | 0.601846 | [
"MIT",
"BSD-3-Clause"
] | codingseb/CSharpRegexTools4Npp | CSharpRegexTools4Npp/Resources.Designer.cs | 3,144 | C# |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
namespace Microsoft.Bot.Builder.Luis.Models
{
using System;
using System.Linq;
using System.Collections.Generic;
using Newtonsoft.Json;
using Microsoft.Rest;
using Microsoft.Rest.Serialization;
/// <summary>
/// Luis composite entity. Look at https://www.luis.ai/Help for more
/// information.
/// </summary>
public partial class CompositeEntity
{
/// <summary>
/// Initializes a new instance of the CompositeEntity class.
/// </summary>
public CompositeEntity() { }
/// <summary>
/// Initializes a new instance of the CompositeEntity class.
/// </summary>
public CompositeEntity(string parentType, string value, IList<CompositeChild> children)
{
ParentType = parentType;
Value = value;
Children = children;
}
/// <summary>
/// Type of parent entity.
/// </summary>
[JsonProperty(PropertyName = "parentType")]
public string ParentType { get; set; }
/// <summary>
/// Value for entity extracted by LUIS.
/// </summary>
[JsonProperty(PropertyName = "value")]
public string Value { get; set; }
/// <summary>
/// </summary>
[JsonProperty(PropertyName = "children")]
public IList<CompositeChild> Children { get; set; }
/// <summary>
/// Validate the object. Throws ValidationException if validation fails.
/// </summary>
public virtual void Validate()
{
if (ParentType == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "ParentType");
}
if (Value == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "Value");
}
if (Children == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "Children");
}
if (this.Children != null)
{
foreach (var element in this.Children)
{
if (element != null)
{
element.Validate();
}
}
}
}
}
}
| 30.790698 | 95 | 0.547961 | [
"MIT"
] | AskYous/botbuilder | CSharp/Library/Microsoft.Bot.Builder/Luis/Models/CompositeEntity.cs | 2,648 | C# |
using GE.WebUI.ViewModels.Abstracts;
using SX.WebCore.MvcControllers;
namespace GE.WebUI.Areas.Admin.Controllers
{
public sealed class DeliveryController : SxDeliveryController<VMMaterial>
{
}
} | 21.7 | 77 | 0.741935 | [
"MIT"
] | simlex-titul2005/GE | GE.WebUI/Areas/Admin/Controllers/DeliveryController.cs | 219 | C# |
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Tilemaps;
namespace UnityEditor
{
// Basic inspector element for a weighted random tile
[System.Serializable]
public struct Element
{
public TileBase tile;
public float weight;
}
[CustomGridBrush(false, true, false, "Random Brush")]
public class BrushRandom : GridBrush
{
// Create the asset for the brush
[MenuItem("Assets/Create/Asset/Random Brush")]
public static void CreateBrush()
{
// Get the path to the selected asset
string selectedPath = "Assets";
UnityEngine.Object selectedObj = Selection.activeObject;
if (selectedObj != null) selectedPath = AssetDatabase.GetAssetPath(selectedObj.GetInstanceID());
// Create the save panel
string path = EditorUtility.SaveFilePanelInProject("Save Random Brush", "New Random Brush", "asset", "Save Random Brush", selectedPath);
// Check if path was invalid
if (path == "")
return;
// Create the brush asset
AssetDatabase.CreateAsset(ScriptableObject.CreateInstance<BrushRandom>(), path);
}
public const int brushRadiusMin = 1, brushRadiusMax = 10;
public int brushRadius = brushRadiusMin;
[Tooltip("The list of weighted tiles")]
public Element[] randomElements;
public delegate void DoPaint(Vector3Int position, TileBase tile);
public bool hasValidTileList()
{
return this.randomElements != null && this.randomElements.Length > 0;
}
public float getTotalWeight()
{
// Calculate the total weight of all elements
float totalWeight = 0;
foreach (Element e in this.randomElements)
{
totalWeight += e.weight;
}
return totalWeight;
}
// Gets some random tile from the list - O(n), n = length of randomElements
public TileBase getRandomTile(float totalWeight)
{
// Find the random value of the weights
float rand = totalWeight * UnityEngine.Random.value;
// Find the element for the random value
foreach (Element e in this.randomElements)
{
// If this is the weight (cannot remove the elements weight)
if (rand < e.weight)
{
// return the tile
return e.tile;
}
// Else, subtract the current tiles weight
rand -= e.weight;
}
// ERROR: should never be reached
// Return the first element
return this.randomElements[0].tile;
}
public Vector3Int getSize()
{
return this.size * this.brushRadius;
}
public BoundsInt getBounds(Vector3Int center)
{
// Calculate the bounds of the selection
Vector3Int size = this.getSize();
Vector3Int offset = new Vector3Int(
Mathf.FloorToInt(size.x / 2),
Mathf.FloorToInt(size.y / 2),
0
);
BoundsInt bounds = new BoundsInt(center - offset, size);
return bounds;
}
public void fill(Tilemap tilemap, BoundsInt bounds, DoPaint doPaint)
{
// Check if the random list is valid
if (this.hasValidTileList())
{
float totalWeight = this.getTotalWeight();
// Iterate over all locations in the bounds
foreach (Vector3Int location in bounds.allPositionsWithin)
{
TileBase tile = this.getRandomTile(totalWeight);
doPaint(location, tile);
}
}
}
public void paint(GridLayout grid, GameObject brushTarget, Vector3Int position, Tilemap tilemap, DoPaint doPaint)
{
// Calulate the bounds of the target position
Vector3Int min = position - pivot;
// Fill the bounds with random tiles
this.fill(tilemap, this.getBounds(min), doPaint);
}
public override void Paint(GridLayout grid, GameObject brushTarget, Vector3Int position)
{
// Check if the random list is valid
if (this.hasValidTileList())
{
// Do nothing if invalid target
if (brushTarget == null)
return;
// Get the tile map at the target
Tilemap tilemap = brushTarget.GetComponent<Tilemap>();
// Do nothing if invalid tilemap
if (tilemap == null)
return;
this.paint(grid, brushTarget, position, tilemap, tilemap.SetTile);
}
else
{
base.Paint(grid, brushTarget, position);
}
}
public override void BoxFill(GridLayout gridLayout, GameObject brushTarget, BoundsInt bounds)
{
// Check if the random list is valid
if (this.hasValidTileList())
{
// Do nothing if invalid target
if (brushTarget == null)
return;
// Get the tile map at the target
var tilemap = brushTarget.GetComponent<Tilemap>();
// Do nothing if invalid tilemap
if (tilemap == null)
return;
// Fill the bounds with random tiles
this.fill(tilemap, bounds, tilemap.SetTile);
}
else
{
base.BoxFill(gridLayout, brushTarget, bounds);
}
}
}
[CustomEditor(typeof(BrushRandom))]
public class RandomBrushEditor : GridBrushEditor
{
private BrushRandom randomBrush { get { return target as BrushRandom; } }
private GameObject lastBrushTarget;
private TileBase tilePlaceholder;
public override void PaintPreview(GridLayout grid, GameObject brushTarget, Vector3Int position)
{
int i = 0;
while (this.tilePlaceholder == null)
{
this.tilePlaceholder = randomBrush.randomElements[i++].tile;
}
if (randomBrush.hasValidTileList())
{
base.PaintPreview(grid, null, position);
if (brushTarget == null)
return;
var tilemap = brushTarget.GetComponent<Tilemap>();
if (tilemap == null)
return;
Vector3Int min = position - randomBrush.pivot;
BoundsInt bounds = this.randomBrush.getBounds(min);
foreach (Vector3Int location in bounds.allPositionsWithin)
{
tilemap.SetEditorPreviewTile(location, tilePlaceholder);
}
//this.randomBrush.paint(grid, brushTarget, position, tilemap, tilemap.SetEditorPreviewTile);
lastBrushTarget = brushTarget;
}
else
{
base.PaintPreview(grid, brushTarget, position);
}
}
public override void BoxFillPreview(GridLayout gridLayout, GameObject brushTarget, BoundsInt position)
{
if (brushTarget == null)
return;
var tilemap = brushTarget.GetComponent<Tilemap>();
if (tilemap == null)
return;
foreach (Vector3Int location in position.allPositionsWithin)
{
tilemap.SetEditorPreviewTile(location, randomBrush.randomElements[0].tile);
}
lastBrushTarget = brushTarget;
//base.BoxFillPreview(gridLayout, brushTarget, position);
}
public override void ClearPreview()
{
if (lastBrushTarget != null)
{
var tilemap = lastBrushTarget.GetComponent<Tilemap>();
if (tilemap == null)
return;
tilemap.ClearAllEditorPreviewTiles();
lastBrushTarget = null;
}
else
{
base.ClearPreview();
}
}
public override void OnInspectorGUI()
{
EditorGUI.BeginChangeCheck();
// Draw script line
GUI.enabled = false;
EditorGUILayout.ObjectField(
"Script",
MonoScript.FromScriptableObject(this.randomBrush),
typeof(MonoScript), false
);
GUI.enabled = true;
SerializedObject target = new SerializedObject(this.randomBrush);
SerializedProperty propRadius = target.FindProperty("brushRadius");
EditorGUILayout.IntSlider(propRadius, BrushRandom.brushRadiusMin, BrushRandom.brushRadiusMax);
SerializedProperty prop = target.FindProperty("randomElements");
EditorGUILayout.PropertyField(prop, true);
target.ApplyModifiedProperties();
if (EditorGUI.EndChangeCheck())
EditorUtility.SetDirty(randomBrush);
}
}
} | 33.090592 | 148 | 0.543961 | [
"Apache-2.0"
] | temportalflux/MultiPoke | Client/Assets/TileMap/Brushes/Editor/BrushRandom.cs | 9,499 | C# |
/// Generated - Do Not Edit
namespace BABYLON.GUI
{
using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
using EventHorizon.Blazor.Server.Interop;
using EventHorizon.Blazor.Server.Interop.Callbacks;
using Microsoft.JSInterop;
[JsonConverter(typeof(CachedEntityConverter<Image>))]
public class Image : Control
{
#region Static Accessors
#endregion
#region Static Properties
public static async ValueTask<decimal> get_STRETCH_NONE()
{
return await EventHorizonBlazorInterop.Get<decimal>(
"BABYLON",
"GUI.Image.STRETCH_NONE"
);
}
public static async ValueTask<decimal> get_STRETCH_FILL()
{
return await EventHorizonBlazorInterop.Get<decimal>(
"BABYLON",
"GUI.Image.STRETCH_FILL"
);
}
public static async ValueTask<decimal> get_STRETCH_UNIFORM()
{
return await EventHorizonBlazorInterop.Get<decimal>(
"BABYLON",
"GUI.Image.STRETCH_UNIFORM"
);
}
public static async ValueTask<decimal> get_STRETCH_EXTEND()
{
return await EventHorizonBlazorInterop.Get<decimal>(
"BABYLON",
"GUI.Image.STRETCH_EXTEND"
);
}
public static async ValueTask<decimal> get_STRETCH_NINE_PATCH()
{
return await EventHorizonBlazorInterop.Get<decimal>(
"BABYLON",
"GUI.Image.STRETCH_NINE_PATCH"
);
}
#endregion
#region Static Methods
#endregion
#region Accessors
public async ValueTask<bool> get_isLoaded()
{
return await EventHorizonBlazorInterop.Get<bool>(
this.___guid,
"isLoaded"
);
}
public async ValueTask<bool> get_populateNinePatchSlicesFromImage()
{
return await EventHorizonBlazorInterop.Get<bool>(
this.___guid,
"populateNinePatchSlicesFromImage"
);
}
public ValueTask set_populateNinePatchSlicesFromImage(bool value)
{
return EventHorizonBlazorInterop.Set(
this.___guid,
"populateNinePatchSlicesFromImage",
value
);
}
public async ValueTask<bool> get_detectPointerOnOpaqueOnly()
{
return await EventHorizonBlazorInterop.Get<bool>(
this.___guid,
"detectPointerOnOpaqueOnly"
);
}
public ValueTask set_detectPointerOnOpaqueOnly(bool value)
{
return EventHorizonBlazorInterop.Set(
this.___guid,
"detectPointerOnOpaqueOnly",
value
);
}
public async ValueTask<decimal> get_sliceLeft()
{
return await EventHorizonBlazorInterop.Get<decimal>(
this.___guid,
"sliceLeft"
);
}
public ValueTask set_sliceLeft(decimal value)
{
return EventHorizonBlazorInterop.Set(
this.___guid,
"sliceLeft",
value
);
}
public async ValueTask<decimal> get_sliceRight()
{
return await EventHorizonBlazorInterop.Get<decimal>(
this.___guid,
"sliceRight"
);
}
public ValueTask set_sliceRight(decimal value)
{
return EventHorizonBlazorInterop.Set(
this.___guid,
"sliceRight",
value
);
}
public async ValueTask<decimal> get_sliceTop()
{
return await EventHorizonBlazorInterop.Get<decimal>(
this.___guid,
"sliceTop"
);
}
public ValueTask set_sliceTop(decimal value)
{
return EventHorizonBlazorInterop.Set(
this.___guid,
"sliceTop",
value
);
}
public async ValueTask<decimal> get_sliceBottom()
{
return await EventHorizonBlazorInterop.Get<decimal>(
this.___guid,
"sliceBottom"
);
}
public ValueTask set_sliceBottom(decimal value)
{
return EventHorizonBlazorInterop.Set(
this.___guid,
"sliceBottom",
value
);
}
public async ValueTask<decimal> get_sourceLeft()
{
return await EventHorizonBlazorInterop.Get<decimal>(
this.___guid,
"sourceLeft"
);
}
public ValueTask set_sourceLeft(decimal value)
{
return EventHorizonBlazorInterop.Set(
this.___guid,
"sourceLeft",
value
);
}
public async ValueTask<decimal> get_sourceTop()
{
return await EventHorizonBlazorInterop.Get<decimal>(
this.___guid,
"sourceTop"
);
}
public ValueTask set_sourceTop(decimal value)
{
return EventHorizonBlazorInterop.Set(
this.___guid,
"sourceTop",
value
);
}
public async ValueTask<decimal> get_sourceWidth()
{
return await EventHorizonBlazorInterop.Get<decimal>(
this.___guid,
"sourceWidth"
);
}
public ValueTask set_sourceWidth(decimal value)
{
return EventHorizonBlazorInterop.Set(
this.___guid,
"sourceWidth",
value
);
}
public async ValueTask<decimal> get_sourceHeight()
{
return await EventHorizonBlazorInterop.Get<decimal>(
this.___guid,
"sourceHeight"
);
}
public ValueTask set_sourceHeight(decimal value)
{
return EventHorizonBlazorInterop.Set(
this.___guid,
"sourceHeight",
value
);
}
public async ValueTask<bool> get_isSVG()
{
return await EventHorizonBlazorInterop.Get<bool>(
this.___guid,
"isSVG"
);
}
public async ValueTask<bool> get_svgAttributesComputationCompleted()
{
return await EventHorizonBlazorInterop.Get<bool>(
this.___guid,
"svgAttributesComputationCompleted"
);
}
public async ValueTask<bool> get_autoScale()
{
return await EventHorizonBlazorInterop.Get<bool>(
this.___guid,
"autoScale"
);
}
public ValueTask set_autoScale(bool value)
{
return EventHorizonBlazorInterop.Set(
this.___guid,
"autoScale",
value
);
}
public async ValueTask<decimal> get_stretch()
{
return await EventHorizonBlazorInterop.Get<decimal>(
this.___guid,
"stretch"
);
}
public ValueTask set_stretch(decimal value)
{
return EventHorizonBlazorInterop.Set(
this.___guid,
"stretch",
value
);
}
private HTMLImageElement __domImage;
public async ValueTask<HTMLImageElement> get_domImage()
{
if(__domImage == null)
{
__domImage = await EventHorizonBlazorInterop.GetClass<HTMLImageElement>(
this.___guid,
"domImage",
(entity) =>
{
return new HTMLImageElement() { ___guid = entity.___guid };
}
);
}
return __domImage;
}
public ValueTask set_domImage(HTMLImageElement value)
{
__domImage = null;
return EventHorizonBlazorInterop.Set(
this.___guid,
"domImage",
value
);
}
public async ValueTask<decimal> get_cellWidth()
{
return await EventHorizonBlazorInterop.Get<decimal>(
this.___guid,
"cellWidth"
);
}
public ValueTask set_cellWidth(decimal value)
{
return EventHorizonBlazorInterop.Set(
this.___guid,
"cellWidth",
value
);
}
public async ValueTask<decimal> get_cellHeight()
{
return await EventHorizonBlazorInterop.Get<decimal>(
this.___guid,
"cellHeight"
);
}
public ValueTask set_cellHeight(decimal value)
{
return EventHorizonBlazorInterop.Set(
this.___guid,
"cellHeight",
value
);
}
public async ValueTask<decimal> get_cellId()
{
return await EventHorizonBlazorInterop.Get<decimal>(
this.___guid,
"cellId"
);
}
public ValueTask set_cellId(decimal value)
{
return EventHorizonBlazorInterop.Set(
this.___guid,
"cellId",
value
);
}
#endregion
#region Properties
public async ValueTask<string> get_name()
{
return await EventHorizonBlazorInterop.Get<string>(
this.___guid,
"name"
);
}
public ValueTask set_name(string value)
{
return EventHorizonBlazorInterop.Set(
this.___guid,
"name",
value
);
}
private Observable<Image> __onImageLoadedObservable;
public async ValueTask<Observable<Image>> get_onImageLoadedObservable()
{
if(__onImageLoadedObservable == null)
{
__onImageLoadedObservable = await EventHorizonBlazorInterop.GetClass<Observable<Image>>(
this.___guid,
"onImageLoadedObservable",
(entity) =>
{
return new Observable<Image>() { ___guid = entity.___guid };
}
);
}
return __onImageLoadedObservable;
}
public ValueTask set_onImageLoadedObservable(Observable<Image> value)
{
__onImageLoadedObservable = null;
return EventHorizonBlazorInterop.Set(
this.___guid,
"onImageLoadedObservable",
value
);
}
private Observable<Image> __onSVGAttributesComputedObservable;
public async ValueTask<Observable<Image>> get_onSVGAttributesComputedObservable()
{
if(__onSVGAttributesComputedObservable == null)
{
__onSVGAttributesComputedObservable = await EventHorizonBlazorInterop.GetClass<Observable<Image>>(
this.___guid,
"onSVGAttributesComputedObservable",
(entity) =>
{
return new Observable<Image>() { ___guid = entity.___guid };
}
);
}
return __onSVGAttributesComputedObservable;
}
public ValueTask set_onSVGAttributesComputedObservable(Observable<Image> value)
{
__onSVGAttributesComputedObservable = null;
return EventHorizonBlazorInterop.Set(
this.___guid,
"onSVGAttributesComputedObservable",
value
);
}
#endregion
#region Constructor
public Image() : base() { }
public Image(
ICachedEntity entity
) : base(entity)
{
}
public static async ValueTask<Image> NewImage(
string name = null, string url = null
)
{
var entity = await EventHorizonBlazorInterop.New(
new string[] { "BABYLON", "GUI", "Image" },
name, url
);
return new Image(entity);
}
#endregion
#region Methods
public async ValueTask<bool> contains(decimal x, decimal y)
{
return await EventHorizonBlazorInterop.Func<bool>(
new object[]
{
new string[] { this.___guid, "contains" }, x, y
}
);
}
public async ValueTask synchronizeSizeWithContent()
{
await EventHorizonBlazorInterop.Func<CachedEntity>(
new object[]
{
new string[] { this.___guid, "synchronizeSizeWithContent" }
}
);
}
public async ValueTask dispose()
{
await EventHorizonBlazorInterop.Func<CachedEntity>(
new object[]
{
new string[] { this.___guid, "dispose" }
}
);
}
#endregion
}
} | 28.214149 | 114 | 0.468691 | [
"MIT"
] | ADefWebserver/AutomaticKingdom | EventHorizon.Blazor.BabylonJS.Server/GUI/Image.cs | 14,756 | C# |
using System;
namespace MiCake.DDD.Extensions.Store.Configure
{
/// <summary>
/// This is an internal API not subject to the same compatibility standards as public APIs.
/// It may be changed or removed without notice in any release.
///
/// Represents a description of an object that needs to be persisted.
/// </summary>
public interface IStoreEntityType
{
/// <summary>
/// The name of this entity.
/// </summary>
string Name { get; }
/// <summary>
/// The Clr Type of this entity.
/// </summary>
Type ClrType { get; }
}
}
| 26.291667 | 96 | 0.583201 | [
"MIT"
] | MiCake/MiCake | src/framework/MiCake.DDD.Extensions/Store/Configure/IStoreEntityType.cs | 633 | C# |
using System;
using System.Text;
using Newtonsoft.Json;
namespace Thor.Core.Abstractions
{
/// <summary>
/// A bunch of convenient extensions for <see cref="object"/>.
/// </summary>
public static class ObjectExtensions
{
private static readonly JsonSerializerSettings _settings = new JsonSerializerSettings
{
MissingMemberHandling = MissingMemberHandling.Ignore,
ReferenceLoopHandling = ReferenceLoopHandling.Ignore
};
/// <summary>
/// Deserializes an UTF8 byte array to its original value.
/// </summary>
/// <typeparam name="TDestination">The destination type.</typeparam>
/// <param name="source">A UTF8 byte array.</param>
/// <returns>A object.</returns>
public static TDestination Deserialize<TDestination>(this byte[] source)
{
if (source == null)
{
throw new ArgumentNullException(nameof(source));
}
string json = Encoding.UTF8.GetString(source);
return JsonConvert.DeserializeObject<TDestination>(json);
}
/// <summary>
/// Serializes an object to a UTF8 byte array.
/// </summary>
/// <param name="source">An object instance.</param>
/// <returns>A UTF8 byte array.</returns>
public static byte[] Serialize(this object source)
{
if (source == null)
{
throw new ArgumentNullException(nameof(source));
}
string json = JsonConvert.SerializeObject(source, _settings);
return Encoding.UTF8.GetBytes(json);
}
}
} | 31.811321 | 93 | 0.588375 | [
"MIT"
] | glucaci/thor-client | src/Core/Core.Abstractions/ObjectExtensions.cs | 1,688 | C# |
namespace PnP.Framework.Modernization.KQL
{
/// <summary>
/// Operators on KQL property filters
/// </summary>
public enum KQLPropertyOperator
{
Matches = 0,
EqualTo = 1,
LesserThan = 2,
GreaterThan = 3,
LesserThanOrEqualTo = 4,
GreaterThanOrEqualTo = 5,
DoesNoEqual = 6,
Restriction = 7,
Undefined = 100
}
}
| 21.368421 | 42 | 0.554187 | [
"MIT"
] | Arturiby/pnpframework | src/lib/PnP.Framework/Modernization/KQL/KQLPropertyOperator.cs | 408 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using TrabalhoIntegradoComSO.Structs;
using TrabalhoIntegradoComSO.Package;
namespace TrabalhoIntegradoComSO.Package
{
static class LerArquivo
{
public static void Ler(Fila fila_p1, Fila fila_p2, Fila fila_p3, Fila fila_p4, Fila fila_p5) // objeto é passado sempre como referencia
{
string arq = "TI.txt";
StreamReader sr = new StreamReader(arq, Encoding.Default); // abre o arquivo para leitura
string aux;
string[] atributos = new string[5];
Processo p;
while (!sr.EndOfStream) // enquanto não chegar ao final do arquivo
{
aux = sr.ReadLine(); // aux recebe a próxima linha do arquivo
atributos = aux.Split(';'); // vetor atributos é construido com strings separadas pelo ";" de aux
p = new Processo(int.Parse(atributos[0]), atributos[1], int.Parse(atributos[2]), float.Parse(atributos[3]), int.Parse(atributos[4]));
switch (p.Prioridade)
{
case 1:
fila_p1.enfileirar(p);
break;
case 2:
fila_p2.enfileirar(p);
break;
case 3:
fila_p3.enfileirar(p);
break;
case 4:
fila_p4.enfileirar(p);
break;
case 5:
fila_p5.enfileirar(p);
break;
default:
break;
}
}
}
}
}
| 32.927273 | 149 | 0.483158 | [
"MIT"
] | lmfrocha/Trabalho-Pratico-AED-SO | TIcomSO/TrabalhoIntegradoComSO/Package/LerArquivo.cs | 1,817 | C# |
using System;
namespace DedicatedHostsManager.DedicatedHostStateManager
{
/// <summary>
/// Dedicated Host state manager.
/// </summary>
public interface IDedicatedHostStateManager
{
/// <summary>
/// Inserts a key in the cache when a Dedicated Host is at full capacity.
/// </summary>
/// <param name="key">Key (host ID).</param>
/// <param name="data">Data.</param>
/// <param name="expiry">TTL.</param>
bool MarkHostAtCapacity(string key, string data, TimeSpan? expiry = null);
/// <summary>
/// Checks to see if a Dedicated Host is at full capacity.
/// </summary>
/// <param name="key">Key (host ID).</param>
bool IsHostAtCapacity(string key);
/// <summary>
/// Inserts a key in the cache when a Dedicated Host is ready for deletion.
/// </summary>
/// <param name="key">Key (host ID).</param>
/// <param name="data">Data.</param>
/// <param name="expiry">TTL.</param>
bool MarkHostForDeletion(string key, string data, TimeSpan? expiry = null);
/// <summary>
/// Checks to see if a Dedicated Host is pending deletion.
/// </summary>
/// <param name="key"></param>
bool IsHostMarkedForDeletion(string key);
/// <summary>
/// Inserts a key in the cache when a VM is being provisioned on a Dedicated Host.
/// </summary>
/// <param name="key">Key (host ID).</param>
/// <param name="data">Data.</param>
/// <param name="expiry">TTL.</param>
bool MarkHostUsage(string key, string data, TimeSpan? expiry = null);
/// <summary>
/// Checks to see if a VM is being provisioned on a Dedicated Host.
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
bool IsHostInUsage(string key);
/// <summary>
/// Removes the Dedicated Host from the pending deletion list.
/// </summary>
/// <param name="key">Key (host ID).</param>
void UnmarkHostForDeletion(string key);
}
} | 36.355932 | 90 | 0.566434 | [
"MIT"
] | Azure/dedicated-hosts-manager | DedicatedHostsManager/DedicatedHostStateManager/IDedicatedHostStateManager.cs | 2,147 | C# |
// Copyright (c) Arch team. All rights reserved.
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Transactions;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.ChangeTracking;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
namespace Dreamless.Core
{
public class UnitOfWork<TContext> : IRepositoryFactory, IUnitOfWork<TContext>, IUnitOfWork where TContext : DbContext
{
private readonly TContext _context;
private bool disposed = false;
private Dictionary<Type, object> repositories;
public UnitOfWork(TContext context)
{
_context = context ?? throw new ArgumentNullException(nameof(context));
}
public TContext DbContext => _context;
public IRepository<TEntity> GetRepository<TEntity>(bool hasCustomRepository = false) where TEntity : class
{
if (repositories == null)
{
repositories = new Dictionary<Type, object>();
}
// what's the best way to support custom reposity?
if (hasCustomRepository)
{
var customRepo = _context.GetService<IRepository<TEntity>>();
if (customRepo != null)
{
return customRepo;
}
}
var type = typeof(TEntity);
if (!repositories.ContainsKey(type))
{
repositories[type] = new Repository<TEntity>(_context);
}
return (IRepository<TEntity>)repositories[type];
}
public int ExecuteSqlCommand(string sql, params object[] parameters) => _context.Database.ExecuteSqlRaw(sql, parameters);
public IQueryable<TEntity> FromSql<TEntity>(string sql, params object[] parameters) where TEntity : class => _context.Set<TEntity>().FromSqlRaw(sql, parameters);
public int SaveChanges()
{
return _context.SaveChanges();
}
public async Task<int> SaveChangesAsync()
{
return await _context.SaveChangesAsync();
}
public async Task<int> SaveChangesAsync(params IUnitOfWork[] unitOfWorks)
{
using (var ts = new TransactionScope())
{
var count = 0;
foreach (var unitOfWork in unitOfWorks)
{
count += await unitOfWork.SaveChangesAsync();
}
count += await SaveChangesAsync();
ts.Complete();
return count;
}
}
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
if (!disposed)
{
if (disposing)
{
// clear repositories
if (repositories != null)
{
repositories.Clear();
}
// dispose the db context.
_context.Dispose();
}
}
disposed = true;
}
public void TrackGraph(object rootEntity, Action<EntityEntryGraphNode> callback)
{
_context.ChangeTracker.TrackGraph(rootEntity, callback);
}
}
}
| 29.413223 | 169 | 0.558022 | [
"MIT"
] | DreamlessRaw/Dreamless.Core | UnitOfWork.cs | 3,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 workspaces-2015-04-08.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.WorkSpaces.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.WorkSpaces.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for WorkspaceAccessProperties Object
/// </summary>
public class WorkspaceAccessPropertiesUnmarshaller : IUnmarshaller<WorkspaceAccessProperties, XmlUnmarshallerContext>, IUnmarshaller<WorkspaceAccessProperties, JsonUnmarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
WorkspaceAccessProperties IUnmarshaller<WorkspaceAccessProperties, XmlUnmarshallerContext>.Unmarshall(XmlUnmarshallerContext context)
{
throw new NotImplementedException();
}
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public WorkspaceAccessProperties Unmarshall(JsonUnmarshallerContext context)
{
context.Read();
if (context.CurrentTokenType == JsonToken.Null)
return null;
WorkspaceAccessProperties unmarshalledObject = new WorkspaceAccessProperties();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("DeviceTypeAndroid", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.DeviceTypeAndroid = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("DeviceTypeChromeOs", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.DeviceTypeChromeOs = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("DeviceTypeIos", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.DeviceTypeIos = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("DeviceTypeLinux", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.DeviceTypeLinux = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("DeviceTypeOsx", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.DeviceTypeOsx = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("DeviceTypeWeb", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.DeviceTypeWeb = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("DeviceTypeWindows", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.DeviceTypeWindows = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("DeviceTypeZeroClient", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.DeviceTypeZeroClient = unmarshaller.Unmarshall(context);
continue;
}
}
return unmarshalledObject;
}
private static WorkspaceAccessPropertiesUnmarshaller _instance = new WorkspaceAccessPropertiesUnmarshaller();
/// <summary>
/// Gets the singleton.
/// </summary>
public static WorkspaceAccessPropertiesUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 39.873134 | 188 | 0.608085 | [
"Apache-2.0"
] | ChristopherButtars/aws-sdk-net | sdk/src/Services/WorkSpaces/Generated/Model/Internal/MarshallTransformations/WorkspaceAccessPropertiesUnmarshaller.cs | 5,343 | C# |
using System;
using System.Collections.Generic;
using NuGet;
using Newtonsoft.Json;
namespace Kudu.Contracts.SiteExtensions
{
// This is equivalent to NuGet.IPackage
public class SiteExtensionInfo
{
public enum SiteExtensionType
{
Gallery,
PreInstalledNonKudu,
PreInstalledKuduModule
}
public SiteExtensionInfo()
{
}
public SiteExtensionInfo(SiteExtensionInfo info)
{
Id = info.Id;
Title = info.Title;
Type = info.Type;
Summary = info.Summary;
Description = info.Description;
Version = info.Version;
ExtensionUrl = info.ExtensionUrl;
ProjectUrl = info.ProjectUrl;
IconUrl = info.IconUrl;
LicenseUrl = info.LicenseUrl;
Authors = info.Authors;
PublishedDateTime = info.PublishedDateTime;
IsLatestVersion = info.IsLatestVersion;
DownloadCount = info.DownloadCount;
LocalIsLatestVersion = info.LocalIsLatestVersion;
LocalPath = info.LocalPath;
InstalledDateTime = info.InstalledDateTime;
}
public SiteExtensionInfo(IPackage package)
{
Id = package.Id;
Title = package.Title;
Type = SiteExtensionType.Gallery;
Summary = package.Summary;
Description = package.Description;
Version = package.Version == null ? null : package.Version.ToString();
ProjectUrl = package.ProjectUrl == null ? null : package.ProjectUrl.ToString();
IconUrl = package.IconUrl == null ? "https://www.siteextensions.net/Content/Images/packageDefaultIcon-50x50.png" : package.IconUrl.ToString();
LicenseUrl = package.LicenseUrl == null ? null : package.LicenseUrl.ToString();
Authors = package.Authors;
PublishedDateTime = package.Published;
IsLatestVersion = package.IsLatestVersion;
DownloadCount = package.DownloadCount;
}
[JsonProperty(PropertyName = "id")]
public string Id
{
get;
set;
}
[JsonProperty(PropertyName = "title")]
public string Title
{
get;
set;
}
[JsonIgnore]
public SiteExtensionType Type
{
get;
set;
}
[JsonProperty(PropertyName = "summary")]
public string Summary
{
get;
set;
}
[JsonProperty(PropertyName = "description")]
public string Description
{
get;
set;
}
[JsonProperty(PropertyName = "version")]
public string Version
{
get;
set;
}
[JsonProperty(PropertyName = "extension_url")]
public string ExtensionUrl
{
get;
set;
}
[JsonProperty(PropertyName = "project_url")]
public string ProjectUrl
{
get;
set;
}
[JsonProperty(PropertyName = "icon_url")]
public string IconUrl
{
get;
set;
}
[JsonProperty(PropertyName = "license_url")]
public string LicenseUrl
{
get;
set;
}
[JsonProperty(PropertyName = "authors")]
public IEnumerable<string> Authors
{
get;
set;
}
[JsonProperty(PropertyName = "published_date_time")]
public DateTimeOffset? PublishedDateTime
{
get;
set;
}
[JsonIgnore]
public bool IsLatestVersion
{
get;
set;
}
[JsonProperty(PropertyName = "download_count")]
public int DownloadCount
{
get;
set;
}
[JsonProperty(PropertyName = "local_is_latest_version")]
public bool? LocalIsLatestVersion
{
get;
set;
}
[JsonProperty(PropertyName = "local_path")]
public string LocalPath
{
get;
set;
}
[JsonProperty(PropertyName = "installed_date_time")]
public DateTimeOffset? InstalledDateTime
{
get;
set;
}
}
}
| 24.916667 | 154 | 0.518841 | [
"Apache-2.0"
] | Acidburn0zzz/kudu | Kudu.Contracts/SiteExtensions/SiteExtensionInfo.cs | 4,487 | C# |
/*
// <copyright>
// dotNetRDF is free and open source software licensed under the MIT License
// -------------------------------------------------------------------------
//
// Copyright (c) 2009-2020 dotNetRDF Project (http://dotnetrdf.org/)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is furnished
// to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// </copyright>
*/
using VDS.RDF.Query.Builder.Expressions;
using VDS.RDF.Query.Expressions;
using VDS.RDF.Query.Expressions.Functions.Sparql.Boolean;
using VDS.RDF.Query.Expressions.Functions.Sparql.String;
namespace VDS.RDF.Query.Builder
{
/// <inheritdoc />
internal partial class ExpressionBuilder
{
/// <inheritdoc />
public BooleanExpression Regex(VariableExpression text, string pattern)
{
return Regex(text.Expression, pattern.ToSimpleLiteral(), null);
}
/// <inheritdoc />
public BooleanExpression Regex(VariableExpression text, VariableExpression pattern)
{
return Regex(text.Expression, pattern.Expression, null);
}
/// <inheritdoc />
public BooleanExpression Regex(LiteralExpression text, string pattern)
{
return Regex(text.Expression, pattern.ToSimpleLiteral(), null);
}
/// <inheritdoc />
public BooleanExpression Regex(LiteralExpression text, LiteralExpression pattern)
{
return Regex(text.Expression, pattern.Expression, null);
}
/// <inheritdoc />
public BooleanExpression Regex(LiteralExpression text, VariableExpression pattern)
{
return Regex(text.Expression, pattern.Expression, null);
}
/// <inheritdoc />
public BooleanExpression Regex(SparqlExpression text, string pattern, string flags)
{
return Regex(text.Expression, Constant(pattern).Expression, flags.ToConstantTerm());
}
/// <inheritdoc />
public BooleanExpression Regex(VariableExpression text, VariableExpression pattern, string flags)
{
return Regex(text.Expression, pattern.Expression, flags.ToConstantTerm());
}
/// <inheritdoc />
public BooleanExpression Regex(LiteralExpression text, string pattern, string flags)
{
return Regex(text.Expression, pattern.ToSimpleLiteral(), flags.ToConstantTerm());
}
/// <inheritdoc />
public BooleanExpression Regex(LiteralExpression text, LiteralExpression pattern, string flags)
{
return Regex(text.Expression, pattern.Expression, flags.ToConstantTerm());
}
/// <inheritdoc />
public BooleanExpression Regex(LiteralExpression text, VariableExpression pattern, string flags)
{
return Regex(text.Expression, pattern.Expression, flags.ToConstantTerm());
}
private static BooleanExpression Regex(ISparqlExpression text, ISparqlExpression pattern, ISparqlExpression flags)
{
RegexFunction regex = flags == null ? new RegexFunction(text, pattern) : new RegexFunction(text, pattern, flags);
return new BooleanExpression(regex);
}
/// <inheritdoc />
public NumericExpression<int> StrLen(VariableExpression str)
{
return new NumericExpression<int>(new StrLenFunction(str.Expression));
}
/// <inheritdoc />
public NumericExpression<int> StrLen(TypedLiteralExpression<string> str)
{
return new NumericExpression<int>(new StrLenFunction(str.Expression));
}
private static TypedLiteralExpression<string> Substr(ISparqlExpression str, ISparqlExpression startingLoc, ISparqlExpression length)
{
var subStrFunction = length == null ? new SubStrFunction(str, startingLoc) : new SubStrFunction(str, startingLoc, length);
return new TypedLiteralExpression<string>(subStrFunction);
}
/// <inheritdoc />
public TypedLiteralExpression<string> Substr(TypedLiteralExpression<string> str, NumericExpression<int> startingLoc)
{
return Substr(str.Expression, startingLoc.Expression, null);
}
/// <inheritdoc />
public TypedLiteralExpression<string> Substr(TypedLiteralExpression<string> str, VariableExpression startingLoc)
{
return Substr(str.Expression, startingLoc.Expression, null);
}
/// <inheritdoc />
public TypedLiteralExpression<string> Substr(TypedLiteralExpression<string> str, int startingLoc)
{
return Substr(str.Expression, startingLoc.ToConstantTerm(), null);
}
/// <inheritdoc />
public TypedLiteralExpression<string> Substr(VariableExpression str, NumericExpression<int> startingLoc)
{
return Substr(str.Expression, startingLoc.Expression, null);
}
/// <inheritdoc />
public TypedLiteralExpression<string> Substr(VariableExpression str, int startingLoc)
{
return Substr(str.Expression, startingLoc.ToConstantTerm(), null);
}
/// <inheritdoc />
public TypedLiteralExpression<string> Substr(VariableExpression str, VariableExpression startingLoc)
{
return Substr(str.Expression, startingLoc.Expression, null);
}
/// <inheritdoc />
public TypedLiteralExpression<string> Substr(TypedLiteralExpression<string> str, NumericExpression<int> startingLoc, int length)
{
return Substr(str.Expression, startingLoc.Expression, length.ToConstantTerm());
}
/// <inheritdoc />
public TypedLiteralExpression<string> Substr(TypedLiteralExpression<string> str, VariableExpression startingLoc, int length)
{
return Substr(str.Expression, startingLoc.Expression, length.ToConstantTerm());
}
/// <inheritdoc />
public TypedLiteralExpression<string> Substr(TypedLiteralExpression<string> str, int startingLoc, int length)
{
return Substr(str.Expression, startingLoc.ToConstantTerm(), length.ToConstantTerm());
}
/// <inheritdoc />
public TypedLiteralExpression<string> Substr(VariableExpression str, NumericExpression<int> startingLoc, int length)
{
return Substr(str.Expression, startingLoc.Expression, length.ToConstantTerm());
}
/// <inheritdoc />
public TypedLiteralExpression<string> Substr(VariableExpression str, int startingLoc, int length)
{
return Substr(str.Expression, startingLoc.ToConstantTerm(), length.ToConstantTerm());
}
/// <inheritdoc />
public TypedLiteralExpression<string> Substr(VariableExpression str, VariableExpression startingLoc, int length)
{
return Substr(str.Expression, startingLoc.Expression, length.ToConstantTerm());
}
/// <inheritdoc />
public TypedLiteralExpression<string> Substr(TypedLiteralExpression<string> str, NumericExpression<int> startingLoc, NumericExpression<int> length)
{
return Substr(str.Expression, startingLoc.Expression, length.Expression);
}
/// <inheritdoc />
public TypedLiteralExpression<string> Substr(TypedLiteralExpression<string> str, VariableExpression startingLoc, NumericExpression<int> length)
{
return Substr(str.Expression, startingLoc.Expression, length.Expression);
}
/// <inheritdoc />
public TypedLiteralExpression<string> Substr(TypedLiteralExpression<string> str, int startingLoc, NumericExpression<int> length)
{
return Substr(str.Expression, startingLoc.ToConstantTerm(), length.Expression);
}
/// <inheritdoc />
public TypedLiteralExpression<string> Substr(VariableExpression str, NumericExpression<int> startingLoc, NumericExpression<int> length)
{
return Substr(str.Expression, startingLoc.Expression, length.Expression);
}
/// <inheritdoc />
public TypedLiteralExpression<string> Substr(VariableExpression str, int startingLoc, NumericExpression<int> length)
{
return Substr(str.Expression, startingLoc.ToConstantTerm(), length.Expression);
}
/// <inheritdoc />
public TypedLiteralExpression<string> Substr(VariableExpression str, VariableExpression startingLoc, NumericExpression<int> length)
{
return Substr(str.Expression, startingLoc.Expression, length.Expression);
}
/// <inheritdoc />
public TypedLiteralExpression<string> Substr(TypedLiteralExpression<string> str, NumericExpression<int> startingLoc, VariableExpression length)
{
return Substr(str.Expression, startingLoc.Expression, length.Expression);
}
/// <inheritdoc />
public TypedLiteralExpression<string> Substr(TypedLiteralExpression<string> str, VariableExpression startingLoc, VariableExpression length)
{
return Substr(str.Expression, startingLoc.Expression, length.Expression);
}
/// <inheritdoc />
public TypedLiteralExpression<string> Substr(TypedLiteralExpression<string> str, int startingLoc, VariableExpression length)
{
return Substr(str.Expression, startingLoc.ToConstantTerm(), length.Expression);
}
/// <inheritdoc />
public TypedLiteralExpression<string> Substr(VariableExpression str, NumericExpression<int> startingLoc, VariableExpression length)
{
return Substr(str.Expression, startingLoc.Expression, length.Expression);
}
/// <inheritdoc />
public TypedLiteralExpression<string> Substr(VariableExpression str, int startingLoc, VariableExpression length)
{
return Substr(str.Expression, startingLoc.ToConstantTerm(), length.Expression);
}
/// <inheritdoc />
public TypedLiteralExpression<string> Substr(VariableExpression str, VariableExpression startingLoc, VariableExpression length)
{
return Substr(str.Expression, startingLoc.Expression, length.Expression);
}
private static BooleanExpression LangMatches(ISparqlExpression languageTag, ISparqlExpression languageRange)
{
return new BooleanExpression(new LangMatchesFunction(languageTag, languageRange));
}
/// <inheritdoc />
public BooleanExpression LangMatches(LiteralExpression languageTag, string languageRange)
{
return LangMatches(languageTag.Expression, languageRange.ToConstantTerm());
}
/// <inheritdoc />
public BooleanExpression LangMatches(VariableExpression languageTag, string languageRange)
{
return LangMatches(languageTag.Expression, languageRange.ToConstantTerm());
}
/// <inheritdoc />
public BooleanExpression LangMatches(LiteralExpression languageTag, LiteralExpression languageRange)
{
return LangMatches(languageTag.Expression, languageRange.Expression);
}
/// <inheritdoc />
public BooleanExpression LangMatches(VariableExpression languageTag, LiteralExpression languageRange)
{
return LangMatches(languageTag.Expression, languageRange.Expression);
}
/// <inheritdoc />
public BooleanExpression LangMatches(LiteralExpression languageTag, VariableExpression languageRange)
{
return LangMatches(languageTag.Expression, languageRange.Expression);
}
/// <inheritdoc />
public BooleanExpression LangMatches(VariableExpression languageTag, VariableExpression languageRange)
{
return LangMatches(languageTag.Expression, languageRange.Expression);
}
}
} | 42.166124 | 155 | 0.673001 | [
"MIT"
] | blackwork/dotnetrdf | Libraries/dotNetRDF/Query/Builder/ExpressionBuilder.String.cs | 12,945 | 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 sagemaker-2017-07-24.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Amazon.SageMaker.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.SageMaker.Model.Internal.MarshallTransformations
{
/// <summary>
/// AdditionalInferenceSpecificationDefinition Marshaller
/// </summary>
public class AdditionalInferenceSpecificationDefinitionMarshaller : IRequestMarshaller<AdditionalInferenceSpecificationDefinition, JsonMarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="requestObject"></param>
/// <param name="context"></param>
/// <returns></returns>
public void Marshall(AdditionalInferenceSpecificationDefinition requestObject, JsonMarshallerContext context)
{
if(requestObject.IsSetContainers())
{
context.Writer.WritePropertyName("Containers");
context.Writer.WriteArrayStart();
foreach(var requestObjectContainersListValue in requestObject.Containers)
{
context.Writer.WriteObjectStart();
var marshaller = ModelPackageContainerDefinitionMarshaller.Instance;
marshaller.Marshall(requestObjectContainersListValue, context);
context.Writer.WriteObjectEnd();
}
context.Writer.WriteArrayEnd();
}
if(requestObject.IsSetDescription())
{
context.Writer.WritePropertyName("Description");
context.Writer.Write(requestObject.Description);
}
if(requestObject.IsSetName())
{
context.Writer.WritePropertyName("Name");
context.Writer.Write(requestObject.Name);
}
if(requestObject.IsSetSupportedContentTypes())
{
context.Writer.WritePropertyName("SupportedContentTypes");
context.Writer.WriteArrayStart();
foreach(var requestObjectSupportedContentTypesListValue in requestObject.SupportedContentTypes)
{
context.Writer.Write(requestObjectSupportedContentTypesListValue);
}
context.Writer.WriteArrayEnd();
}
if(requestObject.IsSetSupportedRealtimeInferenceInstanceTypes())
{
context.Writer.WritePropertyName("SupportedRealtimeInferenceInstanceTypes");
context.Writer.WriteArrayStart();
foreach(var requestObjectSupportedRealtimeInferenceInstanceTypesListValue in requestObject.SupportedRealtimeInferenceInstanceTypes)
{
context.Writer.Write(requestObjectSupportedRealtimeInferenceInstanceTypesListValue);
}
context.Writer.WriteArrayEnd();
}
if(requestObject.IsSetSupportedResponseMIMETypes())
{
context.Writer.WritePropertyName("SupportedResponseMIMETypes");
context.Writer.WriteArrayStart();
foreach(var requestObjectSupportedResponseMIMETypesListValue in requestObject.SupportedResponseMIMETypes)
{
context.Writer.Write(requestObjectSupportedResponseMIMETypesListValue);
}
context.Writer.WriteArrayEnd();
}
if(requestObject.IsSetSupportedTransformInstanceTypes())
{
context.Writer.WritePropertyName("SupportedTransformInstanceTypes");
context.Writer.WriteArrayStart();
foreach(var requestObjectSupportedTransformInstanceTypesListValue in requestObject.SupportedTransformInstanceTypes)
{
context.Writer.Write(requestObjectSupportedTransformInstanceTypesListValue);
}
context.Writer.WriteArrayEnd();
}
}
/// <summary>
/// Singleton Marshaller.
/// </summary>
public readonly static AdditionalInferenceSpecificationDefinitionMarshaller Instance = new AdditionalInferenceSpecificationDefinitionMarshaller();
}
} | 40.632813 | 158 | 0.649106 | [
"Apache-2.0"
] | Hazy87/aws-sdk-net | sdk/src/Services/SageMaker/Generated/Model/Internal/MarshallTransformations/AdditionalInferenceSpecificationDefinitionMarshaller.cs | 5,201 | C# |
#region License
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#endregion
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Net.WebSockets;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Gremlin.Net.Driver.Messages;
using Gremlin.Net.Process;
namespace Gremlin.Net.Driver
{
internal interface IResponseHandlerForSingleRequestMessage
{
void HandleReceived(ResponseMessage<List<object>> received);
void Finalize(Dictionary<string, object> statusAttributes);
void HandleFailure(Exception objException);
}
internal class Connection : IConnection
{
private readonly IMessageSerializer _messageSerializer;
private readonly Uri _uri;
private readonly WebSocketConnection _webSocketConnection;
private readonly string _username;
private readonly string _password;
private readonly string _sessionId;
private readonly bool _sessionEnabled;
private readonly ConcurrentQueue<RequestMessage> _writeQueue = new ConcurrentQueue<RequestMessage>();
private readonly ConcurrentDictionary<Guid, IResponseHandlerForSingleRequestMessage> _callbackByRequestId =
new ConcurrentDictionary<Guid, IResponseHandlerForSingleRequestMessage>();
private int _connectionState = 0;
private int _writeInProgress = 0;
private const int Closed = 1;
public Connection(Uri uri, string username, string password, IMessageSerializer messageSerializer,
Action<ClientWebSocketOptions> webSocketConfiguration, string sessionId)
{
_uri = uri;
_username = username;
_password = password;
_sessionId = sessionId;
if (!string.IsNullOrEmpty(sessionId))
{
_sessionEnabled = true;
}
_messageSerializer = messageSerializer;
_webSocketConnection = new WebSocketConnection(webSocketConfiguration);
}
public async Task ConnectAsync()
{
await _webSocketConnection.ConnectAsync(_uri).ConfigureAwait(false);
BeginReceiving();
}
public int NrRequestsInFlight => _callbackByRequestId.Count;
public bool IsOpen => _webSocketConnection.IsOpen && Volatile.Read(ref _connectionState) != Closed;
public Task<ResultSet<T>> SubmitAsync<T>(RequestMessage requestMessage)
{
var receiver = new ResponseHandlerForSingleRequestMessage<T>();
_callbackByRequestId.GetOrAdd(requestMessage.RequestId, receiver);
_writeQueue.Enqueue(requestMessage);
BeginSendingMessages();
return receiver.Result;
}
private void BeginReceiving()
{
var state = Volatile.Read(ref _connectionState);
if (state == Closed) return;
ReceiveMessagesAsync().Forget();
}
private async Task ReceiveMessagesAsync()
{
while (true)
{
try
{
var received = await _webSocketConnection.ReceiveMessageAsync().ConfigureAwait(false);
await HandleReceivedAsync(received).ConfigureAwait(false);
}
catch (Exception e)
{
await CloseConnectionBecauseOfFailureAsync(e).ConfigureAwait(false);
break;
}
}
}
private async Task HandleReceivedAsync(byte[] received)
{
var receivedMsg = await _messageSerializer.DeserializeMessageAsync(received).ConfigureAwait(false);
if (receivedMsg == null)
{
ThrowMessageDeserializedNull();
}
try
{
HandleReceivedMessage(receivedMsg);
}
catch (Exception e)
{
if (receivedMsg.RequestId != null &&
_callbackByRequestId.TryRemove(receivedMsg.RequestId.Value, out var responseHandler))
{
responseHandler?.HandleFailure(e);
}
}
}
private static void ThrowMessageDeserializedNull() =>
throw new InvalidOperationException("Received data deserialized into null object message. Cannot operate on it.");
private void HandleReceivedMessage(ResponseMessage<List<object>> receivedMsg)
{
var status = receivedMsg.Status;
status.ThrowIfStatusIndicatesError();
if (status.Code == ResponseStatusCode.Authenticate)
{
Authenticate();
return;
}
if (receivedMsg.RequestId == null) return;
if (status.Code != ResponseStatusCode.NoContent)
_callbackByRequestId[receivedMsg.RequestId.Value].HandleReceived(receivedMsg);
if (status.Code == ResponseStatusCode.Success || status.Code == ResponseStatusCode.NoContent)
{
_callbackByRequestId[receivedMsg.RequestId.Value].Finalize(status.Attributes);
_callbackByRequestId.TryRemove(receivedMsg.RequestId.Value, out _);
}
}
private void Authenticate()
{
if (string.IsNullOrEmpty(_username) || string.IsNullOrEmpty(_password))
throw new InvalidOperationException(
$"The Gremlin Server requires authentication, but no credentials are specified - username: {_username}, password: {_password}.");
var message = RequestMessage.Build(Tokens.OpsAuthentication).Processor(Tokens.ProcessorTraversal)
.AddArgument(Tokens.ArgsSasl, SaslArgument()).Create();
_writeQueue.Enqueue(message);
BeginSendingMessages();
}
private string SaslArgument()
{
var auth = $"\0{_username}\0{_password}";
var authBytes = Encoding.UTF8.GetBytes(auth);
return Convert.ToBase64String(authBytes);
}
private void BeginSendingMessages()
{
if (Interlocked.CompareExchange(ref _writeInProgress, 1, 0) != 0)
return;
SendMessagesFromQueueAsync().Forget();
}
private async Task SendMessagesFromQueueAsync()
{
while (_writeQueue.TryDequeue(out var msg))
{
try
{
await SendMessageAsync(msg).ConfigureAwait(false);
}
catch (Exception e)
{
await CloseConnectionBecauseOfFailureAsync(e).ConfigureAwait(false);
break;
}
}
Interlocked.CompareExchange(ref _writeInProgress, 0, 1);
// Since the loop ended and the write in progress was set to 0
// a new item could have been added, write queue can contain items at this time
if (!_writeQueue.IsEmpty && Interlocked.CompareExchange(ref _writeInProgress, 1, 0) == 0)
{
await SendMessagesFromQueueAsync().ConfigureAwait(false);
}
}
private async Task CloseConnectionBecauseOfFailureAsync(Exception exception)
{
EmptyWriteQueue();
await CloseAsync().ConfigureAwait(false);
NotifyAboutConnectionFailure(exception);
}
private void EmptyWriteQueue()
{
while (_writeQueue.TryDequeue(out _))
{
}
}
private void NotifyAboutConnectionFailure(Exception exception)
{
foreach (var cb in _callbackByRequestId.Values)
{
cb.HandleFailure(exception);
}
_callbackByRequestId.Clear();
}
private async Task SendMessageAsync(RequestMessage message)
{
if (_sessionEnabled)
{
message = RebuildSessionMessage(message);
}
var serializedMsg = await _messageSerializer.SerializeMessageAsync(message).ConfigureAwait(false);
await _webSocketConnection.SendMessageAsync(serializedMsg).ConfigureAwait(false);
}
private RequestMessage RebuildSessionMessage(RequestMessage message)
{
if (message.Processor == Tokens.OpsAuthentication)
{
return message;
}
var msgBuilder = RequestMessage.Build(message.Operation)
.OverrideRequestId(message.RequestId).Processor(Tokens.ProcessorSession);
foreach(var kv in message.Arguments)
{
msgBuilder.AddArgument(kv.Key, kv.Value);
}
msgBuilder.AddArgument(Tokens.ArgsSession, _sessionId);
return msgBuilder.Create();
}
public async Task CloseAsync()
{
Interlocked.Exchange(ref _connectionState, Closed);
if (_sessionEnabled)
{
await CloseSession().ConfigureAwait(false);
}
await _webSocketConnection.CloseAsync().ConfigureAwait(false);
}
private async Task CloseSession()
{
// build a request to close this session
var msg = RequestMessage.Build(Tokens.OpsClose).Processor(Tokens.ProcessorSession).Create();
await SendMessageAsync(msg).ConfigureAwait(false);
}
#region IDisposable Support
private bool _disposed;
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
if (!_disposed)
{
if (disposing)
_webSocketConnection?.Dispose();
_disposed = true;
}
}
#endregion
}
} | 35.077922 | 149 | 0.605702 | [
"Apache-2.0"
] | helpspace-co/tinkerpop | gremlin-dotnet/src/Gremlin.Net/Driver/Connection.cs | 10,804 | C# |
namespace Testing_6.HeaderManipulation
{
using System.Threading.Tasks;
using NServiceBus;
using NServiceBus.Testing;
using NUnit.Framework;
[Explicit]
#region TestingHeaderManipulation
[TestFixture]
public class Tests
{
[Test]
public void Run()
{
Test.Handler<MyMessageHandler>()
.SetIncomingHeader("MyHeaderKey", "myHeaderValue")
.ExpectReply<ResponseMessage>(
check: (message, replyOptions) =>
{
var headers = replyOptions.GetHeaders();
return headers["MyHeaderKey"] == "myHeaderValue";
})
.OnMessage<RequestMessage>(
initializeMessage: message =>
{
message.String = "hello";
});
}
}
class MyMessageHandler :
IHandleMessages<RequestMessage>
{
public Task Handle(RequestMessage message, IMessageHandlerContext context)
{
var header = context.MessageHeaders["MyHeaderKey"];
var responseMessage = new ResponseMessage();
var options = new ReplyOptions();
options.SetHeader("MyHeaderKey", header);
return context.Reply(responseMessage, options);
}
}
#endregion
} | 28.96 | 83 | 0.520718 | [
"Apache-2.0"
] | A-Franklin/docs.particular.net | Snippets/Testing/Testing_6/HeaderManipulation/Tests.cs | 1,401 | C# |
using Microsoft.EntityFrameworkCore;
using SamuraiApp.Domain;
namespace SamuraiApp.Data
{
//DbContext provides logic for EF Core to interact with your database. Change tracking
public class SamuraiContext : DbContext
{
public DbSet<Samurai> Samurais { get; set; }
public DbSet<Quote> Quotes { get; set; }
public DbSet<Battle> Battles { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseNpgsql("Host=sanspostgres.postgres.database.azure.com;Database=samuraiappdata;Username=sandeep@sanspostgres;Password=windows10#;SslMode=Require");
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Samurai>()
.HasMany(s => s.Battles)
.WithMany(b => b.Samurais)
.UsingEntity<BattleSamurai>
(bs => bs.HasOne<Battle>().WithMany(),
bs => bs.HasOne<Samurai>().WithMany())
//Let's have the database populate the payload property, DateJoined.
.Property(bs => bs.DateJoined)
.HasDefaultValueSql("now()");
}
}
}
| 38.65625 | 176 | 0.627324 | [
"Apache-2.0"
] | sansindia85/AzurePostgreSQL | 4/SamuraiApp/SamuraiApp.Data/SamuraiContext.cs | 1,239 | C# |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.