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 System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace HexTbs.Battle.Map
{
[Serializable]
public class BMapModel
{
public string Name { get; set; }
public int Width { get; set; }
public int Height { get; set; }
public List<string> Hexes { get; set; }
public List<ModelCoordinate> P1Starts { get; set; }
public List<ModelCoordinate> P2Starts { get; set; }
public BMapModel()
{
}
}
}
| 19.153846 | 57 | 0.620482 | [
"MIT"
] | Gokotti/HexTbs | HexTbs/Battle/Map/BMapModel.cs | 500 | C# |
using System;
using System.ComponentModel.DataAnnotations;
namespace UniLinks.Dependencies.Models
{
public class LessonModel
{
[Key]
public Guid LessonId { get; set; }
[Required]
public string URI { get; set; }
public string LessonSubject { get; set; }
[Required]
public Guid DisciplineId { get; set; }
[Required]
public Guid CourseId { get; set; }
[Required]
public DateTime Date { get; set; }
[Required]
public int Duration { get; set; }
[Required]
public string RecordName { get; set; }
}
} | 17.258065 | 44 | 0.676636 | [
"MIT"
] | Speckoz/UniLink | Speckoz.UniLinks/UniLinks.API/Models/LessonModel.cs | 537 | C# |
using System;
using System.Collections.Generic;
using Xms.Core;
using Xms.Core.Data;
using Xms.Security.Domain;
namespace Xms.Security.DataAuthorization.Data
{
public interface IRoleObjectAccessEntityPermissionRepository : IRepository<RoleObjectAccessEntityPermission>
{
RoleObjectAccessEntityPermission FindUserPermission(string entityName, string userAccountName, AccessRightValue access);
List<RoleObjectAccessEntityPermission> GetPermissions(IEnumerable<Guid> entityIds, IEnumerable<Guid> roleIds, AccessRightValue access);
}
} | 35.1875 | 143 | 0.815275 | [
"MIT"
] | feilingdeng/xms | Libraries/Security/Xms.Security.DataAuthorization/Data/IRoleObjectAccessEntityPermissionRepository.cs | 565 | C# |
using DotNetCore.Validation;
using FluentValidation;
namespace DotNetCoreArchitecture.Model
{
public class ItemValidator<T> : Validator<T> where T : ItemModel
{
public ItemValidator()
{
RuleFor(x => x.ItemName).NotEmpty();
RuleFor(x => x.Description).NotEmpty();
RuleFor(x => x.MaxNum).NotEmpty();
RuleFor(x => x.MinNum).NotEmpty();
}
}
}
| 24.941176 | 68 | 0.589623 | [
"MIT"
] | yousefexperts/angular8 | source/Model/Models/Items/ItemValidator.cs | 424 | C# |
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
namespace System.Data.Entity.Core.Common
{
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Data.Entity.Core.Metadata.Edm;
using System.Data.Entity.Resources;
using System.Data.Entity.Utilities;
using System.Diagnostics;
/// <summary>
/// DataRecordInfo class providing a simple way to access both the type information and the column information.
/// </summary>
public class DataRecordInfo
{
private readonly ReadOnlyCollection<FieldMetadata> _fieldMetadata;
private readonly TypeUsage _metadata;
internal DataRecordInfo()
{
}
/// <summary>
/// Initializes a new <see cref="T:System.Data.Common.DbDataRecord" /> object for a specific type with an enumerable collection of data fields.
/// </summary>
/// <param name="metadata">
/// The metadata for the type represented by this object, supplied by
/// <see
/// cref="T:System.Data.Entity.Core.Metadata.Edm.TypeUsage" />
/// .
/// </param>
/// <param name="memberInfo">
/// An enumerable collection of <see cref="T:System.Data.Entity.Core.Metadata.Edm.EdmMember" /> objects that represent column information.
/// </param>
public DataRecordInfo(TypeUsage metadata, IEnumerable<EdmMember> memberInfo)
{
Check.NotNull(metadata, "metadata");
var members = TypeHelpers.GetAllStructuralMembers(metadata.EdmType);
var fieldList = new List<FieldMetadata>(members.Count);
if (null != memberInfo)
{
foreach (var member in memberInfo)
{
if ((null != member)
&& (0 <= members.IndexOf(member))
&& ((BuiltInTypeKind.EdmProperty == member.BuiltInTypeKind)
|| // for ComplexType, EntityType; BuiltTypeKind.NaviationProperty not allowed
(BuiltInTypeKind.AssociationEndMember == member.BuiltInTypeKind))) // for AssociationType
{
// each memberInfo must be non-null and be part of Properties or AssociationEndMembers
//validate that EdmMembers are from the same type or base type of the passed in metadata.
if ((member.DeclaringType != metadata.EdmType)
&& !member.DeclaringType.IsBaseTypeOf(metadata.EdmType))
{
throw new ArgumentException(Strings.EdmMembersDefiningTypeDoNotAgreeWithMetadataType);
}
fieldList.Add(new FieldMetadata(fieldList.Count, member));
}
else
{
// expecting empty memberInfo for non-structural && non-null member part of members if structural
throw Error.InvalidEdmMemberInstance();
}
}
}
// expecting structural types to have something at least 1 property
// (((null == structural) && (0 == fieldList.Count)) || ((null != structural) && (0 < fieldList.Count)))
if (Helper.IsStructuralType(metadata.EdmType) == (0 < fieldList.Count))
{
_fieldMetadata = new ReadOnlyCollection<FieldMetadata>(fieldList);
_metadata = metadata;
}
else
{
throw Error.InvalidEdmMemberInstance();
}
}
// <summary>
// Construct FieldMetadata for structuralType.Members from TypeUsage
// </summary>
internal DataRecordInfo(TypeUsage metadata)
{
DebugCheck.NotNull(metadata);
var structuralMembers = TypeHelpers.GetAllStructuralMembers(metadata);
var fieldList = new FieldMetadata[structuralMembers.Count];
for (var i = 0; i < fieldList.Length; ++i)
{
var member = structuralMembers[i];
Debug.Assert(
(BuiltInTypeKind.EdmProperty == member.BuiltInTypeKind) ||
(BuiltInTypeKind.AssociationEndMember == member.BuiltInTypeKind),
"unexpected BuiltInTypeKind for member");
fieldList[i] = new FieldMetadata(i, member);
}
_fieldMetadata = new ReadOnlyCollection<FieldMetadata>(fieldList);
_metadata = metadata;
}
// <summary>
// Reusing TypeUsage and FieldMetadata from another EntityRecordInfo which has all the same info
// but with a different EntityKey instance.
// </summary>
internal DataRecordInfo(DataRecordInfo recordInfo)
{
_fieldMetadata = recordInfo._fieldMetadata;
_metadata = recordInfo._metadata;
}
/// <summary>
/// Gets <see cref="T:System.Data.Entity.Core.Common.FieldMetadata" /> for this
/// <see
/// cref="P:System.Data.Entity.Core.IExtendedDataRecord.DataRecordInfo" />
/// object.
/// </summary>
/// <returns>
/// A <see cref="T:System.Data.Entity.Core.Common.FieldMetadata" /> object.
/// </returns>
public ReadOnlyCollection<FieldMetadata> FieldMetadata
{
get { return _fieldMetadata; }
}
/// <summary>
/// Gets type info for this object as a <see cref="T:System.Data.Entity.Core.Metadata.Edm.TypeUsage" /> object.
/// </summary>
/// <returns>
/// A <see cref="T:System.Data.Entity.Core.Metadata.Edm.TypeUsage" /> value.
/// </returns>
public virtual TypeUsage RecordType
{
get { return _metadata; }
}
}
}
| 42.631206 | 151 | 0.573116 | [
"Apache-2.0"
] | Cireson/EntityFramework6 | src/EntityFramework/Core/Common/DataRecordInfo.cs | 6,011 | C# |
using System;
using System.Collections.Generic;
using System.Text;
namespace VGMToolbox.util
{
/// <summary>
/// Struct containing criteria used to find offsets.
/// </summary>
public struct FindOffsetStruct
{
private string searchString;
private string startingOffset;
private bool treatSearchStringAsHex;
private bool cutFile;
private string searchStringOffset;
private string cutSize;
private string cutSizeOffsetSize;
private bool isCutSizeAnOffset;
private string outputFileExtension;
private bool isLittleEndian;
private bool useTerminatorForCutSize;
private string terminatorString;
private bool treatTerminatorStringAsHex;
private bool includeTerminatorLength;
private string extraCutSizeBytes;
public bool DoSearchStringModulo
{
set;
get;
}
public string SearchStringModuloDivisor
{
set;
get;
}
public string SearchStringModuloResult
{
set;
get;
}
public bool DoTerminatorModulo
{
set;
get;
}
public string TerminatorStringModuloDivisor
{
set;
get;
}
public string TerminatorStringModuloResult
{
set;
get;
}
public string MinimumSize
{
set;
get;
}
public string SearchString
{
get { return searchString; }
set { searchString = value; }
}
/// <summary>
/// Gets or sets offset to being searching at
/// </summary>
public string StartingOffset
{
set { startingOffset = value; }
get { return startingOffset; }
}
/// <summary>
/// Gets or sets flag to indicate search string is a hex value.
/// </summary>
public bool TreatSearchStringAsHex
{
get { return treatSearchStringAsHex; }
set { treatSearchStringAsHex = value; }
}
/// <summary>
/// Gets or sets flag to cut the file when the offset is found.
/// </summary>
public bool CutFile
{
get { return cutFile; }
set { cutFile = value; }
}
/// <summary>
/// Gets or sets offset within destination file Search String would reside.
/// </summary>
public string SearchStringOffset
{
get { return searchStringOffset; }
set { searchStringOffset = value; }
}
/// <summary>
/// Gets or sets size to cut from file
/// </summary>
public string CutSize
{
get { return cutSize; }
set { cutSize = value; }
}
/// <summary>
/// Gets or sets size of offset holding cut size
/// </summary>
public string CutSizeOffsetSize
{
get { return cutSizeOffsetSize; }
set { cutSizeOffsetSize = value; }
}
/// <summary>
/// Gets or sets flag indicating that cut size is an offset.
/// </summary>
public bool IsCutSizeAnOffset
{
get { return isCutSizeAnOffset; }
set { isCutSizeAnOffset = value; }
}
/// <summary>
/// Gets or sets file extension to use for cut files.
/// </summary>
public string OutputFileExtension
{
get { return outputFileExtension; }
set { outputFileExtension = value; }
}
/// <summary>
/// Gets or sets flag indicating that offset based cut size is stored in Little Endian byte order.
/// </summary>
public bool IsLittleEndian
{
get { return isLittleEndian; }
set { isLittleEndian = value; }
}
/// <summary>
/// Gets or sets flag indicating that a terminator should be used to determine the cut size.
/// </summary>
public bool UseLengthMultiplier { set; get; }
public string LengthMultiplier { set; get; }
public bool UseTerminatorForCutSize
{
get { return useTerminatorForCutSize; }
set { useTerminatorForCutSize = value; }
}
/// <summary>
/// Gets or sets terminator string to search for.
/// </summary>
public string TerminatorString
{
get { return terminatorString; }
set { terminatorString = value; }
}
/// <summary>
/// Gets or sets flag indicating that Terminator String is hex.
/// </summary>
public bool TreatTerminatorStringAsHex
{
get { return treatTerminatorStringAsHex; }
set { treatTerminatorStringAsHex = value; }
}
/// <summary>
/// Gets or sets flag indicating that the length of the terminator should be included in the cut size.
/// </summary>
public bool IncludeTerminatorLength
{
get { return includeTerminatorLength; }
set { includeTerminatorLength = value; }
}
public bool CutToEofIfTerminatorNotFound { set; get; }
/// <summary>
/// Gets or sets additional bytes to include in the cut size.
/// </summary>
public string ExtraCutSizeBytes
{
get { return extraCutSizeBytes; }
set { extraCutSizeBytes = value; }
}
public string OutputFolder { get; set; }
}
/// <summary>
/// Struct used to send messages conveying progress.
/// </summary>
public struct ProgressStruct
{
/// <summary>
/// File name to display in progress bar.
/// </summary>
private string fileName;
/// <summary>
/// Error message to display in output window.
/// </summary>
private string errorMessage;
/// <summary>
/// Generic message to display in output window.
/// </summary>
private string genericMessage;
/// <summary>
/// Gets or sets fileName.
/// </summary>
public string FileName
{
get { return fileName; }
set { fileName = value; }
}
/// <summary>
/// Gets or sets errorMessage.
/// </summary>
public string ErrorMessage
{
get { return errorMessage; }
set { errorMessage = value; }
}
/// <summary>
/// Gets or sets genericMessage.
/// </summary>
public string GenericMessage
{
get { return genericMessage; }
set { genericMessage = value; }
}
/// <summary>
/// Reset this node's values
/// </summary>
public void Clear()
{
fileName = String.Empty;
errorMessage = String.Empty;
genericMessage = String.Empty;
}
}
/// <summary>
/// Struct used to allow TreeView to select a specific form and modify the originating node upon completion of a task.
/// </summary>
public struct NodeTagStruct
{
/// <summary>
/// Class name of the Form this node will bring to focus.
/// </summary>
private string formClass;
/// <summary>
/// Object type this node represents.
/// </summary>
private string objectType;
/// <summary>
/// File path of the file this node represents.
/// </summary>
private string filePath;
/// <summary>
/// Gets or sets formClass
/// </summary>
public string FormClass
{
get { return formClass; }
set { formClass = value; }
}
/// <summary>
/// Gets or sets objectType
/// </summary>
public string ObjectType
{
get { return objectType; }
set { objectType = value; }
}
/// <summary>
/// Gets or sets filePath
/// </summary>
public string FilePath
{
get { return filePath; }
set { filePath = value; }
}
}
public enum VfsFileRecordRelativeOffsetLocationType
{
FileRecordStart,
FileRecordEnd
}
public struct VfsExtractionStruct
{
// header size
public bool UseStaticHeaderSize { set; get; }
public string StaticHeaderSize { set; get; }
public bool UseHeaderSizeOffset { set; get; }
public OffsetDescription HeaderSizeOffsetDescription { set; get; }
public bool ReadHeaderToEof { set; get; }
// file count
public bool UseStaticFileCount { set; get; }
public string StaticFileCount { set; get; }
public bool UseFileCountOffset { set; get; }
public OffsetDescription FileCountOffsetDescription { set; get; }
// file record basic information
public string FileRecordsStartOffset { set; get; }
public string FileRecordSize { set; get; }
// file offset
public bool UseFileOffsetOffset { set; get; }
public CalculatingOffsetDescription FileOffsetOffsetDescription { set; get; }
public bool UsePreviousFilesSizeToDetermineOffset { set; get; }
public string BeginCuttingFilesAtOffset { set; get; }
public bool UseByteAlignmentValue { set; get; }
public string ByteAlignmentValue { set; get; }
// file length/size
public bool UseFileLengthOffset { set; get; }
public CalculatingOffsetDescription FileLengthOffsetDescription { set; get; }
public bool UseLocationOfNextFileToDetermineLength { set; get; }
// file name
public bool FileNameIsPresent { set; get; }
public bool UseStaticFileNameOffsetWithinRecord { set; get; }
public string StaticFileNameOffsetWithinRecord { set; get; }
public bool UseAbsoluteFileNameOffset { set; get; }
public OffsetDescription AbsoluteFileNameOffsetDescription { set; get; }
public bool UseRelativeFileNameOffset { set; get; }
public OffsetDescription RelativeFileNameOffsetDescription { set; get; }
public VfsFileRecordRelativeOffsetLocationType FileRecordNameRelativeOffsetLocation { set; get; }
// name size
public bool UseStaticFileNameLength { set; get; }
public string StaticFileNameLength { set; get; }
public bool UseFileNameTerminatorString { set; get; }
public string FileNameTerminatorString { set; get; }
}
public struct SimpleFileExtractionStruct
{
public string FilePath { set; get; }
public long FileOffset { set; get; }
public long FileLength { set; get; }
public long FileNameLength { set; get; }
public void Clear()
{
this.FilePath = String.Empty;
this.FileOffset = -1;
this.FileLength = -1;
this.FileNameLength = -1;
}
}
/// <summary>
/// Class containing universal constants.
/// </summary>
public sealed class Constants
{
/// <summary>
/// Chunk size to use when reading from files. Used to grab maximum buffer
/// size without using the large object heap which has poor collection.
/// </summary>
public const int FileReadChunkSize = 71680;
/// <summary>
/// Constant used to send an ignore the value message to the progress bar.
/// </summary>
public const int IgnoreProgress = -1;
/// <summary>
/// Constant used to send a generic message to the progress bar.
/// </summary>
public const int ProgressMessageOnly = -2;
/// <summary>
/// Text description to use when describing a Big Endian option
/// </summary>
public const string BigEndianByteOrder = "Big Endian";
/// <summary>
/// Text description to use when describing a Little Endian option
/// </summary>
public const string LittleEndianByteOrder = "Little Endian";
public static readonly byte[] RiffHeaderBytes = new byte[] { 0x52, 0x49, 0x46, 0x46 };
public static readonly byte[] RiffDataBytes = new byte[] { 0x64, 0x61, 0x74, 0x61 };
public static readonly byte[] RiffWaveBytes = new byte[] { 0x57, 0x41, 0x56, 0x45 };
public static readonly byte[] RiffFmtBytes = new byte[] { 0x66, 0x6D, 0x74, 0x20 };
public static readonly byte[] NullByteArray = new byte[] { 0x00 };
public const string StringNullTerminator = "\0";
// empty constructor
private Constants() { }
}
}
| 29.917808 | 122 | 0.555708 | [
"MIT"
] | selurvedu/UsmDemuxer | UsmDemuxer/VGMToolbox/util/Constants.cs | 13,106 | C# |
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Editor.CSharp.Outlining;
using Microsoft.CodeAnalysis.Editor.Implementation.Outlining;
using Roslyn.Test.Utilities;
using Xunit;
namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Outlining
{
public class EventDeclarationOutlinerTests : AbstractCSharpSyntaxNodeOutlinerTests<EventDeclarationSyntax>
{
internal override AbstractSyntaxOutliner CreateOutliner() => new EventDeclarationOutliner();
[Fact, Trait(Traits.Feature, Traits.Features.Outlining)]
public async Task TestEvent()
{
const string code = @"
class C
{
{|hint:$$event EventHandler E{|collapse:
{
add { }
remove { }
}|}|}
}";
await VerifyRegionsAsync(code,
Region("collapse", "hint", CSharpOutliningHelpers.Ellipsis, autoCollapse: true));
}
[Fact, Trait(Traits.Feature, Traits.Features.Outlining)]
public async Task TestEventWithComments()
{
const string code = @"
class C
{
{|span1:// Foo
// Bar|}
{|hint2:$$event EventHandler E{|collapse2:
{
add { }
remove { }
}|}|}
}";
await VerifyRegionsAsync(code,
Region("span1", "// Foo ...", autoCollapse: true),
Region("collapse2", "hint2", CSharpOutliningHelpers.Ellipsis, autoCollapse: true));
}
}
}
| 30.148148 | 161 | 0.649877 | [
"Apache-2.0"
] | HaloFour/roslyn | src/EditorFeatures/CSharpTest/Outlining/EventDeclarationOutlinerTests.cs | 1,630 | C# |
namespace Azure.DigitalTwins.Core
{
public partial class DigitalTwinsClient
{
protected DigitalTwinsClient() { }
public DigitalTwinsClient(System.Uri endpoint, Azure.Core.TokenCredential credential) { }
public DigitalTwinsClient(System.Uri endpoint, Azure.Core.TokenCredential credential, Azure.DigitalTwins.Core.DigitalTwinsClientOptions options) { }
public virtual Azure.Response<string> CreateDigitalTwin(string digitalTwinId, string digitalTwin, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<string>> CreateDigitalTwinAsync(string digitalTwinId, string digitalTwin, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response CreateEventRoute(string eventRouteId, Azure.DigitalTwins.Core.Models.EventRoute eventRoute, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response> CreateEventRouteAsync(string eventRouteId, Azure.DigitalTwins.Core.Models.EventRoute eventRoute, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.DigitalTwins.Core.Models.ModelData>> CreateModels(System.Collections.Generic.IEnumerable<string> models, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.DigitalTwins.Core.Models.ModelData>>> CreateModelsAsync(System.Collections.Generic.IEnumerable<string> models, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<string> CreateRelationship(string digitalTwinId, string relationshipId, string relationship, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<string>> CreateRelationshipAsync(string digitalTwinId, string relationshipId, string relationship, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response DecommissionModel(string modelId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response> DecommissionModelAsync(string modelId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response DeleteDigitalTwin(string digitalTwinId, Azure.DigitalTwins.Core.RequestOptions requestOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response> DeleteDigitalTwinAsync(string digitalTwinId, Azure.DigitalTwins.Core.RequestOptions requestOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response DeleteEventRoute(string eventRouteId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response> DeleteEventRouteAsync(string eventRouteId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response DeleteModel(string modelId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response> DeleteModelAsync(string modelId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response DeleteRelationship(string digitalTwinId, string relationshipId, Azure.DigitalTwins.Core.RequestOptions requestOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response> DeleteRelationshipAsync(string digitalTwinId, string relationshipId, Azure.DigitalTwins.Core.RequestOptions requestOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<string> GetComponent(string digitalTwinId, string componentPath, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<string>> GetComponentAsync(string digitalTwinId, string componentPath, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<string> GetDigitalTwin(string digitalTwinId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<string>> GetDigitalTwinAsync(string digitalTwinId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<Azure.DigitalTwins.Core.Models.EventRoute> GetEventRoute(string eventRouteId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.DigitalTwins.Core.Models.EventRoute>> GetEventRouteAsync(string eventRouteId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Pageable<Azure.DigitalTwins.Core.Models.EventRoute> GetEventRoutes(Azure.DigitalTwins.Core.Models.EventRoutesListOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.AsyncPageable<Azure.DigitalTwins.Core.Models.EventRoute> GetEventRoutesAsync(Azure.DigitalTwins.Core.Models.EventRoutesListOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Pageable<Azure.DigitalTwins.Core.Models.IncomingRelationship> GetIncomingRelationships(string digitalTwinId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.AsyncPageable<Azure.DigitalTwins.Core.Models.IncomingRelationship> GetIncomingRelationshipsAsync(string digitalTwinId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<Azure.DigitalTwins.Core.Models.ModelData> GetModel(string modelId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.DigitalTwins.Core.Models.ModelData>> GetModelAsync(string modelId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Pageable<Azure.DigitalTwins.Core.Models.ModelData> GetModels(System.Collections.Generic.IEnumerable<string> dependenciesFor = null, bool includeModelDefinition = false, Azure.DigitalTwins.Core.Models.GetModelsOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.AsyncPageable<Azure.DigitalTwins.Core.Models.ModelData> GetModelsAsync(System.Collections.Generic.IEnumerable<string> dependenciesFor = null, bool includeModelDefinition = false, Azure.DigitalTwins.Core.Models.GetModelsOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<string> GetRelationship(string digitalTwinId, string relationshipId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<string>> GetRelationshipAsync(string digitalTwinId, string relationshipId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Pageable<string> GetRelationships(string digitalTwinId, string relationshipName = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.AsyncPageable<string> GetRelationshipsAsync(string digitalTwinId, string relationshipName = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response PublishComponentTelemetry(string digitalTwinId, string componentName, string payload, Azure.DigitalTwins.Core.Models.TelemetryOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response> PublishComponentTelemetryAsync(string digitalTwinId, string componentName, string payload, Azure.DigitalTwins.Core.Models.TelemetryOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response PublishTelemetry(string digitalTwinId, string payload, Azure.DigitalTwins.Core.Models.TelemetryOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response> PublishTelemetryAsync(string digitalTwinId, string payload, Azure.DigitalTwins.Core.Models.TelemetryOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Pageable<string> Query(string query, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.AsyncPageable<string> QueryAsync(string query, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<string> UpdateComponent(string digitalTwinId, string componentPath, string componentUpdateOperations, Azure.DigitalTwins.Core.RequestOptions requestOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<string>> UpdateComponentAsync(string digitalTwinId, string componentPath, string componentUpdateOperations, Azure.DigitalTwins.Core.RequestOptions requestOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<string> UpdateDigitalTwin(string digitalTwinId, string digitalTwinUpdateOperations, Azure.DigitalTwins.Core.RequestOptions requestOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<string>> UpdateDigitalTwinAsync(string digitalTwinId, string digitalTwinUpdateOperations, Azure.DigitalTwins.Core.RequestOptions requestOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response UpdateRelationship(string digitalTwinId, string relationshipId, string relationshipUpdateOperations, Azure.DigitalTwins.Core.RequestOptions requestOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response> UpdateRelationshipAsync(string digitalTwinId, string relationshipId, string relationshipUpdateOperations, Azure.DigitalTwins.Core.RequestOptions requestOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
}
public partial class DigitalTwinsClientOptions : Azure.Core.ClientOptions
{
public DigitalTwinsClientOptions(Azure.DigitalTwins.Core.DigitalTwinsClientOptions.ServiceVersion version = Azure.DigitalTwins.Core.DigitalTwinsClientOptions.ServiceVersion.V2020_05_31_preview) { }
public Azure.DigitalTwins.Core.DigitalTwinsClientOptions.ServiceVersion Version { get { throw null; } }
public enum ServiceVersion
{
V2020_05_31_preview = 1,
}
}
public partial class RequestOptions
{
public RequestOptions() { }
public string IfMatchEtag { get { throw null; } set { } }
}
}
namespace Azure.DigitalTwins.Core.Models
{
public partial class EventRoute
{
public EventRoute(string endpointName) { }
public string EndpointName { get { throw null; } set { } }
public string Filter { get { throw null; } set { } }
public string Id { get { throw null; } }
}
public partial class EventRoutesListOptions
{
public EventRoutesListOptions() { }
public int? MaxItemCount { get { throw null; } set { } }
}
public partial class GetModelsOptions
{
public GetModelsOptions() { }
public int? MaxItemCount { get { throw null; } set { } }
}
public partial class IncomingRelationship
{
internal IncomingRelationship() { }
public string RelationshipId { get { throw null; } }
public string RelationshipLink { get { throw null; } }
public string RelationshipName { get { throw null; } }
public string SourceId { get { throw null; } }
}
public partial class ModelData
{
internal ModelData() { }
public bool? Decommissioned { get { throw null; } }
public System.Collections.Generic.IDictionary<string, string> Description { get { throw null; } }
public System.Collections.Generic.IDictionary<string, string> DisplayName { get { throw null; } }
public string Id { get { throw null; } }
public string Model { get { throw null; } }
public System.DateTimeOffset? UploadTime { get { throw null; } }
}
public partial class TelemetryOptions
{
public TelemetryOptions() { }
public string MessageId { get { throw null; } set { } }
public System.DateTimeOffset TimeStamp { get { throw null; } set { } }
}
}
namespace Azure.DigitalTwins.Core.Queries
{
public static partial class QueryChargeHelper
{
public static bool TryGetQueryCharge(Azure.Page<string> page, out float queryCharge) { throw null; }
}
}
namespace Azure.DigitalTwins.Core.Serialization
{
public partial class BasicDigitalTwin : Azure.DigitalTwins.Core.Serialization.ModelProperties
{
public BasicDigitalTwin() { }
[System.Text.Json.Serialization.JsonPropertyNameAttribute("$etag")]
public string ETag { get { throw null; } set { } }
[System.Text.Json.Serialization.JsonPropertyNameAttribute("$dtId")]
public string Id { get { throw null; } set { } }
}
public partial class BasicRelationship
{
public BasicRelationship() { }
[System.Text.Json.Serialization.JsonExtensionDataAttribute]
public System.Collections.Generic.IDictionary<string, object> CustomProperties { get { throw null; } set { } }
[System.Text.Json.Serialization.JsonPropertyNameAttribute("$relationshipId")]
public string Id { get { throw null; } set { } }
[System.Text.Json.Serialization.JsonPropertyNameAttribute("$relationshipName")]
public string Name { get { throw null; } set { } }
[System.Text.Json.Serialization.JsonPropertyNameAttribute("$sourceId")]
public string SourceId { get { throw null; } set { } }
[System.Text.Json.Serialization.JsonPropertyNameAttribute("$targetId")]
public string TargetId { get { throw null; } set { } }
}
public partial class DigitalTwinMetadata
{
public DigitalTwinMetadata() { }
[System.Text.Json.Serialization.JsonPropertyNameAttribute("$model")]
public string ModelId { get { throw null; } set { } }
[System.Text.Json.Serialization.JsonExtensionDataAttribute]
public System.Collections.Generic.IDictionary<string, object> WriteableProperties { get { throw null; } }
}
public partial class ModelProperties
{
public ModelProperties() { }
[System.Text.Json.Serialization.JsonExtensionDataAttribute]
public System.Collections.Generic.IDictionary<string, object> CustomProperties { get { throw null; } }
[System.Text.Json.Serialization.JsonPropertyNameAttribute("$metadata")]
public Azure.DigitalTwins.Core.Serialization.DigitalTwinMetadata Metadata { get { throw null; } }
}
public partial class UpdateOperationsUtility
{
public UpdateOperationsUtility() { }
public void AppendAddOp(string path, object value) { }
public void AppendRemoveOp(string path) { }
public void AppendReplaceOp(string path, object value) { }
public string Serialize() { throw null; }
}
public partial class WritableProperty
{
public WritableProperty() { }
[System.Text.Json.Serialization.JsonPropertyNameAttribute("ackCode")]
public int AckCode { get { throw null; } set { } }
[System.Text.Json.Serialization.JsonPropertyNameAttribute("ackDescription")]
public string AckDescription { get { throw null; } set { } }
[System.Text.Json.Serialization.JsonPropertyNameAttribute("ackVersion")]
public int AckVersion { get { throw null; } set { } }
[System.Text.Json.Serialization.JsonPropertyNameAttribute("desiredValue")]
public object DesiredValue { get { throw null; } set { } }
[System.Text.Json.Serialization.JsonPropertyNameAttribute("desiredVersion")]
public int DesiredVersion { get { throw null; } set { } }
}
}
| 103.134409 | 387 | 0.776364 | [
"MIT"
] | lapradh/azure-sdk-for-net | sdk/digitaltwins/Azure.DigitalTwins.Core/api/Azure.DigitalTwins.Core.netstandard2.0.cs | 19,183 | C# |
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Quartz.Impl.AdoJobStore;
using Quartz.Impl.AdoJobStore.Common;
using Serilog;
using Serilog.Events;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace Host
{
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public IConfiguration Configuration { get; }
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
// 日志配置
LogConfig();
#region 跨域
services.AddCors(options =>
{
options.AddPolicy("AllowSameDomain", policyBuilder =>
{
policyBuilder.AllowAnyHeader()
.AllowAnyMethod()
//.WithMethods("GET", "POST")
.AllowCredentials();//指定处理cookie
var cfg = Configuration.GetSection("AllowedHosts").Get<List<string>>();
if (cfg?.Contains("*") ?? false)
policyBuilder.AllowAnyOrigin(); //允许任何来源的主机访问
else if (cfg?.Any() ?? false)
policyBuilder.WithOrigins(cfg.ToArray()); //允许类似http://localhost:8080等主机访问
});
});
#endregion
//services.AddMvc();
services.AddControllersWithViews().AddNewtonsoftJson();
// Register the Swagger services
services.AddSwaggerDocument();
services.AddSingleton(GetScheduler());
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
//app.UseMvc();
// Url重写中间件,不是api路由时跳到index.html
app.Use(async (context, next) =>
{
await next();
if (context.Response.StatusCode == 404 &&
!Path.HasExtension(context.Request.Path.Value) &&
!context.Request.Path.Value.StartsWith("/api/"))
{
context.Request.Path = "/index.html";
await next();
}
});
//app.UseMvcWithDefaultRoute();
app.UseDefaultFiles();
app.UseStaticFiles();
// Register the Swagger generator and the Swagger UI middlewares
app.UseOpenApi();
app.UseSwaggerUi3();
app.UseRouting();
//app.UseAuthorization();
//跨域配置
//https://docs.microsoft.com/zh-cn/aspnet/core/security/cors?view=aspnetcore-3.1
app.UseCors();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
}
/// <summary>
/// 日志配置
/// </summary>
private void LogConfig()
{
//nuget导入
//Serilog.Extensions.Logging
//Serilog.Sinks.RollingFile
//Serilog.Sinks.Async
var fileSize = 1024 * 1024 * 10;//10M
var fileCount = 2;
Log.Logger = new LoggerConfiguration()
.Enrich.FromLogContext()
.MinimumLevel.Debug()
.MinimumLevel.Override("System", LogEventLevel.Information)
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
.WriteTo.Logger(lg => lg.Filter.ByIncludingOnly(p => p.Level == LogEventLevel.Debug).WriteTo.Async(
a =>
{
a.RollingFile("File/logs/log-{Date}-Debug.txt", fileSizeLimitBytes: fileSize, retainedFileCountLimit: fileCount);
}
))
.WriteTo.Logger(lg => lg.Filter.ByIncludingOnly(p => p.Level == LogEventLevel.Information).WriteTo.Async(
a =>
{
a.RollingFile("File/logs/log-{Date}-Information.txt", fileSizeLimitBytes: fileSize, retainedFileCountLimit: fileCount);
}
))
.WriteTo.Logger(lg => lg.Filter.ByIncludingOnly(p => p.Level == LogEventLevel.Warning).WriteTo.Async(
a =>
{
a.RollingFile("File/logs/log-{Date}-Warning.txt", fileSizeLimitBytes: fileSize, retainedFileCountLimit: fileCount);
}
))
.WriteTo.Logger(lg => lg.Filter.ByIncludingOnly(p => p.Level == LogEventLevel.Error).WriteTo.Async(
a =>
{
a.RollingFile("File/logs/log-{Date}-Error.txt", fileSizeLimitBytes: fileSize, retainedFileCountLimit: fileCount);
}
))
.WriteTo.Logger(lg => lg.Filter.ByIncludingOnly(p => p.Level == LogEventLevel.Fatal).WriteTo.Async(
a =>
{
a.RollingFile("File/logs/log-{Date}-Fatal.txt", fileSizeLimitBytes: fileSize, retainedFileCountLimit: fileCount);
}
))
//所有情况
.WriteTo.Logger(lg => lg.Filter.ByIncludingOnly(p => true)).WriteTo.Async(
a =>
{
a.RollingFile("File/logs/log-{Date}-All.txt", fileSizeLimitBytes: fileSize, retainedFileCountLimit: fileCount);
}
)
.CreateLogger();
}
private SchedulerCenter GetScheduler()
{
string dbProviderName = Configuration.GetSection("Quartz")["dbProviderName"];
string connectionString = Configuration.GetSection("Quartz")["connectionString"];
string driverDelegateType = string.Empty;
switch (dbProviderName)
{
case "SQLite-Microsoft":
case "SQLite":
driverDelegateType = typeof(SQLiteDelegate).AssemblyQualifiedName; break;
case "MySql":
driverDelegateType = typeof(MySQLDelegate).AssemblyQualifiedName; break;
case "OracleODPManaged":
driverDelegateType = typeof(OracleDelegate).AssemblyQualifiedName; break;
case "SQLServer":
case "SQLServerMOT":
driverDelegateType = typeof(SqlServerDelegate).AssemblyQualifiedName; break;
case "Npgsql":
driverDelegateType = typeof(PostgreSQLDelegate).AssemblyQualifiedName; break;
case "Firebird":
driverDelegateType = typeof(FirebirdDelegate).AssemblyQualifiedName; break;
default:
throw new System.Exception("dbProviderName unreasonable");
}
SchedulerCenter schedulerCenter = SchedulerCenter.Instance;
schedulerCenter.Setting(new DbProvider(dbProviderName, connectionString), driverDelegateType);
return schedulerCenter;
}
}
}
| 42.803109 | 160 | 0.490376 | [
"MIT"
] | teotw1314/quartzui-1 | QuartzNetAPI/Host/Startup.cs | 8,375 | C# |
// <auto-generated>
// This file was generated by a tool; you should avoid making direct changes.
// Consider using 'partial classes' to extend these types
// Input: logs.proto
// </auto-generated>
#region Designer generated code
#pragma warning disable CS0612, CS0618, CS1591, CS3021, IDE0079, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
namespace OpenTelemetry.TestHelpers.Proto.Logs.V1
{
[global::ProtoBuf.ProtoContract()]
public partial class LogsData : global::ProtoBuf.IExtensible
{
private global::ProtoBuf.IExtension __pbn__extensionData;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
=> global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
[global::ProtoBuf.ProtoMember(1, Name = @"resource_logs")]
public global::System.Collections.Generic.List<ResourceLogs> ResourceLogs { get; } = new global::System.Collections.Generic.List<ResourceLogs>();
}
[global::ProtoBuf.ProtoContract()]
public partial class ResourceLogs : global::ProtoBuf.IExtensible
{
private global::ProtoBuf.IExtension __pbn__extensionData;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
=> global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
[global::ProtoBuf.ProtoMember(1, Name = @"resource")]
public global::OpenTelemetry.TestHelpers.Proto.Resource.V1.Resource Resource { get; set; }
[global::ProtoBuf.ProtoMember(2, Name = @"instrumentation_library_logs")]
public global::System.Collections.Generic.List<InstrumentationLibraryLogs> InstrumentationLibraryLogs { get; } = new global::System.Collections.Generic.List<InstrumentationLibraryLogs>();
[global::ProtoBuf.ProtoMember(3, Name = @"schema_url")]
[global::System.ComponentModel.DefaultValue("")]
public string SchemaUrl { get; set; } = "";
}
[global::ProtoBuf.ProtoContract()]
public partial class InstrumentationLibraryLogs : global::ProtoBuf.IExtensible
{
private global::ProtoBuf.IExtension __pbn__extensionData;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
=> global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
[global::ProtoBuf.ProtoMember(1, Name = @"instrumentation_library")]
public global::OpenTelemetry.TestHelpers.Proto.Common.V1.InstrumentationLibrary InstrumentationLibrary { get; set; }
[global::ProtoBuf.ProtoMember(2, Name = @"logs")]
public global::System.Collections.Generic.List<LogRecord> Logs { get; } = new global::System.Collections.Generic.List<LogRecord>();
[global::ProtoBuf.ProtoMember(3, Name = @"schema_url")]
[global::System.ComponentModel.DefaultValue("")]
public string SchemaUrl { get; set; } = "";
}
[global::ProtoBuf.ProtoContract()]
public partial class LogRecord : global::ProtoBuf.IExtensible
{
private global::ProtoBuf.IExtension __pbn__extensionData;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
=> global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
[global::ProtoBuf.ProtoMember(1, Name = @"time_unix_nano", DataFormat = global::ProtoBuf.DataFormat.FixedSize)]
public ulong TimeUnixNano { get; set; }
[global::ProtoBuf.ProtoMember(2, Name = @"severity_number")]
public SeverityNumber SeverityNumber { get; set; }
[global::ProtoBuf.ProtoMember(3, Name = @"severity_text")]
[global::System.ComponentModel.DefaultValue("")]
public string SeverityText { get; set; } = "";
[global::ProtoBuf.ProtoMember(4, Name = @"name")]
[global::System.ComponentModel.DefaultValue("")]
public string Name { get; set; } = "";
[global::ProtoBuf.ProtoMember(5, Name = @"body")]
public global::OpenTelemetry.TestHelpers.Proto.Common.V1.AnyValue Body { get; set; }
[global::ProtoBuf.ProtoMember(6, Name = @"attributes")]
public global::System.Collections.Generic.List<global::OpenTelemetry.TestHelpers.Proto.Common.V1.KeyValue> Attributes { get; } = new global::System.Collections.Generic.List<global::OpenTelemetry.TestHelpers.Proto.Common.V1.KeyValue>();
[global::ProtoBuf.ProtoMember(7, Name = @"dropped_attributes_count")]
public uint DroppedAttributesCount { get; set; }
[global::ProtoBuf.ProtoMember(8, Name = @"flags", DataFormat = global::ProtoBuf.DataFormat.FixedSize)]
public uint Flags { get; set; }
[global::ProtoBuf.ProtoMember(9, Name = @"trace_id")]
public byte[] TraceId { get; set; }
[global::ProtoBuf.ProtoMember(10, Name = @"span_id")]
public byte[] SpanId { get; set; }
}
[global::ProtoBuf.ProtoContract()]
public enum SeverityNumber
{
[global::ProtoBuf.ProtoEnum(Name = @"SEVERITY_NUMBER_UNSPECIFIED")]
SeverityNumberUnspecified = 0,
[global::ProtoBuf.ProtoEnum(Name = @"SEVERITY_NUMBER_TRACE")]
SeverityNumberTrace = 1,
[global::ProtoBuf.ProtoEnum(Name = @"SEVERITY_NUMBER_TRACE2")]
SeverityNumberTrace2 = 2,
[global::ProtoBuf.ProtoEnum(Name = @"SEVERITY_NUMBER_TRACE3")]
SeverityNumberTrace3 = 3,
[global::ProtoBuf.ProtoEnum(Name = @"SEVERITY_NUMBER_TRACE4")]
SeverityNumberTrace4 = 4,
[global::ProtoBuf.ProtoEnum(Name = @"SEVERITY_NUMBER_DEBUG")]
SeverityNumberDebug = 5,
[global::ProtoBuf.ProtoEnum(Name = @"SEVERITY_NUMBER_DEBUG2")]
SeverityNumberDebug2 = 6,
[global::ProtoBuf.ProtoEnum(Name = @"SEVERITY_NUMBER_DEBUG3")]
SeverityNumberDebug3 = 7,
[global::ProtoBuf.ProtoEnum(Name = @"SEVERITY_NUMBER_DEBUG4")]
SeverityNumberDebug4 = 8,
[global::ProtoBuf.ProtoEnum(Name = @"SEVERITY_NUMBER_INFO")]
SeverityNumberInfo = 9,
[global::ProtoBuf.ProtoEnum(Name = @"SEVERITY_NUMBER_INFO2")]
SeverityNumberInfo2 = 10,
[global::ProtoBuf.ProtoEnum(Name = @"SEVERITY_NUMBER_INFO3")]
SeverityNumberInfo3 = 11,
[global::ProtoBuf.ProtoEnum(Name = @"SEVERITY_NUMBER_INFO4")]
SeverityNumberInfo4 = 12,
[global::ProtoBuf.ProtoEnum(Name = @"SEVERITY_NUMBER_WARN")]
SeverityNumberWarn = 13,
[global::ProtoBuf.ProtoEnum(Name = @"SEVERITY_NUMBER_WARN2")]
SeverityNumberWarn2 = 14,
[global::ProtoBuf.ProtoEnum(Name = @"SEVERITY_NUMBER_WARN3")]
SeverityNumberWarn3 = 15,
[global::ProtoBuf.ProtoEnum(Name = @"SEVERITY_NUMBER_WARN4")]
SeverityNumberWarn4 = 16,
[global::ProtoBuf.ProtoEnum(Name = @"SEVERITY_NUMBER_ERROR")]
SeverityNumberError = 17,
[global::ProtoBuf.ProtoEnum(Name = @"SEVERITY_NUMBER_ERROR2")]
SeverityNumberError2 = 18,
[global::ProtoBuf.ProtoEnum(Name = @"SEVERITY_NUMBER_ERROR3")]
SeverityNumberError3 = 19,
[global::ProtoBuf.ProtoEnum(Name = @"SEVERITY_NUMBER_ERROR4")]
SeverityNumberError4 = 20,
[global::ProtoBuf.ProtoEnum(Name = @"SEVERITY_NUMBER_FATAL")]
SeverityNumberFatal = 21,
[global::ProtoBuf.ProtoEnum(Name = @"SEVERITY_NUMBER_FATAL2")]
SeverityNumberFatal2 = 22,
[global::ProtoBuf.ProtoEnum(Name = @"SEVERITY_NUMBER_FATAL3")]
SeverityNumberFatal3 = 23,
[global::ProtoBuf.ProtoEnum(Name = @"SEVERITY_NUMBER_FATAL4")]
SeverityNumberFatal4 = 24,
}
[global::ProtoBuf.ProtoContract()]
public enum LogRecordFlags
{
[global::ProtoBuf.ProtoEnum(Name = @"LOG_RECORD_FLAG_UNSPECIFIED")]
LogRecordFlagUnspecified = 0,
[global::ProtoBuf.ProtoEnum(Name = @"LOG_RECORD_FLAG_TRACE_FLAGS_MASK")]
LogRecordFlagTraceFlagsMask = 255,
}
}
#pragma warning restore CS0612, CS0618, CS1591, CS3021, IDE0079, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
#endregion
| 47.783626 | 243 | 0.691715 | [
"Apache-2.0"
] | Kielek/signalfx-dotnet-tracing | tracer/test/OpenTelemetry.TestHelpers/Proto/Logs/V1/Logs.cs | 8,171 | C# |
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
namespace Microsoft.Data.Entity.Design.CodeGeneration
{
using System.Diagnostics;
/// <summary>
/// Represents a model configuration to set the precision and scale of a decimal property.
/// </summary>
public class PrecisionDecimalConfiguration : IFluentConfiguration
{
/// <summary>
/// Gets or sets the precision of the property.
/// </summary>
public byte Precision { get; set; }
/// <summary>
/// Gets or sets the scale of the property.
/// </summary>
public byte Scale { get; set; }
/// <inheritdoc />
public virtual string GetMethodChain(CodeHelper code)
{
Debug.Assert(code != null, "code is null.");
return ".HasPrecision(" + code.Literal(Precision) + ", " + code.Literal(Scale) + ")";
}
}
}
| 31.83871 | 133 | 0.608916 | [
"Apache-2.0"
] | CZEMacLeod/EntityFramework6 | src/EFTools/EntityDesign/CodeGeneration/Configuration/Property/PrecisionDecimalConfiguration.cs | 989 | C# |
using System;
using System.Reflection;
public struct A
{
public override string ToString ()
{
return "A";
}
}
public class D
{
public string Test ()
{
return "Test";
}
}
enum Enum1
{
A,
B
}
enum Enum2
{
C,
D
}
class Tests
{
public static Enum1 return_enum1 () {
return Enum1.A;
}
public static Enum2 return_enum2 () {
return Enum2.C;
}
public static long return_long () {
return 1234;
}
public static ulong return_ulong () {
return UInt64.MaxValue - 5;
}
static int Main (string[] args)
{
return TestDriver.RunTests (typeof (Tests), args);
}
public static int test_0_base () {
Assembly ass = typeof (Tests).Assembly;
Type a_type = ass.GetType ("A");
MethodInfo a_method = a_type.GetMethod ("ToString");
Type d_type = ass.GetType ("D");
MethodInfo d_method = d_type.GetMethod ("Test");
Console.WriteLine ("TEST: {0} {1}", a_method, d_method);
A a = new A ();
D d = new D ();
object a_ret = a_method.Invoke (a, null);
Console.WriteLine (a_ret);
object d_ret = d_method.Invoke (d, null);
Console.WriteLine (d_ret);
return 0;
}
public static int test_0_enum_sharing () {
/* Check sharing of wrappers returning enums */
if (typeof (Tests).GetMethod ("return_enum1").Invoke (null, null).GetType () != typeof (Enum1))
return 1;
if (typeof (Tests).GetMethod ("return_enum2").Invoke (null, null).GetType () != typeof (Enum2))
return 2;
return 0;
}
public static int test_0_primitive_sharing () {
/* Check sharing of wrappers returning primitive types */
if (typeof (Tests).GetMethod ("return_long").Invoke (null, null).GetType () != typeof (long))
return 3;
if (typeof (Tests).GetMethod ("return_ulong").Invoke (null, null).GetType () != typeof (ulong))
return 4;
return 0;
}
public struct Foo
{
public string ToString2 () {
return "FOO";
}
}
public static object GetNSObject (IntPtr i) {
return i;
}
public static int test_0_vtype_method_sharing () {
/* Check sharing of wrappers of vtype methods with static methods having an IntPtr argument */
if ((string)(typeof (Foo).GetMethod ("ToString2").Invoke (new Foo (), null)) != "FOO")
return 3;
object o = typeof (Tests).GetMethod ("GetNSObject").Invoke (null, new object [] { new IntPtr (42) });
if (!(o is IntPtr) || ((IntPtr)o != new IntPtr (42)))
return 4;
return 0;
}
public static unsafe int test_0_ptr () {
int[] arr = new int [10];
fixed (void *p = &arr [5]) {
object o = typeof (Tests).GetMethod ("data_types_ptr").Invoke (null, new object [1] { new IntPtr (p) });
void *p2 = Pointer.Unbox (o);
if (new IntPtr (p) != new IntPtr (p2))
return 1;
o = typeof (Tests).GetMethod ("data_types_ptr").Invoke (null, new object [1] { null });
p2 = Pointer.Unbox (o);
if (new IntPtr (p2) != IntPtr.Zero)
return 1;
}
return 0;
}
public static int test_0_string_ctor () {
string res = (string)typeof (String).GetConstructor (new Type [] { typeof (char[]) }).Invoke (new object [] { new char [] { 'A', 'B', 'C' } });
if (res == "ABC")
return 0;
else
return 1;
}
public class Foo<T> {
public T t;
}
public static int test_0_ginst_ref () {
Foo<string> f = new Foo<string> { t = "A" };
Foo<string> f2 = (Foo<string>)typeof (Tests).GetMethod ("data_types_ginst_ref").MakeGenericMethod (new Type [] { typeof (string) }).Invoke (null, new object [] { f });
if (f2.t != "A")
return 1;
else
return 0;
}
public static int test_0_ginst_vtype () {
FooStruct<string> f = new FooStruct<string> { t = "A" };
FooStruct<string> f2 = (FooStruct<string>)typeof (Tests).GetMethod ("data_types_ginst_vtype").MakeGenericMethod (new Type [] { typeof (string) }).Invoke (null, new object [] { f });
if (f2.t != "A")
return 1;
else
return 0;
}
public static Foo<T> data_types_ginst_ref<T> (Foo<T> f) {
return f;
}
public struct FooStruct<T> {
public T t;
}
public static FooStruct<T> data_types_ginst_vtype<T> (FooStruct<T> f) {
return f;
}
public static unsafe int* data_types_ptr (int *val) {
//Console.WriteLine (new IntPtr (val));
return val;
}
}
| 22.736264 | 183 | 0.638956 | [
"Apache-2.0"
] | UCIS/mono | mono/tests/runtime-invoke.cs | 4,138 | C# |
/*
Copyright (c) 2018, Szymon Jakóbczyk, Paweł Płatek, Michał Mielus, Maciej Rajs, Minh Nhật Trịnh, Izabela Musztyfaga
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the [organization] nor the names of its contributors may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using System.IO;
/*
* Class used in LoadGameMapScene
*/
public class LoadGameMapSceneInit : MonoBehaviour
{
private GameApp gameApp;
private LevelLoader levelLoader;
void Start()
{
Debug.Log("LoadGameMapSceneInit");
gameApp = GameObject.Find("GameApp").GetComponent<GameApp>();
levelLoader = GameObject.Find("LevelLoader").GetComponent<LevelLoader>();
// find and put files to dropdown list
Dropdown mapToLoadDropdown = GameObject.Find("MenuCanvas/DropdownCanvas/GameToLoadDropdown").GetComponent<Dropdown>();
string[] foundFiles = Directory.GetFiles(gameApp.savedGamesPath, "*.json");
mapToLoadDropdown.ClearOptions();
foreach (string foundFile in foundFiles)
{
mapToLoadDropdown.options.Add(new Dropdown.OptionData() { text = Path.GetFileNameWithoutExtension(foundFile) });
}
mapToLoadDropdown.value = 0;
}
public void Back()
{
levelLoader.Back("MainMenuScene");
}
public void Next()
{
gameApp.PersistAllParameters("LoadGameMapScene");
levelLoader.LoadLevel("LoadGameScene");
}
}
| 43.666667 | 158 | 0.730049 | [
"Unlicense"
] | Playfloor/Galactromeda | Assets/Scripts/Menus/LoadGameMapSceneInit.cs | 2,890 | C# |
using System.Xml.Serialization;
namespace Kachuwa.Web
{
public enum VideoPurchaseOption
{
None,
[XmlEnum("rent")]
Rent,
[XmlEnum("own")]
Own
}
} | 13.866667 | 35 | 0.514423 | [
"MIT"
] | amritdumre10/Kachuwa | Core/Kachuwa.Web/SEO/Sitemap/VideoPurchaseOption.cs | 210 | 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 Microsoft.Store.PartnerCenter.CustomerPortal {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
public 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)]
public static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.Store.PartnerCenter.CustomerPortal.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)]
public static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to About.
/// </summary>
public static string About {
get {
return ResourceManager.GetString("About", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to I accept the terms and conditions.
/// </summary>
public static string AcceptTerms {
get {
return ResourceManager.GetString("AcceptTerms", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to You must accept the terms and conditions.
/// </summary>
public static string AcceptTermsValidationMessage {
get {
return ResourceManager.GetString("AcceptTermsValidationMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to You do not have the rights needed to access this area.
/// </summary>
public static string AccessDeniedMessage {
get {
return ResourceManager.GetString("AccessDeniedMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to - account.
/// </summary>
public static string AccountSuffix {
get {
return ResourceManager.GetString("AccountSuffix", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Active.
/// </summary>
public static string ActiveStatus {
get {
return ResourceManager.GetString("ActiveStatus", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Add.
/// </summary>
public static string AddCapital {
get {
return ResourceManager.GetString("AddCapital", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Add.
/// </summary>
public static string AddCaption {
get {
return ResourceManager.GetString("AddCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Adding subcriptions....
/// </summary>
public static string AddingSubscriptionMessage {
get {
return ResourceManager.GetString("AddingSubscriptionMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to add.
/// </summary>
public static string AddLink {
get {
return ResourceManager.GetString("AddLink", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Add a new offer.
/// </summary>
public static string AddOfferCaption {
get {
return ResourceManager.GetString("AddOfferCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Add offer features.
/// </summary>
public static string AddOfferFeaturesTooltip {
get {
return ResourceManager.GetString("AddOfferFeaturesTooltip", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Add offer feature after this.
/// </summary>
public static string AddOfferFeatureTooltip {
get {
return ResourceManager.GetString("AddOfferFeatureTooltip", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Add plan.
/// </summary>
public static string AddPlan {
get {
return ResourceManager.GetString("AddPlan", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Address.
/// </summary>
public static string Address {
get {
return ResourceManager.GetString("Address", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Add subscriptions.
/// </summary>
public static string AddSubscriptions {
get {
return ResourceManager.GetString("AddSubscriptions", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Add offer summary points.
/// </summary>
public static string AddSummaryPointsTooltip {
get {
return ResourceManager.GetString("AddSummaryPointsTooltip", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Add offer summary after this.
/// </summary>
public static string AddSummaryPointTooltip {
get {
return ResourceManager.GetString("AddSummaryPointTooltip", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Admin user account.
/// </summary>
public static string AdminUserAccount {
get {
return ResourceManager.GetString("AdminUserAccount", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Annual price.
/// </summary>
public static string AnnualPriceCaption {
get {
return ResourceManager.GetString("AnnualPriceCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Annual total.
/// </summary>
public static string AnnualTotalCaption {
get {
return ResourceManager.GetString("AnnualTotalCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Back.
/// </summary>
public static string Back {
get {
return ResourceManager.GetString("Back", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to There was an input error encountered. Please check the inputs and try again..
/// </summary>
public static string BadInputGenericMessage {
get {
return ResourceManager.GetString("BadInputGenericMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to based billing.
/// </summary>
public static string BillingTypeListRowCaption {
get {
return ResourceManager.GetString("BillingTypeListRowCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Could not retrieve partner branding.
/// </summary>
public static string BrandingRetrievalErrorMessage {
get {
return ResourceManager.GetString("BrandingRetrievalErrorMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Retrieving partner branding.
/// </summary>
public static string BrandingRetrievalProgressMessage {
get {
return ResourceManager.GetString("BrandingRetrievalProgressMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Click to configure your company's branding.
/// </summary>
public static string BrandingSectionTooltip {
get {
return ResourceManager.GetString("BrandingSectionTooltip", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Configure your web store.
/// </summary>
public static string BrandingSetupPromptMessage {
get {
return ResourceManager.GetString("BrandingSetupPromptMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Provide your Organization information that will be visible in the header and footer on all pages.
/// </summary>
public static string BrandingSetupSecondaryMessage {
get {
return ResourceManager.GetString("BrandingSetupSecondaryMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Could not save branding.
/// </summary>
public static string BrandingUpdateErrorMessage {
get {
return ResourceManager.GetString("BrandingUpdateErrorMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Updating branding information.
/// </summary>
public static string BrandingUpdateProgressMessage {
get {
return ResourceManager.GetString("BrandingUpdateProgressMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Branding saved. Click the reload button in the header bar to see your changes.
/// </summary>
public static string BrandingUpdateSuccessMessage {
get {
return ResourceManager.GetString("BrandingUpdateSuccessMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Buy more subscriptions.
/// </summary>
public static string BuyMoreSubscriptionsMessage {
get {
return ResourceManager.GetString("BuyMoreSubscriptionsMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Buy now.
/// </summary>
public static string BuyNow {
get {
return ResourceManager.GetString("BuyNow", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Cancel.
/// </summary>
public static string Cancel {
get {
return ResourceManager.GetString("Cancel", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to One or more offers you are trying to add already exists. You can add more licenses to existing subscriptions..
/// </summary>
public static string CannotAddExistingSubscriptionError {
get {
return ResourceManager.GetString("CannotAddExistingSubscriptionError", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to The card verfiication number check failed. Please enter a valid CVN..
/// </summary>
public static string CardCVNFailedError {
get {
return ResourceManager.GetString("CardCVNFailedError", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to The card has expired..
/// </summary>
public static string CardExpiredError {
get {
return ResourceManager.GetString("CardExpiredError", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to The card was refused..
/// </summary>
public static string CardRefusedError {
get {
return ResourceManager.GetString("CardRefusedError", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Category.
/// </summary>
public static string Category {
get {
return ResourceManager.GetString("Category", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Clear all.
/// </summary>
public static string ClearAll {
get {
return ResourceManager.GetString("ClearAll", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to ,.
/// </summary>
public static string Comma {
get {
return ResourceManager.GetString("Comma", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Added seats.
/// </summary>
public static string CommerceOperationTypeAddSeats {
get {
return ResourceManager.GetString("CommerceOperationTypeAddSeats", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Purchase.
/// </summary>
public static string CommerceOperationTypeAddSubscription {
get {
return ResourceManager.GetString("CommerceOperationTypeAddSubscription", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Renewal.
/// </summary>
public static string CommerceOperationTypeRenewSubscription {
get {
return ResourceManager.GetString("CommerceOperationTypeRenewSubscription", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Update your company information.
/// </summary>
public static string CompanyBrandingConfigurationCaption {
get {
return ResourceManager.GetString("CompanyBrandingConfigurationCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Company information.
/// </summary>
public static string CompanyInformation {
get {
return ResourceManager.GetString("CompanyInformation", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Company name.
/// </summary>
public static string CompanyName {
get {
return ResourceManager.GetString("CompanyName", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Configure your website.
/// </summary>
public static string ConfigurePortalMessage {
get {
return ResourceManager.GetString("ConfigurePortalMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Confirmation.
/// </summary>
public static string Confirmation {
get {
return ResourceManager.GetString("Confirmation", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Thank you! We have received your order. It may take a few minutes to process..
/// </summary>
public static string ConfirmationMessage {
get {
return ResourceManager.GetString("ConfirmationMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Customer information.
/// </summary>
public static string ContactInformation {
get {
return ResourceManager.GetString("ContactInformation", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Contact sales.
/// </summary>
public static string ContactSales {
get {
return ResourceManager.GetString("ContactSales", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Sales contact:.
/// </summary>
public static string ContactSalesHeader {
get {
return ResourceManager.GetString("ContactSalesHeader", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Shown in the Contact us section of the header.
/// </summary>
public static string ContactSalesSubText {
get {
return ResourceManager.GetString("ContactSalesSubText", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Contact us.
/// </summary>
public static string ContactUs {
get {
return ResourceManager.GetString("ContactUs", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Email:.
/// </summary>
public static string ContactUsEmailCaption {
get {
return ResourceManager.GetString("ContactUsEmailCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Support contact:.
/// </summary>
public static string ContactUsFieldHeader {
get {
return ResourceManager.GetString("ContactUsFieldHeader", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Phone:.
/// </summary>
public static string ContactUsPhoneCaption {
get {
return ResourceManager.GetString("ContactUsPhoneCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Shown in the Contact us section of the header.
/// </summary>
public static string ContactUsSubText {
get {
return ResourceManager.GetString("ContactUsSubText", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Display contact details.
/// </summary>
public static string ContactUsTooltip {
get {
return ResourceManager.GetString("ContactUsTooltip", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Copyright 2016.
/// </summary>
public static string CopyRight {
get {
return ResourceManager.GetString("CopyRight", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Could not retrieve your account. Please try again later..
/// </summary>
public static string CouldNotRetrieveCustomerAccount {
get {
return ResourceManager.GetString("CouldNotRetrieveCustomerAccount", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Could not retrieve offer details. Please try again later. .
/// </summary>
public static string CouldNotRetrieveOffer {
get {
return ResourceManager.GetString("CouldNotRetrieveOffer", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Could not retrieve offers.
/// </summary>
public static string CouldNotRetrievePartnerOffers {
get {
return ResourceManager.GetString("CouldNotRetrievePartnerOffers", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Could not retrieve your subscriptions. Please try again later..
/// </summary>
public static string CouldNotRetrieveSubscriptionsSummary {
get {
return ResourceManager.GetString("CouldNotRetrieveSubscriptionsSummary", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Amex.
/// </summary>
public static string CreditCardAmexCaption {
get {
return ResourceManager.GetString("CreditCardAmexCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Verification numer (CVN).
/// </summary>
public static string CreditCardCVNCaption {
get {
return ResourceManager.GetString("CreditCardCVNCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Discover.
/// </summary>
public static string CreditCardDiscoverCaption {
get {
return ResourceManager.GetString("CreditCardDiscoverCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Expriration date.
/// </summary>
public static string CreditCardExpirationDateCaption {
get {
return ResourceManager.GetString("CreditCardExpirationDateCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to First name on card.
/// </summary>
public static string CreditCardFirstNameCaption {
get {
return ResourceManager.GetString("CreditCardFirstNameCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Credit Card Information.
/// </summary>
public static string CreditCardInfoCaption {
get {
return ResourceManager.GetString("CreditCardInfoCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Last name on card.
/// </summary>
public static string CreditCardLastNameCaption {
get {
return ResourceManager.GetString("CreditCardLastNameCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Master Card.
/// </summary>
public static string CreditCardMasterCaption {
get {
return ResourceManager.GetString("CreditCardMasterCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Not supported.
/// </summary>
public static string CreditCardNotSupportedCaption {
get {
return ResourceManager.GetString("CreditCardNotSupportedCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Card number.
/// </summary>
public static string CreditCardNumberCaption {
get {
return ResourceManager.GetString("CreditCardNumberCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Credit card type.
/// </summary>
public static string CreditCardTypeCaption {
get {
return ResourceManager.GetString("CreditCardTypeCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Visa.
/// </summary>
public static string CreditCardVisaCaption {
get {
return ResourceManager.GetString("CreditCardVisaCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Creating order for your registration....
/// </summary>
public static string CustomerOrderRegistrationMessage {
get {
return ResourceManager.GetString("CustomerOrderRegistrationMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Organization name.
/// </summary>
public static string CustomerOrganizationNameCaption {
get {
return ResourceManager.GetString("CustomerOrganizationNameCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Primary contact.
/// </summary>
public static string CustomerPrimaryContactCaption {
get {
return ResourceManager.GetString("CustomerPrimaryContactCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Address line 1.
/// </summary>
public static string CustomerProfileAddressLine1Caption {
get {
return ResourceManager.GetString("CustomerProfileAddressLine1Caption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Address line 2.
/// </summary>
public static string CustomerProfileAddressLine2Caption {
get {
return ResourceManager.GetString("CustomerProfileAddressLine2Caption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to City.
/// </summary>
public static string CustomerProfileCityCaption {
get {
return ResourceManager.GetString("CustomerProfileCityCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Country.
/// </summary>
public static string CustomerProfileCompanyCountryCaption {
get {
return ResourceManager.GetString("CustomerProfileCompanyCountryCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Company Information.
/// </summary>
public static string CustomerProfileCompanyInfoSectionCaption {
get {
return ResourceManager.GetString("CustomerProfileCompanyInfoSectionCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Company Name.
/// </summary>
public static string CustomerProfileCompanyNameCaption {
get {
return ResourceManager.GetString("CustomerProfileCompanyNameCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Contact Information.
/// </summary>
public static string CustomerProfileContactInfoSectionCaption {
get {
return ResourceManager.GetString("CustomerProfileContactInfoSectionCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Your domain prefix will appear after the @ in your domain email address. It has to be unique and it can't contain any punctuations. Example: 'yourcompany'..
/// </summary>
public static string CustomerProfileDomainInfoCaption {
get {
return ResourceManager.GetString("CustomerProfileDomainInfoCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Domain prefix.
/// </summary>
public static string CustomerProfileDomainPrefixCaption {
get {
return ResourceManager.GetString("CustomerProfileDomainPrefixCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Email address.
/// </summary>
public static string CustomerProfileEmailAddressIdCaption {
get {
return ResourceManager.GetString("CustomerProfileEmailAddressIdCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Make sure you enter a valid email address. It will be the main point of contact to send you important information to get you started and to set up your payment data..
/// </summary>
public static string CustomerProfileEmailWarningCaption {
get {
return ResourceManager.GetString("CustomerProfileEmailWarningCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to First name.
/// </summary>
public static string CustomerProfileFirstNameCaption {
get {
return ResourceManager.GetString("CustomerProfileFirstNameCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Last name.
/// </summary>
public static string CustomerProfileLastNameCaption {
get {
return ResourceManager.GetString("CustomerProfileLastNameCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to This will be the user id you'll use with your Office 365 account..
/// </summary>
public static string CustomerProfileOffice365EmailCaption {
get {
return ResourceManager.GetString("CustomerProfileOffice365EmailCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Office 365.
/// </summary>
public static string CustomerProfileOffice365SectionCaption {
get {
return ResourceManager.GetString("CustomerProfileOffice365SectionCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Username.
/// </summary>
public static string CustomerProfileOffice365UserNameCaption {
get {
return ResourceManager.GetString("CustomerProfileOffice365UserNameCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Password.
/// </summary>
public static string CustomerProfilePasswordCaption {
get {
return ResourceManager.GetString("CustomerProfilePasswordCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Phone number.
/// </summary>
public static string CustomerProfilePhoneNumberCaption {
get {
return ResourceManager.GetString("CustomerProfilePhoneNumberCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Re-enter password.
/// </summary>
public static string CustomerProfileReEnterPasswordCaption {
get {
return ResourceManager.GetString("CustomerProfileReEnterPasswordCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to State/Province.
/// </summary>
public static string CustomerProfileStateCaption {
get {
return ResourceManager.GetString("CustomerProfileStateCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Zip / Postal code.
/// </summary>
public static string CustomerProfileZipPostalCaption {
get {
return ResourceManager.GetString("CustomerProfileZipPostalCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Could not register the customer. Please try later..
/// </summary>
public static string CustomerRegistrationFailureMessage {
get {
return ResourceManager.GetString("CustomerRegistrationFailureMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Registering and Creating order....
/// </summary>
public static string CustomerRegistrationMessage {
get {
return ResourceManager.GetString("CustomerRegistrationMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Successfully created customer.
/// </summary>
public static string CustomerRegistrationSuccessMessage {
get {
return ResourceManager.GetString("CustomerRegistrationSuccessMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Customization.
/// </summary>
public static string Customization {
get {
return ResourceManager.GetString("Customization", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Customization.
/// </summary>
public static string CustomizationOfferListColumnCaption {
get {
return ResourceManager.GetString("CustomizationOfferListColumnCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Please enter a valid CVN.
/// </summary>
public static string CvnValidationMessage {
get {
return ResourceManager.GetString("CvnValidationMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to -.
/// </summary>
public static string Dash {
get {
return ResourceManager.GetString("Dash", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Building your dashboard.
/// </summary>
public static string DashboardBuildingProgressMessage {
get {
return ResourceManager.GetString("DashboardBuildingProgressMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Configured.
/// </summary>
public static string DashboardItemConfigured {
get {
return ResourceManager.GetString("DashboardItemConfigured", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Needs configuration.
/// </summary>
public static string DashboardItemNeedsConfiguration {
get {
return ResourceManager.GetString("DashboardItemNeedsConfiguration", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Could not retrieve the dashboard information.
/// </summary>
public static string DashboardLoadingError {
get {
return ResourceManager.GetString("DashboardLoadingError", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Personalize your site before you start selling.
/// </summary>
public static string DashboardStatusNotOk {
get {
return ResourceManager.GetString("DashboardStatusNotOk", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to You are good to to go and start selling!.
/// </summary>
public static string DashboardStatusOk {
get {
return ResourceManager.GetString("DashboardStatusOk", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Your Organization Name.
/// </summary>
public static string DefaultOrganizationName {
get {
return ResourceManager.GetString("DefaultOrganizationName", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Delete.
/// </summary>
public static string Delete {
get {
return ResourceManager.GetString("Delete", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Delete Offer(s).
/// </summary>
public static string DeleteOffersCaption {
get {
return ResourceManager.GetString("DeleteOffersCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Are you sure you want to delete the selected offers? If your customers have already purchased these offers, the purchased subscriptions will still be honored but will not be renewable..
/// </summary>
public static string DeleteOffersPromptMessage {
get {
return ResourceManager.GetString("DeleteOffersPromptMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Deleting offers.
/// </summary>
public static string DeletingOfferMessage {
get {
return ResourceManager.GetString("DeletingOfferMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Description.
/// </summary>
public static string Description {
get {
return ResourceManager.GetString("Description", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Features:.
/// </summary>
public static string DetailedFeaturesCaption {
get {
return ResourceManager.GetString("DetailedFeaturesCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to The domain is not available. Please enter another domain prefix.
/// </summary>
public static string DomainNotAvailable {
get {
return ResourceManager.GetString("DomainNotAvailable", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Please enter a valid domain prefix.
/// </summary>
public static string DomainPrefixValidationMessage {
get {
return ResourceManager.GetString("DomainPrefixValidationMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Done.
/// </summary>
public static string Done {
get {
return ResourceManager.GetString("Done", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to We are unable to process your request at this time. Please try later or contact us over email. Error Details - .
/// </summary>
public static string DownstreamErrorPrefix {
get {
return ResourceManager.GetString("DownstreamErrorPrefix", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to ....
/// </summary>
public static string Ellipsis {
get {
return ResourceManager.GetString("Ellipsis", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Please add a subscription.
/// </summary>
public static string EmptyListCaption {
get {
return ResourceManager.GetString("EmptyListCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to No entities found.
/// </summary>
public static string EmptyListMessage {
get {
return ResourceManager.GetString("EmptyListMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to There are no Microsoft offers to choose from.
/// </summary>
public static string EmptyMicrosoftOfferListMessage {
get {
return ResourceManager.GetString("EmptyMicrosoftOfferListMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to You do not have any offers configured. Click Add Offer above to start adding your offers..
/// </summary>
public static string EmptyOfferListMessage {
get {
return ResourceManager.GetString("EmptyOfferListMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to You must select at least one offer to purchase..
/// </summary>
public static string EmptyOffersErrorMessage {
get {
return ResourceManager.GetString("EmptyOffersErrorMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Could not get portal content.
/// </summary>
public static string FailedToLoadPortal {
get {
return ResourceManager.GetString("FailedToLoadPortal", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Features:.
/// </summary>
public static string FeaturesListRowCaption {
get {
return ResourceManager.GetString("FeaturesListRowCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Could not retrieve payment information.
/// </summary>
public static string FetchPaymentConfigurationErrorMessage {
get {
return ResourceManager.GetString("FetchPaymentConfigurationErrorMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Retrieving payment information.
/// </summary>
public static string FetchPaymentConfigurationProgressMessage {
get {
return ResourceManager.GetString("FetchPaymentConfigurationProgressMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to First.
/// </summary>
public static string First {
get {
return ResourceManager.GetString("First", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Header Image:.
/// </summary>
public static string HeaderImageFieldHeader {
get {
return ResourceManager.GetString("HeaderImageFieldHeader", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Shown at the top of the home page. (.jpg, .jpeg, .img, .gif). Upload a file or enter a valid image URL.
/// </summary>
public static string HeaderImageSubText {
get {
return ResourceManager.GetString("HeaderImageSubText", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Select Header image file from your computer.
/// </summary>
public static string HeaderImageUploadTooltip {
get {
return ResourceManager.GetString("HeaderImageUploadTooltip", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Help.
/// </summary>
public static string Help {
get {
return ResourceManager.GetString("Help", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Home page.
/// </summary>
public static string HomePage {
get {
return ResourceManager.GetString("HomePage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to The selected images are too large. Please specify smaller images or upload one by one.
/// </summary>
public static string ImagesTooLarge {
get {
return ResourceManager.GetString("ImagesTooLarge", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Please specify a valid address.
/// </summary>
public static string InvalidAddress {
get {
return ResourceManager.GetString("InvalidAddress", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Please enter a valid contact sales phone.
/// </summary>
public static string InvalidContactSalesPhone {
get {
return ResourceManager.GetString("InvalidContactSalesPhone", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Please enter a valid contact support phone.
/// </summary>
public static string InvalidContactUsPhone {
get {
return ResourceManager.GetString("InvalidContactUsPhone", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Customer Id is invalid..
/// </summary>
public static string InvalidCustomerIdErrorMessage {
get {
return ResourceManager.GetString("InvalidCustomerIdErrorMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Please select a valid image file to upload.
/// </summary>
public static string InvalidFileType {
get {
return ResourceManager.GetString("InvalidFileType", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Invalid header image Uri. Please make sure the Uri is valid..
/// </summary>
public static string InvalidHeaderImageUri {
get {
return ResourceManager.GetString("InvalidHeaderImageUri", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to There was a problem in one of the fields you entered: .
/// </summary>
public static string InvalidInput {
get {
return ResourceManager.GetString("InvalidInput", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Please correct the invalid input :.
/// </summary>
public static string InvalidInputErrorPrefix {
get {
return ResourceManager.GetString("InvalidInputErrorPrefix", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to One or more fields are invalid. Please correct them and then submit..
/// </summary>
public static string InvalidInputInFormCaption {
get {
return ResourceManager.GetString("InvalidInputInFormCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Invalid organization logo Uri. Please make sure the Uri is valid..
/// </summary>
public static string InvalidOrganizationLogoUri {
get {
return ResourceManager.GetString("InvalidOrganizationLogoUri", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Portal configuration seems to be invalid.
/// </summary>
public static string InvalidPortalConfiguration {
get {
return ResourceManager.GetString("InvalidPortalConfiguration", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Invalid privacy Uri. Please make sure the Uri is valid..
/// </summary>
public static string InvalidPrivacyAgreementUri {
get {
return ResourceManager.GetString("InvalidPrivacyAgreementUri", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Language.
/// </summary>
public static string Language {
get {
return ResourceManager.GetString("Language", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Last.
/// </summary>
public static string Last {
get {
return ResourceManager.GetString("Last", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Learn more.
/// </summary>
public static string LearnMore {
get {
return ResourceManager.GetString("LearnMore", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to License.
/// </summary>
public static string LicenseCaption {
get {
return ResourceManager.GetString("LicenseCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to License:.
/// </summary>
public static string LicenseHeader {
get {
return ResourceManager.GetString("LicenseHeader", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Paypal live account.
/// </summary>
public static string LiveAccountTypeCaption {
get {
return ResourceManager.GetString("LiveAccountTypeCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Loading.
/// </summary>
public static string Loading {
get {
return ResourceManager.GetString("Loading", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Login.
/// </summary>
public static string Login {
get {
return ResourceManager.GetString("Login", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Microsoft ID.
/// </summary>
public static string MicrosoftId {
get {
return ResourceManager.GetString("MicrosoftId", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Microsoft Offering.
/// </summary>
public static string MicrosoftOfferListColumnCaption {
get {
return ResourceManager.GetString("MicrosoftOfferListColumnCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Could not retrieve Microsoft offers.
/// </summary>
public static string MicrosoftOfferRetrievalErrorMessage {
get {
return ResourceManager.GetString("MicrosoftOfferRetrievalErrorMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Fees per month.
/// </summary>
public static string MonthlyFee {
get {
return ResourceManager.GetString("MonthlyFee", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Price per month.
/// </summary>
public static string MonthlyPrice {
get {
return ResourceManager.GetString("MonthlyPrice", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to per user/month.
/// </summary>
public static string MonthPerUser {
get {
return ResourceManager.GetString("MonthPerUser", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to More actions....
/// </summary>
public static string MoreActionsTooltip {
get {
return ResourceManager.GetString("MoreActionsTooltip", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Only one subcription can be updated..
/// </summary>
public static string MoreThanOneSubscriptionUpdateErrorMessage {
get {
return ResourceManager.GetString("MoreThanOneSubscriptionUpdateErrorMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to MOST POPULAR.
/// </summary>
public static string MostPopular {
get {
return ResourceManager.GetString("MostPopular", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Go back to: .
/// </summary>
public static string NavigateBackTo {
get {
return ResourceManager.GetString("NavigateBackTo", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Next.
/// </summary>
public static string Next {
get {
return ResourceManager.GetString("Next", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to No.
/// </summary>
public static string No {
get {
return ResourceManager.GetString("No", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Partner non admins are not authorized to sign in..
/// </summary>
public static string NonAdminUnauthorizedMessage {
get {
return ResourceManager.GetString("NonAdminUnauthorizedMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Active notifications.
/// </summary>
public static string NotificationSectionTooltip {
get {
return ResourceManager.GetString("NotificationSectionTooltip", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to new notifications.
/// </summary>
public static string NotificationsSummary {
get {
return ResourceManager.GetString("NotificationsSummary", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Offer.
/// </summary>
public static string Offer {
get {
return ResourceManager.GetString("Offer", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Automatically renewable.
/// </summary>
public static string OfferAutomaticallyRenewable {
get {
return ResourceManager.GetString("OfferAutomaticallyRenewable", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Available for purchase.
/// </summary>
public static string OfferAvailableForPurchase {
get {
return ResourceManager.GetString("OfferAvailableForPurchase", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Offers have been deleted.
/// </summary>
public static string OfferDeletionConfirmation {
get {
return ResourceManager.GetString("OfferDeletionConfirmation", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Could not delete the offer(s).
/// </summary>
public static string OfferDeletionFailure {
get {
return ResourceManager.GetString("OfferDeletionFailure", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Describe a feature this offers gives.
/// </summary>
public static string OfferFeaturePlaceHolder {
get {
return ResourceManager.GetString("OfferFeaturePlaceHolder", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Example: $100 Per Year.
/// </summary>
public static string OfferLicensePlaceHolder {
get {
return ResourceManager.GetString("OfferLicensePlaceHolder", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Manually renewable.
/// </summary>
public static string OfferManuallyRenewable {
get {
return ResourceManager.GetString("OfferManuallyRenewable", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Could not save the offer.
/// </summary>
public static string OfferSaveErrorMessage {
get {
return ResourceManager.GetString("OfferSaveErrorMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Offer successfully saved!.
/// </summary>
public static string OfferSaveSuccessMessage {
get {
return ResourceManager.GetString("OfferSaveSuccessMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Choose which offers to sell.
/// </summary>
public static string OffersConfigurationCaption {
get {
return ResourceManager.GetString("OffersConfigurationCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Could not retrieve the offers.
/// </summary>
public static string OffersFetchFailure {
get {
return ResourceManager.GetString("OffersFetchFailure", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Retrieving offers.
/// </summary>
public static string OffersFetchProgress {
get {
return ResourceManager.GetString("OffersFetchProgress", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Click to configure your offers.
/// </summary>
public static string OffersSectionTooltip {
get {
return ResourceManager.GetString("OffersSectionTooltip", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Write an offer summary.
/// </summary>
public static string OfferSummaryPlaceHolder {
get {
return ResourceManager.GetString("OfferSummaryPlaceHolder", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Unavailable for purchase.
/// </summary>
public static string OfferUnavailableForPurchase {
get {
return ResourceManager.GetString("OfferUnavailableForPurchase", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to OK.
/// </summary>
public static string OK {
get {
return ResourceManager.GetString("OK", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Error during adding subscriptions. .
/// </summary>
public static string OrderAddFailureMessage {
get {
return ResourceManager.GetString("OrderAddFailureMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Order Registration Error.
/// </summary>
public static string OrderRegistrationFailureMessage {
get {
return ResourceManager.GetString("OrderRegistrationFailureMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Order Update Error.
/// </summary>
public static string OrderUpdateFailureMessage {
get {
return ResourceManager.GetString("OrderUpdateFailureMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Logo:.
/// </summary>
public static string OrganizationLogoFieldHeader {
get {
return ResourceManager.GetString("OrganizationLogoFieldHeader", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Shown in the header of every page, images of size 32 by 32 work best. Upload a file or enter a valid image URL.
/// </summary>
public static string OrganizationLogoSubText {
get {
return ResourceManager.GetString("OrganizationLogoSubText", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Select Organization logo image file from your computer.
/// </summary>
public static string OrganizationLogoUploadTooltip {
get {
return ResourceManager.GetString("OrganizationLogoUploadTooltip", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Name:.
/// </summary>
public static string OrganizationNameFieldHeader {
get {
return ResourceManager.GetString("OrganizationNameFieldHeader", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Your company’s legal name, shown on the header of every page.
/// </summary>
public static string OrganizationNameFieldSubText {
get {
return ResourceManager.GetString("OrganizationNameFieldSubText", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Other settings.
/// </summary>
public static string OtherSettingsConfigurationCaption {
get {
return ResourceManager.GetString("OtherSettingsConfigurationCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Click to configure other settings.
/// </summary>
public static string OtherSettingsSectionTooltip {
get {
return ResourceManager.GetString("OtherSettingsSectionTooltip", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Password.
/// </summary>
public static string PasswordLabel {
get {
return ResourceManager.GetString("PasswordLabel", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Add a payment method.
/// </summary>
public static string PaymentConfigurationCaption {
get {
return ResourceManager.GetString("PaymentConfigurationCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Provide your PayPal Pro account settings.
/// </summary>
public static string PaymentConfigurationHeader {
get {
return ResourceManager.GetString("PaymentConfigurationHeader", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to to create a new pro account if you do not have one..
/// </summary>
public static string PaymentConfigurationSubTextPostfix {
get {
return ResourceManager.GetString("PaymentConfigurationSubTextPostfix", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to To receive payments from your customers, you should use a PayPal pro account, please visit:.
/// </summary>
public static string PaymentConfigurationSubTextPrefix {
get {
return ResourceManager.GetString("PaymentConfigurationSubTextPrefix", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to We are unable to process your payment – .
/// </summary>
public static string PaymentGatewayErrorPrefix {
get {
return ResourceManager.GetString("PaymentGatewayErrorPrefix", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Payment configuration is invalid..
/// </summary>
public static string PaymentGatewayIdentityFailureDuringConfiguration {
get {
return ResourceManager.GetString("PaymentGatewayIdentityFailureDuringConfiguration", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Your payment cannot be processed at this time. Please contact us by email. .
/// </summary>
public static string PaymentGatewayIdentityFailureDuringPayment {
get {
return ResourceManager.GetString("PaymentGatewayIdentityFailureDuringPayment", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Click to configure your payment options.
/// </summary>
public static string PaymentSectionTooltip {
get {
return ResourceManager.GetString("PaymentSectionTooltip", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to PayPal account type:.
/// </summary>
public static string PayPalAccountTypeCaption {
get {
return ResourceManager.GetString("PayPalAccountTypeCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to You can select a test account type to test your transactions. Once working, you can switch to a live account type to start transacting.
/// </summary>
public static string PayPalAccountTypeSubText {
get {
return ResourceManager.GetString("PayPalAccountTypeSubText", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to PayPal Client ID:.
/// </summary>
public static string PayPalClientIdCaption {
get {
return ResourceManager.GetString("PayPalClientIdCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Enter your PayPal client ID.
/// </summary>
public static string PayPalClientIdSubText {
get {
return ResourceManager.GetString("PayPalClientIdSubText", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to PayPal Client Secret:.
/// </summary>
public static string PayPalClientSecretCaption {
get {
return ResourceManager.GetString("PayPalClientSecretCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Enter your PayPal client secret.
/// </summary>
public static string PayPalClientSecretSubText {
get {
return ResourceManager.GetString("PayPalClientSecretSubText", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Paypal.com.
/// </summary>
public static string PayPalWebsiteCaption {
get {
return ResourceManager.GetString("PayPalWebsiteCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Phone number.
/// </summary>
public static string PhoneHeader {
get {
return ResourceManager.GetString("PhoneHeader", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Please enter a valid phone number.
/// </summary>
public static string PhoneValidationMessage {
get {
return ResourceManager.GetString("PhoneValidationMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Pick your Offer.
/// </summary>
public static string PickOffer {
get {
return ResourceManager.GetString("PickOffer", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Pick Offer.
/// </summary>
public static string PickOfferCaption {
get {
return ResourceManager.GetString("PickOfferCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Pick the offer you would like to sell.
/// </summary>
public static string PickOfferTooltip {
get {
return ResourceManager.GetString("PickOfferTooltip", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Place your order.
/// </summary>
public static string PlaceOrderCaption {
get {
return ResourceManager.GetString("PlaceOrderCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Portal configuation could not be found.
/// </summary>
public static string PortalConfigurationNotFound {
get {
return ResourceManager.GetString("PortalConfigurationNotFound", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to This website is still under construction. Please visit later..
/// </summary>
public static string PortalNotConfiguredYet {
get {
return ResourceManager.GetString("PortalNotConfiguredYet", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Could not startup the portal.
/// </summary>
public static string PortalStartupFailure {
get {
return ResourceManager.GetString("PortalStartupFailure", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Powered by Microsoft WebPortal.Net.
/// </summary>
public static string PoweredBy {
get {
return ResourceManager.GetString("PoweredBy", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Price:.
/// </summary>
public static string PriceHeader {
get {
return ResourceManager.GetString("PriceHeader", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Privacy.
/// </summary>
public static string PrivacyAgreement {
get {
return ResourceManager.GetString("PrivacyAgreement", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Privacy link:.
/// </summary>
public static string PrivacyAgreementFieldHeader {
get {
return ResourceManager.GetString("PrivacyAgreementFieldHeader", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to You can specify a link that shows privacy terms to your customers here which will show up in the home page footer.
/// </summary>
public static string PrivacyAgreementFieldSubText {
get {
return ResourceManager.GetString("PrivacyAgreementFieldSubText", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to View this website's privacy terms.
/// </summary>
public static string PrivacyAgreementToolTip {
get {
return ResourceManager.GetString("PrivacyAgreementToolTip", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Sample Corporation.
/// </summary>
public static string ProductTitle {
get {
return ResourceManager.GetString("ProductTitle", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Pro-rated.
/// </summary>
public static string ProratedPaymentTotal {
get {
return ResourceManager.GetString("ProratedPaymentTotal", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Quantity.
/// </summary>
public static string Quantity {
get {
return ResourceManager.GetString("Quantity", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Amount paid on {CurrentDate}.
/// </summary>
public static string RegistrationConfirmAmountPaidOnCaption {
get {
return ResourceManager.GetString("RegistrationConfirmAmountPaidOnCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Annual commitment expires on {currentDate + 365}.
/// </summary>
public static string RegistrationConfirmAnnualCommitmentCaption {
get {
return ResourceManager.GetString("RegistrationConfirmAnnualCommitmentCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Please copy the Admin user account and Password and save in a secure location. You won’t be able to retrieve it after you leave this page..
/// </summary>
public static string RegistrationConfirmationPasswordNoticeCaption {
get {
return ResourceManager.GetString("RegistrationConfirmationPasswordNoticeCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Reload portal.
/// </summary>
public static string ReloadPortalButtonCaption {
get {
return ResourceManager.GetString("ReloadPortalButtonCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Reload the portal to see your changes.
/// </summary>
public static string ReloadPortalButtonTooltip {
get {
return ResourceManager.GetString("ReloadPortalButtonTooltip", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Remember Me.
/// </summary>
public static string RememberMe {
get {
return ResourceManager.GetString("RememberMe", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Remove from cart.
/// </summary>
public static string RemoveFromCart {
get {
return ResourceManager.GetString("RemoveFromCart", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Remove offer feature.
/// </summary>
public static string RemoveOfferFeatureTooltip {
get {
return ResourceManager.GetString("RemoveOfferFeatureTooltip", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Remove offer summary.
/// </summary>
public static string RemoveSummaryPointTooltip {
get {
return ResourceManager.GetString("RemoveSummaryPointTooltip", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Renew subscription.
/// </summary>
public static string RenewSubscriptionTitleCaption {
get {
return ResourceManager.GetString("RenewSubscriptionTitleCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to retry.
/// </summary>
public static string Retry {
get {
return ResourceManager.GetString("Retry", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Retry.
/// </summary>
public static string RetryCapital {
get {
return ResourceManager.GetString("RetryCapital", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Sales email.
/// </summary>
public static string SalesEmailAddressHeader {
get {
return ResourceManager.GetString("SalesEmailAddressHeader", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Paypal sandbox account.
/// </summary>
public static string SandboxAccountTypeCaption {
get {
return ResourceManager.GetString("SandboxAccountTypeCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Save.
/// </summary>
public static string Save {
get {
return ResourceManager.GetString("Save", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Save offer.
/// </summary>
public static string SaveOfferCaption {
get {
return ResourceManager.GetString("SaveOfferCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Saving offer.
/// </summary>
public static string SavingOfferMessage {
get {
return ResourceManager.GetString("SavingOfferMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to seats.
/// </summary>
public static string Seats {
get {
return ResourceManager.GetString("Seats", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Select a Microsoft offer:.
/// </summary>
public static string SelectMicrosoftOfferCaption {
get {
return ResourceManager.GetString("SelectMicrosoftOfferCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Please select an offer.
/// </summary>
public static string SelectOfferErrorMessage {
get {
return ResourceManager.GetString("SelectOfferErrorMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Select one or more offers.
/// </summary>
public static string SelectPortalOfferCaption {
get {
return ResourceManager.GetString("SelectPortalOfferCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Details.
/// </summary>
public static string SetupInformation {
get {
return ResourceManager.GetString("SetupInformation", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Sign out.
/// </summary>
public static string Signout {
get {
return ResourceManager.GetString("Signout", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Status.
/// </summary>
public static string Status {
get {
return ResourceManager.GetString("Status", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Submit.
/// </summary>
public static string Submit {
get {
return ResourceManager.GetString("Submit", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Subscripiton alias.
/// </summary>
public static string SubscripitonAlias {
get {
return ResourceManager.GetString("SubscripitonAlias", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Subscription.
/// </summary>
public static string Subscription {
get {
return ResourceManager.GetString("Subscription", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Subscription ID:.
/// </summary>
public static string SubscriptionIDLabel {
get {
return ResourceManager.GetString("SubscriptionIDLabel", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Subscriptions.
/// </summary>
public static string Subscriptions {
get {
return ResourceManager.GetString("Subscriptions", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Amount paid on.
/// </summary>
public static string SubscriptionSummaryAmountPaidOnPrefixCaption {
get {
return ResourceManager.GetString("SubscriptionSummaryAmountPaidOnPrefixCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to expires on.
/// </summary>
public static string SubscriptionSummaryAnnualCommitmentExpiryCaption {
get {
return ResourceManager.GetString("SubscriptionSummaryAnnualCommitmentExpiryCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Annual commitment expires on.
/// </summary>
public static string SubscriptionSummaryAnnualCommitmentExpiryPrefixCaption {
get {
return ResourceManager.GetString("SubscriptionSummaryAnnualCommitmentExpiryPrefixCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Price Paid.
/// </summary>
public static string SubscriptionSummaryAnnualPricePrefixCaption {
get {
return ResourceManager.GetString("SubscriptionSummaryAnnualPricePrefixCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Price paid is displayed pro-rated as applicable. .
/// </summary>
public static string SubscriptionSummaryProratepriceCaption {
get {
return ResourceManager.GetString("SubscriptionSummaryProratepriceCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Rate.
/// </summary>
public static string SubscriptionSummaryRateCaption {
get {
return ResourceManager.GetString("SubscriptionSummaryRateCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Renew.
/// </summary>
public static string SubscriptionSummaryRenewLinkCaption {
get {
return ResourceManager.GetString("SubscriptionSummaryRenewLinkCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Add more licenses.
/// </summary>
public static string SubscriptionSummaryUpdateLinkCaption {
get {
return ResourceManager.GetString("SubscriptionSummaryUpdateLinkCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Summary:.
/// </summary>
public static string SummaryCaption {
get {
return ResourceManager.GetString("SummaryCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Summary:.
/// </summary>
public static string SummaryListRowCaption {
get {
return ResourceManager.GetString("SummaryListRowCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Support.
/// </summary>
public static string Support {
get {
return ResourceManager.GetString("Support", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Support email.
/// </summary>
public static string SupportEmailAddressHeader {
get {
return ResourceManager.GetString("SupportEmailAddressHeader", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Suspended.
/// </summary>
public static string SuspendedStatus {
get {
return ResourceManager.GetString("SuspendedStatus", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Could not get the feature content.
/// </summary>
public static string TemplateLoadFailureMessage {
get {
return ResourceManager.GetString("TemplateLoadFailureMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Getting feature content.
/// </summary>
public static string TemplateLoadRetryMessage {
get {
return ResourceManager.GetString("TemplateLoadRetryMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to to .
/// </summary>
public static string To {
get {
return ResourceManager.GetString("To", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Total.
/// </summary>
public static string Total {
get {
return ResourceManager.GetString("Total", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Total Amount.
/// </summary>
public static string TotalAmountCaption {
get {
return ResourceManager.GetString("TotalAmountCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Undo.
/// </summary>
public static string Undo {
get {
return ResourceManager.GetString("Undo", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Undo local branding changes.
/// </summary>
public static string UndoBrandingChangesTooltip {
get {
return ResourceManager.GetString("UndoBrandingChangesTooltip", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Undo unsaved payment changes.
/// </summary>
public static string UndoUnsavedChanges {
get {
return ResourceManager.GetString("UndoUnsavedChanges", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to -Unpaid.
/// </summary>
public static string UnpaidSubscriptionSuffix {
get {
return ResourceManager.GetString("UnpaidSubscriptionSuffix", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Update.
/// </summary>
public static string Update {
get {
return ResourceManager.GetString("Update", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Could not save payment information.
/// </summary>
public static string UpdatePaymentErrorMessage {
get {
return ResourceManager.GetString("UpdatePaymentErrorMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Updating payment information.
/// </summary>
public static string UpdatePaymentProgressMessage {
get {
return ResourceManager.GetString("UpdatePaymentProgressMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Payment information updated.
/// </summary>
public static string UpdatePaymentSuccessMessage {
get {
return ResourceManager.GetString("UpdatePaymentSuccessMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Add more licenses.
/// </summary>
public static string UpdateSubscriptions {
get {
return ResourceManager.GetString("UpdateSubscriptions", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Updating offer.
/// </summary>
public static string UpdatingOfferMessage {
get {
return ResourceManager.GetString("UpdatingOfferMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Updating subscriptions....
/// </summary>
public static string UpdatingSubscriptionMessage {
get {
return ResourceManager.GetString("UpdatingSubscriptionMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Please use an alternate card..
/// </summary>
public static string UseAlternateCardMessage {
get {
return ResourceManager.GetString("UseAlternateCardMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Licenses.
/// </summary>
public static string UserLicencesCaption {
get {
return ResourceManager.GetString("UserLicencesCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to User name.
/// </summary>
public static string UserName {
get {
return ResourceManager.GetString("UserName", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to User name:.
/// </summary>
public static string UserNameLabel {
get {
return ResourceManager.GetString("UserNameLabel", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to user/year.
/// </summary>
public static string UserPerYear {
get {
return ResourceManager.GetString("UserPerYear", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to View tiles.
/// </summary>
public static string ViewTilesTooltip {
get {
return ResourceManager.GetString("ViewTilesTooltip", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Welcome.
/// </summary>
public static string WelcomeCaptionPrefix {
get {
return ResourceManager.GetString("WelcomeCaptionPrefix", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to to your Web Store Builder!.
/// </summary>
public static string WelcomeCaptionSuffix {
get {
return ResourceManager.GetString("WelcomeCaptionSuffix", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Yes.
/// </summary>
public static string Yes {
get {
return ResourceManager.GetString("Yes", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Annual price:.
/// </summary>
public static string YourAnnualPriceCaption {
get {
return ResourceManager.GetString("YourAnnualPriceCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Offer subtitle:.
/// </summary>
public static string YourOfferingSubtitleCaption {
get {
return ResourceManager.GetString("YourOfferingSubtitleCaption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Offer name:.
/// </summary>
public static string YourOfferingTitleCaption {
get {
return ResourceManager.GetString("YourOfferingTitleCaption", resourceCulture);
}
}
}
}
| 36.046046 | 238 | 0.549922 | [
"MIT"
] | vasokkumar/redstore | Source/PartnerCenter.CustomerPortal/Resources.Designer.cs | 102,559 | C# |
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using UnityEngine;
using KSP;
using KSPPluginFramework;
namespace KerbalAlarmClock
{
public class KACAlarm:ConfigNodeStorage
{
public enum AlarmTypeEnum
{
Raw,
Maneuver,
ManeuverAuto,
Apoapsis,
Periapsis,
AscendingNode,
DescendingNode,
LaunchRendevous,
Closest,
SOIChange,
SOIChangeAuto,
Transfer,
TransferModelled,
Distance,
Crew,
EarthTime,
Contract,
ContractAuto,
ScienceLab
}
internal static Dictionary<AlarmTypeEnum, int> AlarmTypeToButton = new Dictionary<AlarmTypeEnum, int>() {
{AlarmTypeEnum.Raw, 0},
{AlarmTypeEnum.Maneuver , 1},
{AlarmTypeEnum.ManeuverAuto , 1},
{AlarmTypeEnum.Apoapsis , 2},
{AlarmTypeEnum.Periapsis , 2},
{AlarmTypeEnum.AscendingNode , 3},
{AlarmTypeEnum.DescendingNode , 3},
{AlarmTypeEnum.LaunchRendevous , 3},
{AlarmTypeEnum.Closest , 4},
{AlarmTypeEnum.Distance , 4},
{AlarmTypeEnum.SOIChange , 5},
{AlarmTypeEnum.SOIChangeAuto , 5},
{AlarmTypeEnum.Transfer , 6},
{AlarmTypeEnum.TransferModelled , 6},
{AlarmTypeEnum.Crew , 7},
{AlarmTypeEnum.Contract , 8},
{AlarmTypeEnum.ContractAuto , 8},
{AlarmTypeEnum.ScienceLab , 9}
};
internal static Dictionary<int, AlarmTypeEnum> AlarmTypeFromButton = new Dictionary<int, AlarmTypeEnum>() {
{0,AlarmTypeEnum.Raw},
{1,AlarmTypeEnum.Maneuver },
{2,AlarmTypeEnum.Apoapsis },
{3,AlarmTypeEnum.AscendingNode },
{4,AlarmTypeEnum.Closest },
{5,AlarmTypeEnum.SOIChange },
{6,AlarmTypeEnum.Transfer },
{7,AlarmTypeEnum.Crew },
{8,AlarmTypeEnum.Contract },
{9,AlarmTypeEnum.ScienceLab }
};
internal static Dictionary<AlarmTypeEnum, int> AlarmTypeToButtonTS = new Dictionary<AlarmTypeEnum, int>() {
{AlarmTypeEnum.Raw, 0},
{AlarmTypeEnum.Maneuver , 1},
{AlarmTypeEnum.ManeuverAuto , 1},
{AlarmTypeEnum.Apoapsis , 2},
{AlarmTypeEnum.Periapsis , 2},
{AlarmTypeEnum.SOIChange , 3},
{AlarmTypeEnum.SOIChangeAuto , 3},
{AlarmTypeEnum.Transfer , 4},
{AlarmTypeEnum.TransferModelled , 4},
{AlarmTypeEnum.Crew , 5},
{AlarmTypeEnum.Contract , 6},
{AlarmTypeEnum.ContractAuto , 6}
};
internal static Dictionary<int, AlarmTypeEnum> AlarmTypeFromButtonTS = new Dictionary<int, AlarmTypeEnum>() {
{0,AlarmTypeEnum.Raw},
{1,AlarmTypeEnum.Maneuver },
{2,AlarmTypeEnum.Apoapsis },
{3,AlarmTypeEnum.SOIChange },
{4,AlarmTypeEnum.Transfer },
{5,AlarmTypeEnum.Crew },
{6,AlarmTypeEnum.Contract }
};
internal static Dictionary<AlarmTypeEnum, int> AlarmTypeToButtonSC = new Dictionary<AlarmTypeEnum, int>() {
{AlarmTypeEnum.Raw, 0},
{AlarmTypeEnum.Transfer , 1},
{AlarmTypeEnum.TransferModelled , 1},
{AlarmTypeEnum.Contract , 2},
{AlarmTypeEnum.ContractAuto , 2}
};
internal static Dictionary<int, AlarmTypeEnum> AlarmTypeFromButtonSC = new Dictionary<int, AlarmTypeEnum>() {
{0,AlarmTypeEnum.Raw},
{1,AlarmTypeEnum.Transfer },
{2,AlarmTypeEnum.Contract },
};
internal static Dictionary<int, AlarmTypeEnum> AlarmTypeFromButtonEditor = new Dictionary<int, AlarmTypeEnum>() {
{0,AlarmTypeEnum.Raw},
{1,AlarmTypeEnum.Transfer },
{2,AlarmTypeEnum.Contract },
};
internal static List<AlarmTypeEnum> AlarmTypeSupportsRepeat = new List<AlarmTypeEnum>() {
AlarmTypeEnum.Raw,
AlarmTypeEnum.Crew,
AlarmTypeEnum.TransferModelled,
AlarmTypeEnum.Apoapsis,
AlarmTypeEnum.Periapsis
};
internal static List<AlarmTypeEnum> AlarmTypeSupportsRepeatPeriod = new List<AlarmTypeEnum>() {
AlarmTypeEnum.Raw,
AlarmTypeEnum.Crew
};
public enum AlarmActionEnum
{
[Description("Do Nothing-Delete When Past")] DoNothingDeleteWhenPassed,
[Description("Do Nothing")] DoNothing,
[Description("Message Only-No Affect on warp")] MessageOnly,
[Description("Kill Warp Only-No Message")] KillWarpOnly,
[Description("Kill Warp and Message")] KillWarp,
[Description("Pause Game and Message")] PauseGame,
[Description("Custom Config")] Custom,
[Description("Converted to Components")] Converted,
}
public enum ContractAlarmTypeEnum
{
[Description("Contract Offer will Expire")] Expire,
[Description("Contract Deadline will occur")] Deadline,
}
#region "Constructors"
public KACAlarm()
{
ID = Guid.NewGuid().ToString("N");
}
public KACAlarm(double UT) : this ()
{
AlarmTime.UT = UT;
_lastRemainingUTStringUpdate = double.MaxValue; //force the remaining string update;
UpdateRemaining(AlarmTime.UT - Planetarium.GetUniversalTime());
}
private double _lastRemainingUTStringUpdate;
private string _remainingTimeStamp3;
public string RemainingTimeSpanString3 { get { return _remainingTimeStamp3; } }
internal void UpdateRemaining(double remaining)
{
Remaining.UT = remaining;
//Do we need to update strings?
if (Math.Floor(remaining) != _lastRemainingUTStringUpdate)
{
_remainingTimeStamp3 = Remaining.ToStringStandard(KerbalAlarmClock.settings.TimeSpanFormat, 3);
_lastRemainingUTStringUpdate = Math.Floor(remaining);
}
}
public KACAlarm(String NewName, double UT, AlarmTypeEnum atype, AlarmActions aAction)
: this(UT)
{
Name = NewName;
TypeOfAlarm = atype;
this.Actions = aAction.Duplicate();
}
public KACAlarm(String vID, String NewName, double UT, AlarmTypeEnum atype, AlarmActions aAction)
: this(NewName,UT,atype,aAction)
{
VesselID = vID;
}
public KACAlarm(String vID, String NewName, String NewNotes, double UT, Double Margin, AlarmTypeEnum atype, AlarmActions aAction)
: this (vID,NewName,UT,atype,aAction)
{
Notes = NewNotes;
AlarmMarginSecs = Margin;
}
public KACAlarm(String vID, String NewName, String NewNotes, double UT, Double Margin, AlarmTypeEnum atype, AlarmActions aAction, List<ManeuverNode> NewManeuvers)
: this(vID, NewName, NewNotes, UT, Margin, atype, aAction)
{
//set maneuver node
ManNodes = NewManeuvers;
}
public KACAlarm(String vID, String NewName, String NewNotes, double UT, Double Margin, AlarmTypeEnum atype, AlarmActions aAction, KACXFerTarget NewTarget)
: this(vID, NewName, NewNotes, UT, Margin, atype, aAction)
{
//Set target details
XferOriginBodyName = NewTarget.Origin.bodyName;
XferTargetBodyName = NewTarget.Target.bodyName;
}
public KACAlarm(String vID, String NewName, String NewNotes, double UT, Double Margin, AlarmTypeEnum atype, AlarmActions aAction, ITargetable NewTarget)
: this(vID,NewName,NewNotes,UT,Margin,atype,aAction)
{
//Set the ITargetable proerty
TargetObject = NewTarget;
}
#endregion
[Persistent] public String VesselID="";// {get; private set;}
[Persistent] public String ID="";
[Persistent] public String Name = ""; //Name of Alarm
public String Notes = ""; //Entered extra details
[Persistent] private String NotesStorage = ""; //Entered extra details
[Persistent] public AlarmTypeEnum TypeOfAlarm = AlarmTypeEnum.Raw; //What Type of Alarm
public KSPDateTime AlarmTime = new KSPDateTime(0); //UT of the alarm
[Persistent] private Double AlarmTimeStorage;
public Double AlarmTimeUT {
get { return AlarmTime.UT; }
set { AlarmTime.UT = value; }
}
[Persistent] public Double AlarmMarginSecs = 0; //What the margin from the event was
[Persistent] public Boolean Enabled = true; //Whether it is enabled - not in use currently
//[Persistent] public Boolean DeleteWhenPassed = false; //Whether it will be cleaned up after its time
#region Alarm Action Stuff
[Persistent] public AlarmActions Actions = new AlarmActions();
public Boolean PauseGame { get { return Actions.Warp == AlarmActions.WarpEnum.PauseGame; } }
public Boolean HaltWarp { get { return Actions.Warp == AlarmActions.WarpEnum.KillWarp; } }
public Boolean ShowMessage { get {
return ((Actions.Message==AlarmActions.MessageEnum.Yes) ||
( Actions.Message == AlarmActions.MessageEnum.YesIfOtherVessel &&
KACWorkerGameState.CurrentVessel!=null &&
VesselID == KACWorkerGameState.CurrentVessel.id.ToString()
)
);
} }
#region Old ActionEnum
[Persistent] public AlarmActionEnum AlarmAction = AlarmActionEnum.Converted;
[Persistent] public Boolean AlarmActionConverted = false;
public AlarmActionEnum AlarmActionConvert
{
get
{
if ((Actions.Warp == AlarmActions.WarpEnum.DoNothing) && (Actions.Message==AlarmActions.MessageEnum.No) & !Actions.DeleteWhenDone & !Actions.PlaySound)
return AlarmActionEnum.DoNothing;
else if ((Actions.Warp == AlarmActions.WarpEnum.DoNothing) && (Actions.Message == AlarmActions.MessageEnum.No) & Actions.DeleteWhenDone & !Actions.PlaySound)
return AlarmActionEnum.DoNothingDeleteWhenPassed;
else if ((Actions.Warp == AlarmActions.WarpEnum.KillWarp) && (Actions.Message == AlarmActions.MessageEnum.Yes) & !Actions.DeleteWhenDone & !Actions.PlaySound)
return AlarmActionEnum.KillWarp;
else if ((Actions.Warp == AlarmActions.WarpEnum.KillWarp) && (Actions.Message == AlarmActions.MessageEnum.No) & !Actions.DeleteWhenDone & !Actions.PlaySound)
return AlarmActionEnum.KillWarpOnly;
else if ((Actions.Warp == AlarmActions.WarpEnum.DoNothing) && (Actions.Message == AlarmActions.MessageEnum.Yes) & !Actions.DeleteWhenDone & !Actions.PlaySound)
return AlarmActionEnum.MessageOnly;
else if ((Actions.Warp == AlarmActions.WarpEnum.PauseGame) && (Actions.Message == AlarmActions.MessageEnum.Yes) & !Actions.DeleteWhenDone & !Actions.PlaySound)
return AlarmActionEnum.PauseGame;
else
return AlarmActionEnum.Custom;
}
set
{
switch (value)
{
case AlarmActionEnum.DoNothingDeleteWhenPassed:
Actions.Warp = AlarmActions.WarpEnum.DoNothing;
Actions.Message = AlarmActions.MessageEnum.No;
Actions.DeleteWhenDone = true;
Actions.PlaySound = false;
break;
case AlarmActionEnum.DoNothing:
Actions.Warp = AlarmActions.WarpEnum.DoNothing;
Actions.Message = AlarmActions.MessageEnum.No;
Actions.DeleteWhenDone = false;
Actions.PlaySound = false;
break;
case AlarmActionEnum.MessageOnly:
Actions.Warp = AlarmActions.WarpEnum.DoNothing;
Actions.Message = AlarmActions.MessageEnum.Yes;
Actions.DeleteWhenDone = false;
Actions.PlaySound = false;
break;
case AlarmActionEnum.KillWarpOnly:
Actions.Warp = AlarmActions.WarpEnum.KillWarp;
Actions.Message = AlarmActions.MessageEnum.No;
Actions.DeleteWhenDone = false;
Actions.PlaySound = false;
break;
case AlarmActionEnum.KillWarp:
Actions.Warp = AlarmActions.WarpEnum.KillWarp;
Actions.Message = AlarmActions.MessageEnum.Yes;
Actions.DeleteWhenDone = false;
Actions.PlaySound = false;
break;
case AlarmActionEnum.PauseGame:
Actions.Warp = AlarmActions.WarpEnum.PauseGame;
Actions.Message = AlarmActions.MessageEnum.Yes;
Actions.DeleteWhenDone = false;
Actions.PlaySound = false;
break;
case AlarmActionEnum.Custom:
case AlarmActionEnum.Converted:
default:
break;
}
}
}
#endregion
#endregion
//public ManeuverNode ManNode; //Stored ManeuverNode attached to alarm
public List<ManeuverNode> ManNodes = new List<ManeuverNode>(); //Stored ManeuverNode's attached to alarm
[Persistent] String ManNodesStorage = "";
[Persistent] public String XferOriginBodyName = ""; //Stored orbital transfer details
[Persistent] public String XferTargetBodyName = "";
[Persistent] public Boolean RepeatAlarm = false;
public KSPTimeSpan RepeatAlarmPeriod = new KSPTimeSpan(0); //Repeat how often - for non event driven stuff
[Persistent] private Double RepeatAlarmPeriodStorage;
public Double RepeatAlarmPeriodUT
{
get { return RepeatAlarmPeriod.UT; }
set { RepeatAlarmPeriod.UT = value; }
}
public Boolean SupportsRepeat { get { return AlarmTypeSupportsRepeat.Contains(this.TypeOfAlarm); } }
public Boolean SupportsRepeatPeriod { get { return AlarmTypeSupportsRepeatPeriod.Contains(this.TypeOfAlarm); } }
/// <summary>Should the alarm play a sound</summary>
[Persistent] public Boolean PlaySound = false;
//Have to generate these details when the target object is set
private ITargetable _TargetObject = null; //Stored Target Details
[Persistent] private String TargetObjectStorage;
public Guid ContractGUID;
[Persistent] public String ContractGUIDStorage;
[Persistent] public ContractAlarmTypeEnum ContractAlarmType;
//Vessel Target - needs the fancy get routine as the alarms load before the vessels are loaded.
//This means that each time the object is accessed if its not yet loaded it trys again
public ITargetable TargetObject
{
get
{
if (_TargetObject != null)
return _TargetObject;
else
{
//is there something to load here from the string
if (TargetLoader != "")
{
String[] TargetParts = TargetLoader.Split(",".ToCharArray());
switch (TargetParts[0])
{
case "Vessel":
if (KerbalAlarmClock.StoredVesselExists(TargetParts[1]))
_TargetObject = KerbalAlarmClock.StoredVessel(TargetParts[1]);
break;
case "CelestialBody":
if (KerbalAlarmClock.CelestialBodyExists(TargetParts[1]))
TargetObject = KerbalAlarmClock.CelestialBody(TargetParts[1]);
break;
default:
MonoBehaviourExtended.LogFormatted("No Target Found:{0}", TargetLoader);
break;
}
}
return _TargetObject;
}
}
set { _TargetObject = value; }
}
//Need this one as some vessels arent loaded when the config comes in
public String TargetLoader = "";
//[Persistent] internal Boolean DeleteOnClose; //Whether the checkbox is on or off for this
[Persistent] internal Boolean Triggered = false; //Has this alarm been triggered
[Persistent] internal Boolean Actioned = false; //Has the code actioned th alarm - ie. displayed its message
//Dynamic props down here
public KSPTimeSpan Remaining = new KSPTimeSpan(0); //UT value of how long till the alarm fires
public Boolean WarpInfluence = false; //Whether the Warp setting is being influenced by this alarm
//Details of the alarm message window
public Rect AlarmWindow;
public int AlarmWindowID = 0;
public int AlarmWindowHeight = 148;
[Persistent] internal Boolean AlarmWindowClosed = false;
//Details of the alarm message
public Boolean EditWindowOpen = false;
public Int32 AlarmLineWidth = 0;
public Int32 AlarmLineHeight = 0;
public Int32 AlarmLineHeightExtra { get { return (AlarmLineHeight > 22) ? AlarmLineHeight - 22 : 0; } }
public override void OnEncodeToConfigNode()
{
NotesStorage = KACUtils.EncodeVarStrings(Notes);
AlarmTimeStorage = AlarmTime.UT;
RepeatAlarmPeriodStorage = RepeatAlarmPeriod.UT;
ContractGUIDStorage = ContractGUID.ToString();
TargetObjectStorage = TargetSerialize(TargetObject);
ManNodesStorage = ManNodeSerializeList(ManNodes);
}
public override void OnDecodeFromConfigNode()
{
Notes = KACUtils.DecodeVarStrings(NotesStorage);
AlarmTime=new KSPDateTime(AlarmTimeStorage);
if (RepeatAlarmPeriodStorage != 0)
RepeatAlarmPeriod = new KSPTimeSpan(RepeatAlarmPeriodStorage);
//dont try and create a GUID from null or empty :)
if (ContractGUIDStorage!=null && ContractGUIDStorage!="")
ContractGUID = new Guid(ContractGUIDStorage);
_TargetObject = TargetDeserialize(TargetObjectStorage);
ManNodes = ManNodeDeserializeList( ManNodesStorage);
}
internal static ITargetable TargetDeserialize(String strInput)
{
ITargetable tReturn = null;
if (strInput == "") return null;
String[] TargetParts = strInput.Split(",".ToCharArray());
switch (TargetParts[0])
{
case "Vessel":
if (KerbalAlarmClock.StoredVesselExists(TargetParts[1]))
tReturn = KerbalAlarmClock.StoredVessel(TargetParts[1]);
break;
case "CelestialBody":
if (KerbalAlarmClock.CelestialBodyExists(TargetParts[1]))
tReturn = KerbalAlarmClock.CelestialBody(TargetParts[1]);
break;
default:
break;
}
return tReturn;
}
internal static String TargetSerialize(ITargetable tInput)
{
string strReturn = "";
if (tInput == null) return "";
strReturn += tInput.GetType();
strReturn += ",";
if (tInput is Vessel)
{
Vessel tmpVessel = tInput as Vessel;
strReturn += tmpVessel.id.ToString();
}
else if (tInput is CelestialBody)
{
CelestialBody tmpBody = tInput as CelestialBody;
strReturn += tmpBody.bodyName;
}
return strReturn;
}
internal static List<ManeuverNode> ManNodeDeserializeList(String strInput)
{
List<ManeuverNode> lstReturn = new List<ManeuverNode>();
String[] strInputParts = strInput.Split(",".ToCharArray());
MonoBehaviourExtended.LogFormatted("Found {0} Maneuver Nodes to deserialize", strInputParts.Length / 8);
//There are 8 parts per mannode
for (int iNode = 0; iNode < strInputParts.Length / 8; iNode++)
{
String strTempNode = String.Join(",", strInputParts.Skip(iNode * 8).Take(8).ToArray());
lstReturn.Add(ManNodeDeserialize(strTempNode));
}
return lstReturn;
}
internal static ManeuverNode ManNodeDeserialize(String strInput)
{
ManeuverNode mReturn = new ManeuverNode();
String[] manparts = strInput.Split(",".ToCharArray());
mReturn.UT = Convert.ToDouble(manparts[0]);
mReturn.DeltaV = new Vector3d(Convert.ToDouble(manparts[1]),
Convert.ToDouble(manparts[2]),
Convert.ToDouble(manparts[3])
);
mReturn.nodeRotation = new Quaternion(Convert.ToSingle(manparts[4]),
Convert.ToSingle(manparts[5]),
Convert.ToSingle(manparts[6]),
Convert.ToSingle(manparts[7])
);
return mReturn;
}
internal static string ManNodeSerializeList(List<ManeuverNode> mInput)
{
String strReturn = "";
foreach (ManeuverNode tmpMNode in mInput)
{
strReturn += ManNodeSerialize(tmpMNode);
strReturn += ",";
}
strReturn = strReturn.TrimEnd(",".ToCharArray());
return strReturn;
}
internal static string ManNodeSerialize(ManeuverNode mInput)
{
String strReturn = mInput.UT.ToString();
strReturn += "," + KACUtils.CommaSepVariables(mInput.DeltaV.x, mInput.DeltaV.y, mInput.DeltaV.z);
strReturn += "," + KACUtils.CommaSepVariables(mInput.nodeRotation.x, mInput.nodeRotation.y, mInput.nodeRotation.z, mInput.nodeRotation.w);
return strReturn;
}
internal static Boolean CompareManNodeListSimple(List<ManeuverNode> l1, List<ManeuverNode> l2)
{
Boolean blnReturn = true;
if (l1.Count != l2.Count)
blnReturn = false;
else
{
for (int i = 0; i < l1.Count; i++)
{
if (l1[i].UT != l2[i].UT)
blnReturn = false;
else if (l1[i].DeltaV != l2[i].DeltaV)
blnReturn = false;
}
}
return blnReturn;
}
public KACAlarm Duplicate(Double newUT)
{
KACAlarm newAlarm = Duplicate();
newAlarm.AlarmTime = new KSPDateTime(newUT);
return newAlarm;
}
public KACAlarm Duplicate()
{
KACAlarm newAlarm = new KACAlarm(this.VesselID, this.Name, this.Notes, this.AlarmTime.UT, this.AlarmMarginSecs, this.TypeOfAlarm, this.Actions); ;
newAlarm.ContractAlarmType = this.ContractAlarmType;
newAlarm.ContractGUID = this.ContractGUID;
newAlarm.ManNodes = this.ManNodes;
newAlarm.RepeatAlarm = this.RepeatAlarm;
newAlarm.RepeatAlarmPeriod = this.RepeatAlarmPeriod;
newAlarm.TargetObject = this.TargetObject;
newAlarm.XferOriginBodyName = this.XferOriginBodyName;
newAlarm.XferTargetBodyName= this.XferTargetBodyName;
return newAlarm;
}
}
//public class ManeuverNodeStorageList:List<ManeuverNodeStorage>
//{
// public List<ManeuverNode> ToManNodeList()
// {
// List<ManeuverNode> lstReturn = new List<ManeuverNode>();
// foreach (ManeuverNodeStorage item in this)
// {
// lstReturn.Add(item.ToManeuverNode());
// }
// return lstReturn;
// }
// public ManeuverNodeStorageList FromManNodeList(List<ManeuverNode> ManNodesToStore)
// {
// this.Clear();
// MonoBehaviourExtended.LogFormatted("{0}", ManNodesToStore.Count);
// if (ManNodesToStore == null) return this;
// foreach (ManeuverNode item in ManNodesToStore)
// {
// this.Add(new ManeuverNodeStorage(item));
// }
// return this;
// }
//}
//public class ManeuverNodeStorage
//{
// public ManeuverNodeStorage() { }
// public ManeuverNodeStorage(ManeuverNode newManNode)
// {
// FromManeuverNode(newManNode);
// }
// [Persistent] Vector3 DeltaV;
// [Persistent] Quaternion NodeRotation;
// [Persistent] Double UT;
// public ManeuverNode ToManeuverNode()
// {
// ManeuverNode retManNode = new ManeuverNode();
// retManNode.DeltaV = DeltaV;
// retManNode.nodeRotation = NodeRotation;
// retManNode.UT = UT;
// return retManNode;
// }
// public ManeuverNodeStorage FromManeuverNode(ManeuverNode ManNodeToStore)
// {
// this.DeltaV = ManNodeToStore.DeltaV;
// this.NodeRotation = ManNodeToStore.nodeRotation;
// this.UT = ManNodeToStore.UT;
// return this;
// }
//}
public class KACAlarmList: List<KACAlarm>
{
new internal void Add(KACAlarm item)
{
try {
KerbalAlarmClock.APIInstance.APIInstance_AlarmStateChanged(item, KerbalAlarmClock.AlarmStateEventsEnum.Created);
} catch (Exception ex) {
MonoBehaviourExtended.LogFormatted("Error Raising API Event-Created Alarm: {0}\r\n{1}", ex.Message, ex.StackTrace);
}
base.Add(item);
}
new internal void Remove(KACAlarm item)
{
//Make a copy to pass to the API as we will have deleted the source object before the event subscription gets the event
//KACAlarm CopyForAPI = (KACAlarm)item.Clone();
try {
KerbalAlarmClock.APIInstance.APIInstance_AlarmStateChanged(item, KerbalAlarmClock.AlarmStateEventsEnum.Deleted);
} catch (Exception ex) {
MonoBehaviourExtended.LogFormatted("Error Raising API Event-Deleted Alarm: {0}\r\n{1}", ex.Message, ex.StackTrace);
}
base.Remove(item);
}
internal ConfigNode EncodeToCN()
{
KACAlarmListStorage lstTemp = new KACAlarmListStorage();
lstTemp.list = this;
//MonoBehaviourExtended.LogFormatted("{0}", lstTemp.list.Count);
//foreach (KACAlarm item in lstTemp.list)
//{
// MonoBehaviourExtended.LogFormatted("{0}", item.AsConfigNode);
//}
ConfigNode cnReturn = lstTemp.AsConfigNode;
MonoBehaviourExtended.LogFormatted_DebugOnly("Encoding:{0}", cnReturn);
//MonoBehaviourExtended.LogFormatted("{0}", cnReturn.GetNode("list"));
return cnReturn;
}
internal void DecodeFromCN(ConfigNode AlarmListNode)
{
try
{
if (AlarmListNode.CountNodes < 1)
{
MonoBehaviourExtended.LogFormatted("No Alarms to Load");
}
else
{
MonoBehaviourExtended.LogFormatted_DebugOnly("Decoding:{0}", AlarmListNode);
KACAlarmListStorage lstTemp = new KACAlarmListStorage();
ConfigNode.LoadObjectFromConfig(lstTemp, AlarmListNode);
//this.Clear();
this.AddRange(lstTemp.list);
}
}
catch (Exception ex)
{
MonoBehaviourExtended.LogFormatted("Failed to Load Alarms from Save File");
MonoBehaviourExtended.LogFormatted("Message: {0}", ex.Message);
MonoBehaviourExtended.LogFormatted("AlarmListNode: {0}", AlarmListNode);
}
}
/// <summary>
/// Get the Alarm object from the Unity Window ID
/// </summary>
/// <param name="windowID"></param>
/// <returns></returns>
internal KACAlarm GetByWindowID(Int32 windowID)
{
return this.FirstOrDefault(x => x.AlarmWindowID == windowID);
}
/// <summary>
/// Get the Alarm object from the Unity Window ID
/// </summary>
/// <param name="windowID"></param>
/// <returns></returns>
internal KACAlarm GetByID(String ID)
{
return this.FirstOrDefault(x => x.ID == ID);
}
/// <summary>
/// Are there any alarms for this save file that are in the future and not already actioned
/// </summary>
/// <param name="SaveName"></param>
/// <returns></returns>
internal Boolean ActiveEnabledFutureAlarms(String SaveName)
{
Boolean blnReturn = false;
foreach (KACAlarm tmpAlarm in this)
{
if (tmpAlarm.AlarmTime.UT > Planetarium.GetUniversalTime() && tmpAlarm.Enabled && !tmpAlarm.Actioned )
{
blnReturn = true;
}
}
return blnReturn;
}
}
internal class KACAlarmListStorage : ConfigNodeStorage
{
[Persistent] public List<KACAlarm> list;
}
}
| 41.556291 | 175 | 0.5571 | [
"MIT"
] | EwoutH/KerbalAlarmClock | KerbalAlarmClock/AlarmObjects.cs | 31,377 | C# |
/*
* Copyright © 2016-2021 EDDiscovery development team
*
* 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.
*
* EDDiscovery is not affiliated with Frontier Developments plc.
*/
using EliteDangerousCore.DB;
using EliteDangerousCore.JournalEvents;
using QuickJSON;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net;
using System.Reflection;
using System.Web;
namespace EliteDangerousCore.EDSM
{
public partial class EDSMClass : BaseUtils.HttpCom
{
// use if you need an API/name pair to get info from EDSM. Not all queries need it
public bool ValidCredentials { get { return !string.IsNullOrEmpty(commanderName) && !string.IsNullOrEmpty(apiKey); } }
static public string SoftwareName { get; set; } = "EDDiscovery";
private string commanderName;
private string apiKey;
private readonly string fromSoftwareVersion;
public EDSMClass()
{
var assemblyFullName = Assembly.GetEntryAssembly().FullName;
fromSoftwareVersion = assemblyFullName.Split(',')[1].Split('=')[1];
base.httpserveraddress = ServerAddress;
apiKey = EDCommander.Current.EDSMAPIKey;
commanderName = string.IsNullOrEmpty(EDCommander.Current.EdsmName) ? EDCommander.Current.Name : EDCommander.Current.EdsmName;
}
public EDSMClass(EDCommander cmdr) : this()
{
if (cmdr != null)
{
apiKey = cmdr.EDSMAPIKey;
commanderName = string.IsNullOrEmpty(cmdr.EdsmName) ? cmdr.Name : cmdr.EdsmName;
}
}
static string edsm_server_address = "https://www.edsm.net/";
public static string ServerAddress { get { return edsm_server_address; } set { edsm_server_address = value; } }
public static bool IsServerAddressValid { get { return edsm_server_address.Length > 0; } }
#region For Trilateration
public string SubmitDistances(string from, Dictionary<string, double> distances)
{
string query = "{\"ver\":2," + " \"commander\":\"" + commanderName + "\", \"fromSoftware\":\"" + SoftwareName + "\", \"fromSoftwareVersion\":\"" + fromSoftwareVersion + "\", \"p0\": { \"name\": \"" + from + "\" }, \"refs\": [";
var counter = 0;
foreach (var item in distances)
{
if (counter++ > 0)
{
query += ",";
}
var to = item.Key;
var distance = item.Value.ToString("0.00", CultureInfo.InvariantCulture);
query += " { \"name\": \"" + to + "\", \"dist\": " + distance + " } ";
}
query += "] } ";
MimeType = "application/json; charset=utf-8";
var response = RequestPost("{ \"data\": " + query + " }", "api-v1/submit-distances", handleException: true);
if (response.Error)
return null;
var data = response.Body;
return response.Body;
}
public bool ShowDistanceResponse(string json, out string respstr, out Boolean trilOK)
{
bool retval = true;
JObject edsm = null;
trilOK = false;
respstr = "";
try
{
if (json == null)
return false;
edsm = JObject.Parse(json);
if (edsm == null)
return false;
JObject basesystem = (JObject)edsm["basesystem"];
JArray distances = (JArray)edsm["distances"];
if (distances != null)
{
foreach (var st in distances)
{
int statusnum = st["msgnum"].Int();
if (statusnum == 201)
retval = false;
respstr += "Status " + statusnum.ToString() + " : " + st["msg"].Str() + Environment.NewLine;
}
}
if (basesystem != null)
{
int statusnum = basesystem["msgnum"].Int();
if (statusnum == 101)
retval = false;
if (statusnum == 102 || statusnum == 104)
trilOK = true;
respstr += "System " + statusnum.ToString() + " : " + basesystem["msg"].Str() + Environment.NewLine;
}
return retval;
}
catch (Exception ex)
{
respstr += "Exception in ShowDistanceResponse: " + ex.Message;
return false;
}
}
public bool IsKnownSystem(string sysName) // Verified Nov 20
{
string query = "system?systemName=" + HttpUtility.UrlEncode(sysName);
string json = null;
var response = RequestGet("api-v1/" + query, handleException: true);
if (response.Error)
return false;
json = response.Body;
if (json == null)
return false;
return json.ToString().Contains("\"name\":");
}
public List<string> GetPushedSystems() // Verified Nov 20
{
string query = "api-v1/systems?pushed=1";
return getSystemsForQuery(query);
}
public List<string> GetUnknownSystemsForSector(string sectorName) // Verified Nov 20
{
string query = $"api-v1/systems?systemName={HttpUtility.UrlEncode(sectorName)}%20&onlyUnknownCoordinates=1";
// 5s is occasionally slightly short for core sectors returning the max # systems (1000)
return getSystemsForQuery(query, 10000);
}
List<string> getSystemsForQuery(string query, int timeout = 5000) // Verified Nov 20
{
List<string> systems = new List<string>();
var response = RequestGet(query, handleException: true, timeout: timeout);
if (response.Error)
return systems;
var json = response.Body;
if (json == null)
return systems;
JArray msg = JArray.Parse(json);
if (msg != null)
{
foreach (JObject sysname in msg)
{
systems.Add(sysname["name"].Str("Unknown"));
}
}
return systems;
}
#endregion
#region For System DB update
// Verified Nov 20 - EDSM update working
public BaseUtils.ResponseData RequestSystemsData(DateTime startdate, DateTime enddate, int timeout = 5000) // protect yourself against JSON errors!
{
DateTime gammadate = new DateTime(2015, 5, 10, 0, 0, 0, DateTimeKind.Utc);
if (startdate < gammadate)
{
startdate = gammadate;
}
string query = "api-v1/systems" +
"?startdatetime=" + HttpUtility.UrlEncode(startdate.ToUniversalTime().ToStringYearFirstInvariant()) +
"&enddatetime=" + HttpUtility.UrlEncode(enddate.ToUniversalTime().ToStringYearFirstInvariant()) +
"&coords=1&submitted=1&known=1&showId=1";
return RequestGet(query, handleException: true, timeout: timeout);
}
public string GetHiddenSystems(string file) // Verfied Nov 20
{
try
{
if (BaseUtils.DownloadFile.HTTPDownloadFile(base.httpserveraddress + "api-v1/hidden-systems?showId=1", file, false, out bool newfile))
{
string json = BaseUtils.FileHelpers.TryReadAllTextFromFile(file);
return json;
}
else
return null;
}
catch (Exception ex)
{
Trace.WriteLine($"Exception: {ex.Message}");
Trace.WriteLine($"ETrace: {ex.StackTrace}");
return null;
}
}
#endregion
#region Comment sync
private string GetComments(DateTime starttime)
{
if (!ValidCredentials)
return null;
string query = "get-comments?startdatetime=" + HttpUtility.UrlEncode(starttime.ToStringYearFirstInvariant()) + "&apiKey=" + apiKey + "&commanderName=" + HttpUtility.UrlEncode(commanderName) + "&showId=1";
var response = RequestGet("api-logs-v1/" + query, handleException: true);
if (response.Error)
return null;
return response.Body;
}
public void GetComments(Action<string> logout = null) // Protected against bad JSON.. Verified Nov 2020
{
var json = GetComments(new DateTime(2011, 1, 1));
if (json != null)
{
try
{
JObject msg = JObject.ParseThrowCommaEOL(json); // protect against bad json - seen in the wild
int msgnr = msg["msgnum"].Int();
JArray comments = (JArray)msg["comments"];
if (comments != null)
{
int commentsadded = 0;
foreach (JObject jo in comments)
{
string name = jo["system"].Str();
string note = jo["comment"].Str();
DateTime utctime = jo["lastUpdate"].DateTime(DateTime.UtcNow, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal);
int edsmid = jo["systemId"].Int(0);
var localtime = utctime.ToLocalTime();
SystemNoteClass curnote = SystemNoteClass.GetNoteOnSystem(name);
if (curnote != null) // curnote uses local time to store
{
if (localtime.Ticks > curnote.Time.Ticks) // if newer, add on (verified with EDSM 29/9/2016)
{
curnote.UpdateNote(curnote.Note + ". EDSM: " + note, true, localtime, true);
commentsadded++;
}
}
else
{
SystemNoteClass.MakeSystemNote(note, localtime, name, 0, true); // new one! its an FSD one as well
commentsadded++;
}
}
logout?.Invoke(string.Format("EDSM Comments downloaded/updated {0}", commentsadded));
}
}
catch ( Exception e)
{
System.Diagnostics.Debug.WriteLine("Failed due to " + e.ToString());
}
}
}
public string SetComment(string systemName, string note, long edsmid = 0) // Verified Nov 20
{
if (!ValidCredentials)
return null;
string query;
query = "systemName=" + HttpUtility.UrlEncode(systemName) + "&commanderName=" + HttpUtility.UrlEncode(commanderName) + "&apiKey=" + apiKey + "&comment=" + HttpUtility.UrlEncode(note);
if (edsmid > 0)
{
// For future use when EDSM adds the ability to link a comment to a system by EDSM ID
query += "&systemId=" + edsmid;
}
MimeType = "application/x-www-form-urlencoded";
var response = RequestPost(query, "api-logs-v1/set-comment", handleException: true);
if (response.Error)
return null;
return response.Body;
}
public static void SendComments(string star, string note, long edsmid = 0, EDCommander cmdr = null) // (verified with EDSM 29/9/2016)
{
System.Diagnostics.Debug.WriteLine("Send note to EDSM " + star + " " + edsmid + " " + note);
EDSMClass edsm = new EDSMClass(cmdr);
if (!edsm.ValidCredentials)
return;
System.Threading.Tasks.Task taskEDSM = System.Threading.Tasks.Task.Factory.StartNew(() =>
{
edsm.SetComment(star, note, edsmid);
});
}
#endregion
#region Log Sync for log fetcher
// Protected against bad JSON Visual Inspection Nov 2020 - using Int()
public int GetLogs(DateTime? starttimeutc, DateTime? endtimeutc, out List<JournalFSDJump> log, out DateTime logstarttime, out DateTime logendtime, out BaseUtils.ResponseData response)
{
log = new List<JournalFSDJump>();
logstarttime = DateTime.MaxValue;
logendtime = DateTime.MinValue;
response = new BaseUtils.ResponseData { Error = true, StatusCode = HttpStatusCode.Unauthorized };
if (!ValidCredentials)
return 0;
string query = "get-logs?showId=1&apiKey=" + apiKey + "&commanderName=" + HttpUtility.UrlEncode(commanderName);
if (starttimeutc != null)
query += "&startDateTime=" + HttpUtility.UrlEncode(starttimeutc.Value.ToStringYearFirstInvariant());
if (endtimeutc != null)
query += "&endDateTime=" + HttpUtility.UrlEncode(endtimeutc.Value.ToStringYearFirstInvariant());
response = RequestGet("api-logs-v1/" + query, handleException: true);
if (response.Error)
{
if ((int)response.StatusCode == 429)
return 429;
else
return 0;
}
var json = response.Body;
if (json == null)
return 0;
try
{
JObject msg = JObject.ParseThrowCommaEOL(json);
int msgnr = msg["msgnum"].Int(0);
JArray logs = (JArray)msg["logs"];
if (logs != null)
{
string startdatestr = msg["startDateTime"].Str();
string enddatestr = msg["endDateTime"].Str();
if (startdatestr == null || !DateTime.TryParseExact(startdatestr, "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal, out logstarttime))
logstarttime = DateTime.MaxValue;
if (enddatestr == null || !DateTime.TryParseExact(enddatestr, "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal, out logendtime))
logendtime = DateTime.MinValue;
var tofetch = SystemsDatabase.Instance.DBRead(db =>
{
var xtofetch = new List<Tuple<JObject, ISystem>>();
foreach (JObject jo in logs)
{
string name = jo["system"].Str();
string ts = jo["date"].Str();
long id = jo["systemId"].Long();
DateTime etutc = DateTime.ParseExact(ts, "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal); // UTC time
ISystem sc = DB.SystemCache.FindSystemInCacheDB(new SystemClass(name, id), db); // find in our DB only.
xtofetch.Add(new Tuple<JObject, ISystem>(jo, sc));
}
return xtofetch;
});
var xlog = new List<JournalFSDJump>();
foreach (var js in tofetch)
{
var jo = js.Item1;
var sc = js.Item2;
string name = jo["system"].Str();
string ts = jo["date"].Str();
long id = jo["systemId"].Long();
bool firstdiscover = jo["firstDiscover"].Bool();
DateTime etutc = DateTime.ParseExact(ts, "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal); // UTC time
if (sc == null)
{
if (DateTime.UtcNow.Subtract(etutc).TotalHours < 6) // Avoid running into the rate limit
sc = GetSystem(name)?.FirstOrDefault(s => s.EDSMID == id);
if (sc == null)
{
sc = new SystemClass(name, id); // make an EDSM system
}
}
JournalFSDJump fsd = new JournalFSDJump(etutc, sc, EDCommander.Current.MapColour, firstdiscover, true);
xlog.Add(fsd);
}
log = xlog;
}
return msgnr;
}
catch ( Exception e )
{
System.Diagnostics.Debug.WriteLine("Failed due to " + e.ToString());
return 499; // BAD JSON
}
}
#endregion
#region System Information
// given a list of names, get ISystems associated.. may return null, or empty list if edsm responded with nothing
// ISystem list may not be in same order, or even have the same number of entries than sysNames.
// systems unknown to EDSM in sysNames are just ignored and not reported in the returned object
public List<ISystem> GetSystems(List<string> sysNames) // verified feb 21
{
List<ISystem> list = new List<ISystem>();
int pos = 0;
while (pos < sysNames.Count)
{
int left = sysNames.Count - pos;
List<string> toprocess = sysNames.GetRange(pos, Math.Min(20,left)); // N is arbitary to limit length of query
pos += toprocess.Count;
string query = "api-v1/systems?onlyKnownCoordinates=1&showId=1&showCoordinates=1&";
bool first = true;
foreach (string s in toprocess)
{
if (first)
first = false;
else
query = query + "&";
query = query + $"systemName[]={HttpUtility.UrlEncode(s)}";
}
var response = RequestGet(query, handleException: true);
if (response.Error)
return null;
var json = response.Body;
if (json == null)
return null;
JArray msg = JArray.Parse(json);
if (msg != null)
{
//System.Diagnostics.Debug.WriteLine("Return " + msg.ToString(true));
foreach (JObject s in msg)
{
JObject coords = s["coords"].Object();
if (coords != null)
{
SystemClass sys = new SystemClass(s["name"].Str("Unknown"), coords["x"].Double(), coords["y"].Double(), coords["z"].Double(), s["id"].Long());
sys.SystemAddress = s["id64"].Long();
list.Add(sys);
}
}
}
}
return list;
}
// cache of lookups, either null not found or list
static private Dictionary<string, List<ISystem>> EDSMGetSystemCache = new Dictionary<string, List<ISystem>>();
static public bool HasSystemLookedOccurred(string name)
{
return EDSMGetSystemCache.ContainsKey(name);
}
// lookup, through the cache, a system
// may return empty list, or null - protect yourself
public List<ISystem> GetSystem(string systemName)
{
lock (EDSMGetSystemCache) // only lock over test, its unlikely that two queries with the same name will come at the same time
{
if (EDSMGetSystemCache.TryGetValue(systemName, out List<ISystem> res)) // if cache has the name
{
return res; // will return null or list
}
}
string query = String.Format("api-v1/systems?systemName={0}&showCoordinates=1&showId=1&showInformation=1&showPermit=1", Uri.EscapeDataString(systemName));
var response = RequestGet(query, handleException: true);
if (response.Error)
return null;
var json = response.Body;
if (json == null)
return null;
JArray msg = JArray.Parse(json);
if (msg != null)
{
List<ISystem> systems = new List<ISystem>();
foreach (JObject sysname in msg)
{
ISystem sys = new SystemClass(sysname["name"].Str("Unknown"), sysname["id"].Long(0));
if (sys.Name.Equals(systemName, StringComparison.InvariantCultureIgnoreCase))
{
JObject co = (JObject)sysname["coords"];
if (co != null)
{
sys.X = co["x"].Double();
sys.Y = co["y"].Double();
sys.Z = co["z"].Double();
}
sys.NeedsPermit = sysname["requirePermit"].Bool(false) ? 1 : 0;
JObject info = sysname["information"] as JObject;
if (info != null)
{
sys.Population = info["population"].Long(0);
sys.Faction = info["faction"].StrNull();
EDAllegiance allegiance = EDAllegiance.None;
EDGovernment government = EDGovernment.None;
EDState state = EDState.None;
EDEconomy economy = EDEconomy.None;
EDSecurity security = EDSecurity.Unknown;
sys.Allegiance = Enum.TryParse(info["allegiance"].Str(), out allegiance) ? allegiance : EDAllegiance.None;
sys.Government = Enum.TryParse(info["government"].Str(), out government) ? government : EDGovernment.None;
sys.State = Enum.TryParse(info["factionState"].Str(), out state) ? state : EDState.None;
sys.PrimaryEconomy = Enum.TryParse(info["economy"].Str(), out economy) ? economy : EDEconomy.None;
sys.Security = Enum.TryParse(info["security"].Str(), out security) ? security : EDSecurity.Unknown;
}
systems.Add(sys);
}
}
if (systems.Count == 0) // no systems, set to null so stored as such
systems = null;
lock (EDSMGetSystemCache)
{
EDSMGetSystemCache[systemName] = systems;
}
return systems;
}
return null;
}
// Verified Nov 20
public List<Tuple<ISystem,double>> GetSphereSystems(String systemName, double maxradius, double minradius) // may return null
{
string query = String.Format("api-v1/sphere-systems?systemName={0}&radius={1}&minRadius={2}&showCoordinates=1&showId=1", Uri.EscapeDataString(systemName), maxradius , minradius);
var response = RequestGet(query, handleException: true, timeout: 30000);
if (response.Error)
return null;
var json = response.Body;
if (json != null)
{
try
{
List<Tuple<ISystem, double>> systems = new List<Tuple<ISystem, double>>();
JArray msg = JArray.Parse(json); // allow for crap from EDSM or empty list
if (msg != null)
{
foreach (JObject sysname in msg)
{
ISystem sys = new SystemClass(sysname["name"].Str("Unknown"), sysname["id"].Long(0)); // make a system from EDSM
JObject co = (JObject)sysname["coords"];
if (co != null)
{
sys.X = co["x"].Double();
sys.Y = co["y"].Double();
sys.Z = co["z"].Double();
}
systems.Add(new Tuple<ISystem, double>(sys, sysname["distance"].Double()));
}
return systems;
}
}
catch( Exception e) // json may be garbage
{
System.Diagnostics.Debug.WriteLine("Failed due to " + e.ToString());
}
}
return null;
}
// Verified Nov 20
public List<Tuple<ISystem, double>> GetSphereSystems(double x, double y, double z, double maxradius, double minradius) // may return null
{
string query = String.Format("api-v1/sphere-systems?x={0}&y={1}&z={2}&radius={3}&minRadius={4}&showCoordinates=1&showId=1", x, y, z, maxradius, minradius);
var response = RequestGet(query, handleException: true, timeout: 30000);
if (response.Error)
return null;
var json = response.Body;
if (json != null)
{
try
{
List<Tuple<ISystem, double>> systems = new List<Tuple<ISystem, double>>();
JArray msg = JArray.Parse(json); // allow for crap from EDSM or empty list
if (msg != null)
{
foreach (JObject sysname in msg)
{
ISystem sys = new SystemClass(sysname["name"].Str("Unknown"), sysname["id"].Long(0)); // make a EDSM system
JObject co = (JObject)sysname["coords"];
if (co != null)
{
sys.X = co["x"].Double();
sys.Y = co["y"].Double();
sys.Z = co["z"].Double();
}
systems.Add(new Tuple<ISystem, double>(sys, sysname["distance"].Double()));
}
return systems;
}
}
catch (Exception e) // json may be garbage
{
System.Diagnostics.Debug.WriteLine("Failed due to " + e.ToString());
}
}
return null;
}
public string GetUrlToSystem(string sysName) // get a direct name, no check if exists
{
string encodedSys = HttpUtility.UrlEncode(sysName);
string url = base.httpserveraddress + "system?systemName=" + encodedSys;
return url;
}
public bool ShowSystemInEDSM(string sysName) // Verified Nov 20, checks it exists
{
string url = GetUrlCheckSystemExists(sysName);
if (string.IsNullOrEmpty(url))
{
return false;
}
else
{
BaseUtils.BrowserInfo.LaunchBrowser(url);
}
return true;
}
public string GetUrlCheckSystemExists(string sysName) // Check if sysname exists
{
long id = -1;
string encodedSys = HttpUtility.UrlEncode(sysName);
string query = "system?systemName=" + encodedSys + "&showId=1";
var response = RequestGet("api-v1/" + query, handleException: true);
if (response.Error)
return "";
JObject jo = response.Body?.JSONParseObject(JToken.ParseOptions.CheckEOL); // null if no body, or not object
if (jo != null)
id = jo["id"].Long(-1);
if (id == -1)
return "";
string url = base.httpserveraddress + "system/id/" + id.ToStringInvariant() + "/name/" + encodedSys;
return url;
}
public JObject GetSystemByAddress(long id64)
{
string query = "?systemId64=" + id64.ToString() + "&showInformation=1&includeHidden=1";
var response = RequestGet("api-v1/system" + query, handleException: true);
if (response.Error)
return null;
var json = response.Body;
if (json == null || json.ToString() == "[]")
return null;
JObject msg = JObject.Parse(json);
return msg;
}
#endregion
#region Body info
private JObject GetBodies(string sysName) // Verified Nov 20, null if bad json
{
string encodedSys = HttpUtility.UrlEncode(sysName);
string query = "bodies?systemName=" + sysName;
var response = RequestGet("api-system-v1/" + query, handleException: true);
if (response.Error)
return null;
var json = response.Body;
if (json == null || json.ToString() == "[]")
return null;
JObject msg = JObject.Parse(json);
return msg;
}
private JObject GetBodiesByID64(long id64) // Verified Nov 20, null if bad json
{
string query = "bodies?systemId64=" + id64.ToString();
var response = RequestGet("api-system-v1/" + query, handleException: true);
if (response.Error)
return null;
var json = response.Body;
if (json == null || json.ToString() == "[]")
return null;
JObject msg = JObject.Parse(json);
return msg;
}
private JObject GetBodies(long edsmID) // Verified Nov 20, null if bad json
{
string query = "bodies?systemId=" + edsmID.ToString();
var response = RequestGet("api-system-v1/" + query, handleException: true);
if (response.Error)
return null;
var json = response.Body;
if (json == null || json.ToString() == "[]")
return null;
JObject msg = JObject.Parse(json);
return msg;
}
public async static System.Threading.Tasks.Task<Tuple<List<JournalScan>, bool>> GetBodiesListAsync(ISystem sys, bool edsmweblookup = true) // get this edsmid, optionally lookup web protected against bad json
{
return await System.Threading.Tasks.Task.Run(() =>
{
return GetBodiesList(sys, edsmweblookup);
});
}
// EDSMBodiesCache gets either the body list, or null marking no EDSM server data
static private Dictionary<string, List<JournalScan>> EDSMBodiesCache = new Dictionary<string, List<JournalScan>>();
public static bool HasBodyLookupOccurred(string name)
{
return EDSMBodiesCache.ContainsKey(name);
}
// returns null if EDSM says not there, else if returns list of bodies and a flag indicating if from cache.
// all this is done in a lock inside a task - the only way to sequence the code and prevent multiple lookups in an await structure
// so we must pass back all the info we can to tell the caller what happened.
// Verified Nov 21
public static Tuple<List<JournalScan>, bool> GetBodiesList(ISystem sys, bool edsmweblookup = true)
{
try
{
lock (EDSMBodiesCache) // only one request at a time going, this is to prevent multiple requests for the same body
{
// System.Threading.Thread.Sleep(2000); //debug - delay to show its happening
// System.Diagnostics.Debug.WriteLine("EDSM Cache check " + sys.EDSMID + " " + sys.SystemAddress + " " + sys.Name);
if ( EDSMBodiesCache.TryGetValue(sys.Name,out List<JournalScan> we))
{
System.Diagnostics.Debug.WriteLine($"EDSM Bodies Cache hit on {sys.Name} {we!=null}");
if (we == null) // lookedup but not found
return null;
else
return new Tuple<List<JournalScan>, bool>(we, true); // mark from cache
}
if (!edsmweblookup) // must be set for a web lookup
return null;
System.Diagnostics.Debug.WriteLine($"EDSM Web lookup on {sys.Name}");
List<JournalScan> bodies = new List<JournalScan>();
EDSMClass edsm = new EDSMClass();
JObject jo = null;
if (sys.EDSMID > 0)
jo = edsm.GetBodies(sys.EDSMID); // Colonia
else if (sys.SystemAddress != null && sys.SystemAddress > 0)
jo = edsm.GetBodiesByID64(sys.SystemAddress.Value);
else if (sys.Name != null)
jo = edsm.GetBodies(sys.Name);
if (jo != null && jo["bodies"] != null)
{
foreach (JObject edsmbody in jo["bodies"])
{
try
{
JObject jbody = EDSMClass.ConvertFromEDSMBodies(edsmbody);
JournalScan js = new JournalScan(jbody);
bodies.Add(js);
}
catch (Exception ex)
{
BaseUtils.HttpCom.WriteLog($"Exception Loop: {ex.Message}", "");
BaseUtils.HttpCom.WriteLog($"ETrace: {ex.StackTrace}", "");
Trace.WriteLine($"Exception Loop: {ex.Message}");
Trace.WriteLine($"ETrace: {ex.StackTrace}");
}
}
EDSMBodiesCache[sys.Name] = bodies;
System.Diagnostics.Debug.WriteLine("EDSM Web Lookup complete " + sys.Name + " " + bodies.Count);
return new Tuple<List<JournalScan>, bool>(bodies, false); // not from cache
}
else
{
System.Diagnostics.Debug.WriteLine("EDSM Web Lookup complete no info");
EDSMBodiesCache[sys.Name] = null;
return null;
}
}
}
catch (Exception ex)
{
Trace.WriteLine($"Exception: {ex.Message}");
Trace.WriteLine($"ETrace: {ex.StackTrace}");
}
return null;
}
// Verified Nov 20, by scan panel
private static JObject ConvertFromEDSMBodies(JObject jo) // protect yourself against bad JSON
{
//System.Diagnostics.Debug.WriteLine($"EDSM Body {jo.ToString(true)}");
JObject jout = new JObject
{
["timestamp"] = DateTime.UtcNow.ToStringZuluInvariant(),
["event"] = "Scan",
["EDDFromEDSMBodie"] = true,
["BodyName"] = jo["name"],
["SystemAddress"] = jo["id64"].Long(0),
["WasDiscovered"] = true,
["WasMapped"] = false,
};
if (!jo["discovery"].IsNull()) // much more defense around this.. EDSM gives discovery=null back
{
jout["discovery"] = jo["discovery"];
}
if (jo["orbitalInclination"] != null) jout["OrbitalInclination"] = jo["orbitalInclination"];
if (jo["orbitalEccentricity"] != null) jout["Eccentricity"] = jo["orbitalEccentricity"];
if (jo["argOfPeriapsis"] != null) jout["Periapsis"] = jo["argOfPeriapsis"];
if (jo["semiMajorAxis"].Double() != 0) jout["SemiMajorAxis"] = jo["semiMajorAxis"].Double() * BodyPhysicalConstants.oneAU_m; // AU -> metres
if (jo["orbitalPeriod"].Double() != 0) jout["OrbitalPeriod"] = jo["orbitalPeriod"].Double() * BodyPhysicalConstants.oneDay_s; // days -> seconds
if (jo["rotationalPeriodTidallyLocked"] != null) jout["TidalLock"] = jo["rotationalPeriodTidallyLocked"];
if (jo["axialTilt"] != null) jout["AxialTilt"] = jo["axialTilt"].Double() * Math.PI / 180.0; // degrees -> radians
if (jo["rotationalPeriod"].Double() != 0) jout["RotationalPeriod"] = jo["rotationalPeriod"].Double() * BodyPhysicalConstants.oneDay_s; // days -> seconds
if (jo["surfaceTemperature"] != null) jout["SurfaceTemperature"] = jo["surfaceTemperature"];
if (jo["distanceToArrival"] != null) jout["DistanceFromArrivalLS"] = jo["distanceToArrival"];
if (jo["parents"] != null) jout["Parents"] = jo["parents"];
if (jo["id64"] != null) jout["BodyID"] = jo["id64"].Long() >> 55;
if (!jo["type"].IsNull())
{
if (jo["type"].Str().Equals("Star"))
{
jout["StarType"] = EDSMStar2JournalName(jo["subType"].StrNull()); // pass thru null to code, it will cope with it
jout["Age_MY"] = jo["age"];
jout["StellarMass"] = jo["solarMasses"];
jout["Radius"] = jo["solarRadius"].Double() * BodyPhysicalConstants.oneSolRadius_m; // solar-rad -> metres
}
else if (jo["type"].Str().Equals("Planet"))
{
jout["Landable"] = jo["isLandable"];
jout["MassEM"] = jo["earthMasses"];
jout["SurfaceGravity"] = jo["gravity"].Double() * BodyPhysicalConstants.oneGee_m_s2; // if not there, we get 0
jout["Volcanism"] = jo["volcanismType"];
string atmos = jo["atmosphereType"].StrNull();
if ( atmos != null && atmos.IndexOf("atmosphere",StringComparison.InvariantCultureIgnoreCase)==-1)
atmos += " atmosphere";
jout["Atmosphere"] = atmos;
jout["Radius"] = jo["radius"].Double() * 1000.0; // km -> metres
jout["PlanetClass"] = EDSMPlanet2JournalName(jo["subType"].Str());
if (jo["terraformingState"] != null) jout["TerraformState"] = jo["terraformingState"];
if (jo["surfacePressure"] != null) jout["SurfacePressure"] = jo["surfacePressure"].Double() * BodyPhysicalConstants.oneAtmosphere_Pa; // atmospheres -> pascals
if (jout["TerraformState"].Str() == "Candidate for terraforming")
jout["TerraformState"] = "Terraformable";
}
}
JArray rings = (jo["belts"] ?? jo["rings"]) as JArray;
if (!rings.IsNull())
{
JArray jring = new JArray();
foreach (JObject ring in rings)
{
jring.Add(new JObject
{
["InnerRad"] = ring["innerRadius"].Double() * 1000,
["OuterRad"] = ring["outerRadius"].Double() * 1000,
["MassMT"] = ring["mass"],
["RingClass"] = ring["type"],
["Name"] = ring["name"]
});
}
jout["Rings"] = jring;
}
if (!jo["materials"].IsNull()) // Check if materials has stuff
{
Dictionary<string, double?> mats;
Dictionary<string, double> mats2;
mats = jo["materials"]?.ToObjectQ<Dictionary<string, double?>>();
mats2 = new Dictionary<string, double>();
foreach (string key in mats.Keys)
{
if (mats[key] == null)
mats2[key.ToLowerInvariant()] = 0.0;
else
mats2[key.ToLowerInvariant()] = mats[key].Value;
}
jout["Materials"] = JObject.FromObject(mats2);
}
return jout;
}
private static Dictionary<string, string> EDSM2PlanetNames = new Dictionary<string, string>()
{
// EDSM name (lower case) Journal name
{ "rocky ice world", "Rocky ice body" },
{ "high metal content world" , "High metal content body"},
{ "class i gas giant", "Sudarsky class I gas giant"},
{ "class ii gas giant", "Sudarsky class II gas giant"},
{ "class iii gas giant", "Sudarsky class III gas giant"},
{ "class iv gas giant", "Sudarsky class IV gas giant"},
{ "class v gas giant", "Sudarsky class V gas giant"},
{ "earth-like world", "Earthlike body" },
};
private static Dictionary<string, string> EDSM2StarNames = new Dictionary<string, string>(StringComparer.InvariantCultureIgnoreCase)
{
// EDSM name (lower case) Journal name
{ "a (blue-white super giant) star", "A_BlueWhiteSuperGiant" },
{ "b (blue-white super giant) star", "B_BlueWhiteSuperGiant" },
{ "f (white super giant) star", "F_WhiteSuperGiant" },
{ "g (white-yellow super giant) star", "G_WhiteSuperGiant" },
{ "k (yellow-orange giant) star", "K_OrangeGiant" },
{ "m (red giant) star", "M_RedGiant" },
{ "m (red super giant) star", "M_RedSuperGiant" },
{ "black hole", "H" },
{ "c star", "C" },
{ "cj star", "CJ" },
{ "cn star", "CN" },
{ "herbig ae/be star", "AeBe" },
{ "ms-type star", "MS" },
{ "neutron star", "N" },
{ "s-type star", "S" },
{ "t tauri star", "TTS" },
{ "wolf-rayet c star", "WC" },
{ "wolf-rayet n star", "WN" },
{ "wolf-rayet nc star", "WNC" },
{ "wolf-rayet o star", "WO" },
{ "wolf-rayet star", "W" },
};
private static string EDSMPlanet2JournalName(string inname)
{
return EDSM2PlanetNames.ContainsKey(inname.ToLowerInvariant()) ? EDSM2PlanetNames[inname.ToLowerInvariant()] : inname;
}
private static string EDSMStar2JournalName(string startype)
{
if (startype == null)
startype = "Unknown";
else if (EDSM2StarNames.ContainsKey(startype))
startype = EDSM2StarNames[startype];
else if (startype.StartsWith("White Dwarf (", StringComparison.InvariantCultureIgnoreCase))
{
int start = startype.IndexOf("(") + 1;
int len = startype.IndexOf(")") - start;
if (len > 0)
startype = startype.Substring(start, len);
}
else // Remove extra text from EDSM ex "F (White) Star" -> "F"
{
int index = startype.IndexOf("(");
if (index > 0)
startype = startype.Substring(0, index).Trim();
}
return startype;
}
#endregion
#region Journal Events
public List<string> GetJournalEventsToDiscard() // protect yourself against bad JSON
{
string action = "api-journal-v1/discard";
var response = RequestGet(action);
if (response.Body != null)
return JArray.Parse(response.Body).Select(v => v.Str()).ToList();
else
return null;
}
// Visual inspection Nov 20
public List<JObject> SendJournalEvents(List<JObject> entries, out string errmsg) // protected against bad JSON
{
JArray message = new JArray(entries);
string postdata = "commanderName=" + Uri.EscapeDataString(commanderName) +
"&apiKey=" + Uri.EscapeDataString(apiKey) +
"&fromSoftware=" + Uri.EscapeDataString(SoftwareName) +
"&fromSoftwareVersion=" + Uri.EscapeDataString(fromSoftwareVersion) +
"&message=" + EscapeLongDataString(message.ToString());
// System.Diagnostics.Debug.WriteLine("EDSM Send " + message.ToString());
MimeType = "application/x-www-form-urlencoded";
var response = RequestPost(postdata, "api-journal-v1", handleException: true);
if (response.Error)
{
errmsg = response.StatusCode.ToString();
return null;
}
try
{
JObject resp = JObject.ParseThrowCommaEOL(response.Body);
errmsg = resp["msg"].Str();
int msgnr = resp["msgnum"].Int();
if (msgnr >= 200 || msgnr < 100)
{
return null;
}
return resp["events"].Select(e => (JObject)e).ToList();
}
catch(Exception e)
{
System.Diagnostics.Debug.WriteLine("Failed due to " + e.ToString());
errmsg = e.ToString();
return null;
}
}
#endregion
public static bool DownloadGMOFileFromEDSM(string file)
{
try
{
EDSMClass edsm = new EDSMClass();
string url = EDSMClass.ServerAddress + "en/galactic-mapping/json-edd";
bool newfile;
return BaseUtils.DownloadFile.HTTPDownloadFile(url, file, false, out newfile);
}
catch (Exception ex)
{
System.Diagnostics.Trace.WriteLine("DownloadFromEDSM exception:" + ex.Message);
}
return false;
}
}
}
| 41.798298 | 243 | 0.4825 | [
"Apache-2.0"
] | EDDiscovery/EliteDangerous | EliteDangerous/EDSM/EDSMClass.cs | 47,942 | C# |
using NPOI.OpenXml4Net.Util;
using System;
using System.IO;
using System.Xml;
using System.Xml.Serialization;
namespace NPOI.OpenXmlFormats.Dml
{
[Serializable]
[XmlRoot(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", IsNullable = true)]
[XmlType(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/main")]
public class CT_PathShadeProperties
{
private CT_RelativeRect fillToRectField;
private ST_PathShadeType pathField;
private bool pathFieldSpecified;
[XmlElement(Order = 0)]
public CT_RelativeRect fillToRect
{
get
{
return fillToRectField;
}
set
{
fillToRectField = value;
}
}
[XmlAttribute]
public ST_PathShadeType path
{
get
{
return pathField;
}
set
{
pathField = value;
}
}
[XmlIgnore]
public bool pathSpecified
{
get
{
return pathFieldSpecified;
}
set
{
pathFieldSpecified = value;
}
}
public static CT_PathShadeProperties Parse(XmlNode node, XmlNamespaceManager namespaceManager)
{
if (node == null)
{
return null;
}
CT_PathShadeProperties cT_PathShadeProperties = new CT_PathShadeProperties();
if (node.Attributes["path"] != null)
{
cT_PathShadeProperties.path = (ST_PathShadeType)Enum.Parse(typeof(ST_PathShadeType), node.Attributes["path"].Value);
}
foreach (XmlNode childNode in node.ChildNodes)
{
if (childNode.LocalName == "fillToRect")
{
cT_PathShadeProperties.fillToRect = CT_RelativeRect.Parse(childNode, namespaceManager);
}
}
return cT_PathShadeProperties;
}
internal void Write(StreamWriter sw, string nodeName)
{
sw.Write(string.Format("<a:{0}", nodeName));
XmlHelper.WriteAttribute(sw, "path", path.ToString());
sw.Write(">");
if (fillToRect != null)
{
fillToRect.Write(sw, "fillToRect");
}
sw.Write(string.Format("</a:{0}>", nodeName));
}
}
}
| 20.612903 | 120 | 0.684403 | [
"MIT"
] | iNeverSleeeeep/NPOI-For-Unity | NPOI.OpenXmlFormats.Dml/CT_PathShadeProperties.cs | 1,917 | C# |
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Linq;
namespace Fairweather.Service
{
public class Command_Line_Parser
{
readonly bool allow_switches;
readonly bool switch_parameters;
readonly bool switch_grouping;
readonly char switch_leading_char;
readonly char switch_param_char;
public Command_Line_Parser(
bool allow_switches,
bool switch_parameters,
bool switch_grouping,
char switch_leading_char,
char switch_param_char) {
this.allow_switches = allow_switches;
this.switch_parameters = switch_parameters;
this.switch_grouping = switch_grouping;
this.switch_leading_char = switch_leading_char;
this.switch_param_char = switch_param_char;
}
public void
Parse(string[] argv,
out List<Command_Line_Argument> args,
out Multi_Dict<string, Switch> switches) {
args = new List<Command_Line_Argument>(argv.Length / 2);
switches = new Multi_Dict<string, Switch>(argv.Length / 2);
var str_sw = @"{0}(\w+)(?:{1}(\w+))?".spf(switch_leading_char, switch_param_char);
var rx_sw = new Regex(str_sw, RegexOptions.Compiled);
foreach (var str in argv) {
if (str.Trim().IsNullOrEmpty())
continue;
bool is_switch = allow_switches;
if (is_switch) {
var m = rx_sw.Match(str);
is_switch = m.Success;
if (is_switch) {
var sw_id = m.Groups[1].Value;
var sw_pars = m.Groups[2].Value;
if (!switch_parameters) {
sw_id += sw_pars;
sw_pars = "";
}
var sws = switch_grouping ? sw_id.Select(_c => _c + "") : new[] { sw_id };
var list = switches[sw_id];
foreach (var pair in sws.Mark_Last()) {
var id = pair.First;
var to_add = new Switch(
switch_leading_char + id,
id,
pair.Second ? sw_pars : "");
list.Add(to_add);
}
}
}
if (!is_switch) {
var to_add = new Command_Line_Argument(str.Trim());
args.Add(to_add);
}
}
}
}
} | 29.326531 | 99 | 0.460682 | [
"MIT"
] | staafl/dotnet-bclext | to-integrate/libcs_staaflutil/Classes/Command-line parser/Command_Line_Parser.cs | 2,876 | C# |
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Reclaimed.API.Migrations
{
public partial class counseloradddateupdated : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<DateTimeOffset>(
name: "UpdatedDate",
table: "Counselors",
nullable: false,
defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));
migrationBuilder.UpdateData(
table: "Campers",
keyColumn: "Id",
keyValue: -1,
columns: new[] { "CreatedDate", "UpdatedDate" },
values: new object[] { new DateTimeOffset(new DateTime(2019, 12, 5, 12, 7, 33, 832, DateTimeKind.Unspecified).AddTicks(7030), new TimeSpan(0, -5, 0, 0, 0)), new DateTimeOffset(new DateTime(2019, 12, 5, 12, 7, 33, 832, DateTimeKind.Unspecified).AddTicks(7060), new TimeSpan(0, -5, 0, 0, 0)) });
migrationBuilder.UpdateData(
table: "Events",
keyColumn: "Id",
keyValue: -1,
column: "CreatedDate",
value: new DateTimeOffset(new DateTime(2019, 12, 5, 17, 7, 33, 831, DateTimeKind.Unspecified).AddTicks(8950), new TimeSpan(0, 0, 0, 0, 0)));
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: -2,
columns: new[] { "CreatedDate", "UpdatedDate" },
values: new object[] { new DateTimeOffset(new DateTime(2019, 12, 5, 12, 7, 33, 831, DateTimeKind.Unspecified).AddTicks(7090), new TimeSpan(0, -5, 0, 0, 0)), new DateTimeOffset(new DateTime(2019, 12, 5, 12, 7, 33, 831, DateTimeKind.Unspecified).AddTicks(7110), new TimeSpan(0, -5, 0, 0, 0)) });
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: -1,
columns: new[] { "CreatedDate", "UpdatedDate" },
values: new object[] { new DateTimeOffset(new DateTime(2019, 12, 5, 12, 7, 33, 814, DateTimeKind.Unspecified).AddTicks(9150), new TimeSpan(0, -5, 0, 0, 0)), new DateTimeOffset(new DateTime(2019, 12, 5, 12, 7, 33, 829, DateTimeKind.Unspecified).AddTicks(2670), new TimeSpan(0, -5, 0, 0, 0)) });
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "UpdatedDate",
table: "Counselors");
migrationBuilder.UpdateData(
table: "Campers",
keyColumn: "Id",
keyValue: -1,
columns: new[] { "CreatedDate", "UpdatedDate" },
values: new object[] { new DateTimeOffset(new DateTime(2019, 12, 5, 11, 43, 6, 440, DateTimeKind.Unspecified).AddTicks(9070), new TimeSpan(0, -5, 0, 0, 0)), new DateTimeOffset(new DateTime(2019, 12, 5, 11, 43, 6, 440, DateTimeKind.Unspecified).AddTicks(9100), new TimeSpan(0, -5, 0, 0, 0)) });
migrationBuilder.UpdateData(
table: "Events",
keyColumn: "Id",
keyValue: -1,
column: "CreatedDate",
value: new DateTimeOffset(new DateTime(2019, 12, 5, 16, 43, 6, 440, DateTimeKind.Unspecified).AddTicks(1050), new TimeSpan(0, 0, 0, 0, 0)));
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: -2,
columns: new[] { "CreatedDate", "UpdatedDate" },
values: new object[] { new DateTimeOffset(new DateTime(2019, 12, 5, 11, 43, 6, 439, DateTimeKind.Unspecified).AddTicks(9190), new TimeSpan(0, -5, 0, 0, 0)), new DateTimeOffset(new DateTime(2019, 12, 5, 11, 43, 6, 439, DateTimeKind.Unspecified).AddTicks(9200), new TimeSpan(0, -5, 0, 0, 0)) });
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: -1,
columns: new[] { "CreatedDate", "UpdatedDate" },
values: new object[] { new DateTimeOffset(new DateTime(2019, 12, 5, 11, 43, 6, 424, DateTimeKind.Unspecified).AddTicks(6980), new TimeSpan(0, -5, 0, 0, 0)), new DateTimeOffset(new DateTime(2019, 12, 5, 11, 43, 6, 437, DateTimeKind.Unspecified).AddTicks(6700), new TimeSpan(0, -5, 0, 0, 0)) });
}
}
}
| 55.839506 | 309 | 0.567544 | [
"MIT"
] | CandeeGenerations/candee-camp | api/Migrations/20191205170734_counselor-add-date-updated.cs | 4,525 | C# |
namespace Core.Blocks
{
using System;
public class Block
{
// The top left starting point of the block
private int x = 0;
private int y = 0;
private int[][] model;
public Block(int x, int y, int[][] model)
{
this.X = x;
this.Y = y;
this.Model = model;
}
// Do not touch this property!
public int X
{
get
{
return this.x;
}
set
{
if (x < 0)
throw new ArgumentException("The x of the block cannot be less than 0");
if (x > Console.WindowWidth)
throw new ArgumentException($"The x of the block cannot be greater than the Console's Width {Console.WindowWidth}");
this.x = value;
}
}
public int Y
{
get
{
return this.y;
}
set
{
if (y < 0)
throw new ArgumentException("The y of the block cannot be less than 0");
if (y > Console.WindowHeight)
throw new ArgumentException($"The y of the block cannot be greater than the Console's Height {Console.WindowHeight}");
this.y = value;
}
}
// Do not touch this property!
public int[][] Model
{
get
{
return this.model;
}
set
{
this.model = value;
}
}
}
}
| 23.942029 | 138 | 0.41586 | [
"MIT"
] | Team-YoNi/Tetris-YoNi | Core/Blocks/Block.cs | 1,654 | C# |
using System.Collections.Generic;
using Umbraco.Core;
using Umbraco.Core.Logging;
using Umbraco.Core.Models.Editors;
using Umbraco.Core.PropertyEditors;
namespace Umbraco.Web.PropertyEditors
{
/// <summary>
/// Represents a media picker property editor.
/// </summary>
[DataEditor(
Constants.PropertyEditors.Aliases.MediaPicker,
EditorType.PropertyValue | EditorType.MacroParameter,
"Media Picker",
"mediapicker",
ValueType = ValueTypes.Text,
Group = Constants.PropertyEditors.Groups.Media,
Icon = Constants.Icons.MediaImage)]
public class MediaPickerPropertyEditor : DataEditor
{
/// <summary>
/// Initializes a new instance of the <see cref="MediaPickerPropertyEditor"/> class.
/// </summary>
public MediaPickerPropertyEditor(ILogger logger)
: base(logger)
{
}
/// <inheritdoc />
protected override IConfigurationEditor CreateConfigurationEditor() => new MediaPickerConfigurationEditor();
protected override IDataValueEditor CreateValueEditor() => new MediaPickerPropertyValueEditor(Attribute);
internal class MediaPickerPropertyValueEditor : DataValueEditor, IDataValueReference
{
public MediaPickerPropertyValueEditor(DataEditorAttribute attribute) : base(attribute)
{
}
public IEnumerable<UmbracoEntityReference> GetReferences(object value)
{
var asString = value is string str ? str : value?.ToString();
if (string.IsNullOrEmpty(asString)) yield break;
foreach (var udiStr in asString.Split(Constants.CharArrays.Comma))
{
if (Udi.TryParse(udiStr, out var udi))
yield return new UmbracoEntityReference(udi);
}
}
}
}
}
| 32.576271 | 116 | 0.635276 | [
"MIT"
] | AaronSadlerUK/Umbraco-CMS | src/Umbraco.Web/PropertyEditors/MediaPickerPropertyEditor.cs | 1,924 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Xml;
using System.Xml.XPath;
namespace OfdbParser
{
public static class XPathHelper
{
public static List<string> GetXPathValue(XmlDocument xmlDocument, string xPath)
{
XPathNavigator nav = xmlDocument.CreateNavigator();
// Compile a standard XPath expression
XPathExpression expr;
expr = nav.Compile(xPath);
XPathNodeIterator iterator = nav.Select(expr);
var result = new List<string>();
while (iterator.MoveNext())
{
result.Add(iterator.Current.OuterXml);
}
return result;
}
public static XmlDocument GenerateXmlDocument (string SourceString)
{
XmlDocument xDoc = new XmlDocument();
xDoc.LoadXml(SourceString);
return xDoc;
}
public static string EscapeJavaScript(string SourceString)
{
var regex = new Regex("(.+)(onmouseover=\"Tip\\(.+?\\)\")(.+)");
var match = regex.Match(SourceString);
if (match.Success)
{
var decodedString = match.Groups[2].Value.Replace("<", "<").Replace(">", ">");
//var decodedString = HtmlAgilityPack.HtmlDocument.GetXmlName(match.Groups[2].Value);
SourceString = match.Groups[1].Value + decodedString + match.Groups[3].Value;
}
return SourceString;
}
}
}
| 27.866667 | 101 | 0.573565 | [
"MIT"
] | Amoenus/MovieSearchEngine | OfdbParser/XPathHelper.cs | 1,674 | C# |
using Mapsui.Layers;
namespace Mapsui.Extensions
{
public static class FetchInfoExtensions
{
public static Viewport ToViewport(this FetchInfo fetchInfo)
{
return Viewport.Create(fetchInfo.Extent, fetchInfo.Resolution);
}
}
}
| 21.153846 | 75 | 0.669091 | [
"MIT"
] | rafntor/Mapsui | Mapsui/Extensions/FetchInfoExtensions.cs | 277 | C# |
namespace SqlStreamStore
{
using System;
using System.Runtime.ExceptionServices;
using System.Threading;
using System.Threading.Tasks;
using Npgsql;
using SqlStreamStore.PgSqlScriptsV1;
using SqlStreamStore.Streams;
partial class PostgresStreamStore
{
protected override async Task<AppendResult> AppendToStreamInternal(
string streamId,
int expectedVersion,
NewStreamMessage[] messages,
CancellationToken cancellationToken)
{
int maxRetries = 2; //TODO too much? too little? configurable?
Exception exception;
int retryCount = 0;
do
{
try
{
AppendResult result;
var streamIdInfo = new StreamIdInfo(streamId);
using(var connection = await OpenConnection(cancellationToken))
using(var transaction = connection.BeginTransaction())
using(var command = BuildFunctionCommand(
_schema.AppendToStream,
transaction,
Parameters.StreamId(streamIdInfo.PostgresqlStreamId),
Parameters.StreamIdOriginal(streamIdInfo.PostgresqlStreamId),
Parameters.MetadataStreamId(streamIdInfo.MetadataPosgresqlStreamId),
Parameters.ExpectedVersion(expectedVersion),
Parameters.CreatedUtc(_settings.GetUtcNow?.Invoke()),
Parameters.NewStreamMessages(messages)))
{
try
{
using(var reader = await command
.ExecuteReaderAsync(cancellationToken)
.ConfigureAwait(false))
{
await reader.ReadAsync(cancellationToken).ConfigureAwait(false);
result = new AppendResult(reader.GetInt32(0), reader.GetInt64(1));
}
await transaction.CommitAsync(cancellationToken).ConfigureAwait(false);
}
catch(PostgresException ex) when(ex.IsWrongExpectedVersion())
{
await transaction.RollbackAsync(cancellationToken).ConfigureAwait(false);
throw new WrongExpectedVersionException(
ErrorMessages.AppendFailedWrongExpectedVersion(streamIdInfo.PostgresqlStreamId.IdOriginal, expectedVersion),
streamIdInfo.PostgresqlStreamId.IdOriginal,
expectedVersion,
ex);
}
}
if(_settings.ScavengeAsynchronously)
{
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
Task.Run(() => TryScavenge(streamIdInfo, cancellationToken), cancellationToken);
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
}
else
{
await TryScavenge(streamIdInfo, cancellationToken).ConfigureAwait(false);
}
return result;
}
catch(PostgresException ex) when(ex.IsDeadlock())
{
exception = ex;
retryCount++;
}
} while(retryCount < maxRetries);
ExceptionDispatchInfo.Capture(exception).Throw();
return default; // never actually run
}
}
}
| 43.021739 | 140 | 0.525518 | [
"MIT"
] | ArneSchoonvliet/SQLStreamStore | src/SqlStreamStore.Postgres/PostgresStreamStore.Append.cs | 3,960 | C# |
/* Copyright 2019-present MongoDB Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using System;
using System.Collections.Generic;
using MongoDB.Bson;
using MongoDB.Driver.Core;
using MongoDB.Driver.Core.TestHelpers.JsonDrivenTests;
namespace MongoDB.Driver.Tests.Specifications.Runner
{
public abstract class MongoClientJsonDrivenSessionsTestRunner : MongoClientJsonDrivenTestRunnerBase
{
private const string SessionIdKeySuffix = "__ClientSessionId";
protected override string[] ExpectedTestColumns => new[] { "description", "clientOptions", "useMultipleMongoses", "failPoint", "sessionOptions", "operations", "expectations", "outcome", "async" };
// protected methods
protected override void TestInitialize(MongoClient client, BsonDocument test, BsonDocument shared)
{
base.TestInitialize(client, test, shared);
KillAllSessions();
}
protected override void AssertEvent(object actualEvent, BsonDocument expectedEvent)
{
base.AssertEvent(
actualEvent,
expectedEvent,
(actual, expected) =>
{
RecursiveFieldSetter.SetAll(
expected,
"lsid",
value =>
{
if (ObjectMap.TryGetValue(value.AsString + SessionIdKeySuffix, out var sessionId))
{
return (BsonValue)sessionId;
}
else
{
return value;
}
});
});
}
protected override void ExecuteOperations(IMongoClient client, Dictionary<string, object> objectMap, BsonDocument test, EventCapturer eventCapturer = null)
{
var newItems = new Dictionary<string, object>();
foreach (var mapItem in objectMap)
{
// Save session ids to have their values when the session will be disposed.
if (mapItem.Value is IClientSessionHandle clientSessionHandle)
{
newItems.Add(mapItem.Key + SessionIdKeySuffix, clientSessionHandle.ServerSession.Id);
}
}
foreach (var newItem in newItems)
{
objectMap.Add(newItem.Key, newItem.Value);
}
base.ExecuteOperations(client, objectMap, test, eventCapturer);
}
protected void KillAllSessions()
{
var client = DriverTestConfiguration.Client;
var adminDatabase = client.GetDatabase("admin");
var command = BsonDocument.Parse("{ killAllSessions : [] }");
try
{
adminDatabase.RunCommand<BsonDocument>(command);
}
catch (MongoCommandException)
{
// ignore MongoCommandExceptions
}
}
protected IClientSessionHandle StartSession(IMongoClient client, BsonDocument test, string sessionKey)
{
var options = ParseSessionOptions(test, sessionKey);
return client.StartSession(options);
}
// private methods
private ClientSessionOptions ParseSessionOptions(BsonDocument test, string sessionKey)
{
var options = new ClientSessionOptions();
if (test.Contains("sessionOptions"))
{
var sessionOptions = test["sessionOptions"].AsBsonDocument;
if (sessionOptions.Contains(sessionKey))
{
foreach (var option in sessionOptions[sessionKey].AsBsonDocument)
{
switch (option.Name)
{
case "causalConsistency":
options.CausalConsistency = option.Value.ToBoolean();
break;
case "defaultTransactionOptions":
options.DefaultTransactionOptions = ParseTransactionOptions(option.Value.AsBsonDocument);
break;
default:
throw new FormatException($"Unexpected session option: \"{option.Name}\".");
}
}
}
}
return options;
}
private TransactionOptions ParseTransactionOptions(BsonDocument document)
{
ReadConcern readConcern = null;
ReadPreference readPreference = null;
WriteConcern writeConcern = null;
foreach (var element in document)
{
switch (element.Name)
{
case "readConcern":
readConcern = ReadConcern.FromBsonDocument(element.Value.AsBsonDocument);
break;
case "readPreference":
readPreference = ReadPreference.FromBsonDocument(element.Value.AsBsonDocument);
break;
case "writeConcern":
writeConcern = WriteConcern.FromBsonDocument(element.Value.AsBsonDocument);
break;
default:
throw new ArgumentException($"Invalid field: {element.Name}.");
}
}
return new TransactionOptions(readConcern, readPreference, writeConcern);
}
}
}
| 38.165644 | 204 | 0.545732 | [
"Apache-2.0"
] | Anarh2404/mongo-csharp-driver | tests/MongoDB.Driver.Tests/Specifications/Runner/MongoClientJsonDrivenSessionsTestRunner.cs | 6,223 | C# |
using Microsoft.AspNetCore.Mvc;
namespace Rhendaria.Web.Extensions
{
public static class ControllerExtensions
{
public static string NameOf<TController>(this ControllerBase controller) where TController : ControllerBase
{
return typeof(TController).Name.Replace(nameof(Controller), string.Empty);
}
}
}
| 27.153846 | 115 | 0.705382 | [
"MPL-2.0"
] | JustMeGaaRa/rhendaria | src/Rhendaria.Web/Extensions/ControllerExtensions.cs | 355 | C# |
using System.Linq;
using System.Text;
using System.Globalization;
namespace Delta.Icao
{
internal static class StringExtensions
{
/// <summary>
/// Removes the diacritics from the input string.
/// </summary>
/// <remarks>
/// For example, the following string:
/// <b><![CDATA["aàâä-eéèêë-iïî-oöô-uùüû-yÿ-ç"]]></b>
/// would be replaced by
/// <b><![CDATA["aaaa-eeeee-iii-ooo-uuuu-yy-c"]]></b>
/// </remarks>
/// <param name="input">The input string.</param>
/// <returns>The cleaned-up string.</returns>
public static string RemoveDiacritics(this string input)
{
var builder = new StringBuilder();
var characters = input
.Normalize(NormalizationForm.FormD)
.Where(c =>
{
var category = CharUnicodeInfo.GetUnicodeCategory(c);
return category != UnicodeCategory.NonSpacingMark;
});
return builder
.Append(characters.ToArray())
.ToString()
.Normalize(NormalizationForm.FormC);
}
/// <summary>
/// Returns a copy of the specified string converted to uppercase using the casing rules of
/// the invariant culture and after having removed all the diacritics (<see cref="RemoveDiacritics"/>).
/// </summary>
/// <param name="input">The input string.</param>
/// <returns>The uppercase equivalent of the specified string.</returns>
public static string ToUpperInvariantNoDiacritics(this string input) => input.RemoveDiacritics().ToUpperInvariant();
}
}
| 37.391304 | 124 | 0.573837 | [
"MIT"
] | odalet/CertXplorer | src/Delta.Icao/mrz/StringExtensions.cs | 1,738 | C# |
using Unity.Collections;
using Unity.Jobs;
using UnityEngine;
using Unity.Mathematics;
using static MeshBuilder.Utils;
using DataInstance = MeshBuilder.MeshCombinationBuilder.DataInstance;
using PieceTransform = MeshBuilder.Tile.PieceTransform;
namespace MeshBuilder
{
abstract public class TileMesherBase<TileVariant> : Builder where TileVariant : struct
{
public enum Type { Mesher2D, Mesher3D }
protected enum GenerationType
{
/// <summary>
/// Generate the data for the tiles and dispose of it after the mesh is ready,
/// the current meshers don't generate considerable amount of data in most cases
/// but if the mesh is static, there is no need to keep it in memory,
/// it may be also useful if there is a lot of chunks
/// </summary>
FromDataUncached,
/// <summary>
/// Generate the data for the tiles and keep it in memory, it's less work, and if there is
/// randomness in the tile variants they don't change with every regeneration of the mesh
/// </summary>
FromDataCachedTiles,
/// <summary>
/// The tiles aren't generated by the mesher, they are loaded from somewhere else
/// </summary>
FromTiles
}
private TileTheme theme;
public TileTheme Theme
{
get { return theme; }
protected set
{
if (theme != value)
{
theme?.Release();
theme = value;
theme?.Retain();
}
}
}
// the preferred mesh builder is the deferred version of the MeshCombinationBuilder class
// this is also the default
// the unity version is kept here in case the TileMesher needs a feature the MeshCombinationBuilder doesn't handle (and as a reference)
protected enum CombinationMode
{
UnityBuiltIn, CombinationBuilder, DeferredCombinationBuilder
}
protected CombinationMode combinationMode = CombinationMode.DeferredCombinationBuilder;
// in the data volume we're generating the mesh
// for this value
public int FillValue { get; protected set; }
protected Extents dataExtents;
protected Extents tileExtents;
protected GenerationType generationType = GenerationType.FromDataUncached;
private TileThemePalette themePalette;
public TileThemePalette ThemePalette
{
get { return themePalette; }
protected set
{
themePalette = value;
themePalette?.Init();
}
}
// GENERATED DATA
protected Volume<TileVariant> tiles;
protected MeshCombinationBuilder combinationBuilder;
// TEMP DATA
private NativeList<MeshInstance> tempMeshInstanceList;
private NativeList<DataInstance> tempDataInstanceList;
override protected void EndGeneration(Mesh mesh)
{
// the temp lists are added to Temps and will be disposed
// that's why they are only set to default
if (combinationMode == CombinationMode.UnityBuiltIn)
{
if (tempMeshInstanceList.IsCreated)
{
CombineMeshes(mesh, tempMeshInstanceList, Theme);
tempMeshInstanceList = default;
}
else
{
Debug.LogError("There was no tempMeshInstanceList to combine!");
}
}
else
{
if (tempDataInstanceList.IsCreated)
{
combinationBuilder.Complete(mesh);
tempDataInstanceList = default;
}
else
{
Debug.LogError("There was no tempDataInstanceList created!");
}
}
if (generationType == GenerationType.FromDataUncached)
{
SafeDispose(ref tiles);
}
}
override public void Dispose()
{
base.Dispose();
SafeDispose(ref tiles);
Theme?.Release();
Theme = null;
ThemePalette = null;
}
// collect the data for combination
// the MeshInstance contains the data for the unity CombineInstance version
// the DataInstance contains the data for the custom version
abstract protected JobHandle ScheduleFillMeshInstanceList(NativeList<MeshInstance> resultList, JobHandle dependOn);
abstract protected JobHandle ScheduleFillDataInstanceList(NativeList<DataInstance> resultList, JobHandle dependOn);
protected JobHandle ScheduleMeshCombination(JobHandle dependOn)
{
if (combinationMode == CombinationMode.UnityBuiltIn)
{
tempMeshInstanceList = new NativeList<MeshInstance>(Allocator.TempJob);
AddTemp(tempMeshInstanceList);
dependOn = ScheduleFillMeshInstanceList(tempMeshInstanceList, dependOn);
}
else
{
tempDataInstanceList = new NativeList<DataInstance>(Allocator.TempJob);
AddTemp(tempDataInstanceList);
dependOn = ScheduleFillDataInstanceList(tempDataInstanceList, dependOn);
if (combinationMode == CombinationMode.DeferredCombinationBuilder)
{
dependOn = ScheduleDeferredCombineMeshes(tempDataInstanceList, Theme, dependOn);
}
else
{
dependOn.Complete();
dependOn = ScheduleCombineMeshes(tempDataInstanceList, Theme, default);
}
}
return dependOn;
}
/// <summary>
/// Combines the mesh instance array int a single mesh, using the base pieces from the theme.
/// It merges the submeshes properly (a submesh in the piece will be in the same submesh in the result mesh).
/// </summary>
/// <param name="mesh">The result will be generated into this</param>
/// <param name="instanceData">Input data. NOTE: the MeshInstance structs have to be initialized, except for the mesh field of the CombineInstance struct, this will be set from the theme.</param>
/// <param name="theme">Theme which provides the base mesh pieces.</param>
static protected void CombineMeshes(Mesh mesh, NativeArray<MeshInstance> instanceData, TileTheme theme)
{
var basePieces = theme.BaseVariants;
using (var combineList = new NativeList<CombineInstance>(instanceData.Length, Allocator.Temp))
using (var currentList = new NativeList<CombineInstance>(instanceData.Length, Allocator.Temp))
{
int maxSubMeshCount = 0;
for (int i = 0; i < instanceData.Length; ++i)
{
var data = instanceData[i];
if (data.basePieceIndex >= 0)
{
var variants = basePieces[data.basePieceIndex].Variants;
var variantMesh = variants[data.variantIndex];
if (variantMesh != null)
{
maxSubMeshCount = Mathf.Max(maxSubMeshCount, variantMesh.subMeshCount);
for (int subIndex = 0; subIndex < variantMesh.subMeshCount; ++subIndex)
{
combineList.Add(new CombineInstance { transform = data.transform, mesh = variantMesh, subMeshIndex = subIndex });
}
}
}
}
CombineInstance[] submeshInstArray = new CombineInstance[maxSubMeshCount];
int currentSubIndex = 0;
while (combineList.Length > 0 && currentSubIndex < maxSubMeshCount)
{
currentList.Clear();
for (int i = combineList.Length - 1; i >= 0 ; --i)
{
if (combineList[i].subMeshIndex == currentSubIndex)
{
currentList.Add(combineList[i]);
combineList.RemoveAtSwapBack(i);
}
}
var subMesh = new Mesh();
subMesh.indexFormat = UnityEngine.Rendering.IndexFormat.UInt32;
subMesh.CombineMeshes(currentList.ToArray(), true, true);
submeshInstArray[currentSubIndex] = new CombineInstance { mesh = subMesh };
++currentSubIndex;
}
mesh.CombineMeshes(submeshInstArray, false, false);
}
}
protected JobHandle ScheduleCombineMeshes(NativeArray<MeshInstance> instanceData, TileTheme theme, JobHandle dependOn)
{
var instanceArray = new NativeArray<DataInstance>(instanceData.Length, Allocator.TempJob, NativeArrayOptions.UninitializedMemory);
AddTemp(instanceArray);
for (int i = 0; i < instanceData.Length; ++i)
{
var data = instanceData[i];
instanceArray[i] = new DataInstance()
{
dataOffsets = theme.TileThemeCache.GetMeshDataOffset(data.basePieceIndex, data.variantIndex),
transform = instanceData[i].transform
};
}
return ScheduleCombineMeshes(instanceArray, theme, dependOn);
}
protected JobHandle ScheduleCombineMeshes(NativeArray<DataInstance> instanceArray, TileTheme theme, JobHandle dependOn)
{
combinationBuilder = new MeshCombinationBuilder();
AddTemp(combinationBuilder);
combinationBuilder.Init(instanceArray, theme);
dependOn = combinationBuilder.Start(dependOn);
return dependOn;
}
protected JobHandle ScheduleDeferredCombineMeshes(NativeList<DataInstance> instanceList, TileTheme theme, JobHandle dependOn)
{
combinationBuilder = new MeshCombinationBuilder();
AddTemp(combinationBuilder);
combinationBuilder.InitDeferred(instanceList, theme);
dependOn = combinationBuilder.Start(dependOn);
return dependOn;
}
protected bool HasTilesData { get { return tiles != null && !tiles.IsDisposed; } }
private const byte RotationMask = (byte)(PieceTransform.Rotate90 | PieceTransform.Rotate180 | PieceTransform.Rotate270);
private const byte MirrorMask = (byte)PieceTransform.MirrorXYZ;
static protected void MirrorMatrix(PieceTransform pieceTransform, ref float4x4 m)
{
byte mirror = (byte)((byte)pieceTransform & MirrorMask);
switch (mirror)
{
case (byte)PieceTransform.MirrorX: m.c0.x *= -1; m.c1.x *= -1; m.c2.x *= -1; break;
case (byte)PieceTransform.MirrorY: m.c0.y *= -1; m.c1.y *= -1; m.c2.y *= -1; break;
case (byte)PieceTransform.MirrorZ: m.c0.z *= -1; m.c1.z *= -1; m.c2.z *= -1; break;
}
}
static protected float4x4 ToRotationMatrix(PieceTransform pieceTransform)
{
byte rotation = (byte)((byte)pieceTransform & RotationMask);
switch (rotation)
{
case (byte)PieceTransform.Rotate90: return float4x4.RotateY(math.radians(-90));
case (byte)PieceTransform.Rotate180: return float4x4.RotateY(math.radians(-180));
case (byte)PieceTransform.Rotate270: return float4x4.RotateY(math.radians(-270));
}
return float4x4.identity;
}
static protected bool HasFlag(PieceTransform transform, PieceTransform flag)
{
return (byte)(transform & flag) != 0;
}
static protected float4x4 CreateTransform(float3 pos, PieceTransform pieceTransform)
{
float4x4 transform = ToRotationMatrix(pieceTransform);
if (HasFlag(pieceTransform, PieceTransform.MirrorX)) { MirrorMatrix(PieceTransform.MirrorX, ref transform); }
if (HasFlag(pieceTransform, PieceTransform.MirrorY)) { MirrorMatrix(PieceTransform.MirrorY, ref transform); }
transform.c3.x = pos.x;
transform.c3.y = pos.y;
transform.c3.z = pos.z;
return transform;
}
/// <summary>
/// Contains data for rendering a mesh piece. The matrix and indices are usually
/// set earlier from a job, then later the indices are used to set the mesh.
/// (Since the mesh objects can't be handled inside the jobs.)
/// These MeshInstance struct will be combined into the final mesh.
/// </summary>
protected struct MeshInstance
{
public float4x4 transform;
public int basePieceIndex;
public byte variantIndex;
}
}
}
| 40.195195 | 203 | 0.576018 | [
"MIT"
] | hbence/MeshBuilder | builders/tile_mesher/TileMesherBase.cs | 13,387 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace console_colors
{
class Program
{
static void Print(string[] left, string[] right, int rightAt)
{
if (left.Length != right.Length)
throw new ArgumentException(String.Format("Argument lengths do not match ({0} != {1})", left.Length, right.Length));
for (int i = 0; i < left.Length; i++)
{
Console.Write(left[i]);
Console.CursorLeft = rightAt;
Console.WriteLine(right[i]);
}
Console.WriteLine();
}
static string[] GetStandardColorTable()
{
string sep = "".PadRight(6 + 7 * 8, '-');
string text = string.Concat("Standard Colors ( \\x1b[<fg>;<bg>m )\n", sep, "\n");
int[] flags = new int[] { 0, 1 };
text += "fg\\bg|";
for (int bgColor = 0; bgColor < 8; bgColor++)
{
int bg = 40 + bgColor;
text += string.Format("{0,6} ", bg);
}
text += string.Format("\n{0}\n", sep);
for (int fgColor = 0; fgColor < 8; fgColor++)
{
int fg = 30 + fgColor;
text += string.Format("{0,5}|", fg);
for (int bgColor = 0; bgColor < 8; bgColor++)
{
int bg = 40 + bgColor;
string code = string.Format("{0};{1}", fg, bg);
text += string.Format("\x1b[{0}m{0,6}\x1b[0m ", code);
}
text += "\n";
}
text += sep;
return text.Split('\n');
}
static string[] GetStandardColorTableWithBrightFlag()
{
string sep = "".PadRight(6 + 7 * 8, '-');
string text = string.Concat("Standard Colors with Bright flag ( \\x1b[<fg>;<bg>;1m )\n", sep, "\n");
int[] flags = new int[] { 0, 1 };
text += "fg\\bg|";
for (int bgColor = 0; bgColor < 8; bgColor++)
{
int bg = 40 + bgColor;
text += string.Format("{0,6} ", bg);
}
text += string.Format("\n{0}\n", sep);
for (int fgColor = 0; fgColor < 8; fgColor++)
{
int fg = 30 + fgColor;
text += string.Format("{0,5}|", fg);
for (int bgColor = 0; bgColor < 8; bgColor++)
{
int bg = 40 + bgColor;
string code = string.Format("{0};{1}", fg, bg);
text += string.Format("\x1b[{0};1m{0,6}\x1b[0m ", code);
}
text += "\n";
}
text += sep;
return text.Split('\n');
}
static string[] Get256ColorTableForeground()
{
string sep = "".PadRight(4 + 3 * 16, '-');
string text = string.Concat("Extended Foreground Colors 256 ( \\x1b[38;5;<fg>m )\n", sep, "\n");
text += "h\\l|";
for (byte low = 0; low < 16; low++)
{
text += string.Format("{0:X2} ", low);
}
text += string.Format("\n{0}\n", sep);
for (byte high = 0; high < 16; high++)
{
text += string.Format(" {0:X2}|", high << 4);
for (byte low = 0; low < 16; low++)
{
int color = high << 4 | low;
string code = string.Format("38;5;{0}", color);
text += string.Format("\x1b[{0}m{1:X2}\x1b[0m ", code, color);
}
text += "\n";
}
text += sep;
return text.Split('\n');
}
static string[] Get256ColorTableBackground()
{
string sep = "".PadRight(4 + 3 * 16, '-');
string text = string.Concat("Extended Background Colors 256 ( \\x1b[48;5;<fg>m )\n", sep, "\n");
text += "h\\l|";
for (byte low = 0; low < 16; low++)
{
text += string.Format("{0:X2} ", low);
}
text += string.Format("\n{0}\n", sep);
for (byte high = 0; high < 16; high++)
{
text += string.Format(" {0:X2}|", high << 4);
for (byte low = 0; low < 16; low++)
{
int color = high << 4 | low;
string code = string.Format("48;5;{0}", color);
text += string.Format("\x1b[{0}m{1:X2}\x1b[0m ", code, color);
}
text += "\n";
}
text += sep;
return text.Split('\n');
}
static void Main(string[] args)
{
int middle = Console.WindowWidth / 2 - 1;
Print(GetStandardColorTable(), GetStandardColorTableWithBrightFlag(), middle);
Print(Get256ColorTableForeground(), Get256ColorTableBackground(), middle);
}
}
}
| 36.76259 | 132 | 0.419569 | [
"MIT"
] | Paulius-Maruska/dotnet-playground | console-colors/Program.cs | 5,112 | C# |
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using NUnit.Framework;
using ProtoBuf;
using ProtoBuf.Meta;
namespace Examples
{
interface IExtTest
{
string Bof { get; set; }
string Eof { get; set; }
}
[ProtoContract]
class InterfaceBased : object, ProtoBuf.IExtensible, IExtTest, System.ComponentModel.INotifyPropertyChanged
{
[ProtoMember(1)]
public string Bof { get; set; }
private string eof;
[ProtoMember(99, DataFormat = ProtoBuf.DataFormat.Default)]
public string Eof
{
get { return eof;}
set
{
eof = value;
OnPropertyChanged("Eof");
}
}
private IExtension extensionObject;
IExtension IExtensible.GetExtensionObject(bool createIfMissing)
{
return Extensible.GetExtensionObject(ref extensionObject, createIfMissing);
}
public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
protected virtual void OnPropertyChanged(string propertyName)
{
if(PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
[ProtoContract]
class SmallerObject : Extensible, IExtTest
{
[ProtoMember(1)]
public string Bof { get; set; }
[ProtoMember(99)]
public string Eof { get; set; }
}
[ProtoContract]
class BiggerObject
{
[ProtoMember(1)]
public string Bof { get; set; }
[ProtoMember(2)]
public int SomeInt32 { get; set; }
[ProtoMember(3)]
public float SomeFloat { get; set; }
[ProtoMember(4)]
public double SomeDouble { get; set; }
[ProtoMember(5)]
public byte[] SomeBlob { get; set; }
[ProtoMember(6)]
public string SomeString { get; set; }
[ProtoMember(99)]
public string Eof { get; set; }
}
[TestFixture]
public class Extensibility
{
[Test]
public void TestExpectedMakeFromScratchOutput()
{
var canHaz = new CanHazData {
A = "abc", B = 456.7F, C = 123
};
Assert.IsTrue(Program.CheckBytes(canHaz, RuntimeTypeModel.Default, new byte[] {
0x0A, 0x03, 0x61, 0x62, 0x63, // abc
0x15, 0x9A, 0x59, 0xE4, 0x43, // 456.7F
0x1D, 0x7B, 0x00, 0x00, 0x00 // 123
}));
}
[Test]
public void MakeFromScratch()
{
var model = RuntimeTypeModel.Create();
model.Add(typeof(Naked), true);
model.Add(typeof(CanHazData), true)[3].IsStrict = true;
MakeFromScratch(model, "Runtime");
model.CompileInPlace();
MakeFromScratch(model, "CompileInPlace");
MakeFromScratch(model.Compile(), "Compile");
}
static void MakeFromScratch(TypeModel model, string caption)
{
var obj = new Naked();
try
{
Extensible.AppendValue(model, obj, 1, DataFormat.Default, "abc");
Extensible.AppendValue(model, obj, 2, DataFormat.Default, 456.7F);
Extensible.AppendValue(model, obj, 3, DataFormat.FixedSize, 123);
CanHazData clone;
using (var ms = new MemoryStream())
{
model.Serialize(ms, obj);
string s = Program.GetByteString(ms.ToArray());
Assert.AreEqual("0A 03 61 62 63 15 9A 59 E4 43 1D 7B 00 00 00", s, caption);
ms.Position = 0;
clone = (CanHazData) model.Deserialize(ms, null, typeof(CanHazData));
}
Assert.AreEqual("abc", clone.A, caption);
Assert.AreEqual(456.7F, clone.B, caption);
Assert.AreEqual(123, clone.C, caption);
}
catch
{
Debug.WriteLine(caption);
throw;
}
}
[ProtoContract]
public class Naked : Extensible
{
}
[ProtoContract]
public class CanHazData
{
[ProtoMember(1)] public string A {get;set;}
[ProtoMember(2)] public float B { get; set; }
[ProtoMember(3, DataFormat = DataFormat.FixedSize)] public int C { get; set; }
}
internal static BiggerObject GetBigObject()
{
return new BiggerObject
{
Bof = "BOF",
SomeBlob = new byte[] { 0x01, 0x02, 0x03, 0x04, 0x05 },
SomeDouble = double.MaxValue / 2,
SomeFloat = float.MinValue / 2,
SomeInt32 = (int.MaxValue / 3) * 2,
SomeString = "abcdefghijklmnopqrstuvwxyz",
Eof = "EOF"
};
}
[Test]
public void TestRoundtripSmaller()
{
TestRoundTrip<SmallerObject>();
}
[Test]
public void TestRoundtripInterfaceBased()
{
TestRoundTrip<InterfaceBased>();
}
static void TestRoundTrip<T>() where T : IExtTest, IExtensible, new() {
BiggerObject obj = GetBigObject();
T tmp = Serializer.ChangeType<BiggerObject, T>(obj);
Assert.AreEqual(obj.Bof, tmp.Bof, "dehydrate");
Assert.AreEqual(obj.Eof, tmp.Eof, "dehydrate");
BiggerObject clone = Serializer.ChangeType<T, BiggerObject>(tmp);
Assert.AreEqual(obj.Bof, clone.Bof, "rehydrate");
Assert.AreEqual(obj.Eof, clone.Eof, "rehydrate");
Assert.AreEqual(obj.SomeDouble, clone.SomeDouble, "rehydrate");
Assert.AreEqual(obj.SomeFloat, clone.SomeFloat, "rehydrate");
Assert.AreEqual(obj.SomeInt32, clone.SomeInt32, "rehydrate");
Assert.AreEqual(obj.SomeString, clone.SomeString, "rehydrate");
Assert.IsTrue(Program.ArraysEqual(obj.SomeBlob, clone.SomeBlob), "rehydrate");
}
[Test]
public void TestReadExtendedSmallerObject()
{
TestReadExt<SmallerObject>();
}
[Test]
public void TestReadExtendedInterfaceBased()
{
TestReadExt<InterfaceBased>();
}
static void TestReadExt<T>() where T : IExtTest, IExtensible, new()
{
BiggerObject obj = GetBigObject();
T small = Serializer.ChangeType<BiggerObject, T>(obj);
byte[] raw = GetExtensionBytes(small);
float val;
bool hasValue = Extensible.TryGetValue<float>(small, 3, out val);
Assert.IsTrue(hasValue, "has value");
Assert.AreEqual(obj.SomeFloat, val, "float value");
hasValue = Extensible.TryGetValue<float>(small, 1000, out val);
Assert.IsFalse(hasValue, "no value");
Assert.AreEqual(default(float), val);
}
static byte[] GetExtensionBytes(IExtensible obj)
{
Assert.IsNotNull(obj, "null extensible");
IExtension extn = obj.GetExtensionObject(false);
Assert.IsNotNull(extn, "no extension object");
Stream s = extn.BeginQuery();
try
{
using(MemoryStream ms = new MemoryStream()) {
int b; // really lazy clone...
while ((b = s.ReadByte()) >= 0) { ms.WriteByte((byte)b); }
return ms.ToArray();
}
} finally {
extn.EndQuery(s);
}
}
[Test]
public void TestWriteExtendedSmaller()
{
TestWriteExt<SmallerObject>();
}
[Test]
public void TestWriteExtendedInterfaceBased()
{
TestWriteExt<InterfaceBased>();
}
static void TestWriteExt<T>() where T : IExtTest, IExtensible, new() {
const float SOME_VALUE = 987.65F;
T obj = new T();
Extensible.AppendValue<float>(obj, 3, SOME_VALUE);
byte[] raw = GetExtensionBytes(obj);
Assert.AreEqual(5, raw.Length, "Extension Length");
Assert.AreEqual((3 << 3) | 5, raw[0], "Prefix (3 Fixed32)");
byte[] tmp = BitConverter.GetBytes(SOME_VALUE);
if (!BitConverter.IsLittleEndian) Array.Reverse(tmp);
Assert.AreEqual(tmp[0], raw[1], "Float32 Byte 0");
Assert.AreEqual(tmp[1], raw[2], "Float32 Byte 1");
Assert.AreEqual(tmp[2], raw[3], "Float32 Byte 2");
Assert.AreEqual(tmp[3], raw[4], "Float32 Byte 3");
float readBack = Extensible.GetValue<float>(obj, 3);
Assert.AreEqual(SOME_VALUE, readBack, "read back");
BiggerObject big = Serializer.ChangeType<T, BiggerObject>(obj);
Assert.AreEqual(SOME_VALUE, big.SomeFloat, "deserialize");
}
[Test]
public void TestReadShouldUsePropertySmaller()
{
Program.ExpectFailure<ArgumentException>(() =>
{
TestReadShouldUseProperty<SmallerObject>();
});
}
[Test]
public void TestReadShouldUsePropertyInterfaceBased()
{
Program.ExpectFailure<ArgumentException>(() =>
{
TestReadShouldUseProperty<InterfaceBased>();
});
}
static void TestReadShouldUseProperty<T>() where T : IExtTest, IExtensible, new()
{
T obj = new T { Bof = "hi" };
string hi = Extensible.GetValue<string>(obj,1);
Assert.AreEqual("hi", hi);
}
[Test]
public void TestReadInvalidTagSmaller()
{
Program.ExpectFailure<ArgumentOutOfRangeException>(() =>
{
TestReadInvalidTag<SmallerObject>();
});
}
[Test]
public void TestReadInvalidTagInterfaceBased()
{
Program.ExpectFailure<ArgumentOutOfRangeException>(() =>
{
TestReadInvalidTag<InterfaceBased>();
});
}
static void TestReadInvalidTag<T>() where T : IExtTest, IExtensible, new()
{
T obj = new T {Bof = "hi"};
string hi = Extensible.GetValue<string>(obj, 0);
}
[Test]
public void TestReadNullSmaller()
{
Program.ExpectFailure<ArgumentNullException>(() =>
{
TestReadNull<SmallerObject>();
});
}
[Test]
public void TestReadNullInterfaceBased()
{
Program.ExpectFailure<ArgumentNullException>(() =>
{
TestReadNull<InterfaceBased>();
});
}
static void TestReadNull<T>() where T : IExtTest, IExtensible, new()
{
string hi = Extensible.GetValue<string>(null, 1);
}
[Test]
public void TestWriteNullSmaller()
{
Program.ExpectFailure<ArgumentNullException>(() =>
{
TestWriteNull<SmallerObject>();
});
}
[Test]
public void TestWriteNullInterfaceBased()
{
Program.ExpectFailure<ArgumentNullException>(() =>
{
TestWriteNull<InterfaceBased>();
});
}
static void TestWriteNull<T>() where T : IExtTest, IExtensible, new()
{
Extensible.AppendValue<string>(null, 1, "hi");
}
}
}
| 32.656757 | 112 | 0.517421 | [
"Apache-2.0"
] | Anters/protobuf-net | Examples/Extensibility.cs | 12,085 | 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 events-2015-10-07.normal.json service model.
*/
using System;
using Amazon.Runtime;
using Amazon.Util.Internal;
namespace Amazon.CloudWatchEvents
{
/// <summary>
/// Configuration for accessing Amazon CloudWatchEvents service
/// </summary>
public partial class AmazonCloudWatchEventsConfig : ClientConfig
{
private static readonly string UserAgentString =
InternalSDKUtils.BuildUserAgentString("3.3.100.35");
private string _userAgent = UserAgentString;
/// <summary>
/// Default constructor
/// </summary>
public AmazonCloudWatchEventsConfig()
{
this.AuthenticationServiceName = "events";
}
/// <summary>
/// The constant used to lookup in the region hash the endpoint.
/// </summary>
public override string RegionEndpointServiceName
{
get
{
return "events";
}
}
/// <summary>
/// Gets the ServiceVersion property.
/// </summary>
public override string ServiceVersion
{
get
{
return "2015-10-07";
}
}
/// <summary>
/// Gets the value of UserAgent property.
/// </summary>
public override string UserAgent
{
get
{
return _userAgent;
}
}
}
} | 26.45 | 104 | 0.592155 | [
"Apache-2.0"
] | ooohtv/aws-sdk-net | sdk/src/Services/CloudWatchEvents/Generated/AmazonCloudWatchEventsConfig.cs | 2,116 | C# |
// ------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
// ------------------------------------------------------------------------------
// **NOTE** This file was generated by a tool and any changes will be overwritten.
// <auto-generated/>
// Template Source: IEntityCollectionPage.cs.tt
namespace Microsoft.Graph.Ediscovery
{
using System;
using System.Text.Json.Serialization;
/// <summary>
/// The interface ICaseTagsCollectionPage.
/// </summary>
[InterfaceConverter(typeof(Microsoft.Graph.InterfaceConverter<CaseTagsCollectionPage>))]
public interface ICaseTagsCollectionPage : Microsoft.Graph.ICollectionPage<Tag>
{
/// <summary>
/// Gets the next page <see cref="ICaseTagsCollectionRequest"/> instance.
/// </summary>
ICaseTagsCollectionRequest NextPageRequest { get; }
/// <summary>
/// Initializes the NextPageRequest property.
/// </summary>
void InitializeNextPageRequest(Microsoft.Graph.IBaseClient client, string nextPageLinkString);
}
}
| 38.6875 | 153 | 0.609855 | [
"MIT"
] | ScriptBox99/msgraph-beta-sdk-dotnet | src/Microsoft.Graph/Generated/ediscovery/requests/ICaseTagsCollectionPage.cs | 1,238 | C# |
using System;
using System.Collections.Generic;
namespace ReGoap.Core
{
public interface IReGoapAction<T, W>
{
// this should return current's action calculated parameter, will be added to the run method
// userful for dynamic actions, for example a GoTo action can save some informations (wanted position)
// while being chosen from the planner, we save this information and give it back when we run the method
IReGoapActionSettings<T, W> GetSettings(IReGoapAgent<T, W> goapAgent, ReGoapState<T, W> goalState);
void Run(IReGoapAction<T, W> previousAction, IReGoapAction<T, W> nextAction, IReGoapActionSettings<T, W> settings, ReGoapState<T, W> goalState, Action<IReGoapAction<T, W>> done, Action<IReGoapAction<T, W>> fail);
void Exit(IReGoapAction<T, W> nextAction);
Dictionary<string, object> GetGenericValues();
string GetName();
bool IsActive();
void PostPlanCalculations(IReGoapAgent<T, W> goapAgent);
bool IsInterruptable();
void AskForInterruption();
// THREAD SAFE
ReGoapState<T, W> GetPreconditions(ReGoapState<T, W> goalState, IReGoapAction<T, W> next = null);
ReGoapState<T, W> GetEffects(ReGoapState<T, W> goalState, IReGoapAction<T, W> next = null);
bool CheckProceduralCondition(IReGoapAgent<T, W> goapAgent, ReGoapState<T, W> goalState, IReGoapAction<T, W> nextAction = null);
float GetCost(ReGoapState<T, W> goalState, IReGoapAction<T, W> next = null);
// DO NOT CHANGE RUNTIME ACTION VARIABLES, precalculation can be runned many times even while an action is running
void Precalculations(IReGoapAgent<T, W> goapAgent, ReGoapState<T, W> goalState);
}
public interface IReGoapActionSettings<T, W>
{
}
} | 56.125 | 220 | 0.701559 | [
"Apache-2.0"
] | Raptura/ReGoap | ReGoap/Core/IReGoapAction.cs | 1,798 | C# |
namespace Lucene.Net.Tartarus.Snowball.Ext
{
/// <summary>
/// This class was automatically generated by a Snowball to Java compiler
/// It implements the stemming algorithm defined by a snowball script.
/// </summary>
public class HungarianStemmer : SnowballProgram
{
private readonly static HungarianStemmer methodObject = new HungarianStemmer();
private readonly static Among[] a_0 = {
new Among ( "cs", -1, -1, "", methodObject ),
new Among ( "dzs", -1, -1, "", methodObject ),
new Among ( "gy", -1, -1, "", methodObject ),
new Among ( "ly", -1, -1, "", methodObject ),
new Among ( "ny", -1, -1, "", methodObject ),
new Among ( "sz", -1, -1, "", methodObject ),
new Among ( "ty", -1, -1, "", methodObject ),
new Among ( "zs", -1, -1, "", methodObject )
};
private readonly static Among[] a_1 = {
new Among ( "\u00E1", -1, 1, "", methodObject ),
new Among ( "\u00E9", -1, 2, "", methodObject )
};
private readonly static Among[] a_2 = {
new Among ( "bb", -1, -1, "", methodObject ),
new Among ( "cc", -1, -1, "", methodObject ),
new Among ( "dd", -1, -1, "", methodObject ),
new Among ( "ff", -1, -1, "", methodObject ),
new Among ( "gg", -1, -1, "", methodObject ),
new Among ( "jj", -1, -1, "", methodObject ),
new Among ( "kk", -1, -1, "", methodObject ),
new Among ( "ll", -1, -1, "", methodObject ),
new Among ( "mm", -1, -1, "", methodObject ),
new Among ( "nn", -1, -1, "", methodObject ),
new Among ( "pp", -1, -1, "", methodObject ),
new Among ( "rr", -1, -1, "", methodObject ),
new Among ( "ccs", -1, -1, "", methodObject ),
new Among ( "ss", -1, -1, "", methodObject ),
new Among ( "zzs", -1, -1, "", methodObject ),
new Among ( "tt", -1, -1, "", methodObject ),
new Among ( "vv", -1, -1, "", methodObject ),
new Among ( "ggy", -1, -1, "", methodObject ),
new Among ( "lly", -1, -1, "", methodObject ),
new Among ( "nny", -1, -1, "", methodObject ),
new Among ( "tty", -1, -1, "", methodObject ),
new Among ( "ssz", -1, -1, "", methodObject ),
new Among ( "zz", -1, -1, "", methodObject )
};
private readonly static Among[] a_3 = {
new Among ( "al", -1, 1, "", methodObject ),
new Among ( "el", -1, 2, "", methodObject )
};
private readonly static Among[] a_4 = {
new Among ( "ba", -1, -1, "", methodObject ),
new Among ( "ra", -1, -1, "", methodObject ),
new Among ( "be", -1, -1, "", methodObject ),
new Among ( "re", -1, -1, "", methodObject ),
new Among ( "ig", -1, -1, "", methodObject ),
new Among ( "nak", -1, -1, "", methodObject ),
new Among ( "nek", -1, -1, "", methodObject ),
new Among ( "val", -1, -1, "", methodObject ),
new Among ( "vel", -1, -1, "", methodObject ),
new Among ( "ul", -1, -1, "", methodObject ),
new Among ( "n\u00E1l", -1, -1, "", methodObject ),
new Among ( "n\u00E9l", -1, -1, "", methodObject ),
new Among ( "b\u00F3l", -1, -1, "", methodObject ),
new Among ( "r\u00F3l", -1, -1, "", methodObject ),
new Among ( "t\u00F3l", -1, -1, "", methodObject ),
new Among ( "b\u00F5l", -1, -1, "", methodObject ),
new Among ( "r\u00F5l", -1, -1, "", methodObject ),
new Among ( "t\u00F5l", -1, -1, "", methodObject ),
new Among ( "\u00FCl", -1, -1, "", methodObject ),
new Among ( "n", -1, -1, "", methodObject ),
new Among ( "an", 19, -1, "", methodObject ),
new Among ( "ban", 20, -1, "", methodObject ),
new Among ( "en", 19, -1, "", methodObject ),
new Among ( "ben", 22, -1, "", methodObject ),
new Among ( "k\u00E9ppen", 22, -1, "", methodObject ),
new Among ( "on", 19, -1, "", methodObject ),
new Among ( "\u00F6n", 19, -1, "", methodObject ),
new Among ( "k\u00E9pp", -1, -1, "", methodObject ),
new Among ( "kor", -1, -1, "", methodObject ),
new Among ( "t", -1, -1, "", methodObject ),
new Among ( "at", 29, -1, "", methodObject ),
new Among ( "et", 29, -1, "", methodObject ),
new Among ( "k\u00E9nt", 29, -1, "", methodObject ),
new Among ( "ank\u00E9nt", 32, -1, "", methodObject ),
new Among ( "enk\u00E9nt", 32, -1, "", methodObject ),
new Among ( "onk\u00E9nt", 32, -1, "", methodObject ),
new Among ( "ot", 29, -1, "", methodObject ),
new Among ( "\u00E9rt", 29, -1, "", methodObject ),
new Among ( "\u00F6t", 29, -1, "", methodObject ),
new Among ( "hez", -1, -1, "", methodObject ),
new Among ( "hoz", -1, -1, "", methodObject ),
new Among ( "h\u00F6z", -1, -1, "", methodObject ),
new Among ( "v\u00E1", -1, -1, "", methodObject ),
new Among ( "v\u00E9", -1, -1, "", methodObject )
};
private readonly static Among[] a_5 = {
new Among ( "\u00E1n", -1, 2, "", methodObject ),
new Among ( "\u00E9n", -1, 1, "", methodObject ),
new Among ( "\u00E1nk\u00E9nt", -1, 3, "", methodObject )
};
private readonly static Among[] a_6 = {
new Among ( "stul", -1, 2, "", methodObject ),
new Among ( "astul", 0, 1, "", methodObject ),
new Among ( "\u00E1stul", 0, 3, "", methodObject ),
new Among ( "st\u00FCl", -1, 2, "", methodObject ),
new Among ( "est\u00FCl", 3, 1, "", methodObject ),
new Among ( "\u00E9st\u00FCl", 3, 4, "", methodObject )
};
private readonly static Among[] a_7 = {
new Among ( "\u00E1", -1, 1, "", methodObject ),
new Among ( "\u00E9", -1, 2, "", methodObject )
};
private readonly static Among[] a_8 = {
new Among ( "k", -1, 7, "", methodObject ),
new Among ( "ak", 0, 4, "", methodObject ),
new Among ( "ek", 0, 6, "", methodObject ),
new Among ( "ok", 0, 5, "", methodObject ),
new Among ( "\u00E1k", 0, 1, "", methodObject ),
new Among ( "\u00E9k", 0, 2, "", methodObject ),
new Among ( "\u00F6k", 0, 3, "", methodObject )
};
private readonly static Among[] a_9 = {
new Among ( "\u00E9i", -1, 7, "", methodObject ),
new Among ( "\u00E1\u00E9i", 0, 6, "", methodObject ),
new Among ( "\u00E9\u00E9i", 0, 5, "", methodObject ),
new Among ( "\u00E9", -1, 9, "", methodObject ),
new Among ( "k\u00E9", 3, 4, "", methodObject ),
new Among ( "ak\u00E9", 4, 1, "", methodObject ),
new Among ( "ek\u00E9", 4, 1, "", methodObject ),
new Among ( "ok\u00E9", 4, 1, "", methodObject ),
new Among ( "\u00E1k\u00E9", 4, 3, "", methodObject ),
new Among ( "\u00E9k\u00E9", 4, 2, "", methodObject ),
new Among ( "\u00F6k\u00E9", 4, 1, "", methodObject ),
new Among ( "\u00E9\u00E9", 3, 8, "", methodObject )
};
private readonly static Among[] a_10 = {
new Among ( "a", -1, 18, "", methodObject ),
new Among ( "ja", 0, 17, "", methodObject ),
new Among ( "d", -1, 16, "", methodObject ),
new Among ( "ad", 2, 13, "", methodObject ),
new Among ( "ed", 2, 13, "", methodObject ),
new Among ( "od", 2, 13, "", methodObject ),
new Among ( "\u00E1d", 2, 14, "", methodObject ),
new Among ( "\u00E9d", 2, 15, "", methodObject ),
new Among ( "\u00F6d", 2, 13, "", methodObject ),
new Among ( "e", -1, 18, "", methodObject ),
new Among ( "je", 9, 17, "", methodObject ),
new Among ( "nk", -1, 4, "", methodObject ),
new Among ( "unk", 11, 1, "", methodObject ),
new Among ( "\u00E1nk", 11, 2, "", methodObject ),
new Among ( "\u00E9nk", 11, 3, "", methodObject ),
new Among ( "\u00FCnk", 11, 1, "", methodObject ),
new Among ( "uk", -1, 8, "", methodObject ),
new Among ( "juk", 16, 7, "", methodObject ),
new Among ( "\u00E1juk", 17, 5, "", methodObject ),
new Among ( "\u00FCk", -1, 8, "", methodObject ),
new Among ( "j\u00FCk", 19, 7, "", methodObject ),
new Among ( "\u00E9j\u00FCk", 20, 6, "", methodObject ),
new Among ( "m", -1, 12, "", methodObject ),
new Among ( "am", 22, 9, "", methodObject ),
new Among ( "em", 22, 9, "", methodObject ),
new Among ( "om", 22, 9, "", methodObject ),
new Among ( "\u00E1m", 22, 10, "", methodObject ),
new Among ( "\u00E9m", 22, 11, "", methodObject ),
new Among ( "o", -1, 18, "", methodObject ),
new Among ( "\u00E1", -1, 19, "", methodObject ),
new Among ( "\u00E9", -1, 20, "", methodObject )
};
private readonly static Among[] a_11 = {
new Among ( "id", -1, 10, "", methodObject ),
new Among ( "aid", 0, 9, "", methodObject ),
new Among ( "jaid", 1, 6, "", methodObject ),
new Among ( "eid", 0, 9, "", methodObject ),
new Among ( "jeid", 3, 6, "", methodObject ),
new Among ( "\u00E1id", 0, 7, "", methodObject ),
new Among ( "\u00E9id", 0, 8, "", methodObject ),
new Among ( "i", -1, 15, "", methodObject ),
new Among ( "ai", 7, 14, "", methodObject ),
new Among ( "jai", 8, 11, "", methodObject ),
new Among ( "ei", 7, 14, "", methodObject ),
new Among ( "jei", 10, 11, "", methodObject ),
new Among ( "\u00E1i", 7, 12, "", methodObject ),
new Among ( "\u00E9i", 7, 13, "", methodObject ),
new Among ( "itek", -1, 24, "", methodObject ),
new Among ( "eitek", 14, 21, "", methodObject ),
new Among ( "jeitek", 15, 20, "", methodObject ),
new Among ( "\u00E9itek", 14, 23, "", methodObject ),
new Among ( "ik", -1, 29, "", methodObject ),
new Among ( "aik", 18, 26, "", methodObject ),
new Among ( "jaik", 19, 25, "", methodObject ),
new Among ( "eik", 18, 26, "", methodObject ),
new Among ( "jeik", 21, 25, "", methodObject ),
new Among ( "\u00E1ik", 18, 27, "", methodObject ),
new Among ( "\u00E9ik", 18, 28, "", methodObject ),
new Among ( "ink", -1, 20, "", methodObject ),
new Among ( "aink", 25, 17, "", methodObject ),
new Among ( "jaink", 26, 16, "", methodObject ),
new Among ( "eink", 25, 17, "", methodObject ),
new Among ( "jeink", 28, 16, "", methodObject ),
new Among ( "\u00E1ink", 25, 18, "", methodObject ),
new Among ( "\u00E9ink", 25, 19, "", methodObject ),
new Among ( "aitok", -1, 21, "", methodObject ),
new Among ( "jaitok", 32, 20, "", methodObject ),
new Among ( "\u00E1itok", -1, 22, "", methodObject ),
new Among ( "im", -1, 5, "", methodObject ),
new Among ( "aim", 35, 4, "", methodObject ),
new Among ( "jaim", 36, 1, "", methodObject ),
new Among ( "eim", 35, 4, "", methodObject ),
new Among ( "jeim", 38, 1, "", methodObject ),
new Among ( "\u00E1im", 35, 2, "", methodObject ),
new Among ( "\u00E9im", 35, 3, "", methodObject )
};
private static readonly char[] g_v = { (char)17, (char)65, (char)16, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)1, (char)17, (char)52, (char)14 };
private int I_p1;
private void copy_from(HungarianStemmer other)
{
I_p1 = other.I_p1;
base.copy_from(other);
}
private bool r_mark_regions()
{
int v_1;
int v_2;
int v_3;
// (, line 44
I_p1 = limit;
// or, line 51
do
{
v_1 = cursor;
do
{
// (, line 48
if (!(in_grouping(g_v, 97, 252)))
{
goto lab1;
}
// goto, line 48
while (true)
{
v_2 = cursor;
do
{
if (!(out_grouping(g_v, 97, 252)))
{
goto lab3;
}
cursor = v_2;
goto golab2;
} while (false);
lab3:
cursor = v_2;
if (cursor >= limit)
{
goto lab1;
}
cursor++;
}
golab2:
// or, line 49
do
{
v_3 = cursor;
do
{
// among, line 49
if (find_among(a_0, 8) == 0)
{
goto lab5;
}
goto lab4;
} while (false);
lab5:
cursor = v_3;
// next, line 49
if (cursor >= limit)
{
goto lab1;
}
cursor++;
} while (false);
lab4:
// setmark p1, line 50
I_p1 = cursor;
goto lab0;
} while (false);
lab1:
cursor = v_1;
// (, line 53
if (!(out_grouping(g_v, 97, 252)))
{
return false;
}
// gopast, line 53
while (true)
{
do
{
if (!(in_grouping(g_v, 97, 252)))
{
goto lab7;
}
goto golab6;
} while (false);
lab7:
if (cursor >= limit)
{
return false;
}
cursor++;
}
golab6:
// setmark p1, line 53
I_p1 = cursor;
} while (false);
lab0:
return true;
}
private bool r_R1()
{
if (!(I_p1 <= cursor))
{
return false;
}
return true;
}
private bool r_v_ending()
{
int among_var;
// (, line 60
// [, line 61
ket = cursor;
// substring, line 61
among_var = find_among_b(a_1, 2);
if (among_var == 0)
{
return false;
}
// ], line 61
bra = cursor;
// call R1, line 61
if (!r_R1())
{
return false;
}
switch (among_var)
{
case 0:
return false;
case 1:
// (, line 62
// <-, line 62
slice_from("a");
break;
case 2:
// (, line 63
// <-, line 63
slice_from("e");
break;
}
return true;
}
private bool r_double()
{
int v_1;
// (, line 67
// test, line 68
v_1 = limit - cursor;
// among, line 68
if (find_among_b(a_2, 23) == 0)
{
return false;
}
cursor = limit - v_1;
return true;
}
private bool r_undouble()
{
// (, line 72
// next, line 73
if (cursor <= limit_backward)
{
return false;
}
cursor--;
// [, line 73
ket = cursor;
// hop, line 73
{
int c = cursor - 1;
if (limit_backward > c || c > limit)
{
return false;
}
cursor = c;
}
// ], line 73
bra = cursor;
// delete, line 73
slice_del();
return true;
}
private bool r_instrum()
{
int among_var;
// (, line 76
// [, line 77
ket = cursor;
// substring, line 77
among_var = find_among_b(a_3, 2);
if (among_var == 0)
{
return false;
}
// ], line 77
bra = cursor;
// call R1, line 77
if (!r_R1())
{
return false;
}
switch (among_var)
{
case 0:
return false;
case 1:
// (, line 78
// call double, line 78
if (!r_double())
{
return false;
}
break;
case 2:
// (, line 79
// call double, line 79
if (!r_double())
{
return false;
}
break;
}
// delete, line 81
slice_del();
// call undouble, line 82
if (!r_undouble())
{
return false;
}
return true;
}
private bool r_case()
{
// (, line 86
// [, line 87
ket = cursor;
// substring, line 87
if (find_among_b(a_4, 44) == 0)
{
return false;
}
// ], line 87
bra = cursor;
// call R1, line 87
if (!r_R1())
{
return false;
}
// delete, line 111
slice_del();
// call v_ending, line 112
if (!r_v_ending())
{
return false;
}
return true;
}
private bool r_case_special()
{
int among_var;
// (, line 115
// [, line 116
ket = cursor;
// substring, line 116
among_var = find_among_b(a_5, 3);
if (among_var == 0)
{
return false;
}
// ], line 116
bra = cursor;
// call R1, line 116
if (!r_R1())
{
return false;
}
switch (among_var)
{
case 0:
return false;
case 1:
// (, line 117
// <-, line 117
slice_from("e");
break;
case 2:
// (, line 118
// <-, line 118
slice_from("a");
break;
case 3:
// (, line 119
// <-, line 119
slice_from("a");
break;
}
return true;
}
private bool r_case_other()
{
int among_var;
// (, line 123
// [, line 124
ket = cursor;
// substring, line 124
among_var = find_among_b(a_6, 6);
if (among_var == 0)
{
return false;
}
// ], line 124
bra = cursor;
// call R1, line 124
if (!r_R1())
{
return false;
}
switch (among_var)
{
case 0:
return false;
case 1:
// (, line 125
// delete, line 125
slice_del();
break;
case 2:
// (, line 126
// delete, line 126
slice_del();
break;
case 3:
// (, line 127
// <-, line 127
slice_from("a");
break;
case 4:
// (, line 128
// <-, line 128
slice_from("e");
break;
}
return true;
}
private bool r_factive()
{
int among_var;
// (, line 132
// [, line 133
ket = cursor;
// substring, line 133
among_var = find_among_b(a_7, 2);
if (among_var == 0)
{
return false;
}
// ], line 133
bra = cursor;
// call R1, line 133
if (!r_R1())
{
return false;
}
switch (among_var)
{
case 0:
return false;
case 1:
// (, line 134
// call double, line 134
if (!r_double())
{
return false;
}
break;
case 2:
// (, line 135
// call double, line 135
if (!r_double())
{
return false;
}
break;
}
// delete, line 137
slice_del();
// call undouble, line 138
if (!r_undouble())
{
return false;
}
return true;
}
private bool r_plural()
{
int among_var;
// (, line 141
// [, line 142
ket = cursor;
// substring, line 142
among_var = find_among_b(a_8, 7);
if (among_var == 0)
{
return false;
}
// ], line 142
bra = cursor;
// call R1, line 142
if (!r_R1())
{
return false;
}
switch (among_var)
{
case 0:
return false;
case 1:
// (, line 143
// <-, line 143
slice_from("a");
break;
case 2:
// (, line 144
// <-, line 144
slice_from("e");
break;
case 3:
// (, line 145
// delete, line 145
slice_del();
break;
case 4:
// (, line 146
// delete, line 146
slice_del();
break;
case 5:
// (, line 147
// delete, line 147
slice_del();
break;
case 6:
// (, line 148
// delete, line 148
slice_del();
break;
case 7:
// (, line 149
// delete, line 149
slice_del();
break;
}
return true;
}
private bool r_owned()
{
int among_var;
// (, line 153
// [, line 154
ket = cursor;
// substring, line 154
among_var = find_among_b(a_9, 12);
if (among_var == 0)
{
return false;
}
// ], line 154
bra = cursor;
// call R1, line 154
if (!r_R1())
{
return false;
}
switch (among_var)
{
case 0:
return false;
case 1:
// (, line 155
// delete, line 155
slice_del();
break;
case 2:
// (, line 156
// <-, line 156
slice_from("e");
break;
case 3:
// (, line 157
// <-, line 157
slice_from("a");
break;
case 4:
// (, line 158
// delete, line 158
slice_del();
break;
case 5:
// (, line 159
// <-, line 159
slice_from("e");
break;
case 6:
// (, line 160
// <-, line 160
slice_from("a");
break;
case 7:
// (, line 161
// delete, line 161
slice_del();
break;
case 8:
// (, line 162
// <-, line 162
slice_from("e");
break;
case 9:
// (, line 163
// delete, line 163
slice_del();
break;
}
return true;
}
private bool r_sing_owner()
{
int among_var;
// (, line 167
// [, line 168
ket = cursor;
// substring, line 168
among_var = find_among_b(a_10, 31);
if (among_var == 0)
{
return false;
}
// ], line 168
bra = cursor;
// call R1, line 168
if (!r_R1())
{
return false;
}
switch (among_var)
{
case 0:
return false;
case 1:
// (, line 169
// delete, line 169
slice_del();
break;
case 2:
// (, line 170
// <-, line 170
slice_from("a");
break;
case 3:
// (, line 171
// <-, line 171
slice_from("e");
break;
case 4:
// (, line 172
// delete, line 172
slice_del();
break;
case 5:
// (, line 173
// <-, line 173
slice_from("a");
break;
case 6:
// (, line 174
// <-, line 174
slice_from("e");
break;
case 7:
// (, line 175
// delete, line 175
slice_del();
break;
case 8:
// (, line 176
// delete, line 176
slice_del();
break;
case 9:
// (, line 177
// delete, line 177
slice_del();
break;
case 10:
// (, line 178
// <-, line 178
slice_from("a");
break;
case 11:
// (, line 179
// <-, line 179
slice_from("e");
break;
case 12:
// (, line 180
// delete, line 180
slice_del();
break;
case 13:
// (, line 181
// delete, line 181
slice_del();
break;
case 14:
// (, line 182
// <-, line 182
slice_from("a");
break;
case 15:
// (, line 183
// <-, line 183
slice_from("e");
break;
case 16:
// (, line 184
// delete, line 184
slice_del();
break;
case 17:
// (, line 185
// delete, line 185
slice_del();
break;
case 18:
// (, line 186
// delete, line 186
slice_del();
break;
case 19:
// (, line 187
// <-, line 187
slice_from("a");
break;
case 20:
// (, line 188
// <-, line 188
slice_from("e");
break;
}
return true;
}
private bool r_plur_owner()
{
int among_var;
// (, line 192
// [, line 193
ket = cursor;
// substring, line 193
among_var = find_among_b(a_11, 42);
if (among_var == 0)
{
return false;
}
// ], line 193
bra = cursor;
// call R1, line 193
if (!r_R1())
{
return false;
}
switch (among_var)
{
case 0:
return false;
case 1:
// (, line 194
// delete, line 194
slice_del();
break;
case 2:
// (, line 195
// <-, line 195
slice_from("a");
break;
case 3:
// (, line 196
// <-, line 196
slice_from("e");
break;
case 4:
// (, line 197
// delete, line 197
slice_del();
break;
case 5:
// (, line 198
// delete, line 198
slice_del();
break;
case 6:
// (, line 199
// delete, line 199
slice_del();
break;
case 7:
// (, line 200
// <-, line 200
slice_from("a");
break;
case 8:
// (, line 201
// <-, line 201
slice_from("e");
break;
case 9:
// (, line 202
// delete, line 202
slice_del();
break;
case 10:
// (, line 203
// delete, line 203
slice_del();
break;
case 11:
// (, line 204
// delete, line 204
slice_del();
break;
case 12:
// (, line 205
// <-, line 205
slice_from("a");
break;
case 13:
// (, line 206
// <-, line 206
slice_from("e");
break;
case 14:
// (, line 207
// delete, line 207
slice_del();
break;
case 15:
// (, line 208
// delete, line 208
slice_del();
break;
case 16:
// (, line 209
// delete, line 209
slice_del();
break;
case 17:
// (, line 210
// delete, line 210
slice_del();
break;
case 18:
// (, line 211
// <-, line 211
slice_from("a");
break;
case 19:
// (, line 212
// <-, line 212
slice_from("e");
break;
case 20:
// (, line 214
// delete, line 214
slice_del();
break;
case 21:
// (, line 215
// delete, line 215
slice_del();
break;
case 22:
// (, line 216
// <-, line 216
slice_from("a");
break;
case 23:
// (, line 217
// <-, line 217
slice_from("e");
break;
case 24:
// (, line 218
// delete, line 218
slice_del();
break;
case 25:
// (, line 219
// delete, line 219
slice_del();
break;
case 26:
// (, line 220
// delete, line 220
slice_del();
break;
case 27:
// (, line 221
// <-, line 221
slice_from("a");
break;
case 28:
// (, line 222
// <-, line 222
slice_from("e");
break;
case 29:
// (, line 223
// delete, line 223
slice_del();
break;
}
return true;
}
public override bool Stem()
{
int v_1;
int v_2;
int v_3;
int v_4;
int v_5;
int v_6;
int v_7;
int v_8;
int v_9;
int v_10;
// (, line 228
// do, line 229
v_1 = cursor;
do
{
// call mark_regions, line 229
if (!r_mark_regions())
{
goto lab0;
}
} while (false);
lab0:
cursor = v_1;
// backwards, line 230
limit_backward = cursor; cursor = limit;
// (, line 230
// do, line 231
v_2 = limit - cursor;
do
{
// call instrum, line 231
if (!r_instrum())
{
goto lab1;
}
} while (false);
lab1:
cursor = limit - v_2;
// do, line 232
v_3 = limit - cursor;
do
{
// call case, line 232
if (!r_case())
{
goto lab2;
}
} while (false);
lab2:
cursor = limit - v_3;
// do, line 233
v_4 = limit - cursor;
do
{
// call case_special, line 233
if (!r_case_special())
{
goto lab3;
}
} while (false);
lab3:
cursor = limit - v_4;
// do, line 234
v_5 = limit - cursor;
do
{
// call case_other, line 234
if (!r_case_other())
{
goto lab4;
}
} while (false);
lab4:
cursor = limit - v_5;
// do, line 235
v_6 = limit - cursor;
do
{
// call factive, line 235
if (!r_factive())
{
goto lab5;
}
} while (false);
lab5:
cursor = limit - v_6;
// do, line 236
v_7 = limit - cursor;
do
{
// call owned, line 236
if (!r_owned())
{
goto lab6;
}
} while (false);
lab6:
cursor = limit - v_7;
// do, line 237
v_8 = limit - cursor;
do
{
// call sing_owner, line 237
if (!r_sing_owner())
{
goto lab7;
}
} while (false);
lab7:
cursor = limit - v_8;
// do, line 238
v_9 = limit - cursor;
do
{
// call plur_owner, line 238
if (!r_plur_owner())
{
goto lab8;
}
} while (false);
lab8:
cursor = limit - v_9;
// do, line 239
v_10 = limit - cursor;
do
{
// call plural, line 239
if (!r_plural())
{
goto lab9;
}
} while (false);
lab9:
cursor = limit - v_10;
cursor = limit_backward; return true;
}
public override bool Equals(object o)
{
return o is HungarianStemmer;
}
public override int GetHashCode()
{
return this.GetType().FullName.GetHashCode();
}
}
}
| 34.03749 | 234 | 0.315319 | [
"Apache-2.0"
] | BlueCurve-Team/lucenenet | src/Lucene.Net.Analysis.Common/Tartarus/Snowball/Ext/HungarianStemmer.cs | 41,766 | C# |
namespace Plus.HabboHotel.Rooms.Chat.Commands.User
{
using System.Text;
using Communication.Packets.Outgoing.Rooms.Engine;
using GameClients;
internal class RoomCommand : IChatCommand
{
public string PermissionRequired => "command_room";
public string Parameters => "push/pull/enables/respect";
public string Description => "Gives you the ability to enable or disable basic room commands.";
public void Execute(GameClient session, Room room, string[] Params)
{
if (Params.Length == 1)
{
session.SendWhisper("Oops, you must choose a room option to disable.");
return;
}
if (!room.CheckRights(session, true))
{
session.SendWhisper("Oops, only the room owner or staff can use this command.");
return;
}
var option = Params[1];
switch (option)
{
case "list":
{
var list = new StringBuilder("");
list.AppendLine("Room Command List");
list.AppendLine("-------------------------");
list.AppendLine("Pet Morphs: " + (room.PetMorphsAllowed ? "enabled" : "disabled"));
list.AppendLine("Pull: " + (room.PullEnabled ? "enabled" : "disabled"));
list.AppendLine("Push: " + (room.PushEnabled ? "enabled" : "disabled"));
list.AppendLine("Super Pull: " + (room.SPullEnabled ? "enabled" : "disabled"));
list.AppendLine("Super Push: " + (room.SPushEnabled ? "enabled" : "disabled"));
list.AppendLine("Respect: " + (room.RespectNotificationsEnabled ? "enabled" : "disabled"));
list.AppendLine("Enables: " + (room.EnablesEnabled ? "enabled" : "disabled"));
session.SendNotification(list.ToString());
break;
}
case "push":
{
room.PushEnabled = !room.PushEnabled;
using (var dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.SetQuery("UPDATE `rooms` SET `push_enabled` = @PushEnabled WHERE `id` = '" + room.Id +
"' LIMIT 1");
dbClient.AddParameter("PushEnabled", PlusEnvironment.BoolToEnum(room.PushEnabled));
dbClient.RunQuery();
}
session.SendWhisper("Push mode is now " + (room.PushEnabled ? "enabled!" : "disabled!"));
break;
}
case "spush":
{
room.SPushEnabled = !room.SPushEnabled;
using (var dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.SetQuery("UPDATE `rooms` SET `spush_enabled` = @PushEnabled WHERE `id` = '" + room.Id +
"' LIMIT 1");
dbClient.AddParameter("PushEnabled", PlusEnvironment.BoolToEnum(room.SPushEnabled));
dbClient.RunQuery();
}
session.SendWhisper("Super Push mode is now " + (room.SPushEnabled ? "enabled!" : "disabled!"));
break;
}
case "spull":
{
room.SPullEnabled = !room.SPullEnabled;
using (var dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.SetQuery("UPDATE `rooms` SET `spull_enabled` = @PullEnabled WHERE `id` = '" + room.Id +
"' LIMIT 1");
dbClient.AddParameter("PullEnabled", PlusEnvironment.BoolToEnum(room.SPullEnabled));
dbClient.RunQuery();
}
session.SendWhisper("Super Pull mode is now " + (room.SPullEnabled ? "enabled!" : "disabled!"));
break;
}
case "pull":
{
room.PullEnabled = !room.PullEnabled;
using (var dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.SetQuery("UPDATE `rooms` SET `pull_enabled` = @PullEnabled WHERE `id` = '" + room.Id +
"' LIMIT 1");
dbClient.AddParameter("PullEnabled", PlusEnvironment.BoolToEnum(room.PullEnabled));
dbClient.RunQuery();
}
session.SendWhisper("Pull mode is now " + (room.PullEnabled ? "enabled!" : "disabled!"));
break;
}
case "enable":
case "enables":
{
room.EnablesEnabled = !room.EnablesEnabled;
using (var dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.SetQuery("UPDATE `rooms` SET `enables_enabled` = @EnablesEnabled WHERE `id` = '" + room.Id +
"' LIMIT 1");
dbClient.AddParameter("EnablesEnabled", PlusEnvironment.BoolToEnum(room.EnablesEnabled));
dbClient.RunQuery();
}
session.SendWhisper("Enables mode set to " + (room.EnablesEnabled ? "enabled!" : "disabled!"));
break;
}
case "respect":
{
room.RespectNotificationsEnabled = !room.RespectNotificationsEnabled;
using (var dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.SetQuery(
"UPDATE `rooms` SET `respect_notifications_enabled` = @RespectNotificationsEnabled WHERE `id` = '" +
room.Id +
"' LIMIT 1");
dbClient.AddParameter("RespectNotificationsEnabled",
PlusEnvironment.BoolToEnum(room.RespectNotificationsEnabled));
dbClient.RunQuery();
}
session.SendWhisper("Respect notifications mode set to " +
(room.RespectNotificationsEnabled ? "enabled!" : "disabled!"));
break;
}
case "pets":
case "morphs":
{
room.PetMorphsAllowed = !room.PetMorphsAllowed;
using (var dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.SetQuery("UPDATE `rooms` SET `pet_morphs_allowed` = @PetMorphsAllowed WHERE `id` = '" + room.Id +
"' LIMIT 1");
dbClient.AddParameter("PetMorphsAllowed", PlusEnvironment.BoolToEnum(room.PetMorphsAllowed));
dbClient.RunQuery();
}
session.SendWhisper("Human pet morphs notifications mode set to " +
(room.PetMorphsAllowed ? "enabled!" : "disabled!"));
if (!room.PetMorphsAllowed)
{
foreach (var user in room.GetRoomUserManager().GetRoomUsers())
{
if (user == null || user.GetClient() == null || user.GetClient().GetHabbo() == null)
{
continue;
}
user.GetClient()
.SendWhisper("The room owner has disabled the ability to use a pet morph in this room.");
if (user.GetClient().GetHabbo().PetId > 0)
{
//Tell the user what is going on.
user.GetClient()
.SendWhisper("Oops, the room owner has just disabled pet-morphs, un-morphing you.");
//Change the users Pet Id.
user.GetClient().GetHabbo().PetId = 0;
//Quickly remove the old user instance.
room.SendPacket(new UserRemoveComposer(user.VirtualId));
//Add the new one, they won't even notice a thing!!11 8-)
room.SendPacket(new UsersComposer(user));
}
}
}
break;
}
}
}
}
} | 51.19774 | 130 | 0.458729 | [
"Apache-2.0"
] | dotsudo/plus-clean | HabboHotel/Rooms/Chat/Commands/User/RoomCommand.cs | 9,064 | C# |
namespace Server.Communication
{
public class NavigationStateUpdate
{
public string Phase { get; set; }
public string StoryId { get; set; }
}
}
| 17.4 | 43 | 0.62069 | [
"MIT"
] | LucaSalzani/PlanningPokR | Server/Server/Communication/NavigationStateUpdate.cs | 176 | C# |
using System;
using System.Threading.Tasks;
using Microsoft.Owin.Security.OAuth;
namespace mySPA.Providers
{
public class ApplicationOAuthProvider : OAuthAuthorizationServerProvider
{
private readonly string _publicClientId;
public ApplicationOAuthProvider(string publicClientId)
{
if (publicClientId == null)
{
throw new ArgumentNullException("publicClientId");
}
_publicClientId = publicClientId;
}
public override Task ValidateClientRedirectUri(OAuthValidateClientRedirectUriContext context)
{
if (context.ClientId == _publicClientId)
{
Uri expectedRootUri = new Uri(context.Request.Uri, "/");
if (expectedRootUri.AbsoluteUri == context.RedirectUri)
{
context.Validated();
}
else if (context.ClientId == "web")
{
var expectedUri = new Uri(context.Request.Uri, "/");
context.Validated(expectedUri.AbsoluteUri);
}
}
return Task.FromResult<object>(null);
}
}
} | 23.292683 | 95 | 0.718325 | [
"MIT"
] | LLouLiang/AngularjsWithWebApi | mySPA/Providers/ApplicationOAuthProvider.cs | 957 | C# |
/* The Keys in this enum are exactly the ones in WinForm, since WPF WndProc still sends the same keys
* as WinForm and I've not found a suitable way of converting them to their WPF equivalent. I've tried
* using the KeyInterop class but it just makes it cumbersome. With the view of providing the same
* functionalities as WinForm in this library. I've resulted to this. Feel free to explore the KeyInterop
* class in the System.Windows.Input namespace */
using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
namespace BondTech.HotKeyManagement.WPF._4
{
#region The Keys enum
/// <summary>Specifies key codes and modifiers.
/// </summary>
[Flags]
[ComVisible(true)]
[TypeConverter(typeof(KeysConverter))]
public enum Keys
{
/// <summary>The bitmask to extract modifiers from a key value.
/// </summary>
Modifiers = -65536,
/// <summary>No key pressed.
/// </summary>
None = 0,
/// <summary>The left mouse button.
/// </summary>
LButton = 1,
/// <summary>The right mouse button.
/// </summary>
RButton = 2,
/// <summary>The CANCEL key.
/// </summary>
Cancel = 3,
/// <summary>The middle mouse button (three-button mouse).
/// </summary>
MButton = 4,
/// <summary>The first x mouse button (five-button mouse).
/// </summary>
XButton1 = 5,
/// <summary>The second x mouse button (five-button mouse).
/// </summary>
XButton2 = 6,
/// <summary>The BACKSPACE key.
/// </summary>
Back = 8,
/// <summary>The TAB key.
/// </summary>
Tab = 9,
/// <summary>The LINEFEED key.
/// </summary>
LineFeed = 10,
/// <summary>The CLEAR key.
/// </summary>
Clear = 12,
/// <summary>The ENTER key.
/// </summary>
Enter = 13,
/// <summary>The RETURN key.
/// </summary>
Return = 13,
/// <summary>The SHIFT key.
/// </summary>
ShiftKey = 16,
/// <summary>The CTRL key.
/// </summary>
ControlKey = 17,
/// <summary>The ALT key.
/// </summary>
Menu = 18,
/// <summary>The PAUSE key.
/// </summary>
Pause = 19,
/// <summary>The CAPS LOCK key.
/// </summary>
CapsLock = 20,
/// <summary>The CAPS LOCK key.
/// </summary>
Capital = 20,
/// <summary>The IME Kana mode key.
/// </summary>
KanaMode = 21,
/// <summary>The IME Hanguel mode key. (maintained for compatibility; use HangulMode)
/// </summary>
HanguelMode = 21,
/// <summary>The IME Hangul mode key.
/// </summary>
HangulMode = 21,
/// <summary>The IME Junja mode key.
/// </summary>
JunjaMode = 23,
/// <summary>The IME final mode key.
/// </summary>
FinalMode = 24,
/// <summary>The IME Kanji mode key.
/// </summary>
KanjiMode = 25,
/// <summary>The IME Hanja mode key.
/// </summary>
HanjaMode = 25,
/// <summary>The ESC key.
/// </summary>
Escape = 27,
/// <summary>The IME convert key.
/// </summary>
IMEConvert = 28,
/// <summary>The IME nonconvert key.
/// </summary>
IMENonconvert = 29,
/// <summary>The IME accept key. Obsolete, use System.Windows.Forms.Keys.IMEAccept instead.
/// </summary>
IMEAceept = 30,
/// <summary>The IME accept key, replaces System.Windows.Forms.Keys.IMEAceept.
/// </summary>
IMEAccept = 30,
/// <summary>The IME mode change key.
/// </summary>
IMEModeChange = 31,
/// <summary>The SPACEBAR key.
/// </summary>
Space = 32,
/// <summary>The PAGE UP key.
/// </summary>
Prior = 33,
/// <summary>The PAGE UP key.
/// </summary>
PageUp = 33,
/// <summary>The PAGE DOWN key.
/// </summary>
Next = 34,
/// <summary>The PAGE DOWN key.
/// </summary>
PageDown = 34,
/// <summary>The END key.
/// </summary>
End = 35,
/// <summary>The HOME key.
/// </summary>
Home = 36,
/// <summary>The LEFT ARROW key.
/// </summary>
Left = 37,
/// <summary>The UP ARROW key.
/// </summary>
Up = 38,
/// <summary>The RIGHT ARROW key.
/// </summary>
Right = 39,
/// <summary>The DOWN ARROW key.
/// </summary>
Down = 40,
/// <summary>The SELECT key.
/// </summary>
Select = 41,
/// <summary>The PRINT key.
/// </summary>
Print = 42,
/// <summary>The EXECUTE key.
/// </summary>
Execute = 43,
/// <summary>The PRINT SCREEN key.
/// </summary>
PrintScreen = 44,
/// <summary>The PRINT SCREEN key.
/// </summary>
Snapshot = 44,
/// <summary>The INS key.
/// </summary>
Insert = 45,
/// <summary>The DEL key.
/// </summary>
Delete = 46,
/// <summary>The HELP key.
/// </summary>
Help = 47,
/// <summary>The 0 key.
/// </summary>
D0 = 48,
/// <summary>The 1 key.
/// </summary>
D1 = 49,
/// <summary>The 2 key.
/// </summary>
D2 = 50,
/// <summary>The 3 key.
/// </summary>
D3 = 51,
/// <summary>The 4 key.
/// </summary>
D4 = 52,
/// <summary>The 5 key.
/// </summary>
D5 = 53,
/// <summary>The 6 key.
/// </summary>
D6 = 54,
/// <summary>The 7 key.
/// </summary>
D7 = 55,
/// <summary>The 8 key.
/// </summary>
D8 = 56,
/// <summary>The 9 key.
/// </summary>
D9 = 57,
/// <summary>The A key.
/// </summary>
A = 65,
/// <summary>The B key.
/// </summary>
B = 66,
/// <summary>The C key.
/// </summary>
C = 67,
/// <summary>The D key.
/// </summary>
D = 68,
/// <summary>The E key.
/// </summary>
E = 69,
/// <summary>The F key.
/// </summary>
F = 70,
/// <summary>The G key.
/// </summary>
G = 71,
/// <summary>The H key.
/// </summary>
H = 72,
/// <summary>The I key.
/// </summary>
I = 73,
/// <summary>The J key.
///
/// </summary>
J = 74,
/// <summary>The K key.
/// </summary>
K = 75,
/// <summary>The L key.
/// </summary>
L = 76,
/// <summary>The M key.
/// </summary>
M = 77,
/// <summary>The N key.
/// </summary>
N = 78,
/// <summary>The O key.
/// </summary>
O = 79,
/// <summary>The P key.
/// </summary>
P = 80,
/// <summary>The Q key.
/// </summary>
Q = 81,
/// <summary>The R key.
/// </summary>
R = 82,
/// <summary>The S key.
/// </summary>
S = 83,
/// <summary>The T key.
/// </summary>
T = 84,
/// <summary>The U key.
/// </summary>
U = 85,
/// <summary>The V key.
/// </summary>
V = 86,
/// <summary>The W key.
/// </summary>
W = 87,
/// <summary>The X key.
/// </summary>
X = 88,
/// <summary>The Y key.
/// </summary>
Y = 89,
/// <summary>The Z key.
/// </summary>
Z = 90,
/// <summary>The left Windows logo key (Microsoft Natural Keyboard).
/// </summary>
LWin = 91,
/// <summary>The right Windows logo key (Microsoft Natural Keyboard).
/// </summary>
RWin = 92,
/// <summary>The application key (Microsoft Natural Keyboard).
/// </summary>
Apps = 93,
/// <summary>The computer sleep key.
/// </summary>
Sleep = 95,
/// <summary>The 0 key on the numeric keypad.
/// </summary>
NumPad0 = 96,
/// <summary>The 1 key on the numeric keypad.
/// </summary>
NumPad1 = 97,
/// <summary>The 2 key on the numeric keypad.
/// </summary>
NumPad2 = 98,
/// <summary>The 3 key on the numeric keypad.
/// </summary>
NumPad3 = 99,
/// <summary>The 4 key on the numeric keypad.
/// </summary>
NumPad4 = 100,
/// <summary>The 5 key on the numeric keypad.
/// </summary>
NumPad5 = 101,
/// <summary>The 6 key on the numeric keypad.
/// </summary>
NumPad6 = 102,
/// <summary>The 7 key on the numeric keypad.
/// </summary>
NumPad7 = 103,
/// <summary>The 8 key on the numeric keypad.
/// </summary>
NumPad8 = 104,
/// <summary>The 9 key on the numeric keypad.
/// </summary>
NumPad9 = 105,
/// <summary>The multiply key.
/// </summary>
Multiply = 106,
/// <summary>The add key.
/// </summary>
Add = 107,
/// <summary>The separator key.
/// </summary>
Separator = 108,
/// <summary>The subtract key.
/// </summary>
Subtract = 109,
/// <summary>The decimal key.
/// </summary>
Decimal = 110,
/// <summary>The divide key.
/// </summary>
Divide = 111,
/// <summary>The F1 key.
/// </summary>
F1 = 112,
/// <summary>The F2 key.
/// </summary>
F2 = 113,
/// <summary>The F3 key.
/// </summary>
F3 = 114,
/// <summary>The F4 key.
/// </summary>
F4 = 115,
/// <summary>The F5 key.
/// </summary>
F5 = 116,
/// <summary>The F6 key.
/// </summary>
F6 = 117,
/// <summary>The F7 key.
/// </summary>
F7 = 118,
/// <summary>The F8 key.
/// </summary>
F8 = 119,
/// <summary>The F9 key.
/// </summary>
F9 = 120,
/// <summary>The F10 key.
/// </summary>
F10 = 121,
/// <summary>The F11 key.
/// </summary>
F11 = 122,
/// <summary>The F12 key.
/// </summary>
F12 = 123,
/// <summary>The F13 key.
/// </summary>
F13 = 124,
/// <summary>The F14 key.
/// </summary>
F14 = 125,
/// <summary>The F15 key.
/// </summary>
F15 = 126,
/// <summary>The F16 key.
/// </summary>
F16 = 127,
/// <summary>The F17 key.
/// </summary>
F17 = 128,
/// <summary>The F18 key.
/// </summary>
F18 = 129,
/// <summary>The F19 key.
/// </summary>
F19 = 130,
/// <summary>The F20 key.
/// </summary>
F20 = 131,
/// <summary>The F21 key.
/// </summary>
F21 = 132,
/// <summary>The F22 key.
/// </summary>
F22 = 133,
/// <summary>The F23 key.
/// </summary>
F23 = 134,
/// <summary>The F24 key.
/// </summary>
F24 = 135,
/// <summary>The NUM LOCK key.
/// </summary>
NumLock = 144,
/// <summary>The SCROLL LOCK key.
/// </summary>
Scroll = 145,
/// <summary>The left SHIFT key.
/// </summary>
LShiftKey = 160,
/// <summary>The right SHIFT key.
/// </summary>
RShiftKey = 161,
/// <summary>The left CTRL key.
/// </summary>
LControlKey = 162,
/// <summary>The right CTRL key.
/// </summary>
RControlKey = 163,
/// <summary>The left ALT key.
/// </summary>
LMenu = 164,
/// <summary>The right ALT key.
/// </summary>
RMenu = 165,
/// <summary>The browser back key (Windows 2000 or later).
/// </summary>
BrowserBack = 166,
/// <summary>The browser forward key (Windows 2000 or later).
/// </summary>
BrowserForward = 167,
/// <summary>The browser refresh key (Windows 2000 or later).
/// </summary>
BrowserRefresh = 168,
/// <summary>The browser stop key (Windows 2000 or later).
/// </summary>
BrowserStop = 169,
/// <summary>The browser search key (Windows 2000 or later).
/// </summary>
BrowserSearch = 170,
/// <summary>The browser favourites key (Windows 2000 or later).
/// </summary>
BrowserFavorites = 171,
/// <summary>The browser home key (Windows 2000 or later).
/// </summary>
BrowserHome = 172,
/// <summary>The volume mute key (Windows 2000 or later).
/// </summary>
VolumeMute = 173,
/// <summary>The volume down key (Windows 2000 or later).
/// </summary>
VolumeDown = 174,
/// <summary>The volume up key (Windows 2000 or later).
/// </summary>
VolumeUp = 175,
/// <summary>The media next track key (Windows 2000 or later).
/// </summary>
MediaNextTrack = 176,
/// <summary>The media previous track key (Windows 2000 or later).
/// </summary>
MediaPreviousTrack = 177,
/// <summary>The media Stop key (Windows 2000 or later).
/// </summary>
MediaStop = 178,
/// <summary>The media play pause key (Windows 2000 or later).
/// </summary>
MediaPlayPause = 179,
/// <summary>The launch mail key (Windows 2000 or later).
/// </summary>
LaunchMail = 180,
/// <summary>The select media key (Windows 2000 or later).
/// </summary>
SelectMedia = 181,
/// <summary>The start application one key (Windows 2000 or later).
/// </summary>
LaunchApplication1 = 182,
/// <summary>The start application two key (Windows 2000 or later).
/// </summary>
LaunchApplication2 = 183,
/// <summary>The OEM 1 key.
/// </summary>
Oem1 = 186,
/// <summary>The OEM Semicolon key on a US standard keyboard (Windows 2000 or later).
/// </summary>
OemSemicolon = 186,
/// <summary>The OEM plus key on any country/region keyboard (Windows 2000 or later).
/// </summary>
Oemplus = 187,
/// <summary>The OEM comma key on any country/region keyboard (Windows 2000 or later).
/// </summary>
Oemcomma = 188,
/// <summary>The OEM minus key on any country/region keyboard (Windows 2000 or later).
/// </summary>
OemMinus = 189,
/// <summary>The OEM period key on any country/region keyboard (Windows 2000 or later).
/// </summary>
OemPeriod = 190,
/// <summary>The OEM question mark key on a US standard keyboard (Windows 2000 or later).
/// </summary>
OemQuestion = 191,
/// <summary>The OEM 2 key.
/// </summary>
Oem2 = 191,
/// <summary>The OEM tilde key on a US standard keyboard (Windows 2000 or later).
/// </summary>
Oemtilde = 192,
/// <summary>The OEM 3 key.
/// </summary>
Oem3 = 192,
/// <summary>The OEM 4 key.
/// </summary>
Oem4 = 219,
/// <summary>The OEM open bracket key on a US standard keyboard (Windows 2000 or later).
/// </summary>
OemOpenBrackets = 219,
/// <summary>The OEM pipe key on a US standard keyboard (Windows 2000 or later).
/// </summary>
OemPipe = 220,
/// <summary>The OEM 5 key.
/// </summary>
Oem5 = 220,
/// <summary>The OEM 6 key.
/// </summary>
Oem6 = 221,
/// <summary>The OEM close bracket key on a US standard keyboard (Windows 2000 or later).
/// </summary>
OemCloseBrackets = 221,
/// <summary>The OEM 7 key.
/// </summary>
Oem7 = 222,
/// <summary>The OEM singled/double quote key on a US standard keyboard (Windows 2000 or later).
/// </summary>
OemQuotes = 222,
/// <summary>The OEM 8 key.
/// </summary>
Oem8 = 223,
/// <summary>The OEM 102 key.
/// </summary>
Oem102 = 226,
/// <summary>The OEM angle bracket or backslash key on the RT 102 key keyboard (Windows 2000 or later).
/// </summary>
OemBackslash = 226,
/// <summary>The PROCESS KEY key.
/// </summary>
ProcessKey = 229,
/// <summary>Used to pass Unicode characters as if they were keystrokes.
/// The Packet key value is the low word of a 32-bit virtual-key value used for non-keyboard
/// input methods.
/// </summary>
Packet = 231,
/// <summary>The ATTN key.
/// </summary>
Attn = 246,
/// <summary>The CRSEL key.
/// </summary>
Crsel = 247,
/// <summary>The EXSEL key.
/// </summary>
Exsel = 248,
/// <summary>The ERASE EOF key.
/// </summary>
EraseEof = 249,
/// <summary>The PLAY key.
/// </summary>
Play = 250,
/// <summary>The ZOOM key.
/// </summary>
Zoom = 251,
/// <summary>A constant reserved for future use.
/// </summary>
NoName = 252,
/// <summary>The PA1 key.
/// </summary>
Pa1 = 253,
/// <summary>The CLEAR key.
/// </summary>
OemClear = 254,
/// <summary>The bitmask to extract a key code from a key value.
/// </summary>
KeyCode = 65535,
/// <summary>The SHIFT modifier key.
/// </summary>
Shift = 65536,
/// <summary>The CTRL modifier key.
/// </summary>
Control = 131072,
/// <summary>The ALT modifier key.
/// </summary>
Alt = 262144,
}
#endregion
}
| 30.589491 | 111 | 0.469805 | [
"MIT"
] | bondtech/HotKey-Manager-for-WinForm-and-WPF-Apps | BondTech.HotKeyManagement.WPF.4/Classes/Keys Enum.cs | 18,631 | C# |
// Released under the MIT License.
//
// Copyright (c) 2018 Ntreev Soft co., Ltd.
// Copyright (c) 2020 Jeesu Choi
//
// 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.
//
// Forked from https://github.com/NtreevSoft/Crema
// Namespaces and files starting with "Ntreev" have been renamed to "JSSoft".
using JSSoft.Crema.ServiceModel;
namespace JSSoft.Crema.Services
{
public class DomainMemberRemovedEventArgs : DomainMemberEventArgs
{
public DomainMemberRemovedEventArgs(Authentication authentication, IDomain domain, IDomainMember domainMember, RemoveInfo removeInfo)
: base(authentication, domain, domainMember)
{
this.RemoveInfo = removeInfo;
if (this.Domain.Members.Owner != null)
this.OwnerID = this.Domain.Members.Owner.ID;
}
public RemoveInfo RemoveInfo { get; }
public string OwnerID { get; }
}
}
| 46.97561 | 141 | 0.733126 | [
"MIT"
] | s2quake/JSSoft.Crema | share/JSSoft.Crema.Services/DomainMemberRemovedEventArgs.cs | 1,928 | C# |
using System;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.EntityFramework;
using Microsoft.AspNet.Identity.Owin;
using Microsoft.Owin;
using MusicLibrary.Models;
using MusicLibrary.Data;
namespace MusicLibrary.Web
{
public class ApplicationUserManager : UserManager<User>
{
public ApplicationUserManager(IUserStore<User> store)
: base(store)
{
}
public static ApplicationUserManager Create(IdentityFactoryOptions<ApplicationUserManager> options, IOwinContext context)
{
var manager = new ApplicationUserManager(new UserStore<User>(context.Get<MusicLibraryContext>()));
// Configure validation logic for usernames
manager.UserValidator = new UserValidator<User>(manager)
{
AllowOnlyAlphanumericUserNames = false,
RequireUniqueEmail = true
};
// Configure validation logic for passwords
manager.PasswordValidator = new PasswordValidator
{
//RequiredLength = 6,
//RequireNonLetterOrDigit = true,
//RequireDigit = true,
//RequireLowercase = true,
//RequireUppercase = true,
};
// Register two factor authentication providers. This application uses Phone and Emails as a step of receiving a code for verifying the user
// You can write your own provider and plug it in here.
manager.RegisterTwoFactorProvider("Phone Code", new PhoneNumberTokenProvider<User>
{
MessageFormat = "Your security code is {0}"
});
manager.RegisterTwoFactorProvider("Email Code", new EmailTokenProvider<User>
{
Subject = "Security Code",
BodyFormat = "Your security code is {0}"
});
// Configure user lockout defaults
manager.UserLockoutEnabledByDefault = true;
manager.DefaultAccountLockoutTimeSpan = TimeSpan.FromMinutes(5);
manager.MaxFailedAccessAttemptsBeforeLockout = 5;
manager.EmailService = new EmailService();
manager.SmsService = new SmsService();
var dataProtectionProvider = options.DataProtectionProvider;
if (dataProtectionProvider != null)
{
manager.UserTokenProvider = new DataProtectorTokenProvider<User>(dataProtectionProvider.Create("ASP.NET Identity"));
}
return manager;
}
}
}
| 39.121212 | 152 | 0.623548 | [
"MIT"
] | bbojkov/MushroomMusicLibrary | MusicLibrary.Web/App_Start/ApplicationUserManager.cs | 2,584 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace Xamarin.FormsDemo_CHN.CustomCells
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class IncomingViewCell : ViewCell
{
public IncomingViewCell()
{
InitializeComponent();
}
}
} | 21.05 | 53 | 0.712589 | [
"MIT"
] | l2999019/Xamarin.FormsDemo_CHN | Xamarin.FormsDemo_CHN/Xamarin.FormsDemo_CHN/CustomCells/IncomingViewCell.xaml.cs | 423 | C# |
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Windows.Storage.Streams;
namespace MyPhone.OBEX
{
public class ObexPacket
{
public Opcode Opcode { get; set; }
/// <summary>
/// Will only be updated after calling ToBuffer()
/// </summary>
public ushort PacketLength { get; set; }
public Dictionary<HeaderId, IObexHeader> Headers;
public ObexPacket(Opcode op)
{
Opcode = op;
Headers = new Dictionary<HeaderId, IObexHeader>();
}
public ObexPacket(Opcode op, params IObexHeader[] headers) : this(op)
{
foreach (IObexHeader h in headers)
{
Headers[h.HeaderId] = h;
}
}
protected virtual void WriteExtraField(DataWriter writer) { }
/// <summary>
/// Read extra field after the length field
/// </summary>
/// <param name="reader"></param>
/// <returns>The number of bits required for extra bits</returns>
#pragma warning disable CS1998 // "await"
protected virtual async Task<uint> ReadExtraField(DataReader reader)
#pragma warning restore CS1998 // "await"
{
return 0;
}
public IBuffer ToBuffer()
{
DataWriter writer = new DataWriter();
DataWriter exFieldAndHeaderWriter = new DataWriter();
WriteExtraField(exFieldAndHeaderWriter);
foreach (IObexHeader header in Headers.Values)
{
exFieldAndHeaderWriter.WriteByte((byte)header.HeaderId);
byte[] content = header.ToBytes(); //[]?
if (content != null)
{
if (header.HeaderId.Equals(HeaderId.ConnectionId))
{
Console.WriteLine($"ConnectionId: {BitConverter.ToString(content)}");
}
if (header.GetFixedLength() == 0)
{
exFieldAndHeaderWriter.WriteUInt16((ushort)(content.Length + sizeof(HeaderId) + sizeof(ushort)));
}
exFieldAndHeaderWriter.WriteBytes(content);
}
else
{
exFieldAndHeaderWriter.WriteUInt16(0);
}
}
IBuffer exFieldAndHeaderBuffer = exFieldAndHeaderWriter.DetachBuffer();
writer.WriteByte((byte)Opcode);
PacketLength = (ushort)(exFieldAndHeaderBuffer.Length + sizeof(Opcode) + sizeof(ushort));
writer.WriteUInt16(PacketLength);
writer.WriteBuffer(exFieldAndHeaderBuffer);
return writer.DetachBuffer();
}
private async Task ParseHeader(DataReader reader, uint headerSize)
{
if (headerSize <= 0)
{
Console.WriteLine("Header size to read is zero.");
return;
}
uint loaded = await reader.LoadAsync(headerSize);
if (loaded <= 0)
{
throw new ObexRequestException($"No data returned for {headerSize} unint read.");
}
while (true)
{
if (reader.UnconsumedBufferLength == 0)
{
break;
}
byte read = reader.ReadByte();
Console.WriteLine(read);
IObexHeader header = ObexHeaderFromByte(read);
if (header != null)
{
ushort len = header.GetFixedLength();
if (len == 0)
{
len = (ushort)(reader.ReadUInt16() - sizeof(HeaderId) - sizeof(ushort));
}
if (len == 0)
{
continue;
}
byte[] b = new byte[len];
reader.ReadBytes(b);
header.FromBytes(b);
Headers[header.HeaderId] = header;
}
}
}
public void PrintHeaders()
{
bool zeroFlag = true;
foreach (var header in Headers.Values)
{
zeroFlag = false;
Console.WriteLine($"{header.HeaderId}: {BitConverter.ToString(header.ToBytes())}");
if (header.HeaderId.Equals(HeaderId.ApplicationParameters))
{
var ap = (AppParamHeader)header;
foreach (var item in ap.AppParameters)
{
Console.WriteLine($"{item.TagId}: { BitConverter.ToString(item.Content)} ");
}
//break;
}
}
if (zeroFlag)
{
Console.WriteLine("No header returned.");
}
}
/// <summary>
/// Read and parse OBEX packet from DataReader
/// </summary>
/// <param name="reader"></param>
/// <param name="packet">Optional, if this parameter is not null, the data will be read into this parameter</param>
/// <returns>Loaded OBEX packet</returns>
public async static Task<ObexPacket> ReadFromStream(DataReader reader, ObexPacket? packet = null)
{
uint loaded = await reader.LoadAsync(1);
if (loaded != 1)
{
throw new ObexRequestException("The underlying socket was closed before we were able to read the whole data.");
}
Opcode opcode = (Opcode)reader.ReadByte();
if (packet == null)
{
packet = new ObexPacket(opcode);
}
else
{
packet.Opcode = opcode;
}
Console.WriteLine($"ReadFromStream:: Opcode: {packet.Opcode}");
loaded = await reader.LoadAsync(sizeof(ushort));
if (loaded != sizeof(ushort))
{
throw new ObexRequestException("The underlying socket was closed before we were able to read the whole data.");
}
packet.PacketLength = reader.ReadUInt16();
Console.WriteLine($"packet length: {packet.PacketLength}");
uint extraFieldBits = await packet.ReadExtraField(reader);
uint size = packet.PacketLength - (uint)sizeof(Opcode) - sizeof(ushort) - extraFieldBits;
await packet.ParseHeader(reader, size);
return packet;
}
public static IObexHeader ObexHeaderFromByte(byte b)
{
HeaderId headerId = (HeaderId)b;
IObexHeader header;
switch (headerId)
{
case HeaderId.ConnectionId:
case HeaderId.SingleResponseMode:
header = new Int32ValueHeader(headerId);
break;
case HeaderId.ApplicationParameters:
header = new AppParamHeader();
break;
case HeaderId.Type:
case HeaderId.Name:
header = new Utf8StringValueHeader(headerId);
break;
case HeaderId.EndOfBody:
case HeaderId.Body:
header = new BodyHeader(headerId);
break;
case HeaderId.Who:
case HeaderId.Target:
header = new BytesHeader(headerId);
break;
default:
//throw new NotSupportedException($"Input byte '{b}' does not match HeaderId definition. ");
Console.WriteLine($"Input byte '{b}' does not match HeaderId definition. ");
header = new AsciiStringValueHeader(headerId);
break;
}
return header;
}
}
}
| 33.619247 | 127 | 0.49944 | [
"MIT"
] | mediaexplorer74/MyPhone | MyPhone.OBEX/ObexPacket.cs | 8,037 | C# |
using Imagegram.Application.Requests;
using Imagegram.Application.Responses;
using Imagegram.Core.Domain;
using Imagegram.Core.Exceptions;
using Imagegram.Domain.Entities;
using Imagegram.Domain.Repositories;
using MediatR;
using System.Threading;
using System.Threading.Tasks;
namespace Imagegram.Application.Handlers
{
public class CreateCommentCommandHandler : IRequestHandler<CreateCommentRequest, CreateCommentResponse>
{
private readonly IUnitOfWork unitOfWork;
private readonly ICommentRepository commentRepository;
private readonly IPostRepository postRepository;
private readonly IAccountRepository accountRepository;
public CreateCommentCommandHandler(IUnitOfWork unitOfWork, ICommentRepository commentRepository, IPostRepository postRepository, IAccountRepository accountRepository)
{
this.unitOfWork = unitOfWork;
this.commentRepository = commentRepository;
this.postRepository = postRepository;
this.accountRepository = accountRepository;
}
public async Task<CreateCommentResponse> Handle(CreateCommentRequest request, CancellationToken cancellationToken)
{
var creator = await accountRepository.GetByIdAsync(request.CreatorId);
if (creator == null)
{
throw new NotFoundException("creator account");
}
var post = await postRepository.GetByIdAsync(request.PostId);
if (post == null)
{
throw new NotFoundException("post");
}
var comment = Comment.Create(creator, post, request.Content);
await commentRepository.CreateCommentAsync(comment);
await unitOfWork.CommitAsync(comment, cancellationToken);
return new CreateCommentResponse(comment.Id, comment.Content);
}
}
}
| 37.294118 | 174 | 0.701893 | [
"MIT"
] | umutatmaca/imagegram | src/Application/Imagegram.Application/Handlers/CreateCommentCommandHandler.cs | 1,904 | C# |
using System.Threading.Tasks;
using System.Collections.Generic;
namespace Philadelphia.Common {
public delegate void Validate<in T>(T newValue, ISet<string> errors);
public interface IReadWriteValue<ValueT> : IReadOnlyValue<ValueT> {
event Validate<ValueT> Validate;
void Reset(bool isUserChange = false, object sender = null);
Task<Unit> DoChange(ValueT newValue, bool isUserChange, object sender=null, bool mayBeRejectedByValidation=true); //due to user input or programmatic
}
}
| 37.214286 | 157 | 0.742802 | [
"Apache-2.0"
] | todo-it/philadelphia | Philadelphia.Common/Mvp/IReadWriteValue.cs | 521 | C# |
using System;
using System.Threading.Tasks;
using EventDrivenThinking.App.Configuration.EventStore;
using EventDrivenThinking.EventInference.Abstractions;
using EventDrivenThinking.EventInference.Abstractions.Write;
using EventDrivenThinking.EventInference.EventHandlers;
using EventDrivenThinking.EventInference.EventStore;
using EventDrivenThinking.EventInference.Schema;
using EventDrivenThinking.EventInference.Subscriptions;
using EventStore.Client;
namespace EventDrivenThinking.Integrations.EventStore
{
public class ProcessorEventSubscriptionProvider<TEvent> :
IEventSubscriptionProvider<IProcessor, IProcessorSchema, TEvent>
where TEvent : IEvent
{
private readonly IEventStoreFacade _eventStore;
private readonly IEventConverter _eventConverter;
private readonly IServiceProvider _serviceProvider;
private IProcessorSchema _schema;
public ProcessorEventSubscriptionProvider(IEventStoreFacade eventStore,
IEventConverter eventConverter, IServiceProvider serviceProvider)
{
_eventStore = eventStore;
_eventConverter = eventConverter;
_serviceProvider = serviceProvider;
}
public string Type => "EventStore";
public void Init(IProcessorSchema schema)
{
if (_schema == null || Equals(_schema, schema))
_schema = schema;
else throw new InvalidOperationException();
}
public bool CanMerge(ISubscriptionProvider<IProcessor, IProcessorSchema> other)
{
return false;
}
public ISubscriptionProvider<IProcessor, IProcessorSchema> Merge(ISubscriptionProvider<IProcessor, IProcessorSchema> other)
{
throw new NotImplementedException();
}
public async Task<ISubscription> Subscribe(IEventHandlerFactory factory, object[] args = null)
{
if (!factory.SupportedEventTypes.Contains<TEvent>())
throw new InvalidOperationException(
$"Event Handler Factory seems not to support this Event. {typeof(TEvent).Name}");
// uhhh and we need to know from when...
Type checkpointRepo = typeof(ICheckpointRepository<,>).MakeGenericType(_schema.Type, typeof(TEvent));
var repo = (ICheckpointEventRepository<TEvent>) _serviceProvider.GetService(checkpointRepo);
string streamName = $"$et-{typeof(TEvent).Name}";
var lastCheckpoint = await repo.GetLastCheckpoint();
StreamRevision start = StreamRevision.Start;
if (!lastCheckpoint.HasValue)
{
// this is the first time we run this processor.
var (globalPosition, streamRevision )= await _eventStore.GetLastStreamPosition(streamName);
start = streamRevision;
await repo.SaveCheckpoint(start.ToUInt64());
}
else
{
start = new StreamRevision(lastCheckpoint.Value+1);
}
Subscription s = new Subscription();
await _eventStore.SubscribeToStreamAsync(streamName, start,
async (s, r, c) =>
{
using (var scope = factory.Scope())
{
var handler = scope.CreateHandler<TEvent>();
var (m, e) = _eventConverter.Convert<TEvent>(r);
await handler.Execute(m, e);
await repo.SaveCheckpoint(r.Link.EventNumber.ToUInt64());
}
},ss => s.MakeLive(), true);
return s;
}
}
} | 37.565657 | 131 | 0.63189 | [
"MIT"
] | eventmodeling/eventdriventhinking | EventDrivenThinking/Integrations/EventStore/ProcessorEventSubscriptionProvider.cs | 3,721 | C# |
namespace ProcessControlStandards.OPC.TestTool.Commands
{
public interface ICommand : System.Windows.Input.ICommand
{
void RiseCanExecuteChanged();
}
}
| 22.5 | 62 | 0.694444 | [
"MIT"
] | voyachek/ProcessControlStandards.OPC | TestTool/Commands/ICommand.cs | 182 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WamBot.Twitch.Api
{
public abstract class ChecksAttribute : Attribute
{
public abstract bool DoCheck(CommandContext ctx);
}
}
| 19.571429 | 57 | 0.744526 | [
"MIT"
] | WamWooWam/WamBot.Twitch | WamBot.Twitch/Api/Attributes/ChecksAttribute.cs | 276 | C# |
using System;
using System.Collections.Generic;
using System.Net.Http.Headers;
using System.Text;
using YaCloudKit.Core;
namespace YaCloudKit.TTS.Utils
{
public class YandexTtsHeaderBuilder
{
public const string HEAD_AUTH = "Authorization";
public const string HEAD_AUTH_BEARER = "Bearer";
public const string HEAD_AUTH_APIKEY = "Api-Key";
public const string HEAD_REQUEST_ID = "x-client-request-id";
public const string HEAD_REQUEST_LOG = "x-data-logging-enabled";
public static void AddLoggingHeaders(IRequestContext context, string requestId)
{
if (!string.IsNullOrWhiteSpace(requestId))
{
context.AddHeader(HEAD_REQUEST_ID, requestId);
context.AddHeader(HEAD_REQUEST_LOG, "true");
}
}
public static void AddMainHeaders(IRequestContext context, YandexTtsConfig config)
{
if (!string.IsNullOrWhiteSpace(config.TokenIAM) && !string.IsNullOrWhiteSpace(config.FolderID))
context.AddHeader(HEAD_AUTH, HEAD_AUTH_BEARER + " " + config.TokenIAM);
else if (!string.IsNullOrWhiteSpace(config.ApiKey))
context.AddHeader(HEAD_AUTH, HEAD_AUTH_APIKEY + " " + config.ApiKey);
else
throw new YandexTtsServiceException("Параметры авторизации не заданы");
}
/// <summary>
/// Добавляет недостающие заголовки из контекста в класс HttpHeaders запроса или http-контента
/// </summary>
/// <param name="headers"></param>
/// <param name="values"></param>
public static void AddHttpHeaders(IRequestContext context, HttpHeaders headers)
{
foreach (var headItem in context.Headers)
headers.TryAddWithoutValidation(headItem.Key, headItem.Value);
}
}
}
| 39.125 | 107 | 0.646965 | [
"MIT"
] | gkurbesov/YaCloudKit | src/YaCloudKit.TTS/Utils/YandexTtsHeaderBuilder.cs | 1,972 | C# |
using System;
using System.Xml.Serialization;
namespace HoloXPLOR.Data.DataForge
{
[XmlRoot(ElementName = "BTLessThanEqualsOnEnter")]
public partial class BTLessThanEqualsOnEnter : BTDecorator
{
[XmlArray(ElementName = "Lhs")]
[XmlArrayItem(Type = typeof(BTInputAny))]
[XmlArrayItem(Type = typeof(BTInputAnyBoolValue))]
[XmlArrayItem(Type = typeof(BTInputAnyIntValue))]
[XmlArrayItem(Type = typeof(BTInputAnyFloatValue))]
[XmlArrayItem(Type = typeof(BTInputAnyStringValue))]
[XmlArrayItem(Type = typeof(BTInputAnyTagValue))]
[XmlArrayItem(Type = typeof(BTInputAnyVar))]
[XmlArrayItem(Type = typeof(BTInputAnyBB))]
public BTInputAny[] Lhs { get; set; }
[XmlArray(ElementName = "Rhs")]
[XmlArrayItem(Type = typeof(BTInputAny))]
[XmlArrayItem(Type = typeof(BTInputAnyBoolValue))]
[XmlArrayItem(Type = typeof(BTInputAnyIntValue))]
[XmlArrayItem(Type = typeof(BTInputAnyFloatValue))]
[XmlArrayItem(Type = typeof(BTInputAnyStringValue))]
[XmlArrayItem(Type = typeof(BTInputAnyTagValue))]
[XmlArrayItem(Type = typeof(BTInputAnyVar))]
[XmlArrayItem(Type = typeof(BTInputAnyBB))]
public BTInputAny[] Rhs { get; set; }
}
}
| 39.151515 | 62 | 0.673375 | [
"MIT"
] | dolkensp/HoloXPLOR | HoloXPLOR.Data/DataForge/AutoGen/BTLessThanEqualsOnEnter.cs | 1,292 | C# |
using Godot;
using System;
using System.Collections.Generic;
using System.Collections;
using ai4u;
namespace ai4u.ext
{
public class OrRewardFunc : RewardFunc
{
private const int NB_OF_ARGS = 2;
[Export]
public float alfa = 0.5f;
[Export]
public float successReward = 1.0f;
[Export]
public bool repeatable = false;
private RewardFunc[] arguments;
private bool arg1;
private bool arg2;
private bool applied = false;
[Export]
public NodePath argOneRewardFuncPath;
[Export]
public NodePath argTwoRewardFuncPath;
public override void OnCreate()
{
arguments = new RewardFunc[NB_OF_ARGS];
if (argOneRewardFuncPath != null && argTwoRewardFuncPath != null)
{
arguments[0] = GetNode(argOneRewardFuncPath) as RewardFunc;
arguments[1] = GetNode(argTwoRewardFuncPath) as RewardFunc;
arguments[0].Subscribe(this);
arguments[1].Subscribe(this);
} else
{
var count = 0;
foreach (Node node in GetChildren())
{
if ( node.GetType().IsSubclassOf(typeof(RewardFunc)) )
{
RewardFunc r = node as RewardFunc;
arguments[count++] = r;
r.Subscribe(this);
if (count >= NB_OF_ARGS)
{
break;
}
}
}
}
}
private float r = 0.0f;
public override void OnNotificationFrom(RewardFunc notifier, float reward)
{
if (applied && !repeatable)
{
return;
}
if (notifier.Name == arguments[0].Name)
{
r += reward;
arg1 = true;
}
if (notifier.Name == arguments[1].Name)
{
r += reward;
arg2 = true;
}
if (arg1 || arg2)
{
float mixed = (1-alfa)*successReward + alfa * r;
NotifyAll(mixed);
agent.AddReward(mixed, this, endEpisodeInSuccess);
if (repeatable)
{
arg1 = arg2 = false;
} else
{
applied = true;
}
r = 0.0f;
}
}
public override void OnReset(Agent agent)
{
r = 0.0f;
arg1 = arg2 = false;
applied = false;
}
}
}
| 18.181818 | 76 | 0.607 | [
"MIT"
] | gilcoder/AI4U | serverside/godotversion/ai4u/ext/RL/src/OrRewardFunc.cs | 2,000 | C# |
using System;
using System.Collections.Generic;
using System.Text;
namespace Forum.Models
{
public class Category
{
public Category(int id, string name, IEnumerable<int> posts)
{
this.Id = id;
this.Name = name;
this.Posts = new List<int>(posts);
}
public int Id { get; set; }
public string Name { get; set; }
public ICollection<int> Posts { get; set; }
}
}
| 19.913043 | 68 | 0.558952 | [
"MIT"
] | Javorov1103/SoftUni-Course | C# OOP Basics/07. Workshop/Forum.Models/Category.cs | 460 | C# |
//
// Copyright 2016 Carbonfrost Systems, Inc. (http://carbonfrost.com)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
using System;
using System.Linq;
using System.Reflection;
using System.Xml;
using Microsoft.CSharp.RuntimeBinder;
using Carbonfrost.Commons.Core.Runtime;
using Carbonfrost.Commons.Web.Dom;
using System.IO;
namespace Carbonfrost.Commons.Hxl.Compiler {
partial class HxlAssemblyCollection {
internal static readonly HxlAssemblyCollection System
= new HxlAssemblyCollection();
internal static readonly HxlAssemblyCollection Hxl
= new HxlAssemblyCollection();
static readonly Type[] NEED_TYPES = {
typeof(object),
typeof(Enumerable),
typeof(Uri),
typeof(XmlWriter),
typeof(RuntimeBinderException),
};
static readonly Type[] NEED_HXL_TYPES = {
typeof(HxlElement),
typeof(Activation),
typeof(DomElement),
};
// TODO We add assemblies based on the runtime of this rather
// that the desired target framework of the output
static HxlAssemblyCollection() {
foreach (var t in NEED_HXL_TYPES) {
Hxl.Add(t.GetTypeInfo().Assembly);
}
try {
TryLoadDefaults();
} catch {
}
}
static void TryLoadDefaults() {
#if NET
var assemblies = NEED_TYPES.Select(t => t.GetTypeInfo().Assembly);
foreach (var asm in assemblies.Distinct()) {
System.Add(asm);
}
#else
// In netcore, we need a generic list
// TODO Support Windows here, more robust support for directories
string home = Environment.GetEnvironmentVariable("HOME");
System.AddNewFile(
Path.Combine(home, ".nuget/packages/NETStandard.Library/2.0.3/build/netstandard2.0/ref/netstandard.dll")
);
// TODO Contains TimeZoneInfo, which is in use by a test, but it isn't clear that this is a good
// default reference for .NET Standard/2.0
System.AddNewFile(
Path.Combine(home, ".nuget/packages/NETStandard.Library/2.0.3/build/netstandard2.0/ref/System.Runtime.dll")
);
System.AddNewFile(
Path.Combine(home, ".nuget/packages/Microsoft.CSharp/4.7.0/ref/netstandard2.0/Microsoft.CSharp.dll")
);
#endif
}
}
}
| 32.902174 | 123 | 0.625702 | [
"Apache-2.0"
] | Carbonfrost/f-hxl | dotnet/src/Carbonfrost.Commons.Hxl/Compiler/HxlAssemblyCollection.Static.cs | 3,027 | C# |
using System.IO;
namespace Grappachu.Movideo.Core.Components.MediaAnalyzer
{
public interface IFileAnalyzer
{
AnalyzedItem Analyze(FileInfo file);
}
} | 19.111111 | 57 | 0.72093 | [
"MIT"
] | grappachu/apps.movideo | src/Movideo.Core/Components/MediaAnalyzer/IFileAnalyzer.cs | 174 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace PizzaCalories
{
public class Pizza
{
private string name;
private Dough dough;
private List<Topping> toppings;
public Pizza(string name, Dough dough)
{
this.toppings = new List<Topping>();
this.Name = name;
this.Dough = dough;
}
public string Name
{
get => this.name;
private set
{
if (string.IsNullOrEmpty(value) || value.Length > 15)
{
throw new ArgumentException("Pizza name should be between 1 and 15 symbols.");
}
this.name = value;
}
}
public Dough Dough
{
get => this.dough;
private set
{
this.dough = value;
}
}
public int ToppingsCount => this.toppings.Count;
public double Calories => this.PizzaCalories();
public void AddTopping(Topping currentTopping)
{
var type = currentTopping.Type.ToLower();
var weight = currentTopping.Weight;
Topping topping = new Topping(type, weight);
if (toppings.Count > 10)
{
throw new ArgumentException("Number of toppings should be in range [0..10].");
}
this.toppings.Add(topping);
}
private double PizzaCalories()
{
var toppingsCalories = this.toppings.Select(x => x.Calories).Sum();
var doughCalories = this.Dough.Calories;
return doughCalories + toppingsCalories;
}
}
}
| 24.205479 | 98 | 0.513865 | [
"MIT"
] | ITonev/SoftUni | C#-OOP/Encapsulation/Exercise/PizzaCalories/Pizza.cs | 1,769 | C# |
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
namespace SixLabors.ImageSharp.Formats.Bmp
{
/// <summary>
/// Defines possible options, how skipped pixels during decoding of run length encoded bitmaps should be treated.
/// </summary>
public enum RleSkippedPixelHandling : int
{
/// <summary>
/// Undefined pixels should be black. This is the default behavior and equal to how System.Drawing handles undefined pixels.
/// </summary>
Black = 0,
/// <summary>
/// Undefined pixels should be transparent.
/// </summary>
Transparent = 1,
/// <summary>
/// Undefined pixels should have the first color of the palette.
/// </summary>
FirstColorOfPalette = 2
}
}
| 30.703704 | 132 | 0.622437 | [
"Apache-2.0"
] | GyleIverson/ImageSharp | src/ImageSharp/Formats/Bmp/RleSkippedPixelHandling.cs | 829 | C# |
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// 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.Xml;
using ICSharpCode.XmlEditor;
using NUnit.Framework;
using XmlEditor.Tests.Utils;
namespace XmlEditor.Tests.Tree
{
/// <summary>
/// Tests pasting nodes with the XmlTreeEditor either from a cut or a copy.
/// Here we are testing the XmlTreeEditor side and now the actual
/// GUI side - XML Tree.
/// </summary>
[TestFixture]
public class PasteTestFixture : XmlTreeViewTestFixtureBase
{
XmlElement rootElement;
XmlElement bodyElement;
XmlElement paragraphElement;
XmlComment bodyComment;
XmlText paragraphText;
[SetUp]
public void Init()
{
base.InitFixture();
rootElement = editor.Document.DocumentElement;
bodyElement = (XmlElement)rootElement.FirstChild;
paragraphElement = (XmlElement)bodyElement.SelectSingleNode("p");
bodyComment = (XmlComment)bodyElement.SelectSingleNode("comment()");
paragraphText = (XmlText)paragraphElement.SelectSingleNode("text()");
}
/// <summary>
/// Here we take a copy of the root element of the document and paste
/// it on top of itself. This should append a copy of the root element
/// as a child of the existing root element. All child nodes of the
/// root element should be copied too.
/// </summary>
[Test]
public void CopyRootElementAndPasteToRootElement()
{
mockXmlTreeView.SelectedElement = rootElement;
editor.Copy();
bool pasteEnabled = editor.IsPasteEnabled;
editor.Paste();
XmlElement pastedElement = (XmlElement)rootElement.LastChild;
Assert.AreEqual(rootElement.Name, pastedElement.Name);
Assert.AreEqual(rootElement.FirstChild.Name, pastedElement.FirstChild.Name);
Assert.IsTrue(mockXmlTreeView.IsDirty);
Assert.AreEqual(1, mockXmlTreeView.ChildElementsAdded.Count);
Assert.AreEqual(pastedElement, mockXmlTreeView.ChildElementsAdded[0]);
Assert.IsTrue(pasteEnabled);
}
/// <summary>
/// The selected node is null when the paste is attempted. Here
/// nothing should happen.
/// </summary>
[Test]
public void PasteWhenNoNodeSelected()
{
mockXmlTreeView.SelectedNode = rootElement;
editor.Copy();
mockXmlTreeView.SelectedNode = null;
bool pasteEnabled = editor.IsPasteEnabled;
editor.Paste();
Assert.IsFalse(mockXmlTreeView.IsDirty);
Assert.IsFalse(pasteEnabled);
}
/// <summary>
/// Check that the view is informed when a node is cut. This allows the
/// view to give some sort of indication that a particular node is
/// being cut.
/// </summary>
[Test]
public void CutElement()
{
mockXmlTreeView.SelectedElement = bodyElement;
editor.Cut();
Assert.AreEqual(1, mockXmlTreeView.CutNodes.Count);
Assert.AreEqual(bodyElement, mockXmlTreeView.CutNodes[0]);
Assert.IsFalse(mockXmlTreeView.IsDirty);
}
[Test]
public void CutAndPasteElement()
{
mockXmlTreeView.SelectedElement = paragraphElement;
editor.Cut();
mockXmlTreeView.SelectedElement = rootElement;
editor.Paste();
XmlElement pastedElement = rootElement.LastChild as XmlElement;
Assert.IsTrue(mockXmlTreeView.IsDirty);
Assert.AreSame(paragraphElement, pastedElement);
Assert.IsNull(bodyElement.SelectSingleNode("p"));
Assert.AreEqual(1, mockXmlTreeView.ChildElementsAdded.Count);
Assert.AreSame(paragraphElement, mockXmlTreeView.ChildElementsAdded[0]);
Assert.AreEqual(1, mockXmlTreeView.ElementsRemoved.Count);
Assert.AreSame(paragraphElement, mockXmlTreeView.ElementsRemoved[0]);
}
/// <summary>
/// Checks that nothing happens when no node is selected in the tree
/// to cut.
/// </summary>
[Test]
public void NoElementSelectedToCut()
{
editor.Cut();
Assert.AreEqual(0, mockXmlTreeView.CutNodes.Count);
}
/// <summary>
/// The selected node is null when the copy method is called, but
/// there is a selected node when the paste is attempted. Here
/// nothing should happen.
/// </summary>
[Test]
public void CopyWhenNoNodeSelectedThenPaste()
{
mockXmlTreeView.SelectedNode = null;
editor.Copy();
mockXmlTreeView.SelectedNode = rootElement;
bool pasteEnabled = editor.IsPasteEnabled;
editor.Paste();
Assert.IsFalse(mockXmlTreeView.IsDirty);
Assert.IsFalse(pasteEnabled);
}
[Test]
public void IsCopyEnabledWhenNoNodeSelected()
{
Assert.IsFalse(editor.IsCopyEnabled);
}
[Test]
public void IsCopyEnabledWhenRootElementSelected()
{
mockXmlTreeView.SelectedElement = rootElement;
mockXmlTreeView.SelectedNode = rootElement;
Assert.IsTrue(editor.IsCopyEnabled);
}
[Test]
public void IsCutEnabledWhenChildElementSelected()
{
mockXmlTreeView.SelectedElement = bodyElement;
mockXmlTreeView.SelectedNode = bodyElement;
Assert.IsTrue(editor.IsCutEnabled);
}
[Test]
public void IsCutEnabledWhenRootElementSelected()
{
mockXmlTreeView.SelectedElement = rootElement;
mockXmlTreeView.SelectedNode = rootElement;
Assert.IsFalse(editor.IsCutEnabled);
}
/// <summary>
/// The document should not change if the user decides to paste the
/// cut node back to itself. All that should happen is the view
/// updates the cut node so it no longer has the ghost image.
/// </summary>
[Test]
public void CutAndPasteToSameNode()
{
mockXmlTreeView.SelectedElement = paragraphElement;
editor.Cut();
mockXmlTreeView.SelectedElement = paragraphElement;
editor.Paste();
Assert.IsFalse(mockXmlTreeView.IsDirty);
Assert.AreEqual(0, mockXmlTreeView.ChildElementsAdded.Count);
Assert.AreEqual(1, mockXmlTreeView.HiddenCutNodes.Count);
Assert.AreSame(paragraphElement, mockXmlTreeView.HiddenCutNodes[0]);
}
[Test]
public void CutThenPasteTwiceToSameNode()
{
mockXmlTreeView.SelectedElement = paragraphElement;
editor.Cut();
mockXmlTreeView.SelectedElement = paragraphElement;
editor.Paste();
mockXmlTreeView.IsDirty = false;
mockXmlTreeView.HiddenCutNodes.Clear();
mockXmlTreeView.SelectedElement = rootElement;
bool pasteEnabled = editor.IsPasteEnabled;
editor.Paste();
Assert.IsFalse(mockXmlTreeView.IsDirty);
Assert.AreEqual(0, mockXmlTreeView.ChildElementsAdded.Count);
Assert.IsFalse(pasteEnabled);
}
[Test]
public void CannotPasteElementOntoCommentNode()
{
mockXmlTreeView.SelectedElement = paragraphElement;
editor.Copy();
mockXmlTreeView.SelectedComment = bodyComment;
Assert.IsFalse(editor.IsPasteEnabled);
}
[Test]
public void CannotPasteElementOntoTextNode()
{
mockXmlTreeView.SelectedElement = paragraphElement;
editor.Copy();
mockXmlTreeView.SelectedComment = bodyComment;
Assert.IsFalse(editor.IsPasteEnabled);
}
[Test]
public void CopyAndPasteTextNode()
{
mockXmlTreeView.SelectedTextNode = paragraphText;
editor.Copy();
bool pastedEnabledWhenTextNodeSelected = editor.IsPasteEnabled;
mockXmlTreeView.SelectedElement = bodyElement;
bool pasteEnabled = editor.IsPasteEnabled;
editor.Paste();
XmlText pastedTextNode = bodyElement.LastChild as XmlText;
Assert.IsFalse(pastedEnabledWhenTextNodeSelected);
Assert.IsTrue(pasteEnabled);
Assert.IsTrue(mockXmlTreeView.IsDirty);
Assert.IsNotNull(pastedTextNode);
Assert.AreEqual(paragraphText.InnerText, pastedTextNode.InnerText);
Assert.AreEqual(1, mockXmlTreeView.ChildTextNodesAdded.Count);
Assert.AreEqual(pastedTextNode, mockXmlTreeView.ChildTextNodesAdded[0]);
}
[Test]
public void CutAndPasteTextNode()
{
mockXmlTreeView.SelectedTextNode = paragraphText;
editor.Cut();
mockXmlTreeView.SelectedElement = bodyElement;
bool pasteEnabled = editor.IsPasteEnabled;
editor.Paste();
XmlText pastedTextNode = bodyElement.LastChild as XmlText;
Assert.IsTrue(pasteEnabled);
Assert.IsNotNull(pastedTextNode);
Assert.IsTrue(mockXmlTreeView.IsDirty);
Assert.IsNull(paragraphElement.SelectSingleNode("text()"));
Assert.AreEqual(1, mockXmlTreeView.ChildTextNodesAdded.Count);
Assert.AreEqual(pastedTextNode, mockXmlTreeView.ChildTextNodesAdded[0]);
Assert.AreEqual(1, mockXmlTreeView.CutNodes.Count);
Assert.AreSame(pastedTextNode, mockXmlTreeView.CutNodes[0]);
Assert.AreEqual(1, mockXmlTreeView.TextNodesRemoved.Count);
Assert.AreSame(paragraphText, mockXmlTreeView.TextNodesRemoved[0]);
}
[Test]
public void CopyAndPasteCommentNode()
{
mockXmlTreeView.SelectedComment = bodyComment;
editor.Copy();
bool pastedEnabledWhenCommentSelected = editor.IsPasteEnabled;
mockXmlTreeView.SelectedElement = rootElement;
bool pasteEnabled = editor.IsPasteEnabled;
editor.Paste();
XmlComment pastedCommentNode = rootElement.LastChild as XmlComment;
Assert.IsFalse(pastedEnabledWhenCommentSelected);
Assert.IsTrue(pasteEnabled);
Assert.IsTrue(mockXmlTreeView.IsDirty);
Assert.IsNotNull(pastedCommentNode);
Assert.AreEqual(bodyComment.InnerText, pastedCommentNode.InnerText);
Assert.AreEqual(1, mockXmlTreeView.ChildCommentNodesAdded.Count);
Assert.AreEqual(pastedCommentNode, mockXmlTreeView.ChildCommentNodesAdded[0]);
}
[Test]
public void CutAndPasteCommentNode()
{
mockXmlTreeView.SelectedComment = bodyComment;
editor.Cut();
mockXmlTreeView.SelectedElement = rootElement;
bool pasteEnabled = editor.IsPasteEnabled;
editor.Paste();
XmlComment pastedCommentNode = rootElement.LastChild as XmlComment;
Assert.IsTrue(pasteEnabled);
Assert.IsNotNull(pastedCommentNode);
Assert.IsTrue(mockXmlTreeView.IsDirty);
Assert.IsNull(bodyElement.SelectSingleNode("comment()"));
Assert.AreSame(bodyComment, pastedCommentNode);
Assert.AreEqual(1, mockXmlTreeView.ChildCommentNodesAdded.Count);
Assert.AreEqual(pastedCommentNode, mockXmlTreeView.ChildCommentNodesAdded[0]);
Assert.AreEqual(1, mockXmlTreeView.CutNodes.Count);
Assert.AreSame(pastedCommentNode, mockXmlTreeView.CutNodes[0]);
Assert.AreEqual(1, mockXmlTreeView.CommentNodesRemoved.Count);
Assert.AreSame(pastedCommentNode, mockXmlTreeView.CommentNodesRemoved[0]);
}
/// <summary>
/// Tests that the cut node has its ghost image removed.
/// </summary>
[Test]
public void CutThenCopyElement()
{
mockXmlTreeView.SelectedElement = bodyElement;
editor.Cut();
editor.Copy();
Assert.AreEqual(1, mockXmlTreeView.HiddenCutNodes.Count);
Assert.AreSame(bodyElement, mockXmlTreeView.HiddenCutNodes[0]);
}
/// <summary>
/// This test makes sure that the copied node is cleared when
/// the user decides to do a cut.
/// </summary>
[Test]
public void CopyThenCutAndPasteElement()
{
mockXmlTreeView.SelectedElement = paragraphElement;
editor.Copy();
editor.Cut();
mockXmlTreeView.SelectedElement = rootElement;
editor.Paste();
Assert.IsNull(bodyElement.SelectSingleNode("p"));
}
[Test]
public void CopyThenPasteToUnsupportedNode()
{
XmlNode node = editor.Document.CreateProcessingInstruction("a", "b");
mockXmlTreeView.SelectedNode = node;
editor.Copy();
mockXmlTreeView.SelectedElement = rootElement;
Assert.IsFalse(editor.IsPasteEnabled);
}
/// <summary>
/// Returns the xhtml strict schema as the default schema.
/// </summary>
protected override XmlSchemaCompletion DefaultSchemaCompletion {
get { return new XmlSchemaCompletion(ResourceManager.ReadXhtmlStrictSchema()); }
}
protected override string GetXml()
{
return "<html>\r\n" +
"\t<body>\r\n" +
"\t\t<!-- Comment -->\r\n" +
"\t\t<p>some text here</p>\r\n" +
"\t</body>\r\n" +
"</html>";
}
}
}
| 32.47449 | 93 | 0.74077 | [
"MIT"
] | TetradogOther/SharpDevelop | src/AddIns/DisplayBindings/XmlEditor/Test/Tree/PasteTestFixture.cs | 12,732 | C# |
using Newtonsoft.Json;
namespace CmsEngine.Application.ViewModels.DataTableViewModels
{
public class DataOrder
{
[JsonProperty(PropertyName = "column")]
public int Column { get; set; }
[JsonProperty(PropertyName = "dir")]
public string Dir { get; set; }
}
}
| 21.714286 | 62 | 0.644737 | [
"MIT"
] | davidsonsousa/CmsEngine | CmsEngine.Application/Models/ViewModels/DataTableViewModels/DataOrder.cs | 304 | C# |
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
namespace Console.Formatter.Host.Middleware
{
public class IdentifiersMiddleware
{
private readonly RequestDelegate _next;
public IdentifiersMiddleware(RequestDelegate next)
{
_next = next;
}
public async Task Invoke(HttpContext context, ILogger<IdentifiersMiddleware> logger)
{
// Discover these from whatever context is available
var scope = new Identifiers
{
CorrelationId = Guid.NewGuid(),
UserId = "the-user",
CustomerId = "the-customer",
};
// Identifiers will be logged by all other loggers in downstream middleware
using (logger.BeginScope(scope))
{
await _next(context);
}
}
}
} | 26.441176 | 90 | 0.619577 | [
"MIT"
] | acraven/blog-console-formatter | app/Console.Formatter.Host/Middleware/IdentifiersMiddleware.cs | 899 | C# |
public class OutputMessages
{
public const string NoWeaponsForSoldierType = "There is no weapon for {0} {1}!";
public const string SoldierToString = "{0} - {1}";
public const string MissionDeclined = "Mission declined - {0}";
public const string MissionSuccessful = "Mission completed - {0}";
public const string MissionOnHold = "Mission on hold - {0}";
public const string MissionsSummurySuccessful = "Successful missions - {0}";
public const string MissionsSummuryFailed = "Failed missions - {0}";
public const string InputTerminateString = "Enough! Pull back!";
}
| 31.947368 | 84 | 0.70346 | [
"MIT"
] | ViktorAleksandrov/SoftUni--CSharp-Fundamentals | 3. CSharp OOP Advanced/09. Exam Preparations/1. Exam - 20 August 2017 - The Last Army/TheLastArmy/Constants/OutputMessages.cs | 609 | C# |
namespace SFA.DAS.Commitments.Domain
{
public enum CallerType
{
Employer = 0,
Provider
}
} | 14.875 | 37 | 0.579832 | [
"MIT"
] | Ryan-Fitchett/Test | src/SFA.DAS.Commitments.Domain/CallerType.cs | 121 | C# |
namespace Stratis.Bitcoin.EventBus
{
/// <summary>
/// A generic event that can be raised by any component of the full node.
/// <para>
/// This can later be extended or abstracted to provide more in-depth information
/// on a particular event.
/// </para>
/// </summary>
public sealed class FullNodeEvent : EventBase
{
public string Message { get; set; }
public string State { get; set; }
}
}
| 28.1875 | 85 | 0.616408 | [
"MIT"
] | Amazastrophic/StratisFullNode | src/Stratis.Bitcoin/EventBus/FullNodeEvent.cs | 453 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.Support.V4.View;
using Android.Graphics;
using Com.Viewpagerindicator;
namespace Xamarin.Android.ViewPagerIndicator.Sample
{
[Activity (Label = "Circles/Styled (via methods)", Theme = "@android:style/Theme.Light")]
[IntentFilter (new[]{Intent.ActionMain}, Categories = new[]{ "mono.viewpagerindicator.sample" })]
public class SampleCirclesStyledMethods : BaseSampleActivity
{
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
SetContentView (Resource.Layout.themed_circles);
mAdapter = new TestFragmentAdapter (SupportFragmentManager);
mPager = FindViewById<ViewPager> (Resource.Id.pager);
mPager.Adapter = mAdapter;
var indicator = FindViewById<CirclePageIndicator> (Resource.Id.indicator);
mIndicator = indicator;
indicator.SetViewPager (mPager);
float density = Resources.DisplayMetrics.Density;
indicator.SetBackgroundColor (Color.ParseColor ("#FFCCCCCC"));
indicator.Radius = 10 * density;
indicator.PageColor = Color.ParseColor ("#880000FF");
indicator.FillColor = Color.ParseColor ("#FF888888");
indicator.StrokeColor = Color.ParseColor ("#FF000000");
indicator.StrokeWidth = 2 * density;
}
}
}
| 29.833333 | 99 | 0.749302 | [
"Apache-2.0"
] | wada811/Xamarin.Android.ViewPagerIndicator | Xamarin.Android.ViewPagerIndicator/Xamarin.Android.ViewPagerIndicator.Sample/Circles/SampleCirclesStyledMethods.cs | 1,432 | C# |
//---------------------------------------------------------------------
// <copyright file="IPackStreamContext.cs" company="Microsoft Corporation">
// Copyright (c) 1999, Microsoft Corporation. All rights reserved.
// </copyright>
// <summary>
// Part of the Deployment Tools Foundation project.
// </summary>
//---------------------------------------------------------------------
namespace Microsoft.PackageManagement.Archivers.Internal.Compression
{
using System;
using System.Diagnostics.CodeAnalysis;
using System.IO;
/// <summary>
/// This interface provides the methods necessary for the
/// <see cref="CompressionEngine"/> to open and close streams for archives
/// and files. The implementor of this interface can use any kind of logic
/// to determine what kind of streams to open and where.
/// </summary>
public interface IPackStreamContext
{
/// <summary>
/// Gets the name of the archive with a specified number.
/// </summary>
/// <param name="archiveNumber">The 0-based index of the archive
/// within the chain.</param>
/// <returns>The name of the requested archive. May be an empty string
/// for non-chained archives, but may never be null.</returns>
/// <remarks>The archive name is the name stored within the archive, used for
/// identification of the archive especially among archive chains. That
/// name is often, but not necessarily the same as the filename of the
/// archive package.</remarks>
string GetArchiveName(int archiveNumber);
/// <summary>
/// Opens a stream for writing an archive package.
/// </summary>
/// <param name="archiveNumber">The 0-based index of the archive within
/// the chain.</param>
/// <param name="archiveName">The name of the archive that was returned
/// by <see cref="GetArchiveName"/>.</param>
/// <param name="truncate">True if the stream should be truncated when
/// opened (if it already exists); false if an existing stream is being
/// re-opened for writing additional data.</param>
/// <param name="compressionEngine">Instance of the compression engine
/// doing the operations.</param>
/// <returns>A writable Stream where the compressed archive bytes will be
/// written, or null to cancel the archive creation.</returns>
/// <remarks>
/// If this method returns null, the archive engine will throw a
/// FileNotFoundException.
/// </remarks>
Stream OpenArchiveWriteStream(
int archiveNumber,
string archiveName,
bool truncate,
CompressionEngine compressionEngine);
/// <summary>
/// Closes a stream where an archive package was written.
/// </summary>
/// <param name="archiveNumber">The 0-based index of the archive within
/// the chain.</param>
/// <param name="archiveName">The name of the archive that was previously
/// returned by
/// <see cref="GetArchiveName"/>.</param>
/// <param name="stream">A stream that was previously returned by
/// <see cref="OpenArchiveWriteStream"/> and is now ready to be closed.</param>
/// <remarks>
/// If there is another archive package in the chain, then after this stream
/// is closed a new stream will be opened.
/// </remarks>
void CloseArchiveWriteStream(int archiveNumber, string archiveName, Stream stream);
/// <summary>
/// Opens a stream to read a file that is to be included in an archive.
/// </summary>
/// <param name="path">The path of the file within the archive. This is often,
/// but not necessarily, the same as the relative path of the file outside
/// the archive.</param>
/// <param name="attributes">Returned attributes of the opened file, to be
/// stored in the archive.</param>
/// <param name="lastWriteTime">Returned last-modified time of the opened file,
/// to be stored in the archive.</param>
/// <returns>A readable Stream where the file bytes will be read from before
/// they are compressed, or null to skip inclusion of the file and continue to
/// the next file.</returns>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
Stream OpenFileReadStream(
string path,
out FileAttributes attributes,
out DateTime lastWriteTime);
/// <summary>
/// Closes a stream that has been used to read a file.
/// </summary>
/// <param name="path">The path of the file within the archive; the same as
/// the path provided
/// when the stream was opened.</param>
/// <param name="stream">A stream that was previously returned by
/// <see cref="OpenFileReadStream"/> and is now ready to be closed.</param>
void CloseFileReadStream(string path, Stream stream);
/// <summary>
/// Gets extended parameter information specific to the compression
/// format being used.
/// </summary>
/// <param name="optionName">Name of the option being requested.</param>
/// <param name="parameters">Parameters for the option; for per-file options,
/// the first parameter is typically the internal file path.</param>
/// <returns>Option value, or null to use the default behavior.</returns>
/// <remarks>
/// This method provides a way to set uncommon options during packaging, or a
/// way to handle aspects of compression formats not supported by the base library.
/// <para>For example, this may be used by the zip compression library to
/// specify different compression methods/levels on a per-file basis.</para>
/// <para>The available option names, parameters, and expected return values
/// should be documented by each compression library.</para>
/// </remarks>
object GetOption(string optionName, object[] parameters);
}
} | 51.032258 | 92 | 0.608565 | [
"MIT"
] | darkmastermindz/oneget | src/Microsoft.PackageManagement.ArchiverProviders/Compression/IPackStreamContext.cs | 6,330 | C# |
using EmbeeEDModel.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EmbeePathFinder
{
public class StarPaths
{
private List<StarPath> _availablePaths;
public StarPaths(IEnumerable<StarPath> availablePaths)
{
_availablePaths = availablePaths.ToList();
_availablePaths.AddRange(availablePaths.Select(p =>
{
var n = (StarPath)p.Clone();
n.SwapDirection();
return n;
}).ToList());
}
public int Count { get { return _availablePaths.Count; } }
public List<StarPath> PopPathsFromSystem(string systemName) {
var lname = systemName.ToLower();
var popped = new List<StarPath>();
var paths = _availablePaths.Where(s => s.From.ToLower() == lname).ToList();
foreach(var p in paths)
{
popped.Add(p);
_availablePaths.Remove(p);
}
return popped;
}
public void RemoveAll(Func<StarPath, bool> predicate)
{
_availablePaths.RemoveAll(p => predicate(p));
}
public void RemovePath(StarPath path)
{
if (path != null)
{
_availablePaths.Remove(path);
}
}
public void RemovePaths(IEnumerable<StarPath> starPaths)
{
if (starPaths != null)
{
foreach (var sp in starPaths)
{
_availablePaths.Remove(sp);
}
}
}
}
}
| 25.772727 | 87 | 0.519694 | [
"MIT"
] | MattBayliss/EmbeeEDNavComm | EmbeePathFinder/StarPaths-Crivens.cs | 1,703 | C# |
#pragma checksum "C:\Users\CihatSolak\Desktop\DERS\PROJE GELİŞTİREREK ASP.NET CORE MVC APİ ÖĞRENİN A-Z\BusinessTrackApplication\BusinessTrack.Web\Areas\Admin\Views\Exigency\Create.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "fcf4216f2aed51c9a08e6d8268fc822902d5546d"
// <auto-generated/>
#pragma warning disable 1591
[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.Areas_Admin_Views_Exigency_Create), @"mvc.1.0.view", @"/Areas/Admin/Views/Exigency/Create.cshtml")]
namespace AspNetCore
{
#line hidden
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.AspNetCore.Mvc.ViewFeatures;
#nullable restore
#line 1 "C:\Users\CihatSolak\Desktop\DERS\PROJE GELİŞTİREREK ASP.NET CORE MVC APİ ÖĞRENİN A-Z\BusinessTrackApplication\BusinessTrack.Web\Areas\Admin\Views\_ViewImports.cshtml"
using BusinessTrack.Web.Areas.Admin.Models.Exigencies;
#line default
#line hidden
#nullable disable
#nullable restore
#line 2 "C:\Users\CihatSolak\Desktop\DERS\PROJE GELİŞTİREREK ASP.NET CORE MVC APİ ÖĞRENİN A-Z\BusinessTrackApplication\BusinessTrack.Web\Areas\Admin\Views\_ViewImports.cshtml"
using BusinessTrack.Web.Areas.Admin.Models.Assignments;
#line default
#line hidden
#nullable disable
#nullable restore
#line 3 "C:\Users\CihatSolak\Desktop\DERS\PROJE GELİŞTİREREK ASP.NET CORE MVC APİ ÖĞRENİN A-Z\BusinessTrackApplication\BusinessTrack.Web\Areas\Admin\Views\_ViewImports.cshtml"
using BusinessTrack.Web.Areas.Admin.Models.Home;
#line default
#line hidden
#nullable disable
#nullable restore
#line 4 "C:\Users\CihatSolak\Desktop\DERS\PROJE GELİŞTİREREK ASP.NET CORE MVC APİ ÖĞRENİN A-Z\BusinessTrackApplication\BusinessTrack.Web\Areas\Admin\Views\_ViewImports.cshtml"
using BusinessTrack.Web.Models.Users;
#line default
#line hidden
#nullable disable
#nullable restore
#line 5 "C:\Users\CihatSolak\Desktop\DERS\PROJE GELİŞTİREREK ASP.NET CORE MVC APİ ÖĞRENİN A-Z\BusinessTrackApplication\BusinessTrack.Web\Areas\Admin\Views\_ViewImports.cshtml"
using BusinessTrack.Web.Models.Notifications;
#line default
#line hidden
#nullable disable
#nullable restore
#line 6 "C:\Users\CihatSolak\Desktop\DERS\PROJE GELİŞTİREREK ASP.NET CORE MVC APİ ÖĞRENİN A-Z\BusinessTrackApplication\BusinessTrack.Web\Areas\Admin\Views\_ViewImports.cshtml"
using BusinessTrack.Web.Areas.Admin.Models.Logs;
#line default
#line hidden
#nullable disable
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"fcf4216f2aed51c9a08e6d8268fc822902d5546d", @"/Areas/Admin/Views/Exigency/Create.cshtml")]
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"f9257de1057c22fb3c9d8523c8c01af856acddaa", @"/Areas/Admin/Views/_ViewImports.cshtml")]
public class Areas_Admin_Views_Exigency_Create : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<ExigencyViewModel>
{
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("asp-action", "Create", global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_1 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("method", "post", global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_2 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("class", new global::Microsoft.AspNetCore.Html.HtmlString("w-75 mx-auto p-3 shadow"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_3 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("src", new global::Microsoft.AspNetCore.Html.HtmlString("~/lib/js/jquery-validate/jquery.validate.min.js"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_4 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("src", new global::Microsoft.AspNetCore.Html.HtmlString("~/lib/js/jquery-validate/jquery.validate.unobtrusive.min.js"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
#line hidden
#pragma warning disable 0649
private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext __tagHelperExecutionContext;
#pragma warning restore 0649
private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner __tagHelperRunner = new global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner();
#pragma warning disable 0169
private string __tagHelperStringValueBuffer;
#pragma warning restore 0169
private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager __backed__tagHelperScopeManager = null;
private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager __tagHelperScopeManager
{
get
{
if (__backed__tagHelperScopeManager == null)
{
__backed__tagHelperScopeManager = new global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager(StartTagHelperWritingScope, EndTagHelperWritingScope);
}
return __backed__tagHelperScopeManager;
}
}
private global::Microsoft.AspNetCore.Mvc.TagHelpers.FormTagHelper __Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper;
private global::Microsoft.AspNetCore.Mvc.TagHelpers.RenderAtEndOfFormTagHelper __Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper;
private global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper;
#pragma warning disable 1998
public async override global::System.Threading.Tasks.Task ExecuteAsync()
{
#nullable restore
#line 2 "C:\Users\CihatSolak\Desktop\DERS\PROJE GELİŞTİREREK ASP.NET CORE MVC APİ ÖĞRENİN A-Z\BusinessTrackApplication\BusinessTrack.Web\Areas\Admin\Views\Exigency\Create.cshtml"
ViewData["Title"] = "Yeni Aciliyet Ekle";
#line default
#line hidden
#nullable disable
WriteLiteral("\r\n<h1>Yeni Aciliyet Ekle</h1>\r\n\r\n");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("form", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "fcf4216f2aed51c9a08e6d8268fc822902d5546d7036", async() => {
WriteLiteral("\r\n ");
#nullable restore
#line 9 "C:\Users\CihatSolak\Desktop\DERS\PROJE GELİŞTİREREK ASP.NET CORE MVC APİ ÖĞRENİN A-Z\BusinessTrackApplication\BusinessTrack.Web\Areas\Admin\Views\Exigency\Create.cshtml"
Write(await Html.PartialAsync("_CreateOrUpdate", Model));
#line default
#line hidden
#nullable disable
WriteLiteral("\r\n <button type=\"submit\" class=\"btn btn-success\">Kaydet</button>\r\n");
}
);
__Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.FormTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper);
__Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.RenderAtEndOfFormTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper);
__Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper.Action = (string)__tagHelperAttribute_0.Value;
__tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0);
__Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper.Method = (string)__tagHelperAttribute_1.Value;
__tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_1);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_2);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
WriteLiteral("\r\n\r\n");
DefineSection("Javascript", async() => {
WriteLiteral("\r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("script", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "fcf4216f2aed51c9a08e6d8268fc822902d5546d9279", async() => {
}
);
__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_3);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
WriteLiteral("\r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("script", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "fcf4216f2aed51c9a08e6d8268fc822902d5546d10378", async() => {
}
);
__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_4);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
WriteLiteral("\r\n");
}
);
}
#pragma warning restore 1998
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; }
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; }
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; }
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; }
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<ExigencyViewModel> Html { get; private set; }
}
}
#pragma warning restore 1591
| 69.367232 | 395 | 0.763154 | [
"MIT"
] | cihatsolak/BusinessTrackApp | BusinessTrackApplication/BusinessTrack.Web/obj/Debug/netcoreapp3.1/Razor/Areas/Admin/Views/Exigency/Create.cshtml.g.cs | 12,341 | C# |
using Microsoft.EntityFrameworkCore;
using Paas.Pioneer.Admin.Core.Application.Contracts.Comment.Dto.Input;
using Paas.Pioneer.Admin.Core.Application.Contracts.Comment.Dto.Output;
using Paas.Pioneer.Admin.Core.Domain.Comment;
using Paas.Pioneer.Admin.Core.EntityFrameworkCore.BaseExtensions;
using Paas.Pioneer.Admin.Core.EntityFrameworkCore.EntityFrameworkCore;
using Paas.Pioneer.Domain.Shared.Dto.Input;
using Paas.Pioneer.AutoWrapper;
using Paas.Pioneer.Domain.Shared.Extensions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Dynamic.Core;
using System.Threading.Tasks;
using Volo.Abp.EntityFrameworkCore;
namespace Paas.Pioneer.Admin.Core.EntityFrameworkCore.Comment
{
public class EfCoreCommentRepository : BaseExtensionsRepository<Information_CommentEntity>, ICommentRepository
{
public EfCoreCommentRepository(IDbContextProvider<AdminsDbContext> dbContextProvider)
: base(dbContextProvider)
{
}
}
}
| 35.607143 | 114 | 0.809428 | [
"Apache-2.0"
] | xiaolei000129/Paas.Pioneer | modules/admin-core/src/Paas.Pioneer.Admin.Core.EntityFrameworkCore/Comment/EfCoreCommentRepository.cs | 999 | 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;
namespace NuGet.Packaging.Licenses
{
public static class NuGetLicenseExpressionExtensions
{
/// <summary>
/// Determines whether all the licenses and exceptions are not deprecated.
/// </summary>
/// <param name="expression">expression to be validated</param>
/// <returns>Whether this expression consists of licenses with standard identifiers</returns>
public static bool HasOnlyStandardIdentifiers(this NuGetLicenseExpression expression)
{
switch (expression.Type)
{
case LicenseExpressionType.License:
return (expression as NuGetLicense).IsStandardLicense;
case LicenseExpressionType.Operator:
var licenseOperator = expression as LicenseOperator;
switch (licenseOperator.OperatorType)
{
case LicenseOperatorType.LogicalOperator:
var logicalOperator = (LogicalOperator)licenseOperator;
return logicalOperator.Left.HasOnlyStandardIdentifiers() && logicalOperator.Right.HasOnlyStandardIdentifiers();
case LicenseOperatorType.WithOperator:
var withOperator = (WithOperator)licenseOperator;
return withOperator.License.IsStandardLicense;
default:
return false;
}
default:
return false;
}
}
/// <summary>
/// A leaf node in an expression can only be a License or an Exception. Run a func on each one.
/// </summary>
/// <param name="expression">The expression to be walked.</param>
/// <param name="licenseProcessor">A processor for the licenses.</param>
/// <param name="exceptionProcessor">A processor for the exceptions.</param>
public static void OnEachLeafNode(this NuGetLicenseExpression expression, Action<NuGetLicense> licenseProcessor, Action<NuGetLicenseException> exceptionProcessor)
{
switch (expression.Type)
{
case LicenseExpressionType.License:
var license = (NuGetLicense)expression;
licenseProcessor?.Invoke(license);
break;
case LicenseExpressionType.Operator:
var licenseOperator = (LicenseOperator)expression;
switch (licenseOperator.OperatorType)
{
case LicenseOperatorType.LogicalOperator:
var logicalOperator = (LogicalOperator)licenseOperator;
logicalOperator.Left.OnEachLeafNode(licenseProcessor, exceptionProcessor);
logicalOperator.Right.OnEachLeafNode(licenseProcessor, exceptionProcessor);
break;
case LicenseOperatorType.WithOperator:
var withOperator = (WithOperator)licenseOperator;
licenseProcessor?.Invoke(withOperator.License);
exceptionProcessor?.Invoke(withOperator.Exception);
break;
default:
break;
}
break;
default:
break;
}
}
public static bool IsUnlicensed(this NuGetLicense license)
{
return license.Identifier.Equals(NuGetLicense.UNLICENSED);
}
public static bool IsUnlicensed(this NuGetLicenseExpression expression)
{
switch (expression.Type)
{
case LicenseExpressionType.License:
return ((NuGetLicense)expression).IsUnlicensed();
case LicenseExpressionType.Operator: // expressions with operators cannot be unlicensed.
default:
return false;
}
}
}
} | 43.21 | 170 | 0.562601 | [
"Apache-2.0"
] | BdDsl/NuGet.Client | src/NuGet.Core/NuGet.Packaging/Licenses/NuGetLicenseExpressionExtensions.cs | 4,321 | C# |
// © Anamnesis.
// Licensed under the MIT license.
namespace Anamnesis.Memory
{
using Anamnesis.PoseModule;
using Anamnesis.Services;
public class HkaPoseMemory : MemoryBase
{
[Bind(0x000, BindFlags.Pointer)] public HkaSkeletonMemory? Skeleton { get; set; }
[Bind(0x010)] public TransformArrayMemory? Transforms { get; set; }
protected override void HandlePropertyChanged(PropertyChange change)
{
// Big hack to keep bone change history names short.
if (change.Origin == PropertyChange.Origins.User && change.TopPropertyName == nameof(this.Transforms))
{
if (PoseService.SelectedBoneName == null)
{
change.Name = LocalizationService.GetStringFormatted("History_ChangeBone", "??");
}
else
{
change.Name = LocalizationService.GetStringFormatted("History_ChangeBone", PoseService.SelectedBoneName);
}
}
base.HandlePropertyChanged(change);
}
public class TransformArrayMemory : ArrayMemory<TransformMemory, int>
{
public override int CountOffset => 0x000;
public override int AddressOffset => 0x008;
public override int ElementSize => 0x030;
}
}
} | 28.923077 | 110 | 0.72695 | [
"MIT"
] | Squall-Leonhart/Anamnesis | Anamnesis/Memory/HkaPoseMemory.cs | 1,131 | C# |
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Bogus;
using QuickElastic.Core.Domain;
namespace QuickElastic.Core.DataProviders
{
public class UserDataProvider : IDataProvider<User>
{
public UserDataProvider()
{
Randomizer.Seed = new Random(14);
}
public async Task<IEnumerable<User>> GetData()
{
// This would come from a third party data source
var userFactory = new Faker<User>()
.RuleFor(u => u.FirstName, f => f.Person.FirstName)
.RuleFor(u => u.LastName, f => f.Person.LastName)
.RuleFor(u => u.Username, f => f.Person.UserName)
.RuleFor(u => u.AvatarUrl, f => f.Person.Avatar)
.RuleFor(u => u.Email, f => f.Person.Email)
.RuleFor(u => u.DateOfBirth, f => f.Person.DateOfBirth)
.RuleFor(u => u.Phone, f => f.Person.Phone)
.RuleFor(u => u.Website, f => f.Person.Website);
return await Task<IEnumerable<User>>.Factory.StartNew(() => userFactory.Generate(42));
}
}
}
| 34.757576 | 98 | 0.571055 | [
"MIT"
] | Cosmin-Parvulescu/QuickElastic | quickelastic/src/QuickElastic/QuickElastic.Core/DataProviders/UserDataProvider.cs | 1,149 | C# |
using CC.ElectronicCommerce.Common.IOCOptions;
using CC.ElectronicCommerce.Core;
using CC.ElectronicCommerce.Interface;
using CC.ElectronicCommerce.Model;
using CC.ElectronicCommerce.Service;
using Com.Ctrip.Framework.Apollo;
using Com.Ctrip.Framework.Apollo.Core;
using Com.Ctrip.Framework.Apollo.Enums;
using Com.Ctrip.Framework.Apollo.Logging;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using System;
namespace CC.ElectronicCommerce.ElasticSearchProcessor
{
public class Program
{
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureAppConfiguration((hostBuilderContext, configurationBuilder) =>
{
configurationBuilder.AddCommandLine(args);
LogManager.UseConsoleLogging(Com.Ctrip.Framework.Apollo.Logging.LogLevel.Trace);
configurationBuilder
.AddApollo(configurationBuilder.Build().GetSection("apollo"))
.AddDefault()
.AddNamespace("CCECJson", ConfigFileFormat.Json)//自定义的private NameSpace
.AddNamespace(ConfigConsts.NamespaceApplication);//Apollo中默认NameSpace的名称
})
.ConfigureLogging(loggingBuilder =>
{
loggingBuilder.AddFilter("System", Microsoft.Extensions.Logging.LogLevel.Warning);
loggingBuilder.AddFilter("Microsoft", Microsoft.Extensions.Logging.LogLevel.Warning);
loggingBuilder.AddLog4Net();
})
.ConfigureServices((hostContext, services) =>
{
IConfiguration Configuration = services.BuildServiceProvider().GetRequiredService<IConfiguration>();
services.Configure<ElasticSearchOptions>(Configuration.GetSection("ESConn"));
services.Configure<RabbitMQOptions>(Configuration.GetSection("RabbitMQOptions"));
services.Configure<RedisConnOptions>(Configuration.GetSection("RedisConn"));
services.AddSingleton<RabbitMQInvoker>();
services.AddHostedService<InitESIndexWorker>();
#region 服务注入
services.AddTransient<CacheClientDB, CacheClientDB>();
services.AddTransient<OrangeContext, OrangeContext>();
services.AddTransient<IGoodsService, GoodsService>();
services.AddTransient<ISearchService, SearchService>();
services.AddTransient<IElasticSearchService, ElasticSearchService>();
services.AddTransient<IBrandService, BrandService>();
services.AddTransient<ICategoryService, CategoryService>();
services.AddTransient<ISpecService, SpecService>();
services.AddTransient<IPageDetailService, PageDetailService>();
#endregion
#region 配置文件注入
services.Configure<MySqlConnOptions>(Configuration.GetSection("MysqlConn"));
#endregion
services.AddHostedService<WarmupESIndexWorker>();
#region Worker
services.AddHostedService<Worker>();
#endregion
});
}
}
| 45.26506 | 117 | 0.602875 | [
"Apache-2.0"
] | ccnetcore/ec | .NET5/CC.ElectronicCommerce.ElasticSearchProcessor/Program.cs | 3,799 | C# |
namespace Organizr.Web
{
using System.Web.Mvc;
using System.Web.Routing;
public static class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional });
}
}
}
| 26.157895 | 101 | 0.557344 | [
"MIT"
] | DareDev1l/Organizr | Source/Web/Organizr.Web/App_Start/RouteConfig.cs | 499 | C# |
namespace CsBot
{
class Channel
{
public int Id { get; set; }
public string Name { get; set; }
public string Key { get; set; }
}
}
| 16.7 | 40 | 0.51497 | [
"MIT"
] | trixtur/CsBot | src/CsBot/Channel.cs | 167 | C# |
// ------------------------------------------------------------------------------
// <auto-generated>
// Generated by Xsd2Code. Version 3.4.0.19522 Microsoft Reciprocal License (Ms-RL)
// <NameSpace>BankId.Merchant.Library.Xml.Schemas.Saml.AuthContext</NameSpace><Collection>Array</Collection><codeType>CSharp</codeType><EnableDataBinding>False</EnableDataBinding><EnableLazyLoading>False</EnableLazyLoading><TrackingChangesEnable>False</TrackingChangesEnable><GenTrackingClasses>False</GenTrackingClasses><HidePrivateFieldInIDE>True</HidePrivateFieldInIDE><EnableSummaryComment>True</EnableSummaryComment><VirtualProp>False</VirtualProp><IncludeSerializeMethod>True</IncludeSerializeMethod><UseBaseClass>False</UseBaseClass><GenBaseClass>False</GenBaseClass><GenerateCloneMethod>False</GenerateCloneMethod><GenerateDataContracts>False</GenerateDataContracts><CodeBaseTag>Net35</CodeBaseTag><SerializeMethodName>Serialize</SerializeMethodName><DeserializeMethodName>Deserialize</DeserializeMethodName><SaveToFileMethodName>SaveToFile</SaveToFileMethodName><LoadFromFileMethodName>LoadFromFile</LoadFromFileMethodName><GenerateXMLAttributes>True</GenerateXMLAttributes><OrderXMLAttrib>False</OrderXMLAttrib><EnableEncoding>True</EnableEncoding><AutomaticProperties>False</AutomaticProperties><GenerateShouldSerialize>True</GenerateShouldSerialize><DisableDebug>False</DisableDebug><PropNameSpecified>Default</PropNameSpecified><Encoder>UTF8</Encoder><CustomUsings></CustomUsings><ExcludeIncludedTypes>False</ExcludeIncludedTypes><EnableInitializeFields>True</EnableInitializeFields>
// </auto-generated>
// ------------------------------------------------------------------------------
#pragma warning disable 1591
namespace BankId.Merchant.Library.Xml.Schemas.Saml.AuthContext {
using System;
using System.Diagnostics;
using System.Xml.Serialization;
using System.Collections;
using System.Xml.Schema;
using System.ComponentModel;
using System.IO;
using System.Text;
using System.Xml;
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.19522")]
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:oasis:names:tc:SAML:2.0:ac")]
[System.Xml.Serialization.XmlRootAttribute("AuthenticationContextDeclaration", Namespace="urn:oasis:names:tc:SAML:2.0:ac", IsNullable=false)]
public partial class AuthnContextDeclarationBaseType {
[EditorBrowsable(EditorBrowsableState.Never)]
private IdentificationType identificationField;
[EditorBrowsable(EditorBrowsableState.Never)]
private TechnicalProtectionBaseType technicalProtectionField;
[EditorBrowsable(EditorBrowsableState.Never)]
private OperationalProtectionType operationalProtectionField;
[EditorBrowsable(EditorBrowsableState.Never)]
private AuthnMethodBaseType authnMethodField;
[EditorBrowsable(EditorBrowsableState.Never)]
private GoverningAgreementRefType[] governingAgreementsField;
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] extensionField;
[EditorBrowsable(EditorBrowsableState.Never)]
private string idField;
private static System.Xml.Serialization.XmlSerializer serializer;
public IdentificationType Identification {
get {
return this.identificationField;
}
set {
this.identificationField = value;
}
}
public TechnicalProtectionBaseType TechnicalProtection {
get {
return this.technicalProtectionField;
}
set {
this.technicalProtectionField = value;
}
}
public OperationalProtectionType OperationalProtection {
get {
return this.operationalProtectionField;
}
set {
this.operationalProtectionField = value;
}
}
public AuthnMethodBaseType AuthnMethod {
get {
return this.authnMethodField;
}
set {
this.authnMethodField = value;
}
}
[System.Xml.Serialization.XmlArrayItemAttribute("GoverningAgreementRef", IsNullable=false)]
public GoverningAgreementRefType[] GoverningAgreements {
get {
return this.governingAgreementsField;
}
set {
this.governingAgreementsField = value;
}
}
[System.Xml.Serialization.XmlElementAttribute("Extension")]
public ExtensionType[] Extension {
get {
return this.extensionField;
}
set {
this.extensionField = value;
}
}
[System.Xml.Serialization.XmlAttributeAttribute(DataType="ID")]
public string ID {
get {
return this.idField;
}
set {
this.idField = value;
}
}
private static System.Xml.Serialization.XmlSerializer Serializer {
get {
if ((serializer == null)) {
serializer = new System.Xml.Serialization.XmlSerializer(typeof(AuthnContextDeclarationBaseType));
}
return serializer;
}
}
#region Serialize/Deserialize
/// <summary>
/// Serializes current AuthnContextDeclarationBaseType object into an XML document
/// </summary>
/// <returns>string XML value</returns>
public virtual string Serialize(System.Text.Encoding encoding) {
System.IO.StreamReader streamReader = null;
System.IO.MemoryStream memoryStream = null;
try {
memoryStream = new System.IO.MemoryStream();
System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings();
xmlWriterSettings.Encoding = encoding;
System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings);
Serializer.Serialize(xmlWriter, this);
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
streamReader = new System.IO.StreamReader(memoryStream);
return streamReader.ReadToEnd();
}
finally {
if ((streamReader != null)) {
streamReader.Dispose();
}
if ((memoryStream != null)) {
memoryStream.Dispose();
}
}
}
public virtual string Serialize() {
return Serialize(System.Text.Encoding.UTF8);
}
/// <summary>
/// Deserializes workflow markup into an AuthnContextDeclarationBaseType object
/// </summary>
/// <param name="xml">string workflow markup to deserialize</param>
/// <param name="obj">Output AuthnContextDeclarationBaseType object</param>
/// <param name="exception">output Exception value if deserialize failed</param>
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
public static bool Deserialize(string xml, out AuthnContextDeclarationBaseType obj, out System.Exception exception) {
exception = null;
obj = default(AuthnContextDeclarationBaseType);
try {
obj = Deserialize(xml);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool Deserialize(string xml, out AuthnContextDeclarationBaseType obj) {
System.Exception exception = null;
return Deserialize(xml, out obj, out exception);
}
public static AuthnContextDeclarationBaseType Deserialize(string xml) {
System.IO.StringReader stringReader = null;
try {
stringReader = new System.IO.StringReader(xml);
return ((AuthnContextDeclarationBaseType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
}
finally {
if ((stringReader != null)) {
stringReader.Dispose();
}
}
}
#endregion
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.19522")]
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:oasis:names:tc:SAML:2.0:ac")]
[System.Xml.Serialization.XmlRootAttribute("Identification", Namespace="urn:oasis:names:tc:SAML:2.0:ac", IsNullable=false)]
public partial class IdentificationType {
[EditorBrowsable(EditorBrowsableState.Never)]
private PhysicalVerification physicalVerificationField;
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] writtenConsentField;
[EditorBrowsable(EditorBrowsableState.Never)]
private GoverningAgreementRefType[] governingAgreementsField;
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] extensionField;
[EditorBrowsable(EditorBrowsableState.Never)]
private nymType nymField;
[EditorBrowsable(EditorBrowsableState.Never)]
private bool nymFieldSpecified;
private static System.Xml.Serialization.XmlSerializer serializer;
public PhysicalVerification PhysicalVerification {
get {
return this.physicalVerificationField;
}
set {
this.physicalVerificationField = value;
}
}
[System.Xml.Serialization.XmlArrayItemAttribute("Extension", IsNullable=false)]
public ExtensionType[] WrittenConsent {
get {
return this.writtenConsentField;
}
set {
this.writtenConsentField = value;
}
}
[System.Xml.Serialization.XmlArrayItemAttribute("GoverningAgreementRef", IsNullable=false)]
public GoverningAgreementRefType[] GoverningAgreements {
get {
return this.governingAgreementsField;
}
set {
this.governingAgreementsField = value;
}
}
[System.Xml.Serialization.XmlElementAttribute("Extension")]
public ExtensionType[] Extension {
get {
return this.extensionField;
}
set {
this.extensionField = value;
}
}
[System.Xml.Serialization.XmlAttributeAttribute()]
public nymType nym {
get {
return this.nymField;
}
set {
this.nymField = value;
}
}
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool nymSpecified {
get {
return this.nymFieldSpecified;
}
set {
this.nymFieldSpecified = value;
}
}
private static System.Xml.Serialization.XmlSerializer Serializer {
get {
if ((serializer == null)) {
serializer = new System.Xml.Serialization.XmlSerializer(typeof(IdentificationType));
}
return serializer;
}
}
#region Serialize/Deserialize
/// <summary>
/// Serializes current IdentificationType object into an XML document
/// </summary>
/// <returns>string XML value</returns>
public virtual string Serialize(System.Text.Encoding encoding) {
System.IO.StreamReader streamReader = null;
System.IO.MemoryStream memoryStream = null;
try {
memoryStream = new System.IO.MemoryStream();
System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings();
xmlWriterSettings.Encoding = encoding;
System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings);
Serializer.Serialize(xmlWriter, this);
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
streamReader = new System.IO.StreamReader(memoryStream);
return streamReader.ReadToEnd();
}
finally {
if ((streamReader != null)) {
streamReader.Dispose();
}
if ((memoryStream != null)) {
memoryStream.Dispose();
}
}
}
public virtual string Serialize() {
return Serialize(System.Text.Encoding.UTF8);
}
/// <summary>
/// Deserializes workflow markup into an IdentificationType object
/// </summary>
/// <param name="xml">string workflow markup to deserialize</param>
/// <param name="obj">Output IdentificationType object</param>
/// <param name="exception">output Exception value if deserialize failed</param>
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
public static bool Deserialize(string xml, out IdentificationType obj, out System.Exception exception) {
exception = null;
obj = default(IdentificationType);
try {
obj = Deserialize(xml);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool Deserialize(string xml, out IdentificationType obj) {
System.Exception exception = null;
return Deserialize(xml, out obj, out exception);
}
public static IdentificationType Deserialize(string xml) {
System.IO.StringReader stringReader = null;
try {
stringReader = new System.IO.StringReader(xml);
return ((IdentificationType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
}
finally {
if ((stringReader != null)) {
stringReader.Dispose();
}
}
}
#endregion
}
/// <summary>
/// This element indicates that identification has been
/// performed in a physical
/// face-to-face meeting with the principal and not in an
/// online manner.
/// </summary>
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.19522")]
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="urn:oasis:names:tc:SAML:2.0:ac")]
[System.Xml.Serialization.XmlRootAttribute(Namespace="urn:oasis:names:tc:SAML:2.0:ac", IsNullable=false)]
public partial class PhysicalVerification {
[EditorBrowsable(EditorBrowsableState.Never)]
private PhysicalVerificationCredentialLevel credentialLevelField;
[EditorBrowsable(EditorBrowsableState.Never)]
private bool credentialLevelFieldSpecified;
private static System.Xml.Serialization.XmlSerializer serializer;
[System.Xml.Serialization.XmlAttributeAttribute()]
public PhysicalVerificationCredentialLevel credentialLevel {
get {
return this.credentialLevelField;
}
set {
this.credentialLevelField = value;
}
}
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool credentialLevelSpecified {
get {
return this.credentialLevelFieldSpecified;
}
set {
this.credentialLevelFieldSpecified = value;
}
}
private static System.Xml.Serialization.XmlSerializer Serializer {
get {
if ((serializer == null)) {
serializer = new System.Xml.Serialization.XmlSerializer(typeof(PhysicalVerification));
}
return serializer;
}
}
#region Serialize/Deserialize
/// <summary>
/// Serializes current PhysicalVerification object into an XML document
/// </summary>
/// <returns>string XML value</returns>
public virtual string Serialize(System.Text.Encoding encoding) {
System.IO.StreamReader streamReader = null;
System.IO.MemoryStream memoryStream = null;
try {
memoryStream = new System.IO.MemoryStream();
System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings();
xmlWriterSettings.Encoding = encoding;
System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings);
Serializer.Serialize(xmlWriter, this);
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
streamReader = new System.IO.StreamReader(memoryStream);
return streamReader.ReadToEnd();
}
finally {
if ((streamReader != null)) {
streamReader.Dispose();
}
if ((memoryStream != null)) {
memoryStream.Dispose();
}
}
}
public virtual string Serialize() {
return Serialize(System.Text.Encoding.UTF8);
}
/// <summary>
/// Deserializes workflow markup into an PhysicalVerification object
/// </summary>
/// <param name="xml">string workflow markup to deserialize</param>
/// <param name="obj">Output PhysicalVerification object</param>
/// <param name="exception">output Exception value if deserialize failed</param>
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
public static bool Deserialize(string xml, out PhysicalVerification obj, out System.Exception exception) {
exception = null;
obj = default(PhysicalVerification);
try {
obj = Deserialize(xml);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool Deserialize(string xml, out PhysicalVerification obj) {
System.Exception exception = null;
return Deserialize(xml, out obj, out exception);
}
public static PhysicalVerification Deserialize(string xml) {
System.IO.StringReader stringReader = null;
try {
stringReader = new System.IO.StringReader(xml);
return ((PhysicalVerification)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
}
finally {
if ((stringReader != null)) {
stringReader.Dispose();
}
}
}
#endregion
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.19522")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="urn:oasis:names:tc:SAML:2.0:ac")]
public enum PhysicalVerificationCredentialLevel {
/// <remarks/>
primary,
/// <remarks/>
secondary,
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.19522")]
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:oasis:names:tc:SAML:2.0:ac")]
[System.Xml.Serialization.XmlRootAttribute("AuthenticatorTransportProtocol", Namespace="urn:oasis:names:tc:SAML:2.0:ac", IsNullable=false)]
public partial class AuthenticatorTransportProtocolType {
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionOnlyType itemField;
[EditorBrowsable(EditorBrowsableState.Never)]
private ItemChoiceType itemElementNameField;
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] extensionField;
private static System.Xml.Serialization.XmlSerializer serializer;
[System.Xml.Serialization.XmlElementAttribute("ADSL", typeof(ExtensionOnlyType))]
[System.Xml.Serialization.XmlElementAttribute("HTTP", typeof(ExtensionOnlyType))]
[System.Xml.Serialization.XmlElementAttribute("IPSec", typeof(ExtensionOnlyType))]
[System.Xml.Serialization.XmlElementAttribute("ISDN", typeof(ExtensionOnlyType))]
[System.Xml.Serialization.XmlElementAttribute("MobileNetworkEndToEndEncryption", typeof(ExtensionOnlyType))]
[System.Xml.Serialization.XmlElementAttribute("MobileNetworkNoEncryption", typeof(ExtensionOnlyType))]
[System.Xml.Serialization.XmlElementAttribute("MobileNetworkRadioEncryption", typeof(ExtensionOnlyType))]
[System.Xml.Serialization.XmlElementAttribute("PSTN", typeof(ExtensionOnlyType))]
[System.Xml.Serialization.XmlElementAttribute("SSL", typeof(ExtensionOnlyType))]
[System.Xml.Serialization.XmlElementAttribute("WTLS", typeof(ExtensionOnlyType))]
[System.Xml.Serialization.XmlChoiceIdentifierAttribute("ItemElementName")]
public ExtensionOnlyType Item {
get {
return this.itemField;
}
set {
this.itemField = value;
}
}
[System.Xml.Serialization.XmlIgnoreAttribute()]
public ItemChoiceType ItemElementName {
get {
return this.itemElementNameField;
}
set {
this.itemElementNameField = value;
}
}
[System.Xml.Serialization.XmlElementAttribute("Extension")]
public ExtensionType[] Extension {
get {
return this.extensionField;
}
set {
this.extensionField = value;
}
}
private static System.Xml.Serialization.XmlSerializer Serializer {
get {
if ((serializer == null)) {
serializer = new System.Xml.Serialization.XmlSerializer(typeof(AuthenticatorTransportProtocolType));
}
return serializer;
}
}
#region Serialize/Deserialize
/// <summary>
/// Serializes current AuthenticatorTransportProtocolType object into an XML document
/// </summary>
/// <returns>string XML value</returns>
public virtual string Serialize(System.Text.Encoding encoding) {
System.IO.StreamReader streamReader = null;
System.IO.MemoryStream memoryStream = null;
try {
memoryStream = new System.IO.MemoryStream();
System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings();
xmlWriterSettings.Encoding = encoding;
System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings);
Serializer.Serialize(xmlWriter, this);
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
streamReader = new System.IO.StreamReader(memoryStream);
return streamReader.ReadToEnd();
}
finally {
if ((streamReader != null)) {
streamReader.Dispose();
}
if ((memoryStream != null)) {
memoryStream.Dispose();
}
}
}
public virtual string Serialize() {
return Serialize(System.Text.Encoding.UTF8);
}
/// <summary>
/// Deserializes workflow markup into an AuthenticatorTransportProtocolType object
/// </summary>
/// <param name="xml">string workflow markup to deserialize</param>
/// <param name="obj">Output AuthenticatorTransportProtocolType object</param>
/// <param name="exception">output Exception value if deserialize failed</param>
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
public static bool Deserialize(string xml, out AuthenticatorTransportProtocolType obj, out System.Exception exception) {
exception = null;
obj = default(AuthenticatorTransportProtocolType);
try {
obj = Deserialize(xml);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool Deserialize(string xml, out AuthenticatorTransportProtocolType obj) {
System.Exception exception = null;
return Deserialize(xml, out obj, out exception);
}
public static AuthenticatorTransportProtocolType Deserialize(string xml) {
System.IO.StringReader stringReader = null;
try {
stringReader = new System.IO.StringReader(xml);
return ((AuthenticatorTransportProtocolType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
}
finally {
if ((stringReader != null)) {
stringReader.Dispose();
}
}
}
#endregion
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.19522")]
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:oasis:names:tc:SAML:2.0:ac")]
[System.Xml.Serialization.XmlRootAttribute("WrittenConsent", Namespace="urn:oasis:names:tc:SAML:2.0:ac", IsNullable=false)]
public partial class ExtensionOnlyType {
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] extensionField;
private static System.Xml.Serialization.XmlSerializer serializer;
[System.Xml.Serialization.XmlElementAttribute("Extension")]
public ExtensionType[] Extension {
get {
return this.extensionField;
}
set {
this.extensionField = value;
}
}
private static System.Xml.Serialization.XmlSerializer Serializer {
get {
if ((serializer == null)) {
serializer = new System.Xml.Serialization.XmlSerializer(typeof(ExtensionOnlyType));
}
return serializer;
}
}
#region Serialize/Deserialize
/// <summary>
/// Serializes current ExtensionOnlyType object into an XML document
/// </summary>
/// <returns>string XML value</returns>
public virtual string Serialize(System.Text.Encoding encoding) {
System.IO.StreamReader streamReader = null;
System.IO.MemoryStream memoryStream = null;
try {
memoryStream = new System.IO.MemoryStream();
System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings();
xmlWriterSettings.Encoding = encoding;
System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings);
Serializer.Serialize(xmlWriter, this);
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
streamReader = new System.IO.StreamReader(memoryStream);
return streamReader.ReadToEnd();
}
finally {
if ((streamReader != null)) {
streamReader.Dispose();
}
if ((memoryStream != null)) {
memoryStream.Dispose();
}
}
}
public virtual string Serialize() {
return Serialize(System.Text.Encoding.UTF8);
}
/// <summary>
/// Deserializes workflow markup into an ExtensionOnlyType object
/// </summary>
/// <param name="xml">string workflow markup to deserialize</param>
/// <param name="obj">Output ExtensionOnlyType object</param>
/// <param name="exception">output Exception value if deserialize failed</param>
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
public static bool Deserialize(string xml, out ExtensionOnlyType obj, out System.Exception exception) {
exception = null;
obj = default(ExtensionOnlyType);
try {
obj = Deserialize(xml);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool Deserialize(string xml, out ExtensionOnlyType obj) {
System.Exception exception = null;
return Deserialize(xml, out obj, out exception);
}
public static ExtensionOnlyType Deserialize(string xml) {
System.IO.StringReader stringReader = null;
try {
stringReader = new System.IO.StringReader(xml);
return ((ExtensionOnlyType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
}
finally {
if ((stringReader != null)) {
stringReader.Dispose();
}
}
}
#endregion
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.19522")]
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:oasis:names:tc:SAML:2.0:ac")]
[System.Xml.Serialization.XmlRootAttribute("Extension", Namespace="urn:oasis:names:tc:SAML:2.0:ac", IsNullable=false)]
public partial class ExtensionType {
[EditorBrowsable(EditorBrowsableState.Never)]
private System.Xml.XmlElement[] anyField;
private static System.Xml.Serialization.XmlSerializer serializer;
[System.Xml.Serialization.XmlAnyElementAttribute()]
public System.Xml.XmlElement[] Any {
get {
return this.anyField;
}
set {
this.anyField = value;
}
}
private static System.Xml.Serialization.XmlSerializer Serializer {
get {
if ((serializer == null)) {
serializer = new System.Xml.Serialization.XmlSerializer(typeof(ExtensionType));
}
return serializer;
}
}
#region Serialize/Deserialize
/// <summary>
/// Serializes current ExtensionType object into an XML document
/// </summary>
/// <returns>string XML value</returns>
public virtual string Serialize(System.Text.Encoding encoding) {
System.IO.StreamReader streamReader = null;
System.IO.MemoryStream memoryStream = null;
try {
memoryStream = new System.IO.MemoryStream();
System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings();
xmlWriterSettings.Encoding = encoding;
System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings);
Serializer.Serialize(xmlWriter, this);
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
streamReader = new System.IO.StreamReader(memoryStream);
return streamReader.ReadToEnd();
}
finally {
if ((streamReader != null)) {
streamReader.Dispose();
}
if ((memoryStream != null)) {
memoryStream.Dispose();
}
}
}
public virtual string Serialize() {
return Serialize(System.Text.Encoding.UTF8);
}
/// <summary>
/// Deserializes workflow markup into an ExtensionType object
/// </summary>
/// <param name="xml">string workflow markup to deserialize</param>
/// <param name="obj">Output ExtensionType object</param>
/// <param name="exception">output Exception value if deserialize failed</param>
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
public static bool Deserialize(string xml, out ExtensionType obj, out System.Exception exception) {
exception = null;
obj = default(ExtensionType);
try {
obj = Deserialize(xml);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool Deserialize(string xml, out ExtensionType obj) {
System.Exception exception = null;
return Deserialize(xml, out obj, out exception);
}
public static ExtensionType Deserialize(string xml) {
System.IO.StringReader stringReader = null;
try {
stringReader = new System.IO.StringReader(xml);
return ((ExtensionType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
}
finally {
if ((stringReader != null)) {
stringReader.Dispose();
}
}
}
#endregion
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.19522")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:oasis:names:tc:SAML:2.0:ac", IncludeInSchema=false)]
public enum ItemChoiceType {
/// <remarks/>
ADSL,
/// <remarks/>
HTTP,
/// <remarks/>
IPSec,
/// <remarks/>
ISDN,
/// <remarks/>
MobileNetworkEndToEndEncryption,
/// <remarks/>
MobileNetworkNoEncryption,
/// <remarks/>
MobileNetworkRadioEncryption,
/// <remarks/>
PSTN,
/// <remarks/>
SSL,
/// <remarks/>
WTLS,
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.19522")]
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:oasis:names:tc:SAML:2.0:ac")]
[System.Xml.Serialization.XmlRootAttribute("SharedSecretChallengeResponse", Namespace="urn:oasis:names:tc:SAML:2.0:ac", IsNullable=false)]
public partial class SharedSecretChallengeResponseType {
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] extensionField;
[EditorBrowsable(EditorBrowsableState.Never)]
private string methodField;
private static System.Xml.Serialization.XmlSerializer serializer;
[System.Xml.Serialization.XmlElementAttribute("Extension")]
public ExtensionType[] Extension {
get {
return this.extensionField;
}
set {
this.extensionField = value;
}
}
[System.Xml.Serialization.XmlAttributeAttribute(DataType="anyURI")]
public string method {
get {
return this.methodField;
}
set {
this.methodField = value;
}
}
private static System.Xml.Serialization.XmlSerializer Serializer {
get {
if ((serializer == null)) {
serializer = new System.Xml.Serialization.XmlSerializer(typeof(SharedSecretChallengeResponseType));
}
return serializer;
}
}
#region Serialize/Deserialize
/// <summary>
/// Serializes current SharedSecretChallengeResponseType object into an XML document
/// </summary>
/// <returns>string XML value</returns>
public virtual string Serialize(System.Text.Encoding encoding) {
System.IO.StreamReader streamReader = null;
System.IO.MemoryStream memoryStream = null;
try {
memoryStream = new System.IO.MemoryStream();
System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings();
xmlWriterSettings.Encoding = encoding;
System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings);
Serializer.Serialize(xmlWriter, this);
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
streamReader = new System.IO.StreamReader(memoryStream);
return streamReader.ReadToEnd();
}
finally {
if ((streamReader != null)) {
streamReader.Dispose();
}
if ((memoryStream != null)) {
memoryStream.Dispose();
}
}
}
public virtual string Serialize() {
return Serialize(System.Text.Encoding.UTF8);
}
/// <summary>
/// Deserializes workflow markup into an SharedSecretChallengeResponseType object
/// </summary>
/// <param name="xml">string workflow markup to deserialize</param>
/// <param name="obj">Output SharedSecretChallengeResponseType object</param>
/// <param name="exception">output Exception value if deserialize failed</param>
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
public static bool Deserialize(string xml, out SharedSecretChallengeResponseType obj, out System.Exception exception) {
exception = null;
obj = default(SharedSecretChallengeResponseType);
try {
obj = Deserialize(xml);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool Deserialize(string xml, out SharedSecretChallengeResponseType obj) {
System.Exception exception = null;
return Deserialize(xml, out obj, out exception);
}
public static SharedSecretChallengeResponseType Deserialize(string xml) {
System.IO.StringReader stringReader = null;
try {
stringReader = new System.IO.StringReader(xml);
return ((SharedSecretChallengeResponseType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
}
finally {
if ((stringReader != null)) {
stringReader.Dispose();
}
}
}
#endregion
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.19522")]
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:oasis:names:tc:SAML:2.0:ac")]
[System.Xml.Serialization.XmlRootAttribute("DigSig", Namespace="urn:oasis:names:tc:SAML:2.0:ac", IsNullable=false)]
public partial class PublicKeyType {
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] extensionField;
[EditorBrowsable(EditorBrowsableState.Never)]
private string keyValidationField;
private static System.Xml.Serialization.XmlSerializer serializer;
[System.Xml.Serialization.XmlElementAttribute("Extension")]
public ExtensionType[] Extension {
get {
return this.extensionField;
}
set {
this.extensionField = value;
}
}
[System.Xml.Serialization.XmlAttributeAttribute()]
public string keyValidation {
get {
return this.keyValidationField;
}
set {
this.keyValidationField = value;
}
}
private static System.Xml.Serialization.XmlSerializer Serializer {
get {
if ((serializer == null)) {
serializer = new System.Xml.Serialization.XmlSerializer(typeof(PublicKeyType));
}
return serializer;
}
}
#region Serialize/Deserialize
/// <summary>
/// Serializes current PublicKeyType object into an XML document
/// </summary>
/// <returns>string XML value</returns>
public virtual string Serialize(System.Text.Encoding encoding) {
System.IO.StreamReader streamReader = null;
System.IO.MemoryStream memoryStream = null;
try {
memoryStream = new System.IO.MemoryStream();
System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings();
xmlWriterSettings.Encoding = encoding;
System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings);
Serializer.Serialize(xmlWriter, this);
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
streamReader = new System.IO.StreamReader(memoryStream);
return streamReader.ReadToEnd();
}
finally {
if ((streamReader != null)) {
streamReader.Dispose();
}
if ((memoryStream != null)) {
memoryStream.Dispose();
}
}
}
public virtual string Serialize() {
return Serialize(System.Text.Encoding.UTF8);
}
/// <summary>
/// Deserializes workflow markup into an PublicKeyType object
/// </summary>
/// <param name="xml">string workflow markup to deserialize</param>
/// <param name="obj">Output PublicKeyType object</param>
/// <param name="exception">output Exception value if deserialize failed</param>
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
public static bool Deserialize(string xml, out PublicKeyType obj, out System.Exception exception) {
exception = null;
obj = default(PublicKeyType);
try {
obj = Deserialize(xml);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool Deserialize(string xml, out PublicKeyType obj) {
System.Exception exception = null;
return Deserialize(xml, out obj, out exception);
}
public static PublicKeyType Deserialize(string xml) {
System.IO.StringReader stringReader = null;
try {
stringReader = new System.IO.StringReader(xml);
return ((PublicKeyType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
}
finally {
if ((stringReader != null)) {
stringReader.Dispose();
}
}
}
#endregion
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.19522")]
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:oasis:names:tc:SAML:2.0:ac")]
[System.Xml.Serialization.XmlRootAttribute("Authenticator", Namespace="urn:oasis:names:tc:SAML:2.0:ac", IsNullable=false)]
public partial class AuthenticatorBaseType {
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] previousSessionField;
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] resumeSessionField;
[EditorBrowsable(EditorBrowsableState.Never)]
private PublicKeyType digSigField;
[EditorBrowsable(EditorBrowsableState.Never)]
private PasswordType passwordField;
[EditorBrowsable(EditorBrowsableState.Never)]
private RestrictedPasswordType restrictedPasswordField;
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] zeroKnowledgeField;
[EditorBrowsable(EditorBrowsableState.Never)]
private SharedSecretChallengeResponseType sharedSecretChallengeResponseField;
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] sharedSecretDynamicPlaintextField;
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] iPAddressField;
[EditorBrowsable(EditorBrowsableState.Never)]
private PublicKeyType asymmetricDecryptionField;
[EditorBrowsable(EditorBrowsableState.Never)]
private PublicKeyType asymmetricKeyAgreementField;
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] subscriberLineNumberField;
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] userSuffixField;
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] previousSession1Field;
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] resumeSession1Field;
[EditorBrowsable(EditorBrowsableState.Never)]
private PublicKeyType digSig1Field;
[EditorBrowsable(EditorBrowsableState.Never)]
private PasswordType password1Field;
[EditorBrowsable(EditorBrowsableState.Never)]
private RestrictedPasswordType restrictedPassword1Field;
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] zeroKnowledge1Field;
[EditorBrowsable(EditorBrowsableState.Never)]
private SharedSecretChallengeResponseType sharedSecretChallengeResponse1Field;
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] sharedSecretDynamicPlaintext1Field;
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] iPAddress1Field;
[EditorBrowsable(EditorBrowsableState.Never)]
private PublicKeyType asymmetricDecryption1Field;
[EditorBrowsable(EditorBrowsableState.Never)]
private PublicKeyType asymmetricKeyAgreement1Field;
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] subscriberLineNumber1Field;
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] userSuffix1Field;
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] extensionField;
private static System.Xml.Serialization.XmlSerializer serializer;
[System.Xml.Serialization.XmlArrayAttribute(Order=0)]
[System.Xml.Serialization.XmlArrayItemAttribute("Extension", IsNullable=false)]
public ExtensionType[] PreviousSession {
get {
return this.previousSessionField;
}
set {
this.previousSessionField = value;
}
}
[System.Xml.Serialization.XmlArrayAttribute(Order=1)]
[System.Xml.Serialization.XmlArrayItemAttribute("Extension", IsNullable=false)]
public ExtensionType[] ResumeSession {
get {
return this.resumeSessionField;
}
set {
this.resumeSessionField = value;
}
}
[System.Xml.Serialization.XmlElementAttribute(Order=2)]
public PublicKeyType DigSig {
get {
return this.digSigField;
}
set {
this.digSigField = value;
}
}
[System.Xml.Serialization.XmlElementAttribute(Order=3)]
public PasswordType Password {
get {
return this.passwordField;
}
set {
this.passwordField = value;
}
}
[System.Xml.Serialization.XmlElementAttribute(Order=4)]
public RestrictedPasswordType RestrictedPassword {
get {
return this.restrictedPasswordField;
}
set {
this.restrictedPasswordField = value;
}
}
[System.Xml.Serialization.XmlArrayAttribute(Order=5)]
[System.Xml.Serialization.XmlArrayItemAttribute("Extension", IsNullable=false)]
public ExtensionType[] ZeroKnowledge {
get {
return this.zeroKnowledgeField;
}
set {
this.zeroKnowledgeField = value;
}
}
[System.Xml.Serialization.XmlElementAttribute(Order=6)]
public SharedSecretChallengeResponseType SharedSecretChallengeResponse {
get {
return this.sharedSecretChallengeResponseField;
}
set {
this.sharedSecretChallengeResponseField = value;
}
}
[System.Xml.Serialization.XmlArrayAttribute(Order=7)]
[System.Xml.Serialization.XmlArrayItemAttribute("Extension", IsNullable=false)]
public ExtensionType[] SharedSecretDynamicPlaintext {
get {
return this.sharedSecretDynamicPlaintextField;
}
set {
this.sharedSecretDynamicPlaintextField = value;
}
}
[System.Xml.Serialization.XmlArrayAttribute(Order=8)]
[System.Xml.Serialization.XmlArrayItemAttribute("Extension", IsNullable=false)]
public ExtensionType[] IPAddress {
get {
return this.iPAddressField;
}
set {
this.iPAddressField = value;
}
}
[System.Xml.Serialization.XmlElementAttribute(Order=9)]
public PublicKeyType AsymmetricDecryption {
get {
return this.asymmetricDecryptionField;
}
set {
this.asymmetricDecryptionField = value;
}
}
[System.Xml.Serialization.XmlElementAttribute(Order=10)]
public PublicKeyType AsymmetricKeyAgreement {
get {
return this.asymmetricKeyAgreementField;
}
set {
this.asymmetricKeyAgreementField = value;
}
}
[System.Xml.Serialization.XmlArrayAttribute(Order=11)]
[System.Xml.Serialization.XmlArrayItemAttribute("Extension", IsNullable=false)]
public ExtensionType[] SubscriberLineNumber {
get {
return this.subscriberLineNumberField;
}
set {
this.subscriberLineNumberField = value;
}
}
[System.Xml.Serialization.XmlArrayAttribute(Order=12)]
[System.Xml.Serialization.XmlArrayItemAttribute("Extension", IsNullable=false)]
public ExtensionType[] UserSuffix {
get {
return this.userSuffixField;
}
set {
this.userSuffixField = value;
}
}
[System.Xml.Serialization.XmlArrayAttribute("PreviousSession", Order=13)]
[System.Xml.Serialization.XmlArrayItemAttribute("Extension", IsNullable=false)]
public ExtensionType[] PreviousSession1 {
get {
return this.previousSession1Field;
}
set {
this.previousSession1Field = value;
}
}
[System.Xml.Serialization.XmlArrayAttribute("ResumeSession", Order=14)]
[System.Xml.Serialization.XmlArrayItemAttribute("Extension", IsNullable=false)]
public ExtensionType[] ResumeSession1 {
get {
return this.resumeSession1Field;
}
set {
this.resumeSession1Field = value;
}
}
[System.Xml.Serialization.XmlElementAttribute("DigSig", Order=15)]
public PublicKeyType DigSig1 {
get {
return this.digSig1Field;
}
set {
this.digSig1Field = value;
}
}
[System.Xml.Serialization.XmlElementAttribute("Password", Order=16)]
public PasswordType Password1 {
get {
return this.password1Field;
}
set {
this.password1Field = value;
}
}
[System.Xml.Serialization.XmlElementAttribute("RestrictedPassword", Order=17)]
public RestrictedPasswordType RestrictedPassword1 {
get {
return this.restrictedPassword1Field;
}
set {
this.restrictedPassword1Field = value;
}
}
[System.Xml.Serialization.XmlArrayAttribute("ZeroKnowledge", Order=18)]
[System.Xml.Serialization.XmlArrayItemAttribute("Extension", IsNullable=false)]
public ExtensionType[] ZeroKnowledge1 {
get {
return this.zeroKnowledge1Field;
}
set {
this.zeroKnowledge1Field = value;
}
}
[System.Xml.Serialization.XmlElementAttribute("SharedSecretChallengeResponse", Order=19)]
public SharedSecretChallengeResponseType SharedSecretChallengeResponse1 {
get {
return this.sharedSecretChallengeResponse1Field;
}
set {
this.sharedSecretChallengeResponse1Field = value;
}
}
[System.Xml.Serialization.XmlArrayAttribute("SharedSecretDynamicPlaintext", Order=20)]
[System.Xml.Serialization.XmlArrayItemAttribute("Extension", IsNullable=false)]
public ExtensionType[] SharedSecretDynamicPlaintext1 {
get {
return this.sharedSecretDynamicPlaintext1Field;
}
set {
this.sharedSecretDynamicPlaintext1Field = value;
}
}
[System.Xml.Serialization.XmlArrayAttribute("IPAddress", Order=21)]
[System.Xml.Serialization.XmlArrayItemAttribute("Extension", IsNullable=false)]
public ExtensionType[] IPAddress1 {
get {
return this.iPAddress1Field;
}
set {
this.iPAddress1Field = value;
}
}
[System.Xml.Serialization.XmlElementAttribute("AsymmetricDecryption", Order=22)]
public PublicKeyType AsymmetricDecryption1 {
get {
return this.asymmetricDecryption1Field;
}
set {
this.asymmetricDecryption1Field = value;
}
}
[System.Xml.Serialization.XmlElementAttribute("AsymmetricKeyAgreement", Order=23)]
public PublicKeyType AsymmetricKeyAgreement1 {
get {
return this.asymmetricKeyAgreement1Field;
}
set {
this.asymmetricKeyAgreement1Field = value;
}
}
[System.Xml.Serialization.XmlArrayAttribute("SubscriberLineNumber", Order=24)]
[System.Xml.Serialization.XmlArrayItemAttribute("Extension", IsNullable=false)]
public ExtensionType[] SubscriberLineNumber1 {
get {
return this.subscriberLineNumber1Field;
}
set {
this.subscriberLineNumber1Field = value;
}
}
[System.Xml.Serialization.XmlArrayAttribute("UserSuffix", Order=25)]
[System.Xml.Serialization.XmlArrayItemAttribute("Extension", IsNullable=false)]
public ExtensionType[] UserSuffix1 {
get {
return this.userSuffix1Field;
}
set {
this.userSuffix1Field = value;
}
}
[System.Xml.Serialization.XmlElementAttribute("Extension", Order=26)]
public ExtensionType[] Extension {
get {
return this.extensionField;
}
set {
this.extensionField = value;
}
}
private static System.Xml.Serialization.XmlSerializer Serializer {
get {
if ((serializer == null)) {
serializer = new System.Xml.Serialization.XmlSerializer(typeof(AuthenticatorBaseType));
}
return serializer;
}
}
#region Serialize/Deserialize
/// <summary>
/// Serializes current AuthenticatorBaseType object into an XML document
/// </summary>
/// <returns>string XML value</returns>
public virtual string Serialize(System.Text.Encoding encoding) {
System.IO.StreamReader streamReader = null;
System.IO.MemoryStream memoryStream = null;
try {
memoryStream = new System.IO.MemoryStream();
System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings();
xmlWriterSettings.Encoding = encoding;
System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings);
Serializer.Serialize(xmlWriter, this);
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
streamReader = new System.IO.StreamReader(memoryStream);
return streamReader.ReadToEnd();
}
finally {
if ((streamReader != null)) {
streamReader.Dispose();
}
if ((memoryStream != null)) {
memoryStream.Dispose();
}
}
}
public virtual string Serialize() {
return Serialize(System.Text.Encoding.UTF8);
}
/// <summary>
/// Deserializes workflow markup into an AuthenticatorBaseType object
/// </summary>
/// <param name="xml">string workflow markup to deserialize</param>
/// <param name="obj">Output AuthenticatorBaseType object</param>
/// <param name="exception">output Exception value if deserialize failed</param>
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
public static bool Deserialize(string xml, out AuthenticatorBaseType obj, out System.Exception exception) {
exception = null;
obj = default(AuthenticatorBaseType);
try {
obj = Deserialize(xml);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool Deserialize(string xml, out AuthenticatorBaseType obj) {
System.Exception exception = null;
return Deserialize(xml, out obj, out exception);
}
public static AuthenticatorBaseType Deserialize(string xml) {
System.IO.StringReader stringReader = null;
try {
stringReader = new System.IO.StringReader(xml);
return ((AuthenticatorBaseType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
}
finally {
if ((stringReader != null)) {
stringReader.Dispose();
}
}
}
#endregion
}
[System.Xml.Serialization.XmlIncludeAttribute(typeof(RestrictedPasswordType))]
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.19522")]
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:oasis:names:tc:SAML:2.0:ac")]
[System.Xml.Serialization.XmlRootAttribute("Password", Namespace="urn:oasis:names:tc:SAML:2.0:ac", IsNullable=false)]
public partial class PasswordType {
[EditorBrowsable(EditorBrowsableState.Never)]
private LengthType lengthField;
[EditorBrowsable(EditorBrowsableState.Never)]
private AlphabetType alphabetField;
[EditorBrowsable(EditorBrowsableState.Never)]
private Generation generationField;
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] extensionField;
[EditorBrowsable(EditorBrowsableState.Never)]
private string externalVerificationField;
private static System.Xml.Serialization.XmlSerializer serializer;
public LengthType Length {
get {
return this.lengthField;
}
set {
this.lengthField = value;
}
}
public AlphabetType Alphabet {
get {
return this.alphabetField;
}
set {
this.alphabetField = value;
}
}
public Generation Generation {
get {
return this.generationField;
}
set {
this.generationField = value;
}
}
[System.Xml.Serialization.XmlElementAttribute("Extension")]
public ExtensionType[] Extension {
get {
return this.extensionField;
}
set {
this.extensionField = value;
}
}
[System.Xml.Serialization.XmlAttributeAttribute(DataType="anyURI")]
public string ExternalVerification {
get {
return this.externalVerificationField;
}
set {
this.externalVerificationField = value;
}
}
private static System.Xml.Serialization.XmlSerializer Serializer {
get {
if ((serializer == null)) {
serializer = new System.Xml.Serialization.XmlSerializer(typeof(PasswordType));
}
return serializer;
}
}
#region Serialize/Deserialize
/// <summary>
/// Serializes current PasswordType object into an XML document
/// </summary>
/// <returns>string XML value</returns>
public virtual string Serialize(System.Text.Encoding encoding) {
System.IO.StreamReader streamReader = null;
System.IO.MemoryStream memoryStream = null;
try {
memoryStream = new System.IO.MemoryStream();
System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings();
xmlWriterSettings.Encoding = encoding;
System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings);
Serializer.Serialize(xmlWriter, this);
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
streamReader = new System.IO.StreamReader(memoryStream);
return streamReader.ReadToEnd();
}
finally {
if ((streamReader != null)) {
streamReader.Dispose();
}
if ((memoryStream != null)) {
memoryStream.Dispose();
}
}
}
public virtual string Serialize() {
return Serialize(System.Text.Encoding.UTF8);
}
/// <summary>
/// Deserializes workflow markup into an PasswordType object
/// </summary>
/// <param name="xml">string workflow markup to deserialize</param>
/// <param name="obj">Output PasswordType object</param>
/// <param name="exception">output Exception value if deserialize failed</param>
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
public static bool Deserialize(string xml, out PasswordType obj, out System.Exception exception) {
exception = null;
obj = default(PasswordType);
try {
obj = Deserialize(xml);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool Deserialize(string xml, out PasswordType obj) {
System.Exception exception = null;
return Deserialize(xml, out obj, out exception);
}
public static PasswordType Deserialize(string xml) {
System.IO.StringReader stringReader = null;
try {
stringReader = new System.IO.StringReader(xml);
return ((PasswordType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
}
finally {
if ((stringReader != null)) {
stringReader.Dispose();
}
}
}
#endregion
}
[System.Xml.Serialization.XmlIncludeAttribute(typeof(RestrictedLengthType))]
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.19522")]
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:oasis:names:tc:SAML:2.0:ac")]
[System.Xml.Serialization.XmlRootAttribute("Length", Namespace="urn:oasis:names:tc:SAML:2.0:ac", IsNullable=false)]
public partial class LengthType {
[EditorBrowsable(EditorBrowsableState.Never)]
private string minField;
[EditorBrowsable(EditorBrowsableState.Never)]
private string maxField;
private static System.Xml.Serialization.XmlSerializer serializer;
[System.Xml.Serialization.XmlAttributeAttribute(DataType="integer")]
public string min {
get {
return this.minField;
}
set {
this.minField = value;
}
}
[System.Xml.Serialization.XmlAttributeAttribute(DataType="integer")]
public string max {
get {
return this.maxField;
}
set {
this.maxField = value;
}
}
private static System.Xml.Serialization.XmlSerializer Serializer {
get {
if ((serializer == null)) {
serializer = new System.Xml.Serialization.XmlSerializer(typeof(LengthType));
}
return serializer;
}
}
#region Serialize/Deserialize
/// <summary>
/// Serializes current LengthType object into an XML document
/// </summary>
/// <returns>string XML value</returns>
public virtual string Serialize(System.Text.Encoding encoding) {
System.IO.StreamReader streamReader = null;
System.IO.MemoryStream memoryStream = null;
try {
memoryStream = new System.IO.MemoryStream();
System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings();
xmlWriterSettings.Encoding = encoding;
System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings);
Serializer.Serialize(xmlWriter, this);
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
streamReader = new System.IO.StreamReader(memoryStream);
return streamReader.ReadToEnd();
}
finally {
if ((streamReader != null)) {
streamReader.Dispose();
}
if ((memoryStream != null)) {
memoryStream.Dispose();
}
}
}
public virtual string Serialize() {
return Serialize(System.Text.Encoding.UTF8);
}
/// <summary>
/// Deserializes workflow markup into an LengthType object
/// </summary>
/// <param name="xml">string workflow markup to deserialize</param>
/// <param name="obj">Output LengthType object</param>
/// <param name="exception">output Exception value if deserialize failed</param>
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
public static bool Deserialize(string xml, out LengthType obj, out System.Exception exception) {
exception = null;
obj = default(LengthType);
try {
obj = Deserialize(xml);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool Deserialize(string xml, out LengthType obj) {
System.Exception exception = null;
return Deserialize(xml, out obj, out exception);
}
public static LengthType Deserialize(string xml) {
System.IO.StringReader stringReader = null;
try {
stringReader = new System.IO.StringReader(xml);
return ((LengthType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
}
finally {
if ((stringReader != null)) {
stringReader.Dispose();
}
}
}
#endregion
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.19522")]
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:oasis:names:tc:SAML:2.0:ac")]
public partial class RestrictedLengthType : LengthType {
private static System.Xml.Serialization.XmlSerializer serializer;
private static System.Xml.Serialization.XmlSerializer Serializer {
get {
if ((serializer == null)) {
serializer = new System.Xml.Serialization.XmlSerializer(typeof(RestrictedLengthType));
}
return serializer;
}
}
#region Serialize/Deserialize
/// <summary>
/// Serializes current RestrictedLengthType object into an XML document
/// </summary>
/// <returns>string XML value</returns>
public virtual string Serialize(System.Text.Encoding encoding) {
System.IO.StreamReader streamReader = null;
System.IO.MemoryStream memoryStream = null;
try {
memoryStream = new System.IO.MemoryStream();
System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings();
xmlWriterSettings.Encoding = encoding;
System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings);
Serializer.Serialize(xmlWriter, this);
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
streamReader = new System.IO.StreamReader(memoryStream);
return streamReader.ReadToEnd();
}
finally {
if ((streamReader != null)) {
streamReader.Dispose();
}
if ((memoryStream != null)) {
memoryStream.Dispose();
}
}
}
public virtual string Serialize() {
return Serialize(System.Text.Encoding.UTF8);
}
/// <summary>
/// Deserializes workflow markup into an RestrictedLengthType object
/// </summary>
/// <param name="xml">string workflow markup to deserialize</param>
/// <param name="obj">Output RestrictedLengthType object</param>
/// <param name="exception">output Exception value if deserialize failed</param>
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
public static bool Deserialize(string xml, out RestrictedLengthType obj, out System.Exception exception) {
exception = null;
obj = default(RestrictedLengthType);
try {
obj = Deserialize(xml);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool Deserialize(string xml, out RestrictedLengthType obj) {
System.Exception exception = null;
return Deserialize(xml, out obj, out exception);
}
public static RestrictedLengthType Deserialize(string xml) {
System.IO.StringReader stringReader = null;
try {
stringReader = new System.IO.StringReader(xml);
return ((RestrictedLengthType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
}
finally {
if ((stringReader != null)) {
stringReader.Dispose();
}
}
}
#endregion
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.19522")]
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:oasis:names:tc:SAML:2.0:ac")]
[System.Xml.Serialization.XmlRootAttribute("Alphabet", Namespace="urn:oasis:names:tc:SAML:2.0:ac", IsNullable=false)]
public partial class AlphabetType {
[EditorBrowsable(EditorBrowsableState.Never)]
private string requiredCharsField;
[EditorBrowsable(EditorBrowsableState.Never)]
private string excludedCharsField;
[EditorBrowsable(EditorBrowsableState.Never)]
private string caseField;
private static System.Xml.Serialization.XmlSerializer serializer;
[System.Xml.Serialization.XmlAttributeAttribute()]
public string requiredChars {
get {
return this.requiredCharsField;
}
set {
this.requiredCharsField = value;
}
}
[System.Xml.Serialization.XmlAttributeAttribute()]
public string excludedChars {
get {
return this.excludedCharsField;
}
set {
this.excludedCharsField = value;
}
}
[System.Xml.Serialization.XmlAttributeAttribute()]
public string @case {
get {
return this.caseField;
}
set {
this.caseField = value;
}
}
private static System.Xml.Serialization.XmlSerializer Serializer {
get {
if ((serializer == null)) {
serializer = new System.Xml.Serialization.XmlSerializer(typeof(AlphabetType));
}
return serializer;
}
}
#region Serialize/Deserialize
/// <summary>
/// Serializes current AlphabetType object into an XML document
/// </summary>
/// <returns>string XML value</returns>
public virtual string Serialize(System.Text.Encoding encoding) {
System.IO.StreamReader streamReader = null;
System.IO.MemoryStream memoryStream = null;
try {
memoryStream = new System.IO.MemoryStream();
System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings();
xmlWriterSettings.Encoding = encoding;
System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings);
Serializer.Serialize(xmlWriter, this);
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
streamReader = new System.IO.StreamReader(memoryStream);
return streamReader.ReadToEnd();
}
finally {
if ((streamReader != null)) {
streamReader.Dispose();
}
if ((memoryStream != null)) {
memoryStream.Dispose();
}
}
}
public virtual string Serialize() {
return Serialize(System.Text.Encoding.UTF8);
}
/// <summary>
/// Deserializes workflow markup into an AlphabetType object
/// </summary>
/// <param name="xml">string workflow markup to deserialize</param>
/// <param name="obj">Output AlphabetType object</param>
/// <param name="exception">output Exception value if deserialize failed</param>
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
public static bool Deserialize(string xml, out AlphabetType obj, out System.Exception exception) {
exception = null;
obj = default(AlphabetType);
try {
obj = Deserialize(xml);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool Deserialize(string xml, out AlphabetType obj) {
System.Exception exception = null;
return Deserialize(xml, out obj, out exception);
}
public static AlphabetType Deserialize(string xml) {
System.IO.StringReader stringReader = null;
try {
stringReader = new System.IO.StringReader(xml);
return ((AlphabetType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
}
finally {
if ((stringReader != null)) {
stringReader.Dispose();
}
}
}
#endregion
}
/// <summary>
/// Indicates whether the password was chosen by the
/// Principal or auto-supplied by the Authentication Authority.
/// principalchosen - the Principal is allowed to choose
/// the value of the password. This is true even if
/// the initial password is chosen at random by the UA or
/// the IdP and the Principal is then free to change
/// the password.
/// automatic - the password is chosen by the UA or the
/// IdP to be cryptographically strong in some sense,
/// or to satisfy certain password rules, and that the
/// Principal is not free to change it or to choose a new password.
/// </summary>
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.19522")]
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="urn:oasis:names:tc:SAML:2.0:ac")]
[System.Xml.Serialization.XmlRootAttribute(Namespace="urn:oasis:names:tc:SAML:2.0:ac", IsNullable=false)]
public partial class Generation {
[EditorBrowsable(EditorBrowsableState.Never)]
private GenerationMechanism mechanismField;
private static System.Xml.Serialization.XmlSerializer serializer;
[System.Xml.Serialization.XmlAttributeAttribute()]
public GenerationMechanism mechanism {
get {
return this.mechanismField;
}
set {
this.mechanismField = value;
}
}
private static System.Xml.Serialization.XmlSerializer Serializer {
get {
if ((serializer == null)) {
serializer = new System.Xml.Serialization.XmlSerializer(typeof(Generation));
}
return serializer;
}
}
#region Serialize/Deserialize
/// <summary>
/// Serializes current Generation object into an XML document
/// </summary>
/// <returns>string XML value</returns>
public virtual string Serialize(System.Text.Encoding encoding) {
System.IO.StreamReader streamReader = null;
System.IO.MemoryStream memoryStream = null;
try {
memoryStream = new System.IO.MemoryStream();
System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings();
xmlWriterSettings.Encoding = encoding;
System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings);
Serializer.Serialize(xmlWriter, this);
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
streamReader = new System.IO.StreamReader(memoryStream);
return streamReader.ReadToEnd();
}
finally {
if ((streamReader != null)) {
streamReader.Dispose();
}
if ((memoryStream != null)) {
memoryStream.Dispose();
}
}
}
public virtual string Serialize() {
return Serialize(System.Text.Encoding.UTF8);
}
/// <summary>
/// Deserializes workflow markup into an Generation object
/// </summary>
/// <param name="xml">string workflow markup to deserialize</param>
/// <param name="obj">Output Generation object</param>
/// <param name="exception">output Exception value if deserialize failed</param>
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
public static bool Deserialize(string xml, out Generation obj, out System.Exception exception) {
exception = null;
obj = default(Generation);
try {
obj = Deserialize(xml);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool Deserialize(string xml, out Generation obj) {
System.Exception exception = null;
return Deserialize(xml, out obj, out exception);
}
public static Generation Deserialize(string xml) {
System.IO.StringReader stringReader = null;
try {
stringReader = new System.IO.StringReader(xml);
return ((Generation)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
}
finally {
if ((stringReader != null)) {
stringReader.Dispose();
}
}
}
#endregion
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.19522")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="urn:oasis:names:tc:SAML:2.0:ac")]
public enum GenerationMechanism {
/// <remarks/>
principalchosen,
/// <remarks/>
automatic,
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.19522")]
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:oasis:names:tc:SAML:2.0:ac")]
[System.Xml.Serialization.XmlRootAttribute("RestrictedPassword", Namespace="urn:oasis:names:tc:SAML:2.0:ac", IsNullable=false)]
public partial class RestrictedPasswordType : PasswordType {
private static System.Xml.Serialization.XmlSerializer serializer;
private static System.Xml.Serialization.XmlSerializer Serializer {
get {
if ((serializer == null)) {
serializer = new System.Xml.Serialization.XmlSerializer(typeof(RestrictedPasswordType));
}
return serializer;
}
}
#region Serialize/Deserialize
/// <summary>
/// Serializes current RestrictedPasswordType object into an XML document
/// </summary>
/// <returns>string XML value</returns>
public virtual string Serialize(System.Text.Encoding encoding) {
System.IO.StreamReader streamReader = null;
System.IO.MemoryStream memoryStream = null;
try {
memoryStream = new System.IO.MemoryStream();
System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings();
xmlWriterSettings.Encoding = encoding;
System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings);
Serializer.Serialize(xmlWriter, this);
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
streamReader = new System.IO.StreamReader(memoryStream);
return streamReader.ReadToEnd();
}
finally {
if ((streamReader != null)) {
streamReader.Dispose();
}
if ((memoryStream != null)) {
memoryStream.Dispose();
}
}
}
public virtual string Serialize() {
return Serialize(System.Text.Encoding.UTF8);
}
/// <summary>
/// Deserializes workflow markup into an RestrictedPasswordType object
/// </summary>
/// <param name="xml">string workflow markup to deserialize</param>
/// <param name="obj">Output RestrictedPasswordType object</param>
/// <param name="exception">output Exception value if deserialize failed</param>
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
public static bool Deserialize(string xml, out RestrictedPasswordType obj, out System.Exception exception) {
exception = null;
obj = default(RestrictedPasswordType);
try {
obj = Deserialize(xml);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool Deserialize(string xml, out RestrictedPasswordType obj) {
System.Exception exception = null;
return Deserialize(xml, out obj, out exception);
}
public static RestrictedPasswordType Deserialize(string xml) {
System.IO.StringReader stringReader = null;
try {
stringReader = new System.IO.StringReader(xml);
return ((RestrictedPasswordType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
}
finally {
if ((stringReader != null)) {
stringReader.Dispose();
}
}
}
#endregion
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.19522")]
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:oasis:names:tc:SAML:2.0:ac")]
[System.Xml.Serialization.XmlRootAttribute("TimeSyncToken", Namespace="urn:oasis:names:tc:SAML:2.0:ac", IsNullable=false)]
public partial class TimeSyncTokenType {
[EditorBrowsable(EditorBrowsableState.Never)]
private DeviceTypeType deviceTypeField;
[EditorBrowsable(EditorBrowsableState.Never)]
private string seedLengthField;
[EditorBrowsable(EditorBrowsableState.Never)]
private booleanType deviceInHandField;
private static System.Xml.Serialization.XmlSerializer serializer;
[System.Xml.Serialization.XmlAttributeAttribute()]
public DeviceTypeType DeviceType {
get {
return this.deviceTypeField;
}
set {
this.deviceTypeField = value;
}
}
[System.Xml.Serialization.XmlAttributeAttribute(DataType="integer")]
public string SeedLength {
get {
return this.seedLengthField;
}
set {
this.seedLengthField = value;
}
}
[System.Xml.Serialization.XmlAttributeAttribute()]
public booleanType DeviceInHand {
get {
return this.deviceInHandField;
}
set {
this.deviceInHandField = value;
}
}
private static System.Xml.Serialization.XmlSerializer Serializer {
get {
if ((serializer == null)) {
serializer = new System.Xml.Serialization.XmlSerializer(typeof(TimeSyncTokenType));
}
return serializer;
}
}
#region Serialize/Deserialize
/// <summary>
/// Serializes current TimeSyncTokenType object into an XML document
/// </summary>
/// <returns>string XML value</returns>
public virtual string Serialize(System.Text.Encoding encoding) {
System.IO.StreamReader streamReader = null;
System.IO.MemoryStream memoryStream = null;
try {
memoryStream = new System.IO.MemoryStream();
System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings();
xmlWriterSettings.Encoding = encoding;
System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings);
Serializer.Serialize(xmlWriter, this);
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
streamReader = new System.IO.StreamReader(memoryStream);
return streamReader.ReadToEnd();
}
finally {
if ((streamReader != null)) {
streamReader.Dispose();
}
if ((memoryStream != null)) {
memoryStream.Dispose();
}
}
}
public virtual string Serialize() {
return Serialize(System.Text.Encoding.UTF8);
}
/// <summary>
/// Deserializes workflow markup into an TimeSyncTokenType object
/// </summary>
/// <param name="xml">string workflow markup to deserialize</param>
/// <param name="obj">Output TimeSyncTokenType object</param>
/// <param name="exception">output Exception value if deserialize failed</param>
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
public static bool Deserialize(string xml, out TimeSyncTokenType obj, out System.Exception exception) {
exception = null;
obj = default(TimeSyncTokenType);
try {
obj = Deserialize(xml);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool Deserialize(string xml, out TimeSyncTokenType obj) {
System.Exception exception = null;
return Deserialize(xml, out obj, out exception);
}
public static TimeSyncTokenType Deserialize(string xml) {
System.IO.StringReader stringReader = null;
try {
stringReader = new System.IO.StringReader(xml);
return ((TimeSyncTokenType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
}
finally {
if ((stringReader != null)) {
stringReader.Dispose();
}
}
}
#endregion
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.19522")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:oasis:names:tc:SAML:2.0:ac")]
public enum DeviceTypeType {
/// <remarks/>
hardware,
/// <remarks/>
software,
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.19522")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:oasis:names:tc:SAML:2.0:ac")]
public enum booleanType {
/// <remarks/>
@true,
/// <remarks/>
@false,
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.19522")]
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:oasis:names:tc:SAML:2.0:ac")]
[System.Xml.Serialization.XmlRootAttribute("Token", Namespace="urn:oasis:names:tc:SAML:2.0:ac", IsNullable=false)]
public partial class TokenType {
[EditorBrowsable(EditorBrowsableState.Never)]
private TimeSyncTokenType timeSyncTokenField;
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] extensionField;
private static System.Xml.Serialization.XmlSerializer serializer;
public TimeSyncTokenType TimeSyncToken {
get {
return this.timeSyncTokenField;
}
set {
this.timeSyncTokenField = value;
}
}
[System.Xml.Serialization.XmlElementAttribute("Extension")]
public ExtensionType[] Extension {
get {
return this.extensionField;
}
set {
this.extensionField = value;
}
}
private static System.Xml.Serialization.XmlSerializer Serializer {
get {
if ((serializer == null)) {
serializer = new System.Xml.Serialization.XmlSerializer(typeof(TokenType));
}
return serializer;
}
}
#region Serialize/Deserialize
/// <summary>
/// Serializes current TokenType object into an XML document
/// </summary>
/// <returns>string XML value</returns>
public virtual string Serialize(System.Text.Encoding encoding) {
System.IO.StreamReader streamReader = null;
System.IO.MemoryStream memoryStream = null;
try {
memoryStream = new System.IO.MemoryStream();
System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings();
xmlWriterSettings.Encoding = encoding;
System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings);
Serializer.Serialize(xmlWriter, this);
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
streamReader = new System.IO.StreamReader(memoryStream);
return streamReader.ReadToEnd();
}
finally {
if ((streamReader != null)) {
streamReader.Dispose();
}
if ((memoryStream != null)) {
memoryStream.Dispose();
}
}
}
public virtual string Serialize() {
return Serialize(System.Text.Encoding.UTF8);
}
/// <summary>
/// Deserializes workflow markup into an TokenType object
/// </summary>
/// <param name="xml">string workflow markup to deserialize</param>
/// <param name="obj">Output TokenType object</param>
/// <param name="exception">output Exception value if deserialize failed</param>
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
public static bool Deserialize(string xml, out TokenType obj, out System.Exception exception) {
exception = null;
obj = default(TokenType);
try {
obj = Deserialize(xml);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool Deserialize(string xml, out TokenType obj) {
System.Exception exception = null;
return Deserialize(xml, out obj, out exception);
}
public static TokenType Deserialize(string xml) {
System.IO.StringReader stringReader = null;
try {
stringReader = new System.IO.StringReader(xml);
return ((TokenType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
}
finally {
if ((stringReader != null)) {
stringReader.Dispose();
}
}
}
#endregion
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.19522")]
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:oasis:names:tc:SAML:2.0:ac")]
[System.Xml.Serialization.XmlRootAttribute("PrincipalAuthenticationMechanism", Namespace="urn:oasis:names:tc:SAML:2.0:ac", IsNullable=false)]
public partial class PrincipalAuthenticationMechanismType {
[EditorBrowsable(EditorBrowsableState.Never)]
private PasswordType passwordField;
[EditorBrowsable(EditorBrowsableState.Never)]
private RestrictedPasswordType restrictedPasswordField;
[EditorBrowsable(EditorBrowsableState.Never)]
private TokenType tokenField;
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] smartcardField;
[EditorBrowsable(EditorBrowsableState.Never)]
private ActivationPinType activationPinField;
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] extensionField;
[EditorBrowsable(EditorBrowsableState.Never)]
private string preauthField;
private static System.Xml.Serialization.XmlSerializer serializer;
public PasswordType Password {
get {
return this.passwordField;
}
set {
this.passwordField = value;
}
}
public RestrictedPasswordType RestrictedPassword {
get {
return this.restrictedPasswordField;
}
set {
this.restrictedPasswordField = value;
}
}
public TokenType Token {
get {
return this.tokenField;
}
set {
this.tokenField = value;
}
}
[System.Xml.Serialization.XmlArrayItemAttribute("Extension", IsNullable=false)]
public ExtensionType[] Smartcard {
get {
return this.smartcardField;
}
set {
this.smartcardField = value;
}
}
public ActivationPinType ActivationPin {
get {
return this.activationPinField;
}
set {
this.activationPinField = value;
}
}
[System.Xml.Serialization.XmlElementAttribute("Extension")]
public ExtensionType[] Extension {
get {
return this.extensionField;
}
set {
this.extensionField = value;
}
}
[System.Xml.Serialization.XmlAttributeAttribute(DataType="integer")]
public string preauth {
get {
return this.preauthField;
}
set {
this.preauthField = value;
}
}
private static System.Xml.Serialization.XmlSerializer Serializer {
get {
if ((serializer == null)) {
serializer = new System.Xml.Serialization.XmlSerializer(typeof(PrincipalAuthenticationMechanismType));
}
return serializer;
}
}
#region Serialize/Deserialize
/// <summary>
/// Serializes current PrincipalAuthenticationMechanismType object into an XML document
/// </summary>
/// <returns>string XML value</returns>
public virtual string Serialize(System.Text.Encoding encoding) {
System.IO.StreamReader streamReader = null;
System.IO.MemoryStream memoryStream = null;
try {
memoryStream = new System.IO.MemoryStream();
System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings();
xmlWriterSettings.Encoding = encoding;
System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings);
Serializer.Serialize(xmlWriter, this);
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
streamReader = new System.IO.StreamReader(memoryStream);
return streamReader.ReadToEnd();
}
finally {
if ((streamReader != null)) {
streamReader.Dispose();
}
if ((memoryStream != null)) {
memoryStream.Dispose();
}
}
}
public virtual string Serialize() {
return Serialize(System.Text.Encoding.UTF8);
}
/// <summary>
/// Deserializes workflow markup into an PrincipalAuthenticationMechanismType object
/// </summary>
/// <param name="xml">string workflow markup to deserialize</param>
/// <param name="obj">Output PrincipalAuthenticationMechanismType object</param>
/// <param name="exception">output Exception value if deserialize failed</param>
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
public static bool Deserialize(string xml, out PrincipalAuthenticationMechanismType obj, out System.Exception exception) {
exception = null;
obj = default(PrincipalAuthenticationMechanismType);
try {
obj = Deserialize(xml);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool Deserialize(string xml, out PrincipalAuthenticationMechanismType obj) {
System.Exception exception = null;
return Deserialize(xml, out obj, out exception);
}
public static PrincipalAuthenticationMechanismType Deserialize(string xml) {
System.IO.StringReader stringReader = null;
try {
stringReader = new System.IO.StringReader(xml);
return ((PrincipalAuthenticationMechanismType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
}
finally {
if ((stringReader != null)) {
stringReader.Dispose();
}
}
}
#endregion
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.19522")]
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:oasis:names:tc:SAML:2.0:ac")]
[System.Xml.Serialization.XmlRootAttribute("ActivationPin", Namespace="urn:oasis:names:tc:SAML:2.0:ac", IsNullable=false)]
public partial class ActivationPinType {
[EditorBrowsable(EditorBrowsableState.Never)]
private LengthType lengthField;
[EditorBrowsable(EditorBrowsableState.Never)]
private AlphabetType alphabetField;
[EditorBrowsable(EditorBrowsableState.Never)]
private Generation generationField;
[EditorBrowsable(EditorBrowsableState.Never)]
private ActivationLimitType activationLimitField;
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] extensionField;
private static System.Xml.Serialization.XmlSerializer serializer;
public LengthType Length {
get {
return this.lengthField;
}
set {
this.lengthField = value;
}
}
public AlphabetType Alphabet {
get {
return this.alphabetField;
}
set {
this.alphabetField = value;
}
}
public Generation Generation {
get {
return this.generationField;
}
set {
this.generationField = value;
}
}
public ActivationLimitType ActivationLimit {
get {
return this.activationLimitField;
}
set {
this.activationLimitField = value;
}
}
[System.Xml.Serialization.XmlElementAttribute("Extension")]
public ExtensionType[] Extension {
get {
return this.extensionField;
}
set {
this.extensionField = value;
}
}
private static System.Xml.Serialization.XmlSerializer Serializer {
get {
if ((serializer == null)) {
serializer = new System.Xml.Serialization.XmlSerializer(typeof(ActivationPinType));
}
return serializer;
}
}
#region Serialize/Deserialize
/// <summary>
/// Serializes current ActivationPinType object into an XML document
/// </summary>
/// <returns>string XML value</returns>
public virtual string Serialize(System.Text.Encoding encoding) {
System.IO.StreamReader streamReader = null;
System.IO.MemoryStream memoryStream = null;
try {
memoryStream = new System.IO.MemoryStream();
System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings();
xmlWriterSettings.Encoding = encoding;
System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings);
Serializer.Serialize(xmlWriter, this);
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
streamReader = new System.IO.StreamReader(memoryStream);
return streamReader.ReadToEnd();
}
finally {
if ((streamReader != null)) {
streamReader.Dispose();
}
if ((memoryStream != null)) {
memoryStream.Dispose();
}
}
}
public virtual string Serialize() {
return Serialize(System.Text.Encoding.UTF8);
}
/// <summary>
/// Deserializes workflow markup into an ActivationPinType object
/// </summary>
/// <param name="xml">string workflow markup to deserialize</param>
/// <param name="obj">Output ActivationPinType object</param>
/// <param name="exception">output Exception value if deserialize failed</param>
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
public static bool Deserialize(string xml, out ActivationPinType obj, out System.Exception exception) {
exception = null;
obj = default(ActivationPinType);
try {
obj = Deserialize(xml);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool Deserialize(string xml, out ActivationPinType obj) {
System.Exception exception = null;
return Deserialize(xml, out obj, out exception);
}
public static ActivationPinType Deserialize(string xml) {
System.IO.StringReader stringReader = null;
try {
stringReader = new System.IO.StringReader(xml);
return ((ActivationPinType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
}
finally {
if ((stringReader != null)) {
stringReader.Dispose();
}
}
}
#endregion
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.19522")]
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:oasis:names:tc:SAML:2.0:ac")]
[System.Xml.Serialization.XmlRootAttribute("ActivationLimit", Namespace="urn:oasis:names:tc:SAML:2.0:ac", IsNullable=false)]
public partial class ActivationLimitType {
[EditorBrowsable(EditorBrowsableState.Never)]
private object itemField;
private static System.Xml.Serialization.XmlSerializer serializer;
[System.Xml.Serialization.XmlElementAttribute("ActivationLimitDuration", typeof(ActivationLimitDurationType))]
[System.Xml.Serialization.XmlElementAttribute("ActivationLimitSession", typeof(ActivationLimitSessionType))]
[System.Xml.Serialization.XmlElementAttribute("ActivationLimitUsages", typeof(ActivationLimitUsagesType))]
public object Item {
get {
return this.itemField;
}
set {
this.itemField = value;
}
}
private static System.Xml.Serialization.XmlSerializer Serializer {
get {
if ((serializer == null)) {
serializer = new System.Xml.Serialization.XmlSerializer(typeof(ActivationLimitType));
}
return serializer;
}
}
#region Serialize/Deserialize
/// <summary>
/// Serializes current ActivationLimitType object into an XML document
/// </summary>
/// <returns>string XML value</returns>
public virtual string Serialize(System.Text.Encoding encoding) {
System.IO.StreamReader streamReader = null;
System.IO.MemoryStream memoryStream = null;
try {
memoryStream = new System.IO.MemoryStream();
System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings();
xmlWriterSettings.Encoding = encoding;
System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings);
Serializer.Serialize(xmlWriter, this);
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
streamReader = new System.IO.StreamReader(memoryStream);
return streamReader.ReadToEnd();
}
finally {
if ((streamReader != null)) {
streamReader.Dispose();
}
if ((memoryStream != null)) {
memoryStream.Dispose();
}
}
}
public virtual string Serialize() {
return Serialize(System.Text.Encoding.UTF8);
}
/// <summary>
/// Deserializes workflow markup into an ActivationLimitType object
/// </summary>
/// <param name="xml">string workflow markup to deserialize</param>
/// <param name="obj">Output ActivationLimitType object</param>
/// <param name="exception">output Exception value if deserialize failed</param>
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
public static bool Deserialize(string xml, out ActivationLimitType obj, out System.Exception exception) {
exception = null;
obj = default(ActivationLimitType);
try {
obj = Deserialize(xml);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool Deserialize(string xml, out ActivationLimitType obj) {
System.Exception exception = null;
return Deserialize(xml, out obj, out exception);
}
public static ActivationLimitType Deserialize(string xml) {
System.IO.StringReader stringReader = null;
try {
stringReader = new System.IO.StringReader(xml);
return ((ActivationLimitType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
}
finally {
if ((stringReader != null)) {
stringReader.Dispose();
}
}
}
#endregion
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.19522")]
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:oasis:names:tc:SAML:2.0:ac")]
[System.Xml.Serialization.XmlRootAttribute("ActivationLimitDuration", Namespace="urn:oasis:names:tc:SAML:2.0:ac", IsNullable=false)]
public partial class ActivationLimitDurationType {
[EditorBrowsable(EditorBrowsableState.Never)]
private string durationField;
private static System.Xml.Serialization.XmlSerializer serializer;
[System.Xml.Serialization.XmlAttributeAttribute(DataType="duration")]
public string duration {
get {
return this.durationField;
}
set {
this.durationField = value;
}
}
private static System.Xml.Serialization.XmlSerializer Serializer {
get {
if ((serializer == null)) {
serializer = new System.Xml.Serialization.XmlSerializer(typeof(ActivationLimitDurationType));
}
return serializer;
}
}
#region Serialize/Deserialize
/// <summary>
/// Serializes current ActivationLimitDurationType object into an XML document
/// </summary>
/// <returns>string XML value</returns>
public virtual string Serialize(System.Text.Encoding encoding) {
System.IO.StreamReader streamReader = null;
System.IO.MemoryStream memoryStream = null;
try {
memoryStream = new System.IO.MemoryStream();
System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings();
xmlWriterSettings.Encoding = encoding;
System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings);
Serializer.Serialize(xmlWriter, this);
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
streamReader = new System.IO.StreamReader(memoryStream);
return streamReader.ReadToEnd();
}
finally {
if ((streamReader != null)) {
streamReader.Dispose();
}
if ((memoryStream != null)) {
memoryStream.Dispose();
}
}
}
public virtual string Serialize() {
return Serialize(System.Text.Encoding.UTF8);
}
/// <summary>
/// Deserializes workflow markup into an ActivationLimitDurationType object
/// </summary>
/// <param name="xml">string workflow markup to deserialize</param>
/// <param name="obj">Output ActivationLimitDurationType object</param>
/// <param name="exception">output Exception value if deserialize failed</param>
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
public static bool Deserialize(string xml, out ActivationLimitDurationType obj, out System.Exception exception) {
exception = null;
obj = default(ActivationLimitDurationType);
try {
obj = Deserialize(xml);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool Deserialize(string xml, out ActivationLimitDurationType obj) {
System.Exception exception = null;
return Deserialize(xml, out obj, out exception);
}
public static ActivationLimitDurationType Deserialize(string xml) {
System.IO.StringReader stringReader = null;
try {
stringReader = new System.IO.StringReader(xml);
return ((ActivationLimitDurationType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
}
finally {
if ((stringReader != null)) {
stringReader.Dispose();
}
}
}
#endregion
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.19522")]
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:oasis:names:tc:SAML:2.0:ac")]
[System.Xml.Serialization.XmlRootAttribute("ActivationLimitSession", Namespace="urn:oasis:names:tc:SAML:2.0:ac", IsNullable=false)]
public partial class ActivationLimitSessionType {
private static System.Xml.Serialization.XmlSerializer serializer;
private static System.Xml.Serialization.XmlSerializer Serializer {
get {
if ((serializer == null)) {
serializer = new System.Xml.Serialization.XmlSerializer(typeof(ActivationLimitSessionType));
}
return serializer;
}
}
#region Serialize/Deserialize
/// <summary>
/// Serializes current ActivationLimitSessionType object into an XML document
/// </summary>
/// <returns>string XML value</returns>
public virtual string Serialize(System.Text.Encoding encoding) {
System.IO.StreamReader streamReader = null;
System.IO.MemoryStream memoryStream = null;
try {
memoryStream = new System.IO.MemoryStream();
System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings();
xmlWriterSettings.Encoding = encoding;
System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings);
Serializer.Serialize(xmlWriter, this);
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
streamReader = new System.IO.StreamReader(memoryStream);
return streamReader.ReadToEnd();
}
finally {
if ((streamReader != null)) {
streamReader.Dispose();
}
if ((memoryStream != null)) {
memoryStream.Dispose();
}
}
}
public virtual string Serialize() {
return Serialize(System.Text.Encoding.UTF8);
}
/// <summary>
/// Deserializes workflow markup into an ActivationLimitSessionType object
/// </summary>
/// <param name="xml">string workflow markup to deserialize</param>
/// <param name="obj">Output ActivationLimitSessionType object</param>
/// <param name="exception">output Exception value if deserialize failed</param>
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
public static bool Deserialize(string xml, out ActivationLimitSessionType obj, out System.Exception exception) {
exception = null;
obj = default(ActivationLimitSessionType);
try {
obj = Deserialize(xml);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool Deserialize(string xml, out ActivationLimitSessionType obj) {
System.Exception exception = null;
return Deserialize(xml, out obj, out exception);
}
public static ActivationLimitSessionType Deserialize(string xml) {
System.IO.StringReader stringReader = null;
try {
stringReader = new System.IO.StringReader(xml);
return ((ActivationLimitSessionType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
}
finally {
if ((stringReader != null)) {
stringReader.Dispose();
}
}
}
#endregion
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.19522")]
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:oasis:names:tc:SAML:2.0:ac")]
[System.Xml.Serialization.XmlRootAttribute("ActivationLimitUsages", Namespace="urn:oasis:names:tc:SAML:2.0:ac", IsNullable=false)]
public partial class ActivationLimitUsagesType {
[EditorBrowsable(EditorBrowsableState.Never)]
private string numberField;
private static System.Xml.Serialization.XmlSerializer serializer;
[System.Xml.Serialization.XmlAttributeAttribute(DataType="integer")]
public string number {
get {
return this.numberField;
}
set {
this.numberField = value;
}
}
private static System.Xml.Serialization.XmlSerializer Serializer {
get {
if ((serializer == null)) {
serializer = new System.Xml.Serialization.XmlSerializer(typeof(ActivationLimitUsagesType));
}
return serializer;
}
}
#region Serialize/Deserialize
/// <summary>
/// Serializes current ActivationLimitUsagesType object into an XML document
/// </summary>
/// <returns>string XML value</returns>
public virtual string Serialize(System.Text.Encoding encoding) {
System.IO.StreamReader streamReader = null;
System.IO.MemoryStream memoryStream = null;
try {
memoryStream = new System.IO.MemoryStream();
System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings();
xmlWriterSettings.Encoding = encoding;
System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings);
Serializer.Serialize(xmlWriter, this);
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
streamReader = new System.IO.StreamReader(memoryStream);
return streamReader.ReadToEnd();
}
finally {
if ((streamReader != null)) {
streamReader.Dispose();
}
if ((memoryStream != null)) {
memoryStream.Dispose();
}
}
}
public virtual string Serialize() {
return Serialize(System.Text.Encoding.UTF8);
}
/// <summary>
/// Deserializes workflow markup into an ActivationLimitUsagesType object
/// </summary>
/// <param name="xml">string workflow markup to deserialize</param>
/// <param name="obj">Output ActivationLimitUsagesType object</param>
/// <param name="exception">output Exception value if deserialize failed</param>
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
public static bool Deserialize(string xml, out ActivationLimitUsagesType obj, out System.Exception exception) {
exception = null;
obj = default(ActivationLimitUsagesType);
try {
obj = Deserialize(xml);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool Deserialize(string xml, out ActivationLimitUsagesType obj) {
System.Exception exception = null;
return Deserialize(xml, out obj, out exception);
}
public static ActivationLimitUsagesType Deserialize(string xml) {
System.IO.StringReader stringReader = null;
try {
stringReader = new System.IO.StringReader(xml);
return ((ActivationLimitUsagesType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
}
finally {
if ((stringReader != null)) {
stringReader.Dispose();
}
}
}
#endregion
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.19522")]
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:oasis:names:tc:SAML:2.0:ac")]
[System.Xml.Serialization.XmlRootAttribute("AuthnMethod", Namespace="urn:oasis:names:tc:SAML:2.0:ac", IsNullable=false)]
public partial class AuthnMethodBaseType {
[EditorBrowsable(EditorBrowsableState.Never)]
private PrincipalAuthenticationMechanismType principalAuthenticationMechanismField;
[EditorBrowsable(EditorBrowsableState.Never)]
private AuthenticatorBaseType authenticatorField;
[EditorBrowsable(EditorBrowsableState.Never)]
private AuthenticatorTransportProtocolType authenticatorTransportProtocolField;
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] extensionField;
private static System.Xml.Serialization.XmlSerializer serializer;
public PrincipalAuthenticationMechanismType PrincipalAuthenticationMechanism {
get {
return this.principalAuthenticationMechanismField;
}
set {
this.principalAuthenticationMechanismField = value;
}
}
public AuthenticatorBaseType Authenticator {
get {
return this.authenticatorField;
}
set {
this.authenticatorField = value;
}
}
public AuthenticatorTransportProtocolType AuthenticatorTransportProtocol {
get {
return this.authenticatorTransportProtocolField;
}
set {
this.authenticatorTransportProtocolField = value;
}
}
[System.Xml.Serialization.XmlElementAttribute("Extension")]
public ExtensionType[] Extension {
get {
return this.extensionField;
}
set {
this.extensionField = value;
}
}
private static System.Xml.Serialization.XmlSerializer Serializer {
get {
if ((serializer == null)) {
serializer = new System.Xml.Serialization.XmlSerializer(typeof(AuthnMethodBaseType));
}
return serializer;
}
}
#region Serialize/Deserialize
/// <summary>
/// Serializes current AuthnMethodBaseType object into an XML document
/// </summary>
/// <returns>string XML value</returns>
public virtual string Serialize(System.Text.Encoding encoding) {
System.IO.StreamReader streamReader = null;
System.IO.MemoryStream memoryStream = null;
try {
memoryStream = new System.IO.MemoryStream();
System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings();
xmlWriterSettings.Encoding = encoding;
System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings);
Serializer.Serialize(xmlWriter, this);
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
streamReader = new System.IO.StreamReader(memoryStream);
return streamReader.ReadToEnd();
}
finally {
if ((streamReader != null)) {
streamReader.Dispose();
}
if ((memoryStream != null)) {
memoryStream.Dispose();
}
}
}
public virtual string Serialize() {
return Serialize(System.Text.Encoding.UTF8);
}
/// <summary>
/// Deserializes workflow markup into an AuthnMethodBaseType object
/// </summary>
/// <param name="xml">string workflow markup to deserialize</param>
/// <param name="obj">Output AuthnMethodBaseType object</param>
/// <param name="exception">output Exception value if deserialize failed</param>
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
public static bool Deserialize(string xml, out AuthnMethodBaseType obj, out System.Exception exception) {
exception = null;
obj = default(AuthnMethodBaseType);
try {
obj = Deserialize(xml);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool Deserialize(string xml, out AuthnMethodBaseType obj) {
System.Exception exception = null;
return Deserialize(xml, out obj, out exception);
}
public static AuthnMethodBaseType Deserialize(string xml) {
System.IO.StringReader stringReader = null;
try {
stringReader = new System.IO.StringReader(xml);
return ((AuthnMethodBaseType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
}
finally {
if ((stringReader != null)) {
stringReader.Dispose();
}
}
}
#endregion
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.19522")]
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:oasis:names:tc:SAML:2.0:ac")]
[System.Xml.Serialization.XmlRootAttribute("SecurityAudit", Namespace="urn:oasis:names:tc:SAML:2.0:ac", IsNullable=false)]
public partial class SecurityAuditType {
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] switchAuditField;
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] extensionField;
private static System.Xml.Serialization.XmlSerializer serializer;
[System.Xml.Serialization.XmlArrayItemAttribute("Extension", IsNullable=false)]
public ExtensionType[] SwitchAudit {
get {
return this.switchAuditField;
}
set {
this.switchAuditField = value;
}
}
[System.Xml.Serialization.XmlElementAttribute("Extension")]
public ExtensionType[] Extension {
get {
return this.extensionField;
}
set {
this.extensionField = value;
}
}
private static System.Xml.Serialization.XmlSerializer Serializer {
get {
if ((serializer == null)) {
serializer = new System.Xml.Serialization.XmlSerializer(typeof(SecurityAuditType));
}
return serializer;
}
}
#region Serialize/Deserialize
/// <summary>
/// Serializes current SecurityAuditType object into an XML document
/// </summary>
/// <returns>string XML value</returns>
public virtual string Serialize(System.Text.Encoding encoding) {
System.IO.StreamReader streamReader = null;
System.IO.MemoryStream memoryStream = null;
try {
memoryStream = new System.IO.MemoryStream();
System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings();
xmlWriterSettings.Encoding = encoding;
System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings);
Serializer.Serialize(xmlWriter, this);
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
streamReader = new System.IO.StreamReader(memoryStream);
return streamReader.ReadToEnd();
}
finally {
if ((streamReader != null)) {
streamReader.Dispose();
}
if ((memoryStream != null)) {
memoryStream.Dispose();
}
}
}
public virtual string Serialize() {
return Serialize(System.Text.Encoding.UTF8);
}
/// <summary>
/// Deserializes workflow markup into an SecurityAuditType object
/// </summary>
/// <param name="xml">string workflow markup to deserialize</param>
/// <param name="obj">Output SecurityAuditType object</param>
/// <param name="exception">output Exception value if deserialize failed</param>
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
public static bool Deserialize(string xml, out SecurityAuditType obj, out System.Exception exception) {
exception = null;
obj = default(SecurityAuditType);
try {
obj = Deserialize(xml);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool Deserialize(string xml, out SecurityAuditType obj) {
System.Exception exception = null;
return Deserialize(xml, out obj, out exception);
}
public static SecurityAuditType Deserialize(string xml) {
System.IO.StringReader stringReader = null;
try {
stringReader = new System.IO.StringReader(xml);
return ((SecurityAuditType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
}
finally {
if ((stringReader != null)) {
stringReader.Dispose();
}
}
}
#endregion
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.19522")]
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:oasis:names:tc:SAML:2.0:ac")]
[System.Xml.Serialization.XmlRootAttribute("OperationalProtection", Namespace="urn:oasis:names:tc:SAML:2.0:ac", IsNullable=false)]
public partial class OperationalProtectionType {
[EditorBrowsable(EditorBrowsableState.Never)]
private SecurityAuditType securityAuditField;
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] deactivationCallCenterField;
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] extensionField;
private static System.Xml.Serialization.XmlSerializer serializer;
public SecurityAuditType SecurityAudit {
get {
return this.securityAuditField;
}
set {
this.securityAuditField = value;
}
}
[System.Xml.Serialization.XmlArrayItemAttribute("Extension", IsNullable=false)]
public ExtensionType[] DeactivationCallCenter {
get {
return this.deactivationCallCenterField;
}
set {
this.deactivationCallCenterField = value;
}
}
[System.Xml.Serialization.XmlElementAttribute("Extension")]
public ExtensionType[] Extension {
get {
return this.extensionField;
}
set {
this.extensionField = value;
}
}
private static System.Xml.Serialization.XmlSerializer Serializer {
get {
if ((serializer == null)) {
serializer = new System.Xml.Serialization.XmlSerializer(typeof(OperationalProtectionType));
}
return serializer;
}
}
#region Serialize/Deserialize
/// <summary>
/// Serializes current OperationalProtectionType object into an XML document
/// </summary>
/// <returns>string XML value</returns>
public virtual string Serialize(System.Text.Encoding encoding) {
System.IO.StreamReader streamReader = null;
System.IO.MemoryStream memoryStream = null;
try {
memoryStream = new System.IO.MemoryStream();
System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings();
xmlWriterSettings.Encoding = encoding;
System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings);
Serializer.Serialize(xmlWriter, this);
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
streamReader = new System.IO.StreamReader(memoryStream);
return streamReader.ReadToEnd();
}
finally {
if ((streamReader != null)) {
streamReader.Dispose();
}
if ((memoryStream != null)) {
memoryStream.Dispose();
}
}
}
public virtual string Serialize() {
return Serialize(System.Text.Encoding.UTF8);
}
/// <summary>
/// Deserializes workflow markup into an OperationalProtectionType object
/// </summary>
/// <param name="xml">string workflow markup to deserialize</param>
/// <param name="obj">Output OperationalProtectionType object</param>
/// <param name="exception">output Exception value if deserialize failed</param>
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
public static bool Deserialize(string xml, out OperationalProtectionType obj, out System.Exception exception) {
exception = null;
obj = default(OperationalProtectionType);
try {
obj = Deserialize(xml);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool Deserialize(string xml, out OperationalProtectionType obj) {
System.Exception exception = null;
return Deserialize(xml, out obj, out exception);
}
public static OperationalProtectionType Deserialize(string xml) {
System.IO.StringReader stringReader = null;
try {
stringReader = new System.IO.StringReader(xml);
return ((OperationalProtectionType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
}
finally {
if ((stringReader != null)) {
stringReader.Dispose();
}
}
}
#endregion
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.19522")]
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:oasis:names:tc:SAML:2.0:ac")]
[System.Xml.Serialization.XmlRootAttribute("SecretKeyProtection", Namespace="urn:oasis:names:tc:SAML:2.0:ac", IsNullable=false)]
public partial class SecretKeyProtectionType {
[EditorBrowsable(EditorBrowsableState.Never)]
private KeyActivationType keyActivationField;
[EditorBrowsable(EditorBrowsableState.Never)]
private KeyStorageType keyStorageField;
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] extensionField;
private static System.Xml.Serialization.XmlSerializer serializer;
public KeyActivationType KeyActivation {
get {
return this.keyActivationField;
}
set {
this.keyActivationField = value;
}
}
public KeyStorageType KeyStorage {
get {
return this.keyStorageField;
}
set {
this.keyStorageField = value;
}
}
[System.Xml.Serialization.XmlElementAttribute("Extension")]
public ExtensionType[] Extension {
get {
return this.extensionField;
}
set {
this.extensionField = value;
}
}
private static System.Xml.Serialization.XmlSerializer Serializer {
get {
if ((serializer == null)) {
serializer = new System.Xml.Serialization.XmlSerializer(typeof(SecretKeyProtectionType));
}
return serializer;
}
}
#region Serialize/Deserialize
/// <summary>
/// Serializes current SecretKeyProtectionType object into an XML document
/// </summary>
/// <returns>string XML value</returns>
public virtual string Serialize(System.Text.Encoding encoding) {
System.IO.StreamReader streamReader = null;
System.IO.MemoryStream memoryStream = null;
try {
memoryStream = new System.IO.MemoryStream();
System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings();
xmlWriterSettings.Encoding = encoding;
System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings);
Serializer.Serialize(xmlWriter, this);
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
streamReader = new System.IO.StreamReader(memoryStream);
return streamReader.ReadToEnd();
}
finally {
if ((streamReader != null)) {
streamReader.Dispose();
}
if ((memoryStream != null)) {
memoryStream.Dispose();
}
}
}
public virtual string Serialize() {
return Serialize(System.Text.Encoding.UTF8);
}
/// <summary>
/// Deserializes workflow markup into an SecretKeyProtectionType object
/// </summary>
/// <param name="xml">string workflow markup to deserialize</param>
/// <param name="obj">Output SecretKeyProtectionType object</param>
/// <param name="exception">output Exception value if deserialize failed</param>
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
public static bool Deserialize(string xml, out SecretKeyProtectionType obj, out System.Exception exception) {
exception = null;
obj = default(SecretKeyProtectionType);
try {
obj = Deserialize(xml);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool Deserialize(string xml, out SecretKeyProtectionType obj) {
System.Exception exception = null;
return Deserialize(xml, out obj, out exception);
}
public static SecretKeyProtectionType Deserialize(string xml) {
System.IO.StringReader stringReader = null;
try {
stringReader = new System.IO.StringReader(xml);
return ((SecretKeyProtectionType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
}
finally {
if ((stringReader != null)) {
stringReader.Dispose();
}
}
}
#endregion
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.19522")]
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:oasis:names:tc:SAML:2.0:ac")]
[System.Xml.Serialization.XmlRootAttribute("KeyActivation", Namespace="urn:oasis:names:tc:SAML:2.0:ac", IsNullable=false)]
public partial class KeyActivationType {
[EditorBrowsable(EditorBrowsableState.Never)]
private ActivationPinType activationPinField;
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] extensionField;
private static System.Xml.Serialization.XmlSerializer serializer;
public ActivationPinType ActivationPin {
get {
return this.activationPinField;
}
set {
this.activationPinField = value;
}
}
[System.Xml.Serialization.XmlElementAttribute("Extension")]
public ExtensionType[] Extension {
get {
return this.extensionField;
}
set {
this.extensionField = value;
}
}
private static System.Xml.Serialization.XmlSerializer Serializer {
get {
if ((serializer == null)) {
serializer = new System.Xml.Serialization.XmlSerializer(typeof(KeyActivationType));
}
return serializer;
}
}
#region Serialize/Deserialize
/// <summary>
/// Serializes current KeyActivationType object into an XML document
/// </summary>
/// <returns>string XML value</returns>
public virtual string Serialize(System.Text.Encoding encoding) {
System.IO.StreamReader streamReader = null;
System.IO.MemoryStream memoryStream = null;
try {
memoryStream = new System.IO.MemoryStream();
System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings();
xmlWriterSettings.Encoding = encoding;
System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings);
Serializer.Serialize(xmlWriter, this);
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
streamReader = new System.IO.StreamReader(memoryStream);
return streamReader.ReadToEnd();
}
finally {
if ((streamReader != null)) {
streamReader.Dispose();
}
if ((memoryStream != null)) {
memoryStream.Dispose();
}
}
}
public virtual string Serialize() {
return Serialize(System.Text.Encoding.UTF8);
}
/// <summary>
/// Deserializes workflow markup into an KeyActivationType object
/// </summary>
/// <param name="xml">string workflow markup to deserialize</param>
/// <param name="obj">Output KeyActivationType object</param>
/// <param name="exception">output Exception value if deserialize failed</param>
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
public static bool Deserialize(string xml, out KeyActivationType obj, out System.Exception exception) {
exception = null;
obj = default(KeyActivationType);
try {
obj = Deserialize(xml);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool Deserialize(string xml, out KeyActivationType obj) {
System.Exception exception = null;
return Deserialize(xml, out obj, out exception);
}
public static KeyActivationType Deserialize(string xml) {
System.IO.StringReader stringReader = null;
try {
stringReader = new System.IO.StringReader(xml);
return ((KeyActivationType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
}
finally {
if ((stringReader != null)) {
stringReader.Dispose();
}
}
}
#endregion
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.19522")]
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:oasis:names:tc:SAML:2.0:ac")]
[System.Xml.Serialization.XmlRootAttribute("KeyStorage", Namespace="urn:oasis:names:tc:SAML:2.0:ac", IsNullable=false)]
public partial class KeyStorageType {
[EditorBrowsable(EditorBrowsableState.Never)]
private mediumType mediumField;
private static System.Xml.Serialization.XmlSerializer serializer;
[System.Xml.Serialization.XmlAttributeAttribute()]
public mediumType medium {
get {
return this.mediumField;
}
set {
this.mediumField = value;
}
}
private static System.Xml.Serialization.XmlSerializer Serializer {
get {
if ((serializer == null)) {
serializer = new System.Xml.Serialization.XmlSerializer(typeof(KeyStorageType));
}
return serializer;
}
}
#region Serialize/Deserialize
/// <summary>
/// Serializes current KeyStorageType object into an XML document
/// </summary>
/// <returns>string XML value</returns>
public virtual string Serialize(System.Text.Encoding encoding) {
System.IO.StreamReader streamReader = null;
System.IO.MemoryStream memoryStream = null;
try {
memoryStream = new System.IO.MemoryStream();
System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings();
xmlWriterSettings.Encoding = encoding;
System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings);
Serializer.Serialize(xmlWriter, this);
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
streamReader = new System.IO.StreamReader(memoryStream);
return streamReader.ReadToEnd();
}
finally {
if ((streamReader != null)) {
streamReader.Dispose();
}
if ((memoryStream != null)) {
memoryStream.Dispose();
}
}
}
public virtual string Serialize() {
return Serialize(System.Text.Encoding.UTF8);
}
/// <summary>
/// Deserializes workflow markup into an KeyStorageType object
/// </summary>
/// <param name="xml">string workflow markup to deserialize</param>
/// <param name="obj">Output KeyStorageType object</param>
/// <param name="exception">output Exception value if deserialize failed</param>
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
public static bool Deserialize(string xml, out KeyStorageType obj, out System.Exception exception) {
exception = null;
obj = default(KeyStorageType);
try {
obj = Deserialize(xml);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool Deserialize(string xml, out KeyStorageType obj) {
System.Exception exception = null;
return Deserialize(xml, out obj, out exception);
}
public static KeyStorageType Deserialize(string xml) {
System.IO.StringReader stringReader = null;
try {
stringReader = new System.IO.StringReader(xml);
return ((KeyStorageType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
}
finally {
if ((stringReader != null)) {
stringReader.Dispose();
}
}
}
#endregion
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.19522")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:oasis:names:tc:SAML:2.0:ac")]
public enum mediumType {
/// <remarks/>
memory,
/// <remarks/>
smartcard,
/// <remarks/>
token,
/// <remarks/>
MobileDevice,
/// <remarks/>
MobileAuthCard,
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.19522")]
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:oasis:names:tc:SAML:2.0:ac")]
[System.Xml.Serialization.XmlRootAttribute("KeySharing", Namespace="urn:oasis:names:tc:SAML:2.0:ac", IsNullable=false)]
public partial class KeySharingType {
[EditorBrowsable(EditorBrowsableState.Never)]
private bool sharingField;
private static System.Xml.Serialization.XmlSerializer serializer;
[System.Xml.Serialization.XmlAttributeAttribute()]
public bool sharing {
get {
return this.sharingField;
}
set {
this.sharingField = value;
}
}
private static System.Xml.Serialization.XmlSerializer Serializer {
get {
if ((serializer == null)) {
serializer = new System.Xml.Serialization.XmlSerializer(typeof(KeySharingType));
}
return serializer;
}
}
#region Serialize/Deserialize
/// <summary>
/// Serializes current KeySharingType object into an XML document
/// </summary>
/// <returns>string XML value</returns>
public virtual string Serialize(System.Text.Encoding encoding) {
System.IO.StreamReader streamReader = null;
System.IO.MemoryStream memoryStream = null;
try {
memoryStream = new System.IO.MemoryStream();
System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings();
xmlWriterSettings.Encoding = encoding;
System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings);
Serializer.Serialize(xmlWriter, this);
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
streamReader = new System.IO.StreamReader(memoryStream);
return streamReader.ReadToEnd();
}
finally {
if ((streamReader != null)) {
streamReader.Dispose();
}
if ((memoryStream != null)) {
memoryStream.Dispose();
}
}
}
public virtual string Serialize() {
return Serialize(System.Text.Encoding.UTF8);
}
/// <summary>
/// Deserializes workflow markup into an KeySharingType object
/// </summary>
/// <param name="xml">string workflow markup to deserialize</param>
/// <param name="obj">Output KeySharingType object</param>
/// <param name="exception">output Exception value if deserialize failed</param>
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
public static bool Deserialize(string xml, out KeySharingType obj, out System.Exception exception) {
exception = null;
obj = default(KeySharingType);
try {
obj = Deserialize(xml);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool Deserialize(string xml, out KeySharingType obj) {
System.Exception exception = null;
return Deserialize(xml, out obj, out exception);
}
public static KeySharingType Deserialize(string xml) {
System.IO.StringReader stringReader = null;
try {
stringReader = new System.IO.StringReader(xml);
return ((KeySharingType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
}
finally {
if ((stringReader != null)) {
stringReader.Dispose();
}
}
}
#endregion
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.19522")]
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:oasis:names:tc:SAML:2.0:ac")]
[System.Xml.Serialization.XmlRootAttribute("PrivateKeyProtection", Namespace="urn:oasis:names:tc:SAML:2.0:ac", IsNullable=false)]
public partial class PrivateKeyProtectionType {
[EditorBrowsable(EditorBrowsableState.Never)]
private KeyActivationType keyActivationField;
[EditorBrowsable(EditorBrowsableState.Never)]
private KeyStorageType keyStorageField;
[EditorBrowsable(EditorBrowsableState.Never)]
private KeySharingType keySharingField;
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] extensionField;
private static System.Xml.Serialization.XmlSerializer serializer;
public KeyActivationType KeyActivation {
get {
return this.keyActivationField;
}
set {
this.keyActivationField = value;
}
}
public KeyStorageType KeyStorage {
get {
return this.keyStorageField;
}
set {
this.keyStorageField = value;
}
}
public KeySharingType KeySharing {
get {
return this.keySharingField;
}
set {
this.keySharingField = value;
}
}
[System.Xml.Serialization.XmlElementAttribute("Extension")]
public ExtensionType[] Extension {
get {
return this.extensionField;
}
set {
this.extensionField = value;
}
}
private static System.Xml.Serialization.XmlSerializer Serializer {
get {
if ((serializer == null)) {
serializer = new System.Xml.Serialization.XmlSerializer(typeof(PrivateKeyProtectionType));
}
return serializer;
}
}
#region Serialize/Deserialize
/// <summary>
/// Serializes current PrivateKeyProtectionType object into an XML document
/// </summary>
/// <returns>string XML value</returns>
public virtual string Serialize(System.Text.Encoding encoding) {
System.IO.StreamReader streamReader = null;
System.IO.MemoryStream memoryStream = null;
try {
memoryStream = new System.IO.MemoryStream();
System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings();
xmlWriterSettings.Encoding = encoding;
System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings);
Serializer.Serialize(xmlWriter, this);
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
streamReader = new System.IO.StreamReader(memoryStream);
return streamReader.ReadToEnd();
}
finally {
if ((streamReader != null)) {
streamReader.Dispose();
}
if ((memoryStream != null)) {
memoryStream.Dispose();
}
}
}
public virtual string Serialize() {
return Serialize(System.Text.Encoding.UTF8);
}
/// <summary>
/// Deserializes workflow markup into an PrivateKeyProtectionType object
/// </summary>
/// <param name="xml">string workflow markup to deserialize</param>
/// <param name="obj">Output PrivateKeyProtectionType object</param>
/// <param name="exception">output Exception value if deserialize failed</param>
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
public static bool Deserialize(string xml, out PrivateKeyProtectionType obj, out System.Exception exception) {
exception = null;
obj = default(PrivateKeyProtectionType);
try {
obj = Deserialize(xml);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool Deserialize(string xml, out PrivateKeyProtectionType obj) {
System.Exception exception = null;
return Deserialize(xml, out obj, out exception);
}
public static PrivateKeyProtectionType Deserialize(string xml) {
System.IO.StringReader stringReader = null;
try {
stringReader = new System.IO.StringReader(xml);
return ((PrivateKeyProtectionType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
}
finally {
if ((stringReader != null)) {
stringReader.Dispose();
}
}
}
#endregion
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.19522")]
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:oasis:names:tc:SAML:2.0:ac")]
[System.Xml.Serialization.XmlRootAttribute("TechnicalProtection", Namespace="urn:oasis:names:tc:SAML:2.0:ac", IsNullable=false)]
public partial class TechnicalProtectionBaseType {
[EditorBrowsable(EditorBrowsableState.Never)]
private object itemField;
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] extensionField;
private static System.Xml.Serialization.XmlSerializer serializer;
[System.Xml.Serialization.XmlElementAttribute("PrivateKeyProtection", typeof(PrivateKeyProtectionType))]
[System.Xml.Serialization.XmlElementAttribute("SecretKeyProtection", typeof(SecretKeyProtectionType))]
public object Item {
get {
return this.itemField;
}
set {
this.itemField = value;
}
}
[System.Xml.Serialization.XmlElementAttribute("Extension")]
public ExtensionType[] Extension {
get {
return this.extensionField;
}
set {
this.extensionField = value;
}
}
private static System.Xml.Serialization.XmlSerializer Serializer {
get {
if ((serializer == null)) {
serializer = new System.Xml.Serialization.XmlSerializer(typeof(TechnicalProtectionBaseType));
}
return serializer;
}
}
#region Serialize/Deserialize
/// <summary>
/// Serializes current TechnicalProtectionBaseType object into an XML document
/// </summary>
/// <returns>string XML value</returns>
public virtual string Serialize(System.Text.Encoding encoding) {
System.IO.StreamReader streamReader = null;
System.IO.MemoryStream memoryStream = null;
try {
memoryStream = new System.IO.MemoryStream();
System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings();
xmlWriterSettings.Encoding = encoding;
System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings);
Serializer.Serialize(xmlWriter, this);
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
streamReader = new System.IO.StreamReader(memoryStream);
return streamReader.ReadToEnd();
}
finally {
if ((streamReader != null)) {
streamReader.Dispose();
}
if ((memoryStream != null)) {
memoryStream.Dispose();
}
}
}
public virtual string Serialize() {
return Serialize(System.Text.Encoding.UTF8);
}
/// <summary>
/// Deserializes workflow markup into an TechnicalProtectionBaseType object
/// </summary>
/// <param name="xml">string workflow markup to deserialize</param>
/// <param name="obj">Output TechnicalProtectionBaseType object</param>
/// <param name="exception">output Exception value if deserialize failed</param>
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
public static bool Deserialize(string xml, out TechnicalProtectionBaseType obj, out System.Exception exception) {
exception = null;
obj = default(TechnicalProtectionBaseType);
try {
obj = Deserialize(xml);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool Deserialize(string xml, out TechnicalProtectionBaseType obj) {
System.Exception exception = null;
return Deserialize(xml, out obj, out exception);
}
public static TechnicalProtectionBaseType Deserialize(string xml) {
System.IO.StringReader stringReader = null;
try {
stringReader = new System.IO.StringReader(xml);
return ((TechnicalProtectionBaseType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
}
finally {
if ((stringReader != null)) {
stringReader.Dispose();
}
}
}
#endregion
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.19522")]
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:oasis:names:tc:SAML:2.0:ac")]
[System.Xml.Serialization.XmlRootAttribute("GoverningAgreementRef", Namespace="urn:oasis:names:tc:SAML:2.0:ac", IsNullable=false)]
public partial class GoverningAgreementRefType {
[EditorBrowsable(EditorBrowsableState.Never)]
private string governingAgreementRefField;
private static System.Xml.Serialization.XmlSerializer serializer;
[System.Xml.Serialization.XmlAttributeAttribute(DataType="anyURI")]
public string governingAgreementRef {
get {
return this.governingAgreementRefField;
}
set {
this.governingAgreementRefField = value;
}
}
private static System.Xml.Serialization.XmlSerializer Serializer {
get {
if ((serializer == null)) {
serializer = new System.Xml.Serialization.XmlSerializer(typeof(GoverningAgreementRefType));
}
return serializer;
}
}
#region Serialize/Deserialize
/// <summary>
/// Serializes current GoverningAgreementRefType object into an XML document
/// </summary>
/// <returns>string XML value</returns>
public virtual string Serialize(System.Text.Encoding encoding) {
System.IO.StreamReader streamReader = null;
System.IO.MemoryStream memoryStream = null;
try {
memoryStream = new System.IO.MemoryStream();
System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings();
xmlWriterSettings.Encoding = encoding;
System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings);
Serializer.Serialize(xmlWriter, this);
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
streamReader = new System.IO.StreamReader(memoryStream);
return streamReader.ReadToEnd();
}
finally {
if ((streamReader != null)) {
streamReader.Dispose();
}
if ((memoryStream != null)) {
memoryStream.Dispose();
}
}
}
public virtual string Serialize() {
return Serialize(System.Text.Encoding.UTF8);
}
/// <summary>
/// Deserializes workflow markup into an GoverningAgreementRefType object
/// </summary>
/// <param name="xml">string workflow markup to deserialize</param>
/// <param name="obj">Output GoverningAgreementRefType object</param>
/// <param name="exception">output Exception value if deserialize failed</param>
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
public static bool Deserialize(string xml, out GoverningAgreementRefType obj, out System.Exception exception) {
exception = null;
obj = default(GoverningAgreementRefType);
try {
obj = Deserialize(xml);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool Deserialize(string xml, out GoverningAgreementRefType obj) {
System.Exception exception = null;
return Deserialize(xml, out obj, out exception);
}
public static GoverningAgreementRefType Deserialize(string xml) {
System.IO.StringReader stringReader = null;
try {
stringReader = new System.IO.StringReader(xml);
return ((GoverningAgreementRefType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
}
finally {
if ((stringReader != null)) {
stringReader.Dispose();
}
}
}
#endregion
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.19522")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:oasis:names:tc:SAML:2.0:ac")]
public enum nymType {
/// <remarks/>
anonymity,
/// <remarks/>
verinymity,
/// <remarks/>
pseudonymity,
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.19522")]
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:oasis:names:tc:SAML:2.0:ac")]
[System.Xml.Serialization.XmlRootAttribute("ComplexAuthenticator", Namespace="urn:oasis:names:tc:SAML:2.0:ac", IsNullable=false)]
public partial class ComplexAuthenticatorType {
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] previousSessionField;
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] resumeSessionField;
[EditorBrowsable(EditorBrowsableState.Never)]
private PublicKeyType digSigField;
[EditorBrowsable(EditorBrowsableState.Never)]
private PasswordType passwordField;
[EditorBrowsable(EditorBrowsableState.Never)]
private RestrictedPasswordType restrictedPasswordField;
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] zeroKnowledgeField;
[EditorBrowsable(EditorBrowsableState.Never)]
private SharedSecretChallengeResponseType sharedSecretChallengeResponseField;
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] sharedSecretDynamicPlaintextField;
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] iPAddressField;
[EditorBrowsable(EditorBrowsableState.Never)]
private PublicKeyType asymmetricDecryptionField;
[EditorBrowsable(EditorBrowsableState.Never)]
private PublicKeyType asymmetricKeyAgreementField;
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] subscriberLineNumberField;
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] userSuffixField;
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] previousSession1Field;
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] resumeSession1Field;
[EditorBrowsable(EditorBrowsableState.Never)]
private PublicKeyType digSig1Field;
[EditorBrowsable(EditorBrowsableState.Never)]
private PasswordType password1Field;
[EditorBrowsable(EditorBrowsableState.Never)]
private RestrictedPasswordType restrictedPassword1Field;
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] zeroKnowledge1Field;
[EditorBrowsable(EditorBrowsableState.Never)]
private SharedSecretChallengeResponseType sharedSecretChallengeResponse1Field;
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] sharedSecretDynamicPlaintext1Field;
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] iPAddress1Field;
[EditorBrowsable(EditorBrowsableState.Never)]
private PublicKeyType asymmetricDecryption1Field;
[EditorBrowsable(EditorBrowsableState.Never)]
private PublicKeyType asymmetricKeyAgreement1Field;
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] subscriberLineNumber1Field;
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] userSuffix1Field;
[EditorBrowsable(EditorBrowsableState.Never)]
private ExtensionType[] extensionField;
private static System.Xml.Serialization.XmlSerializer serializer;
[System.Xml.Serialization.XmlArrayAttribute(Order=0)]
[System.Xml.Serialization.XmlArrayItemAttribute("Extension", IsNullable=false)]
public ExtensionType[] PreviousSession {
get {
return this.previousSessionField;
}
set {
this.previousSessionField = value;
}
}
[System.Xml.Serialization.XmlArrayAttribute(Order=1)]
[System.Xml.Serialization.XmlArrayItemAttribute("Extension", IsNullable=false)]
public ExtensionType[] ResumeSession {
get {
return this.resumeSessionField;
}
set {
this.resumeSessionField = value;
}
}
[System.Xml.Serialization.XmlElementAttribute(Order=2)]
public PublicKeyType DigSig {
get {
return this.digSigField;
}
set {
this.digSigField = value;
}
}
[System.Xml.Serialization.XmlElementAttribute(Order=3)]
public PasswordType Password {
get {
return this.passwordField;
}
set {
this.passwordField = value;
}
}
[System.Xml.Serialization.XmlElementAttribute(Order=4)]
public RestrictedPasswordType RestrictedPassword {
get {
return this.restrictedPasswordField;
}
set {
this.restrictedPasswordField = value;
}
}
[System.Xml.Serialization.XmlArrayAttribute(Order=5)]
[System.Xml.Serialization.XmlArrayItemAttribute("Extension", IsNullable=false)]
public ExtensionType[] ZeroKnowledge {
get {
return this.zeroKnowledgeField;
}
set {
this.zeroKnowledgeField = value;
}
}
[System.Xml.Serialization.XmlElementAttribute(Order=6)]
public SharedSecretChallengeResponseType SharedSecretChallengeResponse {
get {
return this.sharedSecretChallengeResponseField;
}
set {
this.sharedSecretChallengeResponseField = value;
}
}
[System.Xml.Serialization.XmlArrayAttribute(Order=7)]
[System.Xml.Serialization.XmlArrayItemAttribute("Extension", IsNullable=false)]
public ExtensionType[] SharedSecretDynamicPlaintext {
get {
return this.sharedSecretDynamicPlaintextField;
}
set {
this.sharedSecretDynamicPlaintextField = value;
}
}
[System.Xml.Serialization.XmlArrayAttribute(Order=8)]
[System.Xml.Serialization.XmlArrayItemAttribute("Extension", IsNullable=false)]
public ExtensionType[] IPAddress {
get {
return this.iPAddressField;
}
set {
this.iPAddressField = value;
}
}
[System.Xml.Serialization.XmlElementAttribute(Order=9)]
public PublicKeyType AsymmetricDecryption {
get {
return this.asymmetricDecryptionField;
}
set {
this.asymmetricDecryptionField = value;
}
}
[System.Xml.Serialization.XmlElementAttribute(Order=10)]
public PublicKeyType AsymmetricKeyAgreement {
get {
return this.asymmetricKeyAgreementField;
}
set {
this.asymmetricKeyAgreementField = value;
}
}
[System.Xml.Serialization.XmlArrayAttribute(Order=11)]
[System.Xml.Serialization.XmlArrayItemAttribute("Extension", IsNullable=false)]
public ExtensionType[] SubscriberLineNumber {
get {
return this.subscriberLineNumberField;
}
set {
this.subscriberLineNumberField = value;
}
}
[System.Xml.Serialization.XmlArrayAttribute(Order=12)]
[System.Xml.Serialization.XmlArrayItemAttribute("Extension", IsNullable=false)]
public ExtensionType[] UserSuffix {
get {
return this.userSuffixField;
}
set {
this.userSuffixField = value;
}
}
[System.Xml.Serialization.XmlArrayAttribute("PreviousSession", Order=13)]
[System.Xml.Serialization.XmlArrayItemAttribute("Extension", IsNullable=false)]
public ExtensionType[] PreviousSession1 {
get {
return this.previousSession1Field;
}
set {
this.previousSession1Field = value;
}
}
[System.Xml.Serialization.XmlArrayAttribute("ResumeSession", Order=14)]
[System.Xml.Serialization.XmlArrayItemAttribute("Extension", IsNullable=false)]
public ExtensionType[] ResumeSession1 {
get {
return this.resumeSession1Field;
}
set {
this.resumeSession1Field = value;
}
}
[System.Xml.Serialization.XmlElementAttribute("DigSig", Order=15)]
public PublicKeyType DigSig1 {
get {
return this.digSig1Field;
}
set {
this.digSig1Field = value;
}
}
[System.Xml.Serialization.XmlElementAttribute("Password", Order=16)]
public PasswordType Password1 {
get {
return this.password1Field;
}
set {
this.password1Field = value;
}
}
[System.Xml.Serialization.XmlElementAttribute("RestrictedPassword", Order=17)]
public RestrictedPasswordType RestrictedPassword1 {
get {
return this.restrictedPassword1Field;
}
set {
this.restrictedPassword1Field = value;
}
}
[System.Xml.Serialization.XmlArrayAttribute("ZeroKnowledge", Order=18)]
[System.Xml.Serialization.XmlArrayItemAttribute("Extension", IsNullable=false)]
public ExtensionType[] ZeroKnowledge1 {
get {
return this.zeroKnowledge1Field;
}
set {
this.zeroKnowledge1Field = value;
}
}
[System.Xml.Serialization.XmlElementAttribute("SharedSecretChallengeResponse", Order=19)]
public SharedSecretChallengeResponseType SharedSecretChallengeResponse1 {
get {
return this.sharedSecretChallengeResponse1Field;
}
set {
this.sharedSecretChallengeResponse1Field = value;
}
}
[System.Xml.Serialization.XmlArrayAttribute("SharedSecretDynamicPlaintext", Order=20)]
[System.Xml.Serialization.XmlArrayItemAttribute("Extension", IsNullable=false)]
public ExtensionType[] SharedSecretDynamicPlaintext1 {
get {
return this.sharedSecretDynamicPlaintext1Field;
}
set {
this.sharedSecretDynamicPlaintext1Field = value;
}
}
[System.Xml.Serialization.XmlArrayAttribute("IPAddress", Order=21)]
[System.Xml.Serialization.XmlArrayItemAttribute("Extension", IsNullable=false)]
public ExtensionType[] IPAddress1 {
get {
return this.iPAddress1Field;
}
set {
this.iPAddress1Field = value;
}
}
[System.Xml.Serialization.XmlElementAttribute("AsymmetricDecryption", Order=22)]
public PublicKeyType AsymmetricDecryption1 {
get {
return this.asymmetricDecryption1Field;
}
set {
this.asymmetricDecryption1Field = value;
}
}
[System.Xml.Serialization.XmlElementAttribute("AsymmetricKeyAgreement", Order=23)]
public PublicKeyType AsymmetricKeyAgreement1 {
get {
return this.asymmetricKeyAgreement1Field;
}
set {
this.asymmetricKeyAgreement1Field = value;
}
}
[System.Xml.Serialization.XmlArrayAttribute("SubscriberLineNumber", Order=24)]
[System.Xml.Serialization.XmlArrayItemAttribute("Extension", IsNullable=false)]
public ExtensionType[] SubscriberLineNumber1 {
get {
return this.subscriberLineNumber1Field;
}
set {
this.subscriberLineNumber1Field = value;
}
}
[System.Xml.Serialization.XmlArrayAttribute("UserSuffix", Order=25)]
[System.Xml.Serialization.XmlArrayItemAttribute("Extension", IsNullable=false)]
public ExtensionType[] UserSuffix1 {
get {
return this.userSuffix1Field;
}
set {
this.userSuffix1Field = value;
}
}
[System.Xml.Serialization.XmlElementAttribute("Extension", Order=26)]
public ExtensionType[] Extension {
get {
return this.extensionField;
}
set {
this.extensionField = value;
}
}
private static System.Xml.Serialization.XmlSerializer Serializer {
get {
if ((serializer == null)) {
serializer = new System.Xml.Serialization.XmlSerializer(typeof(ComplexAuthenticatorType));
}
return serializer;
}
}
#region Serialize/Deserialize
/// <summary>
/// Serializes current ComplexAuthenticatorType object into an XML document
/// </summary>
/// <returns>string XML value</returns>
public virtual string Serialize(System.Text.Encoding encoding) {
System.IO.StreamReader streamReader = null;
System.IO.MemoryStream memoryStream = null;
try {
memoryStream = new System.IO.MemoryStream();
System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings();
xmlWriterSettings.Encoding = encoding;
System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings);
Serializer.Serialize(xmlWriter, this);
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
streamReader = new System.IO.StreamReader(memoryStream);
return streamReader.ReadToEnd();
}
finally {
if ((streamReader != null)) {
streamReader.Dispose();
}
if ((memoryStream != null)) {
memoryStream.Dispose();
}
}
}
public virtual string Serialize() {
return Serialize(System.Text.Encoding.UTF8);
}
/// <summary>
/// Deserializes workflow markup into an ComplexAuthenticatorType object
/// </summary>
/// <param name="xml">string workflow markup to deserialize</param>
/// <param name="obj">Output ComplexAuthenticatorType object</param>
/// <param name="exception">output Exception value if deserialize failed</param>
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
public static bool Deserialize(string xml, out ComplexAuthenticatorType obj, out System.Exception exception) {
exception = null;
obj = default(ComplexAuthenticatorType);
try {
obj = Deserialize(xml);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool Deserialize(string xml, out ComplexAuthenticatorType obj) {
System.Exception exception = null;
return Deserialize(xml, out obj, out exception);
}
public static ComplexAuthenticatorType Deserialize(string xml) {
System.IO.StringReader stringReader = null;
try {
stringReader = new System.IO.StringReader(xml);
return ((ComplexAuthenticatorType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
}
finally {
if ((stringReader != null)) {
stringReader.Dispose();
}
}
}
#endregion
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.19522")]
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:oasis:names:tc:SAML:2.0:ac")]
[System.Xml.Serialization.XmlRootAttribute("GoverningAgreements", Namespace="urn:oasis:names:tc:SAML:2.0:ac", IsNullable=false)]
public partial class GoverningAgreementsType {
[EditorBrowsable(EditorBrowsableState.Never)]
private GoverningAgreementRefType[] governingAgreementRefField;
private static System.Xml.Serialization.XmlSerializer serializer;
[System.Xml.Serialization.XmlElementAttribute("GoverningAgreementRef")]
public GoverningAgreementRefType[] GoverningAgreementRef {
get {
return this.governingAgreementRefField;
}
set {
this.governingAgreementRefField = value;
}
}
private static System.Xml.Serialization.XmlSerializer Serializer {
get {
if ((serializer == null)) {
serializer = new System.Xml.Serialization.XmlSerializer(typeof(GoverningAgreementsType));
}
return serializer;
}
}
#region Serialize/Deserialize
/// <summary>
/// Serializes current GoverningAgreementsType object into an XML document
/// </summary>
/// <returns>string XML value</returns>
public virtual string Serialize(System.Text.Encoding encoding) {
System.IO.StreamReader streamReader = null;
System.IO.MemoryStream memoryStream = null;
try {
memoryStream = new System.IO.MemoryStream();
System.Xml.XmlWriterSettings xmlWriterSettings = new System.Xml.XmlWriterSettings();
xmlWriterSettings.Encoding = encoding;
System.Xml.XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings);
Serializer.Serialize(xmlWriter, this);
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
streamReader = new System.IO.StreamReader(memoryStream);
return streamReader.ReadToEnd();
}
finally {
if ((streamReader != null)) {
streamReader.Dispose();
}
if ((memoryStream != null)) {
memoryStream.Dispose();
}
}
}
public virtual string Serialize() {
return Serialize(System.Text.Encoding.UTF8);
}
/// <summary>
/// Deserializes workflow markup into an GoverningAgreementsType object
/// </summary>
/// <param name="xml">string workflow markup to deserialize</param>
/// <param name="obj">Output GoverningAgreementsType object</param>
/// <param name="exception">output Exception value if deserialize failed</param>
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
public static bool Deserialize(string xml, out GoverningAgreementsType obj, out System.Exception exception) {
exception = null;
obj = default(GoverningAgreementsType);
try {
obj = Deserialize(xml);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool Deserialize(string xml, out GoverningAgreementsType obj) {
System.Exception exception = null;
return Deserialize(xml, out obj, out exception);
}
public static GoverningAgreementsType Deserialize(string xml) {
System.IO.StringReader stringReader = null;
try {
stringReader = new System.IO.StringReader(xml);
return ((GoverningAgreementsType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
}
finally {
if ((stringReader != null)) {
stringReader.Dispose();
}
}
}
#endregion
}
}
#pragma warning restore 1591
| 39.384935 | 1,399 | 0.573689 | [
"MIT"
] | Currence-Online/iDIN-libraries-dotnet | .NET/BankId.Merchant.Library/Xml/Schemas/saml-schema-authn-context-2.0.cs | 199,209 | C# |
using FlightTrend.Core.FlightFinders;
using FlightTrend.Core.Ioc;
using FlightTrend.Core.Repositories;
using FlightTrend.PegasusAirlines;
using FlightTrend.Repositories.AzureBlobStorage;
using FlightTrend.Serializers;
using JetBrains.Annotations;
using Microsoft.Extensions.Caching.Memory;
using NodaTime;
namespace FlightTrend.Register
{
public class Ioc
{
[NotNull]
public static IDependencyResolver Bootstrap(FlightTrendConfig config)
{
var clock = SystemClock.Instance;
var serializer = new ReturnFlightArchiveCollectionSerializer(
new ReturnFlightArchiveSerializer(
new InstantSerializer(),
new LocalDateSerializer(),
new LocalTimeSerializer(),
new FloatSerializer()));
var memoryCache = new MemoryCache(new MemoryCacheOptions());
var pegasusCheapestFlightFinder = new PegasusCheapestFlightFinder();
var multiCheapestFlightFinder = new MultiCheapestFlightFinder(
pegasusCheapestFlightFinder);
var azureRepo = new AzureBlobStorageCheapestReturnFlightsRepository(
config.AzureBlobStorageConnectionString,
serializer);
var repository = new CheapestReturnFlightsRepositoryStorageStrategyDecorator(
azureRepo,
new CompositeStorageStrategy(
new OnlyLastYearWorthOfData(clock),
new OnlyStoreChangesStorageStrategy()));
var dependencyResolver = new DependencyResolver();
dependencyResolver.RegisterService<ICheapestFlightFinder>(multiCheapestFlightFinder);
dependencyResolver.RegisterService(memoryCache);
dependencyResolver.RegisterService<IClock>(clock);
dependencyResolver.RegisterService<ICheapestReturnFlightsRepository>(repository);
return dependencyResolver;
}
}
} | 36.944444 | 97 | 0.679198 | [
"MIT"
] | Eraclys/FlightTrend | src/FlightTrend.Register/Ioc.cs | 1,997 | C# |
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Energy : MonoBehaviour
{
public EnergyStats stats;
// Use this for initialization
void Start () {
}
void OnTriggerEnter2D(Collider2D col)
{
if (col.tag == "Player")
{
col.GetComponent<Player>().Regenerate(stats);
Destroy(this.gameObject);
}
}
}
| 17.208333 | 57 | 0.619855 | [
"MIT"
] | Panzershrekk/Ludum_Dare_42 | LudumDare_42/Assets/Script/Map/Energy.cs | 415 | C# |
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Reflection;
using Easy.Admin.Common;
using Easy.Admin.Entities;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Controllers;
using Microsoft.AspNetCore.Mvc.Filters;
using NewLife;
using NewLife.Log;
using NewLife.Reflection;
using XCode;
using XCode.Membership;
namespace Easy.Admin.Filters
{
/// <summary>实体授权特性</summary>
public class ApiAuthorizeFilterAttribute : Attribute, IAuthorizationFilter
{
#region 属性
/// <summary>授权项</summary>
public PermissionFlags Permission { get; }
/// <summary>是否全局特性</summary>
internal Boolean IsGlobal;
#endregion
#region 构造
static ApiAuthorizeFilterAttribute()
{
XTrace.WriteLine("注册过滤器:{0}", typeof(ApiAuthorizeFilterAttribute).FullName);
}
/// <summary>实例化实体授权特性</summary>
public ApiAuthorizeFilterAttribute() { }
/// <summary>实例化实体授权特性</summary>
/// <param name="permission"></param>
public ApiAuthorizeFilterAttribute(PermissionFlags permission)
{
if (permission <= PermissionFlags.None) throw new ArgumentNullException(nameof(permission));
Permission = permission;
}
#endregion
#region 方法
/// <summary>授权发生时触发</summary>
/// <param name="filterContext"></param>
public void OnAuthorization(AuthorizationFilterContext filterContext)
{
/*
* 验证范围:
* 1,魔方区域下的所有控制器
* 2,所有带有EntityAuthorize特性的控制器或动作
*/
var act = filterContext.ActionDescriptor;
var ctrl = (ControllerActionDescriptor)act;
// 允许匿名访问时,直接跳过检查
if (
ctrl.MethodInfo.IsDefined(typeof(AllowAnonymousAttribute)) ||
ctrl.ControllerTypeInfo.IsDefined(typeof(AllowAnonymousAttribute))) return;
// 如果控制器或者Action放有该特性,则跳过全局
var hasAtt =
ctrl.MethodInfo.IsDefined(typeof(ApiAuthorizeFilterAttribute), true) ||
ctrl.ControllerTypeInfo.IsDefined(typeof(ApiAuthorizeFilterAttribute));
if (IsGlobal && hasAtt) return;
// 根据控制器定位资源菜单
var menu = GetMenu(filterContext);
// 如果已经处理过,就不处理了
if (filterContext.Result != null) return;
if (!AuthorizeCore(filterContext.HttpContext))
{
HandleUnauthorizedRequest(filterContext);
}
}
/// <summary>授权核心</summary>
/// <param name="httpContext"></param>
/// <returns></returns>
protected bool AuthorizeCore(Microsoft.AspNetCore.Http.HttpContext httpContext)
{
var ctx = httpContext;
var user = ctx.User.Identity as IUser;
if (user == null)
{
return false;
}
// 判断权限
if (!(ctx.Items["CurrentMenu"] is IMenu menu) || !(user is IUser user2)) return false;
return user2.Has(menu, Permission);
}
/// <summary>无权限请求</summary>
/// <param name="filterContext"></param>
protected void HandleUnauthorizedRequest(AuthorizationFilterContext filterContext)
{
var content = new ApiResult<String>
{
Status = 401,
Msg = "No permission" // 没有权限
};
ResponseStatusCode.SetResponseStatusCode(content, filterContext.HttpContext.Response);
// 此处不能直接设置Response,要设置Result,后续过滤器才不会往下执行,下游判断Result不为空,直接执行结果,自动写入响应
// 否则此处设置响应流,请求到达控制器,又会执行控制器的结果,因再次写入Response而抛异常
filterContext.Result = new ObjectResult(content);
}
private IMenu GetMenu(AuthorizationFilterContext filterContext)
{
var act = (ControllerActionDescriptor)filterContext.ActionDescriptor;
//var ctrl = act.ControllerDescriptor;
var type = act.ControllerTypeInfo;
var fullName = type.FullName + "." + act.ActionName;
var ctx = filterContext.HttpContext;
var mf = ManageProvider.Menu;
var menu = ctx.Items["CurrentMenu"] as IMenu;
if (menu == null)
{
menu = mf.FindByFullName(fullName) ?? mf.FindByFullName(type.FullName);
// 当前菜单
//filterContext.Controller.ViewBag.Menu = menu;
// 兼容旧版本视图权限
ctx.Items["CurrentMenu"] = menu;
}
if (menu == null) XTrace.WriteLine("设计错误!验证权限时无法找到[{0}/{1}]的菜单", type.FullName, act.ActionName);
return menu;
}
private static ConcurrentDictionary<String, Type> _ss = new ConcurrentDictionary<String, Type>();
private bool CreateMenu(Type type)
{
if (!_ss.TryAdd(type.Namespace, type)) return false;
var mf = ManageProvider.Menu;
var ms = mf.ScanController(type.Namespace.TrimEnd(".Controllers"), type.Assembly, type.Namespace);
var root = mf.FindByFullName(type.Namespace);
if (root != null)
{
root.Url = "~";
(root as IEntity).Save();
}
// 遍历菜单,设置权限项
foreach (var controller in ms)
{
if (controller.FullName.IsNullOrEmpty()) continue;
var ctype = type.Assembly.GetType(controller.FullName);
//ctype = controller.FullName.GetTypeEx(false);
if (ctype == null) continue;
// 添加该类型下的所有Action
var dic = new Dictionary<MethodInfo, Int32>();
foreach (var method in ctype.GetMethods())
{
if (method.IsStatic || !method.IsPublic) continue;
if (!method.ReturnType.As<ActionResult>()) continue;
if (method.GetCustomAttribute<AllowAnonymousAttribute>() != null) continue;
var att = method.GetCustomAttribute<ApiAuthorizeFilterAttribute>();
if (att != null && att.Permission > PermissionFlags.None)
{
var dn = method.GetDisplayName();
var pmName = !dn.IsNullOrEmpty() ? dn : method.Name;
if (att.Permission <= PermissionFlags.Delete) pmName = att.Permission.GetDescription();
controller.Permissions[(Int32)att.Permission] = pmName;
}
}
controller.Url = "~/" + ctype.Name.TrimEnd("Controller");
(controller as IEntity).Save();
}
return true;
}
#endregion
}
}
| 34.34 | 111 | 0.570763 | [
"MIT"
] | xxred/Easy.Admin | Easy.Admin/Filters/ApiAuthorizeFilterAttribute.cs | 7,450 | C# |
using System;
using System.Collections.Generic;
using System.Diagnostics;
namespace SDRSharp.Tetra
{
unsafe class LlcLevel
{
private const UInt32 Poly = 0xedb88320;
private const UInt32 GoodFCS = 0xdebb20e3;
private MleLevel _mle = new MleLevel();
public void Parse(LogicChannel channelData, int offset, ReceivedData result)
{
var llcType = (LLCPduType)TetraUtils.BitsToInt32(channelData.Ptr, offset, 4);
offset += 4;
result.Add(GlobalNames.LLC_Pdu_Type, (int)llcType);
//Debug.WriteLine(" " + llcType.ToString());
var fcsIsGood = true;
switch (llcType)
{
case LLCPduType.BL_ADATA:
offset += 1; //N(R)
offset += 1; //N(S)
break;
case LLCPduType.BL_ADATA_FCS:
offset += 1; //N(R)
offset += 1; //N(S)
fcsIsGood = CalculateFCS(channelData, offset);
break;
case LLCPduType.BL_DATA:
offset += 1; //N(S)
break;
case LLCPduType.BL_DATA_FCS:
offset += 1; //N(S)
fcsIsGood = CalculateFCS(channelData, offset);
break;
case LLCPduType.BL_UDATA:
//No bits here
break;
case LLCPduType.BL_UDATA_FCS:
//No bits here
fcsIsGood = CalculateFCS(channelData, offset);
break;
case LLCPduType.BL_ACK:
offset += 1;//N(R)
break;
case LLCPduType.BL_ACK_FCS:
offset += 1;//N(R)
fcsIsGood = CalculateFCS(channelData, offset);
break;
case LLCPduType.AL_SETUP:
case LLCPduType.AL_DATA_AR_FINAL:
case LLCPduType.AL_UDATA_UFINAL:
case LLCPduType.AL_ACK_RNR:
case LLCPduType.AL_RECONNECT:
case LLCPduType.Reserved1:
case LLCPduType.Reserved2:
case LLCPduType.AL_DISC:
default:
Debug.WriteLine(" Unknow_LLC_PDU "+ llcType);
result.Add(GlobalNames.UnknowData, 1);
return;
}
if (fcsIsGood)
{
_mle.Parse(channelData, offset, result);
}
else
{
result.Add(GlobalNames.UnknowData, 1);
}
}
private bool CalculateFCS(LogicChannel channelData, int offset)
{
var lsfr = (UInt32)0xffffffff;
var bit = (UInt32)0;
for (int i = offset; i < channelData.Length; i++)
{
bit = channelData.Ptr[i] ^ (lsfr & 0x1);
lsfr >>= 1;
if (bit != 0) lsfr ^= Poly;
}
Debug.WriteLine(" FCS_" + (lsfr == GoodFCS ? "Ok" : "Err"));
return lsfr == GoodFCS;
}
}
}
| 29.666667 | 89 | 0.460986 | [
"MIT"
] | vgpastor/SDR-Tetra-Plugin | Parsers/LlcLevel.cs | 3,206 | C# |
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information
#region Apache License
//
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to you under the Apache License, Version 2.0
// (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#endregion
using System;
using System.Collections;
using System.Globalization;
using log4net.Core;
using log4net.Layout;
namespace log4net.Util
{
/// <summary>
/// Most of the work of the <see cref="PatternLayout"/> class
/// is delegated to the PatternParser class.
/// </summary>
/// <remarks>
/// <para>
/// The <c>PatternParser</c> processes a pattern string and
/// returns a chain of <see cref="PatternConverter"/> objects.
/// </para>
/// </remarks>
/// <author>Nicko Cadell</author>
/// <author>Gert Driesen</author>
public sealed class PatternParser
{
#region Public Instance Constructors
/// <summary>
/// Constructor
/// </summary>
/// <param name="pattern">The pattern to parse.</param>
/// <remarks>
/// <para>
/// Initializes a new instance of the <see cref="PatternParser" /> class
/// with the specified pattern string.
/// </para>
/// </remarks>
public PatternParser(string pattern)
{
this.m_pattern = pattern;
}
#endregion Public Instance Constructors
#region Public Instance Methods
/// <summary>
/// Parses the pattern into a chain of pattern converters.
/// </summary>
/// <returns>The head of a chain of pattern converters.</returns>
/// <remarks>
/// <para>
/// Parses the pattern into a chain of pattern converters.
/// </para>
/// </remarks>
public PatternConverter Parse()
{
string[] converterNamesCache = this.BuildCache();
this.ParseInternal(this.m_pattern, converterNamesCache);
return this.m_head;
}
#endregion Public Instance Methods
#region Public Instance Properties
/// <summary>
/// Get the converter registry used by this parser
/// </summary>
/// <value>
/// The converter registry used by this parser
/// </value>
/// <remarks>
/// <para>
/// Get the converter registry used by this parser
/// </para>
/// </remarks>
public Hashtable PatternConverters
{
get { return this.m_patternConverters; }
}
#endregion Public Instance Properties
#region Private Instance Methods
/// <summary>
/// Build the unified cache of converters from the static and instance maps
/// </summary>
/// <returns>the list of all the converter names</returns>
/// <remarks>
/// <para>
/// Build the unified cache of converters from the static and instance maps
/// </para>
/// </remarks>
private string[] BuildCache()
{
string[] converterNamesCache = new string[this.m_patternConverters.Keys.Count];
this.m_patternConverters.Keys.CopyTo(converterNamesCache, 0);
// sort array so that longer strings come first
Array.Sort(converterNamesCache, 0, converterNamesCache.Length, StringLengthComparer.Instance);
return converterNamesCache;
}
#region StringLengthComparer
/// <summary>
/// Sort strings by length
/// </summary>
/// <remarks>
/// <para>
/// <see cref="IComparer" /> that orders strings by string length.
/// The longest strings are placed first
/// </para>
/// </remarks>
private sealed class StringLengthComparer : IComparer
{
public static readonly StringLengthComparer Instance = new StringLengthComparer();
private StringLengthComparer()
{
}
#region Implementation of IComparer
public int Compare(object x, object y)
{
string s1 = x as string;
string s2 = y as string;
if (s1 == null && s2 == null)
{
return 0;
}
if (s1 == null)
{
return 1;
}
if (s2 == null)
{
return -1;
}
return s2.Length.CompareTo(s1.Length);
}
#endregion
}
#endregion // StringLengthComparer
/// <summary>
/// Internal method to parse the specified pattern to find specified matches
/// </summary>
/// <param name="pattern">the pattern to parse</param>
/// <param name="matches">the converter names to match in the pattern</param>
/// <remarks>
/// <para>
/// The matches param must be sorted such that longer strings come before shorter ones.
/// </para>
/// </remarks>
private void ParseInternal(string pattern, string[] matches)
{
int offset = 0;
while(offset < pattern.Length)
{
int i = pattern.IndexOf('%', offset);
if (i < 0 || i == pattern.Length - 1)
{
this.ProcessLiteral(pattern.Substring(offset));
offset = pattern.Length;
}
else
{
if (pattern[i+1] == '%')
{
// Escaped
this.ProcessLiteral(pattern.Substring(offset, i - offset + 1));
offset = i + 2;
}
else
{
this.ProcessLiteral(pattern.Substring(offset, i - offset));
offset = i + 1;
FormattingInfo formattingInfo = new FormattingInfo();
// Process formatting options
// Look for the align flag
if (offset < pattern.Length)
{
if (pattern[offset] == '-')
{
// Seen align flag
formattingInfo.LeftAlign = true;
offset++;
}
}
// Look for the minimum length
while (offset < pattern.Length && char.IsDigit(pattern[offset]))
{
// Seen digit
if (formattingInfo.Min < 0)
{
formattingInfo.Min = 0;
}
formattingInfo.Min = (formattingInfo.Min * 10) + int.Parse(pattern[offset].ToString(), NumberFormatInfo.InvariantInfo);
offset++;
}
// Look for the separator between min and max
if (offset < pattern.Length)
{
if (pattern[offset] == '.')
{
// Seen separator
offset++;
}
}
// Look for the maximum length
while (offset < pattern.Length && char.IsDigit(pattern[offset]))
{
// Seen digit
if (formattingInfo.Max == int.MaxValue)
{
formattingInfo.Max = 0;
}
formattingInfo.Max = (formattingInfo.Max * 10) + int.Parse(pattern[offset].ToString(), NumberFormatInfo.InvariantInfo);
offset++;
}
int remainingStringLength = pattern.Length - offset;
// Look for pattern
for(int m=0; m<matches.Length; m++)
{
string key = matches[m];
if (key.Length <= remainingStringLength)
{
if (string.Compare(pattern, offset, key, 0, key.Length) == 0)
{
// Found match
offset = offset + matches[m].Length;
string option = null;
// Look for option
if (offset < pattern.Length)
{
if (pattern[offset] == '{')
{
// Seen option start
offset++;
int optEnd = pattern.IndexOf('}', offset);
if (optEnd < 0)
{
// error
}
else
{
option = pattern.Substring(offset, optEnd - offset);
offset = optEnd + 1;
}
}
}
this.ProcessConverter(matches[m], option, formattingInfo);
break;
}
}
}
}
}
}
}
/// <summary>
/// Process a parsed literal
/// </summary>
/// <param name="text">the literal text</param>
private void ProcessLiteral(string text)
{
if (text.Length > 0)
{
// Convert into a pattern
this.ProcessConverter("literal", text, new FormattingInfo());
}
}
/// <summary>
/// Process a parsed converter pattern
/// </summary>
/// <param name="converterName">the name of the converter</param>
/// <param name="option">the optional option for the converter</param>
/// <param name="formattingInfo">the formatting info for the converter</param>
private void ProcessConverter(string converterName, string option, FormattingInfo formattingInfo)
{
LogLog.Debug(declaringType, "Converter ["+converterName+"] Option ["+option+"] Format [min="+formattingInfo.Min+",max="+formattingInfo.Max+",leftAlign="+formattingInfo.LeftAlign+"]");
// Lookup the converter type
ConverterInfo converterInfo = (ConverterInfo)this.m_patternConverters[converterName];
if (converterInfo == null)
{
LogLog.Error(declaringType, "Unknown converter name ["+converterName+"] in conversion pattern.");
}
else
{
// Create the pattern converter
PatternConverter pc = null;
try
{
pc = (PatternConverter)Activator.CreateInstance(converterInfo.Type);
}
catch(Exception createInstanceEx)
{
LogLog.Error(declaringType, "Failed to create instance of Type [" + converterInfo.Type.FullName + "] using default constructor. Exception: " + createInstanceEx.ToString());
}
// formattingInfo variable is an instance variable, occasionally reset
// and used over and over again
pc.FormattingInfo = formattingInfo;
pc.Option = option;
pc.Properties = converterInfo.Properties;
IOptionHandler optionHandler = pc as IOptionHandler;
if (optionHandler != null)
{
optionHandler.ActivateOptions();
}
this.AddConverter(pc);
}
}
/// <summary>
/// Resets the internal state of the parser and adds the specified pattern converter
/// to the chain.
/// </summary>
/// <param name="pc">The pattern converter to add.</param>
private void AddConverter(PatternConverter pc)
{
// Add the pattern converter to the list.
if (this.m_head == null)
{
this.m_head = this.m_tail = pc;
}
else
{
// Set the next converter on the tail
// Update the tail reference
// note that a converter may combine the 'next' into itself
// and therefore the tail would not change!
this.m_tail = this.m_tail.SetNext(pc);
}
}
#endregion Protected Instance Methods
#region Private Constants
private const char ESCAPE_CHAR = '%';
#endregion Private Constants
#region Private Instance Fields
/// <summary>
/// The first pattern converter in the chain
/// </summary>
private PatternConverter m_head;
/// <summary>
/// the last pattern converter in the chain
/// </summary>
private PatternConverter m_tail;
/// <summary>
/// The pattern
/// </summary>
private string m_pattern;
/// <summary>
/// Internal map of converter identifiers to converter types
/// </summary>
/// <remarks>
/// <para>
/// This map overrides the static s_globalRulesRegistry map.
/// </para>
/// </remarks>
private Hashtable m_patternConverters = new Hashtable();
#endregion Private Instance Fields
#region Private Static Fields
/// <summary>
/// The fully qualified type of the PatternParser class.
/// </summary>
/// <remarks>
/// Used by the internal logger to record the Type of the
/// log message.
/// </remarks>
private readonly static Type declaringType = typeof(PatternParser);
#endregion Private Static Fields
}
}
| 26.670455 | 192 | 0.631615 | [
"MIT"
] | MaiklT/Dnn.Platform | DNN Platform/DotNetNuke.Log4net/log4net/Util/PatternParser.cs | 11,737 | C# |
#region License
// PermissionItem.cs
//
// Copyright (c) 2012 Xoqal.com
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#endregion
namespace Xoqal.Security
{
using System;
using Utilities;
/// <summary>
/// Represents a permission entity.
/// </summary>
public class PermissionItem
{
private readonly string resourceName;
private readonly Type resourceType;
private string description;
/// <summary>
/// Initializes a new instance of the <see cref="PermissionItem" /> class.
/// </summary>
/// <param name="permissionId"> The permission ID. </param>
/// <param name="description"> The description. </param>
public PermissionItem(string permissionId, string description)
{
this.PermissionId = permissionId.Trim();
this.Description = description.Trim();
}
/// <summary>
/// Initializes a new instance of the <see cref="PermissionItem" /> class.
/// </summary>
/// <param name="permissoinId">The permission ID. </param>
/// <param name="resourceType">The resource type. </param>
/// <param name="resourceName">The resource name. </param>
public PermissionItem(string permissoinId, Type resourceType, string resourceName)
{
this.PermissionId = permissoinId;
this.resourceType = resourceType;
this.resourceName = resourceName;
}
/// <summary>
/// Gets or sets the permission ID.
/// </summary>
/// <value> The permission ID. </value>
public string PermissionId { get; private set; }
/// <summary>
/// Gets or sets the description.
/// </summary>
/// <value> The description. </value>
public string Description
{
get { return this.resourceType != null ? ResourceHelper.GetResourceValue(this.resourceType, this.resourceName) : this.description; }
set { this.description = value; }
}
}
}
| 34.689189 | 144 | 0.624854 | [
"Apache-2.0"
] | AmirKarimi/Xoqal | Source/Xoqal.Security/PermissionItem.cs | 2,567 | C# |
using System;
using System.Collections.Generic;
using Microsoft.TemplateEngine.Abstractions;
using Microsoft.TemplateEngine.Core;
using Microsoft.TemplateEngine.Core.Contracts;
using Microsoft.TemplateEngine.Orchestrator.RunnableProjects.Macros;
using Microsoft.TemplateEngine.Orchestrator.RunnableProjects.Macros.Config;
using Microsoft.TemplateEngine.TestHelper;
using static Microsoft.TemplateEngine.Orchestrator.RunnableProjects.RunnableProjectGenerator;
using Newtonsoft.Json.Linq;
using Xunit;
namespace Microsoft.TemplateEngine.Orchestrator.RunnableProjects.UnitTests.MacroTests
{
public class GuidMacroTests : TestBase
{
[Fact(DisplayName = nameof(TestGuidConfig))]
public void TestGuidConfig()
{
string paramName = "TestGuid";
IMacroConfig macroConfig = new GuidMacroConfig(paramName, "string", string.Empty);
IVariableCollection variables = new VariableCollection();
IRunnableProjectConfig config = new SimpleConfigModel();
IParameterSet parameters = new ParameterSet(config);
ParameterSetter setter = MacroTestHelpers.TestParameterSetter(EngineEnvironmentSettings, parameters);
GuidMacro guidMacro = new GuidMacro();
guidMacro.EvaluateConfig(EngineEnvironmentSettings, variables, macroConfig, parameters, setter);
ValidateGuidMacroCreatedParametersWithResolvedValues(paramName, parameters);
}
[Fact(DisplayName = nameof(TestDeferredGuidConfig))]
public void TestDeferredGuidConfig()
{
Dictionary<string, JToken> jsonParameters = new Dictionary<string, JToken>();
jsonParameters.Add("format", null);
string variableName = "myGuid1";
GeneratedSymbolDeferredMacroConfig deferredConfig = new GeneratedSymbolDeferredMacroConfig("GuidMacro", "string", variableName, jsonParameters);
GuidMacro guidMacro = new GuidMacro();
IVariableCollection variables = new VariableCollection();
IRunnableProjectConfig config = new SimpleConfigModel();
IParameterSet parameters = new ParameterSet(config);
ParameterSetter setter = MacroTestHelpers.TestParameterSetter(EngineEnvironmentSettings, parameters);
IMacroConfig realConfig = guidMacro.CreateConfig(EngineEnvironmentSettings, deferredConfig);
guidMacro.EvaluateConfig(EngineEnvironmentSettings, variables, realConfig, parameters, setter);
ValidateGuidMacroCreatedParametersWithResolvedValues(variableName, parameters);
}
private static void ValidateGuidMacroCreatedParametersWithResolvedValues(string variableName, IParameterSet parameters)
{
ITemplateParameter setParam;
Assert.True(parameters.TryGetParameterDefinition(variableName, out setParam));
Guid paramValue = Guid.Parse((string)parameters.ResolvedValues[setParam]);
// check that all the param name variants were created, and their values all resolve to the same guid.
string guidFormats = GuidMacroConfig.DefaultFormats;
for (int i = 0; i < guidFormats.Length; ++i)
{
string otherFormatParamName = variableName + "-" + guidFormats[i];
ITemplateParameter testParam;
Assert.True(parameters.TryGetParameterDefinition(otherFormatParamName, out testParam));
Guid testValue = Guid.Parse((string)parameters.ResolvedValues[testParam]);
Assert.Equal(paramValue, testValue);
}
}
}
}
| 51.236111 | 157 | 0.703714 | [
"MIT"
] | KevinRansom/templating | test/Microsoft.TemplateEngine.Orchestrator.RunnableProjects.UnitTests/MacroTests/GuidMacroTests.cs | 3,618 | C# |
namespace Basket.API.Entities
{
public class ShoppingCartItem
{
public int Quantity { get; set; }
public string Color { get; set; } = null!;
public decimal Price { get; set; }
public string ProductId { get; set; } = null!;
public string ProductName { get; set; } = null!;
}
} | 27.416667 | 56 | 0.580547 | [
"MIT"
] | newmancroos/AspnetMicroservices | src/Services/Basket/Basket.API/Entities/ShoppingCartItem.cs | 331 | C# |
namespace InsanityBot.Commands.Moderation.Locking;
using System;
using System.Collections.Generic;
public struct ChannelData
{
public List<UInt64> WhitelistedRoles { get; set; }
public List<UInt64> LockedRoles { get; set; }
public static ChannelData CreateNew() => new()
{
WhitelistedRoles = new List<UInt64>(),
LockedRoles = new List<UInt64>()
};
} | 24.066667 | 51 | 0.739612 | [
"MIT"
] | InsanityBot/InsanityBot | InsanityBot/Commands/Moderation/Locking/ChannelData.cs | 363 | C# |
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace WordClustering
{
[TestClass]
public class WordClusteringUnitTest
{
[TestMethod]
public void TestClustering()
{
List<string> word_sequence = new List<string>();
Corpus corpus = new Corpus();
using (StreamReader reader = new StreamReader("sample.txt"))
{
string[] words = reader.ReadToEnd().Split(new char[] { ' ', '?', ',', ':', '"', '\n', '\t' }, StringSplitOptions.RemoveEmptyEntries);
foreach (string word in words)
{
string w2 = word.Trim();
if (w2 == ".")
{
continue;
}
if (w2.EndsWith("."))
{
w2 = w2.Substring(0, w2.Length - 1);
}
if (!string.IsNullOrEmpty(w2) && word.Length > 1)
{
word_sequence.Add(w2);
corpus.Add(w2);
}
}
}
int M = 70;
Console.WriteLine("M: {0}", M);
Console.WriteLine("Corpus Size: {0}", corpus.Count);
Console.WriteLine("Document Size: {0}", word_sequence.Count);
BrownClustering bc = new BrownClustering(M);
bc.Cluster(corpus, word_sequence);
Dictionary<string, List<string>> clusters = bc.GetClustersWithCodewordsOfLength(10);
foreach (string codeword in clusters.Keys)
{
Console.WriteLine("In Cluster {0}", codeword);
foreach (string word in clusters[codeword])
{
Console.Write("{0}, ", word);
}
Console.WriteLine();
}
XmlDocument doc = new XmlDocument();
XmlElement root = bc.ToXml(doc);
doc.AppendChild(root);
doc.Save("BrownClusteringResult.xml");
}
}
}
| 32.507463 | 149 | 0.470156 | [
"MIT"
] | cschen1205/cs-nlp-word-clustering | cs-nlp-word-clustering-unit/WordClusteringUnitTest.cs | 2,180 | C# |
#if WITH_EDITOR
#if PLATFORM_64BITS
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace UnrealEngine
{
public partial class UMaterialExpressionFunctionInput
{
static readonly int Preview__Offset;
/// <summary>Used for previewing when editing the function, or when bUsePreviewValueAsDefault is enabled.</summary>
public FExpressionInput Preview
{
get{ CheckIsValid();return (FExpressionInput)Marshal.PtrToStructure(_this.Get()+Preview__Offset, typeof(FExpressionInput));}
}
static readonly int InputName__Offset;
/// <summary>The input's name, which will be drawn on the connector in function call expressions that use this function.</summary>
public FString InputName
{
get{ CheckIsValid();return (FString)Marshal.PtrToStructure(_this.Get()+InputName__Offset, typeof(FString));}
set{ CheckIsValid();Marshal.StructureToPtr(value, _this.Get()+InputName__Offset, false);}
}
static readonly int Description__Offset;
/// <summary>The input's description, which will be used as a tooltip on the connector in function call expressions that use this function.</summary>
public FString Description
{
get{ CheckIsValid();return (FString)Marshal.PtrToStructure(_this.Get()+Description__Offset, typeof(FString));}
set{ CheckIsValid();Marshal.StructureToPtr(value, _this.Get()+Description__Offset, false);}
}
static readonly int Id__Offset;
/// <summary>Id of this input, used to maintain references through name changes.</summary>
public FGuid Id
{
get{ CheckIsValid();return (FGuid)Marshal.PtrToStructure(_this.Get()+Id__Offset, typeof(FGuid));}
}
static readonly int InputType__Offset;
/// <summary>
/// Type of this input.
/// Input code chunks will be cast to this type, and a compiler error will be emitted if the cast fails.
/// </summary>
public EFunctionInputType InputType
{
get{ CheckIsValid();return (EFunctionInputType)Marshal.PtrToStructure(_this.Get()+InputType__Offset, typeof(EFunctionInputType));}
set{ CheckIsValid();Marshal.StructureToPtr(value, _this.Get()+InputType__Offset, false);}
}
static readonly int PreviewValue__Offset;
/// <summary>Value used to preview this input when editing the material function.</summary>
public FVector4 PreviewValue
{
get{ CheckIsValid();return (FVector4)Marshal.PtrToStructure(_this.Get()+PreviewValue__Offset, typeof(FVector4));}
set{ CheckIsValid();Marshal.StructureToPtr(value, _this.Get()+PreviewValue__Offset, false);}
}
static readonly int bUsePreviewValueAsDefault__Offset;
/// <summary>Whether to use the preview value or texture as the default value for this input.</summary>
public bool bUsePreviewValueAsDefault
{
get{ CheckIsValid();return BoolWrap.Get(_this.Get(), bUsePreviewValueAsDefault__Offset, 1, 0, 1, 1);}
set{ CheckIsValid();BoolWrap.Set(value,_this.Get(), bUsePreviewValueAsDefault__Offset, 1,0,1,1);}
}
static readonly int SortPriority__Offset;
/// <summary>Controls where the input is displayed relative to the other inputs.</summary>
public int SortPriority
{
get{ CheckIsValid();return (int)Marshal.PtrToStructure(_this.Get()+SortPriority__Offset, typeof(int));}
set{ CheckIsValid();Marshal.StructureToPtr(value, _this.Get()+SortPriority__Offset, false);}
}
static readonly int bCompilingFunctionPreview__Offset;
/// <summary>
/// true when this expression is being compiled in a function preview,
/// false when this expression is being compiled into a material that uses the function.
/// Only valid in Compile()
/// </summary>
public bool bCompilingFunctionPreview
{
get{ CheckIsValid();return BoolWrap.Get(_this.Get(), bCompilingFunctionPreview__Offset, 1, 0, 1, 1);}
}
static UMaterialExpressionFunctionInput()
{
IntPtr NativeClassPtr=GetNativeClassFromName("MaterialExpressionFunctionInput");
Preview__Offset=GetPropertyOffset(NativeClassPtr,"Preview");
InputName__Offset=GetPropertyOffset(NativeClassPtr,"InputName");
Description__Offset=GetPropertyOffset(NativeClassPtr,"Description");
Id__Offset=GetPropertyOffset(NativeClassPtr,"Id");
InputType__Offset=GetPropertyOffset(NativeClassPtr,"InputType");
PreviewValue__Offset=GetPropertyOffset(NativeClassPtr,"PreviewValue");
bUsePreviewValueAsDefault__Offset=GetPropertyOffset(NativeClassPtr,"bUsePreviewValueAsDefault");
SortPriority__Offset=GetPropertyOffset(NativeClassPtr,"SortPriority");
bCompilingFunctionPreview__Offset=GetPropertyOffset(NativeClassPtr,"bCompilingFunctionPreview");
}
}
}
#endif
#endif
| 40.391304 | 151 | 0.763402 | [
"MIT"
] | RobertAcksel/UnrealCS | Engine/Plugins/UnrealCS/UECSharpDomain/UnrealEngine/GeneratedScriptFile_Editor_64bits/UMaterialExpressionFunctionInput_FixSize.cs | 4,645 | C# |
#region License, Terms and Conditions
//
// PaymentProfileAttributes.cs
//
// Authors: Kori Francis <twitter.com/djbyter>, David Ball
// Copyright (C) 2010 Clinical Support Systems, Inc. All rights reserved.
//
// THIS FILE IS LICENSED UNDER THE MIT LICENSE AS OUTLINED IMMEDIATELY BELOW:
//
// 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 ChargifyNET
{
#region Imports
using System;
using System.Diagnostics;
#endregion
/// <summary>
/// Class which can be used to "import" subscriptions via the API into Chargify
/// Info here: http://support.chargify.com/faqs/api/api-subscription-and-stored-card-token-imports
/// </summary>
[DebuggerDisplay("VaultToken: {VaultToken}, CustomerVaultToken: {CustomerVaultToken}")]
public class PaymentProfileAttributes : ChargifyBase, IPaymentProfileAttributes, IComparable<PaymentProfileAttributes>
{
#region Constructor
/// <summary>
/// Class which can be used to "import" subscriptions via the API into Chargify
/// </summary>
public PaymentProfileAttributes() : base() { /* Nothing */ }
/// <summary>
/// Class which can be used to "import" subscriptions via the API into Chargify
/// </summary>
/// <param name="VaultToken">The "token" provided by your vault storage for an already stored payment profile</param>
/// <param name="CustomerVaultToken">The "customerProfileId" for the owner of the "customerPaymentProfileId" provided as the VaultToken</param>
/// <param name="CurrentVault">The vault that stores the payment profile with the provided VaultToken</param>
/// <param name="ExpYear">The year of expiration</param>
/// <param name="ExpMonth">The month of expiration</param>
/// <param name="CardType">If you know the card type, you may supply it here so that Chargify may display it in the AdminUI</param>
/// <param name="LastFourDigits">The last four digits of the credit card for use in masked numbers</param>
public PaymentProfileAttributes(string VaultToken, string CustomerVaultToken, VaultType CurrentVault, int ExpYear, int ExpMonth, CardType CardType, string LastFourDigits) : base()
{
this._vaultToken = VaultToken;
this._customerVaultToken = CustomerVaultToken;
this._currentVault = CurrentVault;
this._expirationYear = ExpYear;
this._expirationMonth = ExpMonth;
this._cardType = CardType;
this._lastFour = LastFourDigits;
}
#endregion
#region IPaymentProfileAttributes Members
/// <summary>
/// The "token" provided by your vault storage for an already stored payment profile
/// </summary>
public string VaultToken
{
get { return _vaultToken; }
set { if (_vaultToken != value) _vaultToken = value; }
}
private string _vaultToken = string.Empty;
/// <summary>
/// (Only for Authorize.NET CIM storage) The "customerProfileId" for the owner of the
/// "customerPaymentProfileId" provided as the VaultToken
/// </summary>
public string CustomerVaultToken
{
get { return _customerVaultToken; }
set { if (_customerVaultToken != value) _customerVaultToken = value; }
}
private string _customerVaultToken = string.Empty;
/// <summary>
/// The vault that stores the payment profile with the provided VaultToken
/// </summary>
public VaultType CurrentVault
{
get { return _currentVault; }
set { if (_currentVault != value) _currentVault = value; }
}
private VaultType _currentVault = VaultType.Unknown;
/// <summary>
/// The year of expiration
/// </summary>
public int ExpirationYear
{
get { return _expirationYear; }
set { if (_expirationYear != value) _expirationYear = value; }
}
private int _expirationYear = int.MinValue;
/// <summary>
/// The month of expiration
/// </summary>
public int ExpirationMonth
{
get { return _expirationMonth; }
set { if (_expirationMonth != value) _expirationMonth = value; }
}
private int _expirationMonth = int.MinValue;
/// <summary>
/// (Optional) If you know the card type, you may supply it here so that we may display
/// the card type in the UI.
/// </summary>
public CardType CardType
{
get { return _cardType; }
set { if (_cardType != value) _cardType = value; }
}
private CardType _cardType = CardType.Unknown;
/// <summary>
/// (Optional) If you have the last 4 digits of the credit card number, you may supply
/// them here so we may create a masked card number for display in the UI
/// </summary>
public string LastFour
{
get { return _lastFour; }
set { if (_lastFour != value) _lastFour = value; }
}
private string _lastFour = string.Empty;
/// <summary>
/// The name of the bank where the customer's account resides
/// </summary>
public string BankName
{
get { return _bankName; }
set { if (_bankName != value) _bankName = value; }
}
private string _bankName = string.Empty;
/// <summary>
/// The routing number of the bank
/// </summary>
public string BankRoutingNumber
{
get { return _bankRoutingNumber; }
set { if (_bankRoutingNumber != value) _bankRoutingNumber = value; }
}
private string _bankRoutingNumber = string.Empty;
/// <summary>
/// The customer's bank account number
/// </summary>
public string BankAccountNumber
{
get { return _bankAccountNumber; }
set { if (_bankAccountNumber != value) _bankAccountNumber = value; }
}
private string _bankAccountNumber = string.Empty;
/// <summary>
/// Either checking or savings
/// </summary>
public BankAccountType BankAccountType
{
get { return _bankAccountType; }
set { if (_bankAccountType != value) _bankAccountType = value; }
}
private BankAccountType _bankAccountType = BankAccountType.Unknown;
/// <summary>
/// Either personal or business
/// </summary>
public BankAccountHolderType BankAccountHolderType
{
get { return _bankAccountHolderType; }
set { if (_bankAccountHolderType != value) _bankAccountHolderType = value; }
}
private BankAccountHolderType _bankAccountHolderType = BankAccountHolderType.Unknown;
#endregion
#region IComparable<IPaymentProfileAttributes> Members
/// <summary>
/// Method for comparing one IPaymentProfileAttributes to another (by vault token)
/// </summary>
/// <param name="other">The other IPaymentProfileAttributes to compare with</param>
/// <returns>The result of the comparison</returns>
public int CompareTo(IPaymentProfileAttributes other)
{
return this.VaultToken.CompareTo(other.VaultToken);
}
#endregion
#region IComparable<PaymentProfileAttributes> Members
/// <summary>
/// Method for comparing one PaymentProfileAttributes to another (by vault token)
/// </summary>
/// <param name="other">The other PaymentProfileAttributes to compare with</param>
/// <returns>The result of the comparison</returns>
public int CompareTo(PaymentProfileAttributes other)
{
return this.VaultToken.CompareTo(other.VaultToken);
}
#endregion
}
}
| 39.947368 | 188 | 0.631094 | [
"MIT"
] | Brushfire/chargify-dot-net | Source/Chargify.NET/PaymentProfileAttributes.cs | 9,110 | C# |
using System;
namespace nyom.domain.core.MongoDb.Repository.Interface
{
public interface IEntity
{
Guid Id { get; set; }
}
} | 14.555556 | 55 | 0.717557 | [
"MIT"
] | hdrezei/dotnetcore-rabbitmq | nyom/nyom.domain.core/MongoDb/Repository/Interface/IEntity.cs | 133 | C# |
using UnityEngine;
namespace ScriptableObjectArchitecture
{
[CreateAssetMenu(menuName = "SO Architecture/Variable/Constant/Vector2")]
public class ConstVector2 : ConstVariable<Vector2> { }
}
| 25.125 | 77 | 0.776119 | [
"MIT"
] | mfragger/ScriptableObjectArchitecture | Runtime/ConstantCommonTypes/ConstVector2.cs | 203 | C# |
using UnityEngine;
using System.Collections;
using TMPro;
public class EnvMapAnimator : MonoBehaviour {
//private Vector3 TranslationSpeeds;
public Vector3 RotationSpeeds;
private TMP_Text m_textMeshPro;
private Material m_material;
void Awake()
{
//Debug.Log("Awake() on Script called.");
m_textMeshPro = GetComponent<TMP_Text>();
m_material = m_textMeshPro.fontSharedMaterial;
}
// Use this for initialization
IEnumerator Start ()
{
Matrix4x4 matrix = new Matrix4x4();
while (true)
{
//matrix.SetTRS(new Vector3 (Time.time * TranslationSpeeds.x, Time.time * TranslationSpeeds.y, Time.time * TranslationSpeeds.z), Quaternion.Euler(Time.time * RotationSpeeds.x, Time.time * RotationSpeeds.y , Time.time * RotationSpeeds.z), Vector3.one);
matrix.SetTRS(Vector3.zero, Quaternion.Euler(Time.time * RotationSpeeds.x, Time.time * RotationSpeeds.y , Time.time * RotationSpeeds.z), Vector3.one);
m_material.SetMatrix("_EnvMatrix", matrix);
yield return null;
}
}
}
| 32.166667 | 264 | 0.642487 | [
"Apache-2.0"
] | 0ReC0/ArFoundationTestProject | Assets/TextMesh Pro/Examples & Extras/Scripts/EnvMapAnimator.cs | 1,160 | C# |
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Net.Http;
using System.Net.Http.Json;
using System.Threading.Tasks;
using BlazorApp.Extensions;
using BlazorApp.ViewModels.DepartmentsViewModels;
using Microsoft.AspNetCore.Mvc.Rendering;
using TanvirArjel.Extensions.Microsoft.DependencyInjection;
namespace BlazorApp.Services
{
[SingletonService]
public class DepartmentService
{
private readonly HttpClient _httpClient;
[SuppressMessage("Design", "CA1062:Validate arguments of public methods", Justification = "Not applicable for constructor")]
public DepartmentService(IHttpClientFactory httpClientFactory)
{
_httpClient = httpClientFactory.CreateClient("EmployeeManagementApi");
}
public async Task<List<DepartmentDetailsViewModel>> GetListAsync()
{
List<DepartmentDetailsViewModel> departments = await _httpClient.GetFromJsonAsync<List<DepartmentDetailsViewModel>>("v1/departments");
return departments;
}
public async Task<List<SelectListItem>> GetSelectListAsync(int? selectedDepartment = null)
{
List<SelectListItem> departments = await _httpClient
.GetFromJsonAsync<List<SelectListItem>>($"v1/departments/select-list?selectedDepartment={selectedDepartment}");
return departments;
}
public async Task<HttpResponseMessage> CreateAsync(CreateDepartmentViewModel createDepartmentViewModel)
{
createDepartmentViewModel.ThrowIfNull(nameof(createDepartmentViewModel));
HttpResponseMessage response = await _httpClient.PostAsJsonAsync("v1/departments", createDepartmentViewModel);
return response;
}
public async Task<DepartmentDetailsViewModel> GetByIdAsync(int departmentId)
{
departmentId.ThrowIfNotPositive(nameof(departmentId));
DepartmentDetailsViewModel response = await _httpClient.GetFromJsonAsync<DepartmentDetailsViewModel>($"v1/departments/{departmentId}");
return response;
}
public async Task<HttpResponseMessage> UpdateAsync(UpdateDepartmentViewModel updateDepartmentViewModel)
{
updateDepartmentViewModel.ThrowIfNull(nameof(updateDepartmentViewModel));
HttpResponseMessage response = await _httpClient
.PutAsJsonAsync($"v1/departments/{updateDepartmentViewModel.DepartmentId}", updateDepartmentViewModel);
return response;
}
public async Task<HttpResponseMessage> DeleteAsync(int departmentId)
{
departmentId.ThrowIfNotPositive(nameof(departmentId));
HttpResponseMessage response = await _httpClient.DeleteAsync($"v1/departments/{departmentId}");
return response;
}
}
}
| 39.902778 | 147 | 0.717021 | [
"MIT"
] | nagurshaik-git/CleanArchitecture | src/ClientApps/BlazorApp/Services/DepartmentService.cs | 2,875 | C# |
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Generated code. DO NOT EDIT!
namespace Testing.Deprecated.Snippets
{
// [START deprecated_generated_Deprecated_DeprecatedMessageMethod_sync]
using Testing.Deprecated;
public sealed partial class GeneratedDeprecatedClientSnippets
{
/// <summary>Snippet for DeprecatedMessageMethod</summary>
/// <remarks>
/// This snippet has been automatically generated for illustrative purposes only.
/// It may require modifications to work in your environment.
/// </remarks>
public void DeprecatedMessageMethodRequestObject()
{
// Create client
DeprecatedClient deprecatedClient = DeprecatedClient.Create();
// Initialize request argument(s)
#pragma warning disable CS0612
DeprecatedMessageRequest request = new DeprecatedMessageRequest { };
#pragma warning restore CS0612
// Make the request
#pragma warning disable CS0612
Response response = deprecatedClient.DeprecatedMessageMethod(request);
#pragma warning restore CS0612
}
}
// [END deprecated_generated_Deprecated_DeprecatedMessageMethod_sync]
}
| 38.777778 | 89 | 0.718625 | [
"Apache-2.0"
] | LaudateCorpus1/gapic-generator-csharp | Google.Api.Generator.Tests/ProtoTests/Deprecated/Testing.Deprecated.GeneratedSnippets/DeprecatedClient.DeprecatedMessageMethodRequestObjectSnippet.g.cs | 1,747 | C# |
using System ;
using System.Diagnostics.CodeAnalysis ;
using System.Reactive.Subjects ;
using Windows.Devices.Bluetooth ;
using Autofac.Extras.DynamicProxy ;
using Idasen.Aop.Aspects ;
using Idasen.BluetoothLE.Core.Interfaces.ServicesDiscovery ;
using Idasen.BluetoothLE.Core.Interfaces.ServicesDiscovery.Wrappers ;
using Serilog ;
namespace Idasen.BluetoothLE.Core.ServicesDiscovery.Wrappers
{
/// <inheritdoc />
[ ExcludeFromCodeCoverage ]
[ Intercept ( typeof ( LogAspect ) ) ]
public class BluetoothLeDeviceWrapperFactory
: IBluetoothLeDeviceWrapperFactory
{
[ SuppressMessage ( "NDepend" ,
"ND1004:AvoidMethodsWithTooManyParameters" ,
Justification = "The factory hides a real BluetoothLe device behind an interface." ) ]
public BluetoothLeDeviceWrapperFactory (
[ NotNull ] ILogger logger ,
[ NotNull ] IGattServicesProviderFactory providerFactory ,
[ NotNull ] IGattDeviceServicesResultWrapperFactory servicesFactory ,
[ NotNull ] Func < IGattServicesDictionary > gattServicesDictionaryFactory ,
[ NotNull ] IGattCharacteristicsResultWrapperFactory characteristicsFactory ,
[ NotNull ] Func < ISubject < BluetoothConnectionStatus > > connectionStatusChangedFactory ,
[ NotNull ] BluetoothLeDeviceWrapper.Factory factory )
{
Guard.ArgumentNotNull ( logger ,
nameof ( logger ) ) ;
Guard.ArgumentNotNull ( providerFactory ,
nameof ( providerFactory ) ) ;
Guard.ArgumentNotNull ( servicesFactory ,
nameof ( servicesFactory ) ) ;
Guard.ArgumentNotNull ( gattServicesDictionaryFactory ,
nameof ( gattServicesDictionaryFactory ) ) ;
Guard.ArgumentNotNull ( characteristicsFactory ,
nameof ( characteristicsFactory ) ) ;
Guard.ArgumentNotNull ( connectionStatusChangedFactory ,
nameof ( connectionStatusChangedFactory ) ) ;
Guard.ArgumentNotNull ( factory ,
nameof ( factory ) ) ;
_logger = logger ;
_providerFactory = providerFactory ;
_servicesFactory = servicesFactory ;
_gattServicesDictionaryFactory = gattServicesDictionaryFactory ;
_characteristicsFactory = characteristicsFactory ;
_connectionStatusChangedFactory = connectionStatusChangedFactory ;
_factory = factory ;
}
/// <inheritdoc />
public IBluetoothLeDeviceWrapper Create ( BluetoothLEDevice device )
{
return _factory ( _logger ,
_providerFactory ,
_servicesFactory ,
_gattServicesDictionaryFactory ( ) ,
_characteristicsFactory ,
_connectionStatusChangedFactory ( ) ,
device ) ;
}
private readonly IGattCharacteristicsResultWrapperFactory _characteristicsFactory ;
private readonly Func < ISubject < BluetoothConnectionStatus > > _connectionStatusChangedFactory ;
private readonly BluetoothLeDeviceWrapper.Factory _factory ;
private readonly Func < IGattServicesDictionary > _gattServicesDictionaryFactory ;
private readonly ILogger _logger ;
private readonly IGattServicesProviderFactory _providerFactory ;
private readonly IGattDeviceServicesResultWrapperFactory _servicesFactory ;
}
} | 54.106667 | 114 | 0.579842 | [
"MIT"
] | 7orlum/idasen-desk | src/Idasen.BluetoothLE.Core/ServicesDiscovery/Wrappers/BluetoothLeDeviceWrapperFactory.cs | 4,060 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace KeplerBI.DB.Repositories
{
public class CelesticalBodySystemsCo : KeplerBI.Repositories.ICelesticslBodySystemsCo
{
KeplerDBContext _ctx;
public CelesticalBodySystemsCo(KeplerDBContext ctx)
{
_ctx = ctx;
}
public bool ExistsBo(KeplerBI.NaturalCelesticalBodies.INaturalCelesticalBody id)
{
return _ctx.CelesticalBodySystems.Any(r => r.CentralBody.Name == id.Name);
}
public ICelesticalBodySystem GetBo(KeplerBI.NaturalCelesticalBodies.INaturalCelesticalBody id)
{
return _ctx.CelesticalBodySystems.First(r => r.CentralBody.Name == id.Name);
}
}
}
| 28.678571 | 102 | 0.688667 | [
"MIT"
] | mk-prg-net/KeplerDB | KeplerBI.DB/Repositories/CelesticalBodySystemsCo.cs | 805 | C# |
// Copyright 2021-2022 The SeedV Lab.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using System.Collections;
using UnityEngine;
using UnityEngine.UI;
namespace SeedAvatar {
public class FpsViewport : MonoBehaviour {
public int HighLevel = 20;
public int LowLevel = 15;
public Color HighColor = Color.green;
public Color MiddleColor = Color.yellow;
public Color LowColor = Color.red;
private int _frameCount = 0;
private Text _fpsLabel;
void Start() {
_fpsLabel = GetComponent<Text>();
StartCoroutine(Loop());
}
void Update() {
++_frameCount;
}
private IEnumerator Loop() {
while (true) {
yield return new WaitForSeconds(1);
int fps = _frameCount;
_fpsLabel.text = $"fps: {fps}";
_fpsLabel.color = fps >= HighLevel ? HighColor : (fps > LowLevel ? MiddleColor : LowColor);
_frameCount = 0;
}
}
}
}
| 29.387755 | 99 | 0.674306 | [
"Apache-2.0"
] | SeedV/SeedAvatarStudio | Assets/Src/Scripts/SeedAvatar/UI/FpsViewport.cs | 1,440 | 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.Azure.Management.DevTestLabs.Models
{
using System;
using System.Linq;
using System.Collections.Generic;
using Newtonsoft.Json;
using Microsoft.Rest;
using Microsoft.Rest.Serialization;
using Microsoft.Rest.Azure;
/// <summary>
/// Profile of a lab user.
/// </summary>
[JsonTransformation]
public partial class User : Resource
{
/// <summary>
/// Initializes a new instance of the User class.
/// </summary>
public User() { }
/// <summary>
/// Initializes a new instance of the User class.
/// </summary>
public User(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary<string, string> tags = default(IDictionary<string, string>), UserIdentity identity = default(UserIdentity), UserSecretStore secretStore = default(UserSecretStore), DateTime? createdDate = default(DateTime?), string provisioningState = default(string), string uniqueIdentifier = default(string))
: base(id, name, type, location, tags)
{
Identity = identity;
SecretStore = secretStore;
CreatedDate = createdDate;
ProvisioningState = provisioningState;
UniqueIdentifier = uniqueIdentifier;
}
/// <summary>
/// The identity of the user.
/// </summary>
[JsonProperty(PropertyName = "properties.identity")]
public UserIdentity Identity { get; set; }
/// <summary>
/// The secret store of the user.
/// </summary>
[JsonProperty(PropertyName = "properties.secretStore")]
public UserSecretStore SecretStore { get; set; }
/// <summary>
/// The creation date of the user profile.
/// </summary>
[JsonProperty(PropertyName = "properties.createdDate")]
public DateTime? CreatedDate { get; private set; }
/// <summary>
/// The provisioning status of the resource.
/// </summary>
[JsonProperty(PropertyName = "properties.provisioningState")]
public string ProvisioningState { get; set; }
/// <summary>
/// The unique immutable identifier of a resource (Guid).
/// </summary>
[JsonProperty(PropertyName = "properties.uniqueIdentifier")]
public string UniqueIdentifier { get; set; }
}
}
| 37.106667 | 452 | 0.633848 | [
"MIT"
] | 216Giorgiy/azure-sdk-for-net | src/SDKs/DevTestLabs/Management.DevTestLabs/Generated/Models/User.cs | 2,783 | C# |
using System;
namespace Shopping.Domain.Events
{
public class ItemRemovedFromShoppingCart : IDomainEvent
{
public const string EventName = "ItemRemovedFromShoppingCart";
public ItemRemovedFromShoppingCart(Guid id, Guid cartId)
{
Id = id;
CartId = cartId;
}
public Guid Id { get; }
public Guid CartId { get; }
}
} | 22.222222 | 70 | 0.605 | [
"MIT"
] | JohnCgp/domain-blocks | src/Examples/Shopping.Events/ItemRemovedFromShoppingCart.cs | 402 | C# |
/*
* Copyright (C) Sportradar AG. See LICENSE for full license governing this code
*/
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using Sportradar.OddsFeed.SDK.Messages.Internal.REST;
namespace Sportradar.OddsFeed.SDK.Entities.REST.Internal.DTO
{
/// <summary>
/// A data-transfer-object for tournament season
/// </summary>
public class TournamentSeasonsDTO
{
/// <summary>
/// Gets the tournament
/// </summary>
/// <value>The tournament</value>
public TournamentInfoDTO Tournament { get; }
/// <summary>
/// Gets the seasons
/// </summary>
/// <value>The seasons</value>
public IEnumerable<SeasonDTO> Seasons { get; }
/// <summary>
/// Initializes a new instance of the <see cref="TournamentSeasonsDTO"/> class
/// </summary>
/// <param name="item">The item</param>
internal TournamentSeasonsDTO(tournamentSeasons item)
{
Contract.Requires(item != null);
Tournament = new TournamentInfoDTO(item.tournament);
if (item.seasons != null && item.seasons.Any())
{
Seasons = item.seasons.Select(s => new SeasonDTO(s));
}
}
}
}
| 29.111111 | 86 | 0.594656 | [
"Apache-2.0"
] | Furti87/UnifiedOddsSdkNet | src/Sportradar.OddsFeed.SDK.Entities.REST/Internal/DTO/TournamentSeasonsDTO.cs | 1,312 | C# |
namespace SPNATI_Character_Editor.Controls.EditControls.VariableControls
{
partial class CategoryControl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.cboOperator = new Desktop.Skinning.SkinnedComboBox();
this.recCategory = new Desktop.CommonControls.RecordField();
this.SuspendLayout();
//
// cboOperator
//
this.cboOperator.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.None;
this.cboOperator.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.None;
this.cboOperator.BackColor = System.Drawing.Color.White;
this.cboOperator.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cboOperator.FieldType = Desktop.Skinning.SkinnedFieldType.Surface;
this.cboOperator.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.cboOperator.FormattingEnabled = true;
this.cboOperator.Location = new System.Drawing.Point(148, 0);
this.cboOperator.Name = "cboOperator";
this.cboOperator.SelectedIndex = -1;
this.cboOperator.SelectedItem = null;
this.cboOperator.Size = new System.Drawing.Size(44, 21);
this.cboOperator.Sorted = false;
this.cboOperator.TabIndex = 13;
//
// recCategory
//
this.recCategory.AllowCreate = false;
this.recCategory.Location = new System.Drawing.Point(198, 0);
this.recCategory.Name = "recCategory";
this.recCategory.PlaceholderText = null;
this.recCategory.Record = null;
this.recCategory.RecordContext = null;
this.recCategory.RecordFilter = null;
this.recCategory.RecordKey = null;
this.recCategory.RecordType = null;
this.recCategory.Size = new System.Drawing.Size(135, 20);
this.recCategory.TabIndex = 14;
this.recCategory.UseAutoComplete = false;
//
// CategoryControl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.recCategory);
this.Controls.Add(this.cboOperator);
this.Name = "CategoryControl";
this.Controls.SetChildIndex(this.cboOperator, 0);
this.Controls.SetChildIndex(this.recCategory, 0);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private Desktop.Skinning.SkinnedComboBox cboOperator;
private Desktop.CommonControls.RecordField recCategory;
}
}
| 34.241379 | 101 | 0.729439 | [
"MIT"
] | laytonc32/spnati | editor source/SPNATI Character Editor/Controls/EditControls/VariableControls/CategoryControl.Designer.cs | 2,981 | C# |
using AuthServer.Core.Provider;
using AuthServer.Core.Request;
using AuthServer.Core.Response;
namespace AuthServer.Core.Handler
{
public class StatusRequestHandler : IRequestHandler
{
private IUserProvider userProvider;
public StatusRequestHandler(IUserProvider userProvider)
{
this.userProvider = userProvider;
}
public bool CanHandle(IRequest request)
{
return request is StatusRequest;
}
public IResponse Handle(IRequest request)
{
var statusRequest = request as StatusRequest;
var response = new StatusResponse();
foreach(var username in statusRequest.Users)
{
response.Users.Add(username, FromUser(userProvider.GetInformation(username)));
}
return response;
}
private UserStatusResponse FromUser(User user)
{
if (user == null)
{
return null;
}
return new UserStatusResponse
{
IsActive = user.IsActive,
Username = user.Username,
Firstname = user.Firstname,
Lastname = user.Lastname,
DisplayName = user.DisplayName,
UniqueId = user.UniqueId,
OU = user.OU,
Email = user.Email,
Groups = user.Groups
};
}
}
}
| 25.534483 | 94 | 0.542201 | [
"MIT"
] | SchulIT/adauth-server | AuthServer.Core/Handler/StatusRequestHandler.cs | 1,483 | C# |
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
namespace Lab2INotifyProperyChanged
{
public sealed partial class MainPage : Page
{
//create Data Model
public Adder calc = new Adder();
public MainPage()
{
//give the page a data context
this.InitializeComponent();
DataContext = calc; // give the page a data context
//因为Adder继承了INotifyPropertyChanged,所以DataContext = cals;
}
private void btnChange_Click(object sender, RoutedEventArgs e)
{
// add code to change Arg1 and Arg2 in the background
// then update the screen automatically. Use a button
calc.Arg1 = 110;
calc.Arg2 = 200;
}
private void tblAnswer_TextChanged(object sender, TextChangedEventArgs e)
{
}
}
public class Adder : INotifyPropertyChanged //Adder继承了INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
private int arg1;
public int Arg1
{
get { return arg1; }
set
{
arg1 = value;
if (PropertyChanged != null)
{
//raise the property changed event handler
PropertyChanged(this, new PropertyChangedEventArgs("AnswerValue"));
}
}
}
//need arg2 copy arg1 change the value to arg2
private int arg2;
public int Arg2
{
get { return arg2; }
set
{
arg2 = value;
if (PropertyChanged != null)
{
//raise the property changed event handler
PropertyChanged(this, new PropertyChangedEventArgs("AnswerValue"));
}
}
}
// need AnswerValue
public int AnswerValue
{
get { return arg1 + arg2; }
}
}
}
| 30.806818 | 106 | 0.543342 | [
"Apache-2.0"
] | w326004741/MobileApps-3-Labs | Lab2-INotifyProperyChanged/Lab2-INotifyProperyChanged/MainPage.xaml.cs | 2,735 | C# |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.